/[ascend]/trunk/models/dyn_column.a4l
ViewVC logotype

Annotation of /trunk/models/dyn_column.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2651 - (hide annotations) (download) (as text)
Thu Dec 13 07:29:48 2012 UTC (11 years, 6 months ago) by jpye
File MIME type: text/x-ascend
File size: 19765 byte(s)
Fixing GPL header, removing postal address (rpmlint incorrect-fsf-address)
1 johnpye 1159 (* ASCEND modelling environment
2     Copyright (C) 1998 Duncan Coffey
3     Copyright (C) 2006 Carnegie Mellon University
4    
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2, or (at your option)
8     any later version.
9    
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13     GNU General Public License for more details.
14    
15     You should have received a copy of the GNU General Public License
16 jpye 2651 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 johnpye 1159 *)
18 aw0a 1 REQUIRE "dyn_flash.a4l";
19     PROVIDE "dyn_column.a4l";
20     (*
21 johnpye 1159 by Duncan Coffey
22     *)
23 aw0a 1
24 johnpye 1159 (*-------------------------------------
25     REACTOR
26     *)
27 aw0a 1
28     MODEL tray_stack(
29     ntrays WILL_BE integer_constant;
30     vapin WILL_BE stream;
31     liqin WILL_BE stream;
32     vapout WILL_BE stream;
33     liqout WILL_BE stream;
34     t WILL_BE solver_var;
35     dynamic WILL_BE boolean;
36     ode_offset WILL_BE ode_counter;
37     obs_offset WILL_BE obs_counter;
38     )WHERE(
39     ntrays > 1;
40     liqout.state, vapout.state WILL_NOT_BE_THE_SAME;
41     vapin.state.cd, vapout.state.cd WILL_BE_THE_SAME;
42     vapin.pd.phase_indicator == 'V';
43     liqin.pd.phase_indicator == 'L';
44     vapout.pd.phase_indicator == 'V';
45     liqout.pd.phase_indicator == 'L';
46     )REFINES cmumodel;
47    
48     cd ALIASES liqout.cd;
49     pdV ALIASES vapout.pd;
50     pdL ALIASES liqout.pd;
51     equilibrated ALIASES liqout.equilibrated;
52     pdVL IS_A phases_data('VL', vapout.pd.vapor_option,
53     liqout.pd.liquid1_option, 'none');
54    
55     vap_option ALIASES vapout.pd.vapor_option;
56     liq_option ALIASES liqout.pd.liquid1_option;
57     tmp_phaseV[2..ntrays] IS_A select_mixture_type(cd, vap_option);
58     tmp_phaseL[2..ntrays] IS_A select_mixture_type(cd, liq_option);
59     FOR i IN [2..ntrays] CREATE
60     phaseV[i]['vapor'] ALIASES tmp_phaseV[i].phase;
61     phaseL[i]['liquid1'] ALIASES tmp_phaseL[i].phase;
62     END FOR;
63     FOR i IN [2..ntrays] CREATE
64     vapor_state[i] IS_A thermodynamics(cd,pdV,phaseV[i],equilibrated);
65     liquid_state[i] IS_A thermodynamics(cd,pdL,phaseL[i],equilibrated);
66     END FOR;
67     FOR i IN [2..ntrays] CREATE
68     tmp_vapor[i] IS_A detailed_stream(vapor_state[i]);
69     tmp_liquid[i] IS_A detailed_stream(liquid_state[i]);
70     END FOR;
71    
72     vapor[V_set_trays]
73     ALIASES (vapout.Details,tmp_vapor[2..ntrays],vapin.Details)
74     WHERE V_set_trays IS_A set OF integer_constant
75     WITH_VALUE (1..ntrays+1);
76    
77     liquid[L_set_trays]
78     ALIASES (liqin.Details,tmp_liquid[2..ntrays],liqout.Details)
79     WHERE L_set_trays IS_A set OF integer_constant
80     WITH_VALUE (1..ntrays+1);
81    
82     FOR i IN [1..ntrays] CREATE
83     phaseVL[i][VLphases[i]] ALIASES
84     (vapor[i].state.phase['vapor'],liquid[i+1].state.phase['liquid1'])
85     WHERE VLphases[i] IS_A set OF symbol_constant
86     WITH_VALUE ('vapor','liquid1');
87     END FOR;
88     FOR i IN [1..ntrays] CREATE
89     tray_state[i] IS_A thermodynamics(cd,pdVL,phaseVL[i],equilibrated);
90     END FOR;
91     FOR i IN [1..ntrays] CREATE
92     tray[i] IS_A detailed_tray(liquid[i], vapor[i+1], liquid[i+1],
93     vapor[i], tray_state[i], t,
94     dynamic, ode_offset, obs_offset);
95     END FOR;
96    
97     FOR i IN [1..ntrays] CREATE
98     Vol[i] ALIASES tray[i].Vol;
99     vol_liq[i] ALIASES tray[i].vol_liq;
100     vol_vap[i] ALIASES tray[i].vol_vap;
101     cmo_ratio[i] ALIASES tray[i].cmo_ratio;
102     tray_T[i] ALIASES tray[i].T;
103     tray_P[i] ALIASES tray[i].P;
104     Qin[i] ALIASES tray[i].Qin;
105     END FOR;
106    
107 johnpye 1159 METHODS
108 aw0a 1 METHOD check_self;
109     FOR i IN [2..ntrays] DO
110     IF (liquid[i].flow < 1e-4 {mole/s}) THEN
111     STOP {liquid flow to tray i dried up};
112     END IF;
113     IF (vapor[i].flow < 1e-4 {mole/s}) THEN
114     STOP {vapor flow from tray i dried up};
115     END IF;
116     END FOR;
117     IF (abs(vapin.flow+liqin.flow - vapout.flow - liqout.flow)
118     > 1.0e-4) THEN
119     STOP {stack violates overall mass-balance};
120     END IF;
121     RUN tray_state[1..ntrays].check_self;
122     END check_self;
123    
124     METHOD check_all;
125     IF (liqout.flow < 1e-4 {mole/s}) THEN
126     STOP {Liquid flow dried up in stack};
127     END IF;
128     IF (vapout.flow < 1e-4 {mole/s}) THEN
129     STOP {All vapor condensed in stack};
130     END IF;
131     IF (vapin.flow < 1e-4 {mole/s}) THEN
132     STOP {No vapin flowing to stack};
133     END IF;
134     IF (liqin.flow < 1e-4 {mole/s}) THEN
135     STOP {No liqin flowing to stack};
136     END IF;
137     RUN check_self;
138     END check_all;
139    
140     METHOD default_self;
141     RUN vapor[2..ntrays].default_self;
142     RUN liquid[2..ntrays].default_self;
143     RUN pdVL.default_self;
144     RUN phaseVL[1..ntrays][VLphases[1..ntrays]].default_self;
145     RUN tray_state[1..ntrays].default_self;
146     RUN tray[1..ntrays].default_self;
147     END default_self;
148    
149     METHOD default_all;
150     RUN vapin.default_self;
151     RUN liqin.default_self;
152     RUN vapout.default_self;
153     RUN liqout.default_self;
154     RUN default_self;
155     END default_all;
156     METHOD bound_self;
157     RUN vapor[2..ntrays].bound_self;
158     RUN liquid[1..ntrays].bound_self;
159     RUN tray_state[1..ntrays].bound_self;
160     RUN tray[1..ntrays].bound_self;
161     END bound_self;
162     METHOD bound_all;
163     RUN vapin.bound_self;
164     RUN liqin.bound_self;
165     RUN vapout.bound_self;
166     RUN liqout.bound_self;
167     RUN bound_self;
168     END bound_all;
169     METHOD scale_self;
170     RUN vapor[2..ntrays].scale_self;
171     RUN liquid[1..ntrays].scale_self;
172     RUN tray_state[1..ntrays].scale_self;
173     RUN tray[1..ntrays].scale_self;
174     END scale_self;
175     METHOD scale_all;
176     RUN vapin.scale_self;
177     RUN liqin.scale_self;
178     RUN vapout.scale_self;
179     RUN liqout.scale_self;
180     RUN scale_self;
181     END scale_all;
182     METHOD seqmod;
183     RUN tray[1..ntrays].seqmod;
184     END seqmod;
185     METHOD specify;
186     RUN vapin.specify;
187     RUN liqin.specify;
188     RUN seqmod;
189     END specify;
190     METHOD reset_to_adiabatic;
191     RUN seqmod;
192     Qin[1..ntrays] :=0 {kW};
193 johnpye 576 FREE cmo_ratio[1..ntrays];
194     FIX Qin[1..ntrays];
195 aw0a 1 END reset_to_adiabatic;
196     METHOD set_ode;
197     RUN tray[1..ntrays].set_ode;
198     END set_ode;
199     METHOD set_obs;
200     RUN tray[1..ntrays].set_obs;
201     END set_obs;
202     END tray_stack;
203    
204     MODEL column(
205     vap_distillate WILL_BE stream;
206     liq_distillate WILL_BE stream;
207     con_partial WILL_BE boolean;
208     n_trays_above WILL_BE integer_constant;
209     feed WILL_BE stream;
210     n_trays_below WILL_BE integer_constant;
211     reboil_partial WILL_BE boolean;
212     vap_bottoms WILL_BE stream;
213     liq_bottoms WILL_BE stream;
214     t WILL_BE solver_var;
215     dynamic WILL_BE boolean;
216     ode_offset WILL_BE ode_counter;
217     obs_offset WILL_BE obs_counter;
218     )WHERE(
219     n_trays_above > 1;
220     n_trays_below > 1;
221     feed.state, vap_bottoms.state, vap_distillate.state,
222     liq_bottoms.state, liq_distillate.state WILL_NOT_BE_THE_SAME;
223     feed.state.cd, vap_distillate.state.cd, vap_bottoms.state.cd,
224     liq_distillate.state.cd, liq_bottoms.state.cd WILL_BE_THE_SAME;
225     (feed.pd.phase_indicator IN ['V','L','VL','VLL']) == TRUE;
226     liq_bottoms.pd.phase_indicator == 'L';
227     vap_bottoms.pd.phase_indicator == 'V';
228     liq_distillate.pd.phase_indicator == 'L';
229     vap_distillate.pd.phase_indicator == 'V';
230     )REFINES cmumodel;
231    
232     cd ALIASES feed.cd;
233     pdV ALIASES vap_distillate.pd;
234     pdL ALIASES liq_distillate.pd;
235     equilibrated ALIASES vap_distillate.equilibrated;
236    
237     tray_P[tmp1] ALIASES (top_stack.tray_P[1..n_trays_above],feed_tray.P,
238     bottom_stack.tray_P[1..n_trays_below]) WHERE tmp1 IS_A set OF integer_constant
239     WITH_VALUE (1..n_trays_above+n_trays_below+1);
240     tray_T[tmp2] ALIASES (top_stack.tray_T[1..n_trays_above],feed_tray.T,
241     bottom_stack.tray_T[1..n_trays_below]) WHERE tmp2 IS_A set OF integer_constant
242     WITH_VALUE (1..n_trays_above+n_trays_below+1);
243     cmo_ratio[tmp3] ALIASES (top_stack.cmo_ratio[1..n_trays_above],feed_tray.q,
244     bottom_stack.cmo_ratio[1..n_trays_below]) WHERE tmp3 IS_A set OF integer_constant
245     WITH_VALUE (1..n_trays_above+n_trays_below+1);
246     Qin[tmp4] ALIASES (top_stack.Qin[1..n_trays_above],feed_tray.Qin,
247     bottom_stack.Qin[1..n_trays_below]) WHERE tmp4 IS_A set OF integer_constant
248     WITH_VALUE (1..n_trays_above+n_trays_below+1);
249    
250     col_feed ALIASES feed_tray.feed;
251     vapor_distillate ALIASES condenser.vap_distillate;
252     liquid_distillate ALIASES condenser.liq_distillate;
253     reflux_ratio ALIASES condenser.reflux_ratio;
254     condenser_T ALIASES condenser.T;
255     condenser_P ALIASES condenser.P;
256     vapor_bottoms ALIASES reboiler.vap_bottom;
257     liquid_bottoms ALIASES reboiler.liq_bottom;
258     reboil_ratio ALIASES reboiler.reboil_ratio;
259     reboiler_T ALIASES reboiler.T;
260     reboiler_P ALIASES reboiler.P;
261    
262     condenser_liqout IS_A stream(cd,pdL,equilibrated);
263     top_stack_vapout IS_A stream(cd,pdV,equilibrated);
264     top_stack_liqout IS_A stream(cd,pdL,equilibrated);
265     feed_vapout IS_A stream(cd,pdV,equilibrated);
266     feed_liqout IS_A stream(cd,pdL,equilibrated);
267     bottom_stack_vapout IS_A stream(cd,pdV,equilibrated);
268     bottom_stack_liqout IS_A stream(cd,pdL,equilibrated);
269     reboiler_vapout IS_A stream(cd,pdV,equilibrated);
270    
271     condenser IS_A condenser(top_stack_vapout,vap_distillate,liq_distillate,
272     condenser_liqout,con_partial,t,dynamic,ode_offset,obs_offset);
273    
274     top_stack IS_A tray_stack(n_trays_above,feed_vapout,condenser_liqout,
275     top_stack_vapout,top_stack_liqout,t,dynamic,ode_offset,obs_offset);
276    
277     feed_tray IS_A feed_tray(feed,top_stack_liqout,bottom_stack_vapout,
278     feed_liqout,feed_vapout,t,dynamic,ode_offset,obs_offset);
279    
280     bottom_stack IS_A tray_stack(n_trays_below,reboiler_vapout,feed_liqout,
281     bottom_stack_vapout,bottom_stack_liqout,t,dynamic,ode_offset,obs_offset);
282    
283     reboiler IS_A reboiler(bottom_stack_liqout,vap_bottoms,liq_bottoms,
284     reboiler_vapout,reboil_partial,t,dynamic,ode_offset,obs_offset);
285    
286 johnpye 1159 METHODS
287 aw0a 1 METHOD check_self;
288     RUN condenser.check_self;
289     RUN top_stack_vapout.check_self;
290     RUN condenser_liqout.check_self;
291     RUN top_stack.check_self;
292     RUN top_stack_liqout.check_self;
293     RUN feed_vapout.check_self;
294     RUN feed_tray.check_self;
295     RUN feed_liqout.check_self;
296     RUN bottom_stack_vapout.check_self;
297     RUN bottom_stack.check_self;
298     RUN bottom_stack.liqout.check_self;
299     RUN reboiler_vapout.check_self;
300     RUN reboiler.check_self;
301     IF (abs(feed.flow-vap_distillate.flow-liq_distillate.flow
302     -vap_bottoms.flow-liq_bottoms.flow) > 1.0e-4) THEN
303     STOP {column violates overall mass-balance};
304     END IF;
305     END check_self;
306    
307     METHOD check_all;
308     IF con_partial THEN
309     IF (vap_distillate.flow < 1e-4 {mole/s}) THEN
310     STOP {vapor distillate flow dried up};
311     END IF;
312     ELSE
313     IF (liq_distillate.flow < 1e-4 {mole/s}) THEN
314     STOP {liquid distillate flow dried up};
315     END IF;
316     END IF;
317     IF (feed.flow < 1e-4 {mole/s}) THEN
318     STOP {distillate feed flow dried up};
319     END IF;
320     IF reboil_partial THEN
321     IF (liq_bottoms.flow < 1e-4 {mole/s}) THEN
322     STOP {liquid bottoms flow dried up};
323     END IF;
324     ELSE
325     IF (vap_bottoms.flow < 1e-4 {mole/s}) THEN
326     STOP {vapor bottoms flow dried up};
327     END IF;
328     END IF;
329     RUN check_self;
330     END check_all;
331     METHOD default_self;
332     RUN top_stack_vapout.default_self;
333     RUN condenser.default_self;
334     RUN condenser_liqout.default_self;
335     RUN top_stack.default_self;
336     RUN top_stack_liqout.default_self;
337     RUN feed_vapout.default_self;
338     RUN feed_liqout.default_self;
339     RUN feed_tray.default_self;
340     RUN bottom_stack_vapout.default_self;
341     RUN bottom_stack.default_self;
342     RUN bottom_stack.liqout.default_self;
343     RUN reboiler_vapout.default_self;
344     RUN reboiler.default_self;
345     END default_self;
346     METHOD default_all;
347     RUN feed.default_self;
348     RUN vap_distillate.default_self;
349     RUN liq_distillate.default_self;
350     RUN liq_bottoms.default_self;
351     RUN vap_bottoms.default_self;
352     RUN default_self;
353     END default_all;
354     METHOD bound_self;
355     RUN condenser.bound_self;
356     RUN top_stack_vapout.bound_self;
357     RUN condenser_liqout.bound_self;
358     RUN top_stack.bound_self;
359     RUN top_stack_liqout.bound_self;
360     RUN feed_vapout.bound_self;
361     RUN feed_tray.bound_self;
362     RUN feed_liqout.bound_self;
363     RUN bottom_stack_vapout.bound_self;
364     RUN bottom_stack.bound_self;
365     RUN bottom_stack.liqout.bound_self;
366     RUN reboiler_vapout.bound_self;
367     RUN reboiler.bound_self;
368     END bound_self;
369     METHOD bound_all;
370     RUN feed.bound_self;
371     RUN vap_distillate.bound_self;
372     RUN liq_distillate.bound_self;
373     RUN liq_bottoms.bound_self;
374     RUN vap_bottoms.bound_self;
375     RUN bound_self;
376     END bound_all;
377     METHOD scale_self;
378     RUN condenser.scale_self;
379     RUN top_stack_vapout.scale_self;
380     RUN condenser_liqout.scale_self;
381     RUN top_stack.scale_self;
382     RUN top_stack_liqout.scale_self;
383     RUN feed_vapout.scale_self;
384     RUN feed_tray.scale_self;
385     RUN feed_liqout.scale_self;
386     RUN bottom_stack_vapout.scale_self;
387     RUN bottom_stack.scale_self;
388     RUN bottom_stack.liqout.scale_self;
389     RUN reboiler_vapout.scale_self;
390     RUN reboiler.scale_self;
391     END scale_self;
392     METHOD scale_all;
393     RUN feed.scale_self;
394     RUN vap_distillate.scale_self;
395     RUN liq_distillate.scale_self;
396     RUN liq_bottoms.scale_self;
397     RUN vap_bottoms.scale_self;
398     RUN scale_self;
399     END scale_all;
400     METHOD seqmod;
401     RUN condenser.seqmod;
402     RUN top_stack.seqmod;
403     RUN feed_tray.seqmod;
404     RUN bottom_stack.seqmod;
405     RUN reboiler.seqmod;
406     END seqmod;
407     METHOD specify;
408     RUN feed.specify;
409     RUN seqmod;
410     END specify;
411     METHOD reset_to_adiabatic;
412     RUN seqmod;
413     RUN top_stack.reset_to_adiabatic;
414     RUN feed_tray.reset_to_adiabatic;
415     RUN bottom_stack.reset_to_adiabatic;
416     END reset_to_adiabatic;
417     METHOD set_ode;
418     RUN condenser.set_ode;
419     RUN top_stack.set_ode;
420     RUN feed_tray.set_ode;
421     RUN bottom_stack.set_ode;
422     RUN reboiler.set_ode;
423     END set_ode;
424     METHOD set_obs;
425     RUN condenser.set_obs;
426     RUN top_stack.set_obs;
427     RUN feed_tray.set_obs;
428     RUN bottom_stack.set_obs;
429     RUN reboiler.set_obs;
430     END set_obs;
431     END column;
432    
433    
434    
435 johnpye 1159 (*------------------------------------------
436     Test models?
437     *)
438 aw0a 1
439     MODEL test_tray_stack() REFINES testflashmodel();
440    
441     cd IS_A components_data(['methanol','ethanol','water'],'water');
442     pdV IS_A phases_data('V', 'Pitzer_vapor_mixture', 'none', 'none');
443     pdL IS_A phases_data('L', 'none', 'UNIFAC_liquid_mixture', 'none');
444     equilibrated IS_A boolean;
445     vin IS_A stream(cd,pdV,equilibrated);
446     lin IS_A stream(cd,pdL,equilibrated);
447     lout IS_A stream(cd,pdL,equilibrated);
448     vout IS_A stream(cd,pdV,equilibrated);
449     ntrays IS_A integer_constant;
450     ntrays :==10;
451     t IS_A time;
452     dynamic IS_A boolean;
453     ode_offset IS_A ode_counter;
454     obs_offset IS_A obs_counter;
455     fl1 IS_A tray_stack(ntrays, vin, lin, vout, lout, t,
456     dynamic, ode_offset, obs_offset);
457    
458     (* boundwidth might be unit specific *)
459     boundwidth IS_A bound_width;
460    
461     METHODS
462 johnpye 1159 METHOD default_all;
463     RUN default_self;
464     END default_all;
465 aw0a 1
466 johnpye 1159 METHOD default_self;
467     boundwidth := 10;
468     equilibrated :=TRUE;
469     ode_offset :=1;
470     obs_offset :=1;
471     RUN vin.default_self;
472     RUN lin.default_self;
473     RUN lout.default_self;
474     RUN vout.default_self;
475     RUN fl1.default_self;
476     END default_self;
477 aw0a 1
478 johnpye 1159 METHOD check_all;
479     RUN check_self;
480     END check_all;
481 aw0a 1
482 johnpye 1159 METHOD check_self;
483     RUN vin.check_self;
484     RUN lin.check_self;
485     RUN lout.check_self;
486     RUN vout.check_self;
487     RUN fl1.check_self;
488     END check_self;
489 aw0a 1
490 johnpye 1159 METHOD bound_all;
491     RUN bound_self;
492     END bound_all;
493 aw0a 1
494 johnpye 1159 METHOD bound_self;
495     fl1.boundwidth := boundwidth;
496     lin.boundwidth := boundwidth;
497     vin.boundwidth := boundwidth;
498     lout.boundwidth := boundwidth;
499     vout.boundwidth := boundwidth;
500     RUN fl1.bound_all;
501     END bound_self;
502 aw0a 1
503 johnpye 1159 METHOD scale_self;
504     RUN vin.scale_self;
505     RUN lin.scale_self;
506     RUN lout.scale_self;
507     RUN vout.scale_self;
508     RUN fl1.scale_self;
509     END scale_self;
510 aw0a 1
511 johnpye 1159 METHOD specify;
512     RUN fl1.specify;
513     END specify;
514 aw0a 1
515 johnpye 1159 METHOD values;
516     vin.P := 1 {atm};
517     vin.T := 365 {K};
518     vin.f['methanol'] := 0.01 {kmol/s};
519     vin.f['ethanol'] := 0.015 {kmol/s};
520     vin.f['water'] := 0.02 {kmol/s};
521     lin.P := 1 {atm};
522     lin.T := 365 {K};
523     lin.f['methanol'] := 0.01 {kmol/s};
524     lin.f['ethanol'] := 0.015 {kmol/s};
525     lin.f['water'] := 0.02 {kmol/s};
526     FOR i IN [1..ntrays] DO
527     fl1.cmo_ratio[i] := 1;
528     fl1.tray_P[i] := 1 {atm};
529     fl1.tray_T[i] := 365 {K};
530     fl1.Qin[i] := 0 {kW};
531     fl1.Vol[i] := 3 {m^3};
532     fl1.vol_liq[i] := 1 {m^3};
533     END FOR;
534     END values;
535 aw0a 1 END test_tray_stack;
536    
537     MODEL test_column() REFINES testflashmodel();
538    
539     cd IS_A components_data(['n_pentane','n_hexane','n_heptane'],'n_heptane');
540     pdV IS_A phases_data('V', 'Pitzer_vapor_mixture', 'none', 'none');
541     pdL IS_A phases_data('L', 'none', 'UNIFAC_liquid_mixture', 'none');
542     equilibrated IS_A boolean;
543     vap_dist IS_A stream(cd,pdV,equilibrated);
544     liq_dist IS_A stream(cd,pdL,equilibrated);
545     liq_bot IS_A stream(cd,pdL,equilibrated);
546     vap_bot IS_A stream(cd,pdV,equilibrated);
547     feed IS_A stream(cd,pdL,equilibrated);
548     below IS_A integer_constant;
549     below :==5;
550     above IS_A integer_constant;
551     above :==5;
552     t IS_A time;
553     dynamic IS_A boolean;
554     C_partial IS_A boolean;
555     R_partial IS_A boolean;
556     ode_offset IS_A ode_counter;
557     obs_offset IS_A obs_counter;
558     col IS_A column(vap_dist,liq_dist,C_partial,above,feed,below,R_partial,
559     vap_bot,liq_bot,t,dynamic,ode_offset,obs_offset);
560    
561     (* boundwidth might be unit specific *)
562     boundwidth IS_A bound_width;
563    
564 johnpye 1159 METHODS
565 aw0a 1 METHOD default_all;
566 johnpye 1159 RUN default_self;
567 aw0a 1 END default_all;
568    
569     METHOD default_self;
570 johnpye 1159 boundwidth := 10;
571     equilibrated :=FALSE;
572     ode_offset :=1;
573     obs_offset :=1;
574     RUN vap_dist.default_self;
575     RUN liq_dist.default_self;
576     RUN feed.default_self;
577     RUN vap_bot.default_self;
578     RUN liq_bot.default_self;
579     RUN col.default_self;
580 aw0a 1 END default_self;
581    
582     METHOD check_all;
583 johnpye 1159 RUN check_self;
584 aw0a 1 END check_all;
585    
586     METHOD check_self;
587 johnpye 1159 IF C_partial THEN
588     RUN vap_dist.check_self;
589     ELSE
590     RUN liq_dist.check_self;
591     END IF;
592     RUN feed.check_self;
593     IF R_partial THEN
594     RUN liq_bot.check_self;
595     ELSE
596     RUN vap_bot.check_self;
597     END IF;
598     RUN col.check_self;
599 aw0a 1 END check_self;
600    
601     METHOD bound_all;
602 johnpye 1159 ;
603 aw0a 1 END bound_all;
604    
605     METHOD bound_self;
606 johnpye 1159 vap_dist.boundwidth := boundwidth;
607     liq_dist.boundwidth := boundwidth;
608     feed.boundwidth := boundwidth;
609     liq_bot.boundwidth := boundwidth;
610     vap_bot.boundwidth := boundwidth;
611     RUN col.bound_all;
612 aw0a 1 END bound_self;
613    
614     METHOD scale_self;
615 johnpye 1159 RUN vap_dist.scale_self;
616     RUN liq_dist.scale_self;
617     RUN feed.scale_self;
618     RUN vap_bot.scale_self;
619     RUN liq_bot.scale_self;
620     RUN col.scale_self;
621 aw0a 1 END scale_self;
622    
623     METHOD scale_all;
624 johnpye 1159 RUN scale_self;
625 aw0a 1 END scale_all;
626    
627     METHOD specify;
628 johnpye 1159 RUN col.specify;
629 aw0a 1 END specify;
630    
631 johnpye 1159 METHOD values;
632     feed.P := 1 {atm};
633     feed.T := 365 {K};
634     feed.f['n_pentane'] := 0.01 {kmol/s};
635     feed.f['n_hexane'] := 0.01 {kmol/s};
636     feed.f['n_heptane'] := 0.01 {kmol/s};
637     vap_dist.flow :=0 {mol/s};
638     vap_bot.flow :=0 {mol/s};
639     col.condenser.Vol :=3 {m^3};
640     col.condenser.vol_liq :=1 {m^3};
641     col.reflux_ratio :=1.5;
642     col.feed_tray.Vol :=1 {m^3};
643     col.feed_tray.vol_liq :=0.3 {m^3};
644     col.feed_tray.q :=1;
645     col.top_stack.Vol[1..above] :=1 {m^3};
646     col.top_stack.vol_liq[1..above] :=0.3 {m^3};
647     col.bottom_stack.Vol[1..above] :=1 {m^3};
648     col.bottom_stack.vol_liq[1..above] :=0.3 {m^3};
649     col.reboiler.Vol :=3 {m^3};
650     col.reboiler.vol_liq :=1 {m^3};
651     col.reboil_ratio :=2;
652     END values;
653     END test_column;
654 aw0a 1
655 johnpye 1159 (* :ex: set ts=4: *)

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