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

Last change on this file since 78 was 78, checked in by Paula Bettio Staudt, 16 years ago

Updated heat_exchangers files header

  • Property svn:keywords set to Id
File size: 32.1 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
15*--------------------------------------------------------------------
16* Author: Gerson Balbueno Bicca
17* $Id: DoublePipe.mso 78 2006-12-08 19:29:10Z paula $
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
72
73
74if Inlet.Cold.v equal 0
75        then   
76"Heat Capacity Cold Stream"
77        Properties.Cold.Average.Cp              =       PP.LiquidCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
78        Properties.Cold.Inlet.Cp                =       PP.LiquidCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
79        Properties.Cold.Outlet.Cp               =       PP.LiquidCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
80
81"Mass Density Cold Stream"
82        Properties.Cold.Average.rho     =       PP.LiquidDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
83        Properties.Cold.Inlet.rho               =       PP.LiquidDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
84        Properties.Cold.Outlet.rho              =       PP.LiquidDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
85
86"Viscosity Cold Stream"
87        Properties.Cold.Average.Mu              =       PP.LiquidViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
88        Properties.Cold.Inlet.Mu                =       PP.LiquidViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
89        Properties.Cold.Outlet.Mu               =       PP.LiquidViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
90
91"Conductivity Cold Stream"
92        Properties.Cold.Average.K               =       PP.LiquidThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
93        Properties.Cold.Inlet.K                 =       PP.LiquidThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
94        Properties.Cold.Outlet.K                =       PP.LiquidThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
95
96"Heat Capacity Cold Stream"
97        Properties.Cold.Wall.Cp                 =       PP.LiquidCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
98       
99"Viscosity Cold Stream"
100        Properties.Cold.Wall.Mu                 =       PP.LiquidViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
101
102"Conductivity Cold Stream"
103        Properties.Cold.Wall.K                  =       PP.LiquidThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
104
105
106        else
107
108"Heat Capacity Cold Stream"
109        Properties.Cold.Average.Cp      =       PP.VapourCp(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
110        Properties.Cold.Inlet.Cp        =       PP.VapourCp(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
111        Properties.Cold.Outlet.Cp       =       PP.VapourCp(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
112
113"Mass Density Cold Stream"
114        Properties.Cold.Average.rho     =       PP.VapourDensity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
115        Properties.Cold.Inlet.rho               =       PP.VapourDensity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
116        Properties.Cold.Outlet.rho              =       PP.VapourDensity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
117
118"Viscosity Cold Stream"
119        Properties.Cold.Average.Mu              =       PP.VapourViscosity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
120        Properties.Cold.Inlet.Mu                =       PP.VapourViscosity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
121        Properties.Cold.Outlet.Mu               =       PP.VapourViscosity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
122
123"Conductivity Cold Stream"
124        Properties.Cold.Average.K               =       PP.VapourThermalConductivity(Properties.Cold.Average.T,Properties.Cold.Average.P,Inlet.Cold.z);
125        Properties.Cold.Inlet.K                 =       PP.VapourThermalConductivity(Inlet.Cold.T,Inlet.Cold.P,Inlet.Cold.z);
126        Properties.Cold.Outlet.K                =       PP.VapourThermalConductivity(Outlet.Cold.T,Outlet.Cold.P,Outlet.Cold.z);
127       
128"Heat Capacity Cold Stream"
129        Properties.Cold.Wall.Cp                 =       PP.VapourCp(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
130
131
132"Viscosity Cold Stream"
133        Properties.Cold.Wall.Mu                 =       PP.VapourViscosity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
134
135"Conductivity Cold Stream"
136        Properties.Cold.Wall.K                  =       PP.VapourThermalConductivity(Properties.Cold.Wall.Twall,Properties.Cold.Average.P,Inlet.Cold.z);
137       
138       
139       
140end
141
142if Inlet.Hot.v equal 0
143
144        then
145
146"Heat Capacity Hot Stream"
147        Properties.Hot.Average.Cp       =               PP.LiquidCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
148        Properties.Hot.Inlet.Cp         =               PP.LiquidCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
149        Properties.Hot.Outlet.Cp        =               PP.LiquidCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
150
151"Mass Density Hot Stream"
152        Properties.Hot.Average.rho      =               PP.LiquidDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
153        Properties.Hot.Inlet.rho        =               PP.LiquidDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
154        Properties.Hot.Outlet.rho       =               PP.LiquidDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
155
156"Viscosity Hot Stream"
157        Properties.Hot.Average.Mu       =               PP.LiquidViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);     
158        Properties.Hot.Inlet.Mu         =               PP.LiquidViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);       
159        Properties.Hot.Outlet.Mu        =               PP.LiquidViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);     
160
161"Conductivity Hot Stream"
162        Properties.Hot.Average.K        =               PP.LiquidThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
163        Properties.Hot.Inlet.K          =               PP.LiquidThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
164        Properties.Hot.Outlet.K         =               PP.LiquidThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
165
166"Heat Capacity Hot Stream"
167        Properties.Hot.Wall.Cp          =               PP.LiquidCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
168
169"Viscosity Hot Stream"
170        Properties.Hot.Wall.Mu          =               PP.LiquidViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);     
171
172"Conductivity Hot Stream"
173        Properties.Hot.Wall.K           =               PP.LiquidThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
174       
175
176        else
177
178"Heat Capacity Hot Stream"
179        Properties.Hot.Average.Cp       =               PP.VapourCp(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
180        Properties.Hot.Inlet.Cp         =               PP.VapourCp(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
181        Properties.Hot.Outlet.Cp        =               PP.VapourCp(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
182
183"Mass Density Hot Stream"
184        Properties.Hot.Average.rho      =               PP.VapourDensity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
185        Properties.Hot.Inlet.rho        =               PP.VapourDensity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
186        Properties.Hot.Outlet.rho       =               PP.VapourDensity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
187
188"Viscosity Hot Stream"
189        Properties.Hot.Average.Mu       =               PP.VapourViscosity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);
190        Properties.Hot.Inlet.Mu         =               PP.VapourViscosity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);
191        Properties.Hot.Outlet.Mu        =               PP.VapourViscosity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);
192
193"Conductivity Hot Stream"
194        Properties.Hot.Average.K        =               PP.VapourThermalConductivity(Properties.Hot.Average.T,Properties.Hot.Average.P,Inlet.Hot.z);   
195        Properties.Hot.Inlet.K          =               PP.VapourThermalConductivity(Inlet.Hot.T,Inlet.Hot.P,Inlet.Hot.z);     
196        Properties.Hot.Outlet.K         =               PP.VapourThermalConductivity(Outlet.Hot.T,Outlet.Hot.P,Outlet.Hot.z);   
197
198"Heat Capacity Hot Stream"
199        Properties.Hot.Wall.Cp          =               PP.VapourCp(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
200
201"Viscosity Hot Stream"
202        Properties.Hot.Wall.Mu          =               PP.VapourViscosity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);
203
204"Conductivity Hot Stream"
205        Properties.Hot.Wall.K           =               PP.VapourThermalConductivity(Properties.Hot.Wall.Twall,Properties.Hot.Average.P,Inlet.Hot.z);   
206
207
208end
209
210#=====================================================================
211#       Thermal Details
212#=====================================================================
213"Hot Stream Heat Capacity"
214        Details.Ch =Inlet.Hot.F*Properties.Hot.Average.Cp;
215       
216"Cold Stream Heat Capacity"
217        Details.Cc =Inlet.Cold.F*Properties.Cold.Average.Cp;
218
219"Minimum Heat Capacity"
220        Details.Cmin  = min([Details.Ch,Details.Cc]);
221
222"Maximum Heat Capacity"
223        Details.Cmax  = max([Details.Ch,Details.Cc]);
224
225"Heat Capacity Ratio"   
226        Details.Cr*Details.Cmax   = Details.Cmin;
227#=====================================================================
228#       Energy Balance
229#=====================================================================
230"Energy Balance Hot Stream"
231        Details.Q = Inlet.Hot.F*(Inlet.Hot.h-Outlet.Hot.h);
232
233"Energy Balance Cold Stream"
234        Details.Q = Inlet.Cold.F*(Outlet.Cold.h - Inlet.Cold.h);
235
236#=====================================================================
237#       Material Balance
238#=====================================================================
239"Flow Mass Inlet Cold Stream"
240        Properties.Cold.Inlet.Fw        =  sum(M*Inlet.Cold.z)*Inlet.Cold.F;
241
242"Flow Mass Outlet Cold Stream"
243        Properties.Cold.Outlet.Fw       =  sum(M*Outlet.Cold.z)*Outlet.Cold.F;
244
245"Flow Mass Inlet Hot Stream"
246        Properties.Hot.Inlet.Fw         =  sum(M*Inlet.Hot.z)*Inlet.Hot.F;
247
248"Flow Mass Outlet Hot Stream"   
249        Properties.Hot.Outlet.Fw        =  sum(M*Outlet.Hot.z)*Outlet.Hot.F;
250
251"Molar Balance Hot Stream"
252        Inlet.Hot.F  = Outlet.Hot.F;
253       
254"Molar Balance Cold Stream"
255        Inlet.Cold.F = Outlet.Cold.F;
256
257#======================================
258#       Constraints
259#======================================
260"Hot Stream Molar Fraction Constraint"
261        Outlet.Hot.z=Inlet.Hot.z;
262       
263"Cold Stream Molar Fraction Constraint"
264        Outlet.Cold.z=Inlet.Cold.z;
265       
266"No Phase Change In Cold Stream"
267        Inlet.Cold.v=Outlet.Cold.v;
268
269"No Phase Change In Hot Stream"
270        Inlet.Hot.v=Outlet.Hot.v;
271       
272if Inner.PressureDrop.Re < 2300
273
274        then
275"Inner Side Friction Factor - laminar Flow"
276        Inner.PressureDrop.fi*Inner.PressureDrop.Re = 16;
277
278        else
279"Inner Side Friction Factor - Turbulent Flow"
280        (Inner.PressureDrop.fi-0.0035)*(Inner.PressureDrop.Re^0.42) = 0.264;
281
282end     
283
284
285if Outer.PressureDrop.Re < 2300
286
287        then
288"Inner Side Friction Factor - laminar Flow"
289        Outer.PressureDrop.fi*Outer.PressureDrop.Re = 16;
290
291        else
292"Inner Side Friction Factor - Turbulent Flow"
293        (Outer.PressureDrop.fi - 0.0035)*(Outer.PressureDrop.Re^0.42) = 0.264;
294
295end
296
297"Overall Heat Transfer Coefficient"
298#       Details.U*(Resistances.Rtube+Resistances.Rwall+Resistances.Rshell)=1;
299        Details.U=1/(Resistances.Rtube+Resistances.Rwall+Resistances.Rshell);
300
301end
302
303Model DoublePipe                                        as DoublePipe_Basic
304       
305PARAMETERS
306
307        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
308        Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
309        Hside       as Integer          (Brief="Fluid Alocation Flag-Default:Outer",Lower=0,Upper=1);
310        Side            as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
311        DoInner         as length               (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
312        DiInner         as length               (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
313        DiOuter         as length               (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
314        Lpipe           as length               (Brief="Effective Tube Length",Lower=0.1);
315        Kwall           as conductivity (Brief="Tube Wall Material Thermal Conductivity",Default=1.0);
316       
317SET
318        Pi      = 3.14159265;
319        Hside   = HE.FluidAlocation();
320        Side    = HE.FlowDir();
321
322#"Inner Pipe Cross Sectional Area for Flow"
323        Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
324       
325#"Outer Pipe Cross Sectional Area for Flow"
326        Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter-DoInner*DoInner)/4;
327       
328#"Inner Pipe Hydraulic Diameter for Heat Transfer"
329        Inner.HeatTransfer.Dh=DiInner;
330       
331#"Outer Pipe Hydraulic Diameter for Heat Transfer"
332        Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
333
334#"Inner Pipe Hydraulic Diameter for Pressure Drop"
335        Inner.PressureDrop.Dh=DiInner;
336       
337#"Outer Pipe Hydraulic Diameter for Pressure Drop"
338        Outer.PressureDrop.Dh=DiOuter-DoInner;
339
340EQUATIONS
341
342"Exchange Surface Area"
343        Details.A=Pi*DoInner*Lpipe;
344
345if Hside equal 1
346       
347        then
348       
349"Pressure Drop Hot Stream"
350        Outlet.Hot.P  = Inlet.Hot.P - Outer.PressureDrop.Pdrop;
351
352"Pressure Drop Cold Stream"
353        Outlet.Cold.P  = Inlet.Cold.P - Inner.PressureDrop.Pdrop;
354       
355"Outer Pipe Film Coefficient"
356        Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Outer.HeatTransfer.Re,Outer.HeatTransfer.PR,Properties.Hot.Average.K,Outer.HeatTransfer.Dh,Lpipe)*Outer.HeatTransfer.Phi;
357#       Outer.HeatTransfer.hcoeff= (0.027*Outer.HeatTransfer.Re^(4/5)*Outer.HeatTransfer.PR^(1/3)*Properties.Hot.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi;
358
359"Inner Pipe Film Coefficient"
360        Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Inner.HeatTransfer.Re,Inner.HeatTransfer.PR,Properties.Cold.Average.K,DiInner,Lpipe)*Inner.HeatTransfer.Phi;
361#       Inner.HeatTransfer.hcoeff= (0.027*Inner.HeatTransfer.Re^(4/5)*Inner.HeatTransfer.PR^(1/3)*Properties.Cold.Average.K/DiInner)*Inner.HeatTransfer.Phi;
362
363"Outer Pipe Pressure Drop"
364        Outer.PressureDrop.Pdrop = (2*Outer.PressureDrop.fi*Lpipe*Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
365       
366"Inner Pipe Pressure Drop"
367        Inner.PressureDrop.Pdrop = (2*Inner.PressureDrop.fi*Lpipe*Properties.Cold.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
368
369"Outer Pipe Phi correction"
370        Outer.HeatTransfer.Phi = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
371       
372"Inner Pipe Phi correction"
373        Inner.HeatTransfer.Phi  = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
374
375"Outer Pipe Prandtl Number"
376        Outer.HeatTransfer.PR = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
377
378"Inner Pipe Prandtl Number"
379        Inner.HeatTransfer.PR = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
380
381"Outer Pipe Reynolds Number for Heat Transfer"
382        Outer.HeatTransfer.Re = (Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Properties.Hot.Average.Mu;
383
384"Outer Pipe Reynolds Number for Pressure Drop"
385        Outer.PressureDrop.Re = (Properties.Hot.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Properties.Hot.Average.Mu;
386
387"Inner Pipe Reynolds Number for Heat Transfer"
388        Inner.HeatTransfer.Re = (Properties.Cold.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Properties.Cold.Average.Mu;
389
390"Inner Pipe Reynolds Number for Pressure Drop"
391        Inner.PressureDrop.Re = Inner.HeatTransfer.Re;
392
393"Outer Pipe Velocity"
394        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Properties.Hot.Average.rho)  = Properties.Hot.Inlet.Fw;
395
396"Inner Pipe Velocity"
397        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Properties.Cold.Average.rho)  = Properties.Cold.Inlet.Fw;
398
399        else
400       
401"Pressure Drop Hot Stream"
402        Outlet.Hot.P  = Inlet.Hot.P - Inner.PressureDrop.Pdrop;
403
404"Pressure Drop Cold Stream"
405        Outlet.Cold.P  = Inlet.Cold.P - Outer.PressureDrop.Pdrop;
406       
407"Inner Pipe Film Coefficient"
408        Inner.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Inner.HeatTransfer.Re,Inner.HeatTransfer.PR,Properties.Hot.Average.K,DiInner,Lpipe)*Inner.HeatTransfer.Phi;
409#       Inner.HeatTransfer.hcoeff= (0.027*Inner.HeatTransfer.Re^(4/5)*Inner.HeatTransfer.PR^(1/3)*Properties.Hot.Average.K/DiInner)*Inner.HeatTransfer.Phi;
410
411"Outer Pipe Film Coefficient"
412        Outer.HeatTransfer.hcoeff= HE.PipeFilmCoeff(Outer.HeatTransfer.Re,Outer.HeatTransfer.PR,Properties.Cold.Average.K,Outer.HeatTransfer.Dh,Lpipe)*Outer.HeatTransfer.Phi;
413#       Outer.HeatTransfer.hcoeff= (0.027*Outer.HeatTransfer.Re^(4/5)*Outer.HeatTransfer.PR^(1/3)*Properties.Cold.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi;
414
415"Outer Pipe Pressure Drop"
416        Outer.PressureDrop.Pdrop = (2*Outer.PressureDrop.fi*Lpipe*Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean^2)/(Outer.PressureDrop.Dh*Outer.HeatTransfer.Phi);
417       
418"Inner Pipe Pressure Drop"
419        Inner.PressureDrop.Pdrop        = (2*Inner.PressureDrop.fi*Lpipe*Properties.Hot.Average.rho*Inner.HeatTransfer.Vmean^2)/(DiInner*Inner.HeatTransfer.Phi);
420
421"Outer Pipe Phi correction"
422        Outer.HeatTransfer.Phi          = HE.PhiCorrection(Properties.Cold.Average.Mu,Properties.Cold.Wall.Mu);
423       
424"Inner Pipe Phi correction"
425        Inner.HeatTransfer.Phi          = HE.PhiCorrection(Properties.Hot.Average.Mu,Properties.Hot.Wall.Mu);
426       
427"Outer Pipe Prandtl Number"
428        Outer.HeatTransfer.PR           = ((Properties.Cold.Average.Cp/Properties.Cold.Average.Mw)*Properties.Cold.Average.Mu)/Properties.Cold.Average.K;
429
430"Inner Pipe Prandtl Number"
431        Inner.HeatTransfer.PR           = ((Properties.Hot.Average.Cp/Properties.Hot.Average.Mw)*Properties.Hot.Average.Mu)/Properties.Hot.Average.K;
432
433"Outer Pipe Reynolds Number for Heat Transfer"
434        Outer.HeatTransfer.Re           = (Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Properties.Cold.Average.Mu;
435
436"Outer Pipe Reynolds Number for Pressure Drop"
437        Outer.PressureDrop.Re           = (Properties.Cold.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Properties.Cold.Average.Mu;
438
439"Inner Pipe Reynolds Number for Pressure Drop"
440        Inner.PressureDrop.Re           = Inner.HeatTransfer.Re;
441
442"Inner Pipe Reynolds Number for Heat Transfer"
443        Inner.HeatTransfer.Re           = (Properties.Hot.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Properties.Hot.Average.Mu;
444
445"Outer Pipe Velocity"
446        Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Properties.Cold.Average.rho)= Properties.Cold.Inlet.Fw;
447       
448       
449"Inner Pipe Velocity"
450        Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Properties.Hot.Average.rho)     = Properties.Hot.Inlet.Fw;
451
452end
453
454"Inner Pipe Resistance"
455        Resistances.Rtube*(Inner.HeatTransfer.hcoeff*DiInner) = DoInner;
456       
457"Wall Resistance"
458        Resistances.Rwall*(2*Kwall) = DoInner*ln(DoInner/DiInner);
459
460"Outer Pipe Resistance"
461        Resistances.Rshell*(Outer.HeatTransfer.hcoeff)=1;
462
463
464end
465
466Model DoublePipe_Basic_NTU                      as DoublePipe
467#=====================================================================
468#       Basic Model Double Pipe Heat Exchanger - NTU Method
469#=====================================================================
470VARIABLES
471
472Eft       as positive (Brief="Effectiveness",Default=0.5,Lower=1e-12);
473
474EQUATIONS       
475
476"Energy Balance"
477        Details.Q       = Eft*Details.Cmin*(Inlet.Hot.T-Inlet.Cold.T); 
478
479
480end
481
482Model DoublePipe_Basic_LMTD                     as DoublePipe
483#=====================================================================
484#       Basic Model for Double Pipe Heat Exchanger- LMTD Method
485#=====================================================================
486VARIABLES
487
488DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
489DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
490LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1);
491
492EQUATIONS
493#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
494#                       Log Mean Temperature Difference
495#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
496
497if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
498       
499        then
500"Log Mean Temperature Difference"
501        LMTD*ln(DT0/DTL) = (DT0-DTL);
502
503        else
504       
505if DT0*DTL equal 0
506       
507        then
508"Log Mean Temperature Difference"
509        LMTD = 0.5*(DT0+DTL);
510
511        else
512"Log Mean Temperature Difference"
513        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
514       
515end
516       
517end
518
519"Exchange Surface Area"
520        Details.Q = Details.U*Pi*DoInner*Lpipe*LMTD;
521
522end
523
524Model DoublePipe_LMTD                           as DoublePipe_Basic_LMTD
525
526EQUATIONS
527
528if Side equal 0
529
530        then
531"Temperature Difference at Inlet - Cocurrent Flow"
532        DT0 = Inlet.Hot.T - Inlet.Cold.T;
533
534"Temperature Difference at Outlet - Cocurrent Flow"
535        DTL = Outlet.Hot.T - Outlet.Cold.T;
536
537        else
538"Temperature Difference at Inlet - Counter Flow"
539        DT0 = Inlet.Hot.T - Outlet.Cold.T;
540
541"Temperature Difference at Outlet - Counter Flow"
542        DTL = Outlet.Hot.T - Inlet.Cold.T;
543end
544       
545end
546
547Model DoublePipe_NTU                            as DoublePipe_Basic_NTU
548
549EQUATIONS
550
551if Details.Cr equal 0
552       
553        then   
554"Effectiveness in Cocurrent Flow"
555        Eft = 1-exp(-Details.NTU);
556       
557        else
558
559if Side equal 0
560
561then
562"Effectiveness in Cocurrent Flow"
563        Eft*(1+Details.Cr) = (1-exp(-Details.NTU*(1+Details.Cr)));
564       
565        else
566
567if Details.Cr equal 1
568       
569        then
570"Effectiveness in Counter Flow"
571        Eft*(1+Details.NTU) = Details.NTU;
572       
573        else
574"Effectiveness in Counter Flow"
575        Eft*(1-Details.Cr*exp(-Details.NTU*(1-Details.Cr))) = (1-exp(-Details.NTU*(1-Details.Cr)));
576       
577end
578
579end
580
581
582end
583
584end
585
586Model Multitubular_Basic
587       
588PARAMETERS
589
590        Npipe           as Integer              (Brief="N Pipe in Series",Default=2);
591ext PP                  as CalcObject   (Brief="External Physical Properties");
592        HE              as CalcObject   (Brief="STHE Calculations",File="heatex");
593        Pi                      as constant     (Brief="Pi Number",Default=3.14159265);
594        Hside       as Integer          (Brief="Fluid Alocation Flag-Default:Outer",Lower=0,Upper=1);
595        DoInner         as length               (Brief="Outside Diameter of Inner Pipe",Lower=1e-6);
596        DiInner         as length               (Brief="Inside Diameter of Inner Pipe",Lower=1e-10);
597        DiOuter         as length               (Brief="Inside Diameter of Outer pipe",Lower=1e-10);
598        Lpipe           as length               (Brief="Effective Tube Length",Lower=0.1);
599        Kwall           as conductivity (Brief="Tube Wall Material Thermal Conductivity",Default=1.0);
600
601SET
602        Pi      = 3.14159265;
603        Hside   = HE.FluidAlocation();
604
605VARIABLES
606
607Unity(Npipe)  as DoublePipe_Basic;
608
609EQUATIONS
610
611for i in [1:Npipe]
612
613"Exchange Surface Area"
614        Unity(i).Details.A=Pi*DoInner*Lpipe;
615       
616"Inner Pipe Cross Sectional Area for Flow"
617        Unity(i).Inner.HeatTransfer.As=Pi*DiInner*DiInner/4;
618       
619"Outer Pipe Cross Sectional Area for Flow"
620        Unity(i).Outer.HeatTransfer.As=Pi*(DiOuter*DiOuter-DoInner*DoInner)/4;
621       
622"Inner Pipe Hydraulic Diameter for Heat Transfer"
623        Unity(i).Inner.HeatTransfer.Dh=DiInner;
624       
625"Outer Pipe Hydraulic Diameter for Heat Transfer"
626        Unity(i).Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner;
627
628"Inner Pipe Hydraulic Diameter for Pressure Drop"
629        Unity(i).Inner.PressureDrop.Dh=DiInner;
630       
631"Outer Pipe Hydraulic Diameter for Pressure Drop"
632        Unity(i).Outer.PressureDrop.Dh=DiOuter-DoInner;
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.U*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.