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: reboiler.mso 310 2007-07-13 21:28:33Z arge $ |
---|
18 | *--------------------------------------------------------------------*# |
---|
19 | |
---|
20 | using "streams"; |
---|
21 | |
---|
22 | Model reboiler |
---|
23 | ATTRIBUTES |
---|
24 | Pallete = true; |
---|
25 | Icon = "icon/Reboiler"; |
---|
26 | Brief = "Model of a dynamic reboiler - kettle."; |
---|
27 | Info = " |
---|
28 | <h2>Assumptions</h2> |
---|
29 | <ul> |
---|
30 | <li>perfect mixing of both phases; |
---|
31 | <li>thermodynamics equilibrium; |
---|
32 | <li>no liquid entrainment in the vapour stream. |
---|
33 | </ul> |
---|
34 | |
---|
35 | <h2>Specify</h2> |
---|
36 | <ul> |
---|
37 | <li> the inlet stream; |
---|
38 | <li> the liquid inlet stream; |
---|
39 | <li> the outlet flows: OutletV.F and OutletL.F; |
---|
40 | <li> the heat supply. |
---|
41 | </ul> |
---|
42 | |
---|
43 | <h2>Initial Conditions</h2> |
---|
44 | <ul> |
---|
45 | <li> the reboiler temperature (OutletL.T); |
---|
46 | <li> the reboiler liquid level (Level); |
---|
47 | <li> (NoComps - 1) OutletL (OR OutletV) compositions. |
---|
48 | </ul> |
---|
49 | "; |
---|
50 | |
---|
51 | PARAMETERS |
---|
52 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
53 | outer NComp as Integer; |
---|
54 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
55 | V as volume (Brief="Total volume of reboiler"); |
---|
56 | |
---|
57 | VARIABLES |
---|
58 | in Inlet as stream(Brief="Feed Stream"); |
---|
59 | in InletL as stream(Brief="Liquid inlet stream"); |
---|
60 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
61 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
62 | in InletQ as energy_stream (Brief="Heat supplied"); |
---|
63 | |
---|
64 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
65 | ML as mol (Brief="Molar liquid holdup"); |
---|
66 | MV as mol (Brief="Molar vapour holdup"); |
---|
67 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
68 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
69 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
70 | Level as length (Brief="Level of liquid phase"); |
---|
71 | rhoV as dens_mass (Brief="Vapour Density"); |
---|
72 | |
---|
73 | EQUATIONS |
---|
74 | "Component Molar Balance" |
---|
75 | diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z |
---|
76 | - OutletL.F*OutletL.z - OutletV.F*OutletV.z; |
---|
77 | |
---|
78 | "Energy Balance" |
---|
79 | diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h |
---|
80 | - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ.Q; |
---|
81 | |
---|
82 | "Molar Holdup" |
---|
83 | M = ML*OutletL.z + MV*OutletV.z; |
---|
84 | |
---|
85 | "Energy Holdup" |
---|
86 | E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; |
---|
87 | |
---|
88 | "Mol fraction normalisation" |
---|
89 | sum(OutletL.z)=1.0; |
---|
90 | sum(OutletL.z)=sum(OutletV.z); |
---|
91 | |
---|
92 | "Vapour Density" |
---|
93 | rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z); |
---|
94 | |
---|
95 | "Liquid Volume" |
---|
96 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
97 | |
---|
98 | "Vapour Volume" |
---|
99 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
100 | |
---|
101 | "Chemical Equilibrium" |
---|
102 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
103 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
104 | |
---|
105 | "Mechanical Equilibrium" |
---|
106 | OutletL.P = OutletV.P; |
---|
107 | |
---|
108 | "Thermal Equilibrium" |
---|
109 | OutletL.T = OutletV.T; |
---|
110 | |
---|
111 | "Geometry Constraint" |
---|
112 | V = ML*vL + MV*vV; |
---|
113 | |
---|
114 | "Level of liquid phase" |
---|
115 | Level = ML*vL/Across; |
---|
116 | end |
---|
117 | |
---|
118 | #*---------------------------------------------------------------------- |
---|
119 | * Model of a Steady State reboiler with no thermodynamics equilibrium |
---|
120 | *---------------------------------------------------------------------*# |
---|
121 | Model reboilerSteady |
---|
122 | ATTRIBUTES |
---|
123 | Pallete = true; |
---|
124 | Icon = "icon/ReboilerSteady"; |
---|
125 | Brief = "Model of a Steady State reboiler with no thermodynamics equilibrium - thermosyphon."; |
---|
126 | Info = |
---|
127 | "Assumptions: |
---|
128 | * perfect mixing of both phases; |
---|
129 | * no thermodynamics equilibrium; |
---|
130 | * no liquid entrainment in the vapour stream. |
---|
131 | |
---|
132 | Specify: |
---|
133 | * the InletL stream; |
---|
134 | * the heat supply OR the outlet temperature (OutletV.T); |
---|
135 | "; |
---|
136 | |
---|
137 | PARAMETERS |
---|
138 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
139 | outer NComp as Integer; |
---|
140 | DP as press_delta (Brief="Pressure Drop in the reboiler"); |
---|
141 | |
---|
142 | VARIABLES |
---|
143 | in InletL as stream(Brief="Liquid inlet stream"); |
---|
144 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
145 | in InletQ as energy_stream (Brief="Heat supplied"); |
---|
146 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
147 | rhoV as dens_mass (Brief="Vapour Density"); |
---|
148 | |
---|
149 | EQUATIONS |
---|
150 | "Molar Balance" |
---|
151 | InletL.F = OutletV.F; |
---|
152 | InletL.z = OutletV.z; |
---|
153 | |
---|
154 | "Vapour Volume" |
---|
155 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
156 | |
---|
157 | "Vapour Density" |
---|
158 | rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z); |
---|
159 | |
---|
160 | "Energy Balance" |
---|
161 | InletL.F*InletL.h + InletQ.Q = OutletV.F*OutletV.h; |
---|
162 | |
---|
163 | "Pressure" |
---|
164 | DP = InletL.P - OutletV.P; |
---|
165 | end |
---|
166 | |
---|
167 | #*---------------------------------------------------------------------- |
---|
168 | * Model of a Steady State reboiler with fake calculation of |
---|
169 | * vaporisation fraction and output temperature, but with a real |
---|
170 | * calculation of the output stream enthalpy |
---|
171 | *---------------------------------------------------------------------*# |
---|
172 | Model reboilerSteady_fakeH |
---|
173 | ATTRIBUTES |
---|
174 | Pallete = true; |
---|
175 | Icon = "icon/ReboilerSteady"; |
---|
176 | Brief = "Model of a Steady State reboiler with fake calculation of outlet conditions."; |
---|
177 | Info = |
---|
178 | "Model of a Steady State reboiler with fake calculation of |
---|
179 | vaporisation fraction and output temperature, but with a real |
---|
180 | calculation of the output stream enthalpy. |
---|
181 | "; |
---|
182 | |
---|
183 | PARAMETERS |
---|
184 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
185 | outer NComp as Integer; |
---|
186 | DP as press_delta (Brief="Pressure Drop in the reboiler"); |
---|
187 | k as Real (Brief = "Flow Constant", Unit='mol/J'); |
---|
188 | |
---|
189 | VARIABLES |
---|
190 | in InletL as stream(Brief="Liquid inlet stream"); |
---|
191 | out OutletV as stream(Brief="Vapour outlet stream"); |
---|
192 | in InletQ as energy_stream (Brief="Heat supplied"); |
---|
193 | |
---|
194 | EQUATIONS |
---|
195 | "Molar Balance" |
---|
196 | InletL.F = OutletV.F; |
---|
197 | InletL.z = OutletV.z; |
---|
198 | |
---|
199 | "Energy Balance" |
---|
200 | InletL.F*InletL.h + InletQ.Q = OutletV.F*OutletV.h; |
---|
201 | |
---|
202 | "Pressure" |
---|
203 | DP = InletL.P - OutletV.P; |
---|
204 | |
---|
205 | "Fake Vapourisation Fraction" |
---|
206 | OutletV.v = 1.0; |
---|
207 | |
---|
208 | "Fake output temperature" |
---|
209 | OutletV.T = 300*'K'; |
---|
210 | |
---|
211 | "Pressure Drop through the reboiler" |
---|
212 | OutletV.F = k*InletQ.Q; |
---|
213 | end |
---|
214 | |
---|
215 | #*------------------------------------------------------------------- |
---|
216 | * Model of a dynamic reboiler with reaction |
---|
217 | *-------------------------------------------------------------------*# |
---|
218 | Model reboilerReact |
---|
219 | ATTRIBUTES |
---|
220 | Pallete = true; |
---|
221 | Icon = "icon/Reboiler"; |
---|
222 | Brief = "Model of a dynamic reboiler with reaction."; |
---|
223 | Info = |
---|
224 | "Assumptions: |
---|
225 | * perfect mixing of both phases; |
---|
226 | * thermodynamics equilibrium; |
---|
227 | * no liquid entrainment in the vapour stream; |
---|
228 | * the reaction takes place only in the liquid phase. |
---|
229 | |
---|
230 | Specify: |
---|
231 | * the kinetics variables; |
---|
232 | * the inlet stream; |
---|
233 | * the liquid inlet stream; |
---|
234 | * the outlet flows: OutletV.F and OutletL.F; |
---|
235 | * the heat supply. |
---|
236 | |
---|
237 | Initial Conditions: |
---|
238 | * the reboiler temperature (OutletL.T); |
---|
239 | * the reboiler liquid level (Level); |
---|
240 | * (NoComps - 1) OutletL (OR OutletV) compositions. |
---|
241 | "; |
---|
242 | |
---|
243 | PARAMETERS |
---|
244 | outer PP as Plugin(Type="PP"); |
---|
245 | outer NComp as Integer; |
---|
246 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
247 | V as volume (Brief="Total volume of reboiler"); |
---|
248 | |
---|
249 | stoic(NComp) as Real(Brief="Stoichiometric matrix"); |
---|
250 | Hr as energy_mol; |
---|
251 | Pstartup as pressure; |
---|
252 | |
---|
253 | VARIABLES |
---|
254 | in Inlet as stream(Brief="Feed Stream"); |
---|
255 | in InletL as stream(Brief="Liquid inlet stream"); |
---|
256 | out OutletL as liquid_stream(Brief="Liquid outlet stream"); |
---|
257 | out OutletV as vapour_stream(Brief="Vapour outlet stream"); |
---|
258 | |
---|
259 | in InletQ as energy_stream (Brief="Heat supplied"); |
---|
260 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
261 | ML as mol (Brief="Molar liquid holdup"); |
---|
262 | MV as mol (Brief="Molar vapour holdup"); |
---|
263 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
264 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
265 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
266 | Level as length (Brief="Level of liquid phase"); |
---|
267 | Vol as volume; |
---|
268 | startup as Real; |
---|
269 | rhoV as dens_mass; |
---|
270 | r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); |
---|
271 | C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); |
---|
272 | |
---|
273 | EQUATIONS |
---|
274 | "Molar Concentration" |
---|
275 | OutletL.z = vL * C; |
---|
276 | |
---|
277 | "Reaction" |
---|
278 | r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; |
---|
279 | |
---|
280 | "Component Molar Balance" |
---|
281 | diff(M)= Inlet.F*Inlet.z + InletL.F*InletL.z |
---|
282 | - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL; |
---|
283 | |
---|
284 | "Energy Balance" |
---|
285 | diff(E) = Inlet.F*Inlet.h + InletL.F*InletL.h |
---|
286 | - OutletL.F*OutletL.h - OutletV.F*OutletV.h + InletQ.Q + Hr * r3 * vL*ML; |
---|
287 | |
---|
288 | "Molar Holdup" |
---|
289 | M = ML*OutletL.z + MV*OutletV.z; |
---|
290 | |
---|
291 | "Energy Holdup" |
---|
292 | E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; |
---|
293 | |
---|
294 | "Mol fraction normalisation" |
---|
295 | sum(OutletL.z)=1.0; |
---|
296 | |
---|
297 | "Liquid Volume" |
---|
298 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
299 | "Vapour Volume" |
---|
300 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
301 | "Vapour Density" |
---|
302 | rhoV = PP.VapourDensity(OutletV.T, OutletV.P, OutletV.z); |
---|
303 | |
---|
304 | "Level of liquid phase" |
---|
305 | Level = ML*vL/Across; |
---|
306 | |
---|
307 | Vol = ML*vL; |
---|
308 | |
---|
309 | "Mechanical Equilibrium" |
---|
310 | OutletL.P = OutletV.P; |
---|
311 | |
---|
312 | "Thermal Equilibrium" |
---|
313 | OutletL.T = OutletV.T; |
---|
314 | |
---|
315 | "Geometry Constraint" |
---|
316 | V = ML*vL + MV*vV; |
---|
317 | |
---|
318 | "Chemical Equilibrium" |
---|
319 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
320 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, OutletV.z)*OutletV.z; |
---|
321 | |
---|
322 | sum(OutletL.z)=sum(OutletV.z); |
---|
323 | |
---|
324 | end |
---|