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 | * Model of a dynamic flash |
---|
17 | *-------------------------------------------------------------------- |
---|
18 | * - Streams |
---|
19 | * * a liquid outlet stream |
---|
20 | * * a vapour outlet stream |
---|
21 | * * a feed stream |
---|
22 | * |
---|
23 | * - Assumptions |
---|
24 | * * both phases are perfectly mixed |
---|
25 | * |
---|
26 | * - Specify: |
---|
27 | * * the feed stream; |
---|
28 | * * the outlet flows: OutletV.F and OutletL.F |
---|
29 | * |
---|
30 | * - Initial: |
---|
31 | * * the flash initial temperature (OutletL.T) |
---|
32 | * * the flash initial liquid level (Ll) |
---|
33 | * * (NoComps - 1) OutletL (OR OutletV) compositions |
---|
34 | *---------------------------------------------------------------------- |
---|
35 | * Author: Paula B. Staudt |
---|
36 | * $Id: flash.mso 118 2007-01-15 18:48:01Z rafael $ |
---|
37 | *--------------------------------------------------------------------*# |
---|
38 | |
---|
39 | using "streams"; |
---|
40 | |
---|
41 | Model flash |
---|
42 | PARAMETERS |
---|
43 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
44 | outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); |
---|
45 | V as volume(Brief="Total Volume of the flash"); |
---|
46 | Mw(NComp) as molweight; |
---|
47 | Across as area (Brief="Flash Cross section area"); |
---|
48 | |
---|
49 | SET |
---|
50 | Mw=PP.MolecularWeight(); |
---|
51 | |
---|
52 | VARIABLES |
---|
53 | in Inlet as stream(Brief="Feed Stream"); |
---|
54 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
55 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
56 | in Q as heat_rate (Brief="Rate of heat supply"); |
---|
57 | |
---|
58 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
59 | ML as mol (Brief="Molar liquid holdup"); |
---|
60 | MV as mol (Brief="Molar vapour holdup"); |
---|
61 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
62 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
63 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
64 | Level as length (Brief="liquid height"); |
---|
65 | |
---|
66 | EQUATIONS |
---|
67 | "Component Molar Balance" |
---|
68 | diff(M)=Inlet.F*Inlet.z - OutletL.F*OutletL.z - OutletV.F*OutletV.z; |
---|
69 | |
---|
70 | "Energy Balance" |
---|
71 | diff(E) = Inlet.F*Inlet.h - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q; |
---|
72 | |
---|
73 | "Molar Holdup" |
---|
74 | M = ML*OutletL.z + MV*OutletV.z; |
---|
75 | |
---|
76 | "Energy Holdup" |
---|
77 | E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; |
---|
78 | |
---|
79 | "Mol fraction normalisation" |
---|
80 | sum(OutletL.z)=1.0; |
---|
81 | "Mol fraction normalisation" |
---|
82 | sum(OutletL.z)=sum(OutletV.z); |
---|
83 | |
---|
84 | "Liquid Volume" |
---|
85 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
86 | "Vapour Volume" |
---|
87 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
88 | |
---|
89 | "Chemical Equilibrium" |
---|
90 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
91 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
92 | |
---|
93 | "Thermal Equilibrium" |
---|
94 | OutletV.T = OutletL.T; |
---|
95 | |
---|
96 | "Mechanical Equilibrium" |
---|
97 | OutletV.P = OutletL.P; |
---|
98 | |
---|
99 | "Geometry Constraint" |
---|
100 | V = ML* vL + MV*vV; |
---|
101 | "Liquid Level" |
---|
102 | ML* vL = Across * Level; |
---|
103 | end |
---|
104 | |
---|
105 | #*---------------------------------------------------------------------- |
---|
106 | * Model of a Steady State flash |
---|
107 | *---------------------------------------------------------------------*# |
---|
108 | Model flash_steady |
---|
109 | PARAMETERS |
---|
110 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
111 | |
---|
112 | VARIABLES |
---|
113 | in Inlet as stream(Brief="Feed Stream"); |
---|
114 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
115 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
116 | in Q as heat_rate (Brief="Rate of heat supply"); |
---|
117 | vfrac as fraction; |
---|
118 | |
---|
119 | EQUATIONS |
---|
120 | "The flash calculation" |
---|
121 | [vfrac, OutletL.z, OutletV.z] = PP.Flash(OutletV.T, OutletV.P, Inlet.z); |
---|
122 | |
---|
123 | "Global Molar Balance" |
---|
124 | Inlet.F = OutletV.F + OutletL.F; |
---|
125 | "Vaporisation Fraction" |
---|
126 | OutletV.F = Inlet.F * vfrac; |
---|
127 | |
---|
128 | "Energy Balance" |
---|
129 | Inlet.F*Inlet.h + Q = OutletL.F*OutletL.h + OutletV.F*OutletV.h; |
---|
130 | |
---|
131 | "Thermal Equilibrium" |
---|
132 | OutletV.T = OutletL.T; |
---|
133 | |
---|
134 | "Mechanical Equilibrium" |
---|
135 | OutletV.P = OutletL.P; |
---|
136 | end |
---|