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 | * * Hot Inlet streams .... at least one Hot material stream |
---|
21 | * * Cold Inlet streams .... at least one Cold material stream |
---|
22 | * * Hot Outlet streams .... one material stream for each Hot Inlet |
---|
23 | * * Cold Outlet streams .... one material stream for each Cold Inlet |
---|
24 | * |
---|
25 | * Purpose: |
---|
26 | * * Heat Transfer between multiple hot and cold streams. |
---|
27 | * |
---|
28 | *---------------------------------------------------------------------- |
---|
29 | * Author: Gerson Balbueno Bicca |
---|
30 | * $Id: Mheatex.mso 147 2007-01-31 19:02:46Z bicca $ |
---|
31 | *--------------------------------------------------------------------*# |
---|
32 | |
---|
33 | using "streams.mso"; |
---|
34 | |
---|
35 | Model Inlet_Main_Stream |
---|
36 | |
---|
37 | ATTRIBUTES |
---|
38 | Pallete = false; |
---|
39 | Brief = "Inlet material streams for Hot and Cold side"; |
---|
40 | Info = |
---|
41 | "write some information"; |
---|
42 | |
---|
43 | PARAMETERS |
---|
44 | |
---|
45 | outer Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
46 | outer Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
47 | |
---|
48 | VARIABLES |
---|
49 | |
---|
50 | Hot (Nhot) as stream (Brief="Inlet Hot Streams"); |
---|
51 | Cold (Ncold) as stream (Brief="Inlet Cold Streams"); |
---|
52 | |
---|
53 | end |
---|
54 | |
---|
55 | Model Outlet_Main_Stream |
---|
56 | |
---|
57 | ATTRIBUTES |
---|
58 | Pallete = false; |
---|
59 | Brief = "Outlet material streams for Hot and Cold side"; |
---|
60 | Info = |
---|
61 | "write some information"; |
---|
62 | |
---|
63 | PARAMETERS |
---|
64 | |
---|
65 | outer Ncold as Integer (Brief="Number of Outlet Cold Streams",Lower=1); |
---|
66 | outer Nhot as Integer (Brief="Number of Outlet Hot Streams",Lower=1); |
---|
67 | |
---|
68 | VARIABLES |
---|
69 | |
---|
70 | Hot (Nhot) as streamPH (Brief="Outlet Hot Streams"); |
---|
71 | Cold (Ncold) as streamPH (Brief="Outlet Cold Streams"); |
---|
72 | |
---|
73 | end |
---|
74 | |
---|
75 | Model Mheatex |
---|
76 | |
---|
77 | ATTRIBUTES |
---|
78 | Pallete = true; |
---|
79 | Brief = "Multistream heat exchangers"; |
---|
80 | Info = |
---|
81 | "Heat Transfer between multiple hot and cold streams"; |
---|
82 | |
---|
83 | PARAMETERS |
---|
84 | |
---|
85 | outer PP as Plugin (Brief="Physical Properties"); |
---|
86 | outer NComp as Integer (Brief="Number of Components"); |
---|
87 | FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); |
---|
88 | Ncold as Integer (Brief="Number of Inlet Cold Streams",Lower=1); |
---|
89 | Nhot as Integer (Brief="Number of Inlet Hot Streams",Lower=1); |
---|
90 | |
---|
91 | VARIABLES |
---|
92 | |
---|
93 | in Inlet as Inlet_Main_Stream (Brief="Inlet Streams"); |
---|
94 | out Outlet as Outlet_Main_Stream (Brief="Outlet Streams"); |
---|
95 | |
---|
96 | Q as power (Brief="Heat Transfer"); |
---|
97 | LMTD as temp_delta (Brief="Logarithmic Mean Temperature Difference"); |
---|
98 | UA as positive (Brief="UA product",Unit="W/K"); |
---|
99 | DT0 as temp_delta (Brief="Temperature Difference at Inlet",Lower=1); |
---|
100 | DTL as temp_delta (Brief="Temperature Difference at Outlet",Lower=1); |
---|
101 | |
---|
102 | EQUATIONS |
---|
103 | |
---|
104 | "Hot Flow" |
---|
105 | Outlet.Hot.F = Inlet.Hot.F; |
---|
106 | |
---|
107 | "Cold Flow" |
---|
108 | Outlet.Cold.F = Inlet.Cold.F; |
---|
109 | |
---|
110 | "Hot Composition" |
---|
111 | Outlet.Hot.z = Inlet.Hot.z; |
---|
112 | |
---|
113 | "Cold Composition" |
---|
114 | Outlet.Cold.z = Inlet.Cold.z; |
---|
115 | |
---|
116 | "Heat Duty Hot Stream" |
---|
117 | Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); |
---|
118 | |
---|
119 | "Heat Duty Cold Stream" |
---|
120 | Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); |
---|
121 | |
---|
122 | "Heat Duty" |
---|
123 | Q=UA*LMTD; |
---|
124 | |
---|
125 | |
---|
126 | if abs(DT0 - DTL) > 0.05*max(abs([DT0,DTL])) |
---|
127 | |
---|
128 | then |
---|
129 | "Log Mean Temperature Difference" |
---|
130 | LMTD= (DT0-DTL)/ln(DT0/DTL); |
---|
131 | |
---|
132 | else |
---|
133 | |
---|
134 | if DT0*DTL equal 0 |
---|
135 | |
---|
136 | then |
---|
137 | "Log Mean Temperature Difference" |
---|
138 | LMTD = 0.5*(DT0+DTL); |
---|
139 | |
---|
140 | else |
---|
141 | "Log Mean Temperature Difference" |
---|
142 | LMTD = 0.5*(DT0+DTL)*(1-(DT0-DTL)^2/(DT0*DTL)*(1+(DT0-DTL)^2/(DT0*DTL)/2)/12); |
---|
143 | |
---|
144 | end |
---|
145 | |
---|
146 | end |
---|
147 | |
---|
148 | |
---|
149 | switch FlowDirection |
---|
150 | |
---|
151 | case "cocurrent": |
---|
152 | |
---|
153 | "Temperature Difference at Inlet" |
---|
154 | DT0 = max(Inlet.Hot.T) - min(Inlet.Cold.T); |
---|
155 | |
---|
156 | "Temperature Difference at Outlet" |
---|
157 | DTL = min(Outlet.Hot.T) - max(Outlet.Cold.T); |
---|
158 | |
---|
159 | case "counter": |
---|
160 | |
---|
161 | "Temperature Difference at Inlet" |
---|
162 | DT0 = max(Inlet.Hot.T) - max(Outlet.Cold.T); |
---|
163 | |
---|
164 | "Temperature Difference at Outlet" |
---|
165 | DTL = min(Outlet.Hot.T) - min(Inlet.Cold.T); |
---|
166 | |
---|
167 | end |
---|
168 | |
---|
169 | end |
---|