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: tray.mso 522 2008-05-21 23:21:12Z arge $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model trayBasic |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = false; |
---|
25 | Icon = "icon/Tray"; |
---|
26 | Brief = "Basic equations of a tray column model."; |
---|
27 | Info = |
---|
28 | "This model contains only the main equations of a column tray equilibrium model without |
---|
29 | the hidraulic equations. |
---|
30 | |
---|
31 | == Assumptions == |
---|
32 | * both phases (liquid and vapour) exists all the time; |
---|
33 | * thermodymanic equilibrium with Murphree plate efficiency; |
---|
34 | * no entrainment of liquid or vapour phase; |
---|
35 | * no weeping; |
---|
36 | * the dymanics in the downcomer are neglected. |
---|
37 | "; |
---|
38 | |
---|
39 | PARAMETERS |
---|
40 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
41 | outer NComp as Integer; |
---|
42 | |
---|
43 | VARIABLES |
---|
44 | |
---|
45 | Inlet as stream (Brief="Feed stream", Hidden=true, PosX=0, PosY=0.4932, Symbol="_{in}"); |
---|
46 | LiquidSideStream as liquid_stream (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}"); |
---|
47 | VapourSideStream as vapour_stream (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}"); |
---|
48 | |
---|
49 | in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); |
---|
50 | in InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); |
---|
51 | out OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); |
---|
52 | out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); |
---|
53 | |
---|
54 | |
---|
55 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
56 | ML as mol (Brief="Molar liquid holdup"); |
---|
57 | MV as mol (Brief="Molar vapour holdup"); |
---|
58 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
59 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
60 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
61 | Level as length (Brief="Height of clear liquid on plate"); |
---|
62 | yideal(NComp) as fraction; |
---|
63 | |
---|
64 | |
---|
65 | EQUATIONS |
---|
66 | "Component Molar Balance" |
---|
67 | diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z- |
---|
68 | LiquidSideStream.F*LiquidSideStream.z-VapourSideStream.F*VapourSideStream.z; |
---|
69 | |
---|
70 | "Molar Holdup" |
---|
71 | M = ML*OutletL.z + MV*OutletV.z; |
---|
72 | |
---|
73 | "Mol fraction normalisation" |
---|
74 | sum(OutletL.z)= 1.0; |
---|
75 | sum(OutletL.z)= sum(OutletV.z); |
---|
76 | |
---|
77 | "Liquid Volume" |
---|
78 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
79 | |
---|
80 | "Vapour Volume" |
---|
81 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
82 | |
---|
83 | "Chemical Equilibrium" |
---|
84 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; |
---|
85 | |
---|
86 | "Thermal Equilibrium" |
---|
87 | OutletV.T = OutletL.T; |
---|
88 | |
---|
89 | "Mechanical Equilibrium" |
---|
90 | OutletV.P = OutletL.P; |
---|
91 | |
---|
92 | "Thermal Equilibrium Vapour Side Stream" |
---|
93 | OutletV.T = VapourSideStream.T; |
---|
94 | |
---|
95 | "Thermal Equilibrium Liquid Side Stream" |
---|
96 | OutletL.T = LiquidSideStream.T; |
---|
97 | |
---|
98 | "Mechanical Equilibrium Vapour Side Stream" |
---|
99 | OutletV.P= VapourSideStream.P; |
---|
100 | |
---|
101 | "Mechanical Equilibrium Liquid Side Stream" |
---|
102 | OutletL.P = LiquidSideStream.P; |
---|
103 | |
---|
104 | "Composition Liquid Side Stream" |
---|
105 | OutletL.z= LiquidSideStream.z; |
---|
106 | |
---|
107 | "Composition Vapour Side Stream" |
---|
108 | OutletV.z= VapourSideStream.z; |
---|
109 | |
---|
110 | end |
---|
111 | |
---|
112 | Model tray as trayBasic |
---|
113 | ATTRIBUTES |
---|
114 | Pallete = false; |
---|
115 | Icon = "icon/Tray"; |
---|
116 | Brief = "Complete model of a column tray."; |
---|
117 | Info = |
---|
118 | "== Specify == |
---|
119 | * the Feed stream |
---|
120 | * the Liquid inlet stream |
---|
121 | * the Vapour inlet stream |
---|
122 | * the Vapour outlet flow (OutletV.F) |
---|
123 | |
---|
124 | == Initial == |
---|
125 | * the plate temperature (OutletL.T) |
---|
126 | * the liquid height (Level) OR the liquid flow OutletL.F |
---|
127 | * (NoComps - 1) OutletL compositions |
---|
128 | |
---|
129 | == Options == |
---|
130 | You can choose the equation for the liquid outlet flow and the vapour |
---|
131 | inlet flow calculation through the VapourFlowModel and LiquidFlowModel |
---|
132 | switchers. |
---|
133 | |
---|
134 | == References == |
---|
135 | * ELGUE, S.; PRAT, L.; CABASSUD, M.; LANN, J. L.; CéZERAC, J. Dynamic models for start-up operations of batch distillation columns with experimental validation. Computers and Chemical Engineering, v. 28, p. 2735-2747, 2004. |
---|
136 | * FEEHERY, W. F. Dynamic Optimization with Path Constraints. Tese (Doutorado) - Massachusetts Institute of Technology, June 1998. |
---|
137 | * KLINGBERG, A. Modeling and Optimization of Batch Distillation. Dissertação (Mestrado) - Department of Automatic Control, Lund Institute of Technology, Lund, Sweden, fev. 2000. |
---|
138 | * OLSEN, I.; ENDRESTOL, G. O.; SIRA, T. A rigorous and efficient distillation column model for engineering and training simulators. Computers and Chemical Engineering,v. 21, n. Suppl, p. S193-S198, 1997. |
---|
139 | * REEPMEYER, F.; REPKE, J.-U.; WOZNY, G. Analysis of the start-up process for reactive distillation. Chemical Engineering Technology, v. 26, p. 81-86, 2003. |
---|
140 | * ROFFEL, B.; BETLEM, B.; RUIJTER, J. de. First principles dynamic modeling and multivariable control of a cryogenic distillation column process. Computers and Chemical Engineering, v. 24, p. 111-123, 2000. |
---|
141 | * WANG, L.; LI, P.; WOZNY, G.; WANG, S. A start-up model for simulation of batch distillation starting from a cold state. Computers and Chemical Engineering, v. 27, p.1485-1497, 2003. |
---|
142 | "; |
---|
143 | |
---|
144 | VARIABLES |
---|
145 | rhoL as dens_mass; |
---|
146 | rhoV as dens_mass; |
---|
147 | |
---|
148 | EQUATIONS |
---|
149 | |
---|
150 | "Liquid Density" |
---|
151 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
152 | |
---|
153 | "Vapour Density" |
---|
154 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
155 | |
---|
156 | end |
---|
157 | |
---|
158 | #*------------------------------------------------------------------- |
---|
159 | * Model of a tray with reaction |
---|
160 | *-------------------------------------------------------------------*# |
---|
161 | Model trayReac |
---|
162 | ATTRIBUTES |
---|
163 | Pallete = false; |
---|
164 | Icon = "icon/Tray"; |
---|
165 | Brief = "Model of a tray with reaction."; |
---|
166 | Info = |
---|
167 | "== Assumptions == |
---|
168 | * both phases (liquid and vapour) exists all the time; |
---|
169 | * thermodymanic equilibrium with Murphree plate efficiency; |
---|
170 | * no entrainment of liquid or vapour phase; |
---|
171 | * no weeping; |
---|
172 | * the dymanics in the downcomer are neglected. |
---|
173 | |
---|
174 | == Specify == |
---|
175 | * the Feed stream; |
---|
176 | * the Liquid inlet stream; |
---|
177 | * the Vapour inlet stream; |
---|
178 | * the Vapour outlet flow (OutletV.F); |
---|
179 | * the reaction related variables. |
---|
180 | |
---|
181 | == Initial == |
---|
182 | * the plate temperature (OutletL.T) |
---|
183 | * the liquid height (Level) OR the liquid flow OutletL.F |
---|
184 | * (NoComps - 1) OutletL compositions |
---|
185 | "; |
---|
186 | |
---|
187 | PARAMETERS |
---|
188 | |
---|
189 | outer PP as Plugin(Type="PP"); |
---|
190 | outer NComp as Integer; |
---|
191 | |
---|
192 | VARIABLES |
---|
193 | |
---|
194 | Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); |
---|
195 | LiquidSideStream as liquid_stream (Brief="liquid Sidestream", Hidden=true, Symbol="_{outL}"); |
---|
196 | VapourSideStream as vapour_stream (Brief="vapour Sidestream", Hidden=true, Symbol="_{outV}"); |
---|
197 | |
---|
198 | |
---|
199 | in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); |
---|
200 | in InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); |
---|
201 | out OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); |
---|
202 | out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); |
---|
203 | |
---|
204 | yideal(NComp) as fraction; |
---|
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="Height of clear liquid on plate"); |
---|
213 | Vol as volume; |
---|
214 | |
---|
215 | rhoL as dens_mass; |
---|
216 | rhoV as dens_mass; |
---|
217 | r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); |
---|
218 | C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); |
---|
219 | |
---|
220 | EQUATIONS |
---|
221 | |
---|
222 | "Molar Concentration" |
---|
223 | OutletL.z = vL * C; |
---|
224 | |
---|
225 | "Reaction" |
---|
226 | r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s'; |
---|
227 | |
---|
228 | "Molar Holdup" |
---|
229 | M = ML*OutletL.z + MV*OutletV.z; |
---|
230 | |
---|
231 | "Thermal Equilibrium Vapour Side Stream" |
---|
232 | OutletV.T = VapourSideStream.T; |
---|
233 | |
---|
234 | "Thermal Equilibrium Liquid Side Stream" |
---|
235 | OutletL.T = LiquidSideStream.T; |
---|
236 | |
---|
237 | "Mechanical Equilibrium Vapour Side Stream" |
---|
238 | OutletV.P= VapourSideStream.P; |
---|
239 | |
---|
240 | "Mechanical Equilibrium Liquid Side Stream" |
---|
241 | OutletL.P = LiquidSideStream.P; |
---|
242 | |
---|
243 | "Composition Liquid Side Stream" |
---|
244 | OutletL.z= LiquidSideStream.z; |
---|
245 | |
---|
246 | "Composition Vapour Side Stream" |
---|
247 | OutletV.z= VapourSideStream.z; |
---|
248 | |
---|
249 | "Mol fraction normalisation" |
---|
250 | sum(OutletL.z)= 1.0; |
---|
251 | |
---|
252 | "Liquid Volume" |
---|
253 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
254 | |
---|
255 | "Vapour Volume" |
---|
256 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
257 | |
---|
258 | "Thermal Equilibrium" |
---|
259 | OutletV.T = OutletL.T; |
---|
260 | |
---|
261 | "Mechanical Equilibrium" |
---|
262 | OutletV.P = OutletL.P; |
---|
263 | |
---|
264 | Vol = ML*vL; |
---|
265 | |
---|
266 | "Liquid Density" |
---|
267 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
268 | |
---|
269 | "Vapour Density" |
---|
270 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
271 | |
---|
272 | "Chemical Equilibrium" |
---|
273 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; |
---|
274 | |
---|
275 | sum(OutletL.z)= sum(OutletV.z); |
---|
276 | |
---|
277 | end |
---|
278 | |
---|
279 | #*------------------------------------- |
---|
280 | * Model of a packed column stage |
---|
281 | -------------------------------------*# |
---|
282 | Model packedStage |
---|
283 | ATTRIBUTES |
---|
284 | Pallete = false; |
---|
285 | Icon = "icon/PackedStage"; |
---|
286 | Brief = "Complete model of a packed column stage."; |
---|
287 | Info = |
---|
288 | "== Specify == |
---|
289 | * the Feed stream |
---|
290 | * the Liquid inlet stream |
---|
291 | * the Vapour inlet stream |
---|
292 | * the stage pressure drop (deltaP) |
---|
293 | |
---|
294 | == Initial == |
---|
295 | * the plate temperature (OutletL.T) |
---|
296 | * the liquid molar holdup ML |
---|
297 | * (NoComps - 1) OutletL compositions |
---|
298 | "; |
---|
299 | |
---|
300 | PARAMETERS |
---|
301 | |
---|
302 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
303 | outer NComp as Integer; |
---|
304 | |
---|
305 | PPwater as Plugin(Brief="Physical Properties",Type="PP",Components = [ "water" ], |
---|
306 | LiquidModel = "PR", |
---|
307 | VapourModel = "PR" |
---|
308 | ); |
---|
309 | |
---|
310 | Mw(NComp) as molweight (Brief = "Component Mol Weight"); |
---|
311 | |
---|
312 | VARIABLES |
---|
313 | |
---|
314 | Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); |
---|
315 | in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); |
---|
316 | in InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); |
---|
317 | out OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); |
---|
318 | out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); |
---|
319 | |
---|
320 | M(NComp) as mol (Brief="Molar Holdup in the tray", Default=0.01, Lower=0, Upper=100); |
---|
321 | ML as mol (Brief="Molar liquid holdup", Default=0.01, Lower=0, Upper=100); |
---|
322 | MV as mol (Brief="Molar vapour holdup", Default=0.01, Lower=0, Upper=100); |
---|
323 | E as energy (Brief="Total Energy Holdup on tray", Default=-500); |
---|
324 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
325 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
326 | |
---|
327 | miL as viscosity (Brief="Liquid dynamic viscosity", DisplayUnit='kg/m/s'); |
---|
328 | miV as viscosity (Brief="Vapor dynamic viscosity", DisplayUnit='kg/m/s'); |
---|
329 | rhoL as dens_mass; |
---|
330 | rhoV as dens_mass; |
---|
331 | |
---|
332 | deltaP as pressure; |
---|
333 | |
---|
334 | uL as velocity (Brief="volume flow rate of liquid, m^3/m^2/s", Lower=-10, Upper=100); |
---|
335 | uV as velocity (Brief="volume flow rate of vapor, m^3/m^2/s", Lower=-10, Upper=100); |
---|
336 | dp as length (Brief="Particle diameter", Default=1e-3, Lower=0, Upper=10); |
---|
337 | invK as positive (Brief="Wall factor", Default=1, Upper=10); |
---|
338 | Rev as Real (Brief="Reynolds number of the vapor stream", Default=4000); |
---|
339 | Al as area (Brief="Area occupied by the liquid", Default=0.001, Upper=1); |
---|
340 | hl as positive (Brief="Column holdup", Unit='m^3/m^3', Default=0.01,Upper=10); |
---|
341 | |
---|
342 | SET |
---|
343 | Mw = PP.MolecularWeight(); |
---|
344 | |
---|
345 | EQUATIONS |
---|
346 | |
---|
347 | "Component Molar Balance" |
---|
348 | diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z- OutletL.F*OutletL.z - OutletV.F*OutletV.z; |
---|
349 | |
---|
350 | "Molar Holdup" |
---|
351 | M = ML*OutletL.z + MV*OutletV.z; |
---|
352 | |
---|
353 | "Mol fraction normalisation" |
---|
354 | sum(OutletL.z)= 1.0; |
---|
355 | |
---|
356 | "Liquid Volume" |
---|
357 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
358 | |
---|
359 | "Vapour Volume" |
---|
360 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
361 | |
---|
362 | "Chemical Equilibrium" |
---|
363 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
364 | |
---|
365 | "Thermal Equilibrium" |
---|
366 | OutletV.T = OutletL.T; |
---|
367 | |
---|
368 | "Mechanical Equilibrium" |
---|
369 | OutletL.P = OutletV.P; |
---|
370 | |
---|
371 | "Liquid Density" |
---|
372 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
373 | |
---|
374 | "Vapour Density" |
---|
375 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
376 | |
---|
377 | "Liquid viscosity" |
---|
378 | miL = PP.LiquidViscosity(OutletL.T, OutletL.P, OutletL.z); |
---|
379 | |
---|
380 | "Vapour viscosity" |
---|
381 | miV = PP.VapourViscosity(InletV.T, InletV.P, InletV.z); |
---|
382 | |
---|
383 | "Volume flow rate of liquid, m^3/m^2/s" |
---|
384 | uL * Al = OutletL.F * vL; |
---|
385 | |
---|
386 | deltaP = InletV.P - OutletV.P; |
---|
387 | |
---|
388 | end |
---|
389 | |
---|
390 | #*------------------------------------- |
---|
391 | * Nonequilibrium Model |
---|
392 | -------------------------------------* |
---|
393 | Model interfaceTeste |
---|
394 | |
---|
395 | ATTRIBUTES |
---|
396 | Pallete = false; |
---|
397 | Icon = "icon/Tray"; |
---|
398 | Brief = "Descrition of variables of the equilibrium interface."; |
---|
399 | Info = |
---|
400 | "This model contains only the variables of the equilibrium interface."; |
---|
401 | |
---|
402 | PARAMETERS |
---|
403 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
404 | outer NComp as Integer; |
---|
405 | outer NC1 as Integer; |
---|
406 | |
---|
407 | VARIABLES |
---|
408 | NL(NComp) as flow_mol_delta (Brief = "Stream Molar Rate on Liquid Phase"); |
---|
409 | NV(NComp) as flow_mol_delta (Brief = "Stream Molar Rate on Vapour Phase"); |
---|
410 | T as temperature (Brief = "Stream Temperature"); |
---|
411 | P as pressure (Brief = "Stream Pressure"); |
---|
412 | x(NComp) as fraction (Brief = "Stream Molar Fraction on Liquid Phase"); |
---|
413 | y(NComp) as fraction (Brief = "Stream Molar Fraction on Vapour Phase"); |
---|
414 | a as area (Brief = "Interface Area"); |
---|
415 | htL as heat_trans_coeff (Brief = "Heat Transference Coefficient on Liquid Phase"); |
---|
416 | htV as heat_trans_coeff (Brief = "Heat Transference Coefficient on Vapour Phase"); |
---|
417 | E_liq as heat_rate (Brief = "Liquid Energy Rate at interface"); |
---|
418 | E_vap as heat_rate (Brief = "Vapour Energy Rate at interface"); |
---|
419 | hL as enth_mol (Brief = "Liquid Molar Enthalpy"); |
---|
420 | hV as enth_mol (Brief = "Vapour Molar Enthalpy"); |
---|
421 | kL(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients"); |
---|
422 | kV(NC1,NC1) as velocity (Brief = "Mass Transfer Coefficients"); |
---|
423 | |
---|
424 | EQUATIONS |
---|
425 | "Liquid Enthalpy" |
---|
426 | hL = PP.LiquidEnthalpy(T, P, x); |
---|
427 | |
---|
428 | "Vapour Enthalpy" |
---|
429 | hV = PP.VapourEnthalpy(T, P, y); |
---|
430 | |
---|
431 | end |
---|
432 | |
---|
433 | Model trayRateBasicTeste |
---|
434 | ATTRIBUTES |
---|
435 | Pallete = false; |
---|
436 | Icon = "icon/Tray"; |
---|
437 | Brief = "Basic equations of a tray rate column model."; |
---|
438 | Info = |
---|
439 | "This model contains only the main equations of a column tray nonequilibrium model without |
---|
440 | the hidraulic equations. |
---|
441 | |
---|
442 | == Assumptions == |
---|
443 | * both phases (liquid and vapour) exists all the time; |
---|
444 | * no entrainment of liquid or vapour phase; |
---|
445 | * no weeping; |
---|
446 | * the dymanics in the downcomer are neglected. |
---|
447 | "; |
---|
448 | |
---|
449 | PARAMETERS |
---|
450 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
451 | outer NComp as Integer; |
---|
452 | NC1 as Integer; |
---|
453 | V as volume(Brief="Total Volume of the tray"); |
---|
454 | Q as heat_rate (Brief="Rate of heat supply"); |
---|
455 | Ap as area (Brief="Plate area = Atray - Adowncomer"); |
---|
456 | |
---|
457 | VARIABLES |
---|
458 | in Inlet as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); |
---|
459 | in InletFV as stream (Brief="Feed stream", PosX=0, PosY=0.4932, Symbol="_{in}"); |
---|
460 | in InletL as stream (Brief="Inlet liquid stream", PosX=0.5195, PosY=0, Symbol="_{inL}"); |
---|
461 | in InletV as stream (Brief="Inlet vapour stream", PosX=0.4994, PosY=1, Symbol="_{inV}"); |
---|
462 | out OutletL as liquid_stream (Brief="Outlet liquid stream", PosX=0.8277, PosY=1, Symbol="_{outL}"); |
---|
463 | out OutletV as vapour_stream (Brief="Outlet vapour stream", PosX=0.8043, PosY=0, Symbol="_{outV}"); |
---|
464 | |
---|
465 | M_liq(NComp) as mol (Brief="Liquid Molar Holdup in the tray"); |
---|
466 | M_vap(NComp) as mol (Brief="Vapour Molar Holdup in the tray"); |
---|
467 | ML as mol (Brief="Molar liquid holdup"); |
---|
468 | MV as mol (Brief="Molar vapour holdup"); |
---|
469 | E_liq as energy (Brief="Total Liquid Energy Holdup on tray"); |
---|
470 | E_vap as energy (Brief="Total Vapour Energy Holdup on tray"); |
---|
471 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
472 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
473 | Level as length (Brief="Height of clear liquid on plate"); |
---|
474 | interf as interfaceTeste; |
---|
475 | |
---|
476 | SET |
---|
477 | NC1=NComp-1; |
---|
478 | |
---|
479 | EQUATIONS |
---|
480 | "Component Molar Balance" |
---|
481 | diff(M_liq)=Inlet.F*Inlet.z + InletL.F*InletL.z |
---|
482 | - OutletL.F*OutletL.z + interf.NL; |
---|
483 | |
---|
484 | diff(M_vap)=InletFV.F*InletFV.z + InletV.F*InletV.z |
---|
485 | - OutletV.F*OutletV.z - interf.NV; |
---|
486 | |
---|
487 | "Energy Balance" |
---|
488 | diff(E_liq) = Inlet.F*Inlet.h + InletL.F*InletL.h |
---|
489 | - OutletL.F*OutletL.h + Q + interf.E_liq; |
---|
490 | |
---|
491 | diff(E_vap) = InletFV.F*InletFV.h + InletV.F*InletV.h |
---|
492 | - OutletV.F*OutletV.h - interf.E_vap; |
---|
493 | |
---|
494 | "Molar Holdup" |
---|
495 | M_liq = ML*OutletL.z; |
---|
496 | |
---|
497 | M_vap = MV*OutletV.z; |
---|
498 | |
---|
499 | "Energy Holdup" |
---|
500 | E_liq = ML*(OutletL.h - OutletL.P*vL); |
---|
501 | |
---|
502 | E_vap = MV*(OutletV.h - OutletV.P*vV); |
---|
503 | |
---|
504 | "Energy Rate through the interface" |
---|
505 | interf.E_liq = interf.htL*interf.a*(interf.T-OutletL.T)+sum(interf.NL)*interf.hL; |
---|
506 | |
---|
507 | interf.E_vap = interf.htV*interf.a*(OutletV.T-interf.T)+sum(interf.NV)*interf.hV; |
---|
508 | |
---|
509 | "Mass Conservation" |
---|
510 | interf.NL = interf.NV; |
---|
511 | |
---|
512 | "Energy Conservation" |
---|
513 | interf.E_liq = interf.E_vap; |
---|
514 | |
---|
515 | "Mol fraction normalisation" |
---|
516 | sum(OutletL.z)= 1.0; |
---|
517 | sum(OutletL.z)= sum(OutletV.z); |
---|
518 | sum(interf.x)=1.0; |
---|
519 | sum(interf.x)=sum(interf.y); |
---|
520 | |
---|
521 | "Liquid Volume" |
---|
522 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
523 | "Vapour Volume" |
---|
524 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
525 | |
---|
526 | "Chemical Equilibrium" |
---|
527 | PP.LiquidFugacityCoefficient(interf.T, interf.P, interf.x)*interf.x = |
---|
528 | PP.VapourFugacityCoefficient(interf.T, interf.P, interf.y)*interf.y; |
---|
529 | |
---|
530 | "Geometry Constraint" |
---|
531 | V = ML*vL + MV*vV; |
---|
532 | |
---|
533 | "Level of clear liquid over the weir" |
---|
534 | Level = ML*vL/Ap; |
---|
535 | |
---|
536 | "Total Mass Transfer Rates" |
---|
537 | interf.NL(1:NC1)=interf.a*sumt(interf.kL*(interf.x(1:NC1)-OutletL.z(1:NC1)))/vL+ |
---|
538 | OutletL.z(1:NC1)*sum(interf.NL); |
---|
539 | |
---|
540 | # interf.NL(1:NC1)=0.01*'kmol/s'; |
---|
541 | |
---|
542 | interf.NV(1:NC1)=interf.a*sumt(interf.kV*(OutletV.z(1:NC1)-interf.y(1:NC1)))/vV+ |
---|
543 | OutletV.z(1:NC1)*sum(interf.NV); |
---|
544 | |
---|
545 | "Mechanical Equilibrium" |
---|
546 | OutletV.P = OutletL.P; |
---|
547 | interf.P=OutletL.P; |
---|
548 | end |
---|
549 | |
---|
550 | Model trayRateTeste as trayRateBasicTeste |
---|
551 | ATTRIBUTES |
---|
552 | Pallete = false; |
---|
553 | Icon = "icon/Tray"; |
---|
554 | Brief = "Complete rate model of a column tray."; |
---|
555 | Info = |
---|
556 | "== Specify == |
---|
557 | * the Feed stream |
---|
558 | * the Liquid inlet stream |
---|
559 | * the Vapour inlet stream |
---|
560 | * the Vapour outlet flow (OutletV.F) |
---|
561 | |
---|
562 | == Initial == |
---|
563 | * the plate temperature of both phases (OutletL.T and OutletV.T) |
---|
564 | * the liquid height (Level) OR the liquid flow holdup (ML) |
---|
565 | * the vapor holdup (MV) |
---|
566 | * (NoComps - 1) OutletL compositions |
---|
567 | "; |
---|
568 | |
---|
569 | PARAMETERS |
---|
570 | Ah as area (Brief="Total holes area"); |
---|
571 | lw as length (Brief="Weir length"); |
---|
572 | g as acceleration (Default=9.81); |
---|
573 | hw as length (Brief="Weir height"); |
---|
574 | beta as fraction (Brief="Aeration fraction"); |
---|
575 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
576 | |
---|
577 | VapourFlow as Switcher(Valid = ["on", "off"], Default = "on"); |
---|
578 | LiquidFlow as Switcher(Valid = ["on", "off"], Default = "on"); |
---|
579 | |
---|
580 | VARIABLES |
---|
581 | rhoL as dens_mass; |
---|
582 | rhoV as dens_mass; |
---|
583 | |
---|
584 | EQUATIONS |
---|
585 | "Liquid Density" |
---|
586 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
587 | "Vapour Density" |
---|
588 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
589 | |
---|
590 | switch LiquidFlow |
---|
591 | case "on": |
---|
592 | "Francis Equation" |
---|
593 | # OutletL.F*vL = 1.84*'m^0.5/s'*lw*((Level-(beta*hw))/(beta))^1.5; |
---|
594 | OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw))/(beta))^2; |
---|
595 | when Level < (beta * hw) switchto "off"; |
---|
596 | |
---|
597 | case "off": |
---|
598 | "Low level" |
---|
599 | OutletL.F = 0 * 'mol/h'; |
---|
600 | when Level > (beta * hw) + 1e-6*'m' switchto "on"; |
---|
601 | end |
---|
602 | |
---|
603 | switch VapourFlow |
---|
604 | case "on": |
---|
605 | InletV.F*vV = sqrt((InletV.P - OutletV.P)/(rhoV*alfa))*Ah; |
---|
606 | when InletV.F < 1e-6 * 'kmol/h' switchto "off"; |
---|
607 | |
---|
608 | case "off": |
---|
609 | InletV.F = 0 * 'mol/s'; |
---|
610 | when InletV.P > OutletV.P + Level*g*rhoL + 1e-1 * 'atm' switchto "on"; |
---|
611 | end |
---|
612 | end |
---|
613 | |
---|
614 | *# |
---|