/[ascend]/trunk/models/simpleflowsheet01mass.a4c
ViewVC logotype

Contents of /trunk/models/simpleflowsheet01mass.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 457 - (show annotations) (download) (as text)
Wed Apr 5 14:19:41 2006 UTC (18 years, 2 months ago) by aw0a
File MIME type: text/x-ascend
File size: 3139 byte(s)
modified 2_cis_hexene data in components.a4l, updated simpleflowsheetrigorous.a4c
1 REQUIRE "simpleflowsheet01.a4c";
2 (* => simpleflowsheet01.a4c, atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *)
3 PROVIDE "simpleflowsheet01mass.a4c";
4 (*
5 * This file is part of the ASCEND Modeling Library and is released
6 * under the GNU Public License as described at the end of this file.
7 *
8 * Use of this module is demonstrated by the associated script file
9 * simpleflowsheet01cost.a4s.
10 *)
11
12 UNIVERSAL MODEL stream_parameters;
13
14 components IS_A set OF symbol_constant;
15 MW[components] IS_A molar_weight_constant;
16 SpGr[components] IS_A factor_constant;
17
18 END stream_parameters;
19
20
21 MODEL mod_mixture REFINES mixture;
22
23 sp IS_A stream_parameters;
24 MW_ave IS_A molar_mass;
25 SpGr_ave IS_A factor;
26
27 sp.components,
28 components ARE_THE_SAME;
29
30 yw[components],
31 yv_liq[components] IS_A fraction;
32
33
34 sp.MW['A'] :== 50{g/mol};
35 sp.MW['B'] :== 120{g/mol};
36 sp.MW['C'] :== 120{g/mol};
37
38 sp.SpGr['A'] :== 0.8;
39 sp.SpGr['B'] :== 0.8;
40 sp.SpGr['C'] :== 0.8;
41
42 FOR i IN components CREATE
43 yw_def[i]: yw[i]*MW_ave = y[i]*sp.MW[i];
44 END FOR;
45
46 FOR i IN components CREATE
47 yv_liq_def[i]: yv_liq[i]*sp.SpGr[i] = yw[i]*SpGr_ave;
48 END FOR;
49
50 sum_yw: SUM[yw[components]] = 1.0;
51 sum_yv_liq: SUM[yv_liq[components]] = 1.0;
52
53
54 METHODS
55
56 METHOD default_self;
57 END default_self;
58
59 METHOD specify;
60 RUN ClearAll;
61 y[components].fixed := TRUE;
62 y[CHOICE[components]].fixed := FALSE;
63 END specify;
64
65 END mod_mixture;
66
67
68 MODEL mod_stream REFINES molar_stream;
69
70 Wtot,w[components] IS_A mass_rate;
71 Vtot_liq,v_liq[components] IS_A volume_rate;
72
73 state IS_REFINED_TO mod_mixture;
74 state.components,
75 components ARE_THE_SAME;
76
77 Wtot_def: Wtot = Ftot*state.MW_ave;
78 Vtot_liq_def: Vtot_liq = Wtot/state.SpGr_ave;
79
80 FOR i IN components CREATE
81 w_def[i]: w[i] = state.yw[i]*Wtot;
82 END FOR;
83
84 FOR i IN components CREATE
85 v_liq_def[i]: v_liq[i] = state.yv_liq[i]*Vtot_liq;
86 END FOR;
87
88 METHODS
89
90 METHOD default_self;
91 END default_self;
92
93 METHOD specify;
94 RUN ClearAll;
95 f[components].fixed := TRUE;
96 END specify;
97
98 END mod_stream;
99
100
101 (*
102 * simpleflowsheet01mass.a4c
103 * by Arthur W. Westerberg
104 * Part of the ASCEND Library
105 * $Date: 2006/03/03 10:45:21 $
106 *
107 * This file is part of the ASCEND Modeling Library.
108 *
109 * Copyright (C) 1994-1998 Carnegie Mellon University
110 *
111 * The ASCEND Modeling Library is free software; you can redistribute
112 * it and/or modify it under the terms of the GNU General Public
113 * License as published by the Free Software Foundation; either
114 * version 2 of the License, or (at your option) any later version.
115 *
116 * The ASCEND Modeling Library is distributed in hope that it will be
117 * useful, but WITHOUT ANY WARRANTY; without even the implied
118 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
119 * See the GNU General Public License for more details.
120 *
121 * You should have received a copy of the GNU General Public License
122 * along with the program; if not, write to the Free Software
123 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
124 * the file named COPYING.
125 *)

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22