source: branches/newlanguage/eml/heat_exchangers/HeatExchangerDetailed.mso @ 132

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

some modifications for the new language

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