source: trunk/eml/heat_exchangers/HEX_Engine.mso @ 1002

Last change on this file since 1002 was 995, checked in by Argimiro Resende Secchi, 6 years ago

Fix negative temperature difference in only one terminal

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.7 KB
Line 
1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
3*
4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*--------------------------------------------------------------------
15* Author: Gerson Balbueno Bicca
16* $Id: HEX_Engine.mso 995 2016-08-30 20:50:48Z arge $
17*--------------------------------------------------------------------*#
18
19using "streams";
20
21Model Properties_Average
22       
23ATTRIBUTES
24        Pallete = false;
25        Brief = "Average physical properties of the streams.";
26        Info =
27        "to be documented.";
28       
29VARIABLES
30Mw              as molweight            (Brief="Average Mol Weight",Default=75, Lower=1, Upper=1e8);
31T                       as temperature          (Brief="Average  Temperature",Lower=50);
32P                       as pressure                     (Brief="Average  Pressure",Default=1, Lower=1e-10, Upper=2e4, DisplayUnit='kPa');
33rho             as dens_mass            (Brief="Stream Density" ,Default=1000, Lower=1e-3, Upper=5e5, Symbol = "\rho");
34Mu              as viscosity            (Brief="Stream Viscosity",Lower=0.0001, Symbol = "\mu");
35Cp              as cp_mol                       (Brief="Stream Molar Heat Capacity", Upper=1e10);
36K                       as conductivity         (Brief="Stream Thermal Conductivity", Default=1.0, Lower=1e-5, Upper=500);
37
38end
39
40Model Properties_In_Out
41       
42ATTRIBUTES
43        Pallete = false;
44        Brief = "Inlet and outlet physical properties of the streams.";
45        Info =
46        "to be documented.";
47       
48VARIABLES
49Fw              as flow_mass            (Brief="Stream Mass Flow");
50rho             as dens_mass            (Brief="Stream Density" ,Default=1000, Lower=1e-3, Upper=5e5, Symbol = "\rho");
51end
52
53Model Properties_Wall
54       
55ATTRIBUTES
56        Pallete = false;
57        Brief = "Physical properties of the streams at wall temperature.";
58        Info =
59        "to be documented.";
60       
61VARIABLES
62
63Mu              as viscosity            (Brief="Stream Viscosity",Default=1, Lower=1e-5, Upper=1e5, Symbol = "\mu");
64Twall           as temperature  (Brief="Wall Temperature",Lower=50);
65
66end
67
68Model Physical_Properties
69       
70ATTRIBUTES
71        Pallete = false;
72        Brief = "to be documented";
73        Info =
74        "to be documented";
75       
76VARIABLES
77
78Inlet           as Properties_In_Out    (Brief="Properties at Inlet Stream", Symbol = "_{in}");
79Average         as Properties_Average   (Brief="Properties at Average Temperature", Symbol = "_{avg}");
80Outlet          as Properties_In_Out    (Brief="Properties at Outlet Stream", Symbol = "_{out}");
81Wall                    as Properties_Wall              (Brief="Properties at Wall Temperature", Symbol = "_{wall}");
82
83end
84
85Model Physical_Properties_Heatex
86       
87ATTRIBUTES
88        Pallete = false;
89        Brief = "to be documented";
90        Info =
91        "to be documented";
92       
93VARIABLES
94
95Mw              as molweight                    (Brief="Average Mol Weight",Default=75, Lower=1, Upper=1e8);
96Cp              as cp_mol                               (Brief="Average Molar Heat Capacity", Upper=1e10);
97Inlet   as Properties_In_Out    (Brief="Properties at Inlet Stream", Symbol = "_{in}");
98Outlet  as Properties_In_Out    (Brief="Properties at Outlet Stream", Symbol = "_{out}");
99
100end
101
102Model Tube_Pdrop
103       
104ATTRIBUTES
105        Pallete = false;
106        Brief = "Pressure drop and velocities in the tube side section of a shell and tube heat exchanger.";
107       
108VARIABLES
109TubeFriction    as press_delta  (Brief="Tube Pressure Drop due to friction", Symbol = "\Delta P_{tube}", Default=0.01, Lower=1E-10,DisplayUnit='kPa');
110InletNozzle     as press_delta  (Brief="Inlet Nozzle Pressure Drop", Symbol = "\Delta P_{Nozzle\_In}", Default=0.01, Lower=0,DisplayUnit='kPa');
111OutletNozzle    as press_delta  (Brief="Outlet Nozzle Pressure Drop", Symbol = "\Delta P_{Nozzle\_Out}", Default=0.01, Lower=0,DisplayUnit='kPa');
112Total                           as press_delta  (Brief="Total Pressure Drop", Symbol = "\Delta P_{total}", Default=0.01, Lower=1E-10,DisplayUnit='kPa');
113Vnozzle_in              as velocity             (Brief="Inlet Nozzle Velocity", Symbol = "V_{Nozzle\_In}", Default=1, Upper=1e5, Lower=0);
114Vnozzle_out     as velocity             (Brief="Outlet Nozzle Velocity", Symbol = "V_{Nozzle\_Out}", Default=1, Upper=1E5, Lower=0);
115FricFactor              as fricfactor           (Brief="Friction Factor", Symbol = "f_i", Default=0.05, Lower=1e-10, Upper=2000);
116
117EQUATIONS
118"Total Pressure Drop"
119        Total = TubeFriction + InletNozzle + OutletNozzle;
120
121end
122
123Model Tube_Heat_Transfer
124       
125ATTRIBUTES
126        Pallete = false;
127        Brief = "to be documented";
128        Info =
129        "to be documented";
130       
131VARIABLES
132Re              as positive                             (Brief="Tube Side Reynolds Number",Default=1000,Lower=1);
133Nu              as positive                             (Brief="Nusselt Number",Default=0.5,Lower=1e-8);
134htube   as heat_trans_coeff (Brief="Tube Side Film Coefficient",Default=1,Lower=1e-12, Upper=1e6);
135fi              as fricfactor                   (Brief="Friction Factor", Default=0.05, Lower=1e-10, Upper=2000);
136PR              as positive                             (Brief="Tube Side Prandtl Number",Default=0.5,Lower=1e-8);
137Phi             as positive                             (Brief="Phi Correction",Default=1,Lower=1e-3);
138Vtube   as velocity                             (Brief="Tube Side Velocity",Lower=1e-8);
139
140end
141
142Model Shell_Pdrop
143       
144ATTRIBUTES
145        Pallete = false;
146        Brief = "Pressure drop and velocities in the shell side section of a shell and tube heat exchanger.";
147       
148VARIABLES
149Ideal                           as press_delta          (Brief="Ideal Pressure Drop", Symbol = "\Delta P_{ideal}", Default=0.01, Lower=0,DisplayUnit='kPa');
150CrossFlow                       as press_delta          (Brief="Cross Flow Pressure Drop", Symbol = "\Delta P_{CrossFlow}", Default=0.01, Lower=0,DisplayUnit='kPa');
151EndZones                        as press_delta          (Brief="End Zones Pressure Drop", Symbol = "\Delta P_{EndZones}", Default=0.01, Lower=0,DisplayUnit='kPa');
152Window                                  as press_delta          (Brief="Window Pressure Drop", Symbol = "\Delta P_{Window}", Default=0.01, Lower=1e-10,DisplayUnit='kPa');
153InletNozzle             as press_delta          (Brief="Inlet Nozzle Pressure Drop", Symbol = "\Delta P_{Nozzle\_In}", Default=0.01, Lower=0,DisplayUnit='kPa');
154OutletNozzle            as press_delta          (Brief="Outlet Nozzle Pressure Drop", Symbol = "\Delta P_{Nozzle\_Out}", Default=0.01, Lower=0,DisplayUnit='kPa');
155Total                                   as press_delta          (Brief="Total Pressure Drop", Symbol = "\Delta P_{Total}", Default=0.01, Lower=0,DisplayUnit='kPa');
156FricFactor              as fricfactor                   (Brief="Friction Factor",  Symbol = "f_i", Default=0.05, Lower=1e-10, Upper=2000);
157Vnozzle_in                      as velocity                     (Brief="Inlet Nozzle Velocity", Symbol = "V_{Nozzle\_In}", Default=1, Upper=1e5, Lower=0);
158Vnozzle_out             as velocity                     (Brief="Outlet Nozzle Velocity", Symbol = "V_{Nozzle\_Out}", Default=1, Upper=1e5, Lower=0);
159RVsquare_out            as positive                     (Brief = "Outlet Nozzle rho-V^2", Default=1, Upper=1e6, Unit = 'kg/s^2/m');
160RVsquare_in             as positive                     (Brief = "Inlet Nozzle rho-V^2", Default=1, Upper=1e6, Unit = 'kg/s^2/m');
161
162EQUATIONS
163"Shell Side Total Pressure Drop"
164        Total = CrossFlow+ EndZones + InletNozzle + OutletNozzle + Window;
165
166end
167
168Model Shell_Heat_Transfer
169       
170ATTRIBUTES
171        Pallete = false;
172        Brief = "to be documented";
173        Info =
174        "to be documented";
175       
176VARIABLES
177Re              as positive                             (Brief="Shell Side Reynolds Number",Default=100,Lower=1E-6);
178PR              as positive                             (Brief="Shell Side Prandtl Number",Default=0.7,Lower=1e-6);
179hshell          as heat_trans_coeff     (Brief="Shell Side Film Coefficient",Default=1,Lower=1e-12, Upper=1e6);
180Phi     as positive                             (Brief="Phi Correction",Default=1,Lower=1e-3);
181end
182
183Model Baffles_Main
184       
185ATTRIBUTES
186        Pallete = false;
187        Brief = "Main variables in the Baffle section of a shell and tube heat exchanger.";
188
189PARAMETERS
190
191BaffleCut                       as Integer      (Brief="Baffle Cut",Default=25,Lower=25);
192NumberOfBaffles     as Real             (Brief="Number of Baffles", Symbol = "N_{baffles}", Lower=1);
193
194VARIABLES
195
196Inlet_Spacing                   as length               (Brief="Inlet Baffle Spacing",Lower=1e-8, Symbol = "L_{si}", DisplayUnit ='mm' );
197Central_Spacing                 as length               (Brief="Central Baffle Spacing",Lower=1e-8, Symbol = "L_s", DisplayUnit ='mm' );
198Outlet_Spacing          as length               (Brief="Outlet Baffle Spacing",Lower=1e-8, Symbol = "L_{so}", DisplayUnit ='mm' );
199
200end
201
202Model Clearances_Main
203       
204ATTRIBUTES
205        Pallete = false;
206        Brief = "Main parameters for diametral clearances in a shell and tube heat exchanger.";
207
208PARAMETERS
209
210SealStrip                               as Integer      (Brief="Number of Sealing Strips pairs",Lower=1);
211Hinozzle_Shell          as length               (Brief="Height Under Shell Inlet Nozzle",Lower=1E-6);
212Honozzle_Shell          as length               (Brief="Height Under Shell Outlet Nozzle",Lower=1E-6);
213BundleToShell           as length               (Brief="Bundle-to-Shell Clearance", Symbol = "L_{cf}", Lower=1E-8);
214BaffleToShell           as length       (Brief="Baffle-to-Shell Clearance", Symbol = "L_{cd}", Lower=1E-8);
215TubeToBaffle            as length       (Brief="Tube-to-Baffle Clearance", Symbol = "L_{td}", Lower=1E-8);
216
217end
218
219Model NTU_Basic
220
221ATTRIBUTES
222        Pallete = false;
223        Brief = "Number of Units Transference Method.";
224        Info =
225        "to be documented";
226
227VARIABLES
228
229Ch              as positive     (Brief="Hot Stream Heat Capacity",Lower=1e-3,Default=1e3,Unit='W/K',Protected=true);
230Cc              as positive     (Brief="Cold Stream Heat Capacity",Lower=1e-3,Default=1e3,Unit='W/K',Protected=true);
231Cr              as positive     (Brief="Heat Capacity Ratio",Default=0.5,Lower=1e-6,Protected=true);
232Cmin    as positive     (Brief="Minimum Heat Capacity",Lower=1e-10,Default=1e3,Unit='W/K',Protected=true);
233Cmax    as positive     (Brief="Maximum Heat Capacity",Lower=1e-10,Default=1e3,Unit='W/K',Protected=true);
234NTU             as positive     (Brief="Number of Units Transference",Default=0.05,Lower=1e-10,Protected=true);
235Eft             as positive     (Brief="Effectiveness",Default=0.5,Lower=1e-8,Upper=1, Symbol ="\varepsilon",Protected=true);
236Eft1            as positive     (Brief="Effectiveness Correction",Lower=1e-8,Default=0.5, Symbol ="\hat {\varepsilon}",Protected=true);
237
238end
239
240Model LMTD_Basic
241
242ATTRIBUTES
243        Pallete = false;
244        Brief = "Log Mean Temperature Difference Method.";
245        Info =
246        "This model should be used as submodel when the LMTD needs to be calculating";
247       
248VARIABLES
249
250DT0             as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1e-6, Symbol ="\Delta T_0",Protected=true);
251DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1e-6, Symbol ="\Delta T_L",Protected=true);
252LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference",Lower=1e-6,Protected=true);
253Fc                      as positive             (Brief="LMTD Correction Factor",Lower=0.1,Protected=true);
254
255EQUATIONS
256
257if DT0*DTL <= 0 * 'K^2' then
258
259"Log Mean Temperature Difference"
260        LMTD = 0.5*(DT0+DTL);
261
262else if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) then
263       
264"Log Mean Temperature Difference"
265        LMTD= (DT0-DTL)/ln(DT0/DTL);
266
267else
268
269"Log Mean Temperature Difference"
270        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
271       
272end
273       
274end
275
276end
277
278Model Details_Main
279       
280ATTRIBUTES
281        Pallete = false;
282        Brief = "to be documented";
283        Info =
284        "to be documented";
285       
286VARIABLES
287A               as area                                 (Brief="Exchange Surface Area");
288Q               as power                                (Brief="Heat Transfer", Default=7000, Lower=1e-6, Upper=1e10);
289Uc      as heat_trans_coeff (Brief="Overall Heat Transfer Coefficient Clean",Default=1,Lower=1e-6,Upper=1e10);
290Ud      as heat_trans_coeff (Brief="Overall Heat Transfer Coefficient Dirty",Default=1,Lower=1e-6,Upper=1e10);
291
292end
293
294Model Tube_Side_Main
295
296ATTRIBUTES
297        Pallete = false;
298        Brief = "Main variables in the Tube Side section of a shell and tube heat exchanger.";
299
300PARAMETERS
301
302NumberOfTubes           as Integer                      (Brief="Total Number of Tubes in Shell",Default=100,Lower=1);
303Tubepasses                      as Integer                      (Brief="Number of Tube Passes", Lower=1);
304TubeLength                              as length                               (Brief="Effective Tube Length",Lower=0.1);
305TubePitch                               as length                               (Brief="Tube Pitch",Lower=1E-8);
306Kwall                                           as conductivity         (Brief="Tube Wall Material Thermal Conductivity");
307TubeOD                                          as length                               (Brief="Tube Outside Diameter",Lower=1E-6);
308TubeID                                  as length                               (Brief="Tube Inside Diameter",Lower=1E-6);
309Fouling                                 as positive                     (Brief="Tubeside Fouling Resistance",Unit='m^2*K/kW', Symbol = "Rf_{tube}", Default=1E-6 , Lower=0);
310InletNozzleID           as length                               (Brief="Inlet Nozzle Inside Diameter", Lower=1E-6);
311OutletNozzleID                  as length                               (Brief="Outlet Nozzle Inside Diameter", Lower=1E-6);
312
313VARIABLES
314
315PressureDrop    as Tube_Pdrop                           (Brief="Tube Side Pressure Drop", Symbol = " ");
316HeatTransfer    as Tube_Heat_Transfer   (Brief="Tube Side Heat Transfer", Symbol = " ");
317Properties              as Physical_Properties          (Brief="Tube Side Properties", Symbol = " ");
318
319end
320
321Model Shell_Side_Main
322       
323ATTRIBUTES
324        Pallete = false;
325        Brief = "Main variables in the Shell Side section of a shell and tube heat exchanger.";
326
327PARAMETERS
328
329ShellID                         as length               (Brief="Inside Shell Diameter",Lower=1E-6);
330Fouling                         as positive     (Brief="Shellside Fouling Resistance",Unit='m^2*K/kW', Symbol = "Rf_{shell}", Default=1E-6 , Lower=0);
331InletNozzleID   as length               (Brief="Inlet Nozzle Inside Diameter", Lower=1E-6);
332OutletNozzleID          as length               (Brief="Outlet Nozzle Inside Diameter", Lower=1E-6);
333
334VARIABLES
335
336PressureDrop    as Shell_Pdrop                                  (Brief="Shell Side Pressure Drop", Symbol = " ");
337HeatTransfer    as Shell_Heat_Transfer          (Brief= "Shell Side Heat Transfer", Symbol = " ");
338Properties              as Physical_Properties          (Brief="ShellSide Properties", Symbol = " ");
339
340end
341
342Model DoublePipe_HeatTransfer
343       
344ATTRIBUTES
345        Pallete = false;
346        Brief = "to be documented";
347        Info =
348        "to be documented";
349       
350PARAMETERS
351As                      as area                                         (Brief="Cross Sectional Area for Flow",Default=0.05,Lower=1e-8);
352Dh              as length                                       (Brief="Hydraulic Diameter of Pipe for Heat Transfer",Lower=1e-8);
353
354VARIABLES
355Re              as positive                             (Brief="Reynolds Number",Default=100,Lower=1);
356hcoeff  as heat_trans_coeff (Brief="Film Coefficient",Default=1,Lower=1e-12, Upper=1e6);
357fi              as fricfactor                   (Brief="Friction Factor", Default=0.05, Lower=1e-10, Upper=2000);
358Nu              as positive                             (Brief="Nusselt Number",Default=0.5,Lower=1e-8);
359PR              as positive                             (Brief="Prandtl Number",Default=0.5,Lower=1e-8);
360Phi             as positive                             (Brief="Phi Correction",Default=1,Lower=1e-3);
361Vmean   as velocity                             (Brief="Tube Velocity",Lower=1e-8);
362
363end
364
365Model DoublePipe_PressureDrop
366       
367ATTRIBUTES
368        Pallete = false;
369        Brief = "to be documented";
370        Info =
371        "to be documented";
372       
373PARAMETERS
374
375Dh      as length               (Brief="Hydraulic Diameter of Pipe for Pressure Drop",Lower=1e-6);
376
377VARIABLES
378
379Pdrop   as press_delta  (Brief="Total Pressure Drop",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P");
380Pd_fric as press_delta  (Brief="Pressure Drop for friction",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P_{fric}");
381Pd_ret  as press_delta  (Brief="Pressure Drop due to return",Default=0.01, Lower=0,DisplayUnit='kPa', Symbol ="\Delta P_{return}");
382fi      as fricfactor   (Brief="Friction Factor", Default=0.05, Lower=1e-10, Upper=2000);
383Re      as positive             (Brief="Reynolds Number",Default=100,Lower=1);
384
385end     
386
387Model Main_DoublePipe
388       
389ATTRIBUTES
390        Pallete = false;
391        Brief = "to be documented";
392        Info =
393        "to be documented";
394       
395VARIABLES
396
397HeatTransfer    as DoublePipe_HeatTransfer      (Brief="Double Pipe Heat Transfer",Symbol=" ");
398PressureDrop    as DoublePipe_PressureDrop      (Brief="Double Pipe Pressure Drop", Symbol=" ");
399Properties      as Physical_Properties                  (Brief="Double Pipe Properties",Symbol=" " );
400
401end
402
Note: See TracBrowser for help on using the repository browser.