/[ascend]/trunk/models/dyn_separation_demos.a4s
ViewVC logotype

Contents of /trunk/models/dyn_separation_demos.a4s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download)
Fri Oct 29 20:54:12 2004 UTC (19 years, 7 months ago) by aw0a
File size: 8432 byte(s)
Setting up web subdirectory in repository
1 # This file is part of the ASCEND Modeling Library and is released
2 # under the GNU Public License as described at the end of this file.
3 #
4 # This file demonstrates the use of dyn_column.a4l
5
6 DELETE TYPES;
7 READ FILE "dyn_column.a4l";
8 source "$env(ASCENDDIST)/models/set_intervals.tcl";
9
10 #Vapor liquid flash.
11 COMPILE tvlf OF test_vapor_liquid_flash;
12 BROWSE {tvlf};
13 ASSIGN tvlf.equilibrated FALSE;
14 RUN {tvlf.values};
15 RUN {tvlf.reset};
16 SOLVE {tvlf} WITH QRSlv;
17 RUN {tvlf.check_self};
18 ASSIGN tvlf.dynamic TRUE;
19 RUN {tvlf.fl1.seqmod};
20 RUN {tvlf.fl1.set_ode};
21 RUN {tvlf.fl1.set_obs};
22 set_int 100 1 {s};
23 ASSIGN {tvlf.feed.f['water']} 0.025 {kmol/s};
24 INTEGRATE tvlf FROM 0 TO 99 WITH BLSODE;
25
26 DELETE SYSTEM;
27 ASSIGN tvlf.dynamic FALSE;
28 ASSIGN tvlf.equilibrated TRUE;
29 RUN {tvlf.values};
30 RUN {tvlf.reset};
31 SOLVE {tvlf} WITH QRSlv;
32 RUN {tvlf.check_self};
33 ASSIGN tvlf.dynamic TRUE;
34 RUN {tvlf.fl1.seqmod};
35 #RUN {tvlf.fl1.set_ode};
36 #RUN {tvlf.fl1.set_obs};
37 ASSIGN tvlf.t 0 {s};
38 ASSIGN {tvlf.feed.f['water']} 0.010 {kmol/s};
39 INTEGRATE tvlf FROM 0 TO 99 WITH BLSODE;
40
41 # Single Tray
42 COMPILE tt OF test_tray;
43 BROWSE {tt};
44 ASSIGN tt.equilibrated FALSE;
45 RUN {tt.values};
46 RUN {tt.reset};
47 SOLVE {tt} WITH QRSlv;
48 RUN {tt.check_self};
49 ASSIGN tt.dynamic TRUE;
50 RUN {tt.reset};
51 RUN {tt.fl1.set_ode};
52 RUN {tt.fl1.set_obs};
53 ASSIGN {tt.vin.f['water']} 0.030 {kmol/s};
54 INTEGRATE tt FROM 0 TO 99 WITH BLSODE;
55
56 DELETE SYSTEM
57 ASSIGN tt.dynamic FALSE;
58 ASSIGN tt.equilibrated TRUE;
59 RUN {tt.values};
60 RUN {tt.reset};
61 SOLVE {tt} WITH QRSlv;
62 RUN {tt.check_self};
63 ASSIGN tt.dynamic TRUE;
64 RUN {tt.reset};
65 #RUN {tt.fl1.set_ode};
66 #RUN {tt.fl1.set_obs};
67 ASSIGN tt.t 0 {s};
68 ASSIGN {tt.vin.f['water']} 0.010 {kmol/s};
69 INTEGRATE tt FROM 0 TO 99 WITH BLSODE;
70
71 ASSIGN tt.dynamic FALSE;
72 RUN {tt.values};
73 RUN {tt.reset};
74 RUN tt.fl1.reset_to_adiabatic;
75 SOLVE {tt} WITH QRSlv;
76 RUN {tt.check_self};
77 ASSIGN tt.dynamic TRUE;
78 RUN {tt.fl1.seqmod};
79 ASSIGN tt.t 0 {s};
80 ASSIGN {tt.vin.f['water']} 0.015 {kmol/s};
81 INTEGRATE tt FROM 0 TO 99 WITH BLSODE;
82
83
84 # Feed tray with 1 V/L feed.
85 COMPILE tft OF test_feed_tray;
86 BROWSE {tft};
87 ASSIGN tft.equilibrated FALSE;
88 RUN {tft.values};
89 RUN {tft.reset};
90 SOLVE {tft} WITH QRSlv;
91 RUN {tft.check_self};
92 ASSIGN tft.dynamic TRUE;
93 RUN {tft.reset};
94 RUN {tft.fl1.set_ode};
95 RUN {tft.fl1.set_obs};
96 ASSIGN {tft.feed.f['water']} 0.030 {kmol/s};
97 INTEGRATE tft FROM 0 TO 99 WITH BLSODE;
98
99 DELETE SYSTEM;
100 ASSIGN tft.dynamic FALSE;
101 ASSIGN tft.equilibrated TRUE;
102 RUN {tft.values};
103 RUN {tft.reset};
104 SOLVE {tft} WITH QRSlv;
105 RUN {tft.check_self};
106 ASSIGN tft.dynamic TRUE;
107 RUN {tft.reset};
108 ASSIGN tft.t 0 {s};
109 ASSIGN {tft.feed.f['water']} 0.010 {kmol/s};
110 INTEGRATE tft FROM 0 TO 99 WITH BLSODE;
111
112 ASSIGN tft.dynamic FALSE;
113 RUN {tft.values};
114 RUN {tft.reset};
115 RUN {tft.fl1.reset_to_adiabatic};
116 SOLVE {tft} WITH QRSlv;
117 RUN {tft.check_self};
118 ASSIGN tft.dynamic TRUE;
119 RUN {tft.reset};
120 ASSIGN tft.t 0 {s};
121 ASSIGN {tft.feed.f['water']} 0.015 {kmol/s};
122 INTEGRATE tft FROM 0 TO 99 WITH BLSODE;
123
124 # Condenser with 1 liquid product when partial is
125 # FALSE and 1 vapor product when partial is TRUE;
126 # Both Liquid and vapor products are possible but
127 # one of the flows must be set or a ratio given.
128 COMPILE tc OF test_condenser;
129 BROWSE {tc};
130 ASSIGN tc.partial FALSE;
131 # Partial is false - this is a total condenser
132 ASSIGN tc.fl1.vap_distillate.flow 0 {mole/sec};
133 # if partial TRUE set liq_distillate.flow = 0;
134 ASSIGN tc.equilibrated FALSE;
135 RUN {tc.values};
136 RUN {tc.reset};
137 SOLVE {tc} WITH QRSlv;
138 RUN {tc.check_self};
139 ASSIGN tc.dynamic TRUE;
140 RUN tc.fl1.seqmod;
141 RUN tc.fl1.set_ode;
142 RUN tc.fl1.set_obs;
143 ASSIGN tc.t 0 {s};
144 ASSIGN {tc.vapin.f['water']} 0.025 {kmol/s};
145 INTEGRATE tc FROM 0 TO 99 WITH BLSODE;
146
147 DELETE SYSTEM;
148 ASSIGN tc.dynamic FALSE;
149 ASSIGN tc.equilibrated TRUE;
150 RUN {tc.values};
151 RUN tc.fl1.seqmod;
152 SOLVE {tc} WITH QRSlv;
153 RUN {tc.check_self};
154 ASSIGN tc.dynamic TRUE;
155 ASSIGN tc.t 0 {s};
156 ASSIGN {tc.vapin.f['water']} 0.025 {kmol/s};
157 INTEGRATE tc FROM 0 TO 99 WITH BLSODE;
158
159 # Reboiler with 1 liquid product when partial is
160 # TRUE and 1 vapor product with partial is FALSE;
161 # Both liquid an vapor products are possible if one
162 # of the follows is fixed or a ratio is given.
163
164 COMPILE tr OF test_reboiler;
165 BROWSE {tr};
166 ASSIGN tr.dynamic FALSE;
167 ASSIGN tr.partial TRUE;
168 ASSIGN tr.fl1.vap_bottom.flow 0 {mole/s};
169 ASSIGN tr.equilibrated FALSE;
170 RUN {tr.values};
171 RUN {tr.reset};
172 SOLVE {tr} WITH QRSlv;
173 RUN {tr.check_self};
174 ASSIGN tr.dynamic TRUE;
175 RUN tr.fl1.seqmod;
176 RUN tr.fl1.set_ode;
177 RUN tr.fl1.set_obs;
178 ASSIGN tr.t 0 {s};
179 ASSIGN {tr.liqin.f['water']} 0.025 {kmol/s};
180 INTEGRATE tr FROM 0 TO 99 WITH BLSODE;
181
182 DELETE SYSTEM;
183 ASSIGN tr.dynamic FALSE;
184 ASSIGN tr.equilibrated TRUE;
185 RUN {tr.values};
186 RUN {tr.reset};
187 SOLVE {tr} WITH QRSlv;
188 RUN {tr.check_self};
189 ASSIGN tr.dynamic TRUE;
190 RUN tr.fl1.seqmod;
191 ASSIGN tr.t 0 {s};
192 ASSIGN {tr.liqin.f['water']} 0.015 {kmol/s};
193 INTEGRATE tr FROM 0 TO 99 WITH BLSODE;
194
195 # Internal Tray Stack Model
196 # Stack of trays for a column
197 COMPILE tts OF test_tray_stack;
198 BROWSE {tts};
199 ASSIGN {tts.dynamic} FALSE;
200 ASSIGN {tts.equilibrated} FALSE;
201 RUN {tts.values};
202 RUN {tts.reset};
203 SOLVE {tts} WITH QRSlv;
204 RUN {tts.check_self};
205 ASSIGN {tts.dynamic} TRUE;
206 RUN {tts.fl1.seqmod};
207 RUN {tts.fl1.set_ode};
208 RUN {tts.fl1.set_obs};
209 set_int 100 1 {s};
210 ASSIGN {tts.lin.f['water']} 0.015 {kmol/s};
211 INTEGRATE tts FROM 0 TO 99 WITH BLSODE;
212
213 DELETE SYSTEM;
214 ASSIGN {tts.dynamic} FALSE;
215 ASSIGN {tts.equilibrated} TRUE;
216 RUN {tts.values};
217 RUN {tts.reset};
218 SOLVE {tts} WITH QRSlv;
219 RUN {tts.check_self};
220 ASSIGN {tts.dynamic} TRUE;
221 RUN {tts.fl1.seqmod};
222 ASSIGN {tts.t} 0 {s};
223 ASSIGN {tts.lin.f['water']} 0.025 {kmol/s};
224 INTEGRATE tts FROM 0 TO 99 WITH BLSODE;
225
226 ASSIGN {tts.dynamic} FALSE;
227 RUN {tts.values};
228 RUN {tts.fl1.reset_to_adiabatic};
229 SOLVE {tts} WITH QRSlv;
230 RUN {tts.check_self};
231 ASSIGN {tts.dynamic} TRUE;
232 RUN {tts.fl1.seqmod};
233 ASSIGN {tts.t} 0 {s};
234 ASSIGN {tts.lin.f['water']} 0.015 {kmol/s};
235 INTEGRATE tts FROM 0 TO 99 WITH BLSODE;
236
237
238
239 # Column Model
240 # Note that some of the solves in the following model
241 # may require a few more iterations than the solver
242 # gives by default, depending on the solver scaling
243 # and factorization and step control options.
244 # Just hit the Solve button again.
245 # In this model the condenser is defaulted to a total
246 # condenser and the reboiler is a partial reboiler.
247 COMPILE {tsc} OF {test_column};
248 BROWSE {tsc};
249 ASSIGN {tsc.dynamic} FALSE;
250 ASSIGN {tsc.equilibrated} FALSE;
251 #RUN {tsc.scale_all};
252 RUN {tsc.reset};
253 RUN {tsc.values};
254 SOLVE tsc WITH QRSlv;
255 RUN {tsc.check_self};
256 ASSIGN {tsc.dynamic} TRUE;
257 RUN {tsc.reset};
258 RUN {tsc.col.set_ode};
259 RUN {tsc.col.set_obs};
260 set_int 10000 1 {s};
261 ASSIGN {tsc.feed.f['n_heptane']} 0.011 {kmol/s};
262 INTEGRATE tsc FROM 0 TO 99 WITH BLSODE;
263
264 DELETE SYSTEM;
265 ASSIGN {tsc.dynamic} FALSE;
266 ASSIGN {tsc.equilibrated} TRUE;
267 RUN {tsc.values};
268 RUN {tsc.reset};
269 SOLVE tsc WITH QRSlv;
270 RUN {tsc.check_self};
271 ASSIGN {tsc.dynamic} TRUE;
272 RUN {tsc.reset};
273 ASSIGN {tsc.t} 0 {s};
274 ASSIGN {tsc.feed.f['n_heptane']} 0.009 {kmol/s};
275 INTEGRATE tsc FROM 0 TO 99 WITH BLSODE;
276
277 ASSIGN {tsc.dynamic} FALSE;
278 RUN {tsc.values};
279 RUN {tsc.reset};
280 RUN {tsc.col.reset_to_adiabatic};
281 SOLVE tsc WITH QRSlv;
282 RUN {tsc.check_self};
283 ASSIGN {tsc.dynamic} TRUE;
284 RUN {tsc.reset};
285 ASSIGN {tsc.t} 0{s};
286 ASSIGN {tsc.feed.f['n_heptane']} 0.011 {kmol/s};
287 INTEGRATE tsc FROM 0 TO 99 WITH BLSODE;
288
289 ########## dyn_separation_demos.a4s ends here ##########
290 #
291 # dyn_separation_demos.a4s
292 # by Duncan Coffey
293 # June, 1998
294 # Part of the ASCEND Library
295 # $Date: 1998/06/17 20:08:30 $
296 # $Revision: 1.3 $
297 # $Author: mthomas $
298 # $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/dyn_separation_demos.a4s,v $
299 #
300 # This file is part of the ASCEND Modeling Library.
301 #
302 # Copyright (C) 1998 Carnegie Mellon University
303 #
304 # The ASCEND Modeling Library is free software. You can redistribute
305 # it and/or modify it under the terms of the GNU General Public
306 # License as published by the Free Software Foundation---either
307 # version 2 of the License, or (at your option) any later version.
308 #
309 # The ASCEND Modeling Library is distributed in hope that it
310 # will be useful, but WITHOUT ANY WARRANTY--without even the implied
311 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
312 # See the GNU General Public License for more details.
313 #
314 # You should have received a copy of the GNU General Public License
315 # along with the program. If not, write to the Free Software
316 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
317 # the file named COPYING.

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