1 | #*------------------------------------------------------------------- |
---|
2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
3 | * |
---|
4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
6 | * http://www.enq.ufrgs.br/alsoc. |
---|
7 | * |
---|
8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
14 | * |
---|
15 | *-------------------------------------------------------------------- |
---|
16 | * Author: Gerson Balbueno Bicca |
---|
17 | * $Id: HeatExchangerSimplified.mso 145 2007-01-30 18:20:00Z rafael $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "HEX_Engine"; |
---|
21 | |
---|
22 | Model HeatExchangerSimplified_Basic |
---|
23 | |
---|
24 | ATTRIBUTES |
---|
25 | Pallete = false; |
---|
26 | Brief = "Basic Models for Simplified Heat Exchangers"; |
---|
27 | Info = |
---|
28 | "write some information"; |
---|
29 | |
---|
30 | PARAMETERS |
---|
31 | outer PP as Plugin (Brief="External Physical Properties"); |
---|
32 | HE as Plugin (Brief="STHE Calculations",File="heatex"); |
---|
33 | outer NComp as Integer (Brief="Number of Components"); |
---|
34 | M(NComp) as molweight (Brief="Component Mol Weight"); |
---|
35 | |
---|
36 | VARIABLES |
---|
37 | |
---|
38 | in Inlet as Inlet_Main_Stream (Brief="Hot and Cold Inlets"); |
---|
39 | out Outlet as Outlet_Main_Stream (Brief="Hot and Cold Outlets"); |
---|
40 | Properties as Main_Properties (Brief="Hot and Cold Properties"); |
---|
41 | Details as Details_Main (Brief="Heat Exchanger Details"); |
---|
42 | PressureDrop as Main_Pdrop (Brief="Heat Exchanger Pressure Drop"); |
---|
43 | |
---|
44 | SET |
---|
45 | |
---|
46 | M = PP.MolecularWeight(); |
---|
47 | |
---|
48 | EQUATIONS |
---|
49 | |
---|
50 | "Hot Stream Average Temperature" |
---|
51 | Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T; |
---|
52 | |
---|
53 | "Cold Stream Average Temperature" |
---|
54 | Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T; |
---|
55 | |
---|
56 | "Hot Stream Average Pressure" |
---|
57 | Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P; |
---|
58 | |
---|
59 | "Cold Stream Average Pressure" |
---|
60 | Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P; |
---|
61 | |
---|
62 | "Cold Stream Wall Temperature" |
---|
63 | Properties.Cold.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; |
---|
64 | |
---|
65 | "Hot Stream Wall Temperature" |
---|
66 | Properties.Hot.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; |
---|
67 | |
---|
68 | "Hot Stream Average Molecular Weight" |
---|
69 | Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z); |
---|
70 | |
---|
71 | "Cold Stream Average Molecular Weight" |
---|
72 | Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z); |
---|
73 | |
---|
74 | |
---|
75 | if Inlet.Cold.v equal 0 |
---|
76 | |
---|
77 | then |
---|
78 | |
---|
79 | "Cold Stream Average Heat Capacity" |
---|
80 | Properties.Cold.Average.Cp = PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
81 | |
---|
82 | "Cold Stream Inlet Heat Capacity" |
---|
83 | Properties.Cold.Inlet.Cp = PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
84 | |
---|
85 | "Cold Stream Outlet Heat Capacity" |
---|
86 | Properties.Cold.Outlet.Cp = PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
87 | |
---|
88 | "Cold Stream Average Mass Density" |
---|
89 | Properties.Cold.Average.rho = PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
90 | |
---|
91 | "Cold Stream Inlet Mass Density" |
---|
92 | Properties.Cold.Inlet.rho = PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
93 | |
---|
94 | "Cold Stream Outlet Mass Density" |
---|
95 | Properties.Cold.Outlet.rho = PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
96 | |
---|
97 | "Cold Stream Average Viscosity" |
---|
98 | Properties.Cold.Average.Mu = PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
99 | |
---|
100 | "Cold Stream inlet Viscosity" |
---|
101 | Properties.Cold.Inlet.Mu = PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
102 | |
---|
103 | "Cold Stream Outlet Viscosity" |
---|
104 | Properties.Cold.Outlet.Mu = PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
105 | |
---|
106 | "Cold Stream Average Conductivity" |
---|
107 | Properties.Cold.Average.K = PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
108 | |
---|
109 | "Cold Stream Inlet Conductivity" |
---|
110 | Properties.Cold.Inlet.K = PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
111 | |
---|
112 | "Cold Stream Outlet Conductivity" |
---|
113 | Properties.Cold.Outlet.K = PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
114 | |
---|
115 | "Cold Stream Heat Capacity at Wall Temperature" |
---|
116 | Properties.Cold.Wall.Cp = PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
117 | |
---|
118 | "Cold Stream Viscosity at Wall Temperature" |
---|
119 | Properties.Cold.Wall.Mu = PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
120 | |
---|
121 | "Cold Stream Conductivity at Wall Temperature" |
---|
122 | Properties.Cold.Wall.K = PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
123 | |
---|
124 | |
---|
125 | else |
---|
126 | |
---|
127 | "Cold Stream Average Heat Capacity" |
---|
128 | Properties.Cold.Average.Cp = PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
129 | |
---|
130 | "Cold Stream Inlet Heat Capacity" |
---|
131 | Properties.Cold.Inlet.Cp = PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
132 | |
---|
133 | "Cold Stream Outlet Heat Capacity" |
---|
134 | Properties.Cold.Outlet.Cp = PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
135 | |
---|
136 | "Cold Stream Average Mass Density" |
---|
137 | Properties.Cold.Average.rho = PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
138 | |
---|
139 | "Cold Stream Inlet Mass Density" |
---|
140 | Properties.Cold.Inlet.rho = PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
141 | |
---|
142 | "Cold Stream Outlet Mass Density" |
---|
143 | Properties.Cold.Outlet.rho = PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
144 | |
---|
145 | "Cold Stream Average Viscosity " |
---|
146 | Properties.Cold.Average.Mu = PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
147 | |
---|
148 | "Cold Stream Inlet Viscosity " |
---|
149 | Properties.Cold.Inlet.Mu = PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
150 | |
---|
151 | "Cold Stream Outlet Viscosity " |
---|
152 | Properties.Cold.Outlet.Mu = PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
153 | |
---|
154 | "Cold Stream Average Conductivity " |
---|
155 | Properties.Cold.Average.K = PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
156 | |
---|
157 | "Cold Stream Inlet Conductivity " |
---|
158 | Properties.Cold.Inlet.K = PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
159 | |
---|
160 | "Cold Stream Outlet Conductivity " |
---|
161 | Properties.Cold.Outlet.K = PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
162 | |
---|
163 | "Cold Stream Heat Capacity at Wall Temperature" |
---|
164 | Properties.Cold.Wall.Cp = PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
165 | |
---|
166 | |
---|
167 | "Cold Stream Viscosity at Wall Temperature" |
---|
168 | Properties.Cold.Wall.Mu = PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
169 | |
---|
170 | "Cold Stream Conductivity at Wall Temperature" |
---|
171 | Properties.Cold.Wall.K = PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | end |
---|
176 | |
---|
177 | if Inlet.Hot.v equal 0 |
---|
178 | |
---|
179 | then |
---|
180 | |
---|
181 | "Hot Stream Average Heat Capacity" |
---|
182 | Properties.Hot.Average.Cp = PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
183 | |
---|
184 | "Hot Stream Inlet Heat Capacity" |
---|
185 | Properties.Hot.Inlet.Cp = PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
186 | |
---|
187 | "Hot Stream Outlet Heat Capacity" |
---|
188 | Properties.Hot.Outlet.Cp = PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
189 | |
---|
190 | "Hot Stream Average Mass Density" |
---|
191 | Properties.Hot.Average.rho = PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
192 | |
---|
193 | "Hot Stream Inlet Mass Density" |
---|
194 | Properties.Hot.Inlet.rho = PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
195 | |
---|
196 | "Hot Stream Outlet Mass Density" |
---|
197 | Properties.Hot.Outlet.rho = PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
198 | |
---|
199 | "Hot Stream Average Viscosity" |
---|
200 | Properties.Hot.Average.Mu = PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
201 | |
---|
202 | "Hot Stream Inlet Viscosity" |
---|
203 | Properties.Hot.Inlet.Mu = PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
204 | |
---|
205 | "Hot Stream Outlet Viscosity" |
---|
206 | Properties.Hot.Outlet.Mu = PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
207 | |
---|
208 | "Hot Stream Average Conductivity" |
---|
209 | Properties.Hot.Average.K = PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
210 | |
---|
211 | "Hot Stream Inlet Conductivity" |
---|
212 | Properties.Hot.Inlet.K = PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
213 | |
---|
214 | "Hot Stream Outlet Conductivity" |
---|
215 | Properties.Hot.Outlet.K = PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
216 | |
---|
217 | "Hot Stream Heat Capacity at Wall Temperature" |
---|
218 | Properties.Hot.Wall.Cp = PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
219 | |
---|
220 | "Hot Stream Viscosity at Wall Temperature" |
---|
221 | Properties.Hot.Wall.Mu = PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
222 | |
---|
223 | "Hot Stream Conductivity at Wall Temperature" |
---|
224 | Properties.Hot.Wall.K = PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
225 | |
---|
226 | |
---|
227 | else |
---|
228 | |
---|
229 | "Hot Stream Average Heat Capacity" |
---|
230 | Properties.Hot.Average.Cp = PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
231 | |
---|
232 | "Hot Stream Inlet Heat Capacity" |
---|
233 | Properties.Hot.Inlet.Cp = PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
234 | |
---|
235 | "Hot Stream Outlet Heat Capacity" |
---|
236 | Properties.Hot.Outlet.Cp = PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
237 | |
---|
238 | "Hot Stream Average Mass Density" |
---|
239 | Properties.Hot.Average.rho = PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
240 | |
---|
241 | "Hot Stream Inlet Mass Density" |
---|
242 | Properties.Hot.Inlet.rho = PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
243 | |
---|
244 | "Hot Stream Outlet Mass Density" |
---|
245 | Properties.Hot.Outlet.rho = PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
246 | |
---|
247 | "Hot Stream Average Viscosity" |
---|
248 | Properties.Hot.Average.Mu = PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
249 | |
---|
250 | "Hot Stream Inlet Viscosity" |
---|
251 | Properties.Hot.Inlet.Mu = PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
252 | |
---|
253 | "Hot Stream Outlet Viscosity" |
---|
254 | Properties.Hot.Outlet.Mu = PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
255 | |
---|
256 | "Hot Stream Average Conductivity" |
---|
257 | Properties.Hot.Average.K = PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
258 | |
---|
259 | "Hot Stream Inlet Conductivity" |
---|
260 | Properties.Hot.Inlet.K = PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
261 | |
---|
262 | "Hot Stream Outlet Conductivity" |
---|
263 | Properties.Hot.Outlet.K = PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
264 | |
---|
265 | "Hot Stream Heat Capacity at Wall Temperature" |
---|
266 | Properties.Hot.Wall.Cp = PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
267 | |
---|
268 | "Hot Stream Viscosity at Wall Temperature" |
---|
269 | Properties.Hot.Wall.Mu = PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
270 | |
---|
271 | "Hot Stream Conductivity at Wall Temperature" |
---|
272 | Properties.Hot.Wall.K = PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
273 | |
---|
274 | |
---|
275 | end |
---|
276 | |
---|
277 | |
---|
278 | #===================================================================== |
---|
279 | # Thermal Details |
---|
280 | #===================================================================== |
---|
281 | "Hot Stream Heat Capacity" |
---|
282 | Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp; |
---|
283 | |
---|
284 | "Cold Stream Heat Capacity" |
---|
285 | Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp; |
---|
286 | |
---|
287 | "Minimum Heat Capacity" |
---|
288 | Details.Cmin = min([Details.Ch,Details.Cc]); |
---|
289 | |
---|
290 | "Maximum Heat Capacity" |
---|
291 | Details.Cmax = max([Details.Ch,Details.Cc]); |
---|
292 | |
---|
293 | "Heat Capacity Ratio" |
---|
294 | Details.Cr = Details.Cmin/Details.Cmax; |
---|
295 | #===================================================================== |
---|
296 | # Energy Balance |
---|
297 | #===================================================================== |
---|
298 | "Energy Balance Hot Stream" |
---|
299 | Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h); |
---|
300 | |
---|
301 | "Energy Balance Cold Stream" |
---|
302 | Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h); |
---|
303 | |
---|
304 | #===================================================================== |
---|
305 | # Material Balance |
---|
306 | #===================================================================== |
---|
307 | "Flow Mass Inlet Cold Stream" |
---|
308 | Properties.Cold.Inlet.Fw = sum(M*Inlet.Cold.z)*Inlet.Cold.F; |
---|
309 | |
---|
310 | "Flow Mass Outlet Cold Stream" |
---|
311 | Properties.Cold.Outlet.Fw = sum(M*Outlet.Cold.z)*Outlet.Cold.F; |
---|
312 | |
---|
313 | "Flow Mass Inlet Hot Stream" |
---|
314 | Properties.Hot.Inlet.Fw = sum(M*Inlet.Hot.z)*Inlet.Hot.F; |
---|
315 | |
---|
316 | "Flow Mass Outlet Hot Stream" |
---|
317 | Properties.Hot.Outlet.Fw = sum(M*Outlet.Hot.z)*Outlet.Hot.F; |
---|
318 | |
---|
319 | "Molar Balance Hot Stream" |
---|
320 | Inlet.Hot.F = Outlet.Hot.F; |
---|
321 | |
---|
322 | "Molar Balance Cold Stream" |
---|
323 | Inlet.Cold.F = Outlet.Cold.F; |
---|
324 | |
---|
325 | #====================================== |
---|
326 | # Constraints |
---|
327 | #====================================== |
---|
328 | "Hot Stream Molar Fraction Constraint" |
---|
329 | Outlet.Hot.z=Inlet.Hot.z; |
---|
330 | |
---|
331 | "Cold Stream Molar Fraction Constraint" |
---|
332 | Outlet.Cold.z=Inlet.Cold.z; |
---|
333 | |
---|
334 | #"No Phase Change In Cold Stream" |
---|
335 | # Inlet.Cold.v=Outlet.Cold.v; |
---|
336 | |
---|
337 | #"No Phase Change In Hot Stream" |
---|
338 | # Inlet.Hot.v=Outlet.Hot.v; |
---|
339 | |
---|
340 | #====================================== |
---|
341 | # Pressure Drop |
---|
342 | #====================================== |
---|
343 | |
---|
344 | "Pressure Drop Hot Stream" |
---|
345 | Outlet.Hot.P = Inlet.Hot.P - PressureDrop.Hot.Pdrop; |
---|
346 | |
---|
347 | "Pressure Drop Cold Stream" |
---|
348 | Outlet.Cold.P = Inlet.Cold.P - PressureDrop.Cold.Pdrop; |
---|
349 | |
---|
350 | "Fraction of Inlet Pressure : Hot Stream" |
---|
351 | PressureDrop.Hot.Pdrop = Inlet.Hot.P*PressureDrop.Hot.FPdrop; |
---|
352 | |
---|
353 | "Fraction of Inlet Pressure : Cold Stream" |
---|
354 | PressureDrop.Cold.Pdrop = Inlet.Cold.P*PressureDrop.Cold.FPdrop; |
---|
355 | |
---|
356 | end |
---|
357 | |
---|
358 | Model Heatex_Basic_NTU as HeatExchangerSimplified_Basic |
---|
359 | |
---|
360 | ATTRIBUTES |
---|
361 | Pallete = false; |
---|
362 | Brief = "Basic Model for Heat Exchangers - NTU Method"; |
---|
363 | Info = |
---|
364 | "write some information"; |
---|
365 | |
---|
366 | VARIABLES |
---|
367 | |
---|
368 | Eft as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8, Upper=1); |
---|
369 | |
---|
370 | EQUATIONS |
---|
371 | |
---|
372 | "Energy Balance" |
---|
373 | Details.Q = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); |
---|
374 | |
---|
375 | |
---|
376 | end |
---|
377 | |
---|
378 | Model Heatex_Basic_LMTD as HeatExchangerSimplified_Basic |
---|
379 | |
---|
380 | ATTRIBUTES |
---|
381 | Pallete = false; |
---|
382 | Brief = "Basic Model for Heat Exchangers - LMTD Method"; |
---|
383 | Info = |
---|
384 | "write some information"; |
---|
385 | |
---|
386 | VARIABLES |
---|
387 | |
---|
388 | DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); |
---|
389 | DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); |
---|
390 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference",Lower=1); |
---|
391 | Fc as positive (Brief="LMTD Correction Factor",Lower=0.5); |
---|
392 | MTD as temp_delta (Brief="Mean Temperature Difference",Lower=1); |
---|
393 | |
---|
394 | EQUATIONS |
---|
395 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
396 | # Log Mean Temperature Difference |
---|
397 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
398 | if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) |
---|
399 | |
---|
400 | then |
---|
401 | "Log Mean Temperature Difference" |
---|
402 | LMTD= (DT0-DTL)/ln(DT0/DTL); |
---|
403 | |
---|
404 | else |
---|
405 | |
---|
406 | if DT0*DTL equal 0 |
---|
407 | |
---|
408 | then |
---|
409 | "Log Mean Temperature Difference" |
---|
410 | LMTD = 0.5*(DT0+DTL); |
---|
411 | |
---|
412 | else |
---|
413 | "Log Mean Temperature Difference" |
---|
414 | LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); |
---|
415 | |
---|
416 | end |
---|
417 | |
---|
418 | end |
---|
419 | |
---|
420 | "Exchange Surface Area" |
---|
421 | Details.Q = Details.Ud*Details.A*MTD; |
---|
422 | |
---|
423 | "Mean Temperature Difference" |
---|
424 | MTD = Fc*LMTD; |
---|
425 | |
---|
426 | end |
---|
427 | |
---|
428 | |
---|
429 | #===================================================================== |
---|
430 | # Concrete Models for Simplified Heat Exchangers |
---|
431 | #===================================================================== |
---|
432 | |
---|
433 | #===================================================================== |
---|
434 | # LMTD Method |
---|
435 | #===================================================================== |
---|
436 | |
---|
437 | Model HeatExchanger_LMTD as Heatex_Basic_LMTD |
---|
438 | |
---|
439 | ATTRIBUTES |
---|
440 | Pallete = true; |
---|
441 | Brief = "Heat Exchanger Block - LMTD Method"; |
---|
442 | Info = |
---|
443 | "write some information"; |
---|
444 | |
---|
445 | PARAMETERS |
---|
446 | |
---|
447 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
448 | |
---|
449 | EQUATIONS |
---|
450 | |
---|
451 | switch FlowDirection |
---|
452 | |
---|
453 | case "cocurrent": |
---|
454 | |
---|
455 | "Temperature Difference at Inlet" |
---|
456 | DT0 = Inlet.Hot.T - Inlet.Cold.T; |
---|
457 | |
---|
458 | "Temperature Difference at Outlet" |
---|
459 | DTL = Outlet.Hot.T - Outlet.Cold.T; |
---|
460 | |
---|
461 | case "counter": |
---|
462 | |
---|
463 | "Temperature Difference at Inlet" |
---|
464 | DT0 = Inlet.Hot.T - Outlet.Cold.T; |
---|
465 | |
---|
466 | "Temperature Difference at Outlet" |
---|
467 | DTL = Outlet.Hot.T - Inlet.Cold.T; |
---|
468 | end |
---|
469 | |
---|
470 | end |
---|
471 | |
---|
472 | Model E_Shell_LMTD as Heatex_Basic_LMTD |
---|
473 | |
---|
474 | ATTRIBUTES |
---|
475 | Pallete = true; |
---|
476 | Brief = "Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method"; |
---|
477 | Info = |
---|
478 | "write some information"; |
---|
479 | |
---|
480 | EQUATIONS |
---|
481 | "Temperature Difference at Inlet" |
---|
482 | DT0 = Inlet.Hot.T - Outlet.Cold.T; |
---|
483 | |
---|
484 | "Temperature Difference at Outlet" |
---|
485 | DTL = Outlet.Hot.T - Inlet.Cold.T; |
---|
486 | |
---|
487 | "LMTD Correction Factor" |
---|
488 | Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T); |
---|
489 | |
---|
490 | end |
---|
491 | |
---|
492 | Model F_Shell_LMTD as Heatex_Basic_LMTD |
---|
493 | |
---|
494 | ATTRIBUTES |
---|
495 | Pallete = true; |
---|
496 | Brief = "Shell and Tubes Heat Exchanger with 2 shell pass - LMTD Method"; |
---|
497 | Info = |
---|
498 | "write some information"; |
---|
499 | |
---|
500 | EQUATIONS |
---|
501 | "Temperature Difference at Inlet" |
---|
502 | DT0 = Inlet.Hot.T - Outlet.Cold.T; |
---|
503 | |
---|
504 | "Temperature Difference at Outlet" |
---|
505 | DTL = Outlet.Hot.T - Inlet.Cold.T; |
---|
506 | |
---|
507 | "LMTD Correction Factor" |
---|
508 | Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T); |
---|
509 | |
---|
510 | end |
---|
511 | |
---|
512 | #===================================================================== |
---|
513 | # NTU Method |
---|
514 | #===================================================================== |
---|
515 | |
---|
516 | Model HeatExchanger_NTU as Heatex_Basic_NTU |
---|
517 | |
---|
518 | ATTRIBUTES |
---|
519 | Pallete = true; |
---|
520 | Brief = "Heat Exchanger Block - NTU Method"; |
---|
521 | Info = |
---|
522 | "write some information"; |
---|
523 | |
---|
524 | PARAMETERS |
---|
525 | |
---|
526 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
527 | |
---|
528 | EQUATIONS |
---|
529 | |
---|
530 | if Details.Cr equal 0 |
---|
531 | |
---|
532 | then |
---|
533 | |
---|
534 | Eft = 1-exp(-Details.NTU); |
---|
535 | |
---|
536 | else |
---|
537 | |
---|
538 | switch FlowDirection |
---|
539 | |
---|
540 | case "cocurrent": |
---|
541 | |
---|
542 | "Effectiveness in Cocurrent Flow" |
---|
543 | Eft = (1-exp(-Details.NTU*(1+Details.Cr)))/(1+Details.Cr); |
---|
544 | |
---|
545 | case "counter": |
---|
546 | |
---|
547 | if Details.Cr equal 1 |
---|
548 | |
---|
549 | then |
---|
550 | "Effectiveness in Counter Flow" |
---|
551 | Eft = Details.NTU/(1+Details.NTU); |
---|
552 | |
---|
553 | else |
---|
554 | "Effectiveness in Counter Flow" |
---|
555 | Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr))); |
---|
556 | |
---|
557 | end |
---|
558 | |
---|
559 | end |
---|
560 | |
---|
561 | |
---|
562 | end |
---|
563 | |
---|
564 | end |
---|
565 | |
---|
566 | Model E_Shell_NTU as Heatex_Basic_NTU |
---|
567 | |
---|
568 | ATTRIBUTES |
---|
569 | Pallete = true; |
---|
570 | Brief = "Shell and Tubes Heat Exchanger with 1 shell pass - NTU Method"; |
---|
571 | Info = |
---|
572 | "write some information"; |
---|
573 | |
---|
574 | EQUATIONS |
---|
575 | "TEMA E Shell Effectiveness" |
---|
576 | Eft = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1; |
---|
577 | |
---|
578 | end |
---|
579 | |
---|
580 | Model F_Shell_NTU as Heatex_Basic_NTU |
---|
581 | |
---|
582 | ATTRIBUTES |
---|
583 | Pallete = true; |
---|
584 | Brief = "Shell and Tubes Heat Exchanger with 2 shell pass - NTU Method"; |
---|
585 | Info = |
---|
586 | "write some information"; |
---|
587 | |
---|
588 | VARIABLES |
---|
589 | |
---|
590 | Eft1 as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5); |
---|
591 | |
---|
592 | EQUATIONS |
---|
593 | |
---|
594 | "Effectiveness Correction" |
---|
595 | Eft1 = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1; |
---|
596 | |
---|
597 | "TEMA F Shell Effectiveness" |
---|
598 | Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1 )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1; |
---|
599 | |
---|
600 | end |
---|