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 condenser |
---|
17 | *-------------------------------------------------------------------- |
---|
18 | * |
---|
19 | * Streams: |
---|
20 | * * a vapour inlet stream |
---|
21 | * * a liquid outlet stream |
---|
22 | * |
---|
23 | * Assumptions: |
---|
24 | * * perfect mixing of both phases |
---|
25 | * * thermodynamics equilibrium |
---|
26 | * |
---|
27 | * Specify: |
---|
28 | * * the Inlet stream |
---|
29 | * * the Outlet flows |
---|
30 | * |
---|
31 | * Initial: |
---|
32 | * * the condenser temperature (OutletL.T) |
---|
33 | * * the condenser level (Ll) |
---|
34 | * * (NoComps - 1) Outlet compositions |
---|
35 | * |
---|
36 | *---------------------------------------------------------------------- |
---|
37 | * Author: Paula B. Staudt |
---|
38 | * $Id: condenser.mso 200 2007-03-10 19:17:32Z arge $ |
---|
39 | *--------------------------------------------------------------------*# |
---|
40 | |
---|
41 | using "streams"; |
---|
42 | |
---|
43 | Model condenser |
---|
44 | PARAMETERS |
---|
45 | outer PP as Plugin; |
---|
46 | outer NComp as Integer; |
---|
47 | V as volume (Brief="Condenser total volume"); |
---|
48 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
49 | |
---|
50 | VARIABLES |
---|
51 | in InletV as stream(Brief="Vapour inlet stream"); |
---|
52 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
53 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
54 | in Q as heat_rate (Brief="Heat supplied"); |
---|
55 | |
---|
56 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
57 | ML as mol (Brief="Molar liquid holdup"); |
---|
58 | MV as mol (Brief="Molar vapour holdup"); |
---|
59 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
60 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
61 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
62 | Level as length (Brief="Level of liquid phase"); |
---|
63 | |
---|
64 | EQUATIONS |
---|
65 | "Component Molar Balance" |
---|
66 | diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z |
---|
67 | - OutletV.F*OutletV.z; |
---|
68 | |
---|
69 | "Energy Balance" |
---|
70 | diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h |
---|
71 | - 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 - OutletV.P*V; |
---|
78 | |
---|
79 | "Mol fraction normalisation" |
---|
80 | sum(OutletL.z)=1.0; |
---|
81 | sum(OutletL.z)=sum(OutletV.z); |
---|
82 | |
---|
83 | "Liquid Volume" |
---|
84 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
85 | "Vapour Volume" |
---|
86 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
87 | |
---|
88 | "Chemical Equilibrium" |
---|
89 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
90 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
91 | |
---|
92 | "Thermal Equilibrium" |
---|
93 | OutletL.T = OutletV.T; |
---|
94 | |
---|
95 | "Mechanical Equilibrium" |
---|
96 | OutletV.P = OutletL.P; |
---|
97 | |
---|
98 | "Geometry Constraint" |
---|
99 | V = ML*vL + MV*vV; |
---|
100 | |
---|
101 | "Level of liquid phase" |
---|
102 | Level = ML*vL/Across; |
---|
103 | end |
---|
104 | |
---|
105 | |
---|
106 | #*---------------------------------------------------------------------- |
---|
107 | * Model of a Steady State condenser with no thermodynamics equilibrium |
---|
108 | *---------------------------------------------------------------------*# |
---|
109 | Model condenserSteady |
---|
110 | PARAMETERS |
---|
111 | outer PP as Plugin; |
---|
112 | outer NComp as Integer; |
---|
113 | |
---|
114 | VARIABLES |
---|
115 | in InletV as stream(Brief="Vapour inlet stream"); |
---|
116 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
117 | in Q as heat_rate (Brief="Heat supplied"); |
---|
118 | DP as press_delta (Brief="Pressure Drop in the condenser"); |
---|
119 | |
---|
120 | EQUATIONS |
---|
121 | "Molar Balance" |
---|
122 | InletV.F = OutletL.F; |
---|
123 | InletV.z = OutletL.z; |
---|
124 | |
---|
125 | "Energy Balance" |
---|
126 | InletV.F*InletV.h = OutletL.F*OutletL.h + Q; |
---|
127 | |
---|
128 | "Pressure" |
---|
129 | DP = InletV.P - OutletL.P; |
---|
130 | |
---|
131 | "Vapourisation Fraction" |
---|
132 | OutletL.v = 0.0; |
---|
133 | end |
---|
134 | |
---|
135 | #*------------------------------------------------------------------- |
---|
136 | * Condenser with reaction in liquid phase |
---|
137 | *--------------------------------------------------------------------*# |
---|
138 | Model condenserReact |
---|
139 | PARAMETERS |
---|
140 | outer PP as Plugin; |
---|
141 | outer NComp as Integer; |
---|
142 | V as volume (Brief="Condenser total volume"); |
---|
143 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
144 | |
---|
145 | stoic(NComp) as Real(Brief="Stoichiometric matrix"); |
---|
146 | Hr as energy_mol; |
---|
147 | Pstartup as pressure; |
---|
148 | |
---|
149 | VARIABLES |
---|
150 | in InletV as stream(Brief="Vapour inlet stream"); |
---|
151 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
152 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
153 | |
---|
154 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
155 | ML as mol (Brief="Molar liquid holdup"); |
---|
156 | MV as mol (Brief="Molar vapour holdup"); |
---|
157 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
158 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
159 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
160 | Level as length (Brief="Level of liquid phase"); |
---|
161 | Q as heat_rate (Brief="Heat supplied"); |
---|
162 | Vol as volume; |
---|
163 | r as reaction_mol (Brief = "Specific reaction rate"); |
---|
164 | C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); |
---|
165 | |
---|
166 | EQUATIONS |
---|
167 | "Molar Concentration" |
---|
168 | OutletL.z = vL * C; |
---|
169 | |
---|
170 | "Component Molar Balance" |
---|
171 | diff(M) = InletV.F*InletV.z - OutletL.F*OutletL.z |
---|
172 | - OutletV.F*OutletV.z + stoic*r*ML*vL; |
---|
173 | |
---|
174 | "Energy Balance" |
---|
175 | diff(E) = InletV.F*InletV.h - OutletL.F*OutletL.h |
---|
176 | - OutletV.F*OutletV.h + Q + Hr * r * ML*vL; |
---|
177 | |
---|
178 | "Molar Holdup" |
---|
179 | M = ML*OutletL.z + MV*OutletV.z; |
---|
180 | |
---|
181 | "Energy Holdup" |
---|
182 | E = ML*OutletL.h + MV*OutletV.h - OutletV.P*V; |
---|
183 | |
---|
184 | "Mol fraction normalisation" |
---|
185 | sum(OutletL.z)=1.0; |
---|
186 | |
---|
187 | "Liquid Volume" |
---|
188 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
189 | "Vapour Volume" |
---|
190 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
191 | |
---|
192 | "Thermal Equilibrium" |
---|
193 | OutletL.T = OutletV.T; |
---|
194 | |
---|
195 | "Mechanical Equilibrium" |
---|
196 | OutletV.P = OutletL.P; |
---|
197 | |
---|
198 | "Geometry Constraint" |
---|
199 | V = ML*vL + MV*vV; |
---|
200 | |
---|
201 | Vol = ML*vL; |
---|
202 | |
---|
203 | "Level of liquid phase" |
---|
204 | Level = ML*vL/Across; |
---|
205 | |
---|
206 | "Chemical Equilibrium" |
---|
207 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
208 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
209 | |
---|
210 | sum(OutletL.z)=sum(OutletV.z); |
---|
211 | end |
---|