source: trunk/eml/heat_exchangers/HeatExchangerDetailed.mso @ 441

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

REMOVED SOME VARIABLES

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