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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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