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

Annotation of /trunk/models/dyn_separation_demos.a4s

Parent Directory Parent Directory | Revision Log Revision Log


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

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