/[ascend]/trunk/models/test/bug564/brayton_fprops.a4c
ViewVC logotype

Contents of /trunk/models/test/bug564/brayton_fprops.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2690 - (show annotations) (download) (as text)
Mon Mar 4 12:38:28 2013 UTC (6 years, 8 months ago) by jpye
File MIME type: text/x-ascend
File size: 10575 byte(s)
Trying to write self-contained test case for bug 564.
1 (* ASCEND modelling environment
2 Copyright (C) 2007-2012 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, see <http://www.gnu.org/licenses/>.
16 *)(*
17 The Rankine-cycle has been altered to become a Brayton cycle to analyse a
18 supercritical CO2 brayton cycle.
19
20 Authors: Rachel Hogan, John Pye
21 *)
22
23 REQUIRE "atoms.a4l";
24 REQUIRE "johnpye/thermo_types.a4c";
25 REQUIRE "johnpye/airprops.a4c";
26 REQUIRE "test/bug564/rankine_fprops.a4c";
27 REQUIRE "test/bug564/heatex_pinch.a4c";
28
29 IMPORT "sensitivity/solve";
30
31 (*------------------------------------------------------------------------------
32 MERGE PIECE
33 *)
34
35 (*
36 Joining two streams
37 *)
38 MODEL merge;
39 NOTES
40 'block' SELF {Model of a joining of two flow streams}
41 END NOTES;
42
43 inlet "in:" IS_A stream_node;
44 inlet_branch "in:" IS_A stream_node;
45 outlet "out:" IS_A stream_node;
46
47 inlet.cd, inlet_branch.cd, outlet.cd ARE_THE_SAME;
48 cd ALIASES inlet.cd;
49
50 inlet.p, inlet_branch.p, outlet.p ARE_THE_SAME;
51 (*inlet.h, inlet_branch.h, outlet.h ARE_THE_SAME;*)
52
53 (* cons. mass *)
54 cons_mass: inlet.mdot + inlet_branch.mdot= outlet.mdot;
55
56 (* cons. energy*)
57 cons_energy: inlet.mdot*inlet.h+inlet_branch.mdot*inlet_branch.h= outlet.mdot*outlet.h;
58
59 phi IS_A fraction;
60 phi_eq: phi * outlet.mdot = inlet_branch.mdot;
61 METHODS
62 METHOD default_self;
63 RUN inlet.default_self;
64 RUN outlet.default_self;
65 RUN inlet_branch.default_self;
66 END default_self;
67 END merge;
68
69
70 (*------------------------------------------------------------------------------
71 OVERALL CYCLE
72 *)
73
74 (*
75 Simple Brayton cycle.
76
77 This is an improvement on the earlier models/johnpye/brayton.a4c since it
78 allows non-ideal fluids to be used, with evalation done by FPROPS. You won't
79 be able to load both at the same time currently, because the models have the
80 same name.
81 *)
82 MODEL brayton_common;
83
84 BO IS_A boiler_simple;
85 TU IS_A turbine_simple;
86 CO IS_A condenser_simple;
87 PU IS_A pump_simple;
88 cd ALIASES BO.cd;
89
90 BO.outlet, TU.inlet ARE_THE_SAME;
91 TU.outlet, CO.inlet ARE_THE_SAME;
92 CO.outlet, PU.inlet ARE_THE_SAME;
93 PU.outlet, BO.inlet ARE_THE_SAME;
94 braytonpressureratio IS_A positive_factor;
95 braytonpressureratio * PU.inlet.p = TU.outlet.p;
96
97 Wdot IS_A energy_rate;
98 Wdot = PU.Wdot + TU.Wdot;
99
100 Qdot_loss ALIASES CO.Qdot;
101 T_H ALIASES BO.outlet.T;
102 T_C ALIASES CO.outlet.T;
103
104 eta IS_A fraction;
105 eta * (BO.Qdot) = Wdot;
106
107 eta_carnot IS_A fraction;
108 eta_carnot = 1 - T_C / T_H;
109
110 Qdot IS_A energy_rate;
111 Qdot = BO.Qdot + CO.Qdot;
112
113 DE_cycle IS_A energy_rate;
114 DE_cycle = Qdot-Wdot;
115
116 r_bw IS_A factor;
117 r_bw = -PU.Wdot / TU.Wdot;
118
119 mdot ALIASES TU.mdot;
120 x_turb_out ALIASES TU.outlet.x;
121
122 METHODS
123 METHOD on_load;
124 FIX PU.eta, TU.eta;
125 PU.eta := 0.8;
126 TU.eta := 0.85;
127 FIX PU.inlet.T, TU.inlet.T;
128 CO.inlet.T := 300 {K};
129 TU.inlet.T := 1300 {K};
130 FIX PU.r;
131 PU.r := 8;
132 FIX PU.inlet.p;
133 PU.inlet.p := 1 {bar};
134 FIX PU.inlet.mdot;
135 PU.inlet.mdot := 1 {kg/s};
136 FIX BO.eta;
137 BO.eta := 1;
138 END on_load;
139 METHOD default_self;
140 RUN BO.default_self;
141 RUN TU.default_self;
142 RUN CO.default_self;
143 RUN PU.default_self;
144 END default_self;
145 END brayton_common;
146
147
148 MODEL brayton_co2 REFINES brayton_common;
149 cd.component :== 'carbondioxide';
150 cd.type :== 'helmholtz';
151 METHODS
152 METHOD on_load;
153 RUN ClearAll;
154 RUN default_self;
155 FIX BO.eta; BO.eta := 1.0;
156 FIX TU.eta; TU.eta := 0.85;
157 FIX PU.eta; PU.eta := 0.8;
158 FIX Wdot; Wdot := 100 {MW};
159 FIX CO.outlet.T; CO.outlet.T := 10 {K} + 273.15 {K};
160 FIX CO.outlet.x; CO.outlet.x := 1e-6;
161 FIX PU.outlet.p; PU.outlet.p := 150 {bar};
162 FIX BO.outlet.T; BO.outlet.T := 580 {K} + 273.15 {K};
163
164 SOLVER QRSlv;
165 OPTION convopt 'RELNOM_SCALE';
166 OPTION iterationlimit 200;
167 END on_load;
168 METHOD default_self;
169 RUN brayton_common::default_self;
170 BO.outlet.h := 350 {kJ/kg}; (* guess *)
171 TU.outlet.h := 1000 {kJ/kg}; (* guess *)
172 CO.outlet.h := 350 {kJ/kg};
173 CO.outlet.p := 60 {bar};
174 CO.outlet.p.lower_bound := 5.2 {bar};
175 END default_self;
176 END brayton_co2;
177
178
179 (*------------------------------------------------------------------------------
180 REGENERATIVE BRAYTON CYCLE, again using FPROPS instead of ideal air
181 *)
182
183 (*
184 Regenerator: heat exchanger
185
186 Assumption: fluid on both sides have the same c_p.
187 *** FIXME is that still true now that we're calculating on enthalpy??
188 *)
189 MODEL regenerator REFINES heatex_pinch;
190 DT,DT1,DT2 IS_A delta_temperature;
191 DT = inlet_hot.T - inlet.T;
192 DT1 = outlet_hot.T - inlet.T;
193 DT2 = inlet_hot.T - outlet.T;
194
195 epsilon IS_A fraction;
196
197 mdot_min IS_A mass_rate;
198 mdot_min = inlet.mdot + 0.5*(inlet.mdot - inlet_hot.mdot + abs(inlet.mdot - inlet_hot.mdot));
199
200 eps_eq: Qdot = epsilon * mdot_min * (inlet_hot.h - inlet.h);
201 METHODS
202 METHOD bound_self;
203 DT1.lower_bound := 0 {K};
204 DT2.lower_bound := 0 {K};
205 DT.lower_bound := 0 {K};
206 END bound_self;
207 END regenerator;
208
209 MODEL regenerator_test REFINES regenerator;
210 inlet.cd.component :== 'carbondioxide';
211 inlet.cd.type :== 'helmholtz';
212 inlet_hot.cd, inlet.cd ARE_THE_SAME;
213 n :== 8;
214 METHODS
215 METHOD on_load;
216 RUN heatex_pinch::default_self;
217 RUN bound_self;
218 RUN heatex_pinch::default_self;
219 (* heat transfer for a particular value of temperature drop at the pinch *)
220 FIX inlet.p := 200 {bar};
221 FIX inlet_hot.p := 70 {bar}; (* doesn't currently solve for CO2 if the pressure is too low... needed to figure out why *)
222 FIX inlet_hot.T := 100 {K} + 273.15 {K};
223 FIX inlet.T := 31 {K} + 273.15 {K};
224 FIX mdot_hot := 1.1 {kg/s};
225 FIX mdot := 0.81 {kg/s};
226 FIX DT_pinch := 10 {K};
227 END on_load;
228 END regenerator_test;
229
230 MODEL brayton_regen;
231 NOTES
232 'description' SELF {
233 This is a model of a regenerative Brayton cycle with
234 irreversible compressor (eta=0.8) and turbine (eta=0.85) operating
235 between 300 K and 1300 K, with a compression ratio of 8 and an
236 assumed inlet pressure of 1 bar. The regenerator effectiveness is
237 0.8.
238
239 Based on example 9-7 from Çengel & Boles, 'Thermodynamics: An
240 Engineering Approach', 6th Ed, McGraw-Hill, 2008}
241 END NOTES;
242
243
244 BO IS_A boiler_simple;
245 TU IS_A turbine_simple;
246 CO IS_A condenser_simple;
247 PU IS_A pump_simple;
248 RE IS_A heatex_pinch;
249 cd ALIASES BO.cd;
250 cd.component :== 'carbondioxide';
251 cd.type :== 'helmholtz';
252 RE.n :== 8;
253
254 PU.outlet, RE.inlet ARE_THE_SAME;
255 RE.outlet, BO.inlet ARE_THE_SAME;
256 BO.outlet, TU.inlet ARE_THE_SAME;
257 TU.outlet, RE.inlet_hot ARE_THE_SAME;
258 RE.outlet_hot, CO.inlet ARE_THE_SAME;
259 CO.outlet, PU.inlet ARE_THE_SAME;
260
261 Wdot_PU ALIASES PU.Wdot;
262 Wdot_TU ALIASES TU.Wdot;
263 Wdot IS_A energy_rate;
264 Wdot = Wdot_PU + Wdot_TU;
265
266 Qdot_BO ALIASES BO.Qdot;
267 Qdot_CO ALIASES CO.Qdot;
268
269 Qdot IS_A energy_rate;
270 Qdot = Qdot_BO + Qdot_CO;
271
272 Edot IS_A energy_rate;
273 Edot = Wdot - Qdot;
274
275 eta IS_A factor;
276 eta = Wdot / Qdot_BO;
277
278 therm_eff IS_A fraction;
279 therm_eff = ((TU.Wdot)/(TU.mdot)+(PU.Wdot)/(PU.mdot))/(BO.Qdot/BO.mdot);
280
281 r_bw IS_A factor;
282 r_bw = -Wdot_PU / Wdot_TU;
283
284 Qdot_RE ALIASES RE.Qdot;
285
286 eta_TU ALIASES TU.eta;
287 eta_PU ALIASES PU.eta;
288 DT_RE ALIASES RE.DT_pinch;
289 METHODS
290 METHOD default_self;
291 RUN BO.default_self;
292 RUN TU.default_self;
293 RUN CO.default_self;
294 RUN PU.default_self;
295 RUN RE.default_self;
296 END default_self;
297 METHOD on_load;
298 RUN default_self;
299 FIX PU.eta, TU.eta;
300 PU.eta := 0.8;
301 TU.eta := 0.85;
302 FIX PU.inlet.T, TU.inlet.T;
303 PU.inlet.T := 310. {K};
304 TU.inlet.T := 1200. {K};
305 FIX BO.Qdot_fuel := 353 {kW};
306 FIX PU.outlet.p := 50 {MPa};
307 FIX PU.inlet.p;
308 PU.inlet.p := 7.4 {MPa};
309 (*FIX PU.inlet.mdot;
310 PU.inlet.mdot := 1 {kg/s};*)
311 FIX BO.eta;
312 BO.eta := 1;
313 FIX RE.DT_pinch;
314 RE.DT_pinch := 10 {K};
315 END on_load;
316 END brayton_regen;
317
318
319 MODEL brayton_regen_reheat_intercool;
320 BU1, BU2 IS_A boiler_simple;
321 TU1, TU2 IS_A turbine_simple;
322 CO1, CO2 IS_A pump_simple;
323 RE IS_A heatex_pinch;
324 DI1 IS_A condenser_simple; (* let's call it a 'dissipator' in this case *)
325 DI2 IS_A condenser_simple;
326 cd ALIASES BU1.cd;
327
328 BU1.outlet, TU1.inlet ARE_THE_SAME;
329 TU1.outlet, BU2.inlet ARE_THE_SAME;
330 BU2.outlet, TU2.inlet ARE_THE_SAME;
331 TU2.outlet, RE.inlet_hot ARE_THE_SAME;
332 RE.outlet_hot, DI1.inlet ARE_THE_SAME;
333 DI1.outlet, CO1.inlet ARE_THE_SAME;
334 CO1.outlet, DI2.inlet ARE_THE_SAME;
335 DI2.outlet, CO2.inlet ARE_THE_SAME;
336 CO2.outlet, RE.inlet ARE_THE_SAME;
337 RE.outlet, BU1.inlet ARE_THE_SAME;
338
339 T_H, T_L IS_A temperature;
340 T_L, DI1.outlet.T, DI2.outlet.T ARE_THE_SAME;
341 T_H, BU1.outlet.T, BU2.outlet.T ARE_THE_SAME;
342 p_1 ALIASES CO1.inlet.p;
343 p_2a ALIASES CO1.outlet.p;
344 p_2b ALIASES TU1.outlet.p;
345 p_3 ALIASES CO2.outlet.p;
346 DT_RE ALIASES RE.DT_pinch;
347
348 Wdot, Qdot_H, Qdot_L IS_A energy_rate;
349 Wdot = TU1.Wdot + TU2.Wdot + CO1.Wdot + CO2.Wdot;
350 Qdot_H = BU1.Qdot + BU2.Qdot;
351 Qdot_L = DI1.Qdot + DI2.Qdot;
352 Qdot_RE ALIASES RE.Qdot;
353
354 eta IS_A fraction;
355 eta = Wdot / Qdot_H;
356 METHODS
357 METHOD default_self;
358 RUN BU1.default_self;
359 RUN BU2.default_self;
360 RUN TU1.default_self;
361 RUN TU2.default_self;
362 RUN CO1.default_self;
363 RUN CO2.default_self;
364 RUN RE.default_self;
365 RUN DI1.default_self;
366 RUN DI2.default_self;
367 END default_self;
368 METHOD on_load;
369 RUN RE.bound_self;
370 RUN default_self;
371 FIX BU1.eta := 1;
372 FIX BU2.eta := 1;
373 FIX TU1.eta := 0.85;
374 FIX TU2.eta := 0.85;
375 FIX CO1.eta := 0.8;
376 FIX CO2.eta := 0.8;
377 FIX RE.DT_pinch := 10 {K};
378 FIX BU1.mdot := 1{kg/s};
379 END on_load;
380 END brayton_regen_reheat_intercool;
381
382
383 MODEL brayton_regen_reheat_intercool_co2 REFINES brayton_regen_reheat_intercool;
384 cd.component :== 'carbondioxide';
385 cd.type :== 'helmholtz';
386 RE.n :== 8;
387 METHODS
388 METHOD on_load;
389 RUN brayton_regen_reheat_intercool::on_load;
390 FIX T_L := 30 {K} + 273.15 {K}; (* a little on the low side? *)
391 FIX T_H := 650 {K} + 273.15 {K};
392 FIX p_1 := 74 {bar};
393 FIX p_2a := 150 {bar};
394 FIX p_2b := p_2a;
395 FIX p_3 := 300 {bar};
396 (* FIX RE.epsilon := 0.77; *)
397 FIX RE.DT_pinch := 15 {K};
398 END on_load;
399 END brayton_regen_reheat_intercool_co2;

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