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

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

updated heat exchangers model and samples

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.5 KB
Line 
1 
2using "HEX_Engine";
3#=====================================================================
4#       Basic Models for Simplified Heat Exchangers
5#=====================================================================
6Model HeatExchangerSimplified_Basic
7PARAMETERS
8ext PP          as CalcObject   (Brief="External Physical Properties");
9ext HE          as CalcObject   (Brief="STHE Calculations",File="heatex.dll");
10ext NComp       as Integer      (Brief="Number of Components");
11        M(NComp)        as molweight    (Brief="Component Mol Weight");
12       
13VARIABLES
14
15in  Inlet               as Inlet_Main_Stream;   # Hot and Cold Inlets
16out Outlet              as Outlet_Main_Stream;  # Hot and Cold Outlets
17        Properties      as Main_Properties;             # Hot and Cold Properties
18        Details         as Details_Main;
19        PressureDrop    as Main_Pdrop;
20
21SET
22
23M   = PP.MolecularWeight();
24
25EQUATIONS
26
27"Hot Stream Average Temperature"
28        Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T;
29       
30"Cold Stream Average Temperature"
31        Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T;
32       
33"Hot Stream Average Pressure"
34        Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P;
35       
36"Cold Stream Average Pressure"
37        Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P;
38
39"Cold Stream Wall Temperature"
40        Properties.Cold.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
41
42"Hot Stream Wall Temperature"
43        Properties.Hot.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
44
45"Hot Stream Average Molecular Weight"
46        Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z);
47
48"Cold Stream Average Molecular Weight"
49        Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z);
50
51
52
53if Inlet.Cold.v equal 0
54        then   
55"Heat Capacity Cold Stream"
56        Properties.Cold.Average.Cp      =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
57        Properties.Cold.Inlet.Cp                =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
58        Properties.Cold.Outlet.Cp               =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
59
60"Mass Density Cold Stream"
61        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
62        Properties.Cold.Inlet.rho               =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
63        Properties.Cold.Outlet.rho      =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
64
65"Viscosity Cold Stream"
66        Properties.Cold.Average.Mu =    PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
67        Properties.Cold.Inlet.Mu                =               PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
68        Properties.Cold.Outlet.Mu       =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
69
70"Conductivity Cold Stream"
71        Properties.Cold.Average.K        =      PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
72        Properties.Cold.Inlet.K                         =               PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
73        Properties.Cold.Outlet.K                =               PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
74
75"Heat Capacity Cold Stream"
76        Properties.Cold.Wall.Cp                 =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
77       
78"Viscosity Cold Stream"
79        Properties.Cold.Wall.Mu =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
80
81"Conductivity Cold Stream"
82        Properties.Cold.Wall.K =        PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
83
84
85        else
86
87"Heat Capacity Cold Stream"
88        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
89        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
90        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
91
92"Mass Density Cold Stream"
93        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
94        Properties.Cold.Inlet.rho       =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
95        Properties.Cold.Outlet.rho      =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
96
97"Viscosity Cold Stream"
98        Properties.Cold.Average.Mu =    PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
99        Properties.Cold.Inlet.Mu =              PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
100        Properties.Cold.Outlet.Mu =             PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
101
102"Conductivity Cold Stream"
103        Properties.Cold.Average.K =     PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
104        Properties.Cold.Inlet.K =               PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
105        Properties.Cold.Outlet.K =              PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
106       
107"Heat Capacity Cold Stream"
108        Properties.Cold.Wall.Cp         =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
109
110
111"Viscosity Cold Stream"
112        Properties.Cold.Wall.Mu =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
113
114"Conductivity Cold Stream"
115        Properties.Cold.Wall.K =        PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
116       
117       
118       
119end
120
121if Inlet.Hot.v equal 0
122
123        then
124
125"Heat Capacity Hot Stream"
126        Properties.Hot.Average.Cp       =               PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
127        Properties.Hot.Inlet.Cp         =               PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
128        Properties.Hot.Outlet.Cp        =               PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
129
130"Mass Density Hot Stream"
131        Properties.Hot.Average.rho      =               PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
132        Properties.Hot.Inlet.rho        =               PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
133        Properties.Hot.Outlet.rho       =               PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
134
135"Viscosity Hot Stream"
136        Properties.Hot.Average.Mu       =               PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);     
137        Properties.Hot.Inlet.Mu         =               PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);       
138        Properties.Hot.Outlet.Mu        =               PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);     
139
140"Conductivity Hot Stream"
141        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
142        Properties.Hot.Inlet.K  =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
143        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
144
145"Heat Capacity Hot Stream"
146        Properties.Hot.Wall.Cp  =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
147
148"Viscosity Hot Stream"
149        Properties.Hot.Wall.Mu  =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
150
151"Conductivity Hot Stream"
152        Properties.Hot.Wall.K   =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
153       
154
155        else
156
157"Heat Capacity Hot Stream"
158        Properties.Hot.Average.Cp       =               PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
159        Properties.Hot.Inlet.Cp         =               PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
160        Properties.Hot.Outlet.Cp        =               PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
161
162"Mass Density Hot Stream"
163        Properties.Hot.Average.rho      =               PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
164        Properties.Hot.Inlet.rho        =               PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
165        Properties.Hot.Outlet.rho       =               PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
166
167"Viscosity Hot Stream"
168        Properties.Hot.Average.Mu       =               PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
169        Properties.Hot.Inlet.Mu         =               PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
170        Properties.Hot.Outlet.Mu        =               PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
171
172"Conductivity Hot Stream"
173        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
174        Properties.Hot.Inlet.K  =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
175        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
176
177"Heat Capacity Hot Stream"
178        Properties.Hot.Wall.Cp  =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
179
180"Viscosity Hot Stream"
181        Properties.Hot.Wall.Mu  =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
182
183"Conductivity Hot Stream"
184        Properties.Hot.Wall.K   =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
185
186
187end
188
189#=====================================================================
190#       Thermal Details
191#=====================================================================
192"Hot Stream Heat Capacity"
193        Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp;
194       
195"Cold Stream Heat Capacity"
196        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
197       
198"Heat Capacity Ratio"
199
200Details.Cmin  = min([Details.Ch,Details.Cc]);
201Details.Cmax  = max([Details.Ch,Details.Cc]);
202Details.Cr    = Details.Cmin/Details.Cmax;
203#=====================================================================
204#       Energy Balance
205#=====================================================================
206"Energy Balance Hot Stream"
207        Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h);
208
209"Energy Balance Cold Stream"
210        Details.Q =-Inlet.Cold.F*(Inlet.Cold.h-Outlet.Cold.h);
211
212#=====================================================================
213#       Material Balance
214#=====================================================================
215"Flow Mass Inlet Cold Stream"
216        Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F;
217
218"Flow Mass Outlet Cold Stream"
219        Properties.Cold.Outlet.Fw       =  sum(M*Outlet.Cold.z)*Outlet.Cold.F;
220
221"Flow Mass Inlet Hot Stream"
222        Properties.Hot.Inlet.Fw         =  sum(M*Inlet.Hot.z)*Inlet.Hot.F;
223
224"Flow Mass Outlet Hot Stream"   
225        Properties.Hot.Outlet.Fw        =  sum(M*Outlet.Hot.z)*Outlet.Hot.F;
226
227"Molar Balance Hot Stream"
228        Inlet.Hot.F  = Outlet.Hot.F;
229       
230"Molar Balance Cold Stream"
231        Inlet.Cold.F = Outlet.Cold.F;
232
233#======================================
234#       Constraints
235#======================================
236"Hot Stream Molar Fraction Constraint"
237        Outlet.Hot.z=Inlet.Hot.z;
238       
239"Cold Stream Molar Fraction Constraint"
240        Outlet.Cold.z=Inlet.Cold.z;
241       
242"No Phase Change In Cold Stream"
243        Inlet.Cold.v=Outlet.Cold.v;
244
245"No Phase Change In Hot Stream"
246        Inlet.Hot.v=Outlet.Hot.v;
247
248#======================================
249#       Pressure Drop
250#======================================
251
252"Pressure Drop Hot Stream"
253        Outlet.Hot.P  = Inlet.Hot.P - PressureDrop.Hot.Pdrop;
254       
255"Pressure Drop Cold Stream"
256        Outlet.Cold.P  = Inlet.Cold.P - PressureDrop.Cold.Pdrop;
257       
258"Fraction of Inlet Pressure : Hot Stream"
259        PressureDrop.Hot.Pdrop  = Inlet.Hot.P*PressureDrop.Hot.FPdrop;
260       
261"Fraction of Inlet Pressure : Cold Stream"
262        PressureDrop.Cold.Pdrop  = Inlet.Cold.P*PressureDrop.Cold.FPdrop;
263       
264       
265end
266
267Model Heatex_Basic_NTU   as HeatExchangerSimplified_Basic
268#=====================================================================
269#       Basic Model for Heat Exchangers - NTU Method
270#=====================================================================
271VARIABLES
272
273Eft       as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8);
274
275EQUATIONS       
276
277"Energy Balance"
278        Details.Q       = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); 
279
280
281end
282
283Model Heatex_Basic_LMTD  as HeatExchangerSimplified_Basic
284#=====================================================================
285#       Basic Model for Heat Exchangers - LMTD Method
286#=====================================================================
287
288VARIABLES
289
290LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
291Fc              as positive             (Brief="LMTD Correction Factor",Lower=0.5);
292MTD             as temp_delta   (Brief="Mean Temperature Difference");
293
294EQUATIONS
295
296"Exchange Surface Area"
297        Details.Q = Details.U*Details.A*MTD;   
298       
299"Mean Temperature Difference"   
300        MTD   = Fc*LMTD;
301
302end
303
304
305#=====================================================================
306#       Concrete Models for Simplified Heat Exchangers
307#=====================================================================
308
309#=====================================================================
310# LMTD Method
311#=====================================================================
312
313Model HeatExchanger_LMTD        as Heatex_Basic_LMTD
314
315EQUATIONS
316
317"Cocurrent Flow LMTD"
318        LMTD = HE.LogMeanTemperature(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
319
320end
321
322Model E_Shell_LMTD                      as Heatex_Basic_LMTD       
323#=====================================================================
324#       Shell and Tubes Heat Exchanger with 1 shell pass - LMTD Method
325#===================================================================== 
326EQUATIONS
327
328"Counter Flow LMTD"
329        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
330
331"LMTD Correction Factor"
332        Fc = HE.EshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
333
334end
335
336Model F_Shell_LMTD              as Heatex_Basic_LMTD
337#=====================================================================
338#       Shell and Tubes Heat Exchanger with 2 shell passes - LMTD Method
339#=====================================================================
340EQUATIONS
341
342"Counter Flow LMTD"
343        LMTD = HE.CounterLMTD(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
344
345"LMTD Correction Factor"
346        Fc = HE.FshellCorrectionFactor(Inlet.Hot.T,Outlet.Hot.T,Inlet.Cold.T,Outlet.Cold.T);
347
348end
349
350#=====================================================================
351# NTU Method
352#=====================================================================
353
354Model HeatExchanger_NTU         as Heatex_Basic_NTU
355
356EQUATIONS
357"Effectiveness"
358        Eft=HE.Effectiveness(Details.Cr,Details.NTU);
359       
360end
361
362Model E_Shell_NTU                       as Heatex_Basic_NTU
363#=====================================================================
364#       Shell and Tubes Heat Exchanger with 1 shell pass - NTU Method
365#=====================================================================
366EQUATIONS
367"TEMA E Shell Effectiveness"
368        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;
369
370end
371
372Model F_Shell_NTU               as Heatex_Basic_NTU
373#=====================================================================
374#       Shell and Tubes Heat Exchanger with 2 shell passes - NTU Method
375#===================================================================== 
376VARIABLES
377
378Eft1    as positive (Brief="Effectiveness Correction",Lower=0.01,Upper=1,Default=0.5);
379
380EQUATIONS
381
382"Effectiveness Correction"
383        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;
384
385"TEMA F Shell Effectiveness"
386        Eft = ( ((1-Eft1*Details.Cr)/(1-Eft1))^2 -1  )*( ((1-Eft1*Details.Cr)/(1-Eft1))^2 - Details.Cr )^-1;
387
388end
Note: See TracBrowser for help on using the repository browser.