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

Last change on this file since 4 was 1, checked in by Rafael de Pelegrini Soares, 17 years ago

Initial import of the library

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