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