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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2285 - (show annotations) (download) (as text)
Sat Aug 14 13:47:07 2010 UTC (9 years, 2 months ago) by jpye
File MIME type: text/x-ascend
File size: 8319 byte(s)
Added routine to calculate ideal->m and ideal->c for desired reference state values.
Adjusted toluene reference state so that s=0, h=0 for liquid at the triple pt.
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
37 REQUIRE "johnpye/fprops/rankine_fprops.a4c";
38 REQUIRE "johnpye/brayton.a4c";
39
40 MODEL air_stream_heat_exchanger REFINES air_equipment;
41 inlet_cold, outlet_cold IS_A stream_node;
42 inlet.p, outlet.p ARE_THE_SAME;
43 inlet_cold.p, outlet_cold.p ARE_THE_SAME;
44 inlet_cold.mdot, outlet_cold.mdot ARE_THE_SAME;
45 inlet_cold.cd, outlet_cold.cd ARE_THE_SAME;
46
47 mdot_cold ALIASES inlet_cold.mdot;
48 cd_cold ALIASES inlet_cold.cd;
49
50 (* we don't have epsilon worked out or specified here, so the heat exchanged
51 will depend on values specified outside this model. *)
52
53 Qdot IS_A energy_rate;
54 outlet.h = inlet.h + Qdot/inlet.mdot;
55 outlet_cold.h = inlet_cold.h - Qdot/inlet_cold.mdot;
56 METHODS
57 METHOD default_self;
58 RUN inlet_cold.default_self;
59 RUN outlet_cold.default_self;
60 END default_self;
61 END air_stream_heat_exchanger;
62
63 MODEL air_stream_heat_exchanger_test REFINES air_stream_heat_exchanger;
64 cd_cold.component :== 'water';
65 METHODS
66 METHOD on_load;
67 RUN default_self;
68 FIX inlet_cold.p, inlet_cold.h;
69 inlet_cold.p := 50 {bar};
70 inlet_cold.h := 200 {kJ/kg};
71 FIX inlet.p, inlet.T;
72 inlet.p := 1 {bar};
73 inlet.T := 700 {K};
74 FIX mdot, mdot_cold;
75 mdot := 1 {kg/s};
76 mdot_cold := 0.1 {kg/s};
77 FIX Qdot;
78 Qdot := 10 {kW};
79 END on_load;
80 END air_stream_heat_exchanger_test;
81
82
83 MODEL combinedcycle_fprops_common;
84 (* define the blocks *)
85 GC IS_A compressor;
86 BU IS_A combustor;
87 GT IS_A gas_turbine;
88 HE IS_A air_stream_heat_exchanger;
89 DI IS_A dissipator;
90 TU IS_A turbine_simple;
91 CO IS_A condenser_simple;
92 PU IS_A pump_simple;
93
94 (* wire up the model *)
95 GC.outlet, BU.inlet ARE_THE_SAME;
96 BU.outlet, GT.inlet ARE_THE_SAME;
97 GT.outlet, HE.inlet ARE_THE_SAME;
98 HE.outlet, DI.inlet ARE_THE_SAME;
99 DI.outlet, GC.inlet ARE_THE_SAME;
100
101 HE.outlet_cold, TU.inlet ARE_THE_SAME;
102 TU.outlet, CO.inlet ARE_THE_SAME;
103 CO.outlet, PU.inlet ARE_THE_SAME;
104 PU.outlet, HE.inlet_cold ARE_THE_SAME;
105
106 cd_rankine ALIASES TU.inlet.cd;
107
108 Wdot, Wdot_gas, Wdot_vap IS_A energy_rate;
109 Wdot_gas = GC.Wdot + GT.Wdot;
110 Wdot_vap = TU.Wdot + PU.Wdot;
111 Wdot = Wdot_gas + Wdot_vap;
112
113 Qdot_H ALIASES BU.Qdot;
114
115 eta IS_A fraction;
116 eta = Wdot / Qdot_H;
117
118 massflowratio IS_A factor;
119 massflowratio = TU.mdot / GT.mdot;
120
121 braytonpressureratio IS_A positive_factor;
122 braytonpressureratio * GC.inlet.p = GC.outlet.p;
123
124 METHODS
125 METHOD default_self;
126 RUN TU.default_self;
127 RUN PU.default_self;
128 RUN CO.default_self;
129 RUN HE.default_self;
130 END default_self;
131 METHOD specify;
132 (* these values should be independent of the fluid we choose to use *)
133 FIX GC.eta; GC.eta := 0.84;
134 FIX GT.eta; GT.eta := 0.88;
135 FIX TU.eta; TU.eta := 0.90;
136 FIX PU.eta; PU.eta := 0.8;
137 FIX CO.outlet.x; CO.outlet.x := 1e-6;
138 FIX BU.eta; BU.eta := 1;
139 END specify;
140 END combinedcycle_fprops_common;
141
142 MODEL combinedcycle_water REFINES combinedcycle_fprops_common;
143 TU.inlet.cd.component :== 'water';
144 METHODS
145 METHOD default_self;
146 RUN combinedcycle_fprops_common::default_self;
147 (* starting guess, for easy solving *)
148 HE.outlet_cold.h := 3000 {kJ/kg};
149 END default_self;
150 METHOD on_load;
151 RUN ClearAll;
152 RUN default_self;
153 RUN combinedcycle_fprops_common::specify;
154 FIX Wdot; Wdot := 100 {MW};
155 FIX GC.inlet.T, GC.inlet.p;
156 GC.inlet.T := 300 {K};
157 GC.inlet.p := 1 {bar};
158 FIX CO.outlet.p; CO.outlet.p := 8 {kPa};
159
160 (* optimisable *)
161 FIX braytonpressureratio; braytonpressureratio := 8;
162
163 FIX HE.outlet.T; HE.outlet.T := 400 {K};
164 FIX BU.outlet.T; BU.outlet.T := 1300 {K};
165 FIX TU.inlet.T; TU.inlet.T := 600 {K};
166 FIX TU.inlet.p; TU.inlet.p := 50 {bar};
167 END on_load;
168 END combinedcycle_water;
169
170
171 MODEL combinedcycle_co2 REFINES combinedcycle_fprops_common;
172 TU.inlet.cd.component :== 'carbondioxide';
173 METHODS
174 METHOD default_self;
175 RUN combinedcycle_fprops_common::default_self;
176 (* starting guess, for easy solving *)
177 HE.outlet_cold.h := 80 {kJ/kg};
178 END default_self;
179 METHOD on_load;
180 RUN ClearAll;
181 RUN default_self;
182 RUN combinedcycle_fprops_common::specify;
183 FIX Wdot; Wdot := 100 {MW};
184 FIX GC.inlet.T, GC.inlet.p;
185 GC.inlet.T := 300 {K};
186 GC.inlet.p := 1 {bar};
187 FIX CO.outlet.p; CO.outlet.p := 518 {kPa};
188
189 (* optimisable *)
190 FIX braytonpressureratio; braytonpressureratio := 8;
191
192 FIX HE.outlet.T; HE.outlet.T := 400 {K};
193 FIX BU.outlet.T; BU.outlet.T := 1300 {K};
194 FIX TU.inlet.T; TU.inlet.T := 600 {K};
195 FIX TU.inlet.p; TU.inlet.p := 50 {bar};
196 END on_load;
197 END combinedcycle_co2;
198
199
200 MODEL combinedcycle_toluene REFINES combinedcycle_fprops_common;
201 TU.inlet.cd.component :== 'toluene';
202 METHODS
203 METHOD default_self;
204 RUN combinedcycle_fprops_common::default_self;
205 (* starting guess, for easy solving *)
206 HE.outlet_cold.h := 400 {kJ/kg};
207 CO.outlet.h := 400 {kJ/kg};
208 END default_self;
209 METHOD on_load;
210 RUN ClearAll;
211 RUN default_self;
212 RUN combinedcycle_fprops_common::specify;
213 FIX Wdot; Wdot := 100 {MW};
214 FIX GC.inlet.T, GC.inlet.p;
215 GC.inlet.T := 300 {K};
216 GC.inlet.p := 1 {bar};
217 FIX CO.outlet.p; CO.outlet.p := 8 {kPa};
218
219 (* optimisable *)
220 FIX braytonpressureratio; braytonpressureratio := 8;
221
222 FIX HE.outlet.T; HE.outlet.T := 400 {K};
223 FIX BU.outlet.T; BU.outlet.T := 1300 {K};
224 FIX TU.inlet.T; TU.inlet.T := 600 {K};
225 FIX TU.inlet.p; TU.inlet.p := 50 {bar};
226
227 SOLVER QRSlv;
228 OPTION convopt 'RELNOM_SCALE';
229 END on_load;
230 END combinedcycle_toluene;
231
232
233
234
235
236 MODEL combinedcycle_fprops REFINES combinedcycle_water;
237 METHODS
238 METHOD on_load;
239 RUN default_self;
240 RUN cengel_ex_10_9;
241 SOLVER QRSlv;
242 OPTION convopt 'RELNOM_SCALE';
243 END on_load;
244
245 METHOD moran_ex_9_13;
246 RUN ClearAll;
247 FIX Wdot; Wdot := 45 {MW};
248
249 FIX GC.inlet.T, GC.inlet.p;
250 GC.inlet.T := 300 {K};
251 GC.inlet.p := 100 {kPa};
252
253 FIX GC.outlet.p;
254 GC.outlet.p := 1200 {kPa};
255
256 FIX GC.eta; GC.eta := 0.84;
257
258 FIX BU.outlet.T; BU.outlet.T := 1400 {K};
259
260 FIX GT.eta; GT.eta := 0.88;
261
262 (* GT.outlet.p := 100 {kPa};*)
263 FIX HE.outlet.T; HE.outlet.T := 400 {K};
264
265 FIX TU.inlet.T, TU.inlet.p;
266 TU.inlet.T := 400 {K} + 273.15 {K};
267 TU.inlet.p := 8 {MPa};
268 FIX TU.outlet.p; TU.outlet.p := 8 {kPa};
269
270 FIX PU.inlet.x;
271 PU.inlet.x := 0.0001;
272
273 FIX TU.eta; TU.eta := 0.90;
274 FIX PU.eta; PU.eta := 0.8;
275
276 (* assumed *)
277 FIX BU.eta;
278 BU.eta := 1;
279 END moran_ex_9_13;
280
281 METHOD cengel_ex_10_9;
282 RUN ClearAll;
283 FIX Wdot; Wdot := 100 {MW};
284
285 FIX GC.inlet.p; GC.inlet.p := 1 {atm}; (* assumed *)
286
287 FIX braytonpressureratio; braytonpressureratio := 8;
288
289 FIX GC.inlet.T; GC.inlet.T := 300 {K};
290 FIX GT.inlet.T; GT.inlet.T := 1300 {K};
291
292 FIX GC.eta; GC.eta := 0.8;
293 FIX GT.eta; GT.eta := 0.85;
294
295 FIX TU.inlet.p; TU.inlet.p := 7 {MPa};
296 FIX CO.outlet.p; CO.outlet.p := 5 {kPa};
297
298 FIX TU.inlet.T; TU.inlet.T := 500 {K} + 273.15 {K};
299 FIX DI.inlet.T; DI.inlet.T := 450 {K};
300
301 (* 'complete' condensation... bit of a hack *)
302 FIX CO.outlet.x; CO.outlet.x := 0.0001;
303
304 (* 'simple ideal Rankine cycle *)
305 FIX TU.eta; TU.eta := 1;
306 FIX BU.eta; BU.eta := 1;
307 FIX PU.eta; PU.eta := 1;
308
309 (* first guess, for easy solving *)
310 HE.outlet_cold.h := 3000 {kJ/kg};
311 END cengel_ex_10_9;
312
313 END combinedcycle_fprops;

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