source: trunk/eml/heat_exchangers/Heatex.mso @ 551

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

updated Heatex simplified model

File size: 11.6 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* $  $
18*--------------------------------------------------------------------*#
19
20using "heat_exchangers/HEX_Engine";
21
22Model Basic_Pdrop
23       
24ATTRIBUTES
25        Pallete = false;
26        Brief = "to be documented";
27        Info =
28        "to be documented";
29       
30VARIABLES
31
32Pdrop           as press_delta  (Brief="Pressure Drop",Default=0.01, Lower=0,DisplayUnit='kPa' , Symbol ="\Delta P");
33FPdrop  as Real                         (Brief="Pressure Drop : Fraction of Inlet",Lower=0,Upper=0.8);
34
35end
36
37Model Main_Simplified
38       
39ATTRIBUTES
40        Pallete = false;
41        Brief = "to be documented";
42        Info =
43        "to be documented";
44       
45VARIABLES
46
47PressureDrop    as Basic_Pdrop                          (Brief="Pressure Drop", Symbol=" ");
48Properties              as Physical_Properties_Heatex           (Brief="Physical Properties", Symbol=" ");
49
50end
51
52Model Heatex_Basic
53
54ATTRIBUTES
55        Pallete         = false;
56        Brief           = "Basic Model for Simplified Heat Exchangers";
57        Info            =
58        "to be documented.";
59       
60PARAMETERS
61outer PP            as Plugin   (Brief="External Physical Properties", Type="PP");
62outer NComp     as Integer  (Brief="Number of Components");
63       
64        M(NComp)  as molweight  (Brief="Component Mol Weight",Hidden=true);
65       
66VARIABLES
67
68in  InletHot    as stream               (Brief="Inlet Hot Stream", PosX=0, PosY=0.4915, Symbol="^{inHot}");
69out OutletHot   as streamPH     (Brief="Outlet Hot Stream", PosX=1, PosY=0.4915, Symbol="^{outHot}");
70in  InletCold   as stream               (Brief="Inlet Cold Stream", PosX=0.5237, PosY=1, Symbol="^{inCold}");
71out OutletCold  as streamPH     (Brief="Outlet Cold Stream", PosX=0.5237, PosY=0, Symbol="^{outCold}");
72
73        xh(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Hot Side",Hidden=true);
74        yh(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Hot Side",Hidden=true);
75        vh                      as fraction             (Brief = "Vapour Fraction in Hot Side",Hidden=true);
76       
77        xc(NComp)       as fraction             (Brief = "Liquid Molar Fraction in Cold Side",Hidden=true);
78        yc(NComp)       as fraction             (Brief = "Vapour Molar Fraction in Cold Side",Hidden=true);
79        vc                      as fraction             (Brief = "Vapour Fraction in Cold Side",Hidden=true);
80
81        Details     as Details_Main     (Brief="Heat Exchanger Details", Symbol=" ");
82        HotSide         as Main_Simplified      (Brief="Heat Exchanger Hot Side", Symbol="_{hot}");
83        ColdSide        as Main_Simplified      (Brief="Heat Exchanger Cold Side", Symbol="_{cold}");
84
85SET
86
87#"Component Molecular Weight"
88        M   = PP.MolecularWeight();
89
90EQUATIONS
91
92"Flash Calculation in Hot Side"
93        [vh, xh, yh] = PP.Flash(InletHot.T, InletHot.P, InletHot.z);
94
95"Flash Calculation in Cold Side"
96        [vc, xc, yc] = PP.Flash(InletCold.T, InletCold.P, InletCold.z);
97
98"Hot Stream Average Molecular Weight"
99        HotSide.Properties.Mw = sum(M*InletHot.z);
100
101"Cold Stream Average Molecular Weight"
102        ColdSide.Properties.Mw = sum(M*InletCold.z);
103
104"Cold Stream Average Heat Capacity"
105        ColdSide.Properties.Cp  =       (1-InletCold.v)*PP.LiquidCp(0.5*InletCold.T+0.5*OutletCold.T,0.5*InletCold.P+0.5*OutletCold.P,xc)+
106                InletCold.v*PP.VapourCp(0.5*InletCold.T+0.5*OutletCold.T,0.5*InletCold.P+0.5*OutletCold.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"Hot Stream Average Heat Capacity"
117        HotSide.Properties.Cp   =       (1-InletHot.v)*PP.LiquidCp(0.5*InletHot.T+0.5*OutletHot.T,0.5*InletHot.P+0.5*OutletHot.P,xh)+
118                InletHot.v*PP.VapourCp(0.5*InletHot.T+0.5*OutletHot.T,0.5*InletHot.P+0.5*OutletHot.P,yh);
119       
120"Hot Stream Inlet Mass Density"
121        HotSide.Properties.Inlet.rho    =       (1-InletHot.v)*PP.LiquidDensity(InletHot.T,InletHot.P,xc)+
122                InletHot.v*PP.VapourDensity(InletHot.T,InletHot.P,yc);
123
124"Hot Stream Outlet Mass Density"
125        HotSide.Properties.Outlet.rho   =       (1-OutletHot.v)*PP.LiquidDensity(OutletHot.T,OutletHot.P,OutletHot.x)+
126                OutletHot.v*PP.VapourDensity(OutletHot.T,OutletHot.P,OutletHot.y);
127
128"Energy Balance Hot Stream"
129        Details.Q = InletHot.F*(InletHot.h-OutletHot.h);
130
131"Energy Balance Cold Stream"
132        Details.Q =-InletCold.F*(InletCold.h-OutletCold.h);
133
134"Flow Mass Inlet Cold Stream"
135        ColdSide.Properties.Inlet.Fw    =  sum(M*InletCold.z)*InletCold.F;
136
137"Flow Mass Outlet Cold Stream"
138        ColdSide.Properties.Outlet.Fw   =  sum(M*OutletCold.z)*OutletCold.F;
139
140"Flow Mass Inlet Hot Stream"
141        HotSide.Properties.Inlet.Fw             =  sum(M*InletHot.z)*InletHot.F;
142
143"Flow Mass Outlet Hot Stream"   
144        HotSide.Properties.Outlet.Fw    =  sum(M*OutletHot.z)*OutletHot.F;
145
146"Molar Balance Hot Stream"
147        InletHot.F  = OutletHot.F;
148       
149"Molar Balance Cold Stream"
150        InletCold.F = OutletCold.F;
151
152"Hot Stream Molar Fraction Constraint"
153        OutletHot.z             =       InletHot.z;
154       
155"Cold Stream Molar Fraction Constraint"
156        OutletCold.z    =       InletCold.z;
157       
158"Pressure Drop Hot Stream"
159        OutletHot.P  = InletHot.P - HotSide.PressureDrop.Pdrop;
160       
161"Pressure Drop Cold Stream"
162        OutletCold.P  = InletCold.P - ColdSide.PressureDrop.Pdrop;
163       
164"Fraction of Inlet Pressure : Hot Stream"
165        HotSide.PressureDrop.Pdrop  = InletHot.P*HotSide.PressureDrop.FPdrop;
166       
167"Fraction of Inlet Pressure : Cold Stream"
168        ColdSide.PressureDrop.Pdrop  = InletCold.P*ColdSide.PressureDrop.FPdrop;
169       
170end
171
172Model Heatex_LMTD       as Heatex_Basic
173
174ATTRIBUTES
175        Pallete         = true;
176        Icon            = "icon/HeatExchanger_LMTD";   
177        Brief           = "Simplified model for Heat Exchangers";
178        Info            =
179        "to be documented.";
180       
181PARAMETERS
182
183        ExchangerType           as Switcher     (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow");
184        LMTDcorrection  as Switcher     (Brief="LMTD Correction Factor Model",Valid=["Bowmann","Fakheri"],Default="Bowmann");
185
186VARIABLES
187
188        Method  as LMTD_Basic   (Brief="LMTD Method of Calculation", Symbol =" ");
189        R                               as positive                     (Brief="Capacity Ratio for LMTD Correction Fator",Lower=1e-6,Hidden=true);
190        P                               as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator ",Lower=1e-6,Hidden=true);
191        Rho             as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6,Hidden=true);
192        Phi             as positive                     (Brief="Non - Dimensional Variable for LMTD Correction Fator in Fakheri Equation",Lower=1e-6, Symbol ="\phi",Hidden=true);
193
194EQUATIONS
195
196"Duty"
197        Details.Q = Details.Ud*Details.A*Method.LMTD*Method.Fc;
198
199switch ExchangerType
200       
201        case "Cocurrent Flow":
202
203"Temperature Difference at Inlet"
204        Method.DT0 = InletHot.T - InletCold.T;
205
206"Temperature Difference at Outlet"
207        Method.DTL = OutletHot.T - OutletCold.T;
208
209"R: Capacity Ratio for LMTD Correction Fator"
210        R=1;
211
212"P: Non - Dimensional Variable for LMTD Correction Fator"
213        P=1;
214
215" Variable useless with this model"
216        Phi  = 1;
217       
218" Variable useless with this model"
219        Rho = 1;
220
221"LMTD Correction Factor in Cocurrent Flow"
222        Method.Fc = 1;
223
224        case "Counter Flow":
225       
226"Temperature Difference at Inlet"
227        Method.DT0 = InletHot.T - OutletCold.T;
228
229"Temperature Difference at Outlet"
230        Method.DTL = OutletHot.T - InletCold.T;
231
232"R: Capacity Ratio for LMTD Correction Fator"
233        R=1;
234
235"P: Non - Dimensional Variable for LMTD Correction Fator"
236        P=1;
237
238" Variable useless with this model"
239        Phi  = 1;
240       
241" Variable useless with this model"
242        Rho = 1;
243
244"LMTD Correction Factor in Counter Flow"
245        Method.Fc = 1;
246
247        case "Shell and Tube":
248
249"Temperature Difference at Inlet"
250        Method.DT0 = InletHot.T - OutletCold.T;
251
252"Temperature Difference at Outlet"
253        Method.DTL = OutletHot.T - InletCold.T;
254
255switch LMTDcorrection
256
257        case "Bowmann":
258
259" Variable not in use with Bowmann equation"
260        Phi  = 1;
261       
262" Variable not in use with Bowmann equation"
263        Rho = 1;
264
265"R: Capacity Ratio for LMTD Correction Fator when Shell and Tube"
266        R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T);
267
268"P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube"
269        P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T);
270       
271 if R equal 1
272       
273    then
274       
275"LMTD Correction Fator when 1 Pass Shell Side"
276        Method.Fc = (sqrt(2)*P)/((1-P)*ln( abs( ( 2-P*0.585786)/( 2-P*3.414214))));
277
278        else
279       
280"LMTD Correction Fator when 1 Pass Shell Side"
281        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))))));
282
283end
284
285        case "Fakheri":
286
287"R: Capacity Ratio for LMTD Correction Fator when Shell and Tube"
288        R*(OutletCold.T - InletCold.T ) = (InletHot.T-OutletHot.T);
289
290"P: Non - Dimensional Variable for LMTD Correction Fator when Shell and Tube"
291        P*(InletHot.T- InletCold.T)= (OutletCold.T-InletCold.T);
292       
293"Non Dimensional Variable for LMTD Correction Fator in Fakheri Equation "
294        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)));
295
296"Non Dimensional Variable for LMTD Correction Fator in Fakheri Equation"
297        Rho*(1-P*R) = (1-P);
298
299if Rho equal 1
300       
301        then
302       
303"LMTD Correction Fator when 1 Pass Shell Side"
304        Method.Fc = (4*Phi)/(ln(abs((1+2*Phi)/(1-2*Phi))));
305
306        else
307
308"LMTD Correction Fator when 1 Pass Shell Side"
309        Method.Fc = (2*Phi*(Rho+1)*ln(abs(Rho)))/( ln(abs((1+2*Phi)/(1-2*Phi)))*(Rho-1));
310       
311end
312
313end
314
315end
316
317end
318
319Model Heatex_NTU                as Heatex_Basic
320
321ATTRIBUTES
322        Pallete         = true;
323        Icon            = "icon/HeatExchanger_NTU";     
324        Brief           = "Simplified model for Heat Exchangers";
325        Info            =
326        "to be documented.";
327       
328PARAMETERS
329
330        ExchangerType           as Switcher     (Brief="Type of Heat Exchanger",Valid=["Counter Flow","Cocurrent Flow", "Shell and Tube"],Default="Cocurrent Flow");
331
332VARIABLES
333
334Method  as NTU_Basic    (Brief="NTU Method of Calculation", Symbol =" ");
335
336EQUATIONS
337
338"Number of Units Transference"
339        Method.NTU*Method.Cmin = Details.Ud*Details.A;
340       
341"Minimum Heat Capacity"
342        Method.Cmin  = min([Method.Ch,Method.Cc]);
343
344"Maximum Heat Capacity"
345        Method.Cmax  = max([Method.Ch,Method.Cc]);
346
347"Thermal Capacity Ratio"
348        Method.Cr    = Method.Cmin/Method.Cmax;
349
350"Duty"
351        Details.Q       = Method.Eft*Method.Cmin*(InletHot.T-InletCold.T);
352
353"Hot Stream Heat Capacity"
354        Method.Ch  = InletHot.F*HotSide.Properties.Cp;
355       
356"Cold Stream Heat Capacity"
357        Method.Cc = InletCold.F*ColdSide.Properties.Cp;
358       
359"Effectiveness Correction"
360        Method.Eft1 = 1;
361
362if Method.Cr equal 0
363       
364        then
365       
366"Effectiveness"
367        Method.Eft = 1-exp(-Method.NTU);
368       
369        else
370
371switch  ExchangerType
372
373        case "Cocurrent Flow":
374       
375"Effectiveness in Cocurrent Flow"
376        Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
377
378        case "Counter Flow":
379
380if Method.Cr equal 1
381       
382        then
383"Effectiveness in Counter Flow"
384        Method.Eft = Method.NTU/(1+Method.NTU);
385       
386        else
387"Effectiveness in Counter Flow"
388        Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr)));
389       
390end
391
392        case "Shell and Tube":
393       
394"TEMA E Shell Effectiveness"
395        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;
396
397end
398
399
400end
401
402end
403 
Note: See TracBrowser for help on using the repository browser.