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

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

improved documentation of double pipe heat exchanger

  • Property svn:keywords set to Id
File size: 24.3 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*--------------------------------------------------------------------
15* Author: Gerson Balbueno Bicca
16* $Id: DoublePipe.mso 442 2008-01-08 17:56:24Z 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        Pi                              as constant             (Brief="Pi Number",Default=3.14159265, Symbol = "\pi");
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 of one segment of Pipe",Lower=0.1, Symbol = "L_{pipe}");
54        Kwall           as conductivity         (Brief="Tube Wall Material Thermal Conductivity",Default=1.0, Symbol = "K_{wall}");
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", PosX=0, PosY=0.5225, Symbol="_{inInner}");
61in  InletOuter          as stream               (Brief="Inlet Outer Stream", PosX=0.2805, PosY=0, Symbol="_{inOuter}");
62out OutletInner         as streamPH     (Brief="Outlet Inner Stream", PosX=1, PosY=0.5225, Symbol="_{outInner}");
63out OutletOuter         as streamPH     (Brief="Outlet Outer Stream", PosX=0.7264, PosY=1, Symbol="_{outOuter}");
64
65        Details         as Details_Main         (Brief="Some Details in the Heat Exchanger", Symbol=" ");
66        Inner                   as Main_DoublePipe      (Brief="Inner Side of the Heat Exchanger", Symbol="_{Inner}");
67        Outer                   as Main_DoublePipe      (Brief="Outer Side of the Heat Exchanger", Symbol="_{Outer}");
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"Average Mass Density Inner Stream"
129        Inner.Properties.Average.rho    =       PP.LiquidDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
130
131"Inlet Mass Density Inner Stream"
132        Inner.Properties.Inlet.rho              =       PP.LiquidDensity(InletInner.T,InletInner.P,InletInner.z);
133
134"Outlet Mass Density Inner Stream"
135        Inner.Properties.Outlet.rho     =       PP.LiquidDensity(OutletInner.T,OutletInner.P,OutletInner.z);
136
137"Average Viscosity Inner Stream"
138        Inner.Properties.Average.Mu     =       PP.LiquidViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
139
140"Average        Conductivity Inner Stream"
141        Inner.Properties.Average.K              =       PP.LiquidThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
142
143"Viscosity Inner Stream at wall temperature"
144        Inner.Properties.Wall.Mu                =       PP.LiquidViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
145
146        else
147
148"Average Heat Capacity InnerStream"
149        Inner.Properties.Average.Cp     =       PP.VapourCp(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
150
151"Average Mass Density Inner Stream"
152        Inner.Properties.Average.rho    =       PP.VapourDensity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
153
154"Inlet Mass Density Inner Stream"
155        Inner.Properties.Inlet.rho              =       PP.VapourDensity(InletInner.T,InletInner.P,InletInner.z);
156       
157"Outlet Mass Density Inner Stream"
158        Inner.Properties.Outlet.rho     =       PP.VapourDensity(OutletInner.T,OutletInner.P,OutletInner.z);
159
160"Average Viscosity Inner Stream"
161        Inner.Properties.Average.Mu     =       PP.VapourViscosity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
162
163"Average Conductivity Inner Stream"
164        Inner.Properties.Average.K              =       PP.VapourThermalConductivity(Inner.Properties.Average.T,Inner.Properties.Average.P,InletInner.z);
165
166"Viscosity Inner Stream at wall temperature"
167        Inner.Properties.Wall.Mu                =       PP.VapourViscosity(Inner.Properties.Wall.Twall,Inner.Properties.Average.P,InletInner.z);
168
169end
170
171if InletOuter.v equal 0
172
173        then
174
175"Average Heat Capacity Outer Stream"
176        Outer.Properties.Average.Cp     =               PP.LiquidCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
177
178"Average Mass Density Outer Stream"
179        Outer.Properties.Average.rho =          PP.LiquidDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
180
181"Inlet Mass Density Outer Stream"
182        Outer.Properties.Inlet.rho              =               PP.LiquidDensity(InletOuter.T,InletOuter.P,InletOuter.z);
183
184"Outlet Mass Density Outer Stream"
185        Outer.Properties.Outlet.rho     =               PP.LiquidDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
186
187"Average Viscosity Outer Stream"
188        Outer.Properties.Average.Mu     =               PP.LiquidViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
189
190"Average Conductivity Outer Stream"
191        Outer.Properties.Average.K      =               PP.LiquidThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
192
193"Viscosity Outer Stream at wall temperature"
194        Outer.Properties.Wall.Mu                =               PP.LiquidViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);       
195
196
197        else
198
199"Average Heat Capacity Outer Stream"
200        Outer.Properties.Average.Cp     =               PP.VapourCp(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
201
202"Average Mass Density Outer Stream"
203        Outer.Properties.Average.rho =          PP.VapourDensity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
204
205"Inlet Mass Density Outer Stream"
206        Outer.Properties.Inlet.rho              =               PP.VapourDensity(InletOuter.T,InletOuter.P,InletOuter.z);
207       
208"Outlet Mass Density Outer Stream"
209        Outer.Properties.Outlet.rho     =               PP.VapourDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z);
210
211"Average Viscosity Outer Stream"
212        Outer.Properties.Average.Mu     =               PP.VapourViscosity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);
213
214"Average Conductivity Outer Stream"
215        Outer.Properties.Average.K      =               PP.VapourThermalConductivity(Outer.Properties.Average.T,Outer.Properties.Average.P,InletOuter.z);       
216
217"Viscosity Outer Stream at wall temperature"
218        Outer.Properties.Wall.Mu                =               PP.VapourViscosity(Outer.Properties.Wall.Twall,Outer.Properties.Average.P,InletOuter.z);
219
220end
221
222switch HotSide
223       
224        case "outer":
225
226"Energy Balance Outer Stream"
227        Details.Q = InletOuter.F*(InletOuter.h-OutletOuter.h);
228
229"Energy Balance Inner Stream"
230        Details.Q = InletInner.F*(OutletInner.h-InletInner.h);
231
232        when InletInner.T > InletOuter.T switchto "inner";
233
234case "inner":
235
236"Energy Balance Hot Stream"
237        Details.Q = InletInner.F*(InletInner.h-OutletInner.h);
238
239"Energy Balance Cold Stream"
240        Details.Q = InletOuter.F*(OutletOuter.h - InletOuter.h);
241
242        when InletInner.T < InletOuter.T switchto "outer";
243
244end
245
246"Flow Mass Inlet Inner Stream"
247        Inner.Properties.Inlet.Fw       =  sum(M*InletInner.z)*InletInner.F;
248
249"Flow Mass Outlet Inner Stream"
250        Inner.Properties.Outlet.Fw      =  sum(M*OutletInner.z)*OutletInner.F;
251
252"Flow Mass Inlet Outer Stream"
253        Outer.Properties.Inlet.Fw               =  sum(M*InletOuter.z)*InletOuter.F;
254
255"Flow Mass Outlet Outer Stream"
256        Outer.Properties.Outlet.Fw      =  sum(M*OutletOuter.z)*OutletOuter.F;
257
258"Molar Balance Outer Stream"
259        OutletOuter.F = InletOuter.F;
260       
261"Molar Balance Inner Stream"
262        OutletInner.F = InletInner.F;
263
264"Outer Stream Molar Fraction Constraint"
265        OutletOuter.z=InletOuter.z;
266       
267"InnerStream Molar Fraction Constraint"
268        OutletInner.z=InletInner.z;
269
270"Exchange Surface Area for one segment of pipe"
271        Details.A=Pi*DoInner*Lpipe;
272
273switch innerFlowRegime
274       
275        case "laminar":
276       
277"Inner Side Friction Factor for Pressure Drop - laminar Flow"
278        Inner.PressureDrop.fi*Inner.PressureDrop.Re = 16;
279       
280        when Inner.PressureDrop.Re > 2300 switchto "transition";
281
282        case "transition":
283       
284"using Turbulent Flow - to be implemented"
285        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
286
287        when Inner.PressureDrop.Re < 2300 switchto "laminar";
288        when Inner.PressureDrop.Re > 10000 switchto "turbulent";
289
290        case "turbulent":
291
292"Inner Side Friction Factor - Turbulent Flow"
293        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
294
295        when Inner.PressureDrop.Re < 10000 switchto "transition";
296       
297end     
298
299switch outerFlowRegime
300       
301        case "laminar":
302       
303"Outer Side Friction Factor - laminar Flow"
304        Outer.PressureDrop.fi*Outer.PressureDrop.Re = 16;
305       
306        when Outer.PressureDrop.Re > 2300 switchto "transition";
307
308        case "transition":
309       
310"using Turbulent Flow - Transition Flow must be implemented"
311        (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
312
313        when Outer.PressureDrop.Re < 2300 switchto "laminar";
314        when Outer.PressureDrop.Re > 10000 switchto "turbulent";
315
316        case "turbulent":
317
318"Outer Side Friction Factor - Turbulent Flow"
319        (Outer.PressureDrop.fi-0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
320
321        when Outer.PressureDrop.Re < 10000 switchto "transition";
322       
323end
324
325switch innerFlowRegime
326       
327        case "laminar":
328       
329"Inner Side Friction Factor for Heat Transfer - laminar Flow"
330        Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
331       
332switch InnerLaminarCorrelation
333       
334        case "Hausen":
335
336"Nusselt Number"
337        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));
338       
339        case "Schlunder":
340
341"Nusselt Number"
342        Inner.HeatTransfer.Nu = (49.027896+4.173281*Inner.HeatTransfer.Re*Inner.HeatTransfer.PR*(DiInner/Lpipe))^(1/3);
343
344end
345       
346        when Inner.HeatTransfer.Re > 2300 switchto "transition";
347       
348        case "transition":
349       
350"Inner Side Friction Factor for Heat Transfer - transition Flow"
351        Inner.HeatTransfer.fi   = 1/(0.79*ln(Inner.HeatTransfer.Re)-1.64)^2;
352       
353switch InnerTransitionCorrelation
354       
355        case "Gnielinski":
356       
357"Nusselt Number"
358        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;
359
360        case "Hausen":
361
362"Nusselt Number"
363        Inner.HeatTransfer.Nu =0.116*(Inner.HeatTransfer.Re^(0.667)-125)*Inner.HeatTransfer.PR^(0.333)*(1+(DiInner/Lpipe)^0.667);
364       
365end
366
367        when Inner.HeatTransfer.Re < 2300 switchto "laminar";
368        when Inner.HeatTransfer.Re > 10000 switchto "turbulent";
369
370        case "turbulent":
371
372switch InnerTurbulentCorrelation
373       
374        case "Petukhov":
375       
376"Inner Side Friction Factor for Heat Transfer - turbulent Flow"
377        Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
378
379"Nusselt Number"
380        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;
381       
382        case "SiederTate":
383
384"Nusselt Number"
385        Inner.HeatTransfer.Nu = 0.027*(Inner.HeatTransfer.PR)^(1/3)*(Inner.HeatTransfer.Re)^(4/5);
386
387"Inner Side Friction Factor for Heat Transfer - turbulent Flow"
388        Inner.HeatTransfer.fi   = 1/(1.82*log(Inner.HeatTransfer.Re)-1.64)^2;
389       
390end
391       
392        when Inner.HeatTransfer.Re < 10000 switchto "transition";
393       
394end
395
396switch outerFlowRegime
397       
398        case "laminar":
399       
400"Outer Side Friction Factor for Heat Transfer - laminar Flow"
401        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
402       
403switch OuterLaminarCorrelation
404       
405        case "Hausen":
406
407"Nusselt Number"
408        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));
409       
410        case "Schlunder":
411
412"Nusselt Number"
413        Outer.HeatTransfer.Nu = (49.027896+4.173281*Outer.HeatTransfer.Re*Outer.HeatTransfer.PR*(Outer.HeatTransfer.Dh/Lpipe))^(1/3);
414
415end
416       
417        when Outer.HeatTransfer.Re > 2300 switchto "transition";
418       
419        case "transition":
420       
421switch OuterTransitionCorrelation
422       
423        case "Gnielinski":
424
425"Outer Side Friction Factor for Heat Transfer - transition Flow"
426        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
427
428"Nusselt Number"
429        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;
430
431        case "Hausen":
432
433"Nusselt Number"
434        Outer.HeatTransfer.Nu = 0.116*(Outer.HeatTransfer.Re^(0.667)-125)*Outer.HeatTransfer.PR^(0.333)*(1+(Outer.HeatTransfer.Dh/Lpipe)^0.667);
435
436
437"Outer Side Friction Factor for Heat Transfer - transition Flow"
438        Outer.HeatTransfer.fi   = 1/(0.79*ln(Outer.HeatTransfer.Re)-1.64)^2;
439       
440end
441       
442        when Outer.HeatTransfer.Re < 2300 switchto "laminar";
443        when Outer.HeatTransfer.Re > 10000 switchto "turbulent";
444       
445        case "turbulent":
446       
447switch OuterTurbulentCorrelation
448       
449        case "Petukhov":
450
451"Outer Side Friction Factor for Heat Transfer - turbulent Flow"
452        Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
453       
454"Nusselt Number"
455        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;
456       
457        case "SiederTate":
458
459"Nusselt Number"
460        Outer.HeatTransfer.Nu = 0.027*(Outer.HeatTransfer.PR)^(1/3)*(Outer.HeatTransfer.Re)^(4/5);
461
462"Outer Side Friction Factor for Heat Transfer - turbulent Flow"
463        Outer.HeatTransfer.fi   = 1/(1.82*log(Outer.HeatTransfer.Re)-1.64)^2;
464       
465end
466
467        when Outer.HeatTransfer.Re < 10000 switchto "transition";
468
469end
470
471"Inner Pipe Film Coefficient"
472        Inner.HeatTransfer.hcoeff = (Inner.HeatTransfer.Nu*Inner.Properties.Average.K/DiInner)*Inner.HeatTransfer.Phi;
473
474"Outer Pipe Film Coefficient"
475        Outer.HeatTransfer.hcoeff= (Outer.HeatTransfer.Nu*Outer.Properties.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi;
476
477"Total Pressure Drop Outer Stream"
478        Outer.PressureDrop.Pdrop  = Outer.PressureDrop.Pd_fric+Outer.PressureDrop.Pd_ret;
479
480"Total Pressure Drop Inner Stream"
481        Inner.PressureDrop.Pdrop  = Inner.PressureDrop.Pd_fric+Inner.PressureDrop.Pd_ret;
482       
483"Pressure Drop Outer Stream"
484        OutletOuter.P  = InletOuter.P - Outer.PressureDrop.Pdrop;
485
486"Pressure Drop Inner Stream"
487        OutletInner.P  = InletInner.P - Inner.PressureDrop.Pdrop;
488       
489"Outer Pipe Pressure Drop for friction"
490        Outer.PressureDrop.Pd_fric = (2*Outer.PressureDrop.fi*Lpipe*Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
491       
492"Inner Pipe Pressure Drop for friction"
493        Inner.PressureDrop.Pd_fric = (2*Inner.PressureDrop.fi*Lpipe*Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
494
495"Outer Pipe Pressure Drop due to return"
496        Outer.PressureDrop.Pd_ret = 0*'kPa';
497
498"Inner Pipe Pressure Drop due to return"
499        Inner.PressureDrop.Pd_ret = 0*'kPa';
500
501"Outer Pipe Phi correction"
502        Outer.HeatTransfer.Phi = (Outer.Properties.Average.Mu/Outer.Properties.Wall.Mu)^0.14;
503       
504"Inner Pipe Phi correction"
505        Inner.HeatTransfer.Phi  = (Inner.Properties.Average.Mu/Inner.Properties.Wall.Mu)^0.14;
506
507"Outer Pipe Prandtl Number"
508        Outer.HeatTransfer.PR = ((Outer.Properties.Average.Cp/Outer.Properties.Average.Mw)*Outer.Properties.Average.Mu)/Outer.Properties.Average.K;
509
510"Inner Pipe Prandtl Number"
511        Inner.HeatTransfer.PR = ((Inner.Properties.Average.Cp/Inner.Properties.Average.Mw)*Inner.Properties.Average.Mu)/Inner.Properties.Average.K;
512
513"Outer Pipe Reynolds Number for Heat Transfer"
514        Outer.HeatTransfer.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Outer.Properties.Average.Mu;
515
516"Outer Pipe Reynolds Number for Pressure Drop"
517        Outer.PressureDrop.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Outer.Properties.Average.Mu;
518
519"Inner Pipe Reynolds Number for Heat Transfer"
520        Inner.HeatTransfer.Re = (Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Inner.Properties.Average.Mu;
521
522"Inner Pipe Reynolds Number for Pressure Drop"
523        Inner.PressureDrop.Re = Inner.HeatTransfer.Re;
524
525"Outer Pipe Velocity"
526        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Outer.Properties.Average.rho)  = Outer.Properties.Inlet.Fw;
527
528"Inner Pipe Velocity"
529        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Inner.Properties.Average.rho)  = Inner.Properties.Inlet.Fw;
530
531"Overall Heat Transfer Coefficient Clean"
532        Details.Uc*((DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
533
534"Overall Heat Transfer Coefficient Dirty"
535        Details.Ud*(Rfi*(DoInner/DiInner) +  Rfo + (DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))=1;
536
537end
538
539Model DoublePipe_NTU as DoublePipe_Basic
540
541ATTRIBUTES
542
543        Icon = "icon/DoublePipe";
544        Pallete = true;
545        Brief  = "Double Pipe Heat Exchanger - NTU Method";
546        Info  =
547"Thermal analysis of double pipe heat exchanger using the NTU Method.
548
549== Specify ==
550* The Inlet Inner stream
551* The Inlet Outer stream
552== Setting Parameters ==
553* Flow Direction:
554** counter flow
555** cocurrent flow (Default)
556* Heat Transfer Correlations:
557** Laminar flow
558*** Hausen (Default)
559*** Schlunder
560** Transition flow
561*** Gnielinski (Default)
562*** Hausen
563** Turbulent flow
564*** Petukhov (Default)
565*** Sieder Tate
566* Geometrical Parameters:
567** DoInner      - Outside Diameter of Inner Pipe
568** DiInner      - Inside Diameter of Inner Pipe
569** DiOuter      - Inside Diameter of Outer pipe
570** Lpipe                - Effective Tube Length of one segment of Pipe
571** Kwall                - Tube Wall Material Thermal Conductivity
572* Fouling:
573**Rfi   -       Inside Fouling Resistance
574**Rfo   -       Outside Fouling Resistance
575";
576
577PARAMETERS
578
579FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
580       
581VARIABLES
582
583Method as NTU_Basic     (Brief="NTU Method of Calculation", Symbol=" ");
584
585EQUATIONS
586
587"Number of Units Transference"
588        Method.NTU*Method.Cmin = Details.Ud*Pi*DoInner*Lpipe;
589       
590"Minimum Heat Capacity"
591        Method.Cmin  = min([Method.Ch,Method.Cc]);
592
593"Maximum Heat Capacity"
594        Method.Cmax  = max([Method.Ch,Method.Cc]);
595
596"Thermal Capacity Ratio"
597        Method.Cr    = Method.Cmin/Method.Cmax;
598
599"Effectiveness Correction"
600        Method.Eft1 = 1;
601
602if Method.Cr equal 0
603       
604        then   
605"Effectiveness"
606        Method.Eft = 1-exp(-Method.NTU);
607       
608        else
609
610switch  FlowDirection
611
612        case "cocurrent":
613       
614"Effectiveness in Cocurrent Flow"
615        Method.Eft = (1-exp(-Method.NTU*(1+Method.Cr)))/(1+Method.Cr);
616
617        case "counter":
618
619if Method.Cr equal 1
620       
621        then
622       
623"Effectiveness in Counter Flow"
624        Method.Eft = Method.NTU/(1+Method.NTU);
625       
626        else
627       
628"Effectiveness in Counter Flow"
629        Method.Eft = (1-exp(-Method.NTU*(1-Method.Cr)))/(1-Method.Cr*exp(-Method.NTU*(1-Method.Cr)));
630       
631end
632
633end
634
635end
636
637switch HotSide
638       
639        case "outer":
640
641"Duty"
642        Details.Q       = Method.Eft*Method.Cmin*(InletOuter.T-InletInner.T);
643
644"Hot Stream Heat Capacity"
645        Method.Ch  = InletOuter.F*Outer.Properties.Average.Cp;
646       
647"Cold Stream Heat Capacity"
648        Method.Cc = InletInner.F*Inner.Properties.Average.Cp;
649
650        when InletInner.T > InletOuter.T switchto "inner";
651       
652        case "inner":
653
654"Duty"
655        Details.Q       = Method.Eft*Method.Cmin*(InletInner.T-InletOuter.T);
656
657"Cold Stream Heat Capacity"
658        Method.Cc = InletOuter.F*Outer.Properties.Average.Cp;
659       
660"Hot Stream Heat Capacity"
661        Method.Ch = InletInner.F*Inner.Properties.Average.Cp;
662       
663        when InletInner.T < InletOuter.T switchto "outer";
664       
665end
666
667end
668
669Model DoublePipe_LMTD as DoublePipe_Basic
670       
671ATTRIBUTES
672
673        Icon = "icon/DoublePipe";
674        Pallete = true;
675        Brief  = "Double Pipe Heat Exchanger - LMTD Method";
676        Info  =
677"Thermal analysis of double pipe heat exchanger using the LMTD Method.
678
679== Specify ==
680* The Inlet Inner stream
681* The Inlet Outer stream
682== Setting Parameters ==
683* Flow Direction:
684** counter flow
685** cocurrent flow (Default)
686* Heat Transfer Correlations:
687** Laminar flow
688*** Hausen (Default)
689*** Schlunder
690** Transition flow
691*** Gnielinski (Default)
692*** Hausen
693** Turbulent flow
694*** Petukhov (Default)
695*** Sieder Tate
696* Geometrical Parameters:
697** DoInner      - Outside Diameter of Inner Pipe
698** DiInner      - Inside Diameter of Inner Pipe
699** DiOuter      - Inside Diameter of Outer pipe
700** Lpipe                - Effective Tube Length of one segment of Pipe
701** Kwall                - Tube Wall Material Thermal Conductivity
702* Fouling:
703**Rfi   -       Inside Fouling Resistance
704**Rfo   -       Outside Fouling Resistance
705";
706
707PARAMETERS
708
709FlowDirection   as Switcher     (Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent");
710       
711VARIABLES
712
713Method as LMTD_Basic    (Brief="LMTD Method of Calculation", Symbol=" ");
714
715EQUATIONS
716
717"Exchange Surface Area"
718        Details.Q = Details.Ud*Pi*DoInner*Lpipe*Method.LMTD;
719       
720"LMTD Correction Factor - True counter ou cocurrent flow"
721        Method.Fc = 1;
722
723switch HotSide
724       
725        case "outer":
726       
727switch FlowDirection
728
729        case "cocurrent":
730       
731"Temperature Difference at Inlet - Cocurrent Flow"
732        Method.DT0 = InletOuter.T - InletInner.T;
733
734"Temperature Difference at Outlet - Cocurrent Flow"
735        Method.DTL = OutletOuter.T - OutletInner.T;
736
737        case "counter":
738       
739"Temperature Difference at Inlet - Counter Flow"
740        Method.DT0 = InletOuter.T - OutletInner.T;
741
742"Temperature Difference at Outlet - Counter Flow"
743        Method.DTL = OutletOuter.T - InletInner.T;
744       
745
746end
747
748        when InletInner.T > InletOuter.T switchto "inner";
749       
750        case "inner":
751
752switch FlowDirection
753
754        case "cocurrent":
755       
756"Temperature Difference at Inlet - Cocurrent Flow"
757        Method.DT0 = InletInner.T - InletOuter.T;
758
759"Temperature Difference at Outlet - Cocurrent Flow"
760        Method.DTL = OutletInner.T - OutletOuter.T;
761       
762        case "counter":
763       
764"Temperature Difference at Inlet - Counter Flow"
765        Method.DT0 = InletInner.T - OutletOuter.T;
766
767"Temperature Difference at Outlet - Counter Flow"
768        Method.DTL = OutletInner.T - InletOuter.T;
769       
770end
771
772        when InletInner.T < InletOuter.T switchto "outer";
773
774end
775
776end
Note: See TracBrowser for help on using the repository browser.