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 | * Author: Paula B. Staudt |
---|
17 | * $Id: condenser.mso 555 2008-07-18 19:01:13Z rafael $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model condenser |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | Icon = "icon/Condenser"; |
---|
26 | Brief = "Model of a dynamic condenser."; |
---|
27 | Info = |
---|
28 | "== Assumptions == |
---|
29 | * perfect mixing of both phases; |
---|
30 | * thermodynamics equilibrium. |
---|
31 | |
---|
32 | == Specify == |
---|
33 | * the inlet stream; |
---|
34 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
35 | * the heat supply. |
---|
36 | |
---|
37 | == Initial Conditions == |
---|
38 | * the condenser temperature (OutletLiquid.T); |
---|
39 | * the condenser liquid level (Level); |
---|
40 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
41 | "; |
---|
42 | |
---|
43 | PARAMETERS |
---|
44 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
45 | outer NComp as Integer; |
---|
46 | |
---|
47 | V as volume (Brief="Condenser total volume"); |
---|
48 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
49 | |
---|
50 | Initial_Level as length (Brief="Initial Level of liquid phase"); |
---|
51 | Initial_Temperature as temperature (Brief="Initial Temperature of Condenser"); |
---|
52 | Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition"); |
---|
53 | |
---|
54 | VARIABLES |
---|
55 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.15, PosY=0, Symbol="_{inV}"); |
---|
56 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}"); |
---|
57 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}"); |
---|
58 | in InletQ as power (Brief="Cold supplied", PosX=1, PosY=0, Symbol="_{in}"); |
---|
59 | |
---|
60 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
61 | ML as mol (Brief="Molar liquid holdup"); |
---|
62 | MV as mol (Brief="Molar vapour holdup"); |
---|
63 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
64 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
65 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
66 | Level as length (Brief="Level of liquid phase"); |
---|
67 | |
---|
68 | INITIAL |
---|
69 | |
---|
70 | Level = Initial_Level; |
---|
71 | OutletLiquid.T = Initial_Temperature; |
---|
72 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
73 | |
---|
74 | EQUATIONS |
---|
75 | "Component Molar Balance" |
---|
76 | diff(M) = InletVapour.F*InletVapour.z - OutletLiquid.F*OutletLiquid.z- OutletVapour.F*OutletVapour.z; |
---|
77 | |
---|
78 | "Energy Balance" |
---|
79 | diff(E) = InletVapour.F*InletVapour.h - OutletLiquid.F*OutletLiquid.h- OutletVapour.F*OutletVapour.h + InletQ; |
---|
80 | |
---|
81 | "Molar Holdup" |
---|
82 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
83 | |
---|
84 | "Energy Holdup" |
---|
85 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P*V; |
---|
86 | |
---|
87 | "Mol fraction normalisation" |
---|
88 | sum(OutletLiquid.z)=1.0; |
---|
89 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
90 | |
---|
91 | "Liquid Volume" |
---|
92 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
93 | |
---|
94 | "Vapour Volume" |
---|
95 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
96 | |
---|
97 | "Chemical Equilibrium" |
---|
98 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = |
---|
99 | PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
100 | |
---|
101 | "Thermal Equilibrium" |
---|
102 | OutletLiquid.T = OutletVapour.T; |
---|
103 | |
---|
104 | "Mechanical Equilibrium" |
---|
105 | OutletVapour.P = OutletLiquid.P; |
---|
106 | |
---|
107 | "Geometry Constraint" |
---|
108 | V = ML*vL + MV*vV; |
---|
109 | |
---|
110 | "Level of liquid phase" |
---|
111 | Level = ML*vL/Across; |
---|
112 | |
---|
113 | end |
---|
114 | |
---|
115 | |
---|
116 | #*---------------------------------------------------------------------- |
---|
117 | * Model of a Steady State condenser with no thermodynamics equilibrium |
---|
118 | *---------------------------------------------------------------------*# |
---|
119 | Model condenserSteady |
---|
120 | ATTRIBUTES |
---|
121 | Pallete = true; |
---|
122 | Icon = "icon/CondenserSteady"; |
---|
123 | Brief = "Model of a Steady State condenser with no thermodynamics equilibrium."; |
---|
124 | Info = |
---|
125 | "== Assumptions == |
---|
126 | * perfect mixing of both phases; |
---|
127 | * no thermodynamics equilibrium. |
---|
128 | |
---|
129 | == Specify == |
---|
130 | * the inlet stream; |
---|
131 | * the pressure drop in the condenser; |
---|
132 | * the heat supply. |
---|
133 | "; |
---|
134 | |
---|
135 | PARAMETERS |
---|
136 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
137 | outer NComp as Integer; |
---|
138 | |
---|
139 | VARIABLES |
---|
140 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.3431, PosY=0, Symbol="_{inV}"); |
---|
141 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.34375, PosY=1, Symbol="_{outL}"); |
---|
142 | in InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.5974, Symbol="_{in}"); |
---|
143 | DP as press_delta (Brief="Pressure Drop in the condenser",Default=0); |
---|
144 | |
---|
145 | EQUATIONS |
---|
146 | |
---|
147 | "Molar Balance" |
---|
148 | InletVapour.F = OutletLiquid.F; |
---|
149 | InletVapour.z = OutletLiquid.z; |
---|
150 | |
---|
151 | "Energy Balance" |
---|
152 | InletVapour.F*InletVapour.h = OutletLiquid.F*OutletLiquid.h + InletQ; |
---|
153 | |
---|
154 | "Pressure" |
---|
155 | DP = InletVapour.P - OutletLiquid.P; |
---|
156 | |
---|
157 | end |
---|
158 | |
---|
159 | #*------------------------------------------------------------------- |
---|
160 | * Condenser with reaction in liquid phase |
---|
161 | *--------------------------------------------------------------------*# |
---|
162 | Model condenserReact |
---|
163 | ATTRIBUTES |
---|
164 | Pallete = false; |
---|
165 | Icon = "icon/Condenser"; |
---|
166 | Brief = "Model of a Condenser with reaction in liquid phase."; |
---|
167 | Info = |
---|
168 | "== Assumptions == |
---|
169 | * perfect mixing of both phases; |
---|
170 | * thermodynamics equilibrium; |
---|
171 | * the reaction only takes place in liquid phase. |
---|
172 | |
---|
173 | == Specify == |
---|
174 | * the reaction related variables; |
---|
175 | * the inlet stream; |
---|
176 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
177 | * the heat supply. |
---|
178 | |
---|
179 | == Initial Conditions == |
---|
180 | * the condenser temperature (OutletLiquid.T); |
---|
181 | * the condenser liquid level (Level); |
---|
182 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
183 | "; |
---|
184 | |
---|
185 | PARAMETERS |
---|
186 | outer PP as Plugin(Type="PP"); |
---|
187 | outer NComp as Integer; |
---|
188 | |
---|
189 | V as volume (Brief="Condenser total volume"); |
---|
190 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
191 | |
---|
192 | stoic(NComp) as Real (Brief="Stoichiometric matrix"); |
---|
193 | Hr as energy_mol; |
---|
194 | Initial_Level as length (Brief="Initial Level of liquid phase"); |
---|
195 | Initial_Temperature as temperature (Brief="Initial Temperature of Condenser"); |
---|
196 | Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition"); |
---|
197 | |
---|
198 | VARIABLES |
---|
199 | |
---|
200 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}"); |
---|
201 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}"); |
---|
202 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}"); |
---|
203 | InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}"); |
---|
204 | |
---|
205 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
206 | ML as mol (Brief="Molar liquid holdup"); |
---|
207 | MV as mol (Brief="Molar vapour holdup"); |
---|
208 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
209 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
210 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
211 | Level as length (Brief="Level of liquid phase"); |
---|
212 | Vol as volume; |
---|
213 | r3 as reaction_mol (Brief="Reaction Rates", DisplayUnit = 'mol/l/s'); |
---|
214 | C(NComp) as conc_mol (Brief="Molar concentration", Lower = -1); |
---|
215 | |
---|
216 | INITIAL |
---|
217 | |
---|
218 | Level = Initial_Level; |
---|
219 | OutletLiquid.T = Initial_Temperature; |
---|
220 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
221 | |
---|
222 | EQUATIONS |
---|
223 | "Molar Concentration" |
---|
224 | OutletLiquid.z = vL * C; |
---|
225 | |
---|
226 | "Reaction" |
---|
227 | r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; |
---|
228 | |
---|
229 | "Component Molar Balance" |
---|
230 | diff(M) = InletVapour.F*InletVapour.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL; |
---|
231 | |
---|
232 | "Energy Balance" |
---|
233 | diff(E) = InletVapour.F*InletVapour.h - OutletLiquid.F*OutletLiquid.h- OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * ML*vL; |
---|
234 | |
---|
235 | "Molar Holdup" |
---|
236 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
237 | |
---|
238 | "Energy Holdup" |
---|
239 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P*V; |
---|
240 | |
---|
241 | "Mol fraction normalisation" |
---|
242 | sum(OutletLiquid.z)=1.0; |
---|
243 | |
---|
244 | "Liquid Volume" |
---|
245 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
246 | |
---|
247 | "Vapour Volume" |
---|
248 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
249 | |
---|
250 | "Thermal Equilibrium" |
---|
251 | OutletLiquid.T = OutletVapour.T; |
---|
252 | |
---|
253 | "Mechanical Equilibrium" |
---|
254 | OutletVapour.P = OutletLiquid.P; |
---|
255 | |
---|
256 | "Geometry Constraint" |
---|
257 | V = ML*vL + MV*vV; |
---|
258 | |
---|
259 | Vol = ML*vL; |
---|
260 | |
---|
261 | "Level of liquid phase" |
---|
262 | Level = ML*vL/Across; |
---|
263 | |
---|
264 | "Chemical Equilibrium" |
---|
265 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = |
---|
266 | PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
267 | |
---|
268 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
269 | |
---|
270 | end |
---|