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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1926 - (show annotations) (download) (as text)
Wed Oct 8 04:23:52 2008 UTC (12 years ago) by jpye
File MIME type: text/x-ascend
File size: 16118 byte(s)
Still working on the inputs, outputs list. Problem with the notequery functions,
seems that assumption about ordering of notes returned form GetNotesList was wrong.
1 REQUIRE "atoms.a4l";
2 REQUIRE "johnpye/thermo_types.a4c";
3
4 IMPORT "freesteam";
5
6 (* Model of simple Rankine cycle with boiler, turbine, condenser, pump *)
7
8 (*------------------------------------------------------------------------------
9 BACKGROUND STUFF
10 *)
11
12 (*
13 Thermo properties -- IAPWS-IF97
14 *)
15 MODEL steam_state;
16 p IS_A pressure;
17 h IS_A specific_enthalpy;
18 u IS_A specific_energy;
19 v IS_A specific_volume;
20 T IS_A temperature;
21 x IS_A fraction;
22 s IS_A specific_entropy;
23 mu IS_A viscosity;
24
25 props: iapws97_uvTxsmu_ph(
26 p,h : INPUT;
27 u,v,T,x,s,mu : OUTPUT
28 );
29 METHODS
30 METHOD default;
31 p := 10{bar};
32 p.nominal := 42 {bar};
33 v.nominal := 10 {L/kg};
34 u := 2000 {kJ/kg};
35 T := 400 {K};
36 x := 0.8;
37 END default;
38 METHOD solve;
39 EXTERNAL do_solve(SELF);
40 END solve;
41 METHOD on_load;
42 RUN default_all;
43 FIX p, h;
44 END on_load;
45 END steam_state;
46
47 (* a simple connector that includes calculation of steam properties *)
48 MODEL steam_node;
49 state IS_A steam_state;
50 p ALIASES state.p;
51 h ALIASES state.h;
52 u ALIASES state.u;
53 v ALIASES state.v;
54 T ALIASES state.T;
55 x ALIASES state.x;
56 s ALIASES state.s;
57 mu ALIASES state.mu;
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 inlet "in: inlet steam stream" IS_A steam_node;
74 outlet "out: outlet steam stream" IS_A steam_node;
75
76 inlet.mdot, outlet.mdot ARE_THE_SAME;
77 mdot ALIASES inlet.mdot;
78 END steam_equipment;
79
80 (*------------------------------------------------------------------------------
81 PUMP COMPONENT
82 *)
83
84 MODEL pump_simple REFINES steam_equipment;
85 NOTES
86 'block' SELF {Simple model of a pump using isentropic efficiency}
87 END NOTES;
88
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 eta_eq:eta * (inlet.h - outlet.h) = (inlet.h - outlet_is.h);
99
100 (* work done on the environment, will be negative *)
101 Wdot IS_A energy_rate;
102 Wdot_eq:Wdot = eta * mdot * (inlet.h - outlet.h);
103
104 w IS_A specific_energy;
105 w_eq:w = eta * (outlet.h - inlet.h);
106
107 (*
108 NOTES
109 'inline' inlet {in:}
110 'inline' outlet {out:}
111 END NOTES;
112 *)
113 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 NOTES
138 'block' SELF {Simple turbine model}
139 END NOTES;
140
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 eta_eq:eta * (inlet.h - outlet_is.h) = (inlet.h - outlet.h);
150
151 (* work done on the environment, will be positive *)
152 Wdot IS_A energy_rate;
153 Wedot_eq:Wdot = mdot * (inlet.h - outlet.h);
154
155 w IS_A specific_energy;
156 w_eq:w = inlet.h - outlet.h;
157
158 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 NOTES
188 'block' SELF {Simple boiler model}
189 END NOTES;
190
191 inlet.p, outlet.p ARE_THE_SAME;
192 Qdot_fuel IS_A energy_rate;
193 Qdot IS_A energy_rate;
194
195 Qdot = mdot * (outlet.h - inlet.h);
196
197 eta IS_A fraction;
198 Qdot = eta * Qdot_fuel;
199 END boiler_simple;
200
201 MODEL boiler_simple_test REFINES boiler_simple;
202 (* nothing here *)
203 METHODS
204 METHOD on_load;
205 FIX inlet.p;
206 FIX inlet.h;
207 FIX eta;
208 FIX outlet.h;
209 FIX mdot;
210
211 inlet.p := 100 {bar};
212 inlet.h := 500 {kJ/kg};
213
214 eta := 0.8;
215 outlet.h := 3000 {kJ/kg};
216 mdot := 900 {t/d};
217 END on_load;
218 END boiler_simple_test;
219
220 (*------------------------------------------------------------------------------
221 CONDENSER COMPONENT
222 *)
223
224 (*
225 this is really simple (fluid props permitting): just work out the heat
226 that must be expelled to get the water down to a certain state
227 *)
228 MODEL condenser_simple REFINES steam_equipment;
229 NOTES
230 'block' SELF {Simple condenser model}
231 'inline' inlet {in: yahoooo}
232 END NOTES;
233
234 inlet.p, outlet.p ARE_THE_SAME;
235 Qdot IS_A energy_rate;
236
237 Qdot = mdot * (outlet.h - inlet.h);
238
239 END condenser_simple;
240
241 MODEL condenser_simple_test REFINES condenser_simple;
242 (* nothing here *)
243 METHODS
244 METHOD on_load;
245 FIX inlet.p, inlet.x;
246 FIX outlet.h;
247 FIX mdot;
248
249 inlet.p := 5 {bar};
250 inlet.x := 0.95;
251 outlet.h := 500 {kJ/kg};
252 mdot := 900 {t/d};
253 END on_load;
254 END condenser_simple_test;
255
256 (*------------------------------------------------------------------------------
257 FEEDWATER HEATER
258 *)
259
260 (*
261 open heater does not have inlet.mdot==outlet.mdot, so not a refinement
262 of 'steam_equipment'.
263 *)
264 MODEL heater_open;
265 NOTES
266 'block' SELF {Simple open feedwater heater model}
267 END NOTES;
268
269 inlet "in:" IS_A steam_node;
270 inlet_heat "in:" IS_A steam_node;
271 outlet "out:" IS_A steam_node;
272
273 inlet_heat.p, inlet.p, outlet.p ARE_THE_SAME;
274
275 (* cons. mass *)
276 cons_mass: inlet.mdot + inlet_heat.mdot = outlet.mdot;
277
278 (* cons. energy *)
279 cons_en: inlet.mdot * inlet.h + inlet_heat.mdot * inlet_heat.h = outlet.mdot * outlet.h;
280
281 END heater_open;
282
283 MODEL heater_open_test REFINES heater_open;
284 (* nothing here *)
285 METHODS
286 METHOD on_load;
287 FIX inlet.p, inlet.h;
288 inlet.p := 40 {bar};
289 inlet.h := 634 {kJ/kg};
290 FIX inlet_heat.h;
291 inlet_heat.h := 2960 {kJ/kg};
292
293 FIX outlet.mdot;
294 outlet.mdot := 900 {t/d};
295
296 FIX inlet.mdot;
297 inlet.mdot := 700 {t/d};
298 END on_load;
299 END heater_open_test;
300
301 (*------------------------------------------------------------------------------
302 TEE PIECE
303 *)
304
305 (*
306 it's not a car :-)
307 *)
308 MODEL tee;
309 NOTES
310 'block' SELF {Model of a branching of two flow streams}
311 END NOTES;
312
313 inlet "in:" IS_A steam_node;
314 outlet "out:" IS_A steam_node;
315 outlet_branch "out:" IS_A steam_node;
316
317 inlet.p, outlet.p, outlet_branch.p ARE_THE_SAME;
318 inlet.h, outlet.h, outlet_branch.h ARE_THE_SAME;
319
320 (* cons. mass *)
321 cons_mass: inlet.mdot = outlet.mdot + outlet_branch.mdot;
322
323 phi IS_A fraction;
324 phi_eq: phi * inlet.mdot = outlet_branch.mdot;
325
326 END tee;
327
328 (*------------------------------------------------------------------------------
329 OVERALL CYCLE
330 *)
331
332 (*
333 simplest possible rankine cycle
334 *)
335 MODEL rankine;
336
337 BO IS_A boiler_simple;
338 TU IS_A turbine_simple;
339 CO IS_A condenser_simple;
340 PU IS_A pump_simple;
341
342 BO.outlet, TU.inlet ARE_THE_SAME;
343 TU.outlet, CO.inlet ARE_THE_SAME;
344 CO.outlet, PU.inlet ARE_THE_SAME;
345 PU.outlet, BO.inlet ARE_THE_SAME;
346
347 Qdot_loss ALIASES CO.Qdot;
348
349 T_H ALIASES BO.outlet.T;
350 T_C ALIASES CO.outlet.T;
351
352 eta IS_A fraction;
353 eta * (BO.Qdot_fuel - PU.Wdot) = TU.Wdot;
354
355 eta_carnot IS_A fraction;
356 eta_carnot = 1 - T_C / T_H;
357
358 mdot ALIASES TU.mdot;
359 x_turb_out ALIASES TU.outlet.x;
360 METHODS
361 (* first test case: just some plausible values *)
362 METHOD specify_1;
363 RUN ClearAll;
364 FIX PU.inlet.p;
365 FIX PU.inlet.h;
366 FIX PU.outlet.p;
367 FIX BO.outlet.h;
368 FIX TU.eta;
369 FIX PU.eta;
370 FIX BO.eta;
371 FIX mdot;
372 END specify_1;
373 METHOD values_1;
374 PU.inlet.p := 1 {bar};
375 PU.inlet.h := 104.9 {kJ/kg};
376 PU.outlet.p := 250 {bar};
377 BO.outlet.h := 3772 {kJ/kg};
378 TU.eta := 0.85;
379 PU.eta := 0.65;
380 BO.eta := 0.9;
381 mdot := 900 {t/d};
382 END values_1;
383 (*
384 second test case: numbers from Example 2.1, K Weston, 'Energy Conversion',
385 1992, http://www.personal.utulsa.edu/~kenneth-weston/
386 *)
387 METHOD specify;
388 RUN ClearAll;
389 FIX PU.outlet.p;
390 FIX BO.outlet.T;
391 FIX PU.inlet.p;
392 FIX PU.inlet.h;
393 FIX TU.eta;
394 FIX PU.eta;
395 FIX BO.eta;
396 FIX mdot;
397 END specify;
398 METHOD values;
399 PU.outlet.p := 2000 {psi};
400 BO.outlet.T := 1460 {R}; BO.outlet.h := 3400 {kJ/kg};
401 PU.inlet.p := 1 {psi};
402 PU.inlet.h := 69.73 {btu/lbm};
403 TU.eta := 1.0;
404 PU.eta := 1.0;
405 BO.eta := 1.0;
406 mdot := 900 {t/d};
407 END values;
408 METHOD on_load;
409 RUN specify;
410 RUN values;
411 END on_load;
412 METHOD self_test;
413 (* check the results against those from K Weston's book *)
414 (* note that we have NOT neglected pump work in this case! *)
415 ASSERT abs(eta - 0.4294) < 0.0005;
416 ASSERT abs(eta_carnot - 0.6152) < 0.0005;
417 ASSERT abs(TU.outlet.x - 0.7736) < 0.0005;
418 ASSERT abs(TU.w - 603.1 {btu/lbm}) < 0.7 {btu/lbm};
419 END self_test;
420 END rankine;
421
422 (*------------------------------------------------------------------------------
423 REHEAT RANKINE CYCLE
424 *)
425 MODEL rankine_reheat;
426
427 BO1 IS_A boiler_simple;
428 BO2 IS_A boiler_simple;
429 TU1 IS_A turbine_simple;
430 TU2 IS_A turbine_simple;
431 CO IS_A condenser_simple;
432 PU IS_A pump_simple;
433
434 BO1.outlet, TU1.inlet ARE_THE_SAME;
435 TU1.outlet, BO2.inlet ARE_THE_SAME;
436 BO2.outlet, TU2.inlet ARE_THE_SAME;
437 TU2.outlet, CO.inlet ARE_THE_SAME;
438 CO.outlet, PU.inlet ARE_THE_SAME;
439 PU.outlet, BO1.inlet ARE_THE_SAME;
440
441 BO1.eta, BO2.eta ARE_THE_SAME;
442
443 (* boiler peak temperature is reached for both main and reheat... *)
444 BO1.outlet.T, BO2.outlet.T ARE_THE_SAME;
445
446 mdot ALIASES PU.mdot;
447
448 T_H ALIASES BO1.outlet.T;
449 T_C ALIASES CO.outlet.T;
450
451 eta IS_A fraction;
452 eta * (BO1.Qdot_fuel + BO2.Qdot_fuel - PU.Wdot) = TU1.Wdot + TU2.Wdot;
453
454 eta_carnot IS_A fraction;
455 eta_carnot = 1 - T_C / T_H;
456
457 METHODS
458 (*
459 The on_load scenario reproduces the same calculation from
460 K Weston, op. cit., Example 2.5, p. 51.
461 *)
462 METHOD on_load;
463 FIX BO1.eta;
464 BO1.eta := 1.0;
465 FIX TU1.eta, TU2.eta;
466 TU1.eta := 1.0;
467 TU2.eta := 1.0;
468 FIX PU.eta;
469 PU.eta := 1.0;
470 FIX PU.inlet.p;
471 PU.inlet.p := 1 {psi};
472 FIX PU.inlet.h;
473 PU.inlet.h := 69.73 {btu/lbm};
474 FIX BO1.outlet.T;
475 BO1.outlet.T := 1460 {R};
476 BO1.outlet.h := 3000 {kJ/kg}; (* guess *)
477 TU1.outlet.h := 3000 {kJ/kg}; (* guess *)
478 FIX PU.outlet.p;
479 PU.outlet.p := 2000 {psi};
480 FIX mdot;
481 mdot := 900 {t/d};
482
483 (* this value here is what defines the intermediate pressure *)
484 FIX TU1.outlet.T;
485 TU1.outlet.T := 860 {R};
486
487 TU2.inlet.h := 3000 {kJ/kg}; (* guess *)
488 END on_load;
489 METHOD self_test;
490 ASSERT abs(eta - 0.443) < 0.0005;
491 ASSERT abs(TU2.outlet.x - 0.926) < 0.0015;
492 ASSERT abs(TU1.w + TU2.w) - 763.1 {btu/lbm} < 1 {btu/lbm};
493 END self_test;
494 END rankine_reheat;
495
496 (*------------------------------------------------------------------------------
497 REGENERATIVE RANKINE CYCLE
498 *)
499 (*
500 Add a boiler feedwater heater and two-stage turbine
501 *)
502 MODEL rankine_regen;
503
504 BO IS_A boiler_simple;
505 TU1 IS_A turbine_simple;
506 BL IS_A tee; (* bleed *)
507 TU2 IS_A turbine_simple;
508 CO IS_A condenser_simple;
509 HE IS_A heater_open;
510 PU1 IS_A pump_simple;
511 PU2 IS_A pump_simple;
512
513 (* main loop *)
514 BO.outlet, TU1.inlet ARE_THE_SAME;
515 TU1.outlet, BL.inlet ARE_THE_SAME;
516 BL.outlet, TU2.inlet ARE_THE_SAME;
517 TU2.outlet, CO.inlet ARE_THE_SAME;
518 CO.outlet, PU1.inlet ARE_THE_SAME;
519 PU1.outlet, HE.inlet ARE_THE_SAME;
520 HE.outlet, PU2.inlet ARE_THE_SAME;
521 PU2.outlet, BO.inlet ARE_THE_SAME;
522
523 (* bleed stream *)
524 BL.outlet_branch, HE.inlet_heat ARE_THE_SAME;
525 phi ALIASES BL.phi;
526 p_bleed ALIASES TU1.outlet.p;
527
528 mdot ALIASES BO.mdot;
529
530 T_H ALIASES BO.outlet.T;
531 T_C ALIASES CO.outlet.T;
532
533 eta IS_A fraction;
534 eta_eq:eta * (BO.Qdot_fuel) = TU1.Wdot + TU2.Wdot + PU1.Wdot + PU2.Wdot;
535
536 Wdot_TU1 ALIASES TU1.Wdot;
537 Wdot_TU2 ALIASES TU2.Wdot;
538 Wdot_PU1 ALIASES PU1.Wdot;
539 Wdot_PU2 ALIASES PU2.Wdot;
540 Qdot_fuel ALIASES BO.Qdot_fuel;
541
542 eta_carnot IS_A fraction;
543 eta_carnot = 1 - T_C / T_H;
544
545 (* some checking output... *)
546
547 phi_weston IS_A fraction;
548 phi_weston_eq:phi_weston * (TU1.outlet.h - PU1.outlet.h) = (PU2.inlet.h - PU1.outlet.h);
549 phi_eq:phi_weston = phi;
550
551 w_net IS_A specific_energy;
552 w_net_eq: TU1.mdot * w_net = TU1.mdot * (TU1.inlet.h - TU1.outlet.h) + TU2.mdot * (TU2.inlet.h - TU2.outlet.h);
553
554 q_a IS_A specific_energy;
555 q_a = TU1.inlet.h - PU2.outlet.h;
556
557 Wdot IS_A energy_rate;
558 Wdot = TU1.Wdot + TU2.Wdot + PU1.Wdot + PU2.Wdot;
559
560 cons_en: HE.inlet.mdot * HE.inlet.h + HE.inlet_heat.mdot * HE.inlet_heat.h = HE.outlet.mdot * HE.outlet.h;
561
562 METHODS
563 METHOD moran_ex_8_5;
564 (*
565 This is Example 8.5 from Moran and Shapiro, 'Fundamentals of
566 Engineering Thermodynamics', 4th Ed.
567 *)
568 RUN ClearAll;
569 (* component efficiencies *)
570 FIX BO.eta; BO.eta := 1.0;
571 FIX TU1.eta; TU1.eta := 0.85;
572 FIX TU2.eta; TU2.eta := 0.85;
573 FIX PU1.eta; PU1.eta := 1.0;
574 FIX PU2.eta; PU2.eta := 1.0;
575 (* turbine conditions *)
576 FIX TU1.inlet.p; TU1.inlet.p := 8. {MPa};
577 FIX TU1.inlet.T; TU1.inlet.T := 480 {K} + 273.15 {K};
578 FIX TU1.outlet.p; TU1.outlet.p := 0.7 {MPa};
579 FIX TU2.outlet.p; TU2.outlet.p := 0.008 {MPa};
580 (* heater conditions *)
581 FIX HE.outlet.p; HE.outlet.p := 0.7 {MPa};
582 FIX HE.outlet.x; HE.outlet.x := 0.001;
583 FIX Wdot; Wdot := 100 {MW};
584 END moran_ex_8_5;
585 METHOD weston_ex_2_6;
586 (*
587 The scenario here is example 2.6 from K Weston (op. cit.), p. 55.
588 *)
589 RUN ClearAll;
590
591 (* all ideal components *)
592 FIX BO.eta; BO.eta := 1.0;
593 FIX TU1.eta; TU1.eta := 1.0;
594 FIX TU2.eta; TU2.eta := 1.0;
595 FIX PU1.eta; PU1.eta := 1.0;
596 FIX PU2.eta; PU2.eta := 1.0;
597
598 (* mass flow rate is arbitrary *)
599 FIX mdot;
600 mdot := 10 {kg/s};
601
602 (* max pressure constraint *)
603 FIX PU2.outlet.p;
604 PU2.outlet.p := 2000 {psi};
605 PU2.outlet.h := 1400 {btu/lbm}; (* guess *)
606
607 (* boiler max temp *)
608 FIX BO.outlet.T;
609 BO.outlet.T := 1460 {R};
610 BO.outlet.h := 1400 {btu/lbm}; (* guess *)
611
612 (* intermediate temperature setting *)
613 FIX TU1.outlet.p;
614 TU1.outlet.p := 200 {psi};
615 (* FIX TU1.outlet.T;
616 TU1.outlet.T := 860 {R}; (* 400 °F *)
617 TU1.outlet.h := 3000 {kJ/kg}; (* guess *) *)
618
619 (* minimum pressure constraint *)
620 FIX CO.outlet.p;
621 CO.outlet.p := 1 {psi};
622
623 (* condenser outlet is saturated liquid *)
624 FIX CO.outlet.h;
625 CO.outlet.h := 69.73 {btu/lbm};
626
627 (* remove the redundant balance equations *)
628 HE.cons_mass.included := TRUE;
629 HE.cons_en.included := TRUE;
630 BL.cons_mass.included := FALSE;
631 phi_weston_eq.included := TRUE;
632 phi_eq.included := FALSE;
633 cons_en.included := FALSE;
634
635 (* fix the bleed ratio *)
636 FIX BL.phi;
637 BL.phi := 0.251;
638
639 (* FIX BL.outlet.h;
640 BL.outlet.h := 355.5 {btu/lbm}; *)
641
642 END weston_ex_2_6;
643 METHOD self_test;
644 ASSERT abs(TU1.inlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
645 ASSERT abs(TU1.outlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
646 ASSERT abs(TU2.outlet.s - 1.5603 {btu/lbm/R}) < 0.01 {btu/lbm/R};
647 ASSERT abs(PU1.inlet.s - 0.1326 {btu/lbm/R}) < 0.001 {btu/lbm/R};
648 ASSERT abs(PU1.outlet.s - 0.1326 {btu/lbm/R}) < 0.002 {btu/lbm/R};
649 ASSERT abs(PU2.inlet.s - 0.5438 {btu/lbm/R}) < 0.002 {btu/lbm/R};
650 ASSERT abs(PU2.outlet.s - 0.5438 {btu/lbm/R}) < 0.002 {btu/lbm/R};
651
652 ASSERT abs(TU1.inlet.h - 1474.1 {btu/lbm}) < 1.5 {btu/lbm};
653 ASSERT abs(TU1.outlet.h - 1210.0 {btu/lbm}) < 1.5 {btu/lbm};
654 ASSERT abs(TU2.outlet.h - 871.0 {btu/lbm}) < 1.5 {btu/lbm};
655 ASSERT abs(PU1.inlet.h - 69.73 {btu/lbm}) < 0.001 {btu/lbm};
656 ASSERT abs(PU1.outlet.h - 69.73 {btu/lbm}) < 1.0 {btu/lbm};
657 ASSERT abs(PU2.inlet.h - 355.5 {btu/lbm}) < 1.5 {btu/lbm};
658 ASSERT abs(PU2.outlet.h - 355.5 {btu/lbm}) < 8 {btu/lbm};
659
660 ASSERT abs(w_net - 518.1 {btu/lbm}) < 0.3 {btu/lbm};
661
662 ASSERT abs(w_net * mdot - (TU1.Wdot + TU2.Wdot)) < 1 {W};
663
664 ASSERT abs(q_a - 1118.6 {btu/lbm}) < 7 {btu/lbm};
665
666 ASSERT abs(eta - 0.463) < 0.003;
667
668 ASSERT abs(phi - 0.251) < 0.001;
669 END self_test;
670 END rankine_regen;
671
672 MODEL rankine_compare;
673 simple IS_A rankine;
674 regen IS_A rankine_regen;
675 simple.BO.inlet.p, regen.BO.inlet.p ARE_THE_SAME;
676 simple.BO.inlet.h, regen.BO.inlet.h ARE_THE_SAME;
677 simple.BO.Qdot_fuel, regen.BO.Qdot_fuel ARE_THE_SAME;
678 simple.CO.outlet.T, regen.CO.outlet.T ARE_THE_SAME;
679 simple.BO.eta, regen.BO.eta ARE_THE_SAME;
680 simple.TU.eta, regen.TU1.eta, regen.TU2.eta ARE_THE_SAME;
681 simple.PU.eta, regen.PU1.eta, regen.PU2.eta ARE_THE_SAME;
682 simple.mdot, regen.mdot ARE_THE_SAME;
683 METHODS
684 METHOD on_load;
685 RUN ClearAll;
686 RUN regen.on_load;
687 END on_load;
688 END rankine_compare;

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