source: trunk/eml/heat_exchangers/HeatExchangerSimplified.mso @ 284

Last change on this file since 284 was 284, checked in by gerson bicca, 15 years ago

updated ATTRIBUTES section in heat exchangers

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