/[ascend]/trunk/models/johnpye/rankine.a4c
ViewVC logotype

Annotation of /trunk/models/johnpye/rankine.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2049 - (hide annotations) (download) (as text)
Sun Jun 14 13:20:28 2009 UTC (11 years, 2 months ago) by jpye
File MIME type: text/x-ascend
File size: 21914 byte(s)
Fixed rankine_reheat_regen.
1 jpye 1663 REQUIRE "atoms.a4l";
2     REQUIRE "johnpye/thermo_types.a4c";
3    
4     IMPORT "freesteam";
5 jpye 2047 IMPORT "sensitivity/solve";
6 jpye 1663
7     (* Model of simple Rankine cycle with boiler, turbine, condenser, pump *)
8    
9     (*------------------------------------------------------------------------------
10     BACKGROUND STUFF
11     *)
12    
13     (*
14     Thermo properties -- IAPWS-IF97
15     *)
16     MODEL steam_state;
17     p IS_A pressure;
18     h IS_A specific_enthalpy;
19 jpye 2003
20     T IS_A temperature;
21 jpye 1663 v IS_A specific_volume;
22 jpye 2003 s IS_A specific_entropy;
23 jpye 1663 x IS_A fraction;
24    
25 jpye 2003 props: freesteam_Tvsx_ph(
26 jpye 1663 p,h : INPUT;
27 jpye 2003 T,v,s,x : OUTPUT
28 jpye 1663 );
29     METHODS
30     METHOD default;
31     p := 10{bar};
32     p.nominal := 42 {bar};
33 jpye 2003 h := 2000 {kJ/kg};
34    
35     T := 400 {K};
36 jpye 1663 v.nominal := 10 {L/kg};
37 jpye 2003 s := 4 {kJ/kg/K};
38 jpye 1663 x := 0.8;
39     END default;
40     METHOD solve;
41     EXTERNAL do_solve(SELF);
42     END solve;
43     METHOD on_load;
44     RUN default_all;
45     FIX p, h;
46     END on_load;
47     END steam_state;
48    
49     (* a simple connector that includes calculation of steam properties *)
50     MODEL steam_node;
51     state IS_A steam_state;
52     p ALIASES state.p;
53     h ALIASES state.h;
54     v ALIASES state.v;
55     T ALIASES state.T;
56 jpye 2003 s ALIASES state.s;
57 jpye 1663 x ALIASES state.x;
58     mdot IS_A mass_rate;
59     METHODS
60     METHOD default;
61     mdot.nominal := 2 {kg/s};
62     END default;
63     METHOD solve;
64     EXTERNAL do_solve(SELF);
65     END solve;
66     METHOD on_load;
67     RUN default_all; RUN reset; RUN values;
68     FIX p,h;
69     END on_load;
70     END steam_node;
71    
72     MODEL steam_equipment;
73 jpye 1925 inlet "in: inlet steam stream" IS_A steam_node;
74     outlet "out: outlet steam stream" IS_A steam_node;
75 jpye 1663
76 jpye 2043 inlet.mdot, outlet.mdot ARE_THE_SAME;
77 jpye 1663 mdot ALIASES inlet.mdot;
78     END steam_equipment;
79    
80     (*------------------------------------------------------------------------------
81     PUMP COMPONENT
82     *)
83    
84     MODEL pump_simple REFINES steam_equipment;
85 jpye 1925 NOTES
86     'block' SELF {Simple model of a pump using isentropic efficiency}
87     END NOTES;
88 jpye 1663
89     dp IS_A delta_pressure;
90     inlet.p + dp = outlet.p;
91    
92     outlet_is IS_A steam_state;
93     outlet_is.p, outlet.p ARE_THE_SAME;
94    
95     outlet_is.s, inlet.s ARE_THE_SAME;
96     eta IS_A fraction;
97    
98 jpye 1676 eta_eq:eta * (inlet.h - outlet.h) = (inlet.h - outlet_is.h);
99 jpye 1663
100     (* work done on the environment, will be negative *)
101     Wdot IS_A energy_rate;
102 jpye 2047 Wdot_eq:Wdot = mdot * w;
103 jpye 1663
104 jpye 1667 w IS_A specific_energy;
105 jpye 1676 w_eq:w = eta * (outlet.h - inlet.h);
106 jpye 1667
107 jpye 1800 (*
108     NOTES
109     'inline' inlet {in:}
110     'inline' outlet {out:}
111     END NOTES;
112     *)
113 jpye 1663 END pump_simple;
114     MODEL pump_simple_test REFINES pump_simple;
115     (* no equations here *)
116     METHODS
117     METHOD on_load;
118     FIX inlet.p;
119     FIX inlet.h;
120     FIX outlet.p;
121     FIX eta;
122     FIX mdot;
123    
124     inlet.p := 5 {bar};
125     inlet.h := 400 {kJ/kg};
126     outlet.p := 100 {bar};
127     eta := 0.65;
128     mdot := 900 {t/d};
129     END on_load;
130     END pump_simple_test;
131    
132     (*------------------------------------------------------------------------------
133     TURBINE COMPONENT
134     *)
135    
136     MODEL turbine_simple REFINES steam_equipment;
137 jpye 1925 NOTES
138     'block' SELF {Simple turbine model}
139     END NOTES;
140 jpye 1663
141     dp IS_A delta_pressure;
142     inlet.p + dp = outlet.p;
143    
144     outlet_is IS_A steam_state;
145     outlet_is.p, outlet.p ARE_THE_SAME;
146     outlet_is.s, inlet.s ARE_THE_SAME;
147    
148     eta IS_A fraction;
149 jpye 1676 eta_eq:eta * (inlet.h - outlet_is.h) = (inlet.h - outlet.h);
150 jpye 1663
151     (* work done on the environment, will be positive *)
152     Wdot IS_A energy_rate;
153 jpye 2047 Wedot_eq:Wdot = mdot * w;
154 jpye 1663
155 jpye 1667 w IS_A specific_energy;
156 jpye 1676 w_eq:w = inlet.h - outlet.h;
157 jpye 1667
158 jpye 1663 END turbine_simple;
159    
160     MODEL turbine_simple_test REFINES turbine_simple;
161     (* no equations here *)
162     METHODS
163     METHOD on_load;
164     FIX inlet.p;
165     FIX inlet.h;
166     FIX outlet.p;
167     FIX eta;
168     FIX mdot;
169    
170     inlet.p := 100 {bar};
171     inlet.h := 3000 {kJ/kg};
172     outlet.p := 5 {bar};
173     eta := 0.85;
174     mdot := 900 {t/d};
175     END on_load;
176     END turbine_simple_test;
177    
178     (*------------------------------------------------------------------------------
179     BOILER COMPONENT
180     *)
181    
182     (*
183     simple model assumes no pressure drop, but heating losses due to
184     flue gas temperature
185     *)
186     MODEL boiler_simple REFINES steam_equipment;
187 jpye 1925 NOTES
188     'block' SELF {Simple boiler model}
189     END NOTES;
190 jpye 1663
191     inlet.p, outlet.p ARE_THE_SAME;
192     Qdot_fuel IS_A energy_rate;
193 jpye 2047
194     q IS_A specific_energy;
195     q = (outlet.h - inlet.h);
196    
197 jpye 1663 Qdot IS_A energy_rate;
198 jpye 2047 Qdot = mdot * q;
199 jpye 1663
200     eta IS_A fraction;
201     Qdot = eta * Qdot_fuel;
202     END boiler_simple;
203    
204     MODEL boiler_simple_test REFINES boiler_simple;
205     (* nothing here *)
206     METHODS
207     METHOD on_load;
208     FIX inlet.p;
209     FIX inlet.h;
210     FIX eta;
211     FIX outlet.h;
212     FIX mdot;
213    
214     inlet.p := 100 {bar};
215     inlet.h := 500 {kJ/kg};
216    
217     eta := 0.8;
218     outlet.h := 3000 {kJ/kg};
219     mdot := 900 {t/d};
220     END on_load;
221     END boiler_simple_test;
222    
223     (*------------------------------------------------------------------------------
224     CONDENSER COMPONENT
225     *)
226    
227     (*
228     this is really simple (fluid props permitting): just work out the heat
229     that must be expelled to get the water down to a certain state
230     *)
231     MODEL condenser_simple REFINES steam_equipment;
232 jpye 1925 NOTES
233     'block' SELF {Simple condenser model}
234 jpye 1926 'inline' inlet {in: yahoooo}
235 jpye 1925 END NOTES;
236 jpye 1663
237     inlet.p, outlet.p ARE_THE_SAME;
238     Qdot IS_A energy_rate;
239    
240 jpye 2041 cons_en: Qdot = mdot * (outlet.h - inlet.h);
241 jpye 1663
242     END condenser_simple;
243    
244     MODEL condenser_simple_test REFINES condenser_simple;
245     (* nothing here *)
246     METHODS
247     METHOD on_load;
248     FIX inlet.p, inlet.x;
249     FIX outlet.h;
250     FIX mdot;
251    
252     inlet.p := 5 {bar};
253     inlet.x := 0.95;
254     outlet.h := 500 {kJ/kg};
255     mdot := 900 {t/d};
256     END on_load;
257     END condenser_simple_test;
258    
259     (*------------------------------------------------------------------------------
260 jpye 1664 FEEDWATER HEATER
261     *)
262    
263     (*
264     open heater does not have inlet.mdot==outlet.mdot, so not a refinement
265     of 'steam_equipment'.
266     *)
267     MODEL heater_open;
268 jpye 1925 NOTES
269     'block' SELF {Simple open feedwater heater model}
270     END NOTES;
271 jpye 1664
272 jpye 1925 inlet "in:" IS_A steam_node;
273     inlet_heat "in:" IS_A steam_node;
274     outlet "out:" IS_A steam_node;
275 jpye 1664
276     inlet_heat.p, inlet.p, outlet.p ARE_THE_SAME;
277    
278     (* cons. mass *)
279     cons_mass: inlet.mdot + inlet_heat.mdot = outlet.mdot;
280    
281 jpye 2047 m_ratio IS_A factor;
282     inlet_heat.mdot = m_ratio * inlet.mdot;
283 jpye 1664 (* cons. energy *)
284 jpye 2047 cons_en: inlet.h + m_ratio * inlet_heat.h = outlet.h;
285 jpye 1664
286     END heater_open;
287    
288     MODEL heater_open_test REFINES heater_open;
289     (* nothing here *)
290     METHODS
291     METHOD on_load;
292     FIX inlet.p, inlet.h;
293     inlet.p := 40 {bar};
294     inlet.h := 634 {kJ/kg};
295     FIX inlet_heat.h;
296     inlet_heat.h := 2960 {kJ/kg};
297    
298     FIX outlet.mdot;
299     outlet.mdot := 900 {t/d};
300    
301     FIX inlet.mdot;
302     inlet.mdot := 700 {t/d};
303     END on_load;
304     END heater_open_test;
305    
306 jpye 2047 MODEL heater_open2;
307     NOTES
308     'block' SELF {Simple open feedwater heater model}
309     END NOTES;
310    
311     inlet "in:" IS_A steam_node;
312     inlet_heat1 "in:" IS_A steam_node;
313     inlet_heat2 "in:" IS_A steam_node;
314     outlet "out:" IS_A steam_node;
315    
316     inlet_heat1.p, inlet_heat2.p, inlet.p, outlet.p ARE_THE_SAME;
317    
318     (* cons. mass *)
319     cons_mass: inlet.mdot + inlet_heat1.mdot + inlet_heat2.mdot = outlet.mdot;
320    
321     (* cons. energy *)
322     cons_en: inlet.mdot * inlet.h + inlet_heat1.mdot * inlet_heat1.h
323     + inlet_heat2.mdot * inlet_heat2.h = outlet.mdot * outlet.h;
324    
325     END heater_open2;
326    
327     MODEL heater_closed;
328     NOTES
329     'block' SELF {Simple open feedwater heater model}
330     END NOTES;
331    
332     inlet "in:" IS_A steam_node;
333     inlet_heat "in:" IS_A steam_node;
334     outlet "out:" IS_A steam_node;
335     outlet_heat "out:" IS_A steam_node;
336    
337     inlet_heat.p, outlet_heat.p ARE_THE_SAME;
338     inlet.p, outlet.p ARE_THE_SAME;
339    
340     Qdot "heat transferred to main flow stream" IS_A energy_rate;
341    
342     q IS_A specific_energy;
343     Qdot = q * inlet.mdot;
344    
345     (* cons. mass *)
346     cons_mass: inlet.mdot = outlet.mdot;
347     cons_mass_heat: inlet_heat.mdot = outlet_heat.mdot;
348    
349     m_ratio IS_A factor;
350     inlet_heat.mdot = inlet.mdot * m_ratio;
351    
352     (* cons. energy *)
353     cons_en: q + inlet.h = outlet.h;
354     cons_en_heat: m_ratio * inlet_heat.h = m_ratio * outlet.h + q;
355    
356     METHODS
357     METHOD on_load;
358     FIX inlet.p, inlet.h;
359     inlet.p := 40 {bar};
360     inlet.h := 634 {kJ/kg};
361     FIX inlet_heat.h;
362     inlet_heat.h := 2960 {kJ/kg};
363    
364     FIX outlet.mdot;
365     outlet.mdot := 900 {t/d};
366    
367     FIX inlet.mdot;
368     inlet.mdot := 700 {t/d};
369     END on_load;
370     END heater_closed;
371    
372 jpye 1664 (*------------------------------------------------------------------------------
373     TEE PIECE
374     *)
375    
376     (*
377     it's not a car :-)
378     *)
379     MODEL tee;
380 jpye 1925 NOTES
381     'block' SELF {Model of a branching of two flow streams}
382     END NOTES;
383    
384 jpye 1926 inlet "in:" IS_A steam_node;
385     outlet "out:" IS_A steam_node;
386     outlet_branch "out:" IS_A steam_node;
387 jpye 1664
388     inlet.p, outlet.p, outlet_branch.p ARE_THE_SAME;
389     inlet.h, outlet.h, outlet_branch.h ARE_THE_SAME;
390    
391     (* cons. mass *)
392     cons_mass: inlet.mdot = outlet.mdot + outlet_branch.mdot;
393    
394     phi IS_A fraction;
395 jpye 1676 phi_eq: phi * inlet.mdot = outlet_branch.mdot;
396 jpye 1664
397     END tee;
398    
399     (*------------------------------------------------------------------------------
400 jpye 1663 OVERALL CYCLE
401     *)
402    
403 jpye 1664 (*
404     simplest possible rankine cycle
405     *)
406 jpye 1663 MODEL rankine;
407    
408     BO IS_A boiler_simple;
409     TU IS_A turbine_simple;
410     CO IS_A condenser_simple;
411     PU IS_A pump_simple;
412    
413     BO.outlet, TU.inlet ARE_THE_SAME;
414     TU.outlet, CO.inlet ARE_THE_SAME;
415     CO.outlet, PU.inlet ARE_THE_SAME;
416     PU.outlet, BO.inlet ARE_THE_SAME;
417    
418 jpye 1664 Qdot_loss ALIASES CO.Qdot;
419    
420     T_H ALIASES BO.outlet.T;
421     T_C ALIASES CO.outlet.T;
422    
423 jpye 1663 eta IS_A fraction;
424 jpye 1664 eta * (BO.Qdot_fuel - PU.Wdot) = TU.Wdot;
425 jpye 1663
426 jpye 1664 eta_carnot IS_A fraction;
427     eta_carnot = 1 - T_C / T_H;
428    
429 jpye 1663 mdot ALIASES TU.mdot;
430 jpye 1667 x_turb_out ALIASES TU.outlet.x;
431 jpye 1663 METHODS
432 jpye 1667 (* first test case: just some plausible values *)
433     METHOD specify_1;
434     RUN ClearAll;
435 jpye 1663 FIX PU.inlet.p;
436     FIX PU.inlet.h;
437     FIX PU.outlet.p;
438     FIX BO.outlet.h;
439     FIX TU.eta;
440     FIX PU.eta;
441     FIX BO.eta;
442 jpye 1667 FIX mdot;
443     END specify_1;
444     METHOD values_1;
445     PU.inlet.p := 1 {bar};
446     PU.inlet.h := 104.9 {kJ/kg};
447     PU.outlet.p := 250 {bar};
448     BO.outlet.h := 3772 {kJ/kg};
449 jpye 1663 TU.eta := 0.85;
450     PU.eta := 0.65;
451 jpye 1664 BO.eta := 0.9;
452 jpye 1667 mdot := 900 {t/d};
453     END values_1;
454     (*
455     second test case: numbers from Example 2.1, K Weston, 'Energy Conversion',
456     1992, http://www.personal.utulsa.edu/~kenneth-weston/
457     *)
458     METHOD specify;
459     RUN ClearAll;
460     FIX PU.outlet.p;
461     FIX BO.outlet.T;
462     FIX PU.inlet.p;
463     FIX PU.inlet.h;
464     FIX TU.eta;
465     FIX PU.eta;
466     FIX BO.eta;
467 jpye 1663 FIX mdot;
468 jpye 1667 END specify;
469     METHOD values;
470     PU.outlet.p := 2000 {psi};
471     BO.outlet.T := 1460 {R}; BO.outlet.h := 3400 {kJ/kg};
472     PU.inlet.p := 1 {psi};
473     PU.inlet.h := 69.73 {btu/lbm};
474     TU.eta := 1.0;
475     PU.eta := 1.0;
476     BO.eta := 1.0;
477     mdot := 900 {t/d};
478     END values;
479     METHOD on_load;
480     RUN specify;
481     RUN values;
482 jpye 1663 END on_load;
483 jpye 1667 METHOD self_test;
484     (* check the results against those from K Weston's book *)
485     (* note that we have NOT neglected pump work in this case! *)
486     ASSERT abs(eta - 0.4294) < 0.0005;
487     ASSERT abs(eta_carnot - 0.6152) < 0.0005;
488     ASSERT abs(TU.outlet.x - 0.7736) < 0.0005;
489 jpye 1802 ASSERT abs(TU.w - 603.1 {btu/lbm}) < 0.7 {btu/lbm};
490 jpye 1667 END self_test;
491 jpye 1663 END rankine;
492    
493 jpye 1667 (*------------------------------------------------------------------------------
494     REHEAT RANKINE CYCLE
495     *)
496     MODEL rankine_reheat;
497    
498     BO1 IS_A boiler_simple;
499     BO2 IS_A boiler_simple;
500     TU1 IS_A turbine_simple;
501     TU2 IS_A turbine_simple;
502     CO IS_A condenser_simple;
503     PU IS_A pump_simple;
504    
505     BO1.outlet, TU1.inlet ARE_THE_SAME;
506     TU1.outlet, BO2.inlet ARE_THE_SAME;
507     BO2.outlet, TU2.inlet ARE_THE_SAME;
508     TU2.outlet, CO.inlet ARE_THE_SAME;
509     CO.outlet, PU.inlet ARE_THE_SAME;
510     PU.outlet, BO1.inlet ARE_THE_SAME;
511    
512     BO1.eta, BO2.eta ARE_THE_SAME;
513    
514     (* boiler peak temperature is reached for both main and reheat... *)
515     BO1.outlet.T, BO2.outlet.T ARE_THE_SAME;
516    
517     mdot ALIASES PU.mdot;
518    
519     T_H ALIASES BO1.outlet.T;
520     T_C ALIASES CO.outlet.T;
521    
522     eta IS_A fraction;
523     eta * (BO1.Qdot_fuel + BO2.Qdot_fuel - PU.Wdot) = TU1.Wdot + TU2.Wdot;
524    
525     eta_carnot IS_A fraction;
526     eta_carnot = 1 - T_C / T_H;
527    
528     METHODS
529 jpye 1670 (*
530     The on_load scenario reproduces the same calculation from
531     K Weston, op. cit., Example 2.5, p. 51.
532     *)
533 jpye 1667 METHOD on_load;
534     FIX BO1.eta;
535     BO1.eta := 1.0;
536     FIX TU1.eta, TU2.eta;
537     TU1.eta := 1.0;
538     TU2.eta := 1.0;
539     FIX PU.eta;
540     PU.eta := 1.0;
541     FIX PU.inlet.p;
542     PU.inlet.p := 1 {psi};
543     FIX PU.inlet.h;
544     PU.inlet.h := 69.73 {btu/lbm};
545     FIX BO1.outlet.T;
546     BO1.outlet.T := 1460 {R};
547     BO1.outlet.h := 3000 {kJ/kg}; (* guess *)
548 jpye 1670 TU1.outlet.h := 3000 {kJ/kg}; (* guess *)
549 jpye 1667 FIX PU.outlet.p;
550     PU.outlet.p := 2000 {psi};
551     FIX mdot;
552     mdot := 900 {t/d};
553    
554     (* this value here is what defines the intermediate pressure *)
555 jpye 1670 FIX TU1.outlet.T;
556     TU1.outlet.T := 860 {R};
557 jpye 1667
558     TU2.inlet.h := 3000 {kJ/kg}; (* guess *)
559     END on_load;
560 jpye 1669 METHOD self_test;
561     ASSERT abs(eta - 0.443) < 0.0005;
562 jpye 1670 ASSERT abs(TU2.outlet.x - 0.926) < 0.0015;
563     ASSERT abs(TU1.w + TU2.w) - 763.1 {btu/lbm} < 1 {btu/lbm};
564 jpye 1669 END self_test;
565 jpye 1667 END rankine_reheat;
566    
567     (*------------------------------------------------------------------------------
568     REGENERATIVE RANKINE CYCLE
569     *)
570 jpye 1664 (*
571 jpye 2004 Add a boiler feedwater heater and two-stage turbine.
572    
573     This model is hard to solve! One solution seems to be to
574     1. load it, run on_load.
575     2. attempt to solve
576     3. disable equation HE.cons_en
577     4. free HE.outlet.x
578     5. solve again.
579 jpye 1664 *)
580     MODEL rankine_regen;
581    
582     BO IS_A boiler_simple;
583     TU1 IS_A turbine_simple;
584     BL IS_A tee; (* bleed *)
585     TU2 IS_A turbine_simple;
586     CO IS_A condenser_simple;
587     HE IS_A heater_open;
588     PU1 IS_A pump_simple;
589     PU2 IS_A pump_simple;
590    
591     (* main loop *)
592     BO.outlet, TU1.inlet ARE_THE_SAME;
593     TU1.outlet, BL.inlet ARE_THE_SAME;
594     BL.outlet, TU2.inlet ARE_THE_SAME;
595     TU2.outlet, CO.inlet ARE_THE_SAME;
596 jpye 2047 CO.outlet, PU1.inlet ARE_THE_SAME;
597 jpye 1664 PU1.outlet, HE.inlet ARE_THE_SAME;
598     HE.outlet, PU2.inlet ARE_THE_SAME;
599 jpye 2047 PU2.outlet, BO.inlet ARE_THE_SAME;
600 jpye 1664
601     (* bleed stream *)
602     BL.outlet_branch, HE.inlet_heat ARE_THE_SAME;
603     phi ALIASES BL.phi;
604     p_bleed ALIASES TU1.outlet.p;
605    
606     mdot ALIASES BO.mdot;
607    
608     T_H ALIASES BO.outlet.T;
609     T_C ALIASES CO.outlet.T;
610    
611     eta IS_A fraction;
612 jpye 1676 eta_eq:eta * (BO.Qdot_fuel) = TU1.Wdot + TU2.Wdot + PU1.Wdot + PU2.Wdot;
613 jpye 1664
614 jpye 1671 Wdot_TU1 ALIASES TU1.Wdot;
615     Wdot_TU2 ALIASES TU2.Wdot;
616 jpye 1675 Wdot_PU1 ALIASES PU1.Wdot;
617     Wdot_PU2 ALIASES PU2.Wdot;
618     Qdot_fuel ALIASES BO.Qdot_fuel;
619 jpye 1671
620 jpye 1664 eta_carnot IS_A fraction;
621 jpye 2043 eta_carnot_eq: eta_carnot = 1 - T_C / T_H;
622 jpye 1664
623 jpye 1675 (* some checking output... *)
624    
625     phi_weston IS_A fraction;
626 jpye 1676 phi_weston_eq:phi_weston * (TU1.outlet.h - PU1.outlet.h) = (PU2.inlet.h - PU1.outlet.h);
627     phi_eq:phi_weston = phi;
628 jpye 1675
629     w_net IS_A specific_energy;
630 jpye 1676 w_net_eq: TU1.mdot * w_net = TU1.mdot * (TU1.inlet.h - TU1.outlet.h) + TU2.mdot * (TU2.inlet.h - TU2.outlet.h);
631 jpye 1675
632     q_a IS_A specific_energy;
633 jpye 2043 q_a_eq: q_a = TU1.inlet.h - PU2.outlet.h;
634 jpye 1676
635 jpye 1775 Wdot IS_A energy_rate;
636 jpye 2043 Wdot_eq: Wdot = TU1.Wdot + TU2.Wdot + PU1.Wdot + PU2.Wdot;
637 jpye 1775
638 jpye 1676 cons_en: HE.inlet.mdot * HE.inlet.h + HE.inlet_heat.mdot * HE.inlet_heat.h = HE.outlet.mdot * HE.outlet.h;
639    
640 jpye 1664 METHODS
641 jpye 2004 METHOD default_self;
642     BO.outlet.h := 4000 {kJ/kg};
643     p_bleed := 37 {bar};
644     TU1.outlet.h := 2300 {kJ/kg};
645 jpye 2043 BL.cons_mass.included := FALSE;
646     (*HE.cons_mass.included := FALSE;*)
647     HE.cons_en.included := FALSE;
648     cons_en.included := FALSE;
649 jpye 2004 END default_self;
650     METHOD on_load;
651     RUN moran_ex_8_5;
652 jpye 2043 (*
653     This model needs to be solved using QRSlv with convopt set to 'RELNOMSCALE'.
654 jpye 2004 *)
655     END on_load;
656 jpye 1775 METHOD moran_ex_8_5;
657 jpye 2004 RUN default_self;
658 jpye 1775 (*
659     This is Example 8.5 from Moran and Shapiro, 'Fundamentals of
660     Engineering Thermodynamics', 4th Ed.
661     *)
662 jpye 1667 RUN ClearAll;
663 jpye 1775 (* component efficiencies *)
664     FIX BO.eta; BO.eta := 1.0;
665     FIX TU1.eta; TU1.eta := 0.85;
666     FIX TU2.eta; TU2.eta := 0.85;
667     FIX PU1.eta; PU1.eta := 1.0;
668     FIX PU2.eta; PU2.eta := 1.0;
669     (* turbine conditions *)
670     FIX TU1.inlet.p; TU1.inlet.p := 8. {MPa};
671     FIX TU1.inlet.T; TU1.inlet.T := 480 {K} + 273.15 {K};
672     FIX TU1.outlet.p; TU1.outlet.p := 0.7 {MPa};
673     FIX TU2.outlet.p; TU2.outlet.p := 0.008 {MPa};
674     (* heater conditions *)
675 jpye 2004 (* FIX HE.outlet.p; HE.outlet.p := 0.7 {MPa}; *)
676 jpye 2043 FIX CO.outlet.x; CO.outlet.x := 0.0001;
677     FIX HE.outlet.x; HE.outlet.x := 0.0001;
678 jpye 1775 FIX Wdot; Wdot := 100 {MW};
679     END moran_ex_8_5;
680 jpye 2047 METHOD self_test;
681     (* solution values to the Moran & Shapiro example 8.5 problem *)
682     ASSERT abs(eta - 0.369) < 0.001;
683     ASSERT abs((TU1.Wdot+TU2.Wdot)/mdot - 984.4{kJ/kg}) < 1 {kJ/kg};
684     ASSERT abs(mdot - 3.69e5 {kg/h}) < 0.05e5 {kg/h};
685     ASSERT abs(CO.inlet.h - 2249.3 {kJ/kg}) < 1.0 {kJ/kg};
686     END self_test;
687 jpye 1775 METHOD weston_ex_2_6;
688     (*
689     The scenario here is example 2.6 from K Weston (op. cit.), p. 55.
690     *)
691     RUN ClearAll;
692 jpye 1664
693 jpye 1671 (* all ideal components *)
694     FIX BO.eta; BO.eta := 1.0;
695     FIX TU1.eta; TU1.eta := 1.0;
696     FIX TU2.eta; TU2.eta := 1.0;
697 jpye 1664 FIX PU1.eta; PU1.eta := 1.0;
698     FIX PU2.eta; PU2.eta := 1.0;
699    
700 jpye 1671 (* mass flow rate is arbitrary *)
701 jpye 1664 FIX mdot;
702 jpye 1675 mdot := 10 {kg/s};
703 jpye 1671
704     (* max pressure constraint *)
705 jpye 1664 FIX PU2.outlet.p;
706 jpye 1671 PU2.outlet.p := 2000 {psi};
707     PU2.outlet.h := 1400 {btu/lbm}; (* guess *)
708 jpye 1664
709 jpye 1671 (* boiler max temp *)
710     FIX BO.outlet.T;
711     BO.outlet.T := 1460 {R};
712     BO.outlet.h := 1400 {btu/lbm}; (* guess *)
713 jpye 1663
714 jpye 1671 (* intermediate temperature setting *)
715 jpye 1675 FIX TU1.outlet.p;
716     TU1.outlet.p := 200 {psi};
717     (* FIX TU1.outlet.T;
718 jpye 1671 TU1.outlet.T := 860 {R}; (* 400 °F *)
719 jpye 1675 TU1.outlet.h := 3000 {kJ/kg}; (* guess *) *)
720 jpye 1663
721 jpye 1671 (* minimum pressure constraint *)
722     FIX CO.outlet.p;
723     CO.outlet.p := 1 {psi};
724 jpye 1663
725 jpye 1671 (* condenser outlet is saturated liquid *)
726 jpye 1664 FIX CO.outlet.h;
727 jpye 1671 CO.outlet.h := 69.73 {btu/lbm};
728 jpye 1664
729 jpye 1671 (* remove the redundant balance equations *)
730 jpye 1676 HE.cons_mass.included := TRUE;
731     HE.cons_en.included := TRUE;
732     BL.cons_mass.included := FALSE;
733     phi_weston_eq.included := TRUE;
734     phi_eq.included := FALSE;
735     cons_en.included := FALSE;
736 jpye 1671
737     (* fix the bleed ratio *)
738     FIX BL.phi;
739 jpye 1675 BL.phi := 0.251;
740    
741     (* FIX BL.outlet.h;
742     BL.outlet.h := 355.5 {btu/lbm}; *)
743 jpye 2047
744 jpye 2044 (**
745     these values seem to be from another problem, need to check which ...
746 jpye 1675 ASSERT abs(TU1.inlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
747     ASSERT abs(TU1.outlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
748     ASSERT abs(TU2.outlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
749     ASSERT abs(PU1.inlet.s - 0.1326 {btu/lbm/R}) < 0.001 {btu/lbm/R};
750     ASSERT abs(PU1.outlet.s - 0.1326 {btu/lbm/R}) < 0.002 {btu/lbm/R};
751     ASSERT abs(PU2.inlet.s - 0.5438 {btu/lbm/R}) < 0.002 {btu/lbm/R};
752     ASSERT abs(PU2.outlet.s - 0.5438 {btu/lbm/R}) < 0.002 {btu/lbm/R};
753    
754     ASSERT abs(TU1.inlet.h - 1474.1 {btu/lbm}) < 1.5 {btu/lbm};
755     ASSERT abs(TU1.outlet.h - 1210.0 {btu/lbm}) < 1.5 {btu/lbm};
756     ASSERT abs(TU2.outlet.h - 871.0 {btu/lbm}) < 1.5 {btu/lbm};
757     ASSERT abs(PU1.inlet.h - 69.73 {btu/lbm}) < 0.001 {btu/lbm};
758     ASSERT abs(PU1.outlet.h - 69.73 {btu/lbm}) < 1.0 {btu/lbm};
759     ASSERT abs(PU2.inlet.h - 355.5 {btu/lbm}) < 1.5 {btu/lbm};
760     ASSERT abs(PU2.outlet.h - 355.5 {btu/lbm}) < 8 {btu/lbm};
761    
762     ASSERT abs(w_net - 518.1 {btu/lbm}) < 0.3 {btu/lbm};
763    
764     ASSERT abs(w_net * mdot - (TU1.Wdot + TU2.Wdot)) < 1 {W};
765    
766     ASSERT abs(q_a - 1118.6 {btu/lbm}) < 7 {btu/lbm};
767    
768     ASSERT abs(eta - 0.463) < 0.003;
769 jpye 1676
770     ASSERT abs(phi - 0.251) < 0.001;
771 jpye 2047 *)
772     END weston_ex_2_6;
773 jpye 1667 END rankine_regen;
774 jpye 1664
775 jpye 2047 MODEL trap REFINES steam_equipment;
776     NOTES
777     'block' SELF {Steam trap model}
778     END NOTES;
779    
780     inlet.h, outlet.h ARE_THE_SAME;
781     METHODS
782     METHOD on_load;
783     (* FIXME change this so that x is forced exactly zero, needs us to
784     extend freesteam ASCEND interface. *)
785     FIX inlet.x; inlet.x := 0.0001;
786     END on_load;
787     END trap;
788     (*
789     This is a reheat-regenerative Rankine cycle with two feedwater headers
790     (one open, one closed), as described in Moran & Shapiro, example 8.6.
791     *)
792     MODEL rankine_reheat_regen;
793    
794     BO1 IS_A boiler_simple;
795     BO2 IS_A boiler_simple;
796     TU1 IS_A turbine_simple;
797     BL1 IS_A tee; (* bleed *)
798     TU2 IS_A turbine_simple;
799     TU3 IS_A turbine_simple;
800     BL2 IS_A tee; (* bleed *)
801     TU4 IS_A turbine_simple;
802    
803     CO IS_A condenser_simple;
804     PU1 IS_A pump_simple;
805     HE1 IS_A heater_open2;
806     PU2 IS_A pump_simple;
807     HE2 IS_A heater_closed;
808     TR IS_A trap;
809    
810     (* connections *)
811     BO1.outlet, TU1.inlet ARE_THE_SAME;
812     TU1.outlet, BL1.inlet ARE_THE_SAME;
813     BL1.outlet, TU2.inlet ARE_THE_SAME;
814     TU2.outlet, BO2.inlet ARE_THE_SAME;
815     BO2.outlet, TU3.inlet ARE_THE_SAME;
816     TU3.outlet, BL2.inlet ARE_THE_SAME;
817     BL2.outlet, TU4.inlet ARE_THE_SAME;
818     TU4.outlet, CO.inlet ARE_THE_SAME;
819     CO.outlet, PU1.inlet ARE_THE_SAME;
820     PU1.outlet, HE1.inlet ARE_THE_SAME;
821     HE1.outlet, PU2.inlet ARE_THE_SAME;
822     PU2.outlet, HE2.inlet ARE_THE_SAME;
823     HE2.outlet, BO1.inlet ARE_THE_SAME;
824     BL1.outlet_branch, HE2.inlet_heat ARE_THE_SAME;
825     BL2.outlet_branch, HE1.inlet_heat1 ARE_THE_SAME;
826    
827     HE2.outlet_heat, TR.inlet ARE_THE_SAME;
828     TR.outlet, HE1.inlet_heat2 ARE_THE_SAME;
829    
830     phi1 ALIASES BL1.phi;
831     phi2 ALIASES BL2.phi;
832    
833     Wdot_t, Wdot IS_A energy_rate;
834     Wdot = Wdot_t - PU1.Wdot - PU2.Wdot;
835     Wdot_t = TU1.Wdot + TU2.Wdot + TU3.Wdot + TU4.Wdot;
836    
837     (*
838     Qdot_net IS_A energy_rate;
839     Qdot_net = BO1.Qdot + BO2.Qdot + CO.Qdot;
840     *)
841     METHODS
842     METHOD default_self;
843     BL1.outlet.mdot := 1 {kg/s};
844     phi1 := 0.1;
845     phi2 := 0.1;
846     BO1.outlet.h := 4000 {kJ/kg};
847     BO2.outlet.h := 4000 {kJ/kg};
848     TU1.outlet.p := 37 {bar};
849     TU1.outlet.h := 2300 {kJ/kg};
850     TU3.outlet.p := 37 {bar};
851     TU3.outlet.h := 2300 {kJ/kg};
852 jpye 2049
853     (* the following equation is disabled because it makes the system
854     structurally singular: *)
855     BL1.cons_mass.included := FALSE;
856 jpye 2047 END default_self;
857     METHOD moran_8_6;
858     (*
859     This is Example 8.6 from Moran and Shapiro, 'Fundamentals of
860     Engineering Thermodynamics', 4th Ed.
861     *)
862     (* component efficiencies *)
863     FIX TU1.inlet.p; TU1.inlet.p := 8.0 {MPa};
864     FIX TU1.inlet.T; TU1.inlet.T := 480 {K} + 273.15 {K};
865     FIX TU1.outlet.p; TU1.outlet.p := 2 {MPa};
866     FIX TU2.outlet.p; TU2.outlet.p := 0.7 {MPa};
867     FIX TU3.inlet.T; TU3.inlet.T := 440 {K} + 273.15 {K};
868     FIX TU3.outlet.p; TU3.outlet.p := 0.3 {MPa};
869     FIX TU4.outlet.p; TU4.outlet.p := 0.008 {MPa};
870     FIX HE2.outlet.T; HE2.outlet.T := 205 {K} + 273.15 {K};
871    
872     FIX Wdot; Wdot := 100 {MW};
873     FIX BO1.eta; BO1.eta := 1.0;
874     FIX BO2.eta; BO2.eta := 1.0;
875     FIX TU1.eta; TU1.eta := 1.0;
876     FIX TU2.eta; TU2.eta := 1.0;
877     FIX TU3.eta; TU3.eta := 1.0;
878     FIX TU4.eta; TU4.eta := 1.0;
879     FIX PU1.eta; PU1.eta := 1.0;
880     FIX PU2.eta; PU2.eta := 1.0;
881    
882     FIX TR.inlet.x; TR.inlet.x := 0.00001;
883     FIX CO.outlet.x; CO.outlet.x := 0.00001;
884     FIX HE1.outlet.x; HE1.outlet.x := 0.00001;
885     END moran_8_6;
886     METHOD on_load;
887     RUN ClearAll;
888     RUN default_self;
889     RUN moran_8_6;
890     END on_load;
891     END rankine_reheat_regen;
892    
893    
894    
895 jpye 1667 MODEL rankine_compare;
896     simple IS_A rankine;
897     regen IS_A rankine_regen;
898     simple.BO.inlet.p, regen.BO.inlet.p ARE_THE_SAME;
899     simple.BO.inlet.h, regen.BO.inlet.h ARE_THE_SAME;
900     simple.BO.Qdot_fuel, regen.BO.Qdot_fuel ARE_THE_SAME;
901     simple.CO.outlet.T, regen.CO.outlet.T ARE_THE_SAME;
902     simple.BO.eta, regen.BO.eta ARE_THE_SAME;
903     simple.TU.eta, regen.TU1.eta, regen.TU2.eta ARE_THE_SAME;
904     simple.PU.eta, regen.PU1.eta, regen.PU2.eta ARE_THE_SAME;
905     simple.mdot, regen.mdot ARE_THE_SAME;
906     METHODS
907     METHOD on_load;
908     RUN ClearAll;
909     RUN regen.on_load;
910     END on_load;
911     END rankine_compare;
912 jpye 1664
913    

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