source: trunk/eml/heat_exchangers/HeatExchangerDetailed.mso

Last change on this file was 1005, checked in by Argimiro Resende Secchi, 5 years ago

Fixed convergence problem in detailed heat exchanger.

File size: 44.8 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* Author: Gerson Balbueno Bicca
16* $Id: HeatExchangerDetailed.mso 197 2007-03-08 14:31:57Z bicca $
17*------------------------------------------------------------------*#
18using "heat_exchangers/HEX_Engine";
19
20Model ShellandTubesBasic
21
22ATTRIBUTES
23        Pallete = false;
24        Brief  = "Basic Model for Detailed Shell and Tube Heat Exchanger.";
25        Info  =
26"to be documented.
27       
28== Assumptions ==
29* to be documented
30
31== Specify ==
32* to be documented
33
34== Setting Parameters ==
35* to be documented
36
37== References ==
38[1] E.A.D. Saunders, Heat Exchangers: Selection, Design and
39 Construction, Longman, Harlow, 1988.
40
41[2] Taborek, J., Shell-and-tube heat exchangers, in Heat Exchanger Design Handbook, Vol. 3
42 Hemisphere Publishing Corp., New York, 1988.
43
44[3] Bell, K. J., Mueller, A. C., Wolverine Engineering Data Book II. Wolverine Tube, Inc., <www.wlv.com>, 2001.
45
46[4] Fakheri, A. , Alternative approach for determining log mean temperature difference correction factor
47 and number of shells of shell and tube heat exchangers, Journal of Enhanced Heat Transfer, v. 10, p. 407- 420, 2003.
48
49[5] Gnielinski, V., Forced convection in ducts, in Heat Exchanger Design Handbook, Vol. 2
50 Hemisphere Publishing Corp., New York, 1988.";
51
52PARAMETERS
53
54HotSide                 as Switcher     (Brief="Hot Side in the Exchanger",Hidden=true, Valid=["shell","tubes"],Default="shell");
55ShellType       as Switcher     (Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell");
56Pattern         as Switcher     (Brief="Tube Layout Characteristic Angle",Valid=["Triangle","Rotated Square","Square"],Default="Triangle");
57
58VARIABLES
59
60        Tubes                   as Tube_Side_Main               (Brief="Tube Side Section" , Symbol="^{tube}");
61        Shell                   as Shell_Side_Main      (Brief="Shell Side Section" , Symbol="^{shell}");       
62        Baffles                 as Baffles_Main                         (Brief="Baffle Section", Symbol=" ");
63        Clearances      as Clearances_Main      (Brief="Diametral Clearances", Symbol=" ");
64       
65in  InletTube           as stream                                       (Brief="Inlet Tube Stream", PosX=0.13, PosY=0, Symbol="_{in }^{tube}");
66out OutletTube  as streamPH                             (Brief="Outlet Tube Stream", PosX=0.13, PosY=1, Symbol="_{out }^{tube}");
67in  InletShell          as stream                                       (Brief="Inlet Shell Stream", PosX=0.31, PosY=1, Symbol="_{in }^{shell}");
68out OutletShell as streamPH                             (Brief="Outlet Shell Stream", PosX=0.81, PosY=0, Symbol="_{out }^{shell}");
69        Details                         as Details_Main                         (Brief="Details in Heat Exchanger", Symbol = " ");
70       
71#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
72#                               Auxiliar Variables - Must be hidden                                             
73#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
74        Nc              as Real                                 (Brief = "Number of Tube rows Crossed in one Crossflow Section", Hidden = true, Lower=1);
75        Ncw     as Real                                 (Brief = "Number of Effective Crossflow rows in Each Window", Hidden = true, Lower=1);
76        a                       as Real                                 (Brief = "Variable for calculating Ji heat transfer correction Factor", Hidden = true, Lower=1e-3);
77        b                       as Real                                 (Brief = "Variable for calculating shell side pressure drop friction Factor", Hidden = true, Lower=1e-3);
78        Rb              as Real                                 (Brief = "ByPass Correction Factor for Pressure Drop", Hidden = true, Lower=1e-3);
79        Rss             as Real                                 (Brief = "Correction Factor for Pressure Drop", Hidden = true, Lower=1e-3);
80        Rspd    as Real                                 (Brief = "Pressure Drop Correction Factor for Unequal Baffle Spacing", Hidden = true, Lower=1e-3);
81        mw              as Real                                 (Brief = "Mass Velocity in Window Zone", Hidden = true, Unit='kg/m^2/s');
82        Ji                      as constant                     (Brief="Shell Side Ji Factor", Symbol ="J_i", Hidden = true, Default=0.05);
83        Jr                      as positive                     (Brief="Shell Side Jr Factor",  Symbol ="J_r", Hidden = true, Lower=10e-6);
84        Jl                      as positive                     (Brief="Shell Side Jl Factor",  Symbol ="J_l", Hidden = true, Lower=10e-6);
85        Jb                      as positive                     (Brief="Shell Side Jb Factor", Symbol ="J_b", Hidden = true, Lower=10e-6);
86        Jc                      as positive                     (Brief="Shell Side Jc Factor", Symbol ="J_c", Hidden = true, Lower=10e-6);
87        Js                      as positive                     (Brief="Shell Side Js Factor", Symbol ="J_s", Hidden = true, Lower=10e-6);
88        Jtotal  as positive                     (Brief="Shell Side Jtotal Factor", Symbol ="J_{total}", Hidden = true, Lower=10e-6);
89        Sm              as area                                 (Brief="Shell Side Cross Flow Area", Symbol ="S_m", Hidden = true, Default=0.05,Lower=10e-6);
90
91PARAMETERS
92outer PP                        as Plugin               (Brief="External Physical Properties",Type = "PP");
93outer NComp     as Integer      (Brief="Number of Components");
94       
95M(NComp)        as molweight (Brief="Component Mol Weight");
96
97TubeFlowRegime           as Switcher            (Brief="Tube Side Flow Regime ",Hidden=true,Valid=["laminar","transition","turbulent"],Default="laminar");
98ShellFlowRegime                 as Switcher             (Brief="Shell Side Flow Regime ",Hidden=true,Valid=["deep laminar","laminar","turbulent"],Default="deep laminar");
99ShellRange                              as Switcher             (Brief="Shell Side Flow Regime Range for Correction Factor",Hidden=true,Valid=["range1","range2","range3", "range4","range5"],Default="range1");
100Side                                                            as Switcher             (Brief="Flag for Fluid Alocation ",Hidden=true,Valid=["shell","tubes"],Default="shell");
101LaminarCorrelation      as Switcher             (Brief="Tube Heat Transfer Correlation in Laminar Flow",Valid=["Hausen","Schlunder"],Default="Hausen");
102TransitionCorrelation   as Switcher             (Brief="Tube Heat Transfer Correlation in Transition Flow",Valid=["Gnielinski","ESDU"],Default="Gnielinski");
103TurbulentCorrelation    as Switcher             (Brief="Tube Heat Transfer Correlation in Turbulent Flow",Valid=["Petukhov","SiederTate"],Default="Petukhov");
104
105#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
106#                               Auxiliar Parameters     - Must be hidden                                                       
107#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
108Pi                                                      as constant   (Brief="Pi Number", Hidden = true, Default=3.14159265, Symbol = "\pi");
109pi                                                      as constant   (Brief="Pi Number", Unit = 'rad', Default=3.14159265, Symbol = "\pi");
110Aonozzle_Shell          as area                 (Brief="Shell Outlet Nozzle Area", Hidden = true, Lower=1E-6 ,  Symbol ="A_{nozzle\_out }^{shell}");
111Ainozzle_Shell          as area                 (Brief="Shell Inlet Nozzle Area", Hidden = true, Lower=1E-6 ,  Symbol ="A_{nozzle\_in }^{shell}");
112Aeonozzle_Shell         as area                 (Brief="Shell Outlet Escape Area Under Nozzle", Hidden = true, Lower=1E-6 ,  Symbol ="Aescape_{nozzle\_out }^{shell}");
113Aeinozzle_Shell         as area                 (Brief="Shell Inlet Escape Area Under Nozzle",Hidden = true, Lower=1E-6 ,  Symbol ="Aescape_{nozzle\_in }^{shell}");
114Aonozzle_Tube   as area                 (Brief="Tube Outlet Nozzle Area", Hidden = true, Lower=1E-6 ,  Symbol ="A_{nozzle\_out }^{tube}");
115Ainozzle_Tube           as area                 (Brief="Tube Inlet Nozzle Area", Hidden = true, Lower=1E-6 ,  Symbol ="A_{nozzle\_in }^{tube}");
116Kinlet_Tube             as positive     (Brief="Tube Inlet Nozzle Pressure Loss Coeff", Hidden = true, Default=1.1, Symbol ="K_{in }^{tube}");
117Koutlet_Tube            as positive     (Brief="Tube Outlet Nozzle Pressure Loss Coeff",Hidden = true, Default=0.7, Symbol ="K_{out }^{tube}");
118Ods                                             as Real                 (Brief="Baffle cut angle in degrees", Symbol = "\theta _{ds}", Hidden = true);
119Octl                                    as Real                 (Brief="Baffle cut angle relative to the centerline in degrees", Symbol = "\theta _{ctl}", Hidden = true);
120Ftw                                             as Real                 (Brief="Fraction of number of tubes in baffle window", Symbol = "F _{tw}", Hidden = true);
121Scd                                             as area                 (Brief="Shell to baffle leakage area", Symbol = "S _{cd}", Hidden = true);
122Std                                             as area                 (Brief="Tube to baffle hole leakage area", Symbol = "S _{td}", Hidden = true);
123Rs                                              as Real                 (Brief="Ratio of the shell to baffle leakage area", Symbol = "R_s", Hidden = true);
124Dw                                      as length               (Brief="Hydraulic diameter of the baffle window", Symbol = "D _w", Hidden = true);
125
126SET
127
128#"Molecular weight"
129        M       = PP.MolecularWeight();
130       
131#"Pi Number"
132        Pi      = 3.14159265;
133        pi = Pi * 'rad';
134
135#"Baffle cut angle in degrees"
136        Ods     = (360/pi)*acos(1-0.02*Baffles.BaffleCut);
137
138#"Baffle cut angle relative to the centerline"
139        Octl    = (360/pi)*acos((Shell.ShellID/(Shell.ShellID - Clearances.BundleToShell - Tubes.TubeOD))*(1-0.02*Baffles.BaffleCut));
140
141#"Fraction of number of tubes in baffle window"
142        Ftw     = (Octl/360)-sin(Octl*pi/180)/(2*Pi);
143
144#"Shell to baffle leakage area"
145        Scd     = Pi*Shell.ShellID*Clearances.BaffleToShell *((360-Ods)/720);
146
147#"Tube to baffle hole leakage area"
148        Std     = Pi*0.25*((Clearances.TubeToBaffle + Tubes.TubeOD)^2-Tubes.TubeOD*Tubes.TubeOD)*Tubes.NumberOfTubes*(1-Ftw);
149
150#"comments"
151        Rs              = Scd/(Scd+Std);
152
153#"comments"
154        Dw      = (4*abs((Pi*Shell.ShellID*Shell.ShellID*((Ods/360)-sin(Ods*pi/180)/(2*Pi))/4)-(Tubes.NumberOfTubes*Pi*Tubes.TubeOD*Tubes.TubeOD*Ftw/4)))/(Pi*Tubes.TubeOD*Tubes.NumberOfTubes*Ftw+ Pi*Shell.ShellID*Ods/360);
155
156#"Tube Side Inlet Nozzle Area"
157        Ainozzle_Tube = 0.25*Pi*Tubes.InletNozzleID^2;
158
159#"Tube Side Outlet Nozzle Area"
160        Aonozzle_Tube = 0.25*Pi*Tubes.OutletNozzleID^2;
161
162#"Tube Inlet Nozzle Pressure Loss Coeff"
163        Kinlet_Tube   = 1.1;
164
165#"Tube Outlet Nozzle Pressure Loss Coeff"
166        Koutlet_Tube  = 0.7;
167
168#"Shell Outlet Nozzle Area"
169        Aonozzle_Shell  = 0.25*Pi*Shell.OutletNozzleID^2;
170
171#"Shell Inlet Nozzle Area"
172        Ainozzle_Shell  = 0.25*Pi*Shell.InletNozzleID^2;
173
174#"Shell Outlet Escape Area Under Nozzle"
175        Aeonozzle_Shell = Pi*Shell.OutletNozzleID*Clearances.Honozzle_Shell + 0.6*Aonozzle_Shell*(1-(Tubes.TubeOD/Tubes.TubePitch));
176
177#"Shell Inlet Escape Area Under Nozzle"
178        Aeinozzle_Shell = Pi*Shell.InletNozzleID*Clearances.Hinozzle_Shell + 0.6*Ainozzle_Shell*(1-(Tubes.TubeOD/Tubes.TubePitch));
179
180EQUATIONS
181
182"Shell Stream Average Temperature"
183        Shell.Properties.Average.T = 0.5*InletShell.T + 0.5*OutletShell.T;
184#       Shell.Properties.Average.T = InletShell.T;
185       
186"Tube Stream Average Temperature"
187        Tubes.Properties.Average.T = 0.5*InletTube.T + 0.5*OutletTube.T;
188#       Tubes.Properties.Average.T = InletTube.T;
189       
190"Shell Stream Average Pressure"
191#       Shell.Properties.Average.P = 0.5*InletShell.P+0.5*OutletShell.P;
192        Shell.Properties.Average.P = InletShell.P;
193       
194"Tube Stream Average Pressure"
195#       Tubes.Properties.Average.P = 0.5*InletTube.P+0.5*OutletTube.P;
196        Tubes.Properties.Average.P = InletTube.P;
197       
198"Shell Stream Average Molecular Weight"
199        Shell.Properties.Average.Mw = sum(M*InletShell.z);
200
201"Tube Stream Average Molecular Weight"
202        Tubes.Properties.Average.Mw = sum(M*OutletTube.z);
203       
204if InletTube.v equal 0
205       
206        then   
207       
208"Tube Stream Average Heat Capacity"
209        Tubes.Properties.Average.Cp     =       PP.LiquidCp(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
210
211"Tube Stream Average Mass Density"
212        Tubes.Properties.Average.rho =  PP.LiquidDensity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
213
214"Tube Stream Inlet Mass Density"
215        Tubes.Properties.Inlet.rho      =       PP.LiquidDensity(OutletTube.T,OutletTube.P,OutletTube.z);
216
217"Tube Stream Outlet Mass Density"
218        Tubes.Properties.Outlet.rho     =       PP.LiquidDensity(OutletTube.T,OutletTube.P,OutletTube.z);
219
220"TubeStream Average Viscosity"
221        Tubes.Properties.Average.Mu     =       PP.LiquidViscosity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
222
223"Tube Stream Average Conductivity"
224        Tubes.Properties.Average.K      =       PP.LiquidThermalConductivity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
225
226"Tube Stream Viscosity at Wall Temperature"
227        Tubes.Properties.Wall.Mu        =       PP.LiquidViscosity(Tubes.Properties.Wall.Twall,Tubes.Properties.Average.P,OutletTube.z);
228
229        else
230
231"Tube Stream Average Heat Capacity"
232        Tubes.Properties.Average.Cp     =       PP.VapourCp(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
233
234"Tube Stream Average Mass Density"
235        Tubes.Properties.Average.rho =  PP.VapourDensity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
236
237"Tube Stream Inlet Mass Density"
238        Tubes.Properties.Inlet.rho      =       PP.VapourDensity(OutletTube.T,OutletTube.P,OutletTube.z);
239
240"Tube Stream Outlet Mass Density"       
241        Tubes.Properties.Outlet.rho     =       PP.VapourDensity(OutletTube.T,OutletTube.P,OutletTube.z);
242
243"Tube Stream Average Viscosity "
244        Tubes.Properties.Average.Mu     =       PP.VapourViscosity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
245
246"Tube Stream Average Conductivity "
247        Tubes.Properties.Average.K      =       PP.VapourThermalConductivity(Tubes.Properties.Average.T,Tubes.Properties.Average.P,OutletTube.z);
248
249"Tube Stream Viscosity at Wall Temperature"
250        Tubes.Properties.Wall.Mu        =       PP.VapourViscosity(Tubes.Properties.Wall.Twall,Tubes.Properties.Average.P,OutletTube.z);
251
252end
253
254if InletShell.v equal 0
255
256        then
257
258"Shell Stream Average Heat Capacity"
259        Shell.Properties.Average.Cp     =               PP.LiquidCp(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
260
261"Shell Stream Average Mass Density"
262        Shell.Properties.Average.rho    =               PP.LiquidDensity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
263
264"ShellStream Inlet Mass Density"       
265        Shell.Properties.Inlet.rho      =               PP.LiquidDensity(InletShell.T,InletShell.P,InletShell.z);
266
267"Shell Stream Outlet Mass Density"     
268        Shell.Properties.Outlet.rho     =               PP.LiquidDensity(OutletShell.T,OutletShell.P,OutletShell.z);
269
270"Shell Stream Average Viscosity"
271        Shell.Properties.Average.Mu     =               PP.LiquidViscosity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
272
273"Shell Stream Average Conductivity"
274        Shell.Properties.Average.K      =               PP.LiquidThermalConductivity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);       
275
276"ShellStream Viscosity  at Wall Temperature"
277        Shell.Properties.Wall.Mu                =               PP.LiquidViscosity(Shell.Properties.Wall.Twall,Shell.Properties.Average.P,InletShell.z);       
278
279
280        else
281
282"Shell Stream Average Heat Capacity"
283        Shell.Properties.Average.Cp     =               PP.VapourCp(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
284
285"Shell Stream Average Mass Density"
286        Shell.Properties.Average.rho    =               PP.VapourDensity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
287
288"Shell Stream Inlet Mass Density"       
289        Shell.Properties.Inlet.rho      =               PP.VapourDensity(InletShell.T,InletShell.P,InletShell.z);
290
291"Shell Stream Outlet Mass Density"
292        Shell.Properties.Outlet.rho     =               PP.VapourDensity(OutletShell.T,OutletShell.P,OutletShell.z);
293
294"Shell Stream Average Viscosity"
295        Shell.Properties.Average.Mu     =               PP.VapourViscosity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);
296
297"Shell Stream Average Conductivity"
298        Shell.Properties.Average.K      =               PP.VapourThermalConductivity(Shell.Properties.Average.T,Shell.Properties.Average.P,InletShell.z);       
299
300"Shell Stream Viscosity at Wall Temperature"
301        Shell.Properties.Wall.Mu                =               PP.VapourViscosity(Shell.Properties.Wall.Twall,Shell.Properties.Average.P,InletShell.z);
302
303end
304
305switch Side
306       
307        case "shell":
308       
309"Energy Balance Hot Stream"
310        Details.Q = InletShell.F*(InletShell.h-OutletShell.h);
311
312"Energy Balance Cold Stream"
313        Details.Q =-InletTube.F*(InletTube.h-OutletTube.h);
314
315        when InletTube.T > InletShell.T switchto "tubes";
316
317        case "tubes":
318       
319"Energy Balance Hot Stream"
320        Details.Q = InletTube.F*(InletTube.h-OutletTube.h);
321
322"Energy Balance Cold Stream"
323        Details.Q =-InletShell.F*(InletShell.h-OutletShell.h);
324       
325        when InletTube.T < InletShell.T switchto "shell";
326       
327end
328
329"Flow Mass Inlet Tube Stream"
330        Tubes.Properties.Inlet.Fw               =  sum(M*InletTube.z)*InletTube.F;
331
332"Flow Mass Outlet Tube Stream"
333        Tubes.Properties.Outlet.Fw      =  sum(M*OutletTube.z)*OutletTube.F;
334
335"Flow Mass Inlet Shell Stream"
336        Shell.Properties.Inlet.Fw               =  sum(M*InletShell.z)*InletShell.F;
337
338"Flow Mass Outlet Shell Stream"
339        Shell.Properties.Outlet.Fw              =  sum(M*OutletShell.z)*OutletShell.F;
340
341"Molar Balance Shell Stream"
342        OutletShell.F  = InletShell.F;
343       
344"Molar Balance Tube Stream"
345        OutletTube.F = InletTube.F;
346
347"Shell  Stream Molar Fraction Constraint"
348        OutletShell.z=InletShell.z;
349       
350"Tube Stream Molar Fraction Constraint"
351        OutletTube.z=InletTube.z;
352       
353"Jc Factor"
354        Jc = 0.55+0.72*(1-2*Ftw);
355
356"Jl Factor"
357        Jl = 0.44*(1-Rs)+(1-0.44*(1-Rs))*exp(-2.2*(Scd + Std)/Sm);
358
359"Total J Factor"
360        Jtotal = Jc*Jl*Jb*Jr*Js;
361
362"Mass Velocity in Window Zone"
363        mw      = Shell.Properties.Inlet.Fw/sqrt(abs(Sm*abs((Pi*Shell.ShellID*Shell.ShellID*((Ods/360)-sin(Ods*pi/180)/(2*Pi))/4)-(Tubes.NumberOfTubes*Pi*Tubes.TubeOD*Tubes.TubeOD*Ftw/4))));
364
365switch TubeFlowRegime
366       
367        case "laminar":
368       
369"Friction Factor for heat Transfer: Not Necessary in Laminar Correlation - Use any one equation that you want"
370        Tubes.HeatTransfer.fi   = 16/Tubes.HeatTransfer.Re;
371       
372"Friction Factor for Pressure Drop in Laminar Flow"
373        Tubes.PressureDrop.FricFactor  = 16/Tubes.HeatTransfer.Re;
374       
375switch LaminarCorrelation
376       
377        case "Hausen":
378
379"Nusselt Number in Laminar Flow - Hausen Equation"
380        Tubes.HeatTransfer.Nu = 3.665 + ((0.19*((Tubes.TubeID/Tubes.TubeLength)*Tubes.HeatTransfer.Re*Tubes.HeatTransfer.PR)^0.8)/(1+0.117*((Tubes.TubeID/Tubes.TubeLength)*Tubes.HeatTransfer.Re*Tubes.HeatTransfer.PR)^0.467));
381       
382        case "Schlunder":
383       
384"Nusselt Number in Laminar Flow - Schlunder Equation"
385        Tubes.HeatTransfer.Nu = (49.027896+4.173281*Tubes.HeatTransfer.Re*Tubes.HeatTransfer.PR*(Tubes.TubeID/Tubes.TubeLength))^(1/3);
386
387end
388       
389        when Tubes.HeatTransfer.Re > 2300 switchto "transition";
390       
391        case "transition":
392       
393"Friction Factor for heat Transfer : for use in Gnielinski Equation"
394        Tubes.HeatTransfer.fi   = 1/(0.79*ln(Tubes.HeatTransfer.Re)-1.64)^2;
395       
396"Friction Factor for Pressure Drop in Transition Flow"
397        Tubes.PressureDrop.FricFactor  = 0.0122;
398       
399switch TransitionCorrelation
400       
401        case "Gnielinski":
402       
403"Nusselt Number in Transition Flow - Gnielinski Equation"
404        Tubes.HeatTransfer.Nu*(1+(12.7*sqrt(0.125*Tubes.HeatTransfer.fi)*((Tubes.HeatTransfer.PR)^(2/3) -1))) = 0.125*Tubes.HeatTransfer.fi*(Tubes.HeatTransfer.Re-1000)*Tubes.HeatTransfer.PR;
405
406        case "ESDU":
407       
408"Nusselt Number in Transition Flow - ESDU Equation"
409        Tubes.HeatTransfer.Nu =1;#to be implemented
410       
411end
412
413        when Tubes.HeatTransfer.Re < 2300 switchto "laminar";
414        when Tubes.HeatTransfer.Re > 10000 switchto "turbulent";
415
416        case "turbulent":
417
418"Friction Factor for heat Transfer : for use in Petukhov Equation"
419        Tubes.HeatTransfer.fi   = 1/(1.82*log(Tubes.HeatTransfer.Re)-1.64)^2;
420
421"Friction Factor for Pressure Drop in Turbulent Flow"
422        Tubes.PressureDrop.FricFactor  = 0.0035 + 0.264*Tubes.HeatTransfer.Re^(-0.42);
423
424switch TurbulentCorrelation
425       
426        case "Petukhov":
427       
428"Nusselt Number in Turbulent Flow - Petukhov Equation"
429        Tubes.HeatTransfer.Nu*(1.07+(12.7*sqrt(0.125*Tubes.HeatTransfer.fi)*((Tubes.HeatTransfer.PR)^(2/3) -1))) = 0.125*Tubes.HeatTransfer.fi*Tubes.HeatTransfer.Re*Tubes.HeatTransfer.PR;
430       
431        case "SiederTate":
432
433"Nusselt Number in Transition Flow - Sieder Tate Equation"
434        Tubes.HeatTransfer.Nu = 0.027*(Tubes.HeatTransfer.PR)^(1/3)*(Tubes.HeatTransfer.Re)^(4/5);
435
436end
437       
438        when Tubes.HeatTransfer.Re < 10000 switchto "transition";
439
440end
441
442switch Pattern
443       
444case "Triangle":
445
446"Shell Side Cross Flow Area"
447        Sm= Baffles.Central_Spacing*(Clearances.BundleToShell+((Shell.ShellID-Clearances.BundleToShell-Tubes.TubeOD)/Tubes.TubePitch)*(Tubes.TubePitch-Tubes.TubeOD));
448
449"Number of Tube rows Crossed in one Crossflow Section"
450        Nc      = Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.866*Tubes.TubePitch);
451
452"Number of Effective Crossflow rows in Each Window"
453        Ncw = 0.8*(Shell.ShellID*0.01*Baffles.BaffleCut-(Clearances.BundleToShell + Tubes.TubeOD)*0.5)/(0.866*Tubes.TubePitch);
454
455"Variable for calculating Ji heat transfer correction Factor"
456        a       =       1.45/(1+0.14*Shell.HeatTransfer.Re^0.519);
457       
458"Variable for calculating Shell Side Pressure Drop Friction Factor"
459        b=7/(1+0.14*Shell.HeatTransfer.Re^0.5);
460
461"Correction Factor for Pressure Drop"
462        Rss     = Clearances.SealStrip/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.866*Tubes.TubePitch)) ;
463       
464"Ideal Shell Side Pressure Drop"
465        Shell.PressureDrop.Ideal= 2*Shell.PressureDrop.FricFactor*(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.866*Tubes.TubePitch))*(Shell.Properties.Inlet.Fw/Sm)^2/(Shell.Properties.Average.rho*Shell.HeatTransfer.Phi);
466
467"Shell Pressure End Zones"
468        Shell.PressureDrop.EndZones = Shell.PressureDrop.Ideal*(1+ (Ncw/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.866*Tubes.TubePitch))))*Rb*Rspd;
469
470switch ShellRange
471       
472        case "range1":
473       
474"Ji Factor"
475        Ji =1.40*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^0.667;
476       
477"Shell Side Pressure Drop Friction Factor"
478        Shell.PressureDrop.FricFactor=48*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
479       
480        when Shell.HeatTransfer.Re > 10 switchto "range2";
481       
482        case "range2":
483       
484"Ji Factor"
485        Ji =1.36*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.657);
486       
487"Shell Side Pressure Drop Friction Factor"
488        Shell.PressureDrop.FricFactor=45.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.973);
489       
490        when Shell.HeatTransfer.Re > 100 switchto "range3";
491       
492        case "range3":
493
494"Ji Factor"
495        Ji =0.593*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.477);
496       
497"Shell Side Pressure Drop Friction Factor"
498        Shell.PressureDrop.FricFactor=4.570*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.476);
499       
500        when Shell.HeatTransfer.Re > 1000 switchto "range4";
501       
502        case "range4":
503
504"Ji Factor"
505        Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.388);
506       
507"Shell Side Pressure Drop Friction Factor"
508        Shell.PressureDrop.FricFactor=0.486*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.152);
509
510        when Shell.HeatTransfer.Re > 10000 switchto "range5";
511
512        case "range5":
513
514"Ji Factor"
515        Ji =0.321*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.388);
516
517"Shell Side Pressure Drop Friction Factor"
518        Shell.PressureDrop.FricFactor=0.372*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.123);
519       
520        when Shell.HeatTransfer.Re < 10000 switchto "range4";
521       
522end
523
524case "Rotated Square":
525
526"Shell Side Cross Flow Area"
527        Sm= Baffles.Central_Spacing*(Clearances.BundleToShell+((Shell.ShellID-Clearances.BundleToShell-Tubes.TubeOD)/(0.707*Tubes.TubePitch))*(Tubes.TubePitch-Tubes.TubeOD));
528
529"Number of Tube rows Crossed in one Crossflow Section"
530        Nc      = Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.707*Tubes.TubePitch);
531
532"Number of Effective Crossflow rows in Each Window"
533        Ncw = 0.8*(Shell.ShellID*0.01*Baffles.BaffleCut-(Clearances.BundleToShell + Tubes.TubeOD)*0.5)/(0.707*Tubes.TubePitch);
534
535"Variable for calculating Ji heat transfer correction Factor"
536        a       =       1.930/(1+0.14*Shell.HeatTransfer.Re^0.500);
537
538"Variable for calculating Shell Side Pressure Drop Friction Factor"
539        b=6.59/(1+0.14*Shell.HeatTransfer.Re^0.52);
540
541"Correction Factor for Pressure Drop"
542        Rss     = Clearances.SealStrip/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.707*Tubes.TubePitch)) ;
543
544"Ideal Shell Side Pressure Drop"
545        Shell.PressureDrop.Ideal= 2*Shell.PressureDrop.FricFactor*(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.707*Tubes.TubePitch))*(Shell.Properties.Inlet.Fw/Sm)^2/(Shell.Properties.Average.rho*Shell.HeatTransfer.Phi);
546
547"Shell Pressure End Zones"
548        Shell.PressureDrop.EndZones = Shell.PressureDrop.Ideal*(1+ (Ncw/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/(0.707*Tubes.TubePitch))))*Rb*Rspd;
549
550switch ShellRange
551       
552        case "range1":
553
554"Ji Factor"
555        Ji =1.550*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^0.667;
556
557"Shell Side Pressure Drop Friction Factor"
558        Shell.PressureDrop.FricFactor=32*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
559       
560        when Shell.HeatTransfer.Re > 10 switchto "range2";
561       
562        case "range2":
563
564"Ji Factor"
565        Ji =0.498*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^0.656;
566
567"Shell Side Pressure Drop Friction Factor"
568        Shell.PressureDrop.FricFactor=26.20*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.913);
569       
570        when Shell.HeatTransfer.Re > 100 switchto "range3";
571       
572        case "range3":
573
574"Ji Factor"
575        Ji =0.730*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^0.500;
576
577"Shell Side Pressure Drop Friction Factor"
578        Shell.PressureDrop.FricFactor=3.50*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.476);
579       
580        when Shell.HeatTransfer.Re > 1000 switchto "range4";
581       
582        case "range4":
583       
584"Ji Factor"
585        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.396);
586       
587"Shell Side Pressure Drop Friction Factor"
588        Shell.PressureDrop.FricFactor=0.333*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.136);
589
590        when Shell.HeatTransfer.Re > 10000 switchto "range5";
591
592        case "range5":
593
594"Ji Factor"
595        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.396);
596       
597"Shell Side Pressure Drop Friction Factor"
598        Shell.PressureDrop.FricFactor=0.303*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.126);
599       
600        when Shell.HeatTransfer.Re < 10000 switchto "range4";
601       
602end
603
604case "Square":
605
606"Shell Side Cross Flow Area"
607        Sm= Baffles.Central_Spacing*(Clearances.BundleToShell+((Shell.ShellID-Clearances.BundleToShell-Tubes.TubeOD)/Tubes.TubePitch)*(Tubes.TubePitch-Tubes.TubeOD));
608
609"Number of Tube rows Crossed in one Crossflow Section"
610        Nc      = Shell.ShellID*(1-0.02*Baffles.BaffleCut)/Tubes.TubePitch;
611       
612"Number of Effective Crossflow rows in Each Window"
613        Ncw = 0.8*(Shell.ShellID*0.01*Baffles.BaffleCut-(Clearances.BundleToShell + Tubes.TubeOD)*0.5)/Tubes.TubePitch;
614
615"Variable for calculating Ji heat transfer correction Factor"
616        a       =       1.187/(1+0.14*Shell.HeatTransfer.Re^0.370);
617
618"Variable for calculating Shell Side Pressure Drop Friction Factor"
619        b=6.30/(1+0.14*Shell.HeatTransfer.Re^0.38);
620
621"Correction Factor for Pressure Drop"
622        Rss     = Clearances.SealStrip/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/Tubes.TubePitch) ;
623
624"Ideal Shell Side Pressure Drop"
625        Shell.PressureDrop.Ideal= 2*Shell.PressureDrop.FricFactor*(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/Tubes.TubePitch)*(Shell.Properties.Inlet.Fw/Sm)^2/(Shell.Properties.Average.rho*Shell.HeatTransfer.Phi);
626
627"Shell Pressure End Zones"
628        Shell.PressureDrop.EndZones = Shell.PressureDrop.Ideal*(1+ (Ncw/(Shell.ShellID*(1-0.02*Baffles.BaffleCut)/Tubes.TubePitch)))*Rb*Rspd;
629
630switch ShellRange
631       
632        case "range1":
633
634"Ji Factor"
635        Ji =0.970*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.667);
636       
637"Shell Side Pressure Drop Friction Factor"     
638        Shell.PressureDrop.FricFactor=35*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-1);
639
640        when Shell.HeatTransfer.Re > 10 switchto "range2";
641       
642        case "range2":
643
644"Ji Factor"
645        Ji =0.900*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.631);
646
647"Shell Side Pressure Drop Friction Factor"     
648        Shell.PressureDrop.FricFactor=32.10*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.963);
649
650        when Shell.HeatTransfer.Re > 100 switchto "range3";
651       
652        case "range3":
653
654"Ji Factor"
655        Ji =0.408*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.460);
656
657"Shell Side Pressure Drop Friction Factor"     
658        Shell.PressureDrop.FricFactor=6.090*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.602);
659
660        when Shell.HeatTransfer.Re > 1000 switchto "range4";
661       
662        case "range4":
663       
664"Ji Factor"
665        Ji =0.107*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.266);
666
667"Shell Side Pressure Drop Friction Factor"     
668        Shell.PressureDrop.FricFactor=0.0815*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^0.022;
669
670        when Shell.HeatTransfer.Re > 10000 switchto "range5";
671
672        case "range5":
673       
674"Ji Factor"
675        Ji =0.370*((1.33*Tubes.TubeOD/Tubes.TubePitch)^a)*Shell.HeatTransfer.Re^(-0.395);
676
677"Shell Side Pressure Drop Friction Factor"     
678        Shell.PressureDrop.FricFactor=0.391*((1.33*Tubes.TubeOD/Tubes.TubePitch)^b)*Shell.HeatTransfer.Re^(-0.148);
679
680        when Shell.HeatTransfer.Re < 10000 switchto "range4";
681       
682end
683
684end
685
686switch ShellFlowRegime
687
688        case "deep laminar":
689
690"Jr Factor"     
691        Jr = (10/((Nc +Ncw)*(Baffles.NumberOfBaffles+1)))^0.18;
692
693"Js Factor"
694        Js = (Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing)^0.7 + (Baffles.Outlet_Spacing/Baffles.Central_Spacing)^0.7)/(Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing) + (Baffles.Outlet_Spacing/Baffles.Central_Spacing));
695
696"Jb Factor"
697        Jb =    exp(-1.35*( Clearances.BundleToShell+ Tubes.TubeOD)*Baffles.Central_Spacing/Sm*(1-(2*(Clearances.SealStrip/Nc)^(1/3))));
698
699"ByPass Correction Factor for Pressure Drop"
700        Rb      = exp(-4.7*((Clearances.BundleToShell + Tubes.TubeOD)*Baffles.Central_Spacing/Sm)*(1-(2*Rss)^(1/3)));
701
702"Pressure Drop Correction Factor for Unequal Baffle Spacing"
703        Rspd = (Baffles.Central_Spacing/Baffles.Outlet_Spacing) + (Baffles.Central_Spacing/Baffles.Inlet_Spacing);
704
705"Shell Pressure Drop Baffle Window"
706        Shell.PressureDrop.Window    = Baffles.NumberOfBaffles*((26/Shell.Properties.Average.rho)*mw*Shell.Properties.Average.Mu*(Ncw/(Tubes.TubePitch-Tubes.TubeOD)+ Baffles.Central_Spacing/(Dw*Dw))+ 0.5*mw*mw/Shell.Properties.Average.rho)*exp(-1.33*(1+Rs)*((Scd + Std)/Sm)^(-0.15*(1+Rs) + 0.8));
707
708        when Shell.HeatTransfer.Re > 20 switchto "laminar";
709
710        case "laminar":
711
712"Jr Factor"     
713        Jr = (10/((Nc +Ncw)*(Baffles.NumberOfBaffles+1)))^0.18 + (0.25-0.0125*Shell.HeatTransfer.Re)*((10/((Nc +Ncw)*(Baffles.NumberOfBaffles+1)))^0.18 - 1);
714
715"Js Factor"
716        Js = (Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing)^0.7 + (Baffles.Outlet_Spacing/Baffles.Central_Spacing)^0.7)/(Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing) + (Baffles.Outlet_Spacing/Baffles.Central_Spacing));
717
718"Jb Factor"
719        Jb =    exp(-1.35*( Clearances.BundleToShell+ Tubes.TubeOD)*Baffles.Central_Spacing/Sm*(1-(2*(Clearances.SealStrip/Nc)^(1/3))));
720
721"ByPass Correction Factor for Pressure Drop"
722        Rb      = exp(-4.7*((Clearances.BundleToShell+ Tubes.TubeOD)*Baffles.Central_Spacing/Sm)*(1-(2*Rss)^(1/3)));
723
724"Pressure Drop Correction Factor for Unequal Baffle Spacing"
725        Rspd = (Baffles.Central_Spacing/Baffles.Outlet_Spacing) + (Baffles.Central_Spacing/Baffles.Inlet_Spacing);
726
727"Shell Pressure Drop Baffle Window"
728        Shell.PressureDrop.Window    = Baffles.NumberOfBaffles*((26/Shell.Properties.Average.rho)*mw*Shell.Properties.Average.Mu*(Ncw/(Tubes.TubePitch-Tubes.TubeOD)+ Baffles.Central_Spacing/(Dw*Dw))+ 0.5*mw*mw/Shell.Properties.Average.rho)*exp(-1.33*(1+Rs)*((Scd + Std)/Sm)^(-0.15*(1+Rs) + 0.8));
729
730        when Shell.HeatTransfer.Re < 20 switchto "deep laminar";
731        when Shell.HeatTransfer.Re > 100 switchto "turbulent";
732
733        case "turbulent":
734
735"Jr Factor"     
736        Jr = 1;
737
738"Js Factor"
739        Js = (Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing)^0.4 + (Baffles.Outlet_Spacing/Baffles.Central_Spacing)^0.4)/(Baffles.NumberOfBaffles-1+(Baffles.Inlet_Spacing/Baffles.Central_Spacing) + (Baffles.Outlet_Spacing/Baffles.Central_Spacing));
740
741"Jb Factor"
742        Jb =    exp(-1.25*( Clearances.BundleToShell+ Tubes.TubeOD)*Baffles.Central_Spacing/Sm*(1-(2*(Clearances.SealStrip/Nc)^(1/3))));
743
744"ByPass Correction Factor for Pressure Drop"
745        Rb      = exp(-3.7*((Clearances.BundleToShell + Tubes.TubeOD)*Baffles.Central_Spacing/Sm)*(1-(2*Rss)^(1/3)));
746
747"Pressure Drop Correction Factor for Unequal Baffle Spacing"
748        Rspd = (Baffles.Central_Spacing/Baffles.Outlet_Spacing)^1.8 + (Baffles.Central_Spacing/Baffles.Inlet_Spacing)^1.8;
749
750"Shell Pressure Drop Baffle Window"
751        Shell.PressureDrop.Window    = Baffles.NumberOfBaffles*((2+0.6*Ncw)*0.5*mw*mw/Shell.Properties.Average.rho)*exp(-1.33*(1+Rs)*((Scd + Std)/Sm)^(-0.15*(1+Rs) + 0.8));
752       
753        when Shell.HeatTransfer.Re < 100 switchto "laminar";
754       
755end
756
757"Shell Pressure Drop Cross Flow"
758        Shell.PressureDrop.CrossFlow= Shell.PressureDrop.Ideal*Rb*(Baffles.NumberOfBaffles-1)*exp(-1.33*(1+Rs)*((Scd + Std)/Sm)^(-0.15*(1+Rs) + 0.8));
759
760"Shell Side Phi correction"
761        Shell.HeatTransfer.Phi  = (Shell.Properties.Average.Mu/Shell.Properties.Wall.Mu)^0.14;
762
763"Tube Side Phi correction"
764        Tubes.HeatTransfer.Phi  = (Tubes.Properties.Average.Mu/Tubes.Properties.Wall.Mu)^0.14;
765       
766"Shell Side inlet Nozzle rho-V^2"
767        Shell.PressureDrop.RVsquare_in = Shell.Properties.Inlet.rho*(Shell.PressureDrop.Vnozzle_in)^2;
768
769"Shell Side Outlet Nozzle rho-V^2"
770        Shell.PressureDrop.RVsquare_out = Shell.Properties.Outlet.rho*(Shell.PressureDrop.Vnozzle_out)^2;
771
772"Tube Side Pressure Drop"
773        Tubes.PressureDrop.TubeFriction         = 2*Tubes.PressureDrop.FricFactor*Tubes.TubeLength*Tubes.Properties.Average.rho*(Tubes.HeatTransfer.Vtube^2)*Tubes.Tubepasses/(Tubes.TubeID*Tubes.HeatTransfer.Phi);
774
775"Pressure Drop Tube Side Inlet Nozzle"
776        Tubes.PressureDrop.InletNozzle  = 0.5*Kinlet_Tube*Tubes.Properties.Inlet.rho*Tubes.PressureDrop.Vnozzle_in^2;
777
778"Velocity Tube Side Inlet Nozzle"
779        Tubes.PressureDrop.Vnozzle_in   = Tubes.Properties.Inlet.Fw/(Tubes.Properties.Inlet.rho*Ainozzle_Tube);
780
781"Pressure Drop Tube Side Outlet Nozzle"
782        Tubes.PressureDrop.OutletNozzle = 0.5*Koutlet_Tube*Tubes.Properties.Outlet.rho*Tubes.PressureDrop.Vnozzle_out^2;
783
784"Velocity Tube Side Outlet Nozzle"
785        Tubes.PressureDrop.Vnozzle_out  = Tubes.Properties.Inlet.Fw/(Tubes.Properties.Outlet.rho*Aonozzle_Tube);
786
787"Shell Pressure Drop Inlet Nozzle"
788        Shell.PressureDrop.InletNozzle  = (0.5*Shell.Properties.Inlet.Fw^2/Shell.Properties.Inlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2));
789
790"Velocity Shell Side Inlet Nozzle"
791        Shell.PressureDrop.Vnozzle_in   = Shell.Properties.Inlet.Fw/(Shell.Properties.Inlet.rho*Ainozzle_Shell);
792
793"Shell Pressure Drop Outlet Nozzle"
794        Shell.PressureDrop.OutletNozzle = (0.5*Shell.Properties.Outlet.Fw^2/Shell.Properties.Outlet.rho)*((1/Ainozzle_Shell^2)+(1/Aeinozzle_Shell^2));
795
796"Velocity Shell Side Outlet Nozzle"
797        Shell.PressureDrop.Vnozzle_out  = Shell.Properties.Outlet.Fw/(Shell.Properties.Outlet.rho*Aonozzle_Shell);
798
799"Pressure Drop Shell Stream"
800        OutletShell.P  = InletShell.P - Shell.PressureDrop.Total;       
801       
802"Pressure Drop Tube Stream"
803        OutletTube.P  = InletTube.P - Tubes.PressureDrop.Total;
804
805"Shell Wall Temperature"
806        Shell.Properties.Wall.Twall     = (Shell.Properties.Average.T+Tubes.Properties.Average.T)/2;
807
808"Tube Wall Temperature"
809        Tubes.Properties.Wall.Twall  = (Shell.Properties.Average.T+Tubes.Properties.Average.T)/2;
810
811"Tube Side Velocity"
812        Tubes.HeatTransfer.Vtube        = Tubes.Properties.Inlet.Fw*Tubes.Tubepasses/((Pi*Tubes.TubeID*Tubes.TubeID/4)*Tubes.Properties.Average.rho*Tubes.NumberOfTubes);
813
814"Tube Side Reynolds Number"
815        Tubes.HeatTransfer.Re           = (Tubes.Properties.Average.rho*Tubes.HeatTransfer.Vtube*Tubes.TubeID)/Tubes.Properties.Average.Mu;
816       
817"Tube Side Prandtl Number"
818        Tubes.HeatTransfer.PR           = ((Tubes.Properties.Average.Cp/Tubes.Properties.Average.Mw)*Tubes.Properties.Average.Mu)/Tubes.Properties.Average.K;
819
820"Tube Side Film Coefficient"
821        Tubes.HeatTransfer.htube= (Tubes.HeatTransfer.Nu*Tubes.Properties.Average.K/Tubes.TubeID)*Tubes.HeatTransfer.Phi;
822
823"Shell Side Prandtl Number"
824        Shell.HeatTransfer.PR           = ((Shell.Properties.Average.Cp/Shell.Properties.Average.Mw)*Shell.Properties.Average.Mu)/Shell.Properties.Average.K;
825
826"Overall Heat Transfer Coefficient Dirty"
827        Details.Ud=1/(Tubes.TubeOD/(Tubes.HeatTransfer.htube*Tubes.TubeID)+Shell.Fouling+Tubes.Fouling*(Tubes.TubeOD/Tubes.TubeID)+(Tubes.TubeOD*ln(Tubes.TubeOD/Tubes.TubeID)/(2*Tubes.Kwall))+(1/(Shell.HeatTransfer.hshell)));
828
829"Overall Heat Transfer Coefficient Clean"
830        Details.Uc=1/(Tubes.TubeOD/(Tubes.HeatTransfer.htube*Tubes.TubeID)+(Tubes.TubeOD*ln(Tubes.TubeOD/Tubes.TubeID)/(2*Tubes.Kwall))+(1/(Shell.HeatTransfer.hshell)));
831
832"Exchange Surface Area"
833        Details.A=Pi*Tubes.TubeOD*Tubes.NumberOfTubes*Tubes.TubeLength;
834
835"Baffle Spacing Constraint"
836        Tubes.TubeLength = Baffles.Inlet_Spacing+Baffles.Outlet_Spacing+Baffles.Central_Spacing*(Baffles.NumberOfBaffles-1);
837
838"Shell Side Reynolds Number"
839        Shell.HeatTransfer.Re = (Tubes.TubeOD*Shell.Properties.Inlet.Fw/Sm)/Shell.Properties.Average.Mu;
840
841"Shell Heat Transfer Coefficient"
842        Shell.HeatTransfer.hshell                       = Ji*(Shell.Properties.Average.Cp/Shell.Properties.Average.Mw)*(Shell.Properties.Inlet.Fw/Sm)*(Shell.HeatTransfer.PR^(-2/3))*Jtotal*Shell.HeatTransfer.Phi;
843
844end
845
846Model ShellandTubes_NTU         as ShellandTubesBasic
847
848ATTRIBUTES
849        Pallete = true;
850        Icon    = "icon/STHE"; 
851        Brief  = "Shell and Tubes Heat Exchangers";
852        Info  =
853        "to be documented";
854
855VARIABLES
856
857Method as NTU_Basic (Brief="NTU Method");
858
859EQUATIONS
860
861"Number of Units Transference"
862        Method.NTU*Method.Cmin = Details.Ud*Pi*Tubes.TubeOD*Tubes.NumberOfTubes*Tubes.TubeLength;
863
864"Minimum Heat Capacity"
865        Method.Cmin  = min([Method.Ch,Method.Cc]);
866       
867"Maximum Heat Capacity"
868        Method.Cmax  = max([Method.Ch,Method.Cc]);
869
870"Thermal Capacity Ratio"
871        Method.Cr    = Method.Cmin/Method.Cmax;
872       
873switch HotSide
874       
875        case "shell":
876
877"Duty"
878        Details.Q       = Method.Eft*Method.Cmin*(InletShell.T-InletTube.T);
879
880"Hot Stream Heat Capacity"
881        Method.Ch  = InletShell.F*Shell.Properties.Average.Cp;
882       
883"Cold Stream Heat Capacity"
884        Method.Cc = InletTube.F*Tubes.Properties.Average.Cp;
885
886        when InletTube.T > InletShell.T switchto "tubes";
887       
888        case "tubes":
889
890"Duty"
891        Details.Q       = Method.Eft*Method.Cmin*(InletTube.T-InletShell.T);
892
893"Hot Stream Heat Capacity"
894        Method.Cc = InletShell.F*Shell.Properties.Average.Cp;
895       
896"Cold Stream Heat Capacity"
897        Method.Ch = InletTube.F*Tubes.Properties.Average.Cp;
898       
899        when InletTube.T < InletShell.T switchto "shell";
900       
901end
902
903switch ShellType
904       
905        case "Fshell":
906       
907"Effectiveness Correction for 2 pass shell side"
908        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);
909
910"TEMA F Shell Effectiveness"
911        Method.Eft = ( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 -1  )*( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 - Method.Cr )^(-1);
912
913        case "Eshell":
914       
915"TEMA E Shell Effectiveness"
916        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);
917#       Method.Eft = 1;
918
919"Variable not in use when 1 Pass Shell Side"
920        Method.Eft1     = 1;
921       
922end
923
924end
925
926Model ShellandTubes_LMTD        as ShellandTubesBasic
927
928ATTRIBUTES
929        Pallete = true;
930        Icon    = "icon/STHE"; 
931        Brief  = "Shell and Tubes Heat Exchangers";
932        Info  =
933        "to be documented.";
934
935PARAMETERS
936
937LMTDcorrection  as Switcher     (Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri" , "User Specified"],Default="Bowmann");
938FLMTDcorrection  as fraction (Default = 0.8);
939
940VARIABLES
941
942Method  as LMTD_Basic;
943R                       as positive     (Brief=" Capacity Ratio for LMTD Correction Fator",Lower=1e-6);
944P                       as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6);
945Pc                      as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side",Lower=1e-6);
946Rho             as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6);
947Phi     as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6);
948lambdaN as positive     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side",Lower=1e-6);
949lambda1 as positive  (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side",Lower=1e-6);
950
951EQUATIONS
952
953"Exchange Surface Area"
954        Details.Q   = Details.Ud*Pi*Tubes.TubeOD*Tubes.NumberOfTubes*Tubes.TubeLength*Method.LMTD*Method.Fc;
955
956switch HotSide
957       
958        case "shell":
959
960"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
961        Phi*(2*((InletShell.T+ OutletShell.T)-(InletTube.T+ OutletTube.T)))  = (sqrt(((InletShell.T- OutletShell.T)*(InletShell.T- OutletShell.T))+((OutletTube.T - InletTube.T)*(OutletTube.T - InletTube.T))));
962
963"R: Capacity Ratio for LMTD Correction Fator"
964        R*(OutletTube.T - InletTube.T ) = (InletShell.T-OutletShell.T);
965
966"P: Non - Dimensional Variable for LMTD Correction Fator"
967        P*(InletShell.T- InletTube.T)= (OutletTube.T-InletTube.T);
968       
969"Temperature Difference at Inlet"
970        Method.DT0 = InletShell.T - OutletTube.T;
971
972"Temperature Difference at Outlet"
973        Method.DTL = OutletShell.T - InletTube.T;
974
975        when InletTube.T > InletShell.T switchto "tubes";
976       
977        case "tubes":
978
979"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
980        Phi*(2*((InletShell.T+ OutletShell.T)-(InletTube.T+ OutletTube.T)))  = (sqrt(((InletShell.T- OutletShell.T)*(InletShell.T- OutletShell.T))+((OutletTube.T - InletTube.T)*(OutletTube.T - InletTube.T))));
981
982"R: Capacity Ratio for LMTD Correction Fator"
983        R*(OutletShell.T - InletShell.T ) = (InletTube.T-OutletTube.T);
984
985"P: Non - Dimensional Variable for LMTD Correction Fator"
986        P*(InletTube.T- InletShell.T)= (OutletShell.T-InletShell.T);
987       
988"Temperature Difference at Inlet"
989        Method.DT0 = InletTube.T - OutletShell.T;
990
991"Temperature Difference at Outlet"
992        Method.DTL = OutletTube.T - InletShell.T;
993
994       
995        when InletTube.T < InletShell.T switchto "shell";
996       
997end
998
999switch ShellType
1000       
1001        case "Fshell":
1002       
1003switch LMTDcorrection
1004       
1005        case "User Specified": #Just For Initialization
1006       
1007        Method.Fc = FLMTDcorrection;
1008       
1009" Variable not in use with this equation"
1010        lambdaN =1;
1011       
1012" Variable not in use with this equation"
1013        lambda1 =1;
1014
1015#" Variable not in use with this equation"
1016#       Phi = 1;
1017
1018" Variable not in use with this equation"
1019        Rho =1;
1020
1021" Variable not in use with this equation"
1022        Pc = P;
1023
1024        case "Bowmann":
1025       
1026" Variable not in use with Bowmann equation"
1027        lambdaN =1;
1028       
1029" Variable not in use with Bowmann equation"
1030        lambda1 =1;
1031
1032#" Variable not in use with Bowmann equation"
1033#       Phi = 1;
1034
1035" Variable not in use with Bowmann equation"
1036        Rho =1;
1037
1038if R equal 1
1039       
1040        then
1041       
1042"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
1043        Pc*(2-P)= P;
1044
1045"LMTD Correction Fator when 2 Pass Shell Side"
1046        Method.Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214))));
1047       
1048        else
1049       
1050"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
1051        Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R);
1052
1053"LMTD Correction Fator when 2 Pass Shell Side"
1054        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))))));
1055       
1056end
1057
1058        case "Fakeri":
1059       
1060" Variable not in use with Fakeri equation"
1061        Pc = P;
1062       
1063"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
1064        Rho*(1-P*R) = (1-P);
1065
1066#"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
1067#       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)));
1068
1069if Rho equal 1
1070       
1071        then
1072       
1073" Variable not in use when Rho = 1"
1074        lambdaN =       1;
1075       
1076" Variable not in use when Rho = 1"
1077        lambda1 =       1;
1078       
1079"LMTD Correction Fator when 2 Pass Shell Side"
1080        Method.Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi ))));
1081       
1082        else
1083
1084"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
1085        lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1));
1086       
1087"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
1088        lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1));
1089
1090"LMTD Correction Fator when 2 Pass Shell Side"
1091        Method.Fc =     ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN);
1092
1093end
1094
1095
1096end
1097
1098        case "Eshell":
1099       
1100" Variable not in use when 1 Pass Shell Side"
1101        lambdaN =1;
1102
1103" Variable not in use when 1 Pass Shell Side"
1104        lambda1 =1;
1105       
1106" Variable not in use when 1 Pass Shell Side"
1107        Pc = P;
1108       
1109switch LMTDcorrection
1110
1111        case "User Specified": #Just For Initialization
1112       
1113        Method.Fc = FLMTDcorrection;
1114       
1115#" Variable not in use with this equation"
1116#       lambdaN =1;
1117       
1118#" Variable not in use with this equation"
1119#       lambda1 =1;
1120
1121#" Variable not in use with this equation"
1122#       Phi = 1;
1123
1124" Variable not in use with this equation"
1125        Rho =1;
1126       
1127        case "Bowmann":
1128
1129#" Variable not in use with Bowmann equation"
1130#       Phi  = 1;
1131       
1132" Variable not in use with Bowmann equation"
1133        Rho = 1;
1134
1135
1136 if R equal 1
1137       
1138    then
1139       
1140"LMTD Correction Fator when 1 Pass Shell Side"
1141        Method.Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
1142
1143        else
1144       
1145"LMTD Correction Fator when 1 Pass Shell Side"
1146        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))))));
1147
1148end
1149
1150        case "Fakeri":
1151
1152#"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
1153#       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)));
1154
1155"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
1156        Rho*(1-P*R) = (1-P);
1157
1158if Rho equal 1
1159       
1160        then
1161       
1162"LMTD Correction Fator when 1 Pass Shell Side"
1163        Method.Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi))));
1164
1165        else
1166
1167"LMTD Correction Fator when 1 Pass Shell Side"
1168        Method.Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1));
1169       
1170end
1171
1172end
1173
1174       
1175end
1176
1177end
1178
Note: See TracBrowser for help on using the repository browser.