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

Contents of /trunk/models/simpleflowsheet01mass.a4c

Parent Directory Parent Directory | Revision Log Revision Log


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

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