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 condenserSteady |
---|
23 | |
---|
24 | ATTRIBUTES |
---|
25 | Pallete = true; |
---|
26 | Icon = "icon/CondenserSteady"; |
---|
27 | Brief = "Model of a Steady State condenser with no thermodynamics equilibrium."; |
---|
28 | Info = |
---|
29 | "== ASSUMPTIONS == |
---|
30 | * perfect mixing of both phases; |
---|
31 | * no thermodynamics equilibrium. |
---|
32 | |
---|
33 | == SET == |
---|
34 | * the pressure drop in the condenser; |
---|
35 | |
---|
36 | == SPECIFY == |
---|
37 | * the InletVapour stream; |
---|
38 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model). |
---|
39 | |
---|
40 | == OPTIONAL == |
---|
41 | * the condenser model has two control ports |
---|
42 | ** TI OutletLiquid Temperature Indicator; |
---|
43 | ** PI OutletLiquid Pressure Indicator; |
---|
44 | "; |
---|
45 | |
---|
46 | PARAMETERS |
---|
47 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
48 | outer NComp as Integer (Brief = "Number of Components"); |
---|
49 | |
---|
50 | Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P"); |
---|
51 | |
---|
52 | VARIABLES |
---|
53 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}"); |
---|
54 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}"); |
---|
55 | in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true); |
---|
56 | |
---|
57 | Tbubble as temperature (Brief ="Bubble Temperature",Protected=true, Symbol ="T_{bubble}"); |
---|
58 | Deg_Subcooled as temp_delta (Brief ="Degrees subcooled",Symbol ="\Delta T_{subcooled}"); |
---|
59 | |
---|
60 | out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0); |
---|
61 | out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0); |
---|
62 | |
---|
63 | EQUATIONS |
---|
64 | |
---|
65 | "Molar Flow Balance" |
---|
66 | InletVapour.F = OutletLiquid.F; |
---|
67 | |
---|
68 | "Molar Composition Balance" |
---|
69 | InletVapour.z = OutletLiquid.z; |
---|
70 | |
---|
71 | "Energy Balance" |
---|
72 | InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h; |
---|
73 | |
---|
74 | "Pressure Drop" |
---|
75 | OutletLiquid.P = InletVapour.P - Pdrop; |
---|
76 | |
---|
77 | "Bubble Temperature" |
---|
78 | Tbubble = PP.BubbleT(OutletLiquid.P,OutletLiquid.z); |
---|
79 | |
---|
80 | "Temperature" |
---|
81 | OutletLiquid.T = Tbubble-Deg_Subcooled; |
---|
82 | |
---|
83 | "Temperature indicator" |
---|
84 | TI * 'K' = OutletLiquid.T; |
---|
85 | |
---|
86 | "Pressure indicator" |
---|
87 | PI * 'atm' = OutletLiquid.P; |
---|
88 | |
---|
89 | end |
---|
90 | |
---|
91 | Model condenserSteady_fakeH |
---|
92 | |
---|
93 | ATTRIBUTES |
---|
94 | Pallete = true; |
---|
95 | Icon = "icon/CondenserSteady"; |
---|
96 | Brief = "Model of a Steady State condenser with fake calculation of outlet conditions."; |
---|
97 | Info = |
---|
98 | "Model of a Steady State condenser with fake calculation of output temperature, but with a real |
---|
99 | calculation of the output stream enthalpy. |
---|
100 | |
---|
101 | == ASSUMPTIONS == |
---|
102 | * perfect mixing of both phases; |
---|
103 | * no thermodynamics equilibrium. |
---|
104 | |
---|
105 | == SET == |
---|
106 | * the fake Outlet temperature ; |
---|
107 | * the pressure drop in the condenser; |
---|
108 | |
---|
109 | == SPECIFY == |
---|
110 | * the InletVapour stream; |
---|
111 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model). |
---|
112 | |
---|
113 | == OPTIONAL == |
---|
114 | * the condenser model has two control ports |
---|
115 | ** TI OutletLiquid Temperature Indicator; |
---|
116 | ** PI OutletLiquid Pressure Indicator; |
---|
117 | "; |
---|
118 | |
---|
119 | PARAMETERS |
---|
120 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
121 | outer NComp as Integer (Brief = "Number of Components"); |
---|
122 | |
---|
123 | Pdrop as press_delta (Brief="Pressure Drop in the condenser",Default=0, Symbol="\Delta _P"); |
---|
124 | Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}"); |
---|
125 | |
---|
126 | |
---|
127 | VARIABLES |
---|
128 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.16, PosY=0, Symbol="_{in}^{Vapour}"); |
---|
129 | out OutletLiquid as stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}"); |
---|
130 | in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.08, Symbol="Q_{in}",Protected=true); |
---|
131 | |
---|
132 | out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.50, PosY=0); |
---|
133 | out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.32, PosY=0); |
---|
134 | |
---|
135 | EQUATIONS |
---|
136 | |
---|
137 | "Molar Flow Balance" |
---|
138 | InletVapour.F = OutletLiquid.F; |
---|
139 | |
---|
140 | "Molar Composition Balance" |
---|
141 | InletVapour.z = OutletLiquid.z; |
---|
142 | |
---|
143 | "Energy Balance" |
---|
144 | InletVapour.F*InletVapour.h + InletQ = OutletLiquid.F*OutletLiquid.h; |
---|
145 | |
---|
146 | "Pressure Drop" |
---|
147 | OutletLiquid.P = InletVapour.P - Pdrop; |
---|
148 | |
---|
149 | "Fake Temperature" |
---|
150 | OutletLiquid.T = Fake_Temperature; |
---|
151 | |
---|
152 | "Vapourisation Fraction" |
---|
153 | OutletLiquid.v = 0; |
---|
154 | |
---|
155 | "Temperature indicator" |
---|
156 | TI * 'K' = OutletLiquid.T; |
---|
157 | |
---|
158 | "Pressure indicator" |
---|
159 | PI * 'atm' = OutletLiquid.P; |
---|
160 | |
---|
161 | end |
---|
162 | |
---|
163 | Model condenserReact |
---|
164 | ATTRIBUTES |
---|
165 | Pallete = false; |
---|
166 | Icon = "icon/Condenser"; |
---|
167 | Brief = "Model of a Condenser with reaction in liquid phase."; |
---|
168 | Info = |
---|
169 | "== Assumptions == |
---|
170 | * perfect mixing of both phases; |
---|
171 | * thermodynamics equilibrium; |
---|
172 | * the reaction only takes place in liquid phase. |
---|
173 | |
---|
174 | == Specify == |
---|
175 | * the reaction related variables; |
---|
176 | * the inlet stream; |
---|
177 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
178 | * the heat supply. |
---|
179 | |
---|
180 | == Initial Conditions == |
---|
181 | * the condenser temperature (OutletLiquid.T); |
---|
182 | * the condenser liquid level (Level); |
---|
183 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
184 | "; |
---|
185 | |
---|
186 | PARAMETERS |
---|
187 | outer PP as Plugin(Type="PP"); |
---|
188 | outer NComp as Integer; |
---|
189 | |
---|
190 | V as volume (Brief="Condenser total volume"); |
---|
191 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
192 | |
---|
193 | stoic(NComp) as Real (Brief="Stoichiometric matrix"); |
---|
194 | Hr as energy_mol; |
---|
195 | Initial_Level as length (Brief="Initial Level of liquid phase"); |
---|
196 | Initial_Temperature as temperature (Brief="Initial Temperature of Condenser"); |
---|
197 | Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition"); |
---|
198 | |
---|
199 | VARIABLES |
---|
200 | |
---|
201 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.1164, PosY=0, Symbol="_{inV}"); |
---|
202 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4513, PosY=1, Symbol="_{outL}"); |
---|
203 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4723, PosY=0, Symbol="_{outV}"); |
---|
204 | InletQ as power (Brief="Cold supplied", PosX=1, PosY=0.6311, Symbol="_{in}"); |
---|
205 | |
---|
206 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
207 | ML as mol (Brief="Molar liquid holdup"); |
---|
208 | MV as mol (Brief="Molar vapour holdup"); |
---|
209 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
210 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
211 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
212 | Level as length (Brief="Level of liquid phase"); |
---|
213 | Vol as volume; |
---|
214 | r3 as reaction_mol (Brief="Reaction Rates", DisplayUnit = 'mol/l/s'); |
---|
215 | C(NComp) as conc_mol (Brief="Molar concentration", Lower = -1); |
---|
216 | |
---|
217 | INITIAL |
---|
218 | |
---|
219 | Level = Initial_Level; |
---|
220 | OutletLiquid.T = Initial_Temperature; |
---|
221 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
222 | |
---|
223 | EQUATIONS |
---|
224 | "Molar Concentration" |
---|
225 | OutletLiquid.z = vL * C; |
---|
226 | |
---|
227 | "Reaction" |
---|
228 | r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; |
---|
229 | |
---|
230 | "Component Molar Balance" |
---|
231 | diff(M) = InletVapour.F*InletVapour.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL; |
---|
232 | |
---|
233 | "Energy Balance" |
---|
234 | diff(E) = InletVapour.F*InletVapour.h - OutletLiquid.F*OutletLiquid.h- OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * ML*vL; |
---|
235 | |
---|
236 | "Molar Holdup" |
---|
237 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
238 | |
---|
239 | "Energy Holdup" |
---|
240 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P*V; |
---|
241 | |
---|
242 | "Mol fraction normalisation" |
---|
243 | sum(OutletLiquid.z)=1.0; |
---|
244 | |
---|
245 | "Liquid Volume" |
---|
246 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
247 | |
---|
248 | "Vapour Volume" |
---|
249 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
250 | |
---|
251 | "Thermal Equilibrium" |
---|
252 | OutletLiquid.T = OutletVapour.T; |
---|
253 | |
---|
254 | "Mechanical Equilibrium" |
---|
255 | OutletVapour.P = OutletLiquid.P; |
---|
256 | |
---|
257 | "Geometry Constraint" |
---|
258 | V = ML*vL + MV*vV; |
---|
259 | |
---|
260 | Vol = ML*vL; |
---|
261 | |
---|
262 | "Level of liquid phase" |
---|
263 | Level = ML*vL/Across; |
---|
264 | |
---|
265 | "Chemical Equilibrium" |
---|
266 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = |
---|
267 | PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
268 | |
---|
269 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
270 | |
---|
271 | end |
---|
272 | |
---|
273 | Model condenser |
---|
274 | |
---|
275 | ATTRIBUTES |
---|
276 | Pallete = true; |
---|
277 | Icon = "icon/Condenser"; |
---|
278 | Brief = "Model of a dynamic condenser with control."; |
---|
279 | Info = |
---|
280 | "== ASSUMPTIONS == |
---|
281 | * perfect mixing of both phases; |
---|
282 | * thermodynamics equilibrium. |
---|
283 | |
---|
284 | == SPECIFY == |
---|
285 | * the InletVapour stream; |
---|
286 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
287 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model). |
---|
288 | |
---|
289 | == OPTIONAL == |
---|
290 | * the condenser model has three control ports |
---|
291 | ** TI OutletLiquid Temperature Indicator; |
---|
292 | ** PI OutletLiquid Pressure Indicator; |
---|
293 | ** LI Level Indicator of Condenser; |
---|
294 | |
---|
295 | == INITIAL CONDITIONS == |
---|
296 | * Initial_Temperature : the condenser temperature (OutletLiquid.T); |
---|
297 | * Levelpercent_Initial : the condenser liquid level in percent (LI); |
---|
298 | * Initial_Composition : (NoComps) OutletLiquid compositions. |
---|
299 | "; |
---|
300 | |
---|
301 | PARAMETERS |
---|
302 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
303 | outer NComp as Integer (Brief="Number of Components"); |
---|
304 | |
---|
305 | pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi"); |
---|
306 | g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); |
---|
307 | |
---|
308 | Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); |
---|
309 | Heads as Switcher (Valid=["elliptical","hemispherical"],Default="elliptical"); |
---|
310 | |
---|
311 | Diameter as length (Brief="Vessel diameter", Symbol="D_{i}"); |
---|
312 | Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}"); |
---|
313 | |
---|
314 | Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); |
---|
315 | Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); |
---|
316 | Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); |
---|
317 | radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); |
---|
318 | |
---|
319 | Mw(NComp) as molweight (Brief = "Component Mol Weight",Hidden=true); |
---|
320 | low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); |
---|
321 | zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true); |
---|
322 | KfConst as area (Brief="Constant for K factor pressure drop", Default = 1, Hidden=true); |
---|
323 | |
---|
324 | VapourFlow as Switcher (Brief="Vapour Flow", Valid = ["on", "off"], Default = "on",Hidden=true); |
---|
325 | |
---|
326 | Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E-8, Default = 1E-3); |
---|
327 | |
---|
328 | Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); |
---|
329 | Initial_Temperature as temperature (Brief="Initial Temperature of Condenser"); |
---|
330 | Initial_Composition(NComp) as positive (Brief="Initial Liquid Composition", Lower=1E-6); |
---|
331 | |
---|
332 | VARIABLES |
---|
333 | |
---|
334 | in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.13, PosY=0, Symbol="_{in}^{Vapour}"); |
---|
335 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.35, PosY=1, Symbol="_{out}^{Liquid}"); |
---|
336 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.54, PosY=0, Symbol="_{out}^{Vapour}"); |
---|
337 | in InletQ as power (Brief="Heat supplied", Protected = true, PosX=1, PosY=0.08, Symbol="Q_{in}"); |
---|
338 | |
---|
339 | out TI as control_signal (Brief="Temperature Indicator of Condenser", Protected = true, PosX=0.33, PosY=0); |
---|
340 | out LI as control_signal (Brief="Level Indicator of Condenser", Protected = true, PosX=0.43, PosY=0); |
---|
341 | out PI as control_signal (Brief="Pressure Indicator of Condenser", Protected = true, PosX=0.25, PosY=0); |
---|
342 | |
---|
343 | M(NComp) as mol (Brief="Molar Holdup in the tray", Protected = true); |
---|
344 | ML as mol (Brief="Molar liquid holdup", Protected = true); |
---|
345 | MV as mol (Brief="Molar vapour holdup", Protected = true); |
---|
346 | E as energy (Brief="Total Energy Holdup on tray", Protected = true); |
---|
347 | vL as volume_mol (Brief="Liquid Molar Volume", Protected = true); |
---|
348 | vV as volume_mol (Brief="Vapour Molar volume", Protected = true); |
---|
349 | rho as dens_mass (Brief ="Inlet Vapour Mass Density",Hidden=true, Symbol ="\rho"); |
---|
350 | Level as length (Brief="Level of liquid phase", Protected = true); |
---|
351 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); |
---|
352 | |
---|
353 | Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}"); |
---|
354 | Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}"); |
---|
355 | Across as area (Brief="Cross Section Area of condenser",Protected=true); |
---|
356 | |
---|
357 | SET |
---|
358 | pi = 3.141593; |
---|
359 | g = 9.81 * 'm/(s^2)'; |
---|
360 | Vhead_elliptical = (pi*Diameter^3)/12; |
---|
361 | Vhead_hemispherical = (pi*Diameter^3)/6; |
---|
362 | Vcylinder = 0.25*(pi*Diameter^2)*Lenght; |
---|
363 | radius = 0.5*Diameter; |
---|
364 | |
---|
365 | Mw = PP.MolecularWeight(); |
---|
366 | low_flow = 1E-6 * 'kmol/h'; |
---|
367 | zero_flow = 0 * 'kmol/h'; |
---|
368 | KfConst = 1*'m^2'; |
---|
369 | |
---|
370 | INITIAL |
---|
371 | |
---|
372 | "Initial level Percent" |
---|
373 | LI = Levelpercent_Initial; |
---|
374 | |
---|
375 | "Initial Temperature" |
---|
376 | OutletLiquid.T = Initial_Temperature; |
---|
377 | |
---|
378 | "Initial Composition" |
---|
379 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
380 | |
---|
381 | EQUATIONS |
---|
382 | |
---|
383 | switch Orientation |
---|
384 | |
---|
385 | case "vertical": |
---|
386 | |
---|
387 | "Vessel Cross Section Area" |
---|
388 | Across = 0.25*(pi*Diameter^2); |
---|
389 | |
---|
390 | switch Heads |
---|
391 | |
---|
392 | case "elliptical": |
---|
393 | |
---|
394 | "Vessel Total Volume" |
---|
395 | Vtotal = Vhead_elliptical + Vcylinder; |
---|
396 | |
---|
397 | if Level < 0.25*Diameter then |
---|
398 | |
---|
399 | "Vessel Filled Volume" |
---|
400 | Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3); |
---|
401 | |
---|
402 | else |
---|
403 | |
---|
404 | "Vessel Filled Volume" |
---|
405 | Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3); |
---|
406 | |
---|
407 | end |
---|
408 | |
---|
409 | case "hemispherical": |
---|
410 | |
---|
411 | "Vessel Total Volume" |
---|
412 | Vtotal = Vhead_hemispherical + Vcylinder; |
---|
413 | |
---|
414 | if Level < 0.5*Diameter then |
---|
415 | |
---|
416 | "Vessel Filled Volume" |
---|
417 | Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3); |
---|
418 | |
---|
419 | else |
---|
420 | |
---|
421 | "Vessel Filled Volume" |
---|
422 | Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2); |
---|
423 | |
---|
424 | end |
---|
425 | |
---|
426 | end |
---|
427 | |
---|
428 | case "horizontal": |
---|
429 | |
---|
430 | "Vessel Cross Section Area" |
---|
431 | Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2)); |
---|
432 | |
---|
433 | switch Heads |
---|
434 | |
---|
435 | case "elliptical": |
---|
436 | |
---|
437 | "Vessel Total Volume" |
---|
438 | Vtotal = Vhead_elliptical + Vcylinder; |
---|
439 | |
---|
440 | "Vessel Filled Volume" |
---|
441 | Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght; |
---|
442 | |
---|
443 | case "hemispherical": |
---|
444 | |
---|
445 | "Vessel Total Volume" |
---|
446 | Vtotal = Vhead_hemispherical + Vcylinder; |
---|
447 | |
---|
448 | "Vessel Filled Volume" |
---|
449 | Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght; |
---|
450 | |
---|
451 | end |
---|
452 | |
---|
453 | end |
---|
454 | |
---|
455 | switch VapourFlow |
---|
456 | |
---|
457 | case "on": |
---|
458 | InletVapour.F*sum(Mw*InletVapour.z) = Kfactor *sqrt(Pdrop*rho)*KfConst; |
---|
459 | |
---|
460 | when InletVapour.F < low_flow switchto "off"; |
---|
461 | |
---|
462 | case "off": |
---|
463 | InletVapour.F = zero_flow; |
---|
464 | |
---|
465 | when InletVapour.P > OutletLiquid.P switchto "on"; |
---|
466 | |
---|
467 | end |
---|
468 | |
---|
469 | "Component Molar Balance" |
---|
470 | diff(M) = InletVapour.F*InletVapour.z - OutletLiquid.F*OutletLiquid.z- OutletVapour.F*OutletVapour.z; |
---|
471 | |
---|
472 | "Energy Balance" |
---|
473 | diff(E) = InletVapour.F*InletVapour.h - OutletLiquid.F*OutletLiquid.h- OutletVapour.F*OutletVapour.h + InletQ; |
---|
474 | |
---|
475 | "Molar Holdup" |
---|
476 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
477 | |
---|
478 | "Energy Holdup" |
---|
479 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P*Vtotal; |
---|
480 | |
---|
481 | "Mol fraction normalisation" |
---|
482 | sum(OutletLiquid.z)=1.0; |
---|
483 | |
---|
484 | "Mol fraction Constraint" |
---|
485 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
486 | |
---|
487 | "Liquid Volume" |
---|
488 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
489 | |
---|
490 | "Vapour Volume" |
---|
491 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
492 | |
---|
493 | "Inlet Vapour Density" |
---|
494 | rho = PP.VapourDensity(InletVapour.T, InletVapour.P, InletVapour.z); |
---|
495 | |
---|
496 | "Chemical Equilibrium" |
---|
497 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = |
---|
498 | PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
499 | |
---|
500 | "Thermal Equilibrium" |
---|
501 | OutletLiquid.T = OutletVapour.T; |
---|
502 | |
---|
503 | "Mechanical Equilibrium" |
---|
504 | OutletVapour.P = OutletLiquid.P; |
---|
505 | |
---|
506 | "Pressure Drop" |
---|
507 | OutletLiquid.P = InletVapour.P - Pdrop; |
---|
508 | |
---|
509 | "Geometry Constraint" |
---|
510 | Vtotal = ML*vL + MV*vV; |
---|
511 | |
---|
512 | "Liquid Level" |
---|
513 | ML * vL = Vfilled; |
---|
514 | |
---|
515 | "Temperature indicator" |
---|
516 | TI * 'K' = OutletLiquid.T; |
---|
517 | |
---|
518 | "Pressure indicator" |
---|
519 | PI * 'atm' = OutletLiquid.P; |
---|
520 | |
---|
521 | "Level indicator" |
---|
522 | LI*Vtotal= Vfilled; |
---|
523 | |
---|
524 | end |
---|