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

Last change on this file since 78 was 78, checked in by Paula Bettio Staudt, 15 years ago

Updated heat_exchangers files header

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