source: mso/eml/heat_exchangers/HeatExchangerSimplified.mso @ 68

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

added double pipe heat exchanger model and updated eml/heat_exchangers

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