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 148 2007-02-01 20:57:34Z bicca $ |
---|
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 | outer NComp as Integer (Brief="Number of Components"); |
---|
33 | M(NComp) as molweight (Brief="Component Mol Weight"); |
---|
34 | |
---|
35 | VARIABLES |
---|
36 | |
---|
37 | in Inlet as Inlet_Main_Stream (Brief="Hot and Cold Inlets"); |
---|
38 | out Outlet as Outlet_Main_Stream (Brief="Hot and Cold Outlets"); |
---|
39 | Properties as Main_Properties (Brief="Hot and Cold Properties"); |
---|
40 | Details as Details_Main (Brief="Heat Exchanger Details"); |
---|
41 | PressureDrop as Main_Pdrop (Brief="Heat Exchanger Pressure Drop"); |
---|
42 | |
---|
43 | SET |
---|
44 | |
---|
45 | M = PP.MolecularWeight(); |
---|
46 | |
---|
47 | EQUATIONS |
---|
48 | |
---|
49 | "Hot Stream Average Temperature" |
---|
50 | Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T; |
---|
51 | |
---|
52 | "Cold Stream Average Temperature" |
---|
53 | Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T; |
---|
54 | |
---|
55 | "Hot Stream Average Pressure" |
---|
56 | Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P; |
---|
57 | |
---|
58 | "Cold Stream Average Pressure" |
---|
59 | Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P; |
---|
60 | |
---|
61 | "Cold Stream Wall Temperature" |
---|
62 | Properties.Cold.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; |
---|
63 | |
---|
64 | "Hot Stream Wall Temperature" |
---|
65 | Properties.Hot.Wall.Twall = 0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T; |
---|
66 | |
---|
67 | "Hot Stream Average Molecular Weight" |
---|
68 | Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z); |
---|
69 | |
---|
70 | "Cold Stream Average Molecular Weight" |
---|
71 | Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z); |
---|
72 | |
---|
73 | |
---|
74 | if Inlet.Cold.v equal 0 |
---|
75 | |
---|
76 | then |
---|
77 | |
---|
78 | "Cold Stream Average Heat Capacity" |
---|
79 | Properties.Cold.Average.Cp = PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
80 | |
---|
81 | "Cold Stream Inlet Heat Capacity" |
---|
82 | Properties.Cold.Inlet.Cp = PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
83 | |
---|
84 | "Cold Stream Outlet Heat Capacity" |
---|
85 | Properties.Cold.Outlet.Cp = PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
86 | |
---|
87 | "Cold Stream Average Mass Density" |
---|
88 | Properties.Cold.Average.rho = PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
89 | |
---|
90 | "Cold Stream Inlet Mass Density" |
---|
91 | Properties.Cold.Inlet.rho = PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
92 | |
---|
93 | "Cold Stream Outlet Mass Density" |
---|
94 | Properties.Cold.Outlet.rho = PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
95 | |
---|
96 | "Cold Stream Average Viscosity" |
---|
97 | Properties.Cold.Average.Mu = PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
98 | |
---|
99 | "Cold Stream inlet Viscosity" |
---|
100 | Properties.Cold.Inlet.Mu = PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
101 | |
---|
102 | "Cold Stream Outlet Viscosity" |
---|
103 | Properties.Cold.Outlet.Mu = PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
104 | |
---|
105 | "Cold Stream Average Conductivity" |
---|
106 | Properties.Cold.Average.K = PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
107 | |
---|
108 | "Cold Stream Inlet Conductivity" |
---|
109 | Properties.Cold.Inlet.K = PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
110 | |
---|
111 | "Cold Stream Outlet Conductivity" |
---|
112 | Properties.Cold.Outlet.K = PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
113 | |
---|
114 | "Cold Stream Heat Capacity at Wall Temperature" |
---|
115 | Properties.Cold.Wall.Cp = PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
116 | |
---|
117 | "Cold Stream Viscosity at Wall Temperature" |
---|
118 | Properties.Cold.Wall.Mu = PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
119 | |
---|
120 | "Cold Stream Conductivity at Wall Temperature" |
---|
121 | Properties.Cold.Wall.K = PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
122 | |
---|
123 | |
---|
124 | else |
---|
125 | |
---|
126 | "Cold Stream Average Heat Capacity" |
---|
127 | Properties.Cold.Average.Cp = PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
128 | |
---|
129 | "Cold Stream Inlet Heat Capacity" |
---|
130 | Properties.Cold.Inlet.Cp = PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
131 | |
---|
132 | "Cold Stream Outlet Heat Capacity" |
---|
133 | Properties.Cold.Outlet.Cp = PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
134 | |
---|
135 | "Cold Stream Average Mass Density" |
---|
136 | Properties.Cold.Average.rho = PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
137 | |
---|
138 | "Cold Stream Inlet Mass Density" |
---|
139 | Properties.Cold.Inlet.rho = PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
140 | |
---|
141 | "Cold Stream Outlet Mass Density" |
---|
142 | Properties.Cold.Outlet.rho = PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
143 | |
---|
144 | "Cold Stream Average Viscosity " |
---|
145 | Properties.Cold.Average.Mu = PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
146 | |
---|
147 | "Cold Stream Inlet Viscosity " |
---|
148 | Properties.Cold.Inlet.Mu = PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
149 | |
---|
150 | "Cold Stream Outlet Viscosity " |
---|
151 | Properties.Cold.Outlet.Mu = PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
152 | |
---|
153 | "Cold Stream Average Conductivity " |
---|
154 | Properties.Cold.Average.K = PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
155 | |
---|
156 | "Cold Stream Inlet Conductivity " |
---|
157 | Properties.Cold.Inlet.K = PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z); |
---|
158 | |
---|
159 | "Cold Stream Outlet Conductivity " |
---|
160 | Properties.Cold.Outlet.K = PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z); |
---|
161 | |
---|
162 | "Cold Stream Heat Capacity at Wall Temperature" |
---|
163 | Properties.Cold.Wall.Cp = PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
164 | |
---|
165 | |
---|
166 | "Cold Stream Viscosity at Wall Temperature" |
---|
167 | Properties.Cold.Wall.Mu = PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
168 | |
---|
169 | "Cold Stream Conductivity at Wall Temperature" |
---|
170 | Properties.Cold.Wall.K = PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z); |
---|
171 | |
---|
172 | |
---|
173 | |
---|
174 | end |
---|
175 | |
---|
176 | if Inlet.Hot.v equal 0 |
---|
177 | |
---|
178 | then |
---|
179 | |
---|
180 | "Hot Stream Average Heat Capacity" |
---|
181 | Properties.Hot.Average.Cp = PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
182 | |
---|
183 | "Hot Stream Inlet Heat Capacity" |
---|
184 | Properties.Hot.Inlet.Cp = PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
185 | |
---|
186 | "Hot Stream Outlet Heat Capacity" |
---|
187 | Properties.Hot.Outlet.Cp = PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
188 | |
---|
189 | "Hot Stream Average Mass Density" |
---|
190 | Properties.Hot.Average.rho = PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
191 | |
---|
192 | "Hot Stream Inlet Mass Density" |
---|
193 | Properties.Hot.Inlet.rho = PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
194 | |
---|
195 | "Hot Stream Outlet Mass Density" |
---|
196 | Properties.Hot.Outlet.rho = PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
197 | |
---|
198 | "Hot Stream Average Viscosity" |
---|
199 | Properties.Hot.Average.Mu = PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
200 | |
---|
201 | "Hot Stream Inlet Viscosity" |
---|
202 | Properties.Hot.Inlet.Mu = PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
203 | |
---|
204 | "Hot Stream Outlet Viscosity" |
---|
205 | Properties.Hot.Outlet.Mu = PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
206 | |
---|
207 | "Hot Stream Average Conductivity" |
---|
208 | Properties.Hot.Average.K = PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
209 | |
---|
210 | "Hot Stream Inlet Conductivity" |
---|
211 | Properties.Hot.Inlet.K = PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
212 | |
---|
213 | "Hot Stream Outlet Conductivity" |
---|
214 | Properties.Hot.Outlet.K = PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
215 | |
---|
216 | "Hot Stream Heat Capacity at Wall Temperature" |
---|
217 | Properties.Hot.Wall.Cp = PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
218 | |
---|
219 | "Hot Stream Viscosity at Wall Temperature" |
---|
220 | Properties.Hot.Wall.Mu = PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
221 | |
---|
222 | "Hot Stream Conductivity at Wall Temperature" |
---|
223 | Properties.Hot.Wall.K = PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
224 | |
---|
225 | |
---|
226 | else |
---|
227 | |
---|
228 | "Hot Stream Average Heat Capacity" |
---|
229 | Properties.Hot.Average.Cp = PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
230 | |
---|
231 | "Hot Stream Inlet Heat Capacity" |
---|
232 | Properties.Hot.Inlet.Cp = PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
233 | |
---|
234 | "Hot Stream Outlet Heat Capacity" |
---|
235 | Properties.Hot.Outlet.Cp = PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
236 | |
---|
237 | "Hot Stream Average Mass Density" |
---|
238 | Properties.Hot.Average.rho = PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
239 | |
---|
240 | "Hot Stream Inlet Mass Density" |
---|
241 | Properties.Hot.Inlet.rho = PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
242 | |
---|
243 | "Hot Stream Outlet Mass Density" |
---|
244 | Properties.Hot.Outlet.rho = PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
245 | |
---|
246 | "Hot Stream Average Viscosity" |
---|
247 | Properties.Hot.Average.Mu = PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
248 | |
---|
249 | "Hot Stream Inlet Viscosity" |
---|
250 | Properties.Hot.Inlet.Mu = PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
251 | |
---|
252 | "Hot Stream Outlet Viscosity" |
---|
253 | Properties.Hot.Outlet.Mu = PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
254 | |
---|
255 | "Hot Stream Average Conductivity" |
---|
256 | Properties.Hot.Average.K = PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
257 | |
---|
258 | "Hot Stream Inlet Conductivity" |
---|
259 | Properties.Hot.Inlet.K = PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z); |
---|
260 | |
---|
261 | "Hot Stream Outlet Conductivity" |
---|
262 | Properties.Hot.Outlet.K = PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z); |
---|
263 | |
---|
264 | "Hot Stream Heat Capacity at Wall Temperature" |
---|
265 | Properties.Hot.Wall.Cp = PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
266 | |
---|
267 | "Hot Stream Viscosity at Wall Temperature" |
---|
268 | Properties.Hot.Wall.Mu = PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
269 | |
---|
270 | "Hot Stream Conductivity at Wall Temperature" |
---|
271 | Properties.Hot.Wall.K = PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z); |
---|
272 | |
---|
273 | |
---|
274 | end |
---|
275 | |
---|
276 | #===================================================================== |
---|
277 | # Thermal Details |
---|
278 | #===================================================================== |
---|
279 | "Hot Stream Heat Capacity" |
---|
280 | Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp; |
---|
281 | |
---|
282 | "Cold Stream Heat Capacity" |
---|
283 | Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp; |
---|
284 | |
---|
285 | "Minimum Heat Capacity" |
---|
286 | Details.Cmin = min([Details.Ch,Details.Cc]); |
---|
287 | |
---|
288 | "Maximum Heat Capacity" |
---|
289 | Details.Cmax = max([Details.Ch,Details.Cc]); |
---|
290 | |
---|
291 | "Heat Capacity Ratio" |
---|
292 | Details.Cr = Details.Cmin/Details.Cmax; |
---|
293 | #===================================================================== |
---|
294 | # Energy Balance |
---|
295 | #===================================================================== |
---|
296 | "Energy Balance Hot Stream" |
---|
297 | Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h); |
---|
298 | |
---|
299 | "Energy Balance Cold Stream" |
---|
300 | Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h); |
---|
301 | |
---|
302 | #===================================================================== |
---|
303 | # Material Balance |
---|
304 | #===================================================================== |
---|
305 | "Flow Mass Inlet Cold Stream" |
---|
306 | Properties.Cold.Inlet.Fw = sum(M*Inlet.Cold.z)*Inlet.Cold.F; |
---|
307 | |
---|
308 | "Flow Mass Outlet Cold Stream" |
---|
309 | Properties.Cold.Outlet.Fw = sum(M*Outlet.Cold.z)*Outlet.Cold.F; |
---|
310 | |
---|
311 | "Flow Mass Inlet Hot Stream" |
---|
312 | Properties.Hot.Inlet.Fw = sum(M*Inlet.Hot.z)*Inlet.Hot.F; |
---|
313 | |
---|
314 | "Flow Mass Outlet Hot Stream" |
---|
315 | Properties.Hot.Outlet.Fw = sum(M*Outlet.Hot.z)*Outlet.Hot.F; |
---|
316 | |
---|
317 | "Molar Balance Hot Stream" |
---|
318 | Inlet.Hot.F = Outlet.Hot.F; |
---|
319 | |
---|
320 | "Molar Balance Cold Stream" |
---|
321 | Inlet.Cold.F = Outlet.Cold.F; |
---|
322 | |
---|
323 | #====================================== |
---|
324 | # Constraints |
---|
325 | #====================================== |
---|
326 | "Hot Stream Molar Fraction Constraint" |
---|
327 | Outlet.Hot.z=Inlet.Hot.z; |
---|
328 | |
---|
329 | "Cold Stream Molar Fraction Constraint" |
---|
330 | Outlet.Cold.z=Inlet.Cold.z; |
---|
331 | |
---|
332 | #====================================== |
---|
333 | # Pressure Drop |
---|
334 | #====================================== |
---|
335 | |
---|
336 | "Pressure Drop Hot Stream" |
---|
337 | Outlet.Hot.P = Inlet.Hot.P - PressureDrop.Hot.Pdrop; |
---|
338 | |
---|
339 | "Pressure Drop Cold Stream" |
---|
340 | Outlet.Cold.P = Inlet.Cold.P - PressureDrop.Cold.Pdrop; |
---|
341 | |
---|
342 | "Fraction of Inlet Pressure : Hot Stream" |
---|
343 | PressureDrop.Hot.Pdrop = Inlet.Hot.P*PressureDrop.Hot.FPdrop; |
---|
344 | |
---|
345 | "Fraction of Inlet Pressure : Cold Stream" |
---|
346 | PressureDrop.Cold.Pdrop = Inlet.Cold.P*PressureDrop.Cold.FPdrop; |
---|
347 | |
---|
348 | end |
---|
349 | |
---|
350 | Model Heatex_Basic_NTU as HeatExchangerSimplified_Basic |
---|
351 | |
---|
352 | ATTRIBUTES |
---|
353 | Pallete = false; |
---|
354 | Brief = "Basic Model for Heat Exchangers - NTU Method"; |
---|
355 | Info = |
---|
356 | "write some information"; |
---|
357 | |
---|
358 | VARIABLES |
---|
359 | |
---|
360 | Eft as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8, Upper=1); |
---|
361 | |
---|
362 | EQUATIONS |
---|
363 | |
---|
364 | "Energy Balance" |
---|
365 | Details.Q = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); |
---|
366 | |
---|
367 | |
---|
368 | end |
---|
369 | |
---|
370 | Model Heatex_Basic_LMTD as HeatExchangerSimplified_Basic |
---|
371 | |
---|
372 | ATTRIBUTES |
---|
373 | Pallete = false; |
---|
374 | Brief = "Basic Model for Heat Exchangers - LMTD Method"; |
---|
375 | Info = |
---|
376 | "write some information"; |
---|
377 | |
---|
378 | VARIABLES |
---|
379 | |
---|
380 | DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); |
---|
381 | DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); |
---|
382 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference",Lower=1); |
---|
383 | Fc as positive (Brief="LMTD Correction Factor",Lower=0.5); |
---|
384 | MTD as temp_delta (Brief="Mean Temperature Difference",Lower=1); |
---|
385 | |
---|
386 | EQUATIONS |
---|
387 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
388 | # Log Mean Temperature Difference |
---|
389 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
390 | if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) |
---|
391 | |
---|
392 | then |
---|
393 | "Log Mean Temperature Difference" |
---|
394 | LMTD= (DT0-DTL)/ln(DT0/DTL); |
---|
395 | |
---|
396 | else |
---|
397 | |
---|
398 | if DT0*DTL equal 0 |
---|
399 | |
---|
400 | then |
---|
401 | "Log Mean Temperature Difference" |
---|
402 | LMTD = 0.5*(DT0+DTL); |
---|
403 | |
---|
404 | else |
---|
405 | "Log Mean Temperature Difference" |
---|
406 | LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); |
---|
407 | |
---|
408 | end |
---|
409 | |
---|
410 | end |
---|
411 | |
---|
412 | "Exchange Surface Area" |
---|
413 | Details.Q = Details.Ud*Details.A*MTD; |
---|
414 | |
---|
415 | "Mean Temperature Difference" |
---|
416 | MTD = Fc*LMTD; |
---|
417 | |
---|
418 | end |
---|
419 | |
---|
420 | Model HeatExchanger_LMTD as Heatex_Basic_LMTD |
---|
421 | |
---|
422 | ATTRIBUTES |
---|
423 | Pallete = true; |
---|
424 | Brief = "Heat Exchanger Block - LMTD Method"; |
---|
425 | Info = |
---|
426 | "write some information"; |
---|
427 | |
---|
428 | PARAMETERS |
---|
429 | |
---|
430 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
431 | |
---|
432 | EQUATIONS |
---|
433 | |
---|
434 | switch FlowDirection |
---|
435 | |
---|
436 | case "cocurrent": |
---|
437 | |
---|
438 | "Temperature Difference at Inlet" |
---|
439 | DT0 = Inlet.Hot.T - Inlet.Cold.T; |
---|
440 | |
---|
441 | "Temperature Difference at Outlet" |
---|
442 | DTL = Outlet.Hot.T - Outlet.Cold.T; |
---|
443 | |
---|
444 | case "counter": |
---|
445 | |
---|
446 | "Temperature Difference at Inlet" |
---|
447 | DT0 = Inlet.Hot.T - Outlet.Cold.T; |
---|
448 | |
---|
449 | "Temperature Difference at Outlet" |
---|
450 | DTL = Outlet.Hot.T - Inlet.Cold.T; |
---|
451 | end |
---|
452 | |
---|
453 | end |
---|
454 | |
---|
455 | Model Shell_and_Tubes_LMTD as Heatex_Basic_LMTD |
---|
456 | |
---|
457 | ATTRIBUTES |
---|
458 | Pallete = true; |
---|
459 | Brief = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - LMTD Method"; |
---|
460 | Info = |
---|
461 | "write some information"; |
---|
462 | |
---|
463 | PARAMETERS |
---|
464 | |
---|
465 | LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann"); |
---|
466 | ShellType as Switcher(Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell"); |
---|
467 | |
---|
468 | VARIABLES |
---|
469 | |
---|
470 | R as positive (Brief=" Capacity Ratio for LMTD Correction Fator",Lower=1e-6); |
---|
471 | P as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6); |
---|
472 | Pc as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side",Lower=1e-6); |
---|
473 | Rho as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6); |
---|
474 | Phi as positive (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6); |
---|
475 | lambdaN as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side"); |
---|
476 | lambda1 as Real (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side"); |
---|
477 | |
---|
478 | EQUATIONS |
---|
479 | |
---|
480 | "R: Capacity Ratio for LMTD Correction Fator" |
---|
481 | R*(Outlet.Cold.T - Inlet.Cold.T ) = (Inlet.Hot.T-Outlet.Hot.T); |
---|
482 | |
---|
483 | "P: Non - Dimensional Variable for LMTD Correction Fator" |
---|
484 | P*(Inlet.Hot.T- Inlet.Cold.T)= (Outlet.Cold.T-Inlet.Cold.T); |
---|
485 | |
---|
486 | "Temperature Difference at Inlet" |
---|
487 | DT0 = Inlet.Hot.T - Outlet.Cold.T; |
---|
488 | |
---|
489 | "Temperature Difference at Outlet" |
---|
490 | DTL = Outlet.Hot.T - Inlet.Cold.T; |
---|
491 | |
---|
492 | switch ShellType |
---|
493 | |
---|
494 | case "Fshell": |
---|
495 | |
---|
496 | switch LMTDcorrection |
---|
497 | |
---|
498 | case "Bowmann": |
---|
499 | |
---|
500 | " Variable not in use with Bowmann equation" |
---|
501 | lambdaN =1; |
---|
502 | |
---|
503 | " Variable not in use with Bowmann equation" |
---|
504 | lambda1 =1; |
---|
505 | |
---|
506 | " Variable not in use with Bowmann equation" |
---|
507 | Phi = 1; |
---|
508 | |
---|
509 | " Variable not in use with Bowmann equation" |
---|
510 | Rho =1; |
---|
511 | |
---|
512 | if R equal 1 |
---|
513 | |
---|
514 | then |
---|
515 | |
---|
516 | "Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side" |
---|
517 | Pc*(2-P)= P; |
---|
518 | |
---|
519 | "LMTD Correction Fator when 2 Pass Shell Side" |
---|
520 | Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214)))); |
---|
521 | |
---|
522 | else |
---|
523 | |
---|
524 | "Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side" |
---|
525 | Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R); |
---|
526 | |
---|
527 | "LMTD Correction Fator when 2 Pass Shell Side" |
---|
528 | Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1)))))); |
---|
529 | |
---|
530 | end |
---|
531 | |
---|
532 | case "Fakeri": |
---|
533 | |
---|
534 | " Variable not in use with Fakeri equation" |
---|
535 | Pc = P; |
---|
536 | |
---|
537 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" |
---|
538 | Rho*(1-P*R) = (1-P); |
---|
539 | |
---|
540 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation " |
---|
541 | Phi = (sqrt(((Inlet.Hot.T - Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T - Inlet.Cold.T)*(Outlet.Cold.T - Inlet.Cold.T))))/(2*((Inlet.Hot.T + Outlet.Hot.T)-( Inlet.Cold.T + Outlet.Cold.T))); |
---|
542 | |
---|
543 | if Rho equal 1 |
---|
544 | |
---|
545 | then |
---|
546 | |
---|
547 | " Variable not in use when Rho = 1" |
---|
548 | lambdaN = 1; |
---|
549 | |
---|
550 | " Variable not in use when Rho = 1" |
---|
551 | lambda1 = 1; |
---|
552 | |
---|
553 | "LMTD Correction Fator when 2 Pass Shell Side" |
---|
554 | Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi )))); |
---|
555 | |
---|
556 | else |
---|
557 | |
---|
558 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" |
---|
559 | lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1)); |
---|
560 | |
---|
561 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" |
---|
562 | lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1)); |
---|
563 | |
---|
564 | "LMTD Correction Fator when 2 Pass Shell Side" |
---|
565 | Fc = ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN); |
---|
566 | |
---|
567 | end |
---|
568 | |
---|
569 | |
---|
570 | end |
---|
571 | |
---|
572 | case "Eshell": |
---|
573 | |
---|
574 | " Variable not in use when 1 Pass Shell Side" |
---|
575 | lambdaN =1; |
---|
576 | |
---|
577 | " Variable not in use when 1 Pass Shell Side" |
---|
578 | lambda1 =1; |
---|
579 | |
---|
580 | " Variable not in use when 1 Pass Shell Side" |
---|
581 | Pc = P; |
---|
582 | |
---|
583 | switch LMTDcorrection |
---|
584 | |
---|
585 | case "Bowmann": |
---|
586 | |
---|
587 | " Variable not in use with Bowmann equation" |
---|
588 | Phi = 1; |
---|
589 | |
---|
590 | " Variable not in use with Bowmann equation" |
---|
591 | Rho = 1; |
---|
592 | |
---|
593 | |
---|
594 | if R equal 1 |
---|
595 | |
---|
596 | then |
---|
597 | |
---|
598 | "LMTD Correction Fator when 1 Pass Shell Side" |
---|
599 | Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214)))); |
---|
600 | |
---|
601 | else |
---|
602 | |
---|
603 | "LMTD Correction Fator when 1 Pass Shell Side" |
---|
604 | Fc = sqrt(R*R+1)*ln(abs((1-P*R)/(1-P)))/((1-R)*ln( abs( ( 2-P*(R+1-sqrt(R*R+1)))/ ( 2-P*(R + 1 + sqrt(R*R+1)))))); |
---|
605 | |
---|
606 | end |
---|
607 | |
---|
608 | case "Fakeri": |
---|
609 | |
---|
610 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation " |
---|
611 | Phi = (sqrt(((Inlet.Hot.T- Outlet.Hot.T)*(Inlet.Hot.T- Outlet.Hot.T))+((Outlet.Cold.T - Inlet.Cold.T)*(Outlet.Cold.T - Inlet.Cold.T))))/(2*((Inlet.Hot.T+ Outlet.Hot.T)-(Inlet.Cold.T+ Outlet.Cold.T))); |
---|
612 | |
---|
613 | "Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation" |
---|
614 | Rho*(1-P*R) = (1-P); |
---|
615 | |
---|
616 | if Rho equal 1 |
---|
617 | |
---|
618 | then |
---|
619 | |
---|
620 | "LMTD Correction Fator when 1 Pass Shell Side" |
---|
621 | Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi)))); |
---|
622 | |
---|
623 | else |
---|
624 | |
---|
625 | "LMTD Correction Fator when 1 Pass Shell Side" |
---|
626 | Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1)); |
---|
627 | |
---|
628 | end |
---|
629 | |
---|
630 | end |
---|
631 | |
---|
632 | |
---|
633 | end |
---|
634 | |
---|
635 | end |
---|
636 | |
---|
637 | Model HeatExchanger_NTU as Heatex_Basic_NTU |
---|
638 | |
---|
639 | ATTRIBUTES |
---|
640 | Pallete = true; |
---|
641 | Brief = "Heat Exchanger Block - NTU Method"; |
---|
642 | Info = |
---|
643 | "write some information"; |
---|
644 | |
---|
645 | PARAMETERS |
---|
646 | |
---|
647 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
648 | |
---|
649 | EQUATIONS |
---|
650 | |
---|
651 | if Details.Cr equal 0 |
---|
652 | |
---|
653 | then |
---|
654 | |
---|
655 | Eft = 1-exp(-Details.NTU); |
---|
656 | |
---|
657 | else |
---|
658 | |
---|
659 | switch FlowDirection |
---|
660 | |
---|
661 | case "cocurrent": |
---|
662 | |
---|
663 | "Effectiveness in Cocurrent Flow" |
---|
664 | Eft = (1-exp(-Details.NTU*(1+Details.Cr)))/(1+Details.Cr); |
---|
665 | |
---|
666 | case "counter": |
---|
667 | |
---|
668 | if Details.Cr equal 1 |
---|
669 | |
---|
670 | then |
---|
671 | "Effectiveness in Counter Flow" |
---|
672 | Eft = Details.NTU/(1+Details.NTU); |
---|
673 | |
---|
674 | else |
---|
675 | "Effectiveness in Counter Flow" |
---|
676 | Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr))); |
---|
677 | |
---|
678 | end |
---|
679 | |
---|
680 | end |
---|
681 | |
---|
682 | |
---|
683 | end |
---|
684 | |
---|
685 | end |
---|
686 | |
---|
687 | Model E_Shell_NTU as Heatex_Basic_NTU |
---|
688 | |
---|
689 | ATTRIBUTES |
---|
690 | Pallete = true; |
---|
691 | Brief = "Shell and Tubes Heat Exchanger with 1 shell pass - NTU Method"; |
---|
692 | Info = |
---|
693 | "write some information"; |
---|
694 | |
---|
695 | EQUATIONS |
---|
696 | "TEMA E Shell Effectiveness" |
---|
697 | 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; |
---|
698 | |
---|
699 | end |
---|
700 | |
---|
701 | Model F_Shell_NTU as Heatex_Basic_NTU |
---|
702 | |
---|
703 | ATTRIBUTES |
---|
704 | Pallete = true; |
---|
705 | Brief = "Shell and Tubes Heat Exchanger with 2 shell pass - NTU Method"; |
---|
706 | Info = |
---|
707 | "write some information"; |
---|
708 | |
---|
709 | VARIABLES |
---|
710 | |
---|
711 | Eft1 as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5); |
---|
712 | |
---|
713 | EQUATIONS |
---|
714 | |
---|
715 | "Effectiveness Correction" |
---|
716 | 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; |
---|
717 | |
---|
718 | "TEMA F Shell Effectiveness" |
---|
719 | Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1 )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1; |
---|
720 | |
---|
721 | end |
---|