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