source: mso/eml/heat_exchangers/Mheatex.mso @ 45

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

updated heat exchanger model

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1#*---------------------------------------------------------------------
2* Model of a Multistream Heat Exchanger
3*
4*       Streams:
5*               * Inlet(Ninlet) streams ....    at least one material stream
6*               * Outlet stream             ....        one material stream
7*
8*       Purpose:
9*               * Determines thermal and phase conditions of outlet stream
10*
11*----------------------------------------------------------------------
12* Author: Gerson Balbueno Bicca
13* $Id: Mheatex.mso 45 2006-11-07 16:11:10Z bicca $
14*--------------------------------------------------------------------*#
15
16using "streams.mso";
17
18Model Inlet_Main_Stream         
19#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
20#       Inlet Streams
21#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
22PARAMETERS
23
24        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
25        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
26       
27VARIABLES
28
29        Hot  (Nhot)     as stream;# Inlet Hot Streams
30        Cold (Ncold)    as stream;# Inlet Cold Streams
31       
32end
33
34Model Outlet_Main_Stream       
35#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
36#       Outlet Streams
37#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
38PARAMETERS
39
40        Ncold   as Integer      (Brief="Number of Inlet Cold Streams",Lower=1);
41        Nhot    as Integer      (Brief="Number of Inlet Hot Streams",Lower=1);
42       
43VARIABLES
44
45        Hot  (Nhot)     as stream_therm;# Outlet Hot Streams
46        Cold (Ncold)    as stream_therm;# Outlet Cold Streams
47       
48end
49
50Model Mheatex
51#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
52#       Multistream Heat Exchanger Basic Calculation
53#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
54PARAMETERS
55
56ext PP          as CalcObject   (Brief="Physical Properties");
57ext     NComp   as Integer              (Brief="Number of Components");
58        HE              as CalcObject   (Brief="Cold Box Calculations",File="heatex");
59        Side    as Integer              (Brief="Flow Direction",Lower=0,Upper=1);
60        Ncold   as Integer              (Brief="Number of Inlet Cold Streams",Lower=1);
61        Nhot    as Integer              (Brief="Number of Inlet Hot Streams",Lower=1);
62       
63VARIABLES
64
65in  Inlet       as Inlet_Main_Stream;           # Inlet Hot Streams
66out Outlet      as Outlet_Main_Stream;          # Outlet Hot Streams
67
68        Q       as power                (Brief="Heat Transfer");
69        LMTD    as temp_delta   (Brief="Logarithmic Mean Temperature Difference");
70        UA      as positive     (Unit="W/K");
71
72SET
73
74Side = HE.FlowDir();
75
76Inlet.Ncold  = Ncold;
77Outlet.Ncold = Ncold;
78
79Inlet.Nhot  = Nhot ;
80Outlet.Nhot = Nhot ;
81
82
83EQUATIONS
84
85"Hot Flow"
86        Outlet.Hot.F = Inlet.Hot.F;     
87
88"Cold Flow"
89        Outlet.Cold.F = Inlet.Cold.F;
90       
91"Hot Composition"
92        Outlet.Hot.z = Inlet.Hot.z;
93       
94"Cold Composition"
95        Outlet.Cold.z = Inlet.Cold.z;
96       
97"Vapourisation Fraction Hot Stream"
98        Outlet.Hot.v = Inlet.Hot.v;             
99       
100"Vapourisation Fraction Cold Stream"
101        Outlet.Cold.v = Inlet.Cold.v;   
102       
103"Heat Duty Hot Stream"
104        Q =  sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h));
105       
106"Heat Duty Cold Stream"
107        Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h));
108       
109"Heat Duty"
110        Q=UA*LMTD;
111
112#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
113#       Flow Direction
114#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
115
116if Side equal 0
117       
118        then
119"Cocurrent Flow LMTD"
120        LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T));
121       
122        else
123"Counter Flow LMTD"
124        LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T));
125       
126end
127
128end
Note: See TracBrowser for help on using the repository browser.