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

Annotation of /trunk/models/cost_column.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 576 - (hide annotations) (download) (as text)
Tue May 9 03:42:08 2006 UTC (16 years, 4 months ago) by johnpye
File MIME type: text/x-ascend
File size: 13894 byte(s)
Changed all cases of *.fixed := {TRUE,FALSE} to 'FIX' and 'FREE' statements.
1 aw0a 1 REQUIRE "atoms.a4l";
2     (* => atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *)
3     PROVIDE "cost_column.a4l";
4    
5     (*
6     * cost_column.a4l
7     * by Robert S. Huss
8     * Part of the ASCEND Library
9     * $Date: 1998/06/17 18:56:15 $
10     * $Revision: 1.6 $
11     * $Author: mthomas $
12     * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/cost_column.a4l,v $
13     *
14     * This file is part of the ASCEND Modeling Library.
15     *
16     * Copyright (C) 1994, 1997 Carnegie Mellon University
17     *
18     * The ASCEND Modeling Library is free software; you can redistribute
19     * it and/or modify it under the terms of the GNU General Public
20     * License as published by the Free Software Foundation; either
21     * version 2 of the License, or (at your option) any later version.
22     *
23     * The ASCEND Modeling Library is distributed in hope that it
24     * will be useful, but WITHOUT ANY WARRANTY; without even the implied
25     * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26     * See the GNU General Public License for more details.
27     *
28     * You should have received a copy of the GNU General Public License
29     * along with the program; if not, write to the Free Software
30     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
31     * the file named COPYING.
32     *)
33    
34     (*
35     C O S T _ C O L U M N . A 4 L
36     -----------------------------
37    
38     AUTHOR: Robert S. Huss
39    
40     DATES: 5/95 - First Public Release
41     4/96 - Modified for using constant instance types
42     6/97 - Updated to use parameterized types
43    
44     CONTENTS: Collocation models for distillation modeling.
45    
46    
47    
48    
49     REQUIRES: "system.a4l"
50     "atoms.a4l"
51     "components.a4l"
52     "thermodynamics.a4l"
53     "plot.a4l"
54     "stream.a4l"
55     "flash.a4l"
56    
57     *)
58    
59     MODEL cost_calc(
60     column_cost WILL_BE cost_per_time; (* cost/time: capital and operating
61     * cost OF column *)
62     Tc WILL_BE temperature; (* temperature of condenser *)
63     QC WILL_BE energy_rate; (* heat duty of condenser *)
64     QR WILL_BE energy_rate; (* heat duty of reboiler *)
65     nsections WILL_BE integer_constant; (* number OF column sections *)
66     V[1..nsections] WILL_BE molar_rate; (* molar vapor flow rate out
67     * of section *)
68     V_bar[1..nsections] WILL_BE molar_volume; (* corresponding molar vapor
69     * volume *)
70     stot WILL_BE factor; (* total number of trays in column *)
71     M_g WILL_BE molar_mass; (* average molar mass of vapor *)
72     Feedtot WILL_BE molar_rate; (* molar rate OF feed *)
73     );
74    
75     Afrac IS_A real; (* fraction of area taken by tray *)
76    
77     Fp1,
78     Fm1 IS_A real; (* material factors for column p 574*)
79     Fd2,
80     Fp2,
81     Fm2 IS_A real; (* material factors for exchangers p 572*)
82     M_S IS_A real;
83     Tin IS_A real; (* in temperature of cooling water *)
84     Uc IS_A real; (* heat transfer coefficient for condenser *)
85     CpW IS_A real; (* heat capacity of cooling water *)
86     Hs IS_A real; (* heat of vaporization of steam *)
87     Cw IS_A real; (* price of cooling water *)
88     Cs IS_A real; (* price of steam *)
89     Tray_height IS_A real; (* height of each tray *)
90    
91    
92     cost IS_A factor;
93    
94     condenser_cost,
95     condenser_min,
96     condenser_max,
97     reboiler_cost,
98     reboiler_min,
99     reboiler_max,
100     water_cost,
101     water_min,
102     water_max,
103     steam_cost,
104     steam_min,
105     steam_max IS_A cost_per_time;
106     boundwidth IS_A bound_width;
107     Area IS_A area; (* total cross-sectional area of column *)
108     D IS_A distance; (* diameter of column *)
109     H IS_A distance; (* height of column *)
110     pi IS_A circle_constant;
111     DT_C IS_A temperature; (* change in cooling water temperature *)
112     Ac,
113     Ar,
114     Acmin,
115     Acmax,
116     Armin,
117     Armax IS_A area; (* area of condenser and reboiler *)
118     Tout IS_A temperature;
119     Fc1 IS_A factor;
120     Fc2 IS_A factor;
121     Feedmax,
122     Feedmin IS_A molar_rate;
123     F[1..nsections],
124     Fmax,
125     Fmin IS_A factor; (* flooding factor *)
126     LMT IS_A factor; (* log mean temperature difference in condenser *)
127    
128    
129     FOR j IN [1..nsections] CREATE
130     Area = 1{ft^2}*V[j]*1{hr/lb_mole}
131     *sqrt(M_g*1{lb_mole^2/lbm/ft^3}
132     *V_bar[j])/Afrac/F[j]/3600;
133     END FOR;
134    
135     F[1]*Feedmin = Fmin*Feedtot;
136     F[1]*Feedmax = Fmax*Feedtot;
137    
138     Acmin*F[1] = Fmin*Ac;
139     Acmax*F[1] = Fmax*Ac;
140     Armin*F[1] = Fmin*Ar;
141     Armax*F[1] = Fmax*Ar;
142    
143    
144    
145     D = (4*Area/pi)^0.5;
146    
147     H = Tray_height*1.15*stot;
148    
149     Fc1 = Fm1*Fp1;
150     Fc2 = (Fd2+Fp2)*Fm1;
151    
152     DT_C = (Tout - Tin);
153    
154     LMT = ln((Tc-Tin)/(Tc-Tout));
155     Ac = -QC*LMT/((Tout-Tin)*Uc);
156     Ar = QR/11250{BTU/hr/ft^2};
157     Tout IS_REFINED_TO temperature;
158     Tout = Tc - 5{K};
159    
160     c1: column_cost = (M_S/280/3{yr})*(120*(D/1{ft})
161     *((H/1{ft})^0.8))*(2.18 + Fc1);
162     c2: condenser_cost = (M_S/280/3{yr})*(101.3)
163     *(2.29+Fc2)*((Ac/1{ft^2})^0.65);
164     c3: reboiler_cost = (M_S/280/3{yr})*(101.3)
165     *(2.29+Fc2)*((Ar/1{ft^2})^0.65);
166     c4: water_cost = Cw*(-QC)*1{ml/g}*18{g/mole}/(CpW*DT_C);
167     c5: steam_cost = Cs*QR/Hs;
168    
169    
170     condenser_min = (M_S/280/3{yr})*(101.3)*(2.29+Fc2)*((Acmin/1{ft^2})^0.65);
171     condenser_max = (M_S/280/3{yr})*(101.3)*(2.29+Fc2)*((Acmax/1{ft^2})^0.65);
172     reboiler_min = (M_S/280/3{yr})*(101.3)*(2.29+Fc2)*((Armin/1{ft^2})^0.65);
173     reboiler_max = (M_S/280/3{yr})*(101.3)*(2.29+Fc2)*((Armax/1{ft^2})^0.65);
174     water_min*F[1] = Fmin*water_cost;
175     water_max*F[1] = Fmax*water_cost;
176     steam_min*F[1] = Fmin*steam_cost;
177     steam_max*F[1] = Fmax*steam_cost;
178    
179    
180    
181    
182 johnpye 109 c_tot1: cost*1.0{USD/yr} = column_cost + condenser_cost
183 aw0a 1 + reboiler_cost + water_cost + steam_cost;
184    
185    
186     METHODS
187     METHOD default_self;
188     F[1..nsections] := 1.51{};
189     Fmax := 2.5;
190     Fmin := 0.75;
191    
192     Afrac := 0.88{};
193     Fp1 := 1.0{};
194     Fm1 := 1.0{};
195     Fd2 := 1.0{};
196     Fp2 := 0.0{};
197     Fm2 := 1.0{};
198    
199 johnpye 109 M_S := 900{USD};
200 aw0a 1
201     Tin := 459.67{R} + 70{R};
202     Tout := 459.67{R} + 90{R};
203     Uc := 100{BTU/hr/ft^2/R};
204     CpW := 1{cal/mole/K};
205     Hs := 933{BTU/lbm};
206 johnpye 109 Cw := 0.03{USD}/1000{gallon};
207     Cs := 2.5{USD}/1000{lbm};
208 aw0a 1 Tray_height := 2.0{ft};
209    
210    
211     V_bar[1..nsections] := 24{liter/mol};
212     M_g := 70{g/mol};
213     Tc := 350{K};
214     QC := -30{kW};
215     QR := 30{kW};
216     END default_self;
217     METHOD default_all;
218     RUN default_self;
219     END default_all;
220    
221     METHOD check_self;
222     END check_self;
223    
224     METHOD scale_self;
225     END scale_self;
226    
227     METHOD bound_self;
228     END bound_self;
229    
230     METHOD bound_all;
231     RUN bound_self;
232     END bound_all;
233    
234     METHOD scale_all;
235     RUN scale_self;
236     END scale_all;
237    
238     METHOD check_all;
239     RUN check_self;
240     END check_all;
241    
242     METHOD clear;
243 johnpye 576 FREE cost;
244     FREE column_cost;
245     FREE condenser_cost;
246     FREE reboiler_cost;
247     FREE water_cost;
248     FREE steam_cost;
249     FREE Area;
250     FREE V[1..nsections];
251     FREE V_bar[1..nsections];
252     FREE M_g;
253     FREE D;
254     FREE H;
255     FREE DT_C;
256     FREE QC;
257     FREE QR;
258     FREE F[1..nsections];
259     FREE Fmax;
260     FREE Fmin;
261     FREE Feedtot;
262     FREE Feedmin;
263     FREE Feedmax;
264     FREE Fc1;
265     FREE Fc2;
266     FREE Tc;
267     FREE stot;
268     FREE condenser_min;
269     FREE condenser_max;
270     FREE reboiler_min;
271     FREE reboiler_max;
272     FREE water_min;
273     FREE water_max;
274     FREE steam_min;
275     FREE steam_max;
276     FREE Acmin;
277     FREE Acmax;
278     FREE Armin;
279     FREE Armax;
280 aw0a 1 END clear;
281     METHOD seqmod;
282 johnpye 576 FIX F[1];
283     FIX Fmin;
284     FIX Fmax;
285 aw0a 1 END seqmod;
286     METHOD specify;
287 johnpye 576 FIX Tc;
288     FIX M_g;
289     FIX QC;
290     FIX QR;
291     FIX V[1..nsections];
292     FIX V_bar[1..nsections];
293     FIX stot;
294 aw0a 1 END specify;
295     METHOD reset;
296     RUN clear;
297     RUN specify;
298     END reset;
299     METHOD scale;
300     RUN col.scale;
301     column_cost.nominal := column_cost;
302     condenser_cost.nominal := condenser_cost;
303     condenser_min.nominal := condenser_min;
304     condenser_max.nominal := condenser_max;
305     reboiler_cost.nominal := reboiler_cost;
306     reboiler_min.nominal := reboiler_min;
307     reboiler_max.nominal := reboiler_max;
308     water_cost.nominal := water_cost;
309     water_min.nominal := water_min;
310     water_max.nominal := water_max;
311     steam_cost.nominal := steam_cost;
312     steam_min.nominal := steam_min;
313     steam_max.nominal := steam_max;
314    
315     column_cost.upper_bound := column_cost +
316     boundwidth*column_cost.nominal;
317     condenser_cost.upper_bound := condenser_cost +
318     boundwidth*condenser_cost.nominal;
319     condenser_min.upper_bound := condenser_min +
320     boundwidth*condenser_min.nominal;
321     condenser_max.upper_bound := condenser_max +
322     boundwidth*condenser_max.nominal;
323     reboiler_cost.upper_bound := reboiler_cost +
324     boundwidth*reboiler_cost.nominal;
325     reboiler_min.upper_bound := reboiler_min +
326     boundwidth*reboiler_min.nominal;
327     reboiler_max.upper_bound := reboiler_max +
328     boundwidth*reboiler_max.nominal;
329     water_cost.upper_bound := water_cost +
330     boundwidth*water_cost.nominal;
331     water_min.upper_bound := water_min + boundwidth*water_min.nominal;
332     water_max.upper_bound := water_max + boundwidth*water_max.nominal;
333     steam_cost.upper_bound := steam_cost +
334     boundwidth*steam_cost.nominal;
335     steam_min.upper_bound := steam_min + boundwidth*steam_min.nominal;
336     steam_max.upper_bound := steam_max + boundwidth*steam_max.nominal;
337    
338     FOR j IN [1..nsections] DO
339     V[j].nominal := V[j];
340     V_bar[j].nominal := V_bar[j];
341     F[j].nominal := sqrt(sqr(F[j]));
342     F[j].lower_bound := F[j] - boundwidth*F[j].nominal;
343     V[j].upper_bound := V[j] + boundwidth*V[j];
344     V_bar[j].upper_bound := V_bar[j] + boundwidth*V_bar[j];
345     F[j].upper_bound := F[j] + boundwidth*F[j].nominal;
346     END FOR;
347    
348    
349     Area.nominal := Area;
350     M_g.nominal := M_g;
351     D.nominal := D;
352     H.nominal := H;
353     DT_C.nominal := DT_C;
354     Ac.nominal := Ac;
355     Ar.nominal := Ar;
356     Acmin.nominal := Acmin;
357     Acmax.nominal := Acmax;
358     Armin.nominal := Armin;
359     Armax.nominal := Armax;
360     QC.nominal := sqrt(sqr(QC));
361     QR.nominal := sqrt(sqr(QR));
362     Tc.nominal := Tc;
363     Tout.nominal := Tout;
364     Fc1.nominal := Fc1;
365     Fc2.nominal := Fc2;
366    
367     Feedtot.nominal := Feedtot;
368     Feedmax.nominal := Feedmax;
369     Feedmin.nominal := Feedmin;
370     Fmax.nominal := Fmax;
371     Fmin.nominal := Fmin;
372     LMT.nominal := LMT;
373     stot.nominal := stot;
374    
375     Area.upper_bound := Area + boundwidth*Area.nominal;
376     M_g.upper_bound := M_g + boundwidth*M_g.nominal;
377     D.upper_bound := D + boundwidth*D.nominal;
378     H.upper_bound := H + boundwidth*H.nominal;
379     DT_C.upper_bound := DT_C + boundwidth*DT_C.nominal;
380     Ac.upper_bound := Ac + boundwidth*Ac.nominal;
381     Ar.upper_bound := Ar + boundwidth*Ar.nominal;
382     Acmin.upper_bound := Acmin + boundwidth*Acmin.nominal;
383     Acmax.upper_bound := Acmax + boundwidth*Acmax.nominal;
384     Armin.upper_bound := Armin + boundwidth*Armin.nominal;
385     Armax.upper_bound := Armax + boundwidth*Armax.nominal;
386     QC.upper_bound := QC + boundwidth*QC.nominal;
387     QR.upper_bound := QR + boundwidth*QR.nominal;
388     Tc.upper_bound := Tc + boundwidth*Tc.nominal;
389     Tout.upper_bound := Tout + boundwidth*Tout.nominal;
390     Fc1.upper_bound := Fc1 + boundwidth*Fc1.nominal;
391     Fc2.upper_bound := Fc2 + boundwidth*Fc2.nominal;
392    
393     Feedtot.upper_bound := Feedtot + boundwidth*Feedtot.nominal;
394     Feedmax.upper_bound := Feedmax + boundwidth*Feedmax.nominal;
395     Feedmin.upper_bound := Feedmin + boundwidth*Feedmin.nominal;
396     Fmax.upper_bound := Fmax + boundwidth*Fmax.nominal;
397     Fmin.upper_bound := Fmin + boundwidth*Fmin.nominal;
398     LMT.upper_bound := LMT + boundwidth*LMT.nominal;
399     stot.upper_bound := stot + boundwidth*stot.nominal;
400    
401    
402    
403     QC.lower_bound := QC - boundwidth*QC.nominal;
404     QR.lower_bound := QR - boundwidth*QR.nominal;
405    
406     Fmax.lower_bound := Fmax + boundwidth*Fmax.nominal;
407     Fmin.lower_bound := Fmin + boundwidth*Fmin.nominal;
408     END scale;
409     END cost_calc;
410     (*
411     MODEL cost_column;
412    
413     cost_calc IS_A cost_calc;
414     col IS_A td_coll_column;
415    
416     cost_calc.Tc,
417     col.condenser.VLE.T ARE_THE_SAME;
418     cost_calc.QC,
419     col.condenser.Qin ARE_THE_SAME;
420     cost_calc.QR,
421     col.reboiler.Qin ARE_THE_SAME;
422    
423     cost_calc.nsections :== col.nfeeds+1;
424    
425    
426     FOR j IN [1..col.nfeeds+1] CREATE
427     cost_calc.V[j],
428     col.coll_stack[j].coll[1].tray[1].vapout['vapor'].Ftot ARE_THE_SAME;
429     cost_calc.V_bar[j],
430     col.coll_stack[j].coll[1].tray[1].vapout['vapor'].state.V ARE_THE_SAME;
431     END FOR;
432    
433    
434    
435     cost_calc.stot,
436     col.stot ARE_THE_SAME;
437    
438     cost_calc.M_g = SUM[col.feed_tray[1].data[i].mw
439     *col.feed_tray[1].vapout['vapor'].state.y[i]
440     | i IN col.components];
441     cost_calc.Feedtot,
442     col.feed_tray[1].input['feed'].Ftot ARE_THE_SAME;
443    
444    
445     METHODS
446     METHOD clear;
447     RUN col.clear;
448     RUN cost_calc.clear;
449     END clear;
450     METHOD seqmod;
451     RUN col.seqmod;
452     RUN cost_calc.seqmod;
453     END seqmod;
454     METHOD specify;
455     RUN seqmod;
456     RUN col.feed_tray[1..col.nfeeds].input['feed'].specify;
457     END specify;
458     METHOD reset;
459     RUN clear;
460     RUN specify;
461     END reset;
462     END cost_column;
463    
464    
465     MODEL opt_column REFINES cost_column;
466    
467    
468    
469     opt1: MINIMIZE cost_calc.cost;
470    
471     METHODS
472    
473     METHOD free;
474 johnpye 576 FREE col.condenser.reflux_ratio;
475     FREE col.condenser.totprod.Ftot;
476     FREE col.s_stack[1..2];
477 aw0a 1 END free;
478     END opt_column;
479    
480     MODEL standard_cost REFINES column_w_plot;
481    
482    
483    
484     cc IS_A cost_column;
485    
486     cc.col,
487     col ARE_THE_SAME;
488    
489     col.nfeeds :== 1;
490     col.coll_stack[1..2].ncolls :== 2;
491    
492     col.coll_stack[1..2].coll[1].z_set.up_down := -1.0;
493     col.coll_stack[1..2].coll[2].z_set.up_down := 1.0;
494    
495     col.coll_stack[1..col.nfeeds+1].coll
496     [1..col.coll_stack[1].ncolls].z_set.lgr IS_REFINED_TO lgr_2_points;
497    
498     col IS_REFINED_TO td_coll_column;
499     col.coll_stack[1..2].coll[1..2] IS_REFINED_TO h_coll;
500    
501    
502     METHODS
503     METHOD clear;
504     RUN col.clear;
505     RUN plots.clear;
506     END clear;
507     METHOD seqmod;
508 johnpye 576 FIX plots.z_space;
509     FIX plots.box_height;
510 aw0a 1 RUN cc.seqmod;
511     END seqmod;
512     METHOD specify;
513     RUN seqmod;
514     RUN col.feed_tray[1..col.nfeeds].input['feed'].specify;
515     END specify;
516     METHOD values;
517     col.feed_tray[1].alpha['c1'] := 1.5;
518     col.feed_tray[1].alpha['c2'] := 1.2;
519     col.feed_tray[1].alpha['c3'] := 1.0;
520     RUN col.propogate_feed;
521     FOR j IN [1..2] DO
522     col.coll_stack[j].split[1] := 0.5;
523     col.coll_stack[j].stot := 7;
524     col.coll_stack[j].coll[1].z_set.stot := 3;
525     col.coll_stack[j].coll[1..col.coll_stack[1].ncolls].z_set.a := 0.1;
526     END FOR;
527     col.feed_tray[1].input['feed'].f[col.components] := 3{mol/s};
528     col.feed_tray[1].q := 1.0;
529     col.condenser.prodsplit['vapor_product'] := 0.0;
530     col.reboiler.prodsplit['vapor_product'] := 0.0;
531     col.condenser.totprod.Ftot := 3{mol/s};
532     col.condenser.reflux_ratio := 2.0;
533     END values;
534     END standard_cost;
535     *)

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