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