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

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

added sample with the option to solve a convergence problem

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