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

Last change on this file since 68 was 68, checked in by gerson bicca, 16 years ago

added double pipe heat exchanger model and updated eml/heat_exchangers

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