/[ascend]/trunk/models/johnpye/fprops/rankine_fprops.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/rankine_fprops.a4c

Parent Directory Parent Directory | Revision Log Revision Log


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

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