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 78 2006-12-08 19:29:10Z paula $ |
---|
29 | *--------------------------------------------------------------------*# |
---|
30 | |
---|
31 | using "streams.mso"; |
---|
32 | |
---|
33 | Model Inlet_Main_Stream |
---|
34 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
35 | # Inlet Streams |
---|
36 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
37 | PARAMETERS |
---|
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 | |
---|
42 | VARIABLES |
---|
43 | |
---|
44 | Hot (Nhot) as stream;# Inlet Hot Streams |
---|
45 | Cold (Ncold) as stream;# Inlet Cold Streams |
---|
46 | |
---|
47 | end |
---|
48 | |
---|
49 | Model Outlet_Main_Stream |
---|
50 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
51 | # Outlet Streams |
---|
52 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
53 | PARAMETERS |
---|
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 | |
---|
58 | VARIABLES |
---|
59 | |
---|
60 | Hot (Nhot) as stream_therm;# Outlet Hot Streams |
---|
61 | Cold (Ncold) as stream_therm;# Outlet Cold Streams |
---|
62 | |
---|
63 | end |
---|
64 | |
---|
65 | Model Mheatex |
---|
66 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
67 | # Multistream Heat Exchanger Basic Calculation |
---|
68 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
69 | PARAMETERS |
---|
70 | |
---|
71 | ext PP as CalcObject (Brief="Physical Properties"); |
---|
72 | ext 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 | |
---|
78 | VARIABLES |
---|
79 | |
---|
80 | in Inlet as Inlet_Main_Stream; # Inlet Hot Streams |
---|
81 | out 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 | |
---|
87 | SET |
---|
88 | |
---|
89 | Side = HE.FlowDir(); |
---|
90 | |
---|
91 | Inlet.Ncold = Ncold; |
---|
92 | Outlet.Ncold = Ncold; |
---|
93 | |
---|
94 | Inlet.Nhot = Nhot ; |
---|
95 | Outlet.Nhot = Nhot ; |
---|
96 | |
---|
97 | |
---|
98 | EQUATIONS |
---|
99 | |
---|
100 | "Hot Flow" |
---|
101 | Outlet.Hot.F = Inlet.Hot.F; |
---|
102 | |
---|
103 | "Cold Flow" |
---|
104 | Outlet.Cold.F = Inlet.Cold.F; |
---|
105 | |
---|
106 | "Hot Composition" |
---|
107 | Outlet.Hot.z = Inlet.Hot.z; |
---|
108 | |
---|
109 | "Cold Composition" |
---|
110 | Outlet.Cold.z = Inlet.Cold.z; |
---|
111 | |
---|
112 | "Vapourisation Fraction Hot Stream" |
---|
113 | Outlet.Hot.v = Inlet.Hot.v; |
---|
114 | |
---|
115 | "Vapourisation Fraction Cold Stream" |
---|
116 | Outlet.Cold.v = Inlet.Cold.v; |
---|
117 | |
---|
118 | "Heat Duty Hot Stream" |
---|
119 | Q = sum(Inlet.Hot.F*(Inlet.Hot.h- Outlet.Hot.h)); |
---|
120 | |
---|
121 | "Heat Duty Cold Stream" |
---|
122 | Q = -sum(Inlet.Cold.F*(Inlet.Cold.h- Outlet.Cold.h)); |
---|
123 | |
---|
124 | "Heat Duty" |
---|
125 | Q=UA*LMTD; |
---|
126 | |
---|
127 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
128 | # Flow Direction |
---|
129 | #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# |
---|
130 | |
---|
131 | if Side equal 0 |
---|
132 | |
---|
133 | then |
---|
134 | "Cocurrent Flow LMTD" |
---|
135 | LMTD = HE.CocurrentLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),min(Inlet.Cold.T),max(Outlet.Cold.T)); |
---|
136 | |
---|
137 | else |
---|
138 | "Counter Flow LMTD" |
---|
139 | LMTD = HE.CounterLMTD(max(Inlet.Hot.T),min(Outlet.Hot.T),max(Inlet.Cold.T),min(Outlet.Cold.T)); |
---|
140 | |
---|
141 | end |
---|
142 | |
---|
143 | end |
---|