source: mso/eml/heat_exchangers/HeatExchangerSimplified.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: 18.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: HeatExchangerSimplified.mso 100 2007-01-09 14:15:56Z bicca $
18*--------------------------------------------------------------------*#
19
[1]20using "HEX_Engine";
21#=====================================================================
22#       Basic Models for Simplified Heat Exchangers
23#=====================================================================
24Model HeatExchangerSimplified_Basic
25PARAMETERS
[26]26ext PP          as CalcObject   (Brief="External Physical Properties");
[45]27        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
[26]28ext NComp       as Integer      (Brief="Number of Components");
29        M(NComp)        as molweight    (Brief="Component Mol Weight");
[1]30       
31VARIABLES
32
33in  Inlet               as Inlet_Main_Stream;   # Hot and Cold Inlets
34out Outlet              as Outlet_Main_Stream;  # Hot and Cold Outlets
35        Properties      as Main_Properties;             # Hot and Cold Properties
36        Details         as Details_Main;
37        PressureDrop    as Main_Pdrop;
38
39SET
40
41M   = PP.MolecularWeight();
42
43EQUATIONS
44
45"Hot Stream Average Temperature"
46        Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T;
47       
48"Cold Stream Average Temperature"
49        Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T;
50       
51"Hot Stream Average Pressure"
52        Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P;
53       
54"Cold Stream Average Pressure"
55        Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P;
56
57"Cold Stream Wall Temperature"
58        Properties.Cold.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
59
60"Hot Stream Wall Temperature"
61        Properties.Hot.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
62
63"Hot Stream Average Molecular Weight"
64        Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z);
65
66"Cold Stream Average Molecular Weight"
67        Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z);
68
69
70if Inlet.Cold.v equal 0
[68]71       
[1]72        then   
[68]73       
74"Cold Stream Average Heat Capacity"
75        Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
[1]76
[68]77"Cold Stream Inlet Heat Capacity"
78        Properties.Cold.Inlet.Cp        =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
[1]79
[68]80"Cold Stream Outlet Heat Capacity"
81        Properties.Cold.Outlet.Cp       =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
[1]82
[68]83"Cold Stream Average Mass Density"
84        Properties.Cold.Average.rho =   PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
[1]85
[68]86"Cold Stream Inlet Mass Density"
87        Properties.Cold.Inlet.rho       =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
88
89"Cold Stream Outlet Mass Density"
90        Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
91
92"Cold Stream Average Viscosity"
93        Properties.Cold.Average.Mu      =       PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
94
95"Cold Stream inlet Viscosity"
96        Properties.Cold.Inlet.Mu        =       PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
[1]97       
[68]98"Cold Stream Outlet Viscosity"
99        Properties.Cold.Outlet.Mu       =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
[1]100
[68]101"Cold Stream Average Conductivity"
102        Properties.Cold.Average.K       =       PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
[1]103
[68]104"Cold Stream Inlet Conductivity"       
105        Properties.Cold.Inlet.K         =       PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
[1]106
[68]107"Cold Stream Outlet Conductivity"
108        Properties.Cold.Outlet.K        =       PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
109
110"Cold Stream Heat Capacity at Wall Temperature"
111        Properties.Cold.Wall.Cp         =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
112       
113"Cold Stream Viscosity at Wall Temperature"
114        Properties.Cold.Wall.Mu         =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
115
116"Cold Stream Conductivity at Wall Temperature"
117        Properties.Cold.Wall.K          =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
118
119
[1]120        else
121
[68]122"Cold Stream Average Heat Capacity"
[1]123        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
[68]124
125"Cold Stream Inlet Heat Capacity"       
[1]126        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
[68]127
128"Cold Stream Outlet Heat Capacity"     
[1]129        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
130
[68]131"Cold Stream Average Mass Density"
132        Properties.Cold.Average.rho =   PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
[1]133
[68]134"Cold Stream Inlet Mass Density"
135        Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
[1]136
[68]137"Cold Stream Outlet Mass Density"       
138        Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
139
140"Cold Stream Average Viscosity "
141        Properties.Cold.Average.Mu      =       PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
142
143"Cold Stream Inlet Viscosity " 
144        Properties.Cold.Inlet.Mu        =       PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
145
146"Cold Stream Outlet Viscosity "
147        Properties.Cold.Outlet.Mu       =       PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
148
149"Cold Stream Average Conductivity "
150        Properties.Cold.Average.K       =       PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
151
152"Cold Stream Inlet Conductivity "
153        Properties.Cold.Inlet.K         =       PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
154
155"Cold Stream Outlet Conductivity "
156        Properties.Cold.Outlet.K        =       PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
[1]157       
[68]158"Cold Stream Heat Capacity at Wall Temperature"
159        Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
[1]160
161
[68]162"Cold Stream Viscosity at Wall Temperature"
163        Properties.Cold.Wall.Mu         =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
[1]164
[68]165"Cold Stream Conductivity at Wall Temperature"
166        Properties.Cold.Wall.K          =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
[1]167       
168       
169       
170end
171
172if Inlet.Hot.v equal 0
173
174        then
175
[68]176"Hot Stream Average Heat Capacity"
[1]177        Properties.Hot.Average.Cp       =               PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
[68]178
179"Hot Stream Inlet Heat Capacity"
[1]180        Properties.Hot.Inlet.Cp         =               PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
[68]181
182"Hot Stream Outlet Heat Capacity"
[1]183        Properties.Hot.Outlet.Cp        =               PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
184
[68]185"Hot Stream Average Mass Density"
[1]186        Properties.Hot.Average.rho      =               PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
[68]187
188"Hot Stream Inlet Mass Density"
[1]189        Properties.Hot.Inlet.rho        =               PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
[68]190
191"Hot Stream Outlet Mass Density"       
[1]192        Properties.Hot.Outlet.rho       =               PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
193
[68]194"Hot Stream Average Viscosity"
[1]195        Properties.Hot.Average.Mu       =               PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);     
[68]196
197"Hot Stream Inlet Viscosity"
[1]198        Properties.Hot.Inlet.Mu         =               PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);       
[68]199
200"Hot Stream Outlet Viscosity"
[1]201        Properties.Hot.Outlet.Mu        =               PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);     
202
[68]203"Hot Stream Average Conductivity"
[1]204        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
[68]205
206"Hot Stream Inlet Conductivity"
[45]207        Properties.Hot.Inlet.K          =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
[68]208
209"Hot Stream Outlet Conductivity"
[1]210        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
211
[68]212"Hot Stream Heat Capacity at Wall Temperature"
[45]213        Properties.Hot.Wall.Cp          =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
[1]214
[68]215"Hot Stream Viscosity  at Wall Temperature"
[45]216        Properties.Hot.Wall.Mu          =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
[1]217
[68]218"Hot Stream Conductivity at Wall Temperature"
[45]219        Properties.Hot.Wall.K           =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
[1]220       
221
222        else
223
[68]224"Hot Stream Average Heat Capacity"
[1]225        Properties.Hot.Average.Cp       =               PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
[68]226
227"Hot Stream Inlet Heat Capacity"
[1]228        Properties.Hot.Inlet.Cp         =               PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
[68]229
230"Hot Stream Outlet Heat Capacity"
[1]231        Properties.Hot.Outlet.Cp        =               PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
232
[68]233"Hot Stream Average Mass Density"
[1]234        Properties.Hot.Average.rho      =               PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
[68]235
236"Hot Stream Inlet Mass Density"
[1]237        Properties.Hot.Inlet.rho        =               PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
[68]238
239"Hot Stream Outlet Mass Density"
[1]240        Properties.Hot.Outlet.rho       =               PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
241
[68]242"Hot Stream Average Viscosity"
[1]243        Properties.Hot.Average.Mu       =               PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
[68]244
245"Hot Stream Inlet Viscosity"
[1]246        Properties.Hot.Inlet.Mu         =               PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
[68]247
248"Hot Stream Outlet Viscosity"
[1]249        Properties.Hot.Outlet.Mu        =               PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
250
[68]251"Hot Stream Average Conductivity"
[1]252        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
[68]253
254"Hot Stream Inlet Conductivity"
[45]255        Properties.Hot.Inlet.K          =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
[68]256       
257"Hot Stream Outlet Conductivity"
[1]258        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
259
[68]260"Hot Stream Heat Capacity at Wall Temperature"
[45]261        Properties.Hot.Wall.Cp          =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
[1]262
[68]263"Hot Stream Viscosity at Wall Temperature"
[45]264        Properties.Hot.Wall.Mu          =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
[1]265
[68]266"Hot Stream Conductivity at Wall Temperature"
[45]267        Properties.Hot.Wall.K           =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
[1]268
269
270end
271
[68]272
[1]273#=====================================================================
274#       Thermal Details
275#=====================================================================
276"Hot Stream Heat Capacity"
277        Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp;
278       
279"Cold Stream Heat Capacity"
280        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
281
[45]282"Minimum Heat Capacity"
283        Details.Cmin  = min([Details.Ch,Details.Cc]);
284
285"Maximum Heat Capacity"
286        Details.Cmax  = max([Details.Ch,Details.Cc]);
287
288"Heat Capacity Ratio"   
289        Details.Cr    = Details.Cmin/Details.Cmax;
[1]290#=====================================================================
291#       Energy Balance
292#=====================================================================
293"Energy Balance Hot Stream"
294        Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h);
295
296"Energy Balance Cold Stream"
297        Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h);
298
299#=====================================================================
300#       Material Balance
301#=====================================================================
302"Flow Mass Inlet Cold Stream"
303        Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F;
304
305"Flow Mass Outlet Cold Stream"
306        Properties.Cold.Outlet.Fw       =  sum(M*Outlet.Cold.z)*Outlet.Cold.F;
307
308"Flow Mass Inlet Hot Stream"
309        Properties.Hot.Inlet.Fw         =  sum(M*Inlet.Hot.z)*Inlet.Hot.F;
310
311"Flow Mass Outlet Hot Stream"   
312        Properties.Hot.Outlet.Fw        =  sum(M*Outlet.Hot.z)*Outlet.Hot.F;
313
314"Molar Balance Hot Stream"
315        Inlet.Hot.F  = Outlet.Hot.F;
316       
317"Molar Balance Cold Stream"
318        Inlet.Cold.F = Outlet.Cold.F;
319
320#======================================
321#       Constraints
322#======================================
323"Hot Stream Molar Fraction Constraint"
324        Outlet.Hot.z=Inlet.Hot.z;
325       
326"Cold Stream Molar Fraction Constraint"
327        Outlet.Cold.z=Inlet.Cold.z;
328       
329"No Phase Change In Cold Stream"
330        Inlet.Cold.v=Outlet.Cold.v;
331
332"No Phase Change In Hot Stream"
333        Inlet.Hot.v=Outlet.Hot.v;
334
335#======================================
336#       Pressure Drop
337#======================================
338
339"Pressure Drop Hot Stream"
340        Outlet.Hot.P  = Inlet.Hot.P - PressureDrop.Hot.Pdrop;
341       
342"Pressure Drop Cold Stream"
343        Outlet.Cold.P  = Inlet.Cold.P - PressureDrop.Cold.Pdrop;
344       
345"Fraction of Inlet Pressure : Hot Stream"
346        PressureDrop.Hot.Pdrop  = Inlet.Hot.P*PressureDrop.Hot.FPdrop;
347       
348"Fraction of Inlet Pressure : Cold Stream"
349        PressureDrop.Cold.Pdrop  = Inlet.Cold.P*PressureDrop.Cold.FPdrop;
350       
351end
352
353Model Heatex_Basic_NTU   as HeatExchangerSimplified_Basic
354#=====================================================================
355#       Basic Model for Heat Exchangers - NTU Method
356#=====================================================================
357VARIABLES
358
359Eft       as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8);
360
361EQUATIONS       
362
363"Energy Balance"
364        Details.Q       = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); 
365
366
367end
368
369Model Heatex_Basic_LMTD  as HeatExchangerSimplified_Basic
370#=====================================================================
371#       Basic Model for Heat Exchangers - LMTD Method
372#=====================================================================
373VARIABLES
374
[45]375DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
376DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
[26]377LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
378Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.5);
[45]379MTD             as temp_delta   (Brief="Mean Temperature Difference",Lower=1);
[1]380
381EQUATIONS
[45]382#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
383#                       Log Mean Temperature Difference
384#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
385if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
386       
387        then
388"Log Mean Temperature Difference"
389        LMTD= (DT0-DTL)/ln(DT0/DTL);
[1]390
[45]391        else
392       
393if DT0*DTL equal 0
394       
395        then
396"Log Mean Temperature Difference"
397        LMTD = 0.5*(DT0+DTL);
398       
399        else
400"Log Mean Temperature Difference"
401        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
402       
403end
404       
405end
406
[1]407"Exchange Surface Area"
[100]408        Details.Q = Details.Ud*Details.A*MTD;   
[1]409       
410"Mean Temperature Difference"   
411        MTD   = Fc*LMTD;
412
413end
414
415
416#=====================================================================
417#       Concrete Models for Simplified Heat Exchangers
418#=====================================================================
419
420#=====================================================================
421# LMTD Method
422#=====================================================================
423
424Model HeatExchanger_LMTD        as Heatex_Basic_LMTD
425
[45]426PARAMETERS
427
428        Side as Integer         (Brief="Flow Direction",Lower=0,Upper=1);
429
430SET
431
432Side = HE.FlowDir(); # Return Flow Direction
433
[1]434EQUATIONS
[45]435#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
436#       Flow Direction
437#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
438if Side equal 0
439#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
440#       Cocurrent Flow
441#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#   
442        then
443"Temperature Difference at Inlet"
444        DT0 = Inlet.Hot.T - Inlet.Cold.T;
[1]445
[45]446"Temperature Difference at Outlet"
447        DTL = Outlet.Hot.T - Outlet.Cold.T;
[1]448
[45]449        else
450#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
451#       Counter Flow
452#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#           
453"Temperature Difference at Inlet"
454        DT0 = Inlet.Hot.T - Outlet.Cold.T;
455
456"Temperature Difference at Outlet"
457        DTL = Outlet.Hot.T - Inlet.Cold.T;
[1]458end
459
[45]460end
461
[1]462Model E_Shell_LMTD                      as Heatex_Basic_LMTD       
463#=====================================================================
464#       Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method
465#===================================================================== 
466EQUATIONS
[45]467"Temperature Difference at Inlet"
468        DT0 = Inlet.Hot.T - Outlet.Cold.T;
[1]469
[45]470"Temperature Difference at Outlet"
471        DTL = Outlet.Hot.T - Inlet.Cold.T;
472       
[1]473"LMTD Correction Factor"
474        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
475
476end
477
478Model F_Shell_LMTD              as Heatex_Basic_LMTD
479#=====================================================================
480#       Shell and Tubes Heat Exchanger with 2 shell passes - LMTD Method
481#=====================================================================
482EQUATIONS
[45]483"Temperature Difference at Inlet"
484        DT0 = Inlet.Hot.T - Outlet.Cold.T;
[1]485
[45]486"Temperature Difference at Outlet"
487        DTL = Outlet.Hot.T - Inlet.Cold.T;
488       
[1]489"LMTD Correction Factor"
490        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
491
492end
493
494#=====================================================================
495# NTU Method
496#=====================================================================
497
498Model HeatExchanger_NTU         as Heatex_Basic_NTU
[68]499       
500PARAMETERS
[1]501
[68]502Side as Integer (Brief="Flow Direction",Lower=0,Upper=1);
503
504SET
505
506Side = HE.FlowDir(); # Return Flow Direction
507
[1]508EQUATIONS
[68]509
510if Details.Cr equal 0
511       
512        then   
[1]513"Effectiveness"
[68]514        Eft = 1-exp(-Details.NTU);
[1]515       
[68]516        else
517
518if Side equal 0
519
520        then
521"Effectiveness in Cocurrent Flow"
522        Eft = (1-exp(-Details.NTU*(1+Details.Cr)))/(1+Details.Cr);
523       
524        else
525
526if Details.Cr equal 1
527       
528        then
529"Effectiveness in Counter Flow"
530        Eft = Details.NTU/(1+Details.NTU);
531       
532        else
533"Effectiveness in Counter Flow"
534        Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr)));
535       
[1]536end
537
[68]538end
539
540
541end
542
543       
544end
545
[1]546Model E_Shell_NTU                       as Heatex_Basic_NTU
547#=====================================================================
548#       Shell and Tubes Heat Exchanger with 1 shell pass - NTU Method
549#=====================================================================
550EQUATIONS
551"TEMA E Shell Effectiveness"
552        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;
553
554end
555
556Model F_Shell_NTU               as Heatex_Basic_NTU
557#=====================================================================
558#       Shell and Tubes Heat Exchanger with 2 shell passes - NTU Method
559#===================================================================== 
560VARIABLES
561
562Eft1    as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5);
563
564EQUATIONS
565
566"Effectiveness Correction"
567        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;
568
569"TEMA F Shell Effectiveness"
570        Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1  )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1;
571
572end
Note: See TracBrowser for help on using the repository browser.