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

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

updated

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