/[ascend]/trunk/models/johnpye/condenser.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/condenser.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 261 - (show annotations) (download) (as text)
Thu Feb 2 16:15:32 2006 UTC (18 years, 4 months ago) by johnpye
File MIME type: text/x-ascend
File size: 4759 byte(s)
Adding non-saturated condenser mode
1 REQUIRE "johnpye/ideal_steam.a4c";
2 REQUIRE "johnpye/iapws_sat_curves.a4c";
3 REQUIRE "johnpye/iapws95.a4c";
4
5 MODEL condenser_lmtd(
6 S_in WILL_BE thermo_state;
7 S_out WILL_BE thermo_state;
8 );
9 T_h1 ALIASES S_in.T;
10 T_h2 ALIASES S_out.T;
11
12 mdot_in IS_A mass_rate;
13
14 T_c1 IS_A temperature; (* cold inlet *)
15 T_c2 IS_A temperature; (* cold outlet *)
16
17 LMTD IS_A delta_temperature;
18
19 DT_1, DT_2 IS_A delta_temperature;
20
21 DT_1 = T_h1 - T_c2;
22 DT_2 = T_h2 - T_c1;
23
24 lmtd: LMTD = (DT_1 - DT_2) / ln(DT_1/DT_2);
25
26 UA IS_A ua_value;
27 q IS_A energy_rate;
28
29 q = UA * LMTD;
30
31 q = mdot_in * (S_in.h - S_out.h);
32
33 S_out.p = S_in.p;
34
35 METHODS
36 METHOD specify;
37 FIX UA;
38 FIX T_c1;
39 FIX mdot_in;
40 END specify;
41 METHOD values;
42 UA := 1000 {W/m^2/K} * 4 {m} * 900 * 2*3.1415926* (0.01 {m})/2;
43 T_c1 := 273.15{K} + 200 {K};
44 mdot_in := 1 {kg/s};
45 (* free values *)
46 T_c2 := 273.15{K} + 240 {K};
47 END values;
48 METHOD bound_self;
49 DT_1.lower_bound := 0{K};
50 DT_2.lower_bound := 0{K};
51 END bound_self;
52 END condenser_lmtd;
53
54 (*--------------------------*)
55
56 (* test model for the above *)
57 MODEL condenser_lmtd_test;
58 S1 IS_A iapws95_1phase;
59 S2 IS_A iapws95_1phase;
60
61 T_in ALIASES S1.T;
62 p_in ALIASES S1.p;
63
64 C IS_A condenser_lmtd(S1,S2);
65
66 q ALIASES C.q;
67
68 METHODS
69 METHOD default_self;
70 RUN reset; RUN values; RUN bound_self;
71 END default_self;
72 METHOD specify;
73 RUN C.specify;
74 FIX T_in;
75 FIX p_in;
76 FIX q;
77 END specify;
78 METHOD values;
79 RUN C.values;
80 T_in := 273.15{K} + 280 {K};
81 p_in := 1{bar};
82 q := 4.2{kJ/s};
83 END values;
84 METHOD bound_self;
85 RUN C.bound_self;
86 END bound_self;
87 END condenser_lmtd_test;
88
89
90 (*--------------------------*)
91 MODEL condenser_lmtd_sat(
92 S_in WILL_BE thermo_state;
93 S_out WILL_BE thermo_state;
94 );
95 T_in ALIASES S_in.T;
96
97 mdot_in IS_A mass_rate;
98
99 T_c1 IS_A temperature; (* cold inlet *)
100 T_c2 IS_A temperature; (* cold outlet *)
101
102 LMTD_fg IS_A delta_temperature;
103
104 DT_c_fg, DT_1, DT_2 IS_A delta_temperature;
105
106 DT_c_fg = T_c2 - T_c1;
107 DT_1 = T_in - T_c1;
108 DT_2 = T_in - T_c2;
109
110 lmtd: LMTD_fg = (DT_c_fg) / ln(DT_1/DT_2);
111 (* lmtd: LMTD_fg * -ln((T_in - T_c1)/(T_in - T_c2)) = (T_c2 - T_c1); *)
112
113 UA_fg IS_A ua_value;
114 q_fg IS_A energy_rate;
115
116 q_fg = UA_fg * LMTD_fg;
117
118 (* condensation point *)
119 Sf ALIASES S_out;
120
121 sat IS_A iapws_sat_density;
122 sat.rhof = Sf.rho;
123 sat.T = Sf.T;
124
125 S_in.T = Sf.T;
126
127 q_fg = mdot_in * (S_in.h - Sf.h);
128 METHODS
129 METHOD specify;
130 FIX UA_fg;
131 FIX T_c1;
132 FIX mdot_in;
133 END specify;
134 METHOD values;
135 UA_fg := 4000 {W/m^2/K} * 4 {m} * 900 * 2*3.1415926* (0.01 {m})/2;
136 T_c1 := 273.15{K} + 200 {K};
137 mdot_in := 10 {kg/s};
138 (* free values *)
139 T_c2 := 273.15{K} + 240 {K};
140 END values;
141 METHOD bound_self;
142 Sf.tau.lower_bound := 1;
143 DT_c_fg.lower_bound := 0{K};
144 DT_1.lower_bound := 0{K};
145 DT_2.lower_bound := 0{K};
146 Sf.rho.lower_bound := Sf.rhoc;
147 END bound_self;
148 END condenser_lmtd_sat;
149
150 (*------------------------------*)
151
152 MODEL condenser_lmtd_sat_test;
153 Sg IS_A iapws95_1phase;
154 Sf IS_A iapws95_1phase;
155
156 sat IS_A iapws_sat_density;
157 sat.rhog, Sg.rho ARE_THE_SAME;
158 sat.T, Sg.T ARE_THE_SAME;
159 T_in ALIASES Sg.T;
160
161 C IS_A condenser_lmtd_sat(Sg,Sf);
162
163 METHODS
164 METHOD default_self;
165 RUN reset; RUN values; RUN bound_self;
166 END default_self;
167 METHOD specify;
168 RUN C.specify;
169 FIX T_in;
170 END specify;
171 METHOD values;
172 RUN C.values;
173 T_in := 273.15{K} + 280 {K};
174 END values;
175 METHOD bound_self;
176 RUN C.bound_self;
177 END bound_self;
178 METHOD self_test;
179 ASSERT (C.q_fg - 15430{kW}) < 1{kW};
180 END self_test;
181 END condenser_lmtd_sat_test;
182
183 (*-----------------------------*)
184
185 MODEL condenser;
186 (* assumptions:
187 inlet is ideal-gas steam at specified temperature and pressure.
188 output is water of fixed enthalpy.
189 whatever energy is required to be taken away to acheive that is what will be taken away.
190
191 we don't need to enforce saturation inlet conditions. we will just query the enthalpy for the ideal-gas steam
192 and that's it.
193 *)
194 S_in IS_A ideal_steam;
195
196 mdot_gas_in IS_A mass_rate;
197 mdot_water_out IS_A mass_rate;
198 Q IS_A energy_rate; (* heat taken away by condenser *)
199
200 h_in ALIASES S_in.h;
201 p_in ALIASES S_in.p;
202 T_in ALIASES S_in.T;
203
204 (*
205 h2 will be the enthalpy of the condensed water. because we are
206 ignoring pressure effects, we have to assume a constant fixed
207 value for the enthalpy of water at x=0.
208 *)
209 h_out IS_A specific_enthalpy;
210
211 Q = mdot_gas_in * h_in - mdot_water_out * h_out;
212 mdot_water_out = mdot_gas_in;
213
214 (*
215 we will assume there is NO water in the condenser for now; the
216 surge tank will play the role of the mass holdup in this case.
217 *)
218 METHODS
219 METHOD default_self;
220 RUN reset;
221 RUN values;
222 END default_self;
223 METHOD specify;
224 FIX mdot_gas_in;
225 FIX S_in.p, S_in.T;
226 FIX h_out;
227 END specify;
228 METHOD values;
229 mdot_gas_in := 1 {kg/s};
230 S_in.p := 5 {bar};
231 S_in.T := 473.15 {K};
232 h_out := 400{kJ/kg};
233 END values;
234 END condenser;

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