source: mso/eml/heat_exchangers/HeatExchangerDetailed.mso @ 1

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

Initial import of the library

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 66.5 KB
Line 
1 #*--------------------------------------------------------------------*
2*
3*
4*
5*
6*
7*
8*               
9*                                               
10*
11*
12*----------------------------------------------------------------------
13* Author: Gerson Balbueno Bicca
14* $Id: HeatExchangerDetailed.mso 1 2006-06-20 17:33:53Z rafael $
15*--------------------------------------------------------------------*#
16
17using "HEX_Engine";
18
19#=====================================================================
20#       Basic Model for Detailed Heat Exchangers
21#=====================================================================
22
23Model HeatExchangerDetailed_Basic
24
25PARAMETERS
26
27ext PP      as CalcObject(Brief="External Physical Properties");
28ext HE      as CalcObject(Brief="STHE Calculations",File="heatex.dll");
29ext NComp   as Integer   (Brief="Number of Components");
30  M(NComp)  as molweight (Brief="Component Mol Weight");
31       
32VARIABLES
33
34in  Inlet           as Inlet_Main_Stream;       # Hot and Cold Inlets
35out Outlet      as Outlet_Main_Stream;  # Hot and Cold Outlets
36        Properties  as Main_Properties;         # Hot and Cold Properties
37        Details     as Details_Main;
38        Tubes           as Tube_Side_Main;     
39        Shell           as Shell_Side_Main;
40        Resistances as Main_Resistances;
41        Baffles     as Baffles_Main;
42
43SET
44
45M   = PP.MolecularWeight();
46
47EQUATIONS
48
49"Hot Stream Average Temperature"
50        Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T;
51       
52"Cold Stream Average Temperature"
53        Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T;
54       
55"Hot Stream Average Pressure"
56        Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P;
57       
58"Cold Stream Average Pressure"
59        Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P;
60       
61"Hot Stream Average Molecular Weight"
62        Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z);
63
64"Cold Stream Average Molecular Weight"
65        Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z);
66       
67
68if Inlet.Cold.v equal 0
69       
70        then   
71       
72"Heat Capacity Cold Stream"
73        Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
74        Properties.Cold.Inlet.Cp        =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
75        Properties.Cold.Outlet.Cp       =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
76
77"Mass Density Cold Stream"
78        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
79        Properties.Cold.Inlet.rho       =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
80        Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
81
82"Viscosity Cold Stream"
83        Properties.Cold.Average.Mu =    PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
84        Properties.Cold.Inlet.Mu =              PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
85        Properties.Cold.Outlet.Mu =     PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
86
87"Conductivity Cold Stream"
88        Properties.Cold.Average.K =     PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
89        Properties.Cold.Inlet.K =               PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
90        Properties.Cold.Outlet.K =              PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
91
92"Heat Capacity Cold Stream"
93        Properties.Cold.Wall.Cp         =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
94       
95"Viscosity Cold Stream"
96        Properties.Cold.Wall.Mu =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
97
98"Conductivity Cold Stream"
99        Properties.Cold.Wall.K =        PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
100
101
102        else
103
104"Heat Capacity Cold Stream"
105        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
106        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
107        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
108
109"Mass Density Cold Stream"
110        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
111        Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
112        Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
113
114"Viscosity Cold Stream"
115        Properties.Cold.Average.Mu =    PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
116        Properties.Cold.Inlet.Mu =              PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
117        Properties.Cold.Outlet.Mu =             PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
118
119"Conductivity Cold Stream"
120        Properties.Cold.Average.K =     PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
121        Properties.Cold.Inlet.K =               PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
122        Properties.Cold.Outlet.K =              PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
123       
124"Heat Capacity Cold Stream"
125        Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
126
127
128"Viscosity Cold Stream"
129        Properties.Cold.Wall.Mu =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
130
131"Conductivity Cold Stream"
132        Properties.Cold.Wall.K =        PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
133       
134       
135       
136end
137
138if Inlet.Hot.v equal 0
139
140        then
141
142"Heat Capacity Hot Stream"
143        Properties.Hot.Average.Cp       =               PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
144        Properties.Hot.Inlet.Cp         =               PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
145        Properties.Hot.Outlet.Cp        =               PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
146
147"Mass Density Hot Stream"
148        Properties.Hot.Average.rho      =               PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
149        Properties.Hot.Inlet.rho        =               PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
150        Properties.Hot.Outlet.rho       =               PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
151
152"Viscosity Hot Stream"
153        Properties.Hot.Average.Mu       =               PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);     
154        Properties.Hot.Inlet.Mu         =               PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);       
155        Properties.Hot.Outlet.Mu        =               PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);     
156
157"Conductivity Hot Stream"
158        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
159        Properties.Hot.Inlet.K  =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
160        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
161
162"Heat Capacity Hot Stream"
163        Properties.Hot.Wall.Cp  =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
164
165"Viscosity Hot Stream"
166        Properties.Hot.Wall.Mu  =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
167
168"Conductivity Hot Stream"
169        Properties.Hot.Wall.K   =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
170       
171
172        else
173
174"Heat Capacity Hot Stream"
175        Properties.Hot.Average.Cp       =               PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
176        Properties.Hot.Inlet.Cp         =               PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
177        Properties.Hot.Outlet.Cp        =               PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
178
179"Mass Density Hot Stream"
180        Properties.Hot.Average.rho      =               PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
181        Properties.Hot.Inlet.rho        =               PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
182        Properties.Hot.Outlet.rho       =               PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
183
184"Viscosity Hot Stream"
185        Properties.Hot.Average.Mu       =               PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
186        Properties.Hot.Inlet.Mu         =               PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
187        Properties.Hot.Outlet.Mu        =               PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
188
189"Conductivity Hot Stream"
190        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
191        Properties.Hot.Inlet.K  =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
192        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
193
194"Heat Capacity Hot Stream"
195        Properties.Hot.Wall.Cp  =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
196
197"Viscosity Hot Stream"
198        Properties.Hot.Wall.Mu  =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
199
200"Conductivity Hot Stream"
201        Properties.Hot.Wall.K   =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
202
203
204end
205
206#=====================================================================
207#       Thermal Details
208#=====================================================================
209"Hot Stream Heat Capacity"
210        Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp;
211       
212"Cold Stream Heat Capacity"
213        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
214       
215"Heat Capacity Ratio"
216        [Details.Cmin,Details.Cmax,Details.Cr]  = HE.HeatCapacityRatio(Details.Ch,Details.Cc);
217
218#=====================================================================
219#       Energy Balance
220#=====================================================================
221"Energy Balance Hot Stream"
222        Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h);
223
224"Energy Balance Cold Stream"
225        Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h);
226
227#=====================================================================
228#       Material Balance
229#=====================================================================
230"Flow Mass Inlet Cold Stream"
231        Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F;
232
233"Flow Mass Outlet Cold Stream"
234        Properties.Cold.Outlet.Fw       =  sum(M*Outlet.Cold.z)*Outlet.Cold.F;
235
236"Flow Mass Inlet Hot Stream"
237        Properties.Hot.Inlet.Fw         =  sum(M*Inlet.Hot.z)*Inlet.Hot.F;
238
239"Flow Mass Outlet Hot Stream"   
240        Properties.Hot.Outlet.Fw        =  sum(M*Outlet.Hot.z)*Outlet.Hot.F;
241
242"Molar Balance Hot Stream"
243        Inlet.Hot.F  = Outlet.Hot.F;
244       
245"Molar Balance Cold Stream"
246        Inlet.Cold.F = Outlet.Cold.F;
247
248#======================================
249#       Constraints
250#======================================
251"Hot Stream Molar Fraction Constraint"
252        Outlet.Hot.z=Inlet.Hot.z;
253       
254"Cold Stream Molar Fraction Constraint"
255        Outlet.Cold.z=Inlet.Cold.z;
256       
257"No Phase Change In Cold Stream"
258        Inlet.Cold.v=Outlet.Cold.v;
259
260"No Phase Change In Hot Stream"
261        Inlet.Hot.v=Outlet.Hot.v;
262
263       
264end
265
266Model Heatex_Detailed           as HeatExchangerDetailed_Basic
267
268PARAMETERS
269
270ext PP          as CalcObject;
271ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
272side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
273Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
274
275#=====================================================================
276#       Shell Geometrical Parameters
277#=====================================================================
278Tpass                   as Integer              (Brief="Number of Tube Passes",Lower=1);
279Nss                             as Integer              (Brief="Number of Sealing Strips pairs",Lower=1);
280Dishell                 as length               (Brief="Inside Shell Diameter",Lower=10e-6);
281Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6);
282Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6);
283Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6);
284Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6);
285Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8);
286#=====================================================================
287#       Tubes Geometrical Parameters
288#=====================================================================
289Ntt                             as Integer              (Brief="Total Number of Tubes in Shell",Default=100,Lower=1);
290Pattern         as Integer              (Brief="Tube Layout Characteristic Angle",Lower=30);
291Ltube                   as length               (Brief="Effective Tube Length",Lower=0.1);
292pitch                   as length               (Brief="Tube Pitch",Lower=1e-8);
293Kwall                   as conductivity (Brief="Tube Wall Material Thermal Conductivity");
294Dotube                  as length               (Brief="Tube Outside Diameter",Lower=10e-6);
295Ditube                  as length               (Brief="Tube Inside Diameter",Lower=10e-6);
296Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6);
297Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6);
298#=====================================================================
299#       Baffles Geometrical Parameters
300#=====================================================================
301Bc                      as Integer              (Brief="Baffle Cut",Default=25,Lower=25);
302Nb              as Real                 (Brief="Number of Baffles",Lower=1);
303Lcd                     as length               (Brief="Baffle-to-Shell Clearance",Lower=10e-8);
304Ltd                             as length               (Brief="Tube-to-Bafflehole Clearance",Lower=10e-8);
305#=====================================================================
306#=====================================================================
307EQUATIONS
308#=====================================================================
309
310"Shell Side Cross Flow Area"
311        Shell.HeatTransfer.Sm = HE.CrossFlowArea(Baffles.Ls);
312       
313"Ji Factor"
314        Shell.HeatTransfer.Ji = HE.JiFactor(Shell.HeatTransfer.Re);
315
316"Jc Factor"
317        Shell.HeatTransfer.Jc = HE.JcFactor();
318       
319"Jl Factor"
320        Shell.HeatTransfer.Jl = HE.JlFactor(Shell.HeatTransfer.Sm);
321
322"Jb Factor"
323        Shell.HeatTransfer.Jb = HE.JbFactor(Shell.HeatTransfer.Re,Baffles.Ls,Shell.HeatTransfer.Sm);
324
325"Jr Factor"     
326        Shell.HeatTransfer.Jr = HE.JrFactor(Shell.HeatTransfer.Re);
327       
328"Total J Factor"
329        Shell.HeatTransfer.Jtotal=Shell.HeatTransfer.Jc*Shell.HeatTransfer.Jl*Shell.HeatTransfer.Jb*Shell.HeatTransfer.Jr*Shell.HeatTransfer.Js;
330
331#=====================================================================
332#  Fluid Alocation
333#=====================================================================
334
335if side equal 1 then
336       
337       
338"Shell Side Phi correction"
339        Shell.HeatTransfer.Phi = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
340       
341"Tube Side Phi correction"
342        Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
343       
344        else
345       
346
347"Shell Side Phi correction"
348        Shell.HeatTransfer.Phi = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
349       
350"Tube Side Phi correction"
351        Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
352
353end
354
355
356if side equal 1
357       
358        then
359       
360"Wall Temperature"
361#       Properties.Hot.Wall.Twall = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
362
363#       Properties.Cold.Wall.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
364
365Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
366
367Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
368
369"Tube Side Velocity"
370        Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Properties.Cold.Inlet.Fw,Properties.Cold.Average.rho);
371
372"Tube Side Reynolds Number"
373        Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Properties.Cold.Average.rho,Tubes.HeatTransfer.Vtube,Properties.Cold.Average.Mu);
374       
375"Tube Side Prandtl Number"
376        Tubes.HeatTransfer.PR = HE.PrandtlNumber(Properties.Cold.Average.K,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Average.Mu);
377
378"Tube Side Prandtl Number at Wall Temperature"
379        Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Properties.Cold.Wall.K,Properties.Cold.Wall.Cp,Properties.Cold.Average.Mw,Properties.Cold.Wall.Mu);
380
381"Tube Side Film Coefficient"
382        Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Cold.Average.K,Tubes.HeatTransfer.Phi);
383       
384"Shell Side Prandtl Number"
385        Shell.HeatTransfer.PR=HE.PrandtlNumber(Properties.Hot.Average.K,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Average.Mu);
386
387"Shell Side Prandtl Number at Wall Temperature"
388        Shell.HeatTransfer.PRw = HE.PrandtlNumber(Properties.Hot.Wall.K,Properties.Hot.Wall.Cp,Properties.Hot.Average.Mw,Properties.Hot.Wall.Mu);       
389
390"Tube Side Pressure Drop"
391        Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Cold.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi);
392
393"Pressure Drop Tube Side Inlet Nozzle"
394        Tubes.PressureDrop.Pdnozzle_in  = HE.DeltaPtubeNozzlein(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw);
395
396"Velocity Tube Side Inlet Nozzle"
397        Tubes.PressureDrop.Vnozzle_in   = HE.TubeVelocityNozzlein(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw);
398
399"Pressure Drop Tube Side Outlet Nozzle"
400        Tubes.PressureDrop.Pdnozzle_out = HE.DeltaPtubeNozzleout(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw);
401
402"Velocity Tube Side Outlet Nozzle"
403        Tubes.PressureDrop.Vnozzle_out  = HE.TubeVelocityNozzleout(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw);
404
405"Shell Pressure Drop Inlet Nozzle"
406        Shell.PressureDrop.Pdnozzle_in  = HE.DeltaPshellNozzleIn(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw);
407
408"Velocity Shell Side Inlet Nozzle"
409        Shell.PressureDrop.Vnozzle_in   = HE.ShellVelocityNozzleIn(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw);
410
411"Shell Pressure Drop Outlet Nozzle"
412        Shell.PressureDrop.Pdnozzle_out =HE.DeltaPshellNozzleOut(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw);
413
414"Velocity Shell Side Outlet Nozzle"
415        Shell.PressureDrop.Vnozzle_out  =HE.ShellVelocityNozzleOut(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw);
416
417"Pressure Drop Hot Stream"
418        Outlet.Hot.P  = Inlet.Hot.P- Shell.PressureDrop.Pdtotal;       
419       
420"Pressure Drop Cold Stream"
421        Outlet.Cold.P  = Inlet.Cold.P - Tubes.PressureDrop.Pdtotal;
422
423
424        else
425
426"Wall Temperature"
427#       Properties.Cold.Wall.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
428
429#       Properties.Hot.Wall.Twall = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
430
431
432Properties.Hot.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
433
434Properties.Cold.Wall.Twall  = (Properties.Hot.Average.T+Properties.Cold.Average.T)/2;
435
436"Tube Side Velocity"
437        Tubes.HeatTransfer.Vtube=HE.TubeVelocity(Properties.Hot.Inlet.Fw,Properties.Hot.Average.rho);
438
439"Tube Side Reynolds Number"
440        Tubes.HeatTransfer.Re=HE.TubeReynoldsNumber(Properties.Hot.Average.rho,Tubes.HeatTransfer.Vtube,Properties.Hot.Average.Mu);
441       
442"Tube Side Prandtl Number"
443        Tubes.HeatTransfer.PR=HE.PrandtlNumber(Properties.Hot.Average.K,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Average.Mu);
444
445"Tube Side Prandtl Number at Wall"
446        Tubes.HeatTransfer.PRw=HE.PrandtlNumber(Properties.Hot.Wall.K,Properties.Hot.Wall.Cp,Properties.Hot.Average.Mw,Properties.Hot.Wall.Mu);
447
448"Tube Side Film Coefficient"
449        Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Tubes.HeatTransfer.Re,Tubes.HeatTransfer.PR,Properties.Hot.Average.K,Tubes.HeatTransfer.Phi);
450       
451"Shell Side Prandtl Number"
452        Shell.HeatTransfer.PR=HE.PrandtlNumber(Properties.Cold.Average.K,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Average.Mu);
453
454"Shell Side Prandtl Number at Wall"
455        Shell.HeatTransfer.PRw=HE.PrandtlNumber(Properties.Cold.Wall.K,Properties.Cold.Wall.Cp,Properties.Cold.Average.Mw,Properties.Cold.Wall.Mu);
456
457"Tube Side Pressure Drop"
458        Tubes.PressureDrop.PdTube               = HE.DeltaPtube(Tubes.HeatTransfer.Re,Properties.Hot.Average.rho,Tubes.HeatTransfer.Vtube,Tubes.HeatTransfer.Phi);
459
460"Pressure Drop Tube Side Inlet Nozzle"
461        Tubes.PressureDrop.Pdnozzle_in  = HE.DeltaPtubeNozzlein(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw);
462
463"Velocity Tube Side Inlet Nozzle"
464        Tubes.PressureDrop.Vnozzle_in   = HE.TubeVelocityNozzlein(Properties.Hot.Inlet.rho,Properties.Hot.Inlet.Fw);
465
466"Pressure Drop Tube Side Outlet Nozzle"
467        Tubes.PressureDrop.Pdnozzle_out = HE.DeltaPtubeNozzleout(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw);   
468
469"Velocity Tube Side Outlet Nozzle"
470        Tubes.PressureDrop.Vnozzle_out  = HE.TubeVelocityNozzleout(Properties.Hot.Outlet.rho,Properties.Hot.Inlet.Fw); 
471
472"Shell Pressure Drop Inlet Nozzle"
473        Shell.PressureDrop.Pdnozzle_in  = HE.DeltaPshellNozzleIn(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw);
474
475"Velocity Shell Side Inlet Nozzle"
476        Shell.PressureDrop.Vnozzle_in   = HE.ShellVelocityNozzleIn(Properties.Cold.Inlet.rho,Properties.Cold.Inlet.Fw);
477
478"Shell Pressure Drop Outlet Nozzle"
479        Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw);
480
481"Velocity Shell Side Outlet Nozzle"
482        Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Properties.Cold.Outlet.rho,Properties.Cold.Inlet.Fw);
483
484"Pressure Drop Hot Stream"
485        Outlet.Hot.P  = Inlet.Hot.P- Tubes.PressureDrop.Pdtotal;       
486       
487"Pressure Drop Cold Stream"
488        Outlet.Cold.P  = Inlet.Cold.P - Shell.PressureDrop.Pdtotal;
489
490
491end
492
493#=====================================================================
494
495"Tube Resistance"       
496        Resistances.Rtube*(Tubes.HeatTransfer.htube*Ditube) = Dotube;
497       
498"Wall Resistance"
499        Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall);
500       
501"Shell Resistance"
502        Resistances.Rshell*(Shell.HeatTransfer.hshell)=1;
503       
504"Overall Heat Transfer Coefficient"
505        Details.U=1/(Dotube/(Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Shell.HeatTransfer.hshell)));
506
507"Exchange Surface Area"
508        Details.A=Pi*Dotube*Ntt*Ltube;
509
510"Baffles Spacing"
511        Ltube = Baffles.Lsi+Baffles.Lso+Baffles.Ls*(Nb-1);
512       
513       
514
515        SET
516#=====================================================================
517#  Set Parameters for heatex Calculation
518#=====================================================================
519        Pi                              = 3.14159265;
520        HE.Tpass                        = Tpass;
521        HE.Nss                          = Nss;
522        HE.Ntt                          = Ntt;
523        HE.Pattern                      = Pattern;
524        HE.Bc                           = Bc;
525        HE.Donozzle_Shell       = Donozzle_Shell;
526        HE.Dinozzle_Shell       = Dinozzle_Shell;
527        HE.Honozzle_Shell       = Honozzle_Shell;
528        HE.Hinozzle_Shell       = Hinozzle_Shell;
529        HE.Donozzle_Tube        = Donozzle_Tube;
530        HE.Dinozzle_Tube        = Dinozzle_Tube;
531        HE.Nb                       = Nb;
532        HE.Dishell                      = Dishell;             
533        HE.Lcf                          = Lcf; 
534        HE.Ltube                        = Ltube;       
535        HE.pitch                        = pitch;               
536        HE.Dotube                       = Dotube;       
537        HE.Ditube                       = Ditube;       
538        HE.Lcd                          = Lcd;
539        HE.Ltd                          = Ltd;
540        side                            = HE.FluidAlocation();
541       
542end
543
544Model Heatex_Detailed_NTU               as Heatex_Detailed
545       
546VARIABLES
547
548Eft                              as positive            (Brief="Effectiveness",Default=0.05,Lower=1e-8);
549       
550EQUATIONS       
551Details.Q       = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); 
552       
553end
554
555Model Heatex_Detailed_LMTD              as Heatex_Detailed
556       
557VARIABLES
558LMTD            as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=5);
559Fc                      as positive             (Brief="LMTD Correction Factor",Lower=0.7);
560MTD                     as temp_delta   (Brief="Mean Temperature Difference",Lower=5);
561
562EQUATIONS
563
564"Exchange Surface Area"
565        Details.Q   = Details.U*Details.A*MTD;
566       
567"Mean Temperature Difference"   
568        MTD   = Fc*LMTD;
569       
570end
571
572
573Model E_Shell_NTU_Det                   as Heatex_Detailed_NTU
574#=====================================================================
575#       Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method
576#=====================================================================
577EQUATIONS
578
579"TEMA E Shell Effectiveness"
580        Eft = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1;
581
582"Js Factor"     
583        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
584
585if side equal 1
586       
587        then
588       
589"Shell Side Reynolds Number"
590        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
591
592"Shell Heat Transfer Coefficient"
593        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
594
595"Shell Pressure Drop Cross Flow"
596        Shell.PressureDrop.PdCross              = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
597
598"Shell Pressure Baffle Window"
599        Shell.PressureDrop.Pdwindow             = HE.DeltaPwindow(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.rho,Properties.Hot.Average.Mu,Baffles.Ls);
600
601"Shell Pressure End Zones"
602        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
603
604
605        else
606
607"Shell Side Reynolds Number"
608        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
609
610"Shell Heat Transfer Coefficient"
611        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
612
613"Shell Pressure Drop Cross Flow"
614        Shell.PressureDrop.PdCross      = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
615
616"Shell Pressure Baffle Window"
617        Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.rho,Properties.Cold.Average.Mu,Baffles.Ls);
618
619"Shell Pressure End Zones"
620        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
621
622
623end
624
625
626end
627
628Model F_Shell_NTU_Det                   as Heatex_Detailed_NTU
629#=====================================================================
630#       Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method
631#=====================================================================
632VARIABLES
633
634Eft1    as positive (Brief="Effectiveness Correction",Lower=0.01,Default=0.5);
635
636EQUATIONS
637
638"Effectiveness Correction"
639        Eft1 = 2*(1+Details.Cr+sqrt(1+Details.Cr^2)*((1+exp(-Details.NTU*sqrt(1+Details.Cr^2)))/(1-exp(-Details.NTU*sqrt(1+Details.Cr^2)))) )^-1;
640
641"TEMA F Shell Effectiveness"
642        Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1  )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1;
643
644"Js Factor"     
645        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
646
647if side equal 1
648       
649        then
650       
651"Shell Side Reynolds Number"
652        Shell.HeatTransfer.Re= HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
653
654"Shell Heat Transfer Coefficient"
655        Shell.HeatTransfer.hshell= HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
656
657"Shell Pressure Drop Cross Flow"
658        Shell.PressureDrop.PdCross              = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
659
660"Shell Pressure Baffle Window"
661        Shell.PressureDrop.Pdwindow             = HE.DeltaPwindow(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.rho,Properties.Hot.Average.Mu,Baffles.Ls);
662
663"Shell Pressure End Zones"
664        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
665
666
667        else
668
669"Shell Side Reynolds Number"
670        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
671
672"Shell Heat Transfer Coefficient"
673        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
674
675"Shell Pressure Drop Cross Flow"
676        Shell.PressureDrop.PdCross      = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
677
678"Shell Pressure Baffle Window"
679        Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.rho,Properties.Cold.Average.Mu,Baffles.Ls);
680
681"Shell Pressure End Zones"
682        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
683
684
685end
686
687
688end
689
690Model Multipass_NTU_Det         
691#============================================================================
692#       Shell and Tubes Heat Exchanger In Series with 1 shell pass - LMTD Method
693#============================================================================
694PARAMETERS
695
696Nshell          as Integer              (Brief="N Shell in Series",Default=2);
697ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
698ext PP          as CalcObject;
699side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
700Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
701
702#=====================================================================
703#       Shell Geometrical Parameters
704#=====================================================================
705Tpass                   as Integer              (Brief="Number of Tube Passes",Lower=1);
706Nss                             as Integer              (Brief="Number of Sealing Strips pairs",Lower=1);
707Dishell                 as length               (Brief="Inside Shell Diameter",Lower=10e-6);
708Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6);
709Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6);
710Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6);
711Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6);
712Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8);
713#=====================================================================
714#       Tubes Geometrical Parameters
715#=====================================================================
716Ntt                             as Integer              (Brief="Total Number of Tubes in Shell",Default=100,Lower=1);
717Pattern         as Integer              (Brief="Tube Layout Characteristic Angle",Lower=30);
718Ltube                   as length               (Brief="Effective Tube Length",Lower=0.1);
719pitch                   as length               (Brief="Tube Pitch",Lower=1e-8);
720Kwall                   as conductivity (Brief="Tube Wall Material Thermal Conductivity");
721Dotube                  as length               (Brief="Tube Outside Diameter",Lower=10e-6);
722Ditube                  as length               (Brief="Tube Inside Diameter",Lower=10e-6);
723Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6);
724Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6);
725#=====================================================================
726#       Baffles Geometrical Parameters
727#=====================================================================
728Bc                      as Integer              (Brief="Baffle Cut",Default=25,Lower=25);
729Nb              as Real                 (Brief="Number of Baffles",Lower=1);
730Lcd                     as length               (Brief="Baffle-to-Shell Clearance",Lower=10e-8);
731Ltd                             as length               (Brief="Tube-to-Bafflehole Clearance",Lower=10e-8);
732#=====================================================================
733VARIABLES
734
735Eft(Nshell)       as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8);
736Unity(Nshell) as HeatExchangerDetailed_Basic;# "Shell in Series"
737
738CONNECTIONS
739
740Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot;
741Unity([2:Nshell]).Outlet.Cold to Unity([1:Nshell-1]).Inlet.Cold;
742
743EQUATIONS
744
745for i in [1:Nshell]
746       
747"Shell Side Cross Flow Area"
748        Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls);
749
750"Ji Factor"
751        Unity(i).Shell.HeatTransfer.Ji = HE.JiFactor(Unity(i).Shell.HeatTransfer.Re);
752
753"Jc Factor"
754        Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor();
755       
756"Jl Factor"
757        Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm);
758
759"Jb Factor"
760        Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm);
761
762"Jr Factor"     
763        Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re);
764       
765"Total J Factor"
766        Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js;
767
768
769
770#=====================================================================
771#  Fluid Alocation
772#=====================================================================
773
774if side equal 1 then
775       
776"Shell Side Phi correction for viscosity"
777        Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu);
778       
779"Tube Side Phi correction for viscosity"
780        Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
781       
782        else
783       
784"Shell Side Phi correction for viscosity"
785        Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
786       
787"Tube Side Phi correction for viscosity"
788        Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Average.Mu);
789
790end
791
792
793if side equal 1
794       
795        then
796       
797"Wall Temperature"
798#       Unity(i).Tubes.HeatTransfer.Twall  = HE.WallTemperature(Unity(i).Properties.Hot.Average.T,Unity(i).Properties.Cold.Average.T,Unity(i).Tubes.HeatTransfer.htube,Unity(i).Shell.HeatTransfer.hshell);
799        Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
800        Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
801
802"Tube Side Velocity"
803        Unity(i).Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
804
805"Tube Side Reynolds Number"
806        Unity(i).Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
807       
808"Tube Side Prandtl Number"
809        Unity(i).Tubes.HeatTransfer.PR = HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
810
811"Tube Side Prandtl Number at Wall Temperature"
812        Unity(i).Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
813
814
815"Tube Side Film Coefficient"
816        Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,Unity(i).Tubes.HeatTransfer.Phi);
817       
818"Shell Side Prandtl Number"
819        Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
820
821"Shell Side Prandtl Number at Wall Temperature"
822        Unity(i).Shell.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu); 
823
824"Tube Side Pressure Drop"
825        Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi);
826
827"Pressure Drop Tube Side Inlet Nozzle"
828        Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
829
830"Velocity Tube Side Inlet Nozzle"
831        Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
832
833"Pressure Drop Tube Side Outlet Nozzle"
834        Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
835
836"Velocity Tube Side Outlet Nozzle"
837        Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
838
839"Shell Pressure Drop Inlet Nozzle"
840        Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
841
842"Velocity Shell Side Inlet Nozzle"
843        Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
844
845"Shell Pressure Drop Outlet Nozzle"
846        Unity(i).Shell.PressureDrop.Pdnozzle_out        =HE.DeltaPshellNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
847
848"Velocity Shell Side Outlet Nozzle"
849        Unity(i).Shell.PressureDrop.Vnozzle_out =HE.ShellVelocityNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
850
851"Pressure Drop Hot Stream"
852        Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Shell.PressureDrop.Pdtotal;     
853       
854"Pressure Drop Cold Stream"
855        Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal;
856
857
858        else
859
860"Wall Temperature"
861#       Unity(i).Tubes.HeatTransfer.Twall       =       HE.WallTemperature(Unity(i).Properties.Cold.Average.T,Unity(i).Properties.Hot.Average.T,Unity(i).Tubes.HeatTransfer.htube,Unity(i).Shell.HeatTransfer.hshell);
862        Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
863        Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
864
865"Tube Side Velocity"
866        Unity(i).Tubes.HeatTransfer.Vtube       =       HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
867
868"Tube Side Reynolds Number"
869        Unity(i).Tubes.HeatTransfer.Re          =       HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
870       
871"Tube Side Prandtl Number"
872        Unity(i).Tubes.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
873       
874"Tube Side Prandtl Number at Wall"
875        Unity(i).Tubes.HeatTransfer.PRw     =  HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
876
877
878"Tube Side Film Coefficient"
879        Unity(i).Tubes.HeatTransfer.htube       =       HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,Unity(i).Tubes.HeatTransfer.Phi);
880       
881"Shell Side Prandtl Number"
882        Unity(i).Shell.HeatTransfer.PR          =       HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
883       
884"Shell Side Prandtl Number at Wall"
885        Unity(i).Shell.HeatTransfer.PRw     =   HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
886
887
888"Tube Side Pressure Drop"
889        Unity(i).Tubes.PressureDrop.PdTube      =       HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi);
890
891"Pressure Drop Tube Side Inlet Nozzle"
892        Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
893
894"Velocity Tube Side Inlet Nozzle"
895        Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
896
897"Pressure Drop Tube Side Outlet Nozzle"
898        Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); 
899
900"Velocity Tube Side Outlet Nozzle"
901        Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);       
902
903"Shell Pressure Drop Inlet Nozzle"
904        Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
905
906"Velocity Shell Side Inlet Nozzle"
907        Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
908
909"Shell Pressure Drop Outlet Nozzle"
910        Unity(i).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
911
912"Velocity Shell Side Outlet Nozzle"
913        Unity(i).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
914
915"Pressure Drop Hot Stream"
916        Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal;     
917       
918"Pressure Drop Cold Stream"
919        Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal;
920
921
922end
923
924"Tube Resistance"       
925        Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube;
926       
927"Wall Resistance"
928        Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall);
929       
930"Shell Resistance"
931        Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1;
932       
933"Overall Heat Transfer Coefficient"
934        Unity(i).Details.U=1/(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell)));
935
936"Exchange Surface Area"
937        Unity(i).Details.A=Pi*Dotube*Ntt*Ltube;
938
939"Baffles Spacing"
940        Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1);
941       
942
943"TEMA E Shell Effectiveness"
944        Eft(i) = 2*(1+Unity(i).Details.Cr+sqrt(1+Unity(i).Details.Cr^2)*((1+exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))/(1-exp(-Unity(i).Details.NTU*sqrt(1+Unity(i).Details.Cr^2)))) )^-1;
945
946"Js Factor"     
947        Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls);
948
949if side equal 1
950       
951        then
952       
953"Shell Side Reynolds Number"
954        Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
955
956"Shell Heat Transfer Coefficient"
957        Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
958
959"Shell Pressure Drop Cross Flow"
960        Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho);
961
962"Shell Pressure Baffle Window"
963        Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls);
964
965"Shell Pressure End Zones"
966        Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho);
967
968
969        else
970
971"Shell Side Reynolds Number"
972        Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
973
974"Shell Heat Transfer Coefficient"
975        Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
976
977"Shell Pressure Drop Cross Flow"
978        Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho);
979
980"Shell Pressure Baffle Window"
981        Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls);
982
983"Shell Pressure End Zones"
984        Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho);
985
986
987end
988
989        Unity(i).Details.Q      = Eft(i)*Unity(i).Details.Cmin*(Unity(i).Inlet.Hot.T-Unity(i).Inlet.Cold.T);
990
991end
992
993        SET
994#=====================================================================
995#  Set Parameters for heatex Calculation
996#=====================================================================
997        Pi                              = 3.14159265;
998        HE.Tpass                        = Tpass;
999        HE.Nss                          = Nss;
1000        HE.Ntt                          = Ntt;
1001        HE.Pattern                      = Pattern;
1002        HE.Bc                           = Bc;
1003        HE.Donozzle_Shell       = Donozzle_Shell;
1004        HE.Dinozzle_Shell       = Dinozzle_Shell;
1005        HE.Honozzle_Shell       = Honozzle_Shell;
1006        HE.Hinozzle_Shell       = Hinozzle_Shell;
1007        HE.Donozzle_Tube        = Donozzle_Tube;
1008        HE.Dinozzle_Tube        = Dinozzle_Tube;
1009        HE.Nb                       = Nb;
1010        HE.Dishell                      = Dishell;             
1011        HE.Lcf                          = Lcf; 
1012        HE.Ltube                        = Ltube;       
1013        HE.pitch                        = pitch;               
1014        HE.Dotube                       = Dotube;       
1015        HE.Ditube                       = Ditube;       
1016        HE.Lcd                          = Lcd;
1017        HE.Ltd                          = Ltd; 
1018        side                            = HE.FluidAlocation();
1019
1020end
1021
1022Model E_Shell_LMTD_Det                  as Heatex_Detailed_LMTD
1023#=====================================================================
1024#       Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method
1025#=====================================================================
1026EQUATIONS
1027
1028"LMTD Correction Factor"
1029        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
1030
1031"Counter Flow LMTD"
1032        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
1033
1034"Js Factor"     
1035        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
1036
1037if side equal 1
1038       
1039        then
1040       
1041"Shell Side Reynolds Number"
1042        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
1043
1044"Shell Heat Transfer Coefficient"
1045        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
1046
1047"Shell Pressure Drop Cross Flow"
1048        Shell.PressureDrop.PdCross              = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
1049
1050"Shell Pressure Baffle Window"
1051        Shell.PressureDrop.Pdwindow             = HE.DeltaPwindow(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.rho,Properties.Hot.Average.Mu,Baffles.Ls);
1052
1053"Shell Pressure End Zones"
1054        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
1055
1056
1057        else
1058
1059"Shell Side Reynolds Number"
1060        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
1061
1062"Shell Heat Transfer Coefficient"
1063        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
1064
1065"Shell Pressure Drop Cross Flow"
1066        Shell.PressureDrop.PdCross      = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
1067
1068"Shell Pressure Baffle Window"
1069        Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.rho,Properties.Cold.Average.Mu,Baffles.Ls);
1070
1071"Shell Pressure End Zones"
1072        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
1073
1074
1075end
1076
1077
1078
1079end
1080
1081Model F_Shell_LMTD_Det                  as Heatex_Detailed_LMTD
1082#=====================================================================
1083#       Shell and Tubes Heat Exchanger with 2 shell pass - LMTD Method
1084#=====================================================================
1085
1086EQUATIONS
1087
1088"LMTD Correction Factor"
1089        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
1090
1091"Counter Flow LMTD"
1092        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
1093
1094"Js Factor"     
1095        Shell.HeatTransfer.Js = HE.JsFactor(Shell.HeatTransfer.Re,Baffles.Lsi,Baffles.Lso,Baffles.Ls);
1096
1097if side equal 1
1098       
1099        then
1100       
1101"Shell Side Reynolds Number"
1102        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.Mu);
1103
1104"Shell Heat Transfer Coefficient"
1105        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Hot.Average.Cp,Properties.Hot.Average.Mw,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
1106
1107"Shell Pressure Drop Cross Flow"
1108        Shell.PressureDrop.PdCross              = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
1109
1110"Shell Pressure Baffle Window"
1111        Shell.PressureDrop.Pdwindow             = HE.DeltaPwindow(Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Hot.Average.rho,Properties.Hot.Average.Mu,Baffles.Ls);
1112
1113"Shell Pressure End Zones"
1114        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Hot.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Hot.Average.rho);
1115
1116
1117        else
1118
1119"Shell Side Reynolds Number"
1120        Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.Mu);
1121
1122"Shell Heat Transfer Coefficient"
1123        Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Shell.HeatTransfer.Ji,Properties.Cold.Average.Cp,Properties.Cold.Average.Mw,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Shell.HeatTransfer.PR,Shell.HeatTransfer.Jtotal,Shell.HeatTransfer.Phi);
1124
1125"Shell Pressure Drop Cross Flow"
1126        Shell.PressureDrop.PdCross      = HE.DeltaPcross(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
1127
1128"Shell Pressure Baffle Window"
1129        Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Sm,Properties.Cold.Average.rho,Properties.Cold.Average.Mu,Baffles.Ls);
1130
1131"Shell Pressure End Zones"
1132        Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Shell.HeatTransfer.Re,Baffles.Ls,Baffles.Lso,Baffles.Lsi,Properties.Cold.Inlet.Fw,Shell.HeatTransfer.Phi,Properties.Cold.Average.rho);
1133
1134
1135end
1136
1137
1138
1139end
1140
1141Model Multipass_LMTD_Det         
1142#============================================================================
1143#       Shell and Tubes Heat Exchanger In Series with 1 shell pass - LMTD Method
1144#============================================================================
1145PARAMETERS
1146
1147Nshell          as Integer      (Brief="N Shell in Series",Default=2);
1148ext     HE              as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
1149ext PP          as CalcObject;
1150side        as Integer          (Brief="Fluid Alocation",Lower=0,Upper=1);
1151Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
1152
1153#=====================================================================
1154#       Shell Geometrical Parameters
1155#=====================================================================
1156Tpass                   as Integer              (Brief="Number of Tube Passes",Lower=1);
1157Nss                             as Integer              (Brief="Number of Sealing Strips pairs",Lower=1);
1158Dishell                 as length               (Brief="Inside Shell Diameter",Lower=10e-6);
1159Donozzle_Shell  as length               (Brief="Shell Outlet Nozzle Diameter",Lower=10e-6);
1160Dinozzle_Shell  as length               (Brief="Shell Inlet Nozzle Diameter",Lower=10e-6);
1161Hinozzle_Shell  as length               (Brief="Height Under Shell Inlet Nozzle",Lower=10e-6);
1162Honozzle_Shell  as length               (Brief="Height Under Shell Outlet Nozzle",Lower=10e-6);
1163Lcf                     as length               (Brief="Bundle-to-Shell Clearance",Lower=10e-8);
1164#=====================================================================
1165#       Tubes Geometrical Parameters
1166#=====================================================================
1167Ntt                             as Integer              (Brief="Total Number of Tubes in Shell",Default=100,Lower=1);
1168Pattern         as Integer              (Brief="Tube Layout Characteristic Angle",Lower=30);
1169Ltube                   as length               (Brief="Effective Tube Length",Lower=0.1);
1170pitch                   as length               (Brief="Tube Pitch",Lower=1e-8);
1171Kwall                   as conductivity (Brief="Tube Wall Material Thermal Conductivity");
1172Dotube                  as length               (Brief="Tube Outside Diameter",Lower=10e-6);
1173Ditube                  as length               (Brief="Tube Inside Diameter",Lower=10e-6);
1174Donozzle_Tube   as length               (Brief="Tube Outlet Nozzle Diameter",Lower=10e-6);
1175Dinozzle_Tube   as length               (Brief="Tube Inlett Nozzle Diameter",Lower=10e-6);
1176#=====================================================================
1177#       Baffles Geometrical Parameters
1178#=====================================================================
1179Bc                      as Integer              (Brief="Baffle Cut",Default=25,Lower=25);
1180Nb              as Real                 (Brief="Number of Baffles",Lower=1);
1181Lcd                     as length               (Brief="Baffle-to-Shell Clearance",Lower=10e-8);
1182Ltd                             as length               (Brief="Tube-to-Bafflehole Clearance",Lower=10e-8);
1183#=====================================================================
1184VARIABLES
1185
1186LMTD(Nshell)            as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=10);
1187Fc(Nshell)                      as positive             (Brief="LMTD Correction Factor",Lower=0.75);
1188MTD(Nshell)                     as temp_delta   (Brief="Mean Temperature Difference");
1189
1190Unity(Nshell) as HeatExchangerDetailed_Basic;
1191
1192CONNECTIONS
1193
1194Unity([1:Nshell-1]).Outlet.Hot  to Unity([2:Nshell]).Inlet.Hot;
1195Unity([2:Nshell]).Outlet.Cold to Unity([1:Nshell-1]).Inlet.Cold;
1196
1197EQUATIONS
1198
1199for i in [1:Nshell]
1200       
1201"Shell Side Cross Flow Area"
1202        Unity(i).Shell.HeatTransfer.Sm = HE.CrossFlowArea(Unity(i).Baffles.Ls);
1203
1204"Ji Factor"
1205        Unity(i).Shell.HeatTransfer.Ji = HE.JiFactor(Unity(i).Shell.HeatTransfer.Re);
1206
1207"Jc Factor"
1208        Unity(i).Shell.HeatTransfer.Jc = HE.JcFactor();
1209       
1210"Jl Factor"
1211        Unity(i).Shell.HeatTransfer.Jl = HE.JlFactor(Unity(i).Shell.HeatTransfer.Sm);
1212
1213"Jb Factor"
1214        Unity(i).Shell.HeatTransfer.Jb = HE.JbFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Shell.HeatTransfer.Sm);
1215
1216"Jr Factor"     
1217        Unity(i).Shell.HeatTransfer.Jr = HE.JrFactor(Unity(i).Shell.HeatTransfer.Re);
1218       
1219"Total J Factor"
1220        Unity(i).Shell.HeatTransfer.Jtotal=Unity(i).Shell.HeatTransfer.Jc*Unity(i).Shell.HeatTransfer.Jl*Unity(i).Shell.HeatTransfer.Jb*Unity(i).Shell.HeatTransfer.Jr*Unity(i).Shell.HeatTransfer.Js;
1221
1222
1223
1224#=====================================================================
1225#  Fluid Alocation
1226#=====================================================================
1227
1228if side equal 1 then
1229       
1230       
1231"Shell Side Phi correction for viscosity"
1232        Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu);
1233       
1234"Tube Side Phi correction for viscosity"
1235        Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
1236       
1237        else
1238       
1239       
1240"Shell Side Phi correction for viscosity"
1241        Unity(i).Shell.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
1242       
1243"Tube Side Phi correction for viscosity"
1244        Unity(i).Tubes.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu);
1245
1246end
1247
1248
1249if side equal 1
1250       
1251        then
1252       
1253"Wall Temperature"
1254#       Tubes.HeatTransfer.Twall  = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
1255
1256#       Tubes.HeatTransfer.Twall  = HE.WallTemperature(Properties.Hot.Average.T,Properties.Cold.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
1257
1258
1259        Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
1260       
1261        Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
1262
1263"Tube Side Velocity"
1264        Unity(i).Tubes.HeatTransfer.Vtube  = HE.TubeVelocity(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Properties.Cold.Average.rho);
1265
1266"Tube Side Reynolds Number"
1267        Unity(i).Tubes.HeatTransfer.Re = HE.TubeReynoldsNumber(Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Cold.Average.Mu);
1268       
1269"Tube Side Prandtl Number"
1270        Unity(i).Tubes.HeatTransfer.PR = HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
1271
1272"Tube Side Prandtl Number at Wall"
1273        Unity(i).Tubes.HeatTransfer.PRw = HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
1274
1275
1276"Tube Side Film Coefficient"
1277        Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,Unity(i).Tubes.HeatTransfer.Phi);
1278       
1279"Shell Side Prandtl Number"
1280        Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);   
1281
1282"Shell Side Prandtl Number at Wall"
1283        Unity(i).Shell.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);   
1284
1285"Tube Side Pressure Drop"
1286        Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Cold.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi);
1287
1288"Pressure Drop Tube Side Inlet Nozzle"
1289        Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1290
1291"Velocity Tube Side Inlet Nozzle"
1292        Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1293
1294"Pressure Drop Tube Side Outlet Nozzle"
1295        Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1296
1297"Velocity Tube Side Outlet Nozzle"
1298        Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1299
1300"Shell Pressure Drop Inlet Nozzle"
1301        Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1302
1303"Velocity Shell Side Inlet Nozzle"
1304        Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1305
1306"Shell Pressure Drop Outlet Nozzle"
1307        Unity(i).Shell.PressureDrop.Pdnozzle_out        =HE.DeltaPshellNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1308
1309"Velocity Shell Side Outlet Nozzle"
1310        Unity(i).Shell.PressureDrop.Vnozzle_out =HE.ShellVelocityNozzleOut(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1311
1312"Pressure Drop Hot Stream"
1313        Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Shell.PressureDrop.Pdtotal;     
1314       
1315"Pressure Drop Cold Stream"
1316        Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Tubes.PressureDrop.Pdtotal;
1317
1318
1319        else
1320
1321"Wall Temperature"
1322#       Tubes.HeatTransfer.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
1323
1324#       Tubes.HeatTransfer.Twall = HE.WallTemperature(Properties.Cold.Average.T,Properties.Hot.Average.T,Tubes.HeatTransfer.htube,Shell.HeatTransfer.hshell);
1325
1326        Unity(i).Properties.Cold.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
1327       
1328        Unity(i).Properties.Hot.Wall.Twall  = (Unity(i).Properties.Hot.Average.T+Unity(i).Properties.Cold.Average.T)/2;
1329
1330
1331
1332"Tube Side Velocity"
1333        Unity(i).Tubes.HeatTransfer.Vtube=HE.TubeVelocity(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Properties.Hot.Average.rho);
1334
1335"Tube Side Reynolds Number"
1336        Unity(i).Tubes.HeatTransfer.Re=HE.TubeReynoldsNumber(Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Properties.Hot.Average.Mu);
1337       
1338"Tube Side Prandtl Number"
1339        Unity(i).Tubes.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Hot.Average.K,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Average.Mu);
1340
1341"Tube Side Prandtl Number at Wall"
1342        Unity(i).Tubes.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Hot.Wall.K,Unity(i).Properties.Hot.Wall.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Wall.Mu);
1343
1344"Tube Side Film Coefficient"
1345        Unity(i).Tubes.HeatTransfer.htube= HE.TubeFilmCoeff(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Tubes.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,Unity(i).Tubes.HeatTransfer.Phi);
1346       
1347"Shell Side Prandtl Number"
1348        Unity(i).Shell.HeatTransfer.PR=HE.PrandtlNumber(Unity(i).Properties.Cold.Average.K,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Average.Mu);
1349
1350"Shell Side Prandtl Number at Wall"
1351        Unity(i).Shell.HeatTransfer.PRw=HE.PrandtlNumber(Unity(i).Properties.Cold.Wall.K,Unity(i).Properties.Cold.Wall.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Wall.Mu);
1352
1353"Tube Side Pressure Drop"
1354        Unity(i).Tubes.PressureDrop.PdTube              = HE.DeltaPtube(Unity(i).Tubes.HeatTransfer.Re,Unity(i).Properties.Hot.Average.rho,Unity(i).Tubes.HeatTransfer.Vtube,Unity(i).Tubes.HeatTransfer.Phi);
1355
1356"Pressure Drop Tube Side Inlet Nozzle"
1357        Unity(i).Tubes.PressureDrop.Pdnozzle_in = HE.DeltaPtubeNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1358
1359"Velocity Tube Side Inlet Nozzle"
1360        Unity(i).Tubes.PressureDrop.Vnozzle_in  = HE.TubeVelocityNozzlein(Unity(i).Properties.Hot.Inlet.rho,Unity(i).Properties.Hot.Inlet.Fw);
1361
1362"Pressure Drop Tube Side Outlet Nozzle"
1363        Unity(i).Tubes.PressureDrop.Pdnozzle_out        = HE.DeltaPtubeNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw); 
1364
1365"Velocity Tube Side Outlet Nozzle"
1366        Unity(i).Tubes.PressureDrop.Vnozzle_out = HE.TubeVelocityNozzleout(Unity(i).Properties.Hot.Outlet.rho,Unity(i).Properties.Hot.Inlet.Fw);       
1367
1368"Shell Pressure Drop Inlet Nozzle"
1369        Unity(i).Shell.PressureDrop.Pdnozzle_in = HE.DeltaPshellNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1370
1371"Velocity Shell Side Inlet Nozzle"
1372        Unity(i).Shell.PressureDrop.Vnozzle_in  = HE.ShellVelocityNozzleIn(Unity(i).Properties.Cold.Inlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1373
1374"Shell Pressure Drop Outlet Nozzle"
1375        Unity(i).Shell.PressureDrop.Pdnozzle_out = HE.DeltaPshellNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1376
1377"Velocity Shell Side Outlet Nozzle"
1378        Unity(i).Shell.PressureDrop.Vnozzle_out  = HE.ShellVelocityNozzleOut(Unity(i).Properties.Cold.Outlet.rho,Unity(i).Properties.Cold.Inlet.Fw);
1379
1380"Pressure Drop Hot Stream"
1381        Unity(i).Outlet.Hot.P  = Unity(i).Inlet.Hot.P- Unity(i).Tubes.PressureDrop.Pdtotal;     
1382       
1383"Pressure Drop Cold Stream"
1384        Unity(i).Outlet.Cold.P  = Unity(i).Inlet.Cold.P - Unity(i).Shell.PressureDrop.Pdtotal;
1385
1386
1387end
1388
1389"Tube Resistance"       
1390        Unity(i).Resistances.Rtube*(Unity(i).Tubes.HeatTransfer.htube*Ditube) = Dotube;
1391       
1392"Wall Resistance"
1393        Unity(i).Resistances.Rwall=Dotube*ln(Dotube/Ditube)/(2*Kwall);
1394       
1395"Shell Resistance"
1396        Unity(i).Resistances.Rshell*(Unity(i).Shell.HeatTransfer.hshell)=1;
1397       
1398"Overall Heat Transfer Coefficient"
1399        Unity(i).Details.U=1/(Dotube/(Unity(i).Tubes.HeatTransfer.htube*Ditube)+(Dotube*ln(Dotube/Ditube)/(2*Kwall))+(1/(Unity(i).Shell.HeatTransfer.hshell)));
1400
1401"Exchange Surface Area"
1402        Unity(i).Details.A=Pi*Dotube*Ntt*Ltube;
1403
1404"Baffles Spacing"
1405        Ltube = Unity(i).Baffles.Lsi+Unity(i).Baffles.Lso+Unity(i).Baffles.Ls*(Nb-1);
1406       
1407"LMTD Correction Factor"
1408        Fc(i) = HE.EshellCorrectionFactor(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T);
1409
1410"Counter Flow LMTD"
1411        LMTD(i) = HE.CounterLMTD(Unity(i).Inlet.Hot.T,Unity(i).Outlet.Hot.T,Unity(i).Inlet.Cold.T,Unity(i).Outlet.Cold.T);
1412
1413"Js Factor"     
1414        Unity(i).Shell.HeatTransfer.Js = HE.JsFactor(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Lsi,Unity(i).Baffles.Lso,Unity(i).Baffles.Ls);
1415
1416if side equal 1
1417       
1418        then
1419       
1420"Shell Side Reynolds Number"
1421        Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.Mu);
1422
1423"Shell Heat Transfer Coefficient"
1424        Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Hot.Average.Cp,Unity(i).Properties.Hot.Average.Mw,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
1425
1426"Shell Pressure Drop Cross Flow"
1427        Unity(i).Shell.PressureDrop.PdCross             = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho);
1428
1429"Shell Pressure Baffle Window"
1430        Unity(i).Shell.PressureDrop.Pdwindow            = HE.DeltaPwindow(Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Hot.Average.rho,Unity(i).Properties.Hot.Average.Mu,Unity(i).Baffles.Ls);
1431
1432"Shell Pressure End Zones"
1433        Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Hot.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Hot.Average.rho);
1434
1435
1436        else
1437
1438"Shell Side Reynolds Number"
1439        Unity(i).Shell.HeatTransfer.Re=HE.ShellReynoldsNumber(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.Mu);
1440
1441"Shell Heat Transfer Coefficient"
1442        Unity(i).Shell.HeatTransfer.hshell=HE.ShellFilmCoeff(Unity(i).Shell.HeatTransfer.Ji,Unity(i).Properties.Cold.Average.Cp,Unity(i).Properties.Cold.Average.Mw,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Shell.HeatTransfer.PR,Unity(i).Shell.HeatTransfer.Jtotal,Unity(i).Shell.HeatTransfer.Phi);
1443
1444"Shell Pressure Drop Cross Flow"
1445        Unity(i).Shell.PressureDrop.PdCross      = HE.DeltaPcross(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho);
1446
1447"Shell Pressure Baffle Window"
1448        Unity(i).Shell.PressureDrop.Pdwindow     = HE.DeltaPwindow(Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Sm,Unity(i).Properties.Cold.Average.rho,Unity(i).Properties.Cold.Average.Mu,Unity(i).Baffles.Ls);
1449
1450"Shell Pressure End Zones"
1451        Unity(i).Shell.PressureDrop.PdEndZones  = HE.DeltaPendZones(Unity(i).Shell.HeatTransfer.Re,Unity(i).Baffles.Ls,Unity(i).Baffles.Lso,Unity(i).Baffles.Lsi,Unity(i).Properties.Cold.Inlet.Fw,Unity(i).Shell.HeatTransfer.Phi,Unity(i).Properties.Cold.Average.rho);
1452
1453
1454end
1455
1456"Exchange Surface Area"
1457        Unity(i).Details.Q   = Unity(i).Details.U*Unity(i).Details.A*Fc(i)*LMTD(i);
1458       
1459"Mean Temperature Difference"   
1460        MTD(i)   = Fc(i)*LMTD(i);
1461
1462end
1463
1464        SET
1465#=====================================================================
1466#  Set Parameters for heatex Calculation
1467#=====================================================================
1468        Pi                              = 3.14159265;
1469        HE.Tpass                        = Tpass;
1470        HE.Nss                          = Nss;
1471        HE.Ntt                          = Ntt;
1472        HE.Pattern                      = Pattern;
1473        HE.Bc                           = Bc;
1474        HE.Donozzle_Shell       = Donozzle_Shell;
1475        HE.Dinozzle_Shell       = Dinozzle_Shell;
1476        HE.Honozzle_Shell       = Honozzle_Shell;
1477        HE.Hinozzle_Shell       = Hinozzle_Shell;
1478        HE.Donozzle_Tube        = Donozzle_Tube;
1479        HE.Dinozzle_Tube        = Dinozzle_Tube;
1480        HE.Nb                       = Nb;
1481        HE.Dishell                      = Dishell;             
1482        HE.Lcf                          = Lcf; 
1483        HE.Ltube                        = Ltube;       
1484        HE.pitch                        = pitch;               
1485        HE.Dotube                       = Dotube;       
1486        HE.Ditube                       = Ditube;       
1487        HE.Lcd                          = Lcd;
1488        HE.Ltd                          = Ltd; 
1489        side                            = HE.FluidAlocation();
1490
1491end
1492
Note: See TracBrowser for help on using the repository browser.