[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: tray.mso 270 2007-06-16 19:18:47Z paula $ |
---|
| 18 | *--------------------------------------------------------------------*# |
---|
| 19 | |
---|
| 20 | using "streams"; |
---|
| 21 | |
---|
| 22 | Model trayBasic |
---|
[270] | 23 | ATTRIBUTES |
---|
| 24 | Pallete = false; |
---|
| 25 | Icon = "Tray"; |
---|
| 26 | Brief = "Basic equations of a tray column model."; |
---|
| 27 | Info = |
---|
| 28 | "This model contains only the main equations of a column tray equilibrium model without |
---|
| 29 | the hidraulic equations. |
---|
| 30 | |
---|
| 31 | Assumptions |
---|
| 32 | * both phases (liquid and vapour) exists all the time; |
---|
| 33 | * thermodymanic equilibrium with Murphree plate efficiency; |
---|
| 34 | * no entrainment of liquid or vapour phase; |
---|
| 35 | * no weeping; |
---|
| 36 | * the dymanics in the downcomer are neglected. |
---|
| 37 | "; |
---|
| 38 | |
---|
[1] | 39 | PARAMETERS |
---|
[262] | 40 | outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); |
---|
| 41 | outer NComp as Integer; |
---|
[1] | 42 | V as volume(Brief="Total Volume of the tray"); |
---|
| 43 | Q as heat_rate (Brief="Rate of heat supply"); |
---|
| 44 | Ap as area (Brief="Plate area = Atray - Adowncomer"); |
---|
| 45 | |
---|
| 46 | VARIABLES |
---|
| 47 | in Inlet as stream; |
---|
| 48 | in InletL as stream; |
---|
| 49 | in InletV as stream; |
---|
[124] | 50 | out OutletL as liquid_stream; |
---|
| 51 | out OutletV as vapour_stream; |
---|
[1] | 52 | |
---|
| 53 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
| 54 | ML as mol (Brief="Molar liquid holdup"); |
---|
| 55 | MV as mol (Brief="Molar vapour holdup"); |
---|
| 56 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
| 57 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
| 58 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
| 59 | Level as length (Brief="Height of clear liquid on plate"); |
---|
| 60 | yideal(NComp) as fraction; |
---|
| 61 | Emv as Real (Brief = "Murphree efficiency"); |
---|
| 62 | |
---|
| 63 | EQUATIONS |
---|
| 64 | "Component Molar Balance" |
---|
| 65 | diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z |
---|
| 66 | - OutletL.F*OutletL.z - OutletV.F*OutletV.z; |
---|
| 67 | |
---|
| 68 | "Energy Balance" |
---|
| 69 | diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h |
---|
| 70 | - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ); |
---|
| 71 | |
---|
| 72 | "Molar Holdup" |
---|
| 73 | M = ML*OutletL.z + MV*OutletV.z; |
---|
| 74 | |
---|
| 75 | "Energy Holdup" |
---|
| 76 | E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; |
---|
| 77 | |
---|
| 78 | "Mol fraction normalisation" |
---|
| 79 | sum(OutletL.z)= 1.0; |
---|
| 80 | sum(OutletL.z)= sum(OutletV.z); |
---|
| 81 | |
---|
| 82 | "Liquid Volume" |
---|
| 83 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
| 84 | "Vapour Volume" |
---|
| 85 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
| 86 | |
---|
| 87 | "Chemical Equilibrium" |
---|
| 88 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
[60] | 89 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; |
---|
[1] | 90 | |
---|
| 91 | "Murphree Efficiency" |
---|
| 92 | OutletV.z = Emv * (yideal - InletV.z) + InletV.z; |
---|
| 93 | |
---|
| 94 | "Thermal Equilibrium" |
---|
| 95 | OutletV.T = OutletL.T; |
---|
| 96 | |
---|
| 97 | "Mechanical Equilibrium" |
---|
| 98 | OutletV.P = OutletL.P; |
---|
| 99 | |
---|
| 100 | "Geometry Constraint" |
---|
| 101 | V = ML* vL + MV*vV; |
---|
| 102 | |
---|
| 103 | "Level of clear liquid over the weir" |
---|
| 104 | Level = ML*vL/Ap; |
---|
| 105 | end |
---|
| 106 | |
---|
| 107 | Model tray as trayBasic |
---|
[270] | 108 | ATTRIBUTES |
---|
| 109 | Pallete = false; |
---|
| 110 | Icon = "Tray"; |
---|
| 111 | Brief = "Complete model of a column tray."; |
---|
| 112 | Info = |
---|
| 113 | "Specify: |
---|
| 114 | * the Feed stream |
---|
| 115 | * the Liquid inlet stream |
---|
| 116 | * the Vapour inlet stream |
---|
| 117 | * the Vapour outlet flow (OutletV.F) |
---|
| 118 | |
---|
| 119 | Initial: |
---|
| 120 | * the plate temperature (OutletL.T) |
---|
| 121 | * the liquid height (Level) OR the liquid flow OutletL.F |
---|
| 122 | * (NoComps - 1) OutletL compositions |
---|
| 123 | "; |
---|
[1] | 124 | |
---|
| 125 | PARAMETERS |
---|
| 126 | Ah as area (Brief="Total holes area"); |
---|
| 127 | lw as length (Brief="Weir length"); |
---|
| 128 | g as acceleration (Default=9.81); |
---|
| 129 | hw as length (Brief="Weir height"); |
---|
| 130 | beta as fraction (Brief="Aeration fraction"); |
---|
| 131 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
| 132 | |
---|
| 133 | VARIABLES |
---|
| 134 | rhoL as dens_mass; |
---|
| 135 | rhoV as dens_mass; |
---|
| 136 | |
---|
| 137 | EQUATIONS |
---|
| 138 | "Liquid Density" |
---|
| 139 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
| 140 | "Vapour Density" |
---|
| 141 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
| 142 | |
---|
[124] | 143 | if Level > (beta * hw) then |
---|
[1] | 144 | "Francis Equation" |
---|
[209] | 145 | OutletL.F = 1.84*'1/s'*lw*((Level-(beta*hw))/(beta))^2/vL; |
---|
[1] | 146 | else |
---|
| 147 | "Low level" |
---|
[209] | 148 | OutletL.F = 0 * 'mol/h'; |
---|
[1] | 149 | end |
---|
| 150 | |
---|
| 151 | end |
---|
| 152 | |
---|
[38] | 153 | #*------------------------------------------------------------------- |
---|
| 154 | * Model of a tray with reaction |
---|
| 155 | *-------------------------------------------------------------------*# |
---|
| 156 | Model trayReact |
---|
[270] | 157 | ATTRIBUTES |
---|
| 158 | Pallete = false; |
---|
| 159 | Icon = "Tray"; |
---|
| 160 | Brief = "Model of a tray with reaction."; |
---|
| 161 | Info = |
---|
| 162 | "Assumptions |
---|
| 163 | * both phases (liquid and vapour) exists all the time; |
---|
| 164 | * thermodymanic equilibrium with Murphree plate efficiency; |
---|
| 165 | * no entrainment of liquid or vapour phase; |
---|
| 166 | * no weeping; |
---|
| 167 | * the dymanics in the downcomer are neglected. |
---|
| 168 | |
---|
| 169 | Specify: |
---|
| 170 | * the Feed stream; |
---|
| 171 | * the Liquid inlet stream; |
---|
| 172 | * the Vapour inlet stream; |
---|
| 173 | * the Vapour outlet flow (OutletV.F); |
---|
| 174 | * the reaction related variables. |
---|
| 175 | |
---|
| 176 | Initial: |
---|
| 177 | * the plate temperature (OutletL.T) |
---|
| 178 | * the liquid height (Level) OR the liquid flow OutletL.F |
---|
| 179 | * (NoComps - 1) OutletL compositions |
---|
| 180 | "; |
---|
[38] | 181 | |
---|
| 182 | PARAMETERS |
---|
[243] | 183 | outer PP as Plugin(Type="PP"); |
---|
[124] | 184 | outer NComp as Integer; |
---|
[38] | 185 | V as volume(Brief="Total Volume of the tray"); |
---|
| 186 | Q as power (Brief="Rate of heat supply"); |
---|
| 187 | Ap as area (Brief="Plate area = Atray - Adowncomer"); |
---|
| 188 | |
---|
| 189 | Ah as area (Brief="Total holes area"); |
---|
| 190 | lw as length (Brief="Weir length"); |
---|
| 191 | g as acceleration (Default=9.81); |
---|
| 192 | hw as length (Brief="Weir height"); |
---|
| 193 | beta as fraction (Brief="Aeration fraction"); |
---|
| 194 | alfa as fraction (Brief="Dry pressure drop coefficient"); |
---|
| 195 | |
---|
| 196 | stoic(NComp) as Real(Brief="Stoichiometric matrix"); |
---|
| 197 | Hr as energy_mol; |
---|
| 198 | Pstartup as pressure; |
---|
| 199 | |
---|
[243] | 200 | VapourFlow as Switcher(Valid = ["on", "off"], Default = "off"); |
---|
| 201 | LiquidFlow as Switcher(Valid = ["on", "off"], Default = "off"); |
---|
| 202 | |
---|
[38] | 203 | VARIABLES |
---|
| 204 | in Inlet as stream; |
---|
| 205 | in InletL as stream; |
---|
| 206 | in InletV as stream; |
---|
[124] | 207 | out OutletL as liquid_stream; |
---|
| 208 | out OutletV as vapour_stream; |
---|
[38] | 209 | |
---|
| 210 | yideal(NComp) as fraction; |
---|
| 211 | Emv as Real (Brief = "Murphree efficiency"); |
---|
| 212 | |
---|
| 213 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
| 214 | ML as mol (Brief="Molar liquid holdup"); |
---|
| 215 | MV as mol (Brief="Molar vapour holdup"); |
---|
| 216 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
| 217 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
| 218 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
| 219 | Level as length (Brief="Height of clear liquid on plate"); |
---|
| 220 | Vol as volume; |
---|
| 221 | |
---|
| 222 | rhoL as dens_mass; |
---|
| 223 | rhoV as dens_mass; |
---|
[243] | 224 | r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); |
---|
[38] | 225 | C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l"); |
---|
| 226 | |
---|
| 227 | EQUATIONS |
---|
| 228 | "Molar Concentration" |
---|
| 229 | OutletL.z = vL * C; |
---|
| 230 | |
---|
[243] | 231 | "Reaction" |
---|
| 232 | r3 = exp(-7150*'K'/OutletL.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4))*'l/mol/s'; |
---|
| 233 | |
---|
[38] | 234 | "Component Molar Balance" |
---|
| 235 | diff(M)=Inlet.F*Inlet.z + InletL.F*InletL.z + InletV.F*InletV.z |
---|
[243] | 236 | - OutletL.F*OutletL.z - OutletV.F*OutletV.z + stoic*r3*ML*vL; |
---|
[38] | 237 | |
---|
| 238 | "Energy Balance" |
---|
| 239 | diff(E) = ( Inlet.F*Inlet.h + InletL.F*InletL.h + InletV.F*InletV.h |
---|
[243] | 240 | - OutletL.F*OutletL.h - OutletV.F*OutletV.h + Q ) + Hr * r3 * vL*ML; |
---|
[38] | 241 | |
---|
| 242 | "Molar Holdup" |
---|
| 243 | M = ML*OutletL.z + MV*OutletV.z; |
---|
| 244 | |
---|
| 245 | "Energy Holdup" |
---|
| 246 | E = ML*OutletL.h + MV*OutletV.h - OutletL.P*V; |
---|
| 247 | |
---|
| 248 | "Mol fraction normalisation" |
---|
| 249 | sum(OutletL.z)= 1.0; |
---|
| 250 | |
---|
| 251 | "Liquid Volume" |
---|
| 252 | vL = PP.LiquidVolume(OutletL.T, OutletL.P, OutletL.z); |
---|
| 253 | "Vapour Volume" |
---|
| 254 | vV = PP.VapourVolume(OutletV.T, OutletV.P, OutletV.z); |
---|
| 255 | |
---|
| 256 | "Thermal Equilibrium" |
---|
| 257 | OutletV.T = OutletL.T; |
---|
| 258 | |
---|
| 259 | "Mechanical Equilibrium" |
---|
| 260 | OutletV.P = OutletL.P; |
---|
| 261 | |
---|
| 262 | "Level of clear liquid over the weir" |
---|
| 263 | Level = ML*vL/Ap; |
---|
| 264 | |
---|
| 265 | Vol = ML*vL; |
---|
| 266 | |
---|
| 267 | "Liquid Density" |
---|
| 268 | rhoL = PP.LiquidDensity(OutletL.T, OutletL.P, OutletL.z); |
---|
| 269 | "Vapour Density" |
---|
| 270 | rhoV = PP.VapourDensity(InletV.T, InletV.P, InletV.z); |
---|
| 271 | |
---|
[243] | 272 | switch LiquidFlow |
---|
| 273 | case "on": |
---|
[38] | 274 | "Francis Equation" |
---|
[243] | 275 | OutletL.F*vL = 1.84*'1/s'*lw*((Level-(beta*hw)+1e-6*'m')/(beta))^2; |
---|
| 276 | when Level < (beta * hw) switchto "off"; |
---|
| 277 | |
---|
| 278 | case "off": |
---|
[38] | 279 | "Low level" |
---|
[176] | 280 | OutletL.F = 0 * 'mol/h'; |
---|
[243] | 281 | when Level > (beta * hw) + 1e-6*'m' switchto "on"; |
---|
[38] | 282 | end |
---|
| 283 | |
---|
[243] | 284 | switch VapourFlow |
---|
| 285 | case "on": |
---|
| 286 | #InletV.P = OutletV.P + Level*g*rhoL + rhoV*alfa*(InletV.F*vV/Ah)^2; |
---|
| 287 | InletV.F*vV = sqrt((InletV.P - OutletV.P - Level*g*rhoL + 1e-8 * 'atm')/(rhoV*alfa))*Ah; |
---|
| 288 | when InletV.P < OutletV.P + Level*g*rhoL switchto "off"; |
---|
[38] | 289 | |
---|
[243] | 290 | case "off": |
---|
| 291 | InletV.F = 0 * 'mol/s'; |
---|
| 292 | when InletV.P > OutletV.P + Level*g*rhoL + 3e-2 * 'atm' switchto "on"; |
---|
| 293 | #when InletV.P > OutletV.P + Level*beta*g*rhoL + 1e-2 * 'atm' switchto "on"; |
---|
| 294 | end |
---|
[38] | 295 | |
---|
| 296 | "Chemical Equilibrium" |
---|
| 297 | PP.LiquidFugacityCoefficient(OutletL.T, OutletL.P, OutletL.z)*OutletL.z = |
---|
[60] | 298 | PP.VapourFugacityCoefficient(OutletV.T, OutletV.P, yideal)*yideal; |
---|
[38] | 299 | |
---|
| 300 | OutletV.z = Emv * (yideal - InletV.z) + InletV.z; |
---|
| 301 | |
---|
| 302 | sum(OutletL.z)= sum(OutletV.z); |
---|
| 303 | |
---|
| 304 | "Geometry Constraint" |
---|
| 305 | V = ML* vL + MV*vV; |
---|
| 306 | end |
---|