source: trunk/eml/heat_exchangers/HeatExchangerSimplified.mso @ 384

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

Adding symbol for latex.

File size: 19.4 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*--------------------------------------------------------------------
16* Author: Gerson Balbueno Bicca
17* $Id: HeatExchangerSimplified.mso 160 2007-02-08 18:37:44Z bicca $
18*--------------------------------------------------------------------*#
19
20using "heat_exchangers/HEX_Engine";
21
22Model HeatExchangerSimplified_Basic
23
24ATTRIBUTES
25        Pallete         = false;
26        Brief           = "Basic Models for Simplified Heat Exchangers";
27        Info            =
28        "to be documented.";
29       
30PARAMETERS
31outer PP            as Plugin   (Brief="External Physical Properties", Type="PP");
32outer NComp     as Integer  (Brief="Number of Components");
33       
34        M(NComp)  as molweight  (Brief="Component Mol Weight");
35       
36VARIABLES
37
38in  InletHot    as stream               (Brief="Inlet Hot Stream", PosX=0, PosY=0.4915, Symbol="^{inHot}");
39out OutletHot   as streamPH     (Brief="Outlet Hot Stream", PosX=1, PosY=0.4915, Symbol="^{outHot}");
40in  InletCold   as stream               (Brief="Inlet Cold Stream", PosX=0.5237, PosY=1, Symbol="^{inCold}");
41out OutletCold  as streamPH     (Brief="Outlet Cold Stream", PosX=0.5237, PosY=0, Symbol="^{outCold}");
42
43        xh(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Hot Side");
44        yh(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Hot Side");
45        vh                      as fraction             (Brief = "Vapour Molar Fraction in Hot Side");
46       
47        xc(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Cold Side");
48        yc(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Cold Side");
49        vc                      as fraction             (Brief = "Vapour Molar Fraction in Cold Side");
50
51        Details     as Details_Main     (Brief="Heat Exchanger Details", Symbol=" ");
52        HotSide         as Main_Simplified      (Brief="Heat Exchanger Hot Side", Symbol="_{hot}");
53        ColdSide        as Main_Simplified      (Brief="Heat Exchanger Cold Side", Symbol="_{cold}");
54
55SET
56
57#"Component Molecular Weight"
58        M   = PP.MolecularWeight();
59
60EQUATIONS
61
62"Flash Calculation in Hot Side"
63        [vh, xh, yh] = PP.Flash(InletHot.T, InletHot.P, InletHot.z);
64
65"Flash Calculation in Cold Side"
66        [vc, xc, yc] = PP.Flash(InletCold.T, InletCold.P, InletCold.z);
67
68"Hot Stream Average Temperature"
69        HotSide.Properties.Average.T = 0.5*InletHot.T + 0.5*OutletHot.T;
70       
71"Cold Stream Average Temperature"
72        ColdSide.Properties.Average.T = 0.5*InletCold.T + 0.5*OutletCold.T;
73       
74"Hot Stream Average Pressure"
75        HotSide.Properties.Average.P = 0.5*InletHot.P+0.5*OutletHot.P;
76       
77"Cold Stream Average Pressure"
78        ColdSide.Properties.Average.P = 0.5*InletCold.P+0.5*OutletCold.P;
79
80"Cold Stream Wall Temperature"
81        ColdSide.Properties.Wall.Twall =   0.5*HotSide.Properties.Average.T + 0.5*ColdSide.Properties.Average.T;
82
83"Hot Stream Wall Temperature"
84        HotSide.Properties.Wall.Twall =   0.5*HotSide.Properties.Average.T + 0.5*ColdSide.Properties.Average.T;
85
86"Hot Stream Average Molecular Weight"
87        HotSide.Properties.Average.Mw = sum(M*InletHot.z);
88
89"Cold Stream Average Molecular Weight"
90        ColdSide.Properties.Average.Mw = sum(M*InletCold.z);
91
92"Cold Stream Average Heat Capacity"
93        ColdSide.Properties.Average.Cp  =       (1-InletCold.v)*PP.LiquidCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc) +
94                InletCold.v*PP.VapourCp(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
95
96"Cold Stream Inlet Heat Capacity"
97        ColdSide.Properties.Inlet.Cp    =       (1-InletCold.v)*PP.LiquidCp(InletCold.T,InletCold.P,xc)+
98                InletCold.v*PP.VapourCp(InletCold.T,InletCold.P,yc);
99
100"Cold Stream Outlet Heat Capacity"
101        ColdSide.Properties.Outlet.Cp   =       (1-OutletCold.v)*PP.LiquidCp(OutletCold.T,OutletCold.P,OutletCold.x)+
102                OutletCold.v*PP.VapourCp(OutletCold.T,OutletCold.P,OutletCold.y);
103
104"Cold Stream Average Mass Density"
105        ColdSide.Properties.Average.rho =       (1-InletCold.v)*PP.LiquidDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
106                InletCold.v*PP.VapourDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
107
108"Cold Stream Inlet Mass Density"
109        ColdSide.Properties.Inlet.rho   =       (1-InletCold.v)*PP.LiquidDensity(InletCold.T,InletCold.P,xc)+
110                InletCold.v*PP.VapourDensity(InletCold.T,InletCold.P,yc);
111
112"Cold Stream Outlet Mass Density"
113        ColdSide.Properties.Outlet.rho  =       (1-OutletCold.v)*PP.LiquidDensity(OutletCold.T,OutletCold.P,OutletCold.x)+
114                OutletCold.v*PP.VapourDensity(OutletCold.T,OutletCold.P,OutletCold.y);
115
116"Cold Stream Average Viscosity"
117        ColdSide.Properties.Average.Mu  =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
118                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
119
120"Cold Stream inlet Viscosity"
121        ColdSide.Properties.Inlet.Mu    =       (1-InletCold.v)*PP.LiquidViscosity(InletCold.T,InletCold.P,xc)+
122                InletCold.v*PP.VapourViscosity(InletCold.T,InletCold.P,yc);
123
124"Cold Stream Outlet Viscosity"
125        ColdSide.Properties.Outlet.Mu   =       (1-OutletCold.v)*PP.LiquidViscosity(OutletCold.T,OutletCold.P,OutletCold.x)+
126                OutletCold.v*PP.VapourViscosity(OutletCold.T,OutletCold.P,OutletCold.y);
127
128"Cold Stream Average Conductivity"
129        ColdSide.Properties.Average.K   =       (1-InletCold.v)*PP.LiquidThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
130                InletCold.v*PP.VapourThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
131
132"Cold Stream Inlet Conductivity"       
133        ColdSide.Properties.Inlet.K     =       (1-InletCold.v)*PP.LiquidThermalConductivity(InletCold.T,InletCold.P,xc)+
134                InletCold.v*PP.VapourThermalConductivity(InletCold.T,InletCold.P,yc);
135
136"Cold Stream Outlet Conductivity"
137        ColdSide.Properties.Outlet.K    =       (1-OutletCold.v)*PP.LiquidThermalConductivity(OutletCold.T,OutletCold.P,OutletCold.x)+
138                OutletCold.v*PP.VapourThermalConductivity(OutletCold.T,OutletCold.P,OutletCold.y);
139       
140"Cold Stream Viscosity at Wall Temperature"
141        ColdSide.Properties.Wall.Mu     =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,xc)+
142                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,yc);
143
144"Hot Stream Average Heat Capacity"
145        HotSide.Properties.Average.Cp   =       (1-InletHot.v)*PP.LiquidCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc) +
146                InletHot.v*PP.VapourCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
147
148"Hot Stream Inlet Heat Capacity"
149        HotSide.Properties.Inlet.Cp     =       (1-InletHot.v)*PP.LiquidCp(InletHot.T,InletHot.P,xc)+
150                InletHot.v*PP.VapourCp(InletHot.T,InletHot.P,yc);
151
152"Hot Stream Outlet Heat Capacity"
153        HotSide.Properties.Outlet.Cp    =       (1-OutletHot.v)*PP.LiquidCp(OutletHot.T,OutletHot.P,OutletHot.x)+
154                OutletHot.v*PP.VapourCp(OutletHot.T,OutletHot.P,OutletHot.y);
155
156"Hot Stream Average Mass Density"
157        HotSide.Properties.Average.rho =        (1-InletHot.v)*PP.LiquidDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
158                InletHot.v*PP.VapourDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
159
160"Hot Stream Inlet Mass Density"
161        HotSide.Properties.Inlet.rho    =       (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,xc)+
162                InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,yc);
163
164"Hot Stream Outlet Mass Density"
165        HotSide.Properties.Outlet.rho   =       (1-OutletHot.v)*PP.LiquidDensity(OutletHot.T,OutletHot.P,OutletHot.x)+
166                OutletHot.v*PP.VapourDensity(OutletHot.T,OutletHot.P,OutletHot.y);
167
168"Hot Stream Average Viscosity"
169        HotSide.Properties.Average.Mu   =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
170                InletHot.v*PP.VapourViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
171
172"Hot Stream inlet Viscosity"
173        HotSide.Properties.Inlet.Mu     =       (1-InletHot.v)*PP.LiquidViscosity(InletHot.T,InletHot.P,xc)+
174                InletHot.v*PP.VapourViscosity(InletHot.T,InletHot.P,yc);
175
176"Hot Stream Outlet Viscosity"
177        HotSide.Properties.Outlet.Mu    =       (1-OutletHot.v)*PP.LiquidViscosity(OutletHot.T,OutletHot.P,OutletHot.x)+
178                OutletHot.v*PP.VapourViscosity(OutletHot.T,OutletHot.P,OutletHot.y);
179
180"Hot Stream Average Conductivity"
181        HotSide.Properties.Average.K    =       (1-InletHot.v)*PP.LiquidThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
182                InletHot.v*PP.VapourThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
183
184"Hot Stream Inlet Conductivity"
185        HotSide.Properties.Inlet.K      =       (1-InletHot.v)*PP.LiquidThermalConductivity(InletHot.T,InletHot.P,xc)+
186                InletHot.v*PP.VapourThermalConductivity(InletHot.T,InletHot.P,yc);
187
188"Hot Stream Outlet Conductivity"
189        HotSide.Properties.Outlet.K     =       (1-OutletHot.v)*PP.LiquidThermalConductivity(OutletHot.T,OutletHot.P,OutletHot.x)+
190                OutletHot.v*PP.VapourThermalConductivity(OutletHot.T,OutletHot.P,OutletHot.y);
191       
192"Hot Stream Viscosity at Wall Temperature"
193        HotSide.Properties.Wall.Mu      =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,xc)+
194                InletHot.v*PP.VapourViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,yc);
195
196"Energy Balance Hot Stream"
197        Details.Q = InletHot.F*(InletHot.h-OutletHot.h);
198
199"Energy Balance Cold Stream"
200        Details.Q =-InletCold.F*(InletCold.h-OutletCold.h);
201
202"Flow Mass Inlet Cold Stream"
203        ColdSide.Properties.Inlet.Fw    =  sum(M*InletCold.z)*InletCold.F;
204
205"Flow Mass Outlet Cold Stream"
206        ColdSide.Properties.Outlet.Fw   =  sum(M*OutletCold.z)*OutletCold.F;
207
208"Flow Mass Inlet Hot Stream"
209        HotSide.Properties.Inlet.Fw             =  sum(M*InletHot.z)*InletHot.F;
210
211"Flow Mass Outlet Hot Stream"   
212        HotSide.Properties.Outlet.Fw    =  sum(M*OutletHot.z)*OutletHot.F;
213
214"Molar Balance Hot Stream"
215        InletHot.F  = OutletHot.F;
216       
217"Molar Balance Cold Stream"
218        InletCold.F = OutletCold.F;
219
220"Hot Stream Molar Fraction Constraint"
221        OutletHot.z             =       InletHot.z;
222       
223"Cold Stream Molar Fraction Constraint"
224        OutletCold.z    =       InletCold.z;
225       
226"Pressure Drop Hot Stream"
227        OutletHot.P  = InletHot.P - HotSide.PressureDrop.Pdrop;
228       
229"Pressure Drop Cold Stream"
230        OutletCold.P  = InletCold.P - ColdSide.PressureDrop.Pdrop;
231       
232"Fraction of Inlet Pressure : Hot Stream"
233        HotSide.PressureDrop.Pdrop  = InletHot.P*HotSide.PressureDrop.FPdrop;
234       
235"Fraction of Inlet Pressure : Cold Stream"
236        ColdSide.PressureDrop.Pdrop  = InletCold.P*ColdSide.PressureDrop.FPdrop;
237       
238end
239
240Model HeatExchanger_LMTD                as HeatExchangerSimplified_Basic
241
242ATTRIBUTES
243        Pallete         = true;
244        Icon            = "icon/HeatExchanger_LMTD";           
245        Brief           = "Heat Exchanger Block - LMTD Method";
246        Info            =
247        "to be documented.";
248       
249PARAMETERS
250
251        FlowDirection as Switcher       (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
252
253VARIABLES
254
255        Method as LMTD_Basic    (Brief="LMTD Method of Calculation", Symbol =" ");
256
257EQUATIONS
258
259"Exchange Surface Area"
260        Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc;
261       
262switch FlowDirection
263       
264        case "cocurrent":
265
266"Temperature Difference at Inlet"
267        Method.DT0 = InletHot.T - InletCold.T;
268
269"Temperature Difference at Outlet"
270        Method.DTL = OutletHot.T - OutletCold.T;
271
272        case "counter":
273       
274"Temperature Difference at Inlet"
275        Method.DT0 = InletHot.T - OutletCold.T;
276
277"Temperature Difference at Outlet"
278        Method.DTL = OutletHot.T - InletCold.T;
279
280end
281
282end
283
284Model Shell_and_Tubes_LMTD      as HeatExchangerSimplified_Basic
285       
286ATTRIBUTES
287        Pallete         = true;
288        Icon            = "icon/Shell_and_Tubes_LMTD";
289        Brief           = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - LMTD Method";
290        Info            =
291        "to be documented.";
292       
293PARAMETERS
294
295LMTDcorrection as Switcher(Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakeri"],Default="Bowmann");
296ShellType                as Switcher(Brief="TEMA Designation for Shell Type",Valid=["Eshell","Fshell"],Default="Eshell");
297
298VARIABLES
299
300Method  as LMTD_Basic (Brief="LMTD Method of Calculation", Symbol =" ");
301R                       as positive             (Brief=" Capacity Ratio for LMTD Correction Fator",Lower=1e-6);
302P                       as positive             (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6);
303Pc                      as positive             (Brief="Non - Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side",Lower=1e-6);
304Rho             as positive             (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6);
305Phi     as positive             (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation",Lower=1e-6, Symbol ="\phi");
306lambdaN as Real                 (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equation when 2 Pass Shell Side", Symbol ="\lambda _{N}");
307lambda1 as Real                 (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakeri Equationwhen 2 Pass Shell Side", Symbol ="\lambda _{1}");
308
309EQUATIONS
310
311"Exchange Surface Area"
312        Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc;
313
314"R: Capacity Ratio for LMTD Correction Fator"
315        R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T);
316
317"P: Non - Dimensional Variable for LMTD Correction Fator"
318        P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T);
319       
320"Temperature Difference at Inlet"
321        Method.DT0 = InletHot.T - OutletCold.T;
322
323"Temperature Difference at Outlet"
324        Method.DTL = OutletHot.T - InletCold.T;
325
326switch ShellType
327       
328        case "Fshell":
329       
330switch LMTDcorrection
331       
332        case "Bowmann":
333       
334" Variable not in use with Bowmann equation"
335        lambdaN =1;
336       
337" Variable not in use with Bowmann equation"
338        lambda1 =1;
339
340" Variable not in use with Bowmann equation"
341        Phi = 1;
342
343" Variable not in use with Bowmann equation"
344        Rho =1;
345
346if R equal 1
347       
348        then
349       
350"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
351        Pc*(2-P)= P;
352
353"LMTD Correction Fator when 2 Pass Shell Side"
354        Method.Fc= (sqrt(2)*Pc)/((1-Pc)*ln( abs( ( 2-Pc*0.585786)/( 2-Pc*3.414214))));
355       
356        else
357       
358"Non Dimensional Variable for LMTD Correction Fator when 2 Pass Shell Side"
359        Pc = (sqrt(abs(( 1-P*R)/(1-P)))-1)/(sqrt(abs(( 1-P*R)/(1-P)))-R);
360
361"LMTD Correction Fator when 2 Pass Shell Side"
362        Method.Fc = sqrt(R*R+1)*ln(abs((1-Pc*R)/(1-Pc)))/((1-R)*ln( abs( ( 2-Pc*(R+1-sqrt(R*R+1)))/ ( 2-Pc*(R + 1 + sqrt(R*R+1))))));
363       
364end
365
366        case "Fakeri":
367       
368" Variable not in use with Fakeri equation"
369        Pc = P;
370       
371"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
372        Rho*(1-P*R) = (1-P);
373
374"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
375        Phi = (sqrt(((InletHot.T - OutletHot.T)*(InletHot.T- OutletHot.T))+((OutletCold.T -  InletCold.T)*(OutletCold.T -  InletCold.T))))/(2*((InletHot.T + OutletHot.T)-( InletCold.T + OutletCold.T)));
376
377if Rho equal 1
378       
379        then
380       
381" Variable not in use when Rho = 1"
382        lambdaN =       1;
383       
384" Variable not in use when Rho = 1"
385        lambda1 =       1;
386       
387"LMTD Correction Fator when 2 Pass Shell Side"
388        Method.Fc = (2*Phi )/(ln(abs((1+Phi )/(1-Phi ))));
389       
390        else
391
392"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
393        lambdaN = (1/ln(sqrt(abs(Rho))))*((2*sqrt(abs(Rho))-2)/(sqrt(abs(Rho))+1));
394       
395"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
396        lambda1 = (1/ln(abs(Rho)))*((2*Rho-2)/(Rho+1));
397
398"LMTD Correction Fator when 2 Pass Shell Side"
399        Method.Fc =     ((2*Phi *(lambdaN/lambda1))/(ln(abs((1+Phi *(lambdaN/lambda1))/(1-Phi *(lambdaN/lambda1))))))*(1/lambdaN);
400
401end
402
403
404end
405
406        case "Eshell":
407       
408" Variable not in use when 1 Pass Shell Side"
409        lambdaN =1;
410
411" Variable not in use when 1 Pass Shell Side"
412        lambda1 =1;
413       
414" Variable not in use when 1 Pass Shell Side"
415        Pc = P;
416       
417switch LMTDcorrection
418       
419        case "Bowmann":
420
421" Variable not in use with Bowmann equation"
422        Phi  = 1;
423       
424" Variable not in use with Bowmann equation"
425        Rho = 1;
426
427
428 if R equal 1
429       
430    then
431       
432"LMTD Correction Fator when 1 Pass Shell Side"
433        Method.Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
434
435        else
436       
437"LMTD Correction Fator when 1 Pass Shell Side"
438        Method.Fc = sqrt(R*R+1)*ln(abs((1-P*R)/(1-P)))/((1-R)*ln( abs( ( 2-P*(R+1-sqrt(R*R+1)))/ ( 2-P*(R + 1 + sqrt(R*R+1))))));
439
440end
441
442        case "Fakeri":
443
444"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation "
445        Phi  = (sqrt(((InletHot.T- OutletHot.T)*(InletHot.T- OutletHot.T))+((OutletCold.T - InletCold.T)*(OutletCold.T - InletCold.T))))/(2*((InletHot.T+ OutletHot.T)-(InletCold.T+ OutletCold.T)));
446
447"Non Dimensional Variable for LMTD Correction Fator in Fakeri Equation"
448        Rho*(1-P*R) = (1-P);
449
450if Rho equal 1
451       
452        then
453       
454"LMTD Correction Fator when 1 Pass Shell Side"
455        Method.Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi))));
456
457        else
458
459"LMTD Correction Fator when 1 Pass Shell Side"
460        Method.Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1));
461       
462end
463
464end
465
466       
467end
468
469end
470
471Model HeatExchanger_NTU                 as      HeatExchangerSimplified_Basic
472
473ATTRIBUTES
474        Pallete         = true;
475        Icon            = "icon/HeatExchanger_NTU";     
476        Brief           = "Heat Exchanger Block - NTU Method";
477        Info            =
478        "to be documented.";
479       
480PARAMETERS
481
482        FlowDirection as Switcher       (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
483
484VARIABLES
485
486Method  as NTU_Basic    (Brief="NTU Method of Calculation", Symbol =" ");
487
488EQUATIONS
489
490"Number of Units Transference"
491        Method.NTU*Method.Cmin = Details.Ud*Details.A;
492       
493"Minimum Heat Capacity"
494        Method.Cmin  = min([Method.Ch,Method.Cc]);
495
496"Maximum Heat Capacity"
497        Method.Cmax  = max([Method.Ch,Method.Cc]);
498
499"Thermal Capacity Ratio"
500        Method.Cr    = Method.Cmin/Method.Cmax;
501
502"Duty"
503        Details.Q       = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T);
504
505"Hot Stream Heat Capacity"
506        Method.Ch  = InletHot.F*HotSide.Properties.Average.Cp;
507       
508"Cold Stream Heat Capacity"
509        Method.Cc = InletCold.F*ColdSide.Properties.Average.Cp;
510       
511"Effectiveness Correction"
512        Method.Eft1 = 1;
513
514if Method.Cr equal 0
515       
516        then
517       
518"Effectiveness"
519        Method.Eft = 1-exp(-Method.NTU);
520       
521        else
522
523switch  FlowDirection
524
525        case "cocurrent":
526       
527"Effectiveness in Cocurrent Flow"
528        Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
529
530        case "counter":
531
532if Method.Cr equal 1
533       
534        then
535"Effectiveness in Counter Flow"
536        Method.Eft = Method.NTU/(1+Method.NTU);
537       
538        else
539"Effectiveness in Counter Flow"
540        Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr)));
541       
542end
543
544end
545
546
547end
548
549end
550 
551Model Shell_and_Tubes_NTU       as HeatExchangerSimplified_Basic
552
553ATTRIBUTES
554        Pallete         = true;
555        Icon            = "icon/Shell_and_Tubes_NTU";           
556        Brief           = "Shell and Tubes Heat Exchanger with 1 or 2 shell pass - NTU Method";
557        Info            =
558        "to be documented.";
559
560PARAMETERS
561
562ShellType       as Switcher (Brief="TEMA Designation",Valid=["Eshell","Fshell"],Default="Eshell");
563
564VARIABLES
565
566Method  as NTU_Basic (Brief="NTU Method of Calculation" , Symbol =" ");
567
568EQUATIONS
569
570"Number of Units Transference"
571        Method.NTU*Method.Cmin = Details.Ud*Details.A;
572       
573"Minimum Heat Capacity"
574        Method.Cmin  = min([Method.Ch,Method.Cc]);
575
576"Maximum Heat Capacity"
577        Method.Cmax  = max([Method.Ch,Method.Cc]);
578
579"Thermal Capacity Ratio"
580        Method.Cr    = Method.Cmin/Method.Cmax;
581
582"Duty"
583        Details.Q       = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T);
584
585"Hot Stream Heat Capacity"
586        Method.Ch  = InletHot.F*HotSide.Properties.Average.Cp;
587       
588"Cold Stream Heat Capacity"
589        Method.Cc = InletCold.F*ColdSide.Properties.Average.Cp;
590
591switch ShellType
592       
593        case "Fshell":
594       
595"Effectiveness Correction for 2 pass shell side"
596        Method.Eft1 = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1;
597
598"TEMA F Shell Effectiveness"
599        Method.Eft = ( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 -1  )*( ((1-Method.Eft1*Method.Cr)/(1-Method.Eft1))^2 - Method.Cr )^-1;
600
601        case "Eshell":
602       
603"TEMA E Shell Effectiveness"
604        Method.Eft      = 2*(1+Method.Cr+sqrt(1+Method.Cr^2)*((1+exp(-Method.NTU*sqrt(1+Method.Cr^2)))/(1-exp(-Method.NTU*sqrt(1+Method.Cr^2)))) )^-1;
605
606"Variable not in use when 1 Pass Shell Side"
607        Method.Eft1     = 1;
608       
609end
610
611end
Note: See TracBrowser for help on using the repository browser.