source: branches/rate/eml/heat_exchangers/Heatex.mso @ 507

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

improved the simplified model of heat exchangers

File size: 13.3 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  $
18*--------------------------------------------------------------------*#
19
20using "heat_exchangers/HEX_Engine";
21
22Model Heatex_Basic
23
24ATTRIBUTES
25        Pallete         = false;
26        Brief           = "Basic Model 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 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 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 Average Mass Density"
97        ColdSide.Properties.Average.rho =       (1-InletCold.v)*PP.LiquidDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
98                InletCold.v*PP.VapourDensity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
99
100"Cold Stream Inlet Mass Density"
101        ColdSide.Properties.Inlet.rho   =       (1-InletCold.v)*PP.LiquidDensity(InletCold.T,InletCold.P,xc)+
102                InletCold.v*PP.VapourDensity(InletCold.T,InletCold.P,yc);
103
104"Cold Stream Outlet Mass Density"
105        ColdSide.Properties.Outlet.rho  =       (1-OutletCold.v)*PP.LiquidDensity(OutletCold.T,OutletCold.P,OutletCold.x)+
106                OutletCold.v*PP.VapourDensity(OutletCold.T,OutletCold.P,OutletCold.y);
107
108"Cold Stream Average Viscosity"
109        ColdSide.Properties.Average.Mu  =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
110                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
111
112"Cold Stream Average Conductivity"
113        ColdSide.Properties.Average.K   =       (1-InletCold.v)*PP.LiquidThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,xc)+
114                InletCold.v*PP.VapourThermalConductivity(ColdSide.Properties.Average.T,ColdSide.Properties.Average.P,yc);
115
116"Cold Stream Viscosity at Wall Temperature"
117        ColdSide.Properties.Wall.Mu     =       (1-InletCold.v)*PP.LiquidViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,xc)+
118                InletCold.v*PP.VapourViscosity(ColdSide.Properties.Wall.Twall,ColdSide.Properties.Average.P,yc);
119
120"Hot Stream Average Heat Capacity"
121        HotSide.Properties.Average.Cp   =       (1-InletHot.v)*PP.LiquidCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc) +
122                InletHot.v*PP.VapourCp(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
123
124"Hot Stream Average Mass Density"
125        HotSide.Properties.Average.rho =        (1-InletHot.v)*PP.LiquidDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
126                InletHot.v*PP.VapourDensity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
127
128"Hot Stream Inlet Mass Density"
129        HotSide.Properties.Inlet.rho    =       (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,xc)+
130                InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,yc);
131
132"Hot Stream Outlet Mass Density"
133        HotSide.Properties.Outlet.rho   =       (1-OutletHot.v)*PP.LiquidDensity(OutletHot.T,OutletHot.P,OutletHot.x)+
134                OutletHot.v*PP.VapourDensity(OutletHot.T,OutletHot.P,OutletHot.y);
135
136"Hot Stream Average Viscosity"
137        HotSide.Properties.Average.Mu   =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
138                InletHot.v*PP.VapourViscosity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
139
140"Hot Stream Average Conductivity"
141        HotSide.Properties.Average.K    =       (1-InletHot.v)*PP.LiquidThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,xc)+
142                InletHot.v*PP.VapourThermalConductivity(HotSide.Properties.Average.T,HotSide.Properties.Average.P,yc);
143
144"Hot Stream Viscosity at Wall Temperature"
145        HotSide.Properties.Wall.Mu      =       (1-InletHot.v)*PP.LiquidViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,xc)+
146                InletHot.v*PP.VapourViscosity(HotSide.Properties.Wall.Twall,HotSide.Properties.Average.P,yc);
147
148"Energy Balance Hot Stream"
149        Details.Q = InletHot.F*(InletHot.h-OutletHot.h);
150
151"Energy Balance Cold Stream"
152        Details.Q =-InletCold.F*(InletCold.h-OutletCold.h);
153
154"Flow Mass Inlet Cold Stream"
155        ColdSide.Properties.Inlet.Fw    =  sum(M*InletCold.z)*InletCold.F;
156
157"Flow Mass Outlet Cold Stream"
158        ColdSide.Properties.Outlet.Fw   =  sum(M*OutletCold.z)*OutletCold.F;
159
160"Flow Mass Inlet Hot Stream"
161        HotSide.Properties.Inlet.Fw             =  sum(M*InletHot.z)*InletHot.F;
162
163"Flow Mass Outlet Hot Stream"   
164        HotSide.Properties.Outlet.Fw    =  sum(M*OutletHot.z)*OutletHot.F;
165
166"Molar Balance Hot Stream"
167        InletHot.F  = OutletHot.F;
168       
169"Molar Balance Cold Stream"
170        InletCold.F = OutletCold.F;
171
172"Hot Stream Molar Fraction Constraint"
173        OutletHot.z             =       InletHot.z;
174       
175"Cold Stream Molar Fraction Constraint"
176        OutletCold.z    =       InletCold.z;
177       
178"Pressure Drop Hot Stream"
179        OutletHot.P  = InletHot.P - HotSide.PressureDrop.Pdrop;
180       
181"Pressure Drop Cold Stream"
182        OutletCold.P  = InletCold.P - ColdSide.PressureDrop.Pdrop;
183       
184"Fraction of Inlet Pressure : Hot Stream"
185        HotSide.PressureDrop.Pdrop  = InletHot.P*HotSide.PressureDrop.FPdrop;
186       
187"Fraction of Inlet Pressure : Cold Stream"
188        ColdSide.PressureDrop.Pdrop  = InletCold.P*ColdSide.PressureDrop.FPdrop;
189       
190end
191
192Model Heatex_LMTD       as Heatex_Basic
193
194ATTRIBUTES
195        Pallete         = true;
196        Icon            = "icon/HeatExchanger_LMTD";   
197        Brief           = "Simplified model for Heat Exchangers";
198        Info            =
199        "to be documented.";
200       
201PARAMETERS
202
203        ExchangerType           as Switcher     (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow");
204        LMTDcorrection  as Switcher     (Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakheri"],Default="Bowmann");
205
206VARIABLES
207
208        Method  as LMTD_Basic   (Brief="LMTD Method of Calculation", Symbol =" ");
209        R                               as positive                     (Brief="Capacity Ratio for LMTD Correction Fator",Lower=1e-6);
210        P                               as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6);
211        Rho             as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6);
212        Phi             as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6, Symbol ="\phi");
213
214EQUATIONS
215
216"Duty"
217        Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc;
218
219switch ExchangerType
220       
221        case "Cocurrent Flow":
222
223"Temperature Difference at Inlet"
224        Method.DT0 = InletHot.T - InletCold.T;
225
226"Temperature Difference at Outlet"
227        Method.DTL = OutletHot.T - OutletCold.T;
228
229"R: Capacity Ratio for LMTD Correction Fator"
230        R=1;
231
232"P: Non - Dimensional Variable for LMTD Correction Fator"
233        P=1;
234
235" Variable useless with this model"
236        Phi  = 1;
237       
238" Variable useless with this model"
239        Rho = 1;
240
241"LMTD Correction Factor in Cocurrent Flow"
242        Method.Fc = 1;
243
244        case "Counter Flow":
245       
246"Temperature Difference at Inlet"
247        Method.DT0 = InletHot.T - OutletCold.T;
248
249"Temperature Difference at Outlet"
250        Method.DTL = OutletHot.T - InletCold.T;
251
252"R: Capacity Ratio for LMTD Correction Fator"
253        R=1;
254
255"P: Non - Dimensional Variable for LMTD Correction Fator"
256        P=1;
257
258" Variable useless with this model"
259        Phi  = 1;
260       
261" Variable useless with this model"
262        Rho = 1;
263
264"LMTD Correction Factor in Counter Flow"
265        Method.Fc = 1;
266
267        case "Shell and Tube":
268
269"Temperature Difference at Inlet"
270        Method.DT0 = InletHot.T - OutletCold.T;
271
272"Temperature Difference at Outlet"
273        Method.DTL = OutletHot.T - InletCold.T;
274
275switch LMTDcorrection
276
277        case "Bowmann":
278
279" Variable not in use with Bowmann equation"
280        Phi  = 1;
281       
282" Variable not in use with Bowmann equation"
283        Rho = 1;
284
285"R: Capacity Ratio for LMTD Correction Fator when Shell and Tube"
286        R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T);
287
288"P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube"
289        P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T);
290       
291 if R equal 1
292       
293    then
294       
295"LMTD Correction Fator when 1 Pass Shell Side"
296        Method.Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
297
298        else
299       
300"LMTD Correction Fator when 1 Pass Shell Side"
301        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))))));
302
303end
304
305        case "Fakheri":
306
307"R: Capacity Ratio for LMTD Correction Fator when Shell and Tube"
308        R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T);
309
310"P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube"
311        P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T);
312       
313"Non Dimensional Variable for LMTD Correction Fator in Fakheri Equation "
314        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)));
315
316"Non Dimensional Variable for LMTD Correction Fator in Fakheri Equation"
317        Rho*(1-P*R) = (1-P);
318
319if Rho equal 1
320       
321        then
322       
323"LMTD Correction Fator when 1 Pass Shell Side"
324        Method.Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi))));
325
326        else
327
328"LMTD Correction Fator when 1 Pass Shell Side"
329        Method.Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1));
330       
331end
332
333end
334
335end
336
337end
338
339Model Heatex_NTU                as Heatex_Basic
340
341ATTRIBUTES
342        Pallete         = true;
343        Icon            = "icon/HeatExchanger_NTU";     
344        Brief           = "Simplified model for Heat Exchangers";
345        Info            =
346        "to be documented.";
347       
348PARAMETERS
349
350        ExchangerType           as Switcher     (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow");
351
352VARIABLES
353
354Method  as NTU_Basic    (Brief="NTU Method of Calculation", Symbol =" ");
355
356EQUATIONS
357
358"Number of Units Transference"
359        Method.NTU*Method.Cmin = Details.Ud*Details.A;
360       
361"Minimum Heat Capacity"
362        Method.Cmin  = min([Method.Ch,Method.Cc]);
363
364"Maximum Heat Capacity"
365        Method.Cmax  = max([Method.Ch,Method.Cc]);
366
367"Thermal Capacity Ratio"
368        Method.Cr    = Method.Cmin/Method.Cmax;
369
370"Duty"
371        Details.Q       = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T);
372
373"Hot Stream Heat Capacity"
374        Method.Ch  = InletHot.F*HotSide.Properties.Average.Cp;
375       
376"Cold Stream Heat Capacity"
377        Method.Cc = InletCold.F*ColdSide.Properties.Average.Cp;
378       
379"Effectiveness Correction"
380        Method.Eft1 = 1;
381
382if Method.Cr equal 0
383       
384        then
385       
386"Effectiveness"
387        Method.Eft = 1-exp(-Method.NTU);
388       
389        else
390
391switch  ExchangerType
392
393        case "Cocurrent Flow":
394       
395"Effectiveness in Cocurrent Flow"
396        Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
397
398        case "Counter Flow":
399
400if Method.Cr equal 1
401       
402        then
403"Effectiveness in Counter Flow"
404        Method.Eft = Method.NTU/(1+Method.NTU);
405       
406        else
407"Effectiveness in Counter Flow"
408        Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr)));
409       
410end
411
412        case "Shell and Tube":
413       
414"TEMA E Shell Effectiveness"
415        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;
416
417end
418
419
420end
421
422end
423 
Note: See TracBrowser for help on using the repository browser.