1 |
(* ASCEND modelling environment |
2 |
Copyright (C) 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 |
This file contains a model of a combined-cycle power station, with |
20 |
a gas turbine (Brayton) cycle running as the 'topping' cycle and a steam |
21 |
turbine (Rankine) cycle running as the 'bottoming' cycle. Initially the |
22 |
model is being based on Example 9.13 from Moran & Shapiro, 'Fundamentals of |
23 |
Engineering Thermodynamics', 4th Ed, Wiley, 2000. |
24 |
|
25 |
See also Example 10-9 from the book Çengel & Boles |
26 |
'Thermodynamcs: An Engineering Approach, 6th Ed, McGraw-Hill, 2008. |
27 |
|
28 |
At the current revision (12 Apr 2010), this model seems to be working OK. |
29 |
The Cengel model needs convopt=RELNOM_SCALE with the QRSlv solver. The |
30 |
Moran example just works. |
31 |
|
32 |
TODO: add exergy accounting to the model. |
33 |
|
34 |
Author: John Pye |
35 |
*) |
36 |
IMPORT "johnpye/extpy/extpy"; |
37 |
|
38 |
IMPORT "johnpye/fprops/cycle_plot"; |
39 |
|
40 |
REQUIRE "johnpye/fprops/rankine_fprops.a4c"; |
41 |
REQUIRE "johnpye/brayton.a4c"; |
42 |
|
43 |
MODEL air_stream_heat_exchanger REFINES air_equipment; |
44 |
inlet_cold, outlet_cold IS_A stream_node; |
45 |
inlet.p, outlet.p ARE_THE_SAME; |
46 |
inlet_cold.p, outlet_cold.p ARE_THE_SAME; |
47 |
inlet_cold.mdot, outlet_cold.mdot ARE_THE_SAME; |
48 |
inlet_cold.cd, outlet_cold.cd ARE_THE_SAME; |
49 |
|
50 |
mdot_cold ALIASES inlet_cold.mdot; |
51 |
cd_cold ALIASES inlet_cold.cd; |
52 |
|
53 |
(* we don't have epsilon worked out or specified here, so the heat exchanged |
54 |
will depend on values specified outside this model. *) |
55 |
|
56 |
Qdot IS_A energy_rate; |
57 |
outlet.h = inlet.h + Qdot/inlet.mdot; |
58 |
outlet_cold.h = inlet_cold.h - Qdot/inlet_cold.mdot; |
59 |
METHODS |
60 |
METHOD default_self; |
61 |
RUN inlet_cold.default_self; |
62 |
RUN outlet_cold.default_self; |
63 |
END default_self; |
64 |
END air_stream_heat_exchanger; |
65 |
|
66 |
MODEL air_stream_heat_exchanger_test REFINES air_stream_heat_exchanger; |
67 |
cd_cold.component :== 'water'; |
68 |
METHODS |
69 |
METHOD on_load; |
70 |
RUN default_self; |
71 |
FIX inlet_cold.p, inlet_cold.h; |
72 |
inlet_cold.p := 50 {bar}; |
73 |
inlet_cold.h := 200 {kJ/kg}; |
74 |
FIX inlet.p, inlet.T; |
75 |
inlet.p := 1 {bar}; |
76 |
inlet.T := 700 {K}; |
77 |
FIX mdot, mdot_cold; |
78 |
mdot := 1 {kg/s}; |
79 |
mdot_cold := 0.1 {kg/s}; |
80 |
FIX Qdot; |
81 |
Qdot := 10 {kW}; |
82 |
END on_load; |
83 |
END air_stream_heat_exchanger_test; |
84 |
|
85 |
|
86 |
MODEL combinedcycle_fprops_common; |
87 |
(* define the blocks *) |
88 |
GC IS_A compressor; |
89 |
BU IS_A combustor; |
90 |
GT IS_A gas_turbine; |
91 |
HE IS_A air_stream_heat_exchanger; |
92 |
DI IS_A dissipator; |
93 |
TU IS_A turbine_simple; |
94 |
CO IS_A condenser_simple; |
95 |
PU IS_A pump_simple; |
96 |
|
97 |
(* wire up the model *) |
98 |
GC.outlet, BU.inlet ARE_THE_SAME; |
99 |
BU.outlet, GT.inlet ARE_THE_SAME; |
100 |
GT.outlet, HE.inlet ARE_THE_SAME; |
101 |
HE.outlet, DI.inlet ARE_THE_SAME; |
102 |
DI.outlet, GC.inlet ARE_THE_SAME; |
103 |
|
104 |
HE.outlet_cold, TU.inlet ARE_THE_SAME; |
105 |
TU.outlet, CO.inlet ARE_THE_SAME; |
106 |
CO.outlet, PU.inlet ARE_THE_SAME; |
107 |
PU.outlet, HE.inlet_cold ARE_THE_SAME; |
108 |
|
109 |
cd_rankine ALIASES TU.inlet.cd; |
110 |
|
111 |
Wdot, Wdot_gas, Wdot_vap IS_A energy_rate; |
112 |
Wdot_gas = GC.Wdot + GT.Wdot; |
113 |
Wdot_vap = TU.Wdot + PU.Wdot; |
114 |
Wdot = Wdot_gas + Wdot_vap; |
115 |
|
116 |
Qdot_H ALIASES BU.Qdot; |
117 |
|
118 |
eta IS_A fraction; |
119 |
eta = Wdot / Qdot_H; |
120 |
|
121 |
massflowratio IS_A factor; |
122 |
massflowratio = TU.mdot / GT.mdot; |
123 |
|
124 |
braytonpressureratio IS_A positive_factor; |
125 |
braytonpressureratio * GC.inlet.p = GC.outlet.p; |
126 |
|
127 |
METHODS |
128 |
METHOD default_self; |
129 |
RUN TU.default_self; |
130 |
RUN PU.default_self; |
131 |
RUN CO.default_self; |
132 |
RUN HE.default_self; |
133 |
END default_self; |
134 |
METHOD specify; |
135 |
(* these values should be independent of the fluid we choose to use *) |
136 |
FIX GC.eta; GC.eta := 0.84; |
137 |
FIX GT.eta; GT.eta := 0.88; |
138 |
FIX TU.eta; TU.eta := 0.90; |
139 |
FIX PU.eta; PU.eta := 0.8; |
140 |
FIX CO.outlet.x; CO.outlet.x := 1e-6; |
141 |
FIX BU.eta; BU.eta := 1; |
142 |
END specify; |
143 |
METHOD cycle_plot; |
144 |
EXTERNAL cycle_plot(SELF); |
145 |
END cycle_plot; |
146 |
END combinedcycle_fprops_common; |
147 |
|
148 |
MODEL combinedcycle_water REFINES combinedcycle_fprops_common; |
149 |
TU.inlet.cd.component :== 'water'; |
150 |
METHODS |
151 |
METHOD default_self; |
152 |
RUN combinedcycle_fprops_common::default_self; |
153 |
(* starting guess, for easy solving *) |
154 |
HE.outlet_cold.h := 3000 {kJ/kg}; |
155 |
END default_self; |
156 |
METHOD on_load; |
157 |
RUN ClearAll; |
158 |
RUN default_self; |
159 |
RUN combinedcycle_fprops_common::specify; |
160 |
FIX Wdot; Wdot := 100 {MW}; |
161 |
FIX GC.inlet.T, GC.inlet.p; |
162 |
GC.inlet.T := 300 {K}; |
163 |
GC.inlet.p := 1 {bar}; |
164 |
FIX CO.outlet.p; CO.outlet.p := 8 {kPa}; |
165 |
|
166 |
(* optimisable *) |
167 |
FIX braytonpressureratio; braytonpressureratio := 8; |
168 |
|
169 |
FIX HE.outlet.T; HE.outlet.T := 400 {K}; |
170 |
FIX BU.outlet.T; BU.outlet.T := 1300 {K}; |
171 |
FIX TU.inlet.T; TU.inlet.T := 600 {K}; |
172 |
FIX TU.inlet.p; TU.inlet.p := 50 {bar}; |
173 |
END on_load; |
174 |
END combinedcycle_water; |
175 |
|
176 |
|
177 |
MODEL combinedcycle_co2 REFINES combinedcycle_fprops_common; |
178 |
TU.inlet.cd.component :== 'carbondioxide'; |
179 |
METHODS |
180 |
METHOD default_self; |
181 |
RUN combinedcycle_fprops_common::default_self; |
182 |
(* starting guess, for easy solving *) |
183 |
HE.outlet_cold.h := 200 {kJ/kg}; |
184 |
CO.outlet.h := 200 {kJ/kg}; |
185 |
END default_self; |
186 |
METHOD on_load; |
187 |
RUN ClearAll; |
188 |
RUN default_self; |
189 |
RUN combinedcycle_fprops_common::specify; |
190 |
FIX Wdot; Wdot := 100 {MW}; |
191 |
FIX GC.inlet.T, GC.inlet.p; |
192 |
GC.inlet.T := 300 {K}; |
193 |
GC.inlet.p := 1 {bar}; |
194 |
FIX CO.outlet.p; CO.outlet.p := 5.2 {bar}; |
195 |
|
196 |
(* optimisable *) |
197 |
FIX braytonpressureratio; braytonpressureratio := 8; |
198 |
|
199 |
FIX HE.outlet.T; HE.outlet.T := 400 {K}; |
200 |
FIX BU.outlet.T; BU.outlet.T := 1300 {K}; |
201 |
FIX TU.inlet.T; TU.inlet.T := 600 {K}; |
202 |
FIX TU.inlet.p; TU.inlet.p := 50 {bar}; |
203 |
|
204 |
SOLVER QRSlv; |
205 |
OPTION convopt 'RELNOM_SCALE'; |
206 |
END on_load; |
207 |
END combinedcycle_co2; |
208 |
|
209 |
|
210 |
MODEL combinedcycle_toluene REFINES combinedcycle_fprops_common; |
211 |
TU.inlet.cd.component :== 'toluene'; |
212 |
METHODS |
213 |
METHOD default_self; |
214 |
RUN combinedcycle_fprops_common::default_self; |
215 |
(* starting guess, for easy solving *) |
216 |
HE.outlet_cold.h := 400 {kJ/kg}; |
217 |
CO.outlet.h := 400 {kJ/kg}; |
218 |
END default_self; |
219 |
METHOD on_load; |
220 |
RUN ClearAll; |
221 |
RUN default_self; |
222 |
RUN combinedcycle_fprops_common::specify; |
223 |
FIX Wdot; Wdot := 100 {MW}; |
224 |
FIX GC.inlet.T, GC.inlet.p; |
225 |
GC.inlet.T := 300 {K}; |
226 |
GC.inlet.p := 1 {bar}; |
227 |
FIX CO.outlet.p; CO.outlet.p := 8 {kPa}; |
228 |
|
229 |
(* optimisable *) |
230 |
FIX braytonpressureratio; braytonpressureratio := 8; |
231 |
|
232 |
FIX HE.outlet.T; HE.outlet.T := 400 {K}; |
233 |
FIX BU.outlet.T; BU.outlet.T := 1300 {K}; |
234 |
FIX TU.inlet.T; TU.inlet.T := 600 {K}; |
235 |
FIX TU.inlet.p; TU.inlet.p := 50 {bar}; |
236 |
|
237 |
SOLVER QRSlv; |
238 |
OPTION convopt 'RELNOM_SCALE'; |
239 |
END on_load; |
240 |
END combinedcycle_toluene; |
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
MODEL combinedcycle_fprops REFINES combinedcycle_water; |
247 |
METHODS |
248 |
METHOD on_load; |
249 |
RUN default_self; |
250 |
RUN cengel_ex_10_9; |
251 |
SOLVER QRSlv; |
252 |
OPTION convopt 'RELNOM_SCALE'; |
253 |
END on_load; |
254 |
|
255 |
METHOD moran_ex_9_13; |
256 |
RUN ClearAll; |
257 |
FIX Wdot; Wdot := 45 {MW}; |
258 |
|
259 |
FIX GC.inlet.T, GC.inlet.p; |
260 |
GC.inlet.T := 300 {K}; |
261 |
GC.inlet.p := 100 {kPa}; |
262 |
|
263 |
FIX GC.outlet.p; |
264 |
GC.outlet.p := 1200 {kPa}; |
265 |
|
266 |
FIX GC.eta; GC.eta := 0.84; |
267 |
|
268 |
FIX BU.outlet.T; BU.outlet.T := 1400 {K}; |
269 |
|
270 |
FIX GT.eta; GT.eta := 0.88; |
271 |
|
272 |
(* GT.outlet.p := 100 {kPa};*) |
273 |
FIX HE.outlet.T; HE.outlet.T := 400 {K}; |
274 |
|
275 |
FIX TU.inlet.T, TU.inlet.p; |
276 |
TU.inlet.T := 400 {K} + 273.15 {K}; |
277 |
TU.inlet.p := 8 {MPa}; |
278 |
FIX TU.outlet.p; TU.outlet.p := 8 {kPa}; |
279 |
|
280 |
FIX PU.inlet.x; |
281 |
PU.inlet.x := 0.0001; |
282 |
|
283 |
FIX TU.eta; TU.eta := 0.90; |
284 |
FIX PU.eta; PU.eta := 0.8; |
285 |
|
286 |
(* assumed *) |
287 |
FIX BU.eta; |
288 |
BU.eta := 1; |
289 |
END moran_ex_9_13; |
290 |
|
291 |
METHOD cengel_ex_10_9; |
292 |
RUN ClearAll; |
293 |
FIX Wdot; Wdot := 100 {MW}; |
294 |
|
295 |
FIX GC.inlet.p; GC.inlet.p := 1 {atm}; (* assumed *) |
296 |
|
297 |
FIX braytonpressureratio; braytonpressureratio := 8; |
298 |
|
299 |
FIX GC.inlet.T; GC.inlet.T := 300 {K}; |
300 |
FIX GT.inlet.T; GT.inlet.T := 1300 {K}; |
301 |
|
302 |
FIX GC.eta; GC.eta := 0.8; |
303 |
FIX GT.eta; GT.eta := 0.85; |
304 |
|
305 |
FIX TU.inlet.p; TU.inlet.p := 7 {MPa}; |
306 |
FIX CO.outlet.p; CO.outlet.p := 5 {kPa}; |
307 |
|
308 |
FIX TU.inlet.T; TU.inlet.T := 500 {K} + 273.15 {K}; |
309 |
FIX DI.inlet.T; DI.inlet.T := 450 {K}; |
310 |
|
311 |
(* 'complete' condensation... bit of a hack *) |
312 |
FIX CO.outlet.x; CO.outlet.x := 0.0001; |
313 |
|
314 |
(* 'simple ideal Rankine cycle *) |
315 |
FIX TU.eta; TU.eta := 1; |
316 |
FIX BU.eta; BU.eta := 1; |
317 |
FIX PU.eta; PU.eta := 1; |
318 |
|
319 |
(* first guess, for easy solving *) |
320 |
HE.outlet_cold.h := 3000 {kJ/kg}; |
321 |
END cengel_ex_10_9; |
322 |
|
323 |
END combinedcycle_fprops; |