source: trunk/eml/heat_exchangers/Mheatex.mso @ 120

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

updated Mheatex model

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 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*---------------------------------------------------------------------
17* Model of a Multistream Heat Exchanger
18*
19*       Streams:
20*               * Inlet(Ninlet) streams ....    at least one material stream
21*               * Outlet stream             ....        one material stream
22*
23*       Purpose:
24*               * Determines thermal and phase conditions of outlet stream
25*
26*----------------------------------------------------------------------
27* Author: Gerson Balbueno Bicca
28* $Id: Mheatex.mso 120 2007-01-17 20:11:19Z bicca $
29*--------------------------------------------------------------------*#
30
31using "streams.mso";
32
33Model Inlet_Main_Stream         
34#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
35#       Inlet Streams
36#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
37PARAMETERS
38
39        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
40        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
41       
42VARIABLES
43
44        Hot  (Nhot)     as stream;# Inlet Hot Streams
45        Cold (Ncold)    as stream;# Inlet Cold Streams
46       
47end
48
49Model Outlet_Main_Stream       
50#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
51#       Outlet Streams
52#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
53PARAMETERS
54
55        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
56        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
57       
58VARIABLES
59
60        Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
61        Cold (Ncold)    as stream_therm;# Outlet Cold Streams
62       
63end
64
65Model Mheatex
66#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
67#       Multistream Heat Exchanger Basic Calculation
68#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
69PARAMETERS
70
71ext PP          as CalcObject   (Brief="Physical Properties");
72ext     NComp   as Integer              (Brief="Number of Components");
73        HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
74        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
75        Ncold   as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
76        Nhot    as Integer              (Brief="Number of Inlet Hot Streams",Lower=1);
77       
78VARIABLES
79
80in  Inlet       as Inlet_Main_Stream;           # Inlet Hot Streams
81out Outlet      as Outlet_Main_Stream;          # Outlet Hot Streams
82
83        Q       as power                (Brief="Heat Transfer");
84        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
85        UA      as positive     (Unit="W/K");
86        DT0     as temp_delta   (Brief="Temperature Difference at Inlet",Lower=1);
87        DTL             as temp_delta   (Brief="Temperature Difference at Outlet",Lower=1);
88       
89SET
90
91# Flow Direction
92        Side = HE.FlowDir();
93
94# Inlet Ncold Parameters
95        Inlet.Ncold  = Ncold;
96       
97# Outlet Ncold Parameters
98        Outlet.Ncold = Ncold;
99
100# Inlet Nhot Parameters
101        Inlet.Nhot  = Nhot;
102       
103# Outlet Nhot Parameters
104        Outlet.Nhot = Nhot ;
105
106EQUATIONS
107
108"Hot Flow"
109        Outlet.Hot.F = Inlet.Hot.F;     
110
111"Cold Flow"
112        Outlet.Cold.F = Inlet.Cold.F;
113       
114"Hot Composition"
115        Outlet.Hot.z = Inlet.Hot.z;
116       
117"Cold Composition"
118        Outlet.Cold.z = Inlet.Cold.z;
119       
120"Vapourisation Fraction Hot Stream"
121        Outlet.Hot.v = Inlet.Hot.v;             
122       
123"Vapourisation Fraction Cold Stream"
124        Outlet.Cold.v = Inlet.Cold.v;   
125       
126"Heat Duty Hot Stream"
127        Q =  sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h));
128       
129"Heat Duty Cold Stream"
130        Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h));
131       
132"Heat Duty"
133        Q=UA*LMTD;
134
135       
136if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL]))
137       
138        then
139"Log Mean Temperature Difference"
140        LMTD= (DT0-DTL)/ln(DT0/DTL);
141
142        else
143       
144if DT0*DTL equal 0
145       
146        then
147"Log Mean Temperature Difference"
148        LMTD = 0.5*(DT0+DTL);
149       
150        else
151"Log Mean Temperature Difference"
152        LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12);
153       
154end
155       
156end     
157
158
159if Side equal 0
160       
161        then
162       
163"Temperature Difference at Inlet"
164        DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T);
165
166"Temperature Difference at Outlet"
167        DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T);
168       
169        else
170       
171"Temperature Difference at Inlet"
172        DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T);
173
174"Temperature Difference at Outlet"
175        DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T);
176       
177end
178
179end
Note: See TracBrowser for help on using the repository browser.