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