source: trunk/eml/heat_exchangers/DoublePipe.mso @ 250

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

updated double pipe model - modified switcher implementation in EMSO language

  • Property svn:keywords set to Id
File size: 25.7 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: DoublePipe.mso 250 2007-04-27 16:32:02Z bicca $
18*------------------------------------------------------------------*#
19
20using "HEX_Engine";
21
22Model DoublePipe_Basic
23
24ATTRIBUTES
25        Pallete         = false;
26        Brief           = "Basic Equations for rigorous double pipe heat exchanger model.";
27        Info            =
28        "to be documented.";
29
30PARAMETERS
31
32outer PP                        as Plugin               (Brief="External Physical Properties", Type="PP");
33outer NComp             as Integer      (Brief="Number of Components");
34       
35        M(NComp)        as molweight    (Brief="Component Mol Weight");
36       
37        HotSide                                 as Switcher     (Brief="Flag for Fluid Alocation ",Valid=["outer","inner"],Default="outer");
38        innerFlowRegime         as Switcher     (Brief="Inner Flow Regime ",Valid=["laminar","transition","turbulent"],Default="laminar");
39        outerFlowRegime         as Switcher     (Brief="Outer Flow Regime ",Valid=["laminar","transition","turbulent"],Default="laminar");
40
41        InnerLaminarCorrelation         as Switcher             (Brief="Heat Transfer Correlation in Laminar Flow for the Inner Side",Valid=["Hausen","Schlunder"],Default="Hausen");
42        InnerTransitionCorrelation  as Switcher         (Brief="Heat Transfer Correlation in Transition Flow for the Inner Side",Valid=["Gnielinski","ESDU"],Default="Gnielinski");
43        InnerTurbulentCorrelation  as Switcher                  (Brief="Heat Transfer Correlation in Turbulent Flow for the Inner Side",Valid=["Petukhov","SiederTate"],Default="Petukhov");
44
45        OuterLaminarCorrelation         as Switcher             (Brief="Heat Transfer Correlation in Laminar Flow for the Outer Side",Valid=["Hausen","Schlunder"],Default="Hausen");
46        OuterTransitionCorrelation  as Switcher         (Brief="Heat Transfer Correlation in Transition Flow for the OuterSide",Valid=["Gnielinski","ESDU"],Default="Gnielinski");
47        OuterTurbulentCorrelation  as Switcher          (Brief="Heat Transfer Correlation in Turbulent Flow for the Outer Side",Valid=["Petukhov","SiederTate"],Default="Petukhov");
48
49        Pi                      as constant             (Brief="Pi Number",Default=3.14159265);
50        DoInner  as length                      (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
51        DiInner as length                       (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
52        DiOuter as length                       (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
53        Lpipe           as length                       (Brief="Effective Tube Length",Lower=0.1);
54        Kwall           as conductivity         (Brief="Tube Wall Material Thermal Conductivity",Default=1.0);
55        Rfi                     as positive                     (Brief="Inside Fouling Resistance",Unit='m^2*K/kW',Default=1e-6,Lower=0);
56        Rfo             as positive                     (Brief="Outside Fouling Resistance",Unit='m^2*K/kW',Default=1e-6,Lower=0);
57
58VARIABLES
59
60in      InletInner              as stream                       (Brief="Inlet Inner Stream");   
61in      InletOuter              as stream                       (Brief="Inlet Outer Stream");
62out     OutletInner             as streamPH             (Brief="Outlet Inner Stream");
63out     OutletOuter     as streamPH             (Brief="Outlet Outer Stream");
64
65        Details                 as Details_Main                 (Brief="Some Details in the Heat Exchanger");
66        Inner                   as Main_DoublePipe              (Brief="Inner Side of the Heat Exchanger");
67        Outer                   as Main_DoublePipe              (Brief="Outer Side of the Heat Exchanger");
68
69SET
70
71#"Component Molecular Weight"
72        M  = PP.MolecularWeight();
73       
74#"Pi Number"
75        Pi      = 3.14159265;
76       
77#"Inner Pipe Cross Sectional Area for Flow"
78        Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
79       
80#"Outer Pipe Cross Sectional Area for Flow"
81        Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter - DoInner*DoInner)/4;
82       
83#"Inner Pipe Hydraulic Diameter for Heat Transfer"
84        Inner.HeatTransfer.Dh=DiInner;
85       
86#"Outer Pipe Hydraulic Diameter for Heat Transfer"
87        Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
88
89#"Inner Pipe Hydraulic Diameter for Pressure Drop"
90        Inner.PressureDrop.Dh=DiInner;
91       
92#"Outer Pipe Hydraulic Diameter for Pressure Drop"
93        Outer.PressureDrop.Dh=DiOuter-DoInner;
94
95EQUATIONS
96
97"Outer  Stream Average Temperature"
98        Outer.Properties.Average.T = 0.5*InletOuter.T + 0.5*OutletOuter.T;
99
100"Inner Stream Average Temperature"
101        Inner.Properties.Average.T = 0.5*InletInner.T + 0.5*OutletInner.T;
102       
103"Outer Stream Average Pressure"
104        Outer.Properties.Average.P = 0.5*InletOuter.P+0.5*OutletOuter.P;
105       
106"Inner Stream Average Pressure"
107        Inner.Properties.Average.P = 0.5*InletInner.P+0.5*OutletInner.P;
108
109"Inner Stream Wall Temperature"
110        Inner.Properties.Wall.Twall =   0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T;
111
112"Outer Stream Wall Temperature"
113        Outer.Properties.Wall.Twall =   0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T;
114
115"Outer Stream Average Molecular Weight"
116        Outer.Properties.Average.Mw = sum(M*InletOuter.z);
117
118"Inner Stream Average Molecular Weight"
119        Inner.Properties.Average.Mw = sum(M*InletInner.z);
120
121if InletInner.v equal 0
122       
123        then   
124
125"Average Heat Capacity Inner Stream"
126        Inner.Properties.Average.Cp             =       PP.LiquidCp(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
127
128"Inlet Heat Capacity Inner Stream"
129        Inner.Properties.Inlet.Cp                       =       PP.LiquidCp(InletInner.T,InletInner.P,InletInner.z);
130
131"Outlet Heat Capacity Inner Stream"
132        Inner.Properties.Outlet.Cp              =       PP.LiquidCp(OutletInner.T,OutletInner.P,OutletInner.z);
133
134"Average Mass Density Inner Stream"
135        Inner.Properties.Average.rho    =       PP.LiquidDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
136
137"Inlet Mass Density Inner Stream"
138        Inner.Properties.Inlet.rho              =       PP.LiquidDensity(InletInner.T,InletInner.P,InletInner.z);
139
140"Outlet Mass Density Inner Stream"
141        Inner.Properties.Outlet.rho     =       PP.LiquidDensity(OutletInner.T,OutletInner.P,OutletInner.z);
142
143"Average Viscosity Inner Stream"
144        Inner.Properties.Average.Mu     =       PP.LiquidViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
145
146"Inlet  Viscosity Inner Stream"
147        Inner.Properties.Inlet.Mu               =       PP.LiquidViscosity(InletInner.T,InletInner.P,InletInner.z);
148
149"Outlet Viscosity Inner Stream"
150        Inner.Properties.Outlet.Mu      =       PP.LiquidViscosity(OutletInner.T,OutletInner.P,OutletInner.z);
151
152"Average        Conductivity Inner Stream"
153        Inner.Properties.Average.K              =       PP.LiquidThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
154
155"Inlet  Conductivity Inner Stream"
156        Inner.Properties.Inlet.K                =       PP.LiquidThermalConductivity(InletInner.T,InletInner.P,InletInner.z);
157
158"Outlet Conductivity Inner Stream"
159        Inner.Properties.Outlet.K               =       PP.LiquidThermalConductivity(OutletInner.T,OutletInner.P,OutletInner.z);
160
161"Viscosity Inner Stream at wall temperature"
162        Inner.Properties.Wall.Mu                =       PP.LiquidViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
163
164        else
165
166"Average Heat Capacity InnerStream"
167        Inner.Properties.Average.Cp     =       PP.VapourCp(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
168
169"Inlet Heat Capacity Inner Stream"
170        Inner.Properties.Inlet.Cp               =       PP.VapourCp(InletInner.T,InletInner.P,InletInner.z);
171
172"Outlet Heat Capacity Inner Stream"
173        Inner.Properties.Outlet.Cp      =       PP.VapourCp(OutletInner.T,OutletInner.P,OutletInner.z);
174
175"Average Mass Density Inner Stream"
176        Inner.Properties.Average.rho    =       PP.VapourDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
177
178"Inlet Mass Density Inner Stream"
179        Inner.Properties.Inlet.rho              =       PP.VapourDensity(InletInner.T,InletInner.P,InletInner.z);
180       
181"Outlet Mass Density Inner Stream"
182        Inner.Properties.Outlet.rho     =       PP.VapourDensity(OutletInner.T,OutletInner.P,OutletInner.z);
183
184"Average Viscosity Inner Stream"
185        Inner.Properties.Average.Mu     =       PP.VapourViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
186
187"Inlet Viscosity Inner Stream"
188        Inner.Properties.Inlet.Mu               =       PP.VapourViscosity(InletInner.T,InletInner.P,InletInner.z);
189
190"Outlet Viscosity Inner Stream"
191        Inner.Properties.Outlet.Mu      =       PP.VapourViscosity(OutletInner.T,OutletInner.P,OutletInner.z);
192
193"Average Conductivity Inner Stream"
194        Inner.Properties.Average.K              =       PP.VapourThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
195
196"Inlet Conductivity Inner Stream"
197        Inner.Properties.Inlet.K                =       PP.VapourThermalConductivity(InletInner.T,InletInner.P,InletInner.z);
198
199"Outlet Conductivity Inner Stream"
200        Inner.Properties.Outlet.K               =       PP.VapourThermalConductivity(OutletInner.T,OutletInner.P,OutletInner.z);
201       
202"Viscosity Inner Stream at wall temperature"
203        Inner.Properties.Wall.Mu                =       PP.VapourViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
204
205end
206
207if InletOuter.v equal 0
208
209        then
210
211"Average Heat Capacity Outer Stream"
212        Outer.Properties.Average.Cp     =               PP.LiquidCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
213
214"Inlet Heat Capacity Outer Stream"
215        Outer.Properties.Inlet.Cp               =               PP.LiquidCp(InletOuter.T,InletOuter.P,InletOuter.z);
216
217"Outlet Heat Capacity Outer Stream"
218        Outer.Properties.Outlet.Cp      =               PP.LiquidCp(OutletOuter.T,OutletOuter.P,OutletOuter.z);
219
220"Average Mass Density Outer Stream"
221        Outer.Properties.Average.rho =          PP.LiquidDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
222
223"Inlet Mass Density Outer Stream"
224        Outer.Properties.Inlet.rho              =               PP.LiquidDensity(InletOuter.T,InletOuter.P,InletOuter.z);
225
226"Outlet Mass Density Outer Stream"
227        Outer.Properties.Outlet.rho     =               PP.LiquidDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
228
229"Average Viscosity Outer Stream"
230        Outer.Properties.Average.Mu     =               PP.LiquidViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
231
232"Inlet Viscosity Outer Stream"
233        Outer.Properties.Inlet.Mu       =               PP.LiquidViscosity(InletOuter.T,InletOuter.P,InletOuter.z);     
234
235"Outlet Viscosity Outer Stream"
236        Outer.Properties.Outlet.Mu      =               PP.LiquidViscosity(OutletOuter.T,OutletOuter.P,OutletOuter.z); 
237
238"Average Conductivity Outer Stream"
239        Outer.Properties.Average.K      =               PP.LiquidThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
240
241"Inlet Conductivity Outer Stream"
242        Outer.Properties.Inlet.K                =               PP.LiquidThermalConductivity(InletOuter.T,InletOuter.P,InletOuter.z);   
243
244"Outlet Conductivity Outer Stream"
245        Outer.Properties.Outlet.K       =               PP.LiquidThermalConductivity(OutletOuter.T,OutletOuter.P,OutletOuter.z);       
246
247"Viscosity Outer Stream at wall temperature"
248        Outer.Properties.Wall.Mu                =               PP.LiquidViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);       
249
250
251        else
252
253"Average Heat Capacity Outer Stream"
254        Outer.Properties.Average.Cp     =               PP.VapourCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
255
256"Inlet Heat Capacity Outer Stream"
257        Outer.Properties.Inlet.Cp               =               PP.VapourCp(InletOuter.T,InletOuter.P,InletOuter.z);
258
259"Outlet Heat Capacity Outer Stream"
260        Outer.Properties.Outlet.Cp      =               PP.VapourCp(OutletOuter.T,OutletOuter.P,OutletOuter.z);
261
262"Average Mass Density Outer Stream"
263        Outer.Properties.Average.rho =          PP.VapourDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
264
265"Inlet Mass Density Outer Stream"
266        Outer.Properties.Inlet.rho              =               PP.VapourDensity(InletOuter.T,InletOuter.P,InletOuter.z);
267       
268"Outlet Mass Density Outer Stream"
269        Outer.Properties.Outlet.rho     =               PP.VapourDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
270
271"Average Viscosity Outer Stream"
272        Outer.Properties.Average.Mu     =               PP.VapourViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
273
274"Inlet Viscosity Outer Stream"
275        Outer.Properties.Inlet.Mu       =               PP.VapourViscosity(InletOuter.T,InletOuter.P,InletOuter.z);
276
277"Outlet Viscosity Outer Stream"
278        Outer.Properties.Outlet.Mu      =               PP.VapourViscosity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
279
280"Average Conductivity Outer Stream"
281        Outer.Properties.Average.K      =               PP.VapourThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
282
283"Inlet Conductivity Outer Stream"
284        Outer.Properties.Inlet.K                =               PP.VapourThermalConductivity(InletOuter.T,InletOuter.P,InletOuter.z);   
285
286"Outlet Conductivity Outer Stream"
287        Outer.Properties.Outlet.K       =               PP.VapourThermalConductivity(OutletOuter.T,OutletOuter.P,OutletOuter.z);       
288
289"Viscosity Outer Stream at wall temperature"
290        Outer.Properties.Wall.Mu                =               PP.VapourViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);
291
292end
293
294switch HotSide
295       
296        case "outer":
297
298"Energy Balance Hot Stream"
299        Details.Q = InletOuter.F*(InletOuter.h-OutletOuter.h);
300
301"Energy Balance Cold Stream"
302        Details.Q = InletInner.F*(OutletInner.h - InletInner.h);
303
304        when InletInner.T > InletOuter.T switchto "inner";
305
306case "inner":
307
308"Energy Balance Hot Stream"
309        Details.Q = InletInner.F*(InletInner.h-OutletInner.h);
310
311"Energy Balance Cold Stream"
312        Details.Q = InletOuter.F*(OutletOuter.h - InletOuter.h);
313
314        when InletInner.T < InletOuter.T switchto "outer";
315
316end
317
318"Flow Mass Inlet Inner Stream"
319        Inner.Properties.Inlet.Fw       =  sum(M*InletInner.z)*InletInner.F;
320
321"Flow Mass Outlet Inner Stream"
322        Inner.Properties.Outlet.Fw      =  sum(M*OutletInner.z)*OutletInner.F;
323
324"Flow Mass Inlet Outer Stream"
325        Outer.Properties.Inlet.Fw               =  sum(M*InletOuter.z)*InletOuter.F;
326
327"Flow Mass Outlet Outer Stream"
328        Outer.Properties.Outlet.Fw      =  sum(M*OutletOuter.z)*OutletOuter.F;
329
330"Molar Balance Outer Stream"
331        OutletOuter.F = InletOuter.F;
332       
333"Molar Balance Inner Stream"
334        OutletInner.F = InletInner.F;
335
336"Outer Stream Molar Fraction Constraint"
337        OutletOuter.z=InletOuter.z;
338       
339"InnerStream Molar Fraction Constraint"
340        OutletInner.z=InletInner.z;
341
342"Exchange Surface Area"
343        Details.A=Pi*DoInner*Lpipe;
344
345switch innerFlowRegime
346       
347        case "laminar":
348       
349"Inner Side Friction Factor for Pressure Drop - laminar Flow"
350        Inner.PressureDrop.fi*Inner.PressureDrop.Re = 16;
351       
352        when Inner.PressureDrop.Re > 2300 switchto "transition";
353
354        case "transition":
355       
356"using Turbulent Flow - to be implemented"
357        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
358
359        when Inner.PressureDrop.Re < 2300 switchto "laminar";
360        when Inner.PressureDrop.Re > 10000 switchto "turbulent";
361
362        case "turbulent":
363
364"Inner Side Friction Factor - Turbulent Flow"
365        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
366
367        when Inner.PressureDrop.Re < 10000 switchto "transition";
368       
369end     
370
371switch outerFlowRegime
372       
373        case "laminar":
374       
375"Outer Side Friction Factor - laminar Flow"
376        Outer.PressureDrop.fi*Outer.PressureDrop.Re = 16;
377       
378        when Outer.PressureDrop.Re > 2300 switchto "transition";
379
380        case "transition":
381       
382"using Turbulent Flow - Transition Flow must be implemented"
383        (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
384
385        when Outer.PressureDrop.Re < 2300 switchto "laminar";
386        when Outer.PressureDrop.Re > 10000 switchto "turbulent";
387
388        case "turbulent":
389
390"Outer Side Friction Factor - Turbulent Flow"
391        (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
392
393        when Outer.PressureDrop.Re < 10000 switchto "transition";
394       
395end
396
397switch innerFlowRegime
398       
399        case "laminar":
400       
401"Inner Side Friction Factor for Heat Transfer - laminar Flow"
402        Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
403       
404switch InnerLaminarCorrelation
405       
406        case "Hausen":
407
408"Nusselt Number"
409        Inner.HeatTransfer.Nu = 3.665 + ((0.19*((DiInner/Lpipe)*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR)^0.8)/(1+0.117*((DiInner/Lpipe)*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR)^0.467));
410       
411        case "Schlunder":
412
413"Nusselt Number"
414        Inner.HeatTransfer.Nu = (49.027896+4.173281*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR*(DiInner/Lpipe))^(1/3);
415
416end
417       
418        when Inner.HeatTransfer.Re > 2300 switchto "transition";
419       
420        case "transition":
421       
422"Inner Side Friction Factor for Heat Transfer - transition Flow"
423        Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
424       
425switch InnerTransitionCorrelation
426       
427        case "Gnielinski":
428       
429"Nusselt Number"
430        Inner.HeatTransfer.Nu*(1+(12.7*sqrt(0.125*Inner.HeatTransfer.fi)*((Inner.HeatTransfer.PR)^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi*(Inner.HeatTransfer.Re-1000)*Inner.HeatTransfer.PR;
431
432        case "ESDU":
433
434"Nusselt Number"
435        Inner.HeatTransfer.Nu =1;#to be implemented
436       
437end
438
439        when Inner.HeatTransfer.Re < 2300 switchto "laminar";
440        when Inner.HeatTransfer.Re > 10000 switchto "turbulent";
441
442        case "turbulent":
443
444switch InnerTurbulentCorrelation
445       
446        case "Petukhov":
447       
448"Inner Side Friction Factor for Heat Transfer - turbulent Flow"
449        Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
450
451"Nusselt Number"
452        Inner.HeatTransfer.Nu*(1.07+(12.7*sqrt(0.125*Inner.HeatTransfer.fi)*((Inner.HeatTransfer.PR)^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR;
453       
454        case "SiederTate":
455
456"Nusselt Number"
457        Inner.HeatTransfer.Nu = 0.027*(Inner.HeatTransfer.PR)^(1/3)*(Inner.HeatTransfer.Re)^(4/5);
458
459"Inner Side Friction Factor for Heat Transfer - turbulent Flow"
460        Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
461       
462end
463       
464        when Inner.HeatTransfer.Re < 10000 switchto "transition";
465       
466end
467
468switch outerFlowRegime
469       
470        case "laminar":
471       
472"Outer Side Friction Factor for Heat Transfer - laminar Flow"
473        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
474       
475switch OuterLaminarCorrelation
476       
477        case "Hausen":
478
479"Nusselt Number"
480        Outer.HeatTransfer.Nu = 3.665 + ((0.19*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR)^0.8)/(1+0.117*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR)^0.467));
481       
482        case "Schlunder":
483
484"Nusselt Number"
485        Outer.HeatTransfer.Nu = (49.027896+4.173281*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR*(Outer.HeatTransfer.Dh/Lpipe))^(1/3);
486
487end
488       
489        when Outer.HeatTransfer.Re > 2300 switchto "transition";
490       
491        case "transition":
492       
493switch OuterTransitionCorrelation
494       
495        case "Gnielinski":
496
497"Outer Side Friction Factor for Heat Transfer - transition Flow"
498        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
499
500"Nusselt Number"
501        Outer.HeatTransfer.Nu*(1+(12.7*sqrt(0.125*Outer.HeatTransfer.fi)*((Outer.HeatTransfer.PR)^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi*(Outer.HeatTransfer.Re-1000)*Outer.HeatTransfer.PR;
502
503        case "ESDU":
504
505"Nusselt Number"
506        Outer.HeatTransfer.Nu =1;#to be implemented
507
508"Outer Side Friction Factor for Heat Transfer - transition Flow"
509        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
510       
511end
512       
513        when Outer.HeatTransfer.Re < 2300 switchto "laminar";
514        when Outer.HeatTransfer.Re > 10000 switchto "turbulent";
515       
516        case "turbulent":
517       
518switch OuterTurbulentCorrelation
519       
520        case "Petukhov":
521
522"Outer Side Friction Factor for Heat Transfer - turbulent Flow"
523        Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
524       
525"Nusselt Number"
526        Outer.HeatTransfer.Nu*(1.07+(12.7*sqrt(0.125*Outer.HeatTransfer.fi)*((Outer.HeatTransfer.PR)^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR;
527       
528        case "SiederTate":
529
530"Nusselt Number"
531        Outer.HeatTransfer.Nu = 0.027*(Outer.HeatTransfer.PR)^(1/3)*(Outer.HeatTransfer.Re)^(4/5);
532
533"Outer Side Friction Factor for Heat Transfer - turbulent Flow"
534        Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
535       
536end
537
538        when Outer.HeatTransfer.Re < 10000 switchto "transition";
539
540end
541
542"Inner Pipe Film Coefficient"
543        Inner.HeatTransfer.hcoeff = (Inner.HeatTransfer.Nu*Inner.Properties.Average.K/DiInner)*Inner.HeatTransfer.Phi;
544
545"Outer Pipe Film Coefficient"
546        Outer.HeatTransfer.hcoeff= (Outer.HeatTransfer.Nu*Outer.Properties.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi;
547
548"Pressure Drop Outer Stream"
549        OutletOuter.P  = InletOuter.P - Outer.PressureDrop.Pdrop;
550
551"Pressure Drop Inner Stream"
552        OutletInner.P  = InletInner.P - Inner.PressureDrop.Pdrop;
553       
554"Outer Pipe Pressure Drop for friction"
555        Outer.PressureDrop.Pdrop = (2*Outer.PressureDrop.fi*Lpipe*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
556       
557"Inner Pipe Pressure Drop for friction"
558        Inner.PressureDrop.Pdrop = (2*Inner.PressureDrop.fi*Lpipe*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
559
560"Outer Pipe Phi correction"
561        Outer.HeatTransfer.Phi = (Outer.Properties.Average.Mu/Outer.Properties.Wall.Mu)^0.14;
562       
563"Inner Pipe Phi correction"
564        Inner.HeatTransfer.Phi  = (Inner.Properties.Average.Mu/Inner.Properties.Wall.Mu)^0.14;
565
566"Outer Pipe Prandtl Number"
567        Outer.HeatTransfer.PR = ((Outer.Properties.Average.Cp/Outer.Properties.Average.Mw)*Outer.Properties.Average.Mu)/Outer.Properties.Average.K;
568
569"Inner Pipe Prandtl Number"
570        Inner.HeatTransfer.PR = ((Inner.Properties.Average.Cp/Inner.Properties.Average.Mw)*Inner.Properties.Average.Mu)/Inner.Properties.Average.K;
571
572"Outer Pipe Reynolds Number for Heat Transfer"
573        Outer.HeatTransfer.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Outer.Properties.Average.Mu;
574
575"Outer Pipe Reynolds Number for Pressure Drop"
576        Outer.PressureDrop.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Outer.Properties.Average.Mu;
577
578"Inner Pipe Reynolds Number for Heat Transfer"
579        Inner.HeatTransfer.Re = (Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Inner.Properties.Average.Mu;
580
581"Inner Pipe Reynolds Number for Pressure Drop"
582        Inner.PressureDrop.Re = Inner.HeatTransfer.Re;
583
584"Outer Pipe Velocity"
585        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Outer.Properties.Average.rho)  = Outer.Properties.Inlet.Fw;
586
587"Inner Pipe Velocity"
588        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Inner.Properties.Average.rho)  = Inner.Properties.Inlet.Fw;
589
590"Overall Heat Transfer Coefficient Clean"
591        Details.Uc*((DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
592
593"Overall Heat Transfer Coefficient Dirty"
594        Details.Ud*(Rfi*(DoInner/DiInner) +  Rfo + (DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
595
596end
597
598Model DoublePipe_NTU as DoublePipe_Basic
599
600ATTRIBUTES
601        Pallete = false;
602        Brief  = "Double Pipe Heat Exchanger - NTU Method";
603        Info  =
604        "write some information";
605
606PARAMETERS
607
608FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
609       
610VARIABLES
611
612Method as NTU_Basic     (Brief="NTU Method of Calculation");
613
614EQUATIONS
615
616"Number of Units Transference"
617        Method.NTU*Method.Cmin = Details.Ud*Pi*DoInner*Lpipe;
618       
619"Minimum Heat Capacity"
620        Method.Cmin  = min([Method.Ch,Method.Cc]);
621
622"Maximum Heat Capacity"
623        Method.Cmax  = max([Method.Ch,Method.Cc]);
624
625"Thermal Capacity Ratio"
626        Method.Cr    = Method.Cmin/Method.Cmax;
627
628"Effectiveness Correction"
629        Method.Eft1 = 1;
630
631if Method.Cr equal 0
632       
633        then   
634"Effectiveness"
635        Method.Eft = 1-exp(-Method.NTU);
636       
637        else
638
639switch  FlowDirection
640
641        case "cocurrent":
642       
643"Effectiveness in Cocurrent Flow"
644        Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
645
646        case "counter":
647
648if Method.Cr equal 1
649       
650        then
651       
652"Effectiveness in Counter Flow"
653        Method.Eft = Method.NTU/(1+Method.NTU);
654       
655        else
656       
657"Effectiveness in Counter Flow"
658        Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr)));
659       
660end
661
662end
663
664end
665
666switch HotSide
667       
668        case "outer":
669
670"Duty"
671        Details.Q       = Method.Eft*Method.Cmin*(InletOuter.T-InletInner.T);
672
673"Hot Stream Heat Capacity"
674        Method.Ch  = InletOuter.F*Outer.Properties.Average.Cp;
675       
676"Cold Stream Heat Capacity"
677        Method.Cc = InletInner.F*Inner.Properties.Average.Cp;
678
679        when InletInner.T > InletOuter.T switchto "inner";
680       
681        case "inner":
682
683"Duty"
684        Details.Q       = Method.Eft*Method.Cmin*(InletInner.T-InletOuter.T);
685
686"Cold Stream Heat Capacity"
687        Method.Cc = InletOuter.F*Outer.Properties.Average.Cp;
688       
689"Hot Stream Heat Capacity"
690        Method.Ch = InletInner.F*Inner.Properties.Average.Cp;
691       
692        when InletInner.T < InletOuter.T switchto "outer";
693       
694end
695
696end
697
698Model DoublePipe_LMTD as DoublePipe_Basic
699       
700ATTRIBUTES
701        Pallete = false;
702        Brief  = "Double Pipe Heat Exchanger - LMTD Method";
703        Info  =
704        "write some information";
705
706PARAMETERS
707
708FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
709       
710VARIABLES
711
712Method as LMTD_Basic    (Brief="LMTD Method of Calculation");
713
714EQUATIONS
715
716"Exchange Surface Area"
717        Details.Q = Details.Ud*Pi*DoInner*Lpipe*Method.LMTD;
718       
719"LMTD Correction Factor - True counter ou cocurrent flow"
720        Method.Fc = 1;
721
722switch HotSide
723       
724        case "outer":
725       
726switch FlowDirection
727
728        case "cocurrent":
729       
730"Temperature Difference at Inlet - Cocurrent Flow"
731        Method.DT0 = InletOuter.T - InletInner.T;
732
733"Temperature Difference at Outlet - Cocurrent Flow"
734        Method.DTL = OutletOuter.T - OutletInner.T;
735
736        case "counter":
737       
738"Temperature Difference at Inlet - Counter Flow"
739        Method.DT0 = InletOuter.T - OutletInner.T;
740
741"Temperature Difference at Outlet - Counter Flow"
742        Method.DTL = OutletOuter.T - InletInner.T;
743       
744
745end
746
747        when InletInner.T > InletOuter.T switchto "inner";
748       
749        case "inner":
750
751switch FlowDirection
752
753        case "cocurrent":
754       
755"Temperature Difference at Inlet - Cocurrent Flow"
756        Method.DT0 = InletInner.T - InletOuter.T;
757
758"Temperature Difference at Outlet - Cocurrent Flow"
759        Method.DTL = OutletInner.T - OutletOuter.T;
760       
761        case "counter":
762       
763"Temperature Difference at Inlet - Counter Flow"
764        Method.DT0 = InletInner.T - OutletOuter.T;
765
766"Temperature Difference at Outlet - Counter Flow"
767        Method.DTL = OutletInner.T - InletOuter.T;
768       
769end
770
771        when InletInner.T < InletOuter.T switchto "outer";
772
773end
774
775end
Note: See TracBrowser for help on using the repository browser.