source: branches/gui/eml/heat_exchangers/HeatExchangerDetailed.mso @ 574

Last change on this file since 574 was 574, checked in by Rafael de Pelegrini Soares, 14 years ago

Updated the models to work with some language constraints

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