source: mso/eml/heat_exchangers/DoublePipe.mso @ 100

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

updated

  • Property svn:keywords set to Id
File size: 32.8 KB
RevLine 
[100]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 100 2007-01-09 14:15:56Z bicca $
18*------------------------------------------------------------------*#
19
20using "HEX_Engine";
21#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
22#       Basic Models for Double Pipe Heat Exchangers
23#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
24
25Model DoublePipe_Basic
26       
27PARAMETERS
28ext PP          as CalcObject   (Brief="External Physical Properties");
29ext NComp       as Integer      (Brief="Number of Components");
30        M(NComp)        as molweight    (Brief="Component Mol Weight");
31       
32VARIABLES
33
34in  Inlet               as Inlet_Main_Stream;   # Hot and Cold Inlets
35out Outlet              as Outlet_Main_Stream;  # Hot and Cold Outlets
36        Properties      as Main_Properties;             # Hot and Cold Properties
37        Details         as Details_Main;
38        Inner                   as Main_DoublePipe;
39        Outer                   as Main_DoublePipe;
40        Resistances     as Main_Resistances;
41
42SET
43
44        M  = PP.MolecularWeight();
45
46EQUATIONS
47
48"Hot Stream Average Temperature"
49        Properties.Hot.Average.T = 0.5*Inlet.Hot.T + 0.5*Outlet.Hot.T;
50       
51"Cold Stream Average Temperature"
52        Properties.Cold.Average.T = 0.5*Inlet.Cold.T + 0.5*Outlet.Cold.T;
53       
54"Hot Stream Average Pressure"
55        Properties.Hot.Average.P = 0.5*Inlet.Hot.P+0.5*Outlet.Hot.P;
56       
57"Cold Stream Average Pressure"
58        Properties.Cold.Average.P = 0.5*Inlet.Cold.P+0.5*Outlet.Cold.P;
59
60"Cold Stream Wall Temperature"
61        Properties.Cold.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
62
63"Hot Stream Wall Temperature"
64        Properties.Hot.Wall.Twall =   0.5*Properties.Hot.Average.T + 0.5*Properties.Cold.Average.T;
65
66"Hot Stream Average Molecular Weight"
67        Properties.Hot.Average.Mw = sum(M*Inlet.Hot.z);
68
69"Cold Stream Average Molecular Weight"
70        Properties.Cold.Average.Mw = sum(M*Inlet.Cold.z);
71
72if Inlet.Cold.v equal 0
73        then   
74"Heat Capacity Cold Stream"
75        Properties.Cold.Average.Cp              =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
76        Properties.Cold.Inlet.Cp                =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
77        Properties.Cold.Outlet.Cp               =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
78
79"Mass Density Cold Stream"
80        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
81        Properties.Cold.Inlet.rho               =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
82        Properties.Cold.Outlet.rho              =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
83
84"Viscosity Cold Stream"
85        Properties.Cold.Average.Mu              =       PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
86        Properties.Cold.Inlet.Mu                =       PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
87        Properties.Cold.Outlet.Mu               =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
88
89"Conductivity Cold Stream"
90        Properties.Cold.Average.K               =       PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
91        Properties.Cold.Inlet.K                 =       PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
92        Properties.Cold.Outlet.K                =       PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
93
94"Heat Capacity Cold Stream"
95        Properties.Cold.Wall.Cp                 =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
96       
97"Viscosity Cold Stream"
98        Properties.Cold.Wall.Mu                 =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
99
100"Conductivity Cold Stream"
101        Properties.Cold.Wall.K                  =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
102
103
104        else
105
106"Heat Capacity Cold Stream"
107        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
108        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
109        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
110
111"Mass Density Cold Stream"
112        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
113        Properties.Cold.Inlet.rho               =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
114        Properties.Cold.Outlet.rho              =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
115
116"Viscosity Cold Stream"
117        Properties.Cold.Average.Mu              =       PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
118        Properties.Cold.Inlet.Mu                =       PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
119        Properties.Cold.Outlet.Mu               =       PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
120
121"Conductivity Cold Stream"
122        Properties.Cold.Average.K               =       PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
123        Properties.Cold.Inlet.K                 =       PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
124        Properties.Cold.Outlet.K                =       PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
125       
126"Heat Capacity Cold Stream"
127        Properties.Cold.Wall.Cp                 =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
128
129
130"Viscosity Cold Stream"
131        Properties.Cold.Wall.Mu                 =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
132
133"Conductivity Cold Stream"
134        Properties.Cold.Wall.K                  =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
135       
136       
137       
138end
139
140if Inlet.Hot.v equal 0
141
142        then
143
144"Heat Capacity Hot Stream"
145        Properties.Hot.Average.Cp       =               PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
146        Properties.Hot.Inlet.Cp         =               PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
147        Properties.Hot.Outlet.Cp        =               PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
148
149"Mass Density Hot Stream"
150        Properties.Hot.Average.rho      =               PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
151        Properties.Hot.Inlet.rho        =               PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
152        Properties.Hot.Outlet.rho       =               PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
153
154"Viscosity Hot Stream"
155        Properties.Hot.Average.Mu       =               PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);     
156        Properties.Hot.Inlet.Mu         =               PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);       
157        Properties.Hot.Outlet.Mu        =               PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);     
158
159"Conductivity Hot Stream"
160        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
161        Properties.Hot.Inlet.K          =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
162        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
163
164"Heat Capacity Hot Stream"
165        Properties.Hot.Wall.Cp          =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
166
167"Viscosity Hot Stream"
168        Properties.Hot.Wall.Mu          =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
169
170"Conductivity Hot Stream"
171        Properties.Hot.Wall.K           =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
172       
173
174        else
175
176"Heat Capacity Hot Stream"
177        Properties.Hot.Average.Cp       =               PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
178        Properties.Hot.Inlet.Cp         =               PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
179        Properties.Hot.Outlet.Cp        =               PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
180
181"Mass Density Hot Stream"
182        Properties.Hot.Average.rho      =               PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
183        Properties.Hot.Inlet.rho        =               PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
184        Properties.Hot.Outlet.rho       =               PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
185
186"Viscosity Hot Stream"
187        Properties.Hot.Average.Mu       =               PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
188        Properties.Hot.Inlet.Mu         =               PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
189        Properties.Hot.Outlet.Mu        =               PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
190
191"Conductivity Hot Stream"
192        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
193        Properties.Hot.Inlet.K          =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
194        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
195
196"Heat Capacity Hot Stream"
197        Properties.Hot.Wall.Cp          =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
198
199"Viscosity Hot Stream"
200        Properties.Hot.Wall.Mu          =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
201
202"Conductivity Hot Stream"
203        Properties.Hot.Wall.K           =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
204
205
206end
207
208#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
209#       Thermal Details
210#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
211"Hot Stream Heat Capacity"
212        Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp;
213       
214"Cold Stream Heat Capacity"
215        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
216
217"Minimum Heat Capacity"
218        Details.Cmin  = min([Details.Ch,Details.Cc]);
219
220"Maximum Heat Capacity"
221        Details.Cmax  = max([Details.Ch,Details.Cc]);
222
223"Heat Capacity Ratio"   
224        Details.Cr*Details.Cmax   = Details.Cmin;
225#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
226#       Energy Balance
227#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
228"Energy Balance Hot Stream"
229        Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h);
230
231"Energy Balance Cold Stream"
232        Details.Q = Inlet.Cold.F*(Outlet.Cold.h - Inlet.Cold.h);
233
234#--------------------------------------------------------------------
235#       Material Balance
236#--------------------------------------------------------------------
237"Flow Mass Inlet Cold Stream"
238        Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F;
239
240"Flow Mass Outlet Cold Stream"
241        Properties.Cold.Outlet.Fw       =  sum(M*Outlet.Cold.z)*Outlet.Cold.F;
242
243"Flow Mass Inlet Hot Stream"
244        Properties.Hot.Inlet.Fw         =  sum(M*Inlet.Hot.z)*Inlet.Hot.F;
245
246"Flow Mass Outlet Hot Stream"   
247        Properties.Hot.Outlet.Fw        =  sum(M*Outlet.Hot.z)*Outlet.Hot.F;
248
249"Molar Balance Hot Stream"
250        Inlet.Hot.F  = Outlet.Hot.F;
251       
252"Molar Balance Cold Stream"
253        Inlet.Cold.F = Outlet.Cold.F;
254
255#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
256#       Constraints
257#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
258"Hot Stream Molar Fraction Constraint"
259        Outlet.Hot.z=Inlet.Hot.z;
260       
261"Cold Stream Molar Fraction Constraint"
262        Outlet.Cold.z=Inlet.Cold.z;
263       
264"No Phase Change In Cold Stream"
265        Inlet.Cold.v=Outlet.Cold.v;
266
267"No Phase Change In Hot Stream"
268        Inlet.Hot.v=Outlet.Hot.v;
269       
270if Inner.PressureDrop.Re < 2300
271
272        then
273"Inner Side Friction Factor - laminar Flow"
274        Inner.PressureDrop.fi*Inner.PressureDrop.Re = 16;
275
276        else
277"Inner Side Friction Factor - Turbulent Flow"
278        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
279
280end     
281
282
283if Outer.PressureDrop.Re < 2300
284
285        then
286"Inner Side Friction Factor - laminar Flow"
287        Outer.PressureDrop.fi*Outer.PressureDrop.Re = 16;
288
289        else
290"Inner Side Friction Factor - Turbulent Flow"
291        (Outer.PressureDrop.fi - 0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
292
293end
294
295end
296
297Model DoublePipe                                        as DoublePipe_Basic
298       
299PARAMETERS
300
301        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
302        Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
303        Hside       as Integer          (Brief="Fluid Alocation Flag-Default:Outer",Lower=0,Upper=1);
304        Side            as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
305        DoInner         as length               (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
306        DiInner         as length               (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
307        DiOuter         as length               (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
308        Lpipe           as length               (Brief="Effective Tube Length",Lower=0.1);
309        Kwall           as conductivity (Brief="Tube Wall Material Thermal Conductivity",Default=1.0);
310       
311SET
312        Pi      = 3.14159265;
313        Hside   = HE.FluidAlocation();
314        Side    = HE.FlowDir();
315
316#"Inner Pipe Cross Sectional Area for Flow"
317        Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
318       
319#"Outer Pipe Cross Sectional Area for Flow"
320        Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter-DoInner*DoInner)/4;
321       
322#"Inner Pipe Hydraulic Diameter for Heat Transfer"
323        Inner.HeatTransfer.Dh=DiInner;
324       
325#"Outer Pipe Hydraulic Diameter for Heat Transfer"
326        Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
327
328#"Inner Pipe Hydraulic Diameter for Pressure Drop"
329        Inner.PressureDrop.Dh=DiInner;
330       
331#"Outer Pipe Hydraulic Diameter for Pressure Drop"
332        Outer.PressureDrop.Dh=DiOuter-DoInner;
333
334EQUATIONS
335
336"Exchange Surface Area"
337        Details.A=Pi*DoInner*Lpipe;
338
339if Hside equal 1
340       
341        then
342       
343"Pressure Drop Hot Stream"
344        Outlet.Hot.P  = Inlet.Hot.P - Outer.PressureDrop.Pdrop;
345
346"Pressure Drop Cold Stream"
347        Outlet.Cold.P  = Inlet.Cold.P - Inner.PressureDrop.Pdrop;
348       
349"Outer Pipe Film Coefficient"
350        Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Outer.HeatTransfer.Re,Outer.HeatTransfer.PR,Properties.Hot.Average.K,Outer.HeatTransfer.Dh,Lpipe)*Outer.HeatTransfer.Phi;
351
352"Inner Pipe Film Coefficient"
353        Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Inner.HeatTransfer.Re,Inner.HeatTransfer.PR,Properties.Cold.Average.K,DiInner,Lpipe)*Inner.HeatTransfer.Phi;
354
355"Outer Pipe Pressure Drop"
356        Outer.PressureDrop.Pdrop = (2*Outer.PressureDrop.fi*Lpipe*Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
357       
358"Inner Pipe Pressure Drop"
359        Inner.PressureDrop.Pdrop = (2*Inner.PressureDrop.fi*Lpipe*Properties.Cold.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
360
361"Outer Pipe Phi correction"
362        Outer.HeatTransfer.Phi = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
363       
364"Inner Pipe Phi correction"
365        Inner.HeatTransfer.Phi  = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
366
367"Outer Pipe Prandtl Number"
368        Outer.HeatTransfer.PR = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
369
370"Inner Pipe Prandtl Number"
371        Inner.HeatTransfer.PR = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
372
373"Outer Pipe Reynolds Number for Heat Transfer"
374        Outer.HeatTransfer.Re = (Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Properties.Hot.Average.Mu;
375
376"Outer Pipe Reynolds Number for Pressure Drop"
377        Outer.PressureDrop.Re = (Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Properties.Hot.Average.Mu;
378
379"Inner Pipe Reynolds Number for Heat Transfer"
380        Inner.HeatTransfer.Re = (Properties.Cold.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Properties.Cold.Average.Mu;
381
382"Inner Pipe Reynolds Number for Pressure Drop"
383        Inner.PressureDrop.Re = Inner.HeatTransfer.Re;
384
385"Outer Pipe Velocity"
386        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Properties.Hot.Average.rho)  = Properties.Hot.Inlet.Fw;
387
388"Inner Pipe Velocity"
389        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Properties.Cold.Average.rho)  = Properties.Cold.Inlet.Fw;
390
391        else
392       
393"Pressure Drop Hot Stream"
394        Outlet.Hot.P  = Inlet.Hot.P - Inner.PressureDrop.Pdrop;
395
396"Pressure Drop Cold Stream"
397        Outlet.Cold.P  = Inlet.Cold.P - Outer.PressureDrop.Pdrop;
398       
399"Inner Pipe Film Coefficient"
400        Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Inner.HeatTransfer.Re,Inner.HeatTransfer.PR,Properties.Hot.Average.K,DiInner,Lpipe)*Inner.HeatTransfer.Phi;
401
402"Outer Pipe Film Coefficient"
403        Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Outer.HeatTransfer.Re,Outer.HeatTransfer.PR,Properties.Cold.Average.K,Outer.HeatTransfer.Dh,Lpipe)*Outer.HeatTransfer.Phi;
404
405"Outer Pipe Pressure Drop"
406        Outer.PressureDrop.Pdrop = (2*Outer.PressureDrop.fi*Lpipe*Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
407       
408"Inner Pipe Pressure Drop"
409        Inner.PressureDrop.Pdrop        = (2*Inner.PressureDrop.fi*Lpipe*Properties.Hot.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
410
411"Outer Pipe Phi correction"
412        Outer.HeatTransfer.Phi          = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
413       
414"Inner Pipe Phi correction"
415        Inner.HeatTransfer.Phi          = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
416       
417"Outer Pipe Prandtl Number"
418        Outer.HeatTransfer.PR           = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
419
420"Inner Pipe Prandtl Number"
421        Inner.HeatTransfer.PR           = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
422
423"Outer Pipe Reynolds Number for Heat Transfer"
424        Outer.HeatTransfer.Re           = (Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Properties.Cold.Average.Mu;
425
426"Outer Pipe Reynolds Number for Pressure Drop"
427        Outer.PressureDrop.Re           = (Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Properties.Cold.Average.Mu;
428
429"Inner Pipe Reynolds Number for Pressure Drop"
430        Inner.PressureDrop.Re           = Inner.HeatTransfer.Re;
431
432"Inner Pipe Reynolds Number for Heat Transfer"
433        Inner.HeatTransfer.Re           = (Properties.Hot.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Properties.Hot.Average.Mu;
434
435"Outer Pipe Velocity"
436        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Properties.Cold.Average.rho)= Properties.Cold.Inlet.Fw;
437       
438"Inner Pipe Velocity"
439        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Properties.Hot.Average.rho)     = Properties.Hot.Inlet.Fw;
440
441end
442
443"Inner Pipe Resistance"
444        Resistances.Rtube*(Inner.HeatTransfer.hcoeff*DiInner) = DoInner;
445       
446"Wall Resistance"
447        Resistances.Rwall*(2*Kwall) = DoInner*ln(DoInner/DiInner);
448
449"Outer Pipe Resistance"
450        Resistances.Rshell*(Outer.HeatTransfer.hcoeff)=1;
451
452"Overall Heat Transfer Coefficient Clean"
453        Details.Uc*(Resistances.Rtube+Resistances.Rwall+Resistances.Rshell)=1;
454
455"Overall Heat Transfer Coefficient Dirty"
456        Details.Ud*(Resistances.Rfi*(DoInner/DiInner) + Resistances.Rfo + Resistances.Rtube + Resistances.Rwall + Resistances.Rshell)=1;
457       
458end
459
460Model DoublePipe_Basic_NTU                      as DoublePipe
461#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
462#       Basic Model Double Pipe Heat Exchanger - NTU Method
463#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
464VARIABLES
465
466Eft       as positive (Brief="Effectiveness",Default=0.5,Lower=1e-12);
467
468EQUATIONS       
469
470"Energy Balance"
471        Details.Q       = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); 
472
473
474end
475
476Model DoublePipe_Basic_LMTD                     as DoublePipe
477#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
478#       Basic Model for Double Pipe Heat Exchanger- LMTD Method
479#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
480VARIABLES
481
482DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
483DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
484LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
485
486EQUATIONS
487#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
488#                       Log Mean Temperature Difference
489#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
490
491if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
492       
493        then
494"Log Mean Temperature Difference"
495        LMTD*ln(DT0/DTL) = (DT0-DTL);
496
497        else
498       
499if DT0*DTL equal 0
500       
501        then
502"Log Mean Temperature Difference"
503        LMTD = 0.5*(DT0+DTL);
504
505        else
506"Log Mean Temperature Difference"
507        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
508       
509end
510       
511end
512
513"Exchange Surface Area"
514        Details.Q = Details.Ud*Pi*DoInner*Lpipe*LMTD;
515
516end
517
518Model DoublePipe_LMTD                           as DoublePipe_Basic_LMTD
519
520EQUATIONS
521
522if Side equal 0
523
524        then
525"Temperature Difference at Inlet - Cocurrent Flow"
526        DT0 = Inlet.Hot.T - Inlet.Cold.T;
527
528"Temperature Difference at Outlet - Cocurrent Flow"
529        DTL = Outlet.Hot.T - Outlet.Cold.T;
530
531        else
532"Temperature Difference at Inlet - Counter Flow"
533        DT0 = Inlet.Hot.T - Outlet.Cold.T;
534
535"Temperature Difference at Outlet - Counter Flow"
536        DTL = Outlet.Hot.T - Inlet.Cold.T;
537end
538       
539end
540
541Model DoublePipe_NTU                            as DoublePipe_Basic_NTU
542
543EQUATIONS
544
545if Details.Cr equal 0
546       
547        then   
548"Effectiveness"
549        Eft = 1-exp(-Details.NTU);
550       
551        else
552
553if Side equal 0
554
555then
556"Effectiveness in Cocurrent Flow"
557        Eft*(1+Details.Cr) = (1-exp(-Details.NTU*(1+Details.Cr)));
558       
559        else
560
561if Details.Cr equal 1
562       
563        then
564"Effectiveness in Counter Flow"
565        Eft*(1+Details.NTU) = Details.NTU;
566       
567        else
568"Effectiveness in Counter Flow"
569        Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr)));
570       
571end
572
573end
574
575
576end
577
578end
579
580Model Multitubular_Basic
581       
582PARAMETERS
583
584        Npipe           as Integer              (Brief="N Pipe in Series",Default=2);
585ext PP                  as CalcObject   (Brief="External Physical Properties");
586        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
587        Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
588        Hside       as Integer          (Brief="Fluid Alocation Flag-Default:Outer",Lower=0,Upper=1);
589        DoInner         as length               (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
590        DiInner         as length               (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
591        DiOuter         as length               (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
592        Lpipe           as length               (Brief="Effective Tube Length",Lower=0.1);
593        Kwall           as conductivity (Brief="Tube Wall Material Thermal Conductivity",Default=1.0);
594
595VARIABLES
596
597Unity(Npipe)  as DoublePipe_Basic;
598
599SET
600        Pi      = 3.14159265;
601        Hside   = HE.FluidAlocation();
602       
603#"Inner Pipe Cross Sectional Area for Flow"
604        Unity.Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
605       
606#"Outer Pipe Cross Sectional Area for Flow"
607        Unity.Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter-DoInner*DoInner)/4;
608       
609#"Inner Pipe Hydraulic Diameter for Heat Transfer"
610        Unity.Inner.HeatTransfer.Dh=DiInner;
611       
612#"Outer Pipe Hydraulic Diameter for Heat Transfer"
613        Unity.Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
614
615#"Inner Pipe Hydraulic Diameter for Pressure Drop"
616        Unity.Inner.PressureDrop.Dh=DiInner;
617       
618#"Outer Pipe Hydraulic Diameter for Pressure Drop"
619        Unity.Outer.PressureDrop.Dh=DiOuter-DoInner;
620
621EQUATIONS
622
623for i in [1:Npipe]
624
625"Overall Heat Transfer Coefficient Clean"
626        Unity(i).Details.Uc*(Unity(i).Resistances.Rtube+Unity(i).Resistances.Rwall+Unity(i).Resistances.Rshell)=1;
627
628"Overall Heat Transfer Coefficient Dirty"
629        Unity(i).Details.Ud*(Unity(i).Resistances.Rfi*(DoInner/DiInner) + Unity(i).Resistances.Rfo + Unity(i).Resistances.Rtube + Unity(i).Resistances.Rwall + Unity(i).Resistances.Rshell)=1;
630
631"Exchange Surface Area"
632        Unity(i).Details.A=Pi*DoInner*Lpipe;
633       
634if Hside equal 1
635       
636        then
637       
638"Outer Pipe Film Coefficient"
639        Unity(i).Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Unity(i).Outer.HeatTransfer.Re,Unity(i).Outer.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,Unity(i).Outer.HeatTransfer.Dh,Lpipe)*Unity(i).Outer.HeatTransfer.Phi;
640
641"Inner Pipe Film Coefficient"
642        Unity(i).Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Unity(i).Inner.HeatTransfer.Re,Unity(i).Inner.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,DiInner,Lpipe)*Unity(i).Inner.HeatTransfer.Phi;
643
644"Outer Pipe Pressure Drop"
645        Unity(i).Outer.PressureDrop.Pdrop = (2*Unity(i).Outer.PressureDrop.fi*Lpipe*Unity(i).Properties.Hot.Average.rho*Unity(i).Outer.HeatTransfer.Vmean^2)/(Unity(i).Outer.PressureDrop.Dh*Unity(i).Outer.HeatTransfer.Phi);
646       
647"Inner Pipe Pressure Drop"
648        Unity(i).Inner.PressureDrop.Pdrop = (2*Unity(i).Inner.PressureDrop.fi*Lpipe*Unity(i).Properties.Cold.Average.rho*Unity(i).Inner.HeatTransfer.Vmean^2)/(DiInner*Unity(i).Inner.HeatTransfer.Phi);
649
650"Outer Pipe Phi correction"
651        Unity(i).Outer.HeatTransfer.Phi = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu);
652       
653"Inner Pipe Phi correction"
654        Unity(i).Inner.HeatTransfer.Phi  = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
655
656"Outer Pipe Prandtl Number"
657        Unity(i).Outer.HeatTransfer.PR = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K;
658
659"Inner Pipe Prandtl Number"
660        Unity(i).Inner.HeatTransfer.PR = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K;
661
662"Outer Pipe Reynolds Number for Heat Transfer"
663        Unity(i).Outer.HeatTransfer.Re =        (Unity(i).Properties.Hot.Average.rho*Unity(i).Outer.HeatTransfer.Vmean*Unity(i).Outer.HeatTransfer.Dh)/Unity(i).Properties.Hot.Average.Mu;
664
665"Outer Pipe Reynolds Number for Pressure Drop"
666        Unity(i).Outer.PressureDrop.Re =        (Unity(i).Properties.Hot.Average.rho*Unity(i).Outer.HeatTransfer.Vmean*Unity(i).Outer.PressureDrop.Dh)/Unity(i).Properties.Hot.Average.Mu;
667
668"Inner Pipe Reynolds Number for Heat Transfer"
669        Unity(i).Inner.HeatTransfer.Re =        (Unity(i).Properties.Cold.Average.rho*Unity(i).Inner.HeatTransfer.Vmean*Unity(i).Inner.HeatTransfer.Dh)/Unity(i).Properties.Cold.Average.Mu;
670
671"Inner Pipe Reynolds Number for Pressure Drop"
672        Unity(i).Inner.PressureDrop.Re =        Unity(i).Inner.HeatTransfer.Re;
673
674"Outer Pipe Velocity"
675        Unity(i).Outer.HeatTransfer.Vmean  = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Outer.HeatTransfer.As*Unity(i).Properties.Hot.Average.rho);
676
677"Inner Pipe Velocity"
678        Unity(i).Inner.HeatTransfer.Vmean  = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Inner.HeatTransfer.As*Unity(i).Properties.Cold.Average.rho);
679
680        else
681       
682"Inner Pipe Film Coefficient"
683        Unity(i).Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Unity(i).Inner.HeatTransfer.Re,Unity(i).Inner.HeatTransfer.PR,Unity(i).Properties.Hot.Average.K,DiInner,Lpipe)*Unity(i).Inner.HeatTransfer.Phi;
684
685"Outer Pipe Film Coefficient"
686        Unity(i).Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Unity(i).Outer.HeatTransfer.Re,Unity(i).Outer.HeatTransfer.PR,Unity(i).Properties.Cold.Average.K,Unity(i).Outer.HeatTransfer.Dh,Lpipe)*Unity(i).Outer.HeatTransfer.Phi;
687       
688"Outer Pipe Pressure Drop"
689        Unity(i).Outer.PressureDrop.Pdrop = (2*Unity(i).Outer.PressureDrop.fi*Lpipe*Unity(i).Properties.Cold.Average.rho*Unity(i).Outer.HeatTransfer.Vmean^2)/(Unity(i).Outer.PressureDrop.Dh*Unity(i).Outer.HeatTransfer.Phi);
690       
691"Inner Pipe Pressure Drop"
692        Unity(i).Inner.PressureDrop.Pdrop       = (2*Unity(i).Inner.PressureDrop.fi*Lpipe*Unity(i).Properties.Hot.Average.rho*Unity(i).Inner.HeatTransfer.Vmean^2)/(DiInner*Unity(i).Inner.HeatTransfer.Phi);
693
694"Outer Pipe Phi correction"
695        Unity(i).Outer.HeatTransfer.Phi         = HE.PhiCorrection(Unity(i).Properties.Cold.Average.Mu,Unity(i).Properties.Cold.Wall.Mu);
696       
697"Inner Pipe Phi correction"
698        Unity(i).Inner.HeatTransfer.Phi         = HE.PhiCorrection(Unity(i).Properties.Hot.Average.Mu,Unity(i).Properties.Hot.Wall.Mu);
699       
700"Outer Pipe Prandtl Number"
701        Unity(i).Outer.HeatTransfer.PR          = ((Unity(i).Properties.Cold.Average.Cp/Unity(i).Properties.Cold.Average.Mw)*Unity(i).Properties.Cold.Average.Mu)/Unity(i).Properties.Cold.Average.K;
702
703"Inner Pipe Prandtl Number"
704        Unity(i).Inner.HeatTransfer.PR          = ((Unity(i).Properties.Hot.Average.Cp/Unity(i).Properties.Hot.Average.Mw)*Unity(i).Properties.Hot.Average.Mu)/Unity(i).Properties.Hot.Average.K;
705
706"Outer Pipe Reynolds Number for Heat Transfer"
707        Unity(i).Outer.HeatTransfer.Re          = (Unity(i).Properties.Cold.Average.rho*Unity(i).Outer.HeatTransfer.Vmean*Unity(i).Outer.HeatTransfer.Dh)/Unity(i).Properties.Cold.Average.Mu;
708
709"Outer Pipe Reynolds Number for Pressure Drop"
710        Unity(i).Outer.PressureDrop.Re          = (Unity(i).Properties.Cold.Average.rho*Unity(i).Outer.HeatTransfer.Vmean*Unity(i).Outer.PressureDrop.Dh)/Unity(i).Properties.Cold.Average.Mu;
711
712"Inner Pipe Reynolds Number for Pressure Drop"
713        Unity(i).Inner.PressureDrop.Re          = Unity(i).Inner.HeatTransfer.Re;
714
715"Inner Pipe Reynolds Number for Heat Transfer"
716        Unity(i).Inner.HeatTransfer.Re          = (Unity(i).Properties.Hot.Average.rho*Unity(i).Inner.HeatTransfer.Vmean*Unity(i).Inner.HeatTransfer.Dh)/Unity(i).Properties.Hot.Average.Mu;
717
718"Outer Pipe Velocity"
719        Unity(i).Outer.HeatTransfer.Vmean       = Unity(i).Properties.Cold.Inlet.Fw/(Unity(i).Outer.HeatTransfer.As*Unity(i).Properties.Cold.Average.rho);
720
721"Inner Pipe Velocity"
722        Unity(i).Inner.HeatTransfer.Vmean       = Unity(i).Properties.Hot.Inlet.Fw/(Unity(i).Inner.HeatTransfer.As*Unity(i).Properties.Hot.Average.rho);
723
724end
725
726"Inner Pipe Resistance"
727        Unity(i).Resistances.Rtube = DoInner/(Unity(i).Inner.HeatTransfer.hcoeff*DiInner);
728       
729"Wall Resistance"
730        Unity(i).Resistances.Rwall=DoInner*ln(DoInner/DiInner)/(2*Kwall);
731
732"Outer Pipe Resistance"
733        Unity(i).Resistances.Rshell*(Unity(i).Outer.HeatTransfer.hcoeff)=1;
734       
735end
736
737
738end
739
740Model Multitubular_Basic_LMTD           as Multitubular_Basic
741#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
742#       Basic Model for Double Pipe Heat Exchanger- LMTD Method
743#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
744VARIABLES
745
746DT0(Npipe)      as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
747DTL(Npipe)              as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
748LMTD(Npipe)             as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
749
750EQUATIONS
751#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
752#                       Log Mean Temperature Difference
753#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
754for i in [1:Npipe]
755       
756if abs(DT0(i) - DTL(i)) > 0.05*max(abs([DT0(i),DTL(i)]))
757       
758        then
759"Log Mean Temperature Difference"
760        LMTD(i)= (DT0(i)-DTL(i))/ln(DT0(i)/DTL(i));
761
762        else
763       
764if DT0(i)*DTL(i) equal 0
765       
766        then
767"Log Mean Temperature Difference"
768        LMTD(i) = 0.5*(DT0(i)+DTL(i));
769       
770        else
771"Log Mean Temperature Difference"
772        LMTD(i) = 0.5*(DT0(i)+DTL(i))*(1-(DT0(i)-DTL(i))^2/(DT0(i)*DTL(i))*(1+(DT0(i)-DTL(i))^2/(DT0(i)*DTL(i))/2)/12);
773       
774end
775       
776end
777
778"Exchange Surface Area"
779        Unity(i).Details.Q = Unity(i).Details.Ud*Unity(i).Details.A*LMTD(i);
780
781end
782
783end
784
785Model Multitubular_Counter_NTU          as Multitubular_Basic
786
787VARIABLES
788
789Eft(Npipe)        as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8);
790
791CONNECTIONS
792
793Unity([1:Npipe-1]).Outlet.Hot   to Unity([2:Npipe]).Inlet.Hot;
794Unity([2:Npipe]).Outlet.Cold    to Unity([1:Npipe-1]).Inlet.Cold;
795
796EQUATIONS
797
798for i in [1:Npipe]
799
800if Unity(i).Details.Cr equal 0
801       
802        then   
803"Effectiveness"
804        Eft(i) = 1-exp(-Unity(i).Details.NTU);
805       
806        else
807
808if Unity(i).Details.Cr equal 1
809       
810        then
811"Effectiveness in Counter Flow"
812        Eft(i) = Unity(i).Details.NTU/(1+Unity(i).Details.NTU);
813       
814        else
815"Effectiveness in Counter Flow"
816        Eft(i)*(1-Unity(i).Details.Cr*exp(-Unity(i).Details.NTU*(1-Unity(i).Details.Cr))) = (1-exp(-Unity(i).Details.NTU*(1-Unity(i).Details.Cr)));
817       
818end
819
820
821end
822
823"Energy Balance"
824        Unity(i).Details.Q      = Eft(i)*Unity(i).Details.Cmin*(Unity(i).Inlet.Hot.T-Unity(i).Inlet.Cold.T);
825       
826end
827
828end
829
830Model Multitubular_Cocurrent_NTU        as Multitubular_Basic
831
832VARIABLES
833
834Eft(Npipe)        as positive (Brief="Effectiveness",Default=0.05,Lower=1e-8);
835
836CONNECTIONS
837
838Unity([1:Npipe-1]).Outlet.Hot   to Unity([2:Npipe]).Inlet.Hot;
839Unity([1:Npipe-1]).Outlet.Cold  to Unity([2:Npipe]).Inlet.Cold;
840
841EQUATIONS
842
843for i in [1:Npipe]
844
845if Unity(i).Details.Cr equal 0
846       
847        then   
848"Effectiveness"
849        Eft(i) = 1-exp(-Unity(i).Details.NTU);
850       
851        else
852"Effectiveness in Cocurrent Flow"
853        Eft = (1-exp(-Unity(i).Details.NTU*(1+Unity(i).Details.Cr)))/(1+Unity(i).Details.Cr);
854
855end
856
857"Energy Balance"
858        Unity(i).Details.Q      = Eft(i)*Unity(i).Details.Cmin*(Unity(i).Inlet.Hot.T-Unity(i).Inlet.Cold.T);
859       
860end
861
862end
863
864Model Multitubular_Counter_LMTD         as Multitubular_Basic_LMTD
865
866CONNECTIONS
867
868Unity([1:Npipe-1]).Outlet.Hot   to Unity([2:Npipe]).Inlet.Hot;
869Unity([2:Npipe]).Outlet.Cold    to Unity([1:Npipe-1]).Inlet.Cold;
870
871EQUATIONS
872for i in [1:Npipe]
873       
874"Temperature Difference at Inlet - Counter Flow"
875        DT0(i) = Unity(i).Inlet.Hot.T - Unity(i).Outlet.Cold.T;
876
877"Temperature Difference at Outlet - Counter Flow"
878        DTL(i) = Unity(i).Outlet.Hot.T - Unity(i).Inlet.Cold.T;
879       
880end
881
882end
883
884Model Multitubular_Cocurrent_LMTD       as Multitubular_Basic_LMTD
885
886CONNECTIONS
887
888Unity([1:Npipe-1]).Outlet.Hot   to Unity([2:Npipe]).Inlet.Hot;
889Unity([1:Npipe-1]).Outlet.Cold  to Unity([2:Npipe]).Inlet.Cold;
890
891EQUATIONS
892
893for i in [1:Npipe]
894       
895"Temperature Difference at Inlet - Cocurrent Flow"
896        DT0(i) = Unity(i).Inlet.Hot.T - Unity(i).Inlet.Cold.T;
897
898"Temperature Difference at Outlet - Cocurrent Flow"
899        DTL(i) = Unity(i).Outlet.Hot.T - Unity(i).Outlet.Cold.T;
900       
901end
902
903end
Note: See TracBrowser for help on using the repository browser.