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

Last change on this file since 110 was 110, checked in by gerson bicca, 16 years ago

modified some equations

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