[698] | 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 |
---|
[841] | 17 | * $Id$ |
---|
[698] | 18 | *--------------------------------------------------------------------*# |
---|
| 19 | |
---|
[879] | 20 | using "tank"; |
---|
[698] | 21 | |
---|
[841] | 22 | Model thermosyphon |
---|
[698] | 23 | |
---|
[794] | 24 | ATTRIBUTES |
---|
[698] | 25 | Pallete = true; |
---|
[841] | 26 | Icon = "icon/Thermosyphon"; |
---|
| 27 | Brief = "Model of a Steady State reboiler thermosyphon."; |
---|
[698] | 28 | Info = |
---|
[794] | 29 | "== ASSUMPTIONS == |
---|
[698] | 30 | * perfect mixing of both phases; |
---|
| 31 | * no thermodynamics equilibrium; |
---|
[794] | 32 | |
---|
| 33 | == SET == |
---|
| 34 | * the pressure drop in the reboiler; |
---|
[808] | 35 | * the FlowConstant that relates the Flow through the reboiler and the heat duty |
---|
| 36 | ** Flow^3 = FlowConstant*InletQ |
---|
[794] | 37 | |
---|
| 38 | == SPECIFY == |
---|
[735] | 39 | * the InletLiquid stream; |
---|
[794] | 40 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model) |
---|
| 41 | OR the outlet temperature (OutletVapour.T); |
---|
| 42 | |
---|
| 43 | == OPTIONAL == |
---|
| 44 | * the reboiler model has two control ports |
---|
| 45 | ** TI OutletVapour Temperature Indicator; |
---|
| 46 | ** PI OutletVapour Pressure Indicator; |
---|
[698] | 47 | "; |
---|
| 48 | |
---|
| 49 | PARAMETERS |
---|
[794] | 50 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 51 | outer NComp as Integer (Brief="Number of Components"); |
---|
| 52 | Pdrop as press_delta (Brief="Pressure Drop in the reboiler", Symbol = "\Delta P"); |
---|
[805] | 53 | FlowConstant as Real (Brief = "Flow Constant"); |
---|
| 54 | k as Real (Brief = "Flow Constant", Hidden = true, Unit='mol^3/(kg*m^2)'); |
---|
[698] | 55 | |
---|
[805] | 56 | SET |
---|
| 57 | |
---|
| 58 | k = 1*'mol^3/(kg*m^2)'; |
---|
| 59 | |
---|
[698] | 60 | VARIABLES |
---|
[841] | 61 | in InletLiquid as stream (Brief="Liquid inlet stream", PosX=0.44, PosY=1, Symbol="_{inL}"); |
---|
| 62 | out OutletVapour as streamPH (Brief="Vapour outlet stream", PosX=0, PosY=0.09, Symbol="_{outV}"); |
---|
| 63 | in InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.77, Symbol="Q_{in}", Protected = true); |
---|
[794] | 64 | |
---|
[841] | 65 | out TI as control_signal (Brief="Temperature Indicator of Reboiler", Protected = true, PosX=1, PosY=0.57); |
---|
| 66 | out PI as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=1, PosY=0.35); |
---|
[698] | 67 | |
---|
| 68 | EQUATIONS |
---|
| 69 | |
---|
[784] | 70 | "Molar Flow Balance" |
---|
[735] | 71 | InletLiquid.F = OutletVapour.F; |
---|
[784] | 72 | |
---|
| 73 | "Molar Composition Balance" |
---|
[735] | 74 | InletLiquid.z = OutletVapour.z; |
---|
[698] | 75 | |
---|
| 76 | "Energy Balance" |
---|
[735] | 77 | InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h; |
---|
[698] | 78 | |
---|
[784] | 79 | "Pressure Drop" |
---|
| 80 | OutletVapour.P = InletLiquid.P - Pdrop; |
---|
[698] | 81 | |
---|
[794] | 82 | "Temperature indicator" |
---|
| 83 | TI * 'K' = OutletVapour.T; |
---|
| 84 | |
---|
| 85 | "Pressure indicator" |
---|
| 86 | PI * 'atm' = OutletVapour.P; |
---|
[805] | 87 | |
---|
[841] | 88 | "Flow through the thermosyphon reboiler" |
---|
[805] | 89 | OutletVapour.F^3 = FlowConstant*k*InletQ; |
---|
[794] | 90 | |
---|
[698] | 91 | end |
---|
| 92 | |
---|
[841] | 93 | Model reboilerSteady |
---|
[805] | 94 | |
---|
| 95 | ATTRIBUTES |
---|
| 96 | Pallete = true; |
---|
[841] | 97 | Icon = "icon/ReboilerSteady"; |
---|
| 98 | Brief = "Model of a Steady State reboiler with no thermodynamics equilibrium - thermosyphon."; |
---|
[805] | 99 | Info = |
---|
[841] | 100 | "Model of a Steady State reboiler with two approaches: |
---|
| 101 | **Fake Conditions: fake calculation of vaporisation fraction and output temperature, but with a real |
---|
| 102 | calculation of the output stream enthalpy. |
---|
| 103 | |
---|
| 104 | **Flash PH: in the outlet stream a PH Flash is performed to obtain the outlet conditions. |
---|
| 105 | |
---|
| 106 | == ASSUMPTIONS == |
---|
[805] | 107 | * perfect mixing of both phases; |
---|
| 108 | * no thermodynamics equilibrium; |
---|
| 109 | |
---|
| 110 | == SET == |
---|
[841] | 111 | * the option Flash_Calculation |
---|
| 112 | * the fake Outlet temperature; |
---|
| 113 | * the fake outlet vapour fraction; |
---|
[805] | 114 | * the pressure drop in the reboiler; |
---|
[808] | 115 | * the FlowConstant that relates the Flow through the reboiler and the heat duty |
---|
| 116 | ** Flow^3 = FlowConstant*InletQ |
---|
[805] | 117 | |
---|
| 118 | == SPECIFY == |
---|
| 119 | * the InletLiquid stream; |
---|
| 120 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model) |
---|
| 121 | OR the outlet temperature (OutletVapour.T); |
---|
| 122 | |
---|
| 123 | == OPTIONAL == |
---|
| 124 | * the reboiler model has two control ports |
---|
| 125 | ** TI OutletVapour Temperature Indicator; |
---|
| 126 | ** PI OutletVapour Pressure Indicator; |
---|
| 127 | "; |
---|
| 128 | |
---|
| 129 | PARAMETERS |
---|
| 130 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
| 131 | outer NComp as Integer (Brief="Number of Components"); |
---|
[841] | 132 | Flash_Calculation as Switcher (Brief="Flash Calculation", Valid=["Flash_PH","Fake_Conditions"],Default="Fake_Conditions"); |
---|
[805] | 133 | Pdrop as press_delta (Brief="Pressure Drop in the reboiler", Symbol = "\Delta P"); |
---|
| 134 | FlowConstant as Real (Brief = "Flow Constant"); |
---|
[841] | 135 | Fake_Temperature as temperature (Brief="Fake temperature", Symbol = "T_{fake}"); |
---|
| 136 | Fake_Vfrac as fraction (Brief="Fake vapour fraction", Symbol = "v_{fake}"); |
---|
[805] | 137 | k as Real (Brief = "Flow Constant", Hidden = true, Unit='mol^3/(kg*m^2)'); |
---|
| 138 | |
---|
| 139 | SET |
---|
| 140 | |
---|
| 141 | k = 1*'mol^3/(kg*m^2)'; |
---|
| 142 | |
---|
| 143 | VARIABLES |
---|
[841] | 144 | in InletLiquid as stream (Brief="Liquid inlet stream", PosX=0.345, PosY=1, Symbol="_{inL}", Protected = true); |
---|
| 145 | out OutletVapour as stream (Brief="Vapour outlet stream", PosX=0.17, PosY=0, Symbol="_{outV}", Protected = true); |
---|
| 146 | in InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.08, Symbol="Q_{in}", Protected = true); |
---|
[805] | 147 | |
---|
[841] | 148 | x(NComp) as fraction (Brief = "Liquid Molar Fraction",Hidden=true); |
---|
| 149 | y(NComp) as fraction (Brief = "Vapour Molar Fraction",Hidden=true); |
---|
| 150 | |
---|
| 151 | out TI as control_signal (Brief="Temperature Indicator of Reboiler", Protected = true, PosX=0.44, PosY=0); |
---|
| 152 | out PI as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.35, PosY=0); |
---|
| 153 | |
---|
[805] | 154 | EQUATIONS |
---|
| 155 | |
---|
| 156 | "Molar Flow Balance" |
---|
| 157 | InletLiquid.F = OutletVapour.F; |
---|
| 158 | |
---|
| 159 | "Molar Composition Balance" |
---|
| 160 | InletLiquid.z = OutletVapour.z; |
---|
| 161 | |
---|
| 162 | "Energy Balance" |
---|
| 163 | InletLiquid.F*InletLiquid.h + InletQ = OutletVapour.F*OutletVapour.h; |
---|
| 164 | |
---|
| 165 | "Pressure Drop" |
---|
| 166 | OutletVapour.P = InletLiquid.P - Pdrop; |
---|
| 167 | |
---|
| 168 | "Temperature indicator" |
---|
| 169 | TI * 'K' = OutletVapour.T; |
---|
| 170 | |
---|
| 171 | "Pressure indicator" |
---|
| 172 | PI * 'atm' = OutletVapour.P; |
---|
| 173 | |
---|
[841] | 174 | "Flow through the reboiler" |
---|
[805] | 175 | OutletVapour.F^3 = FlowConstant*k*InletQ; |
---|
| 176 | |
---|
[841] | 177 | switch Flash_Calculation |
---|
[805] | 178 | |
---|
[841] | 179 | case "Flash_PH": |
---|
[805] | 180 | |
---|
[866] | 181 | #*"Flash Calculation" |
---|
[841] | 182 | [OutletVapour.v, x, y] = PP.FlashPH(OutletVapour.P, OutletVapour.h, OutletVapour.z); |
---|
[698] | 183 | |
---|
[841] | 184 | "Enthalpy" |
---|
| 185 | OutletVapour.h = (1-OutletVapour.v)*PP.LiquidEnthalpy(OutletVapour.T, OutletVapour.P, x) + |
---|
| 186 | OutletVapour.v*PP.VapourEnthalpy(OutletVapour.T, OutletVapour.P, y); |
---|
[866] | 187 | *# |
---|
[794] | 188 | |
---|
[866] | 189 | "Fake Vapourisation Fraction" |
---|
| 190 | OutletVapour.v = Fake_Vfrac; |
---|
| 191 | |
---|
| 192 | "Fake output temperature" |
---|
| 193 | OutletVapour.T = Fake_Temperature; |
---|
| 194 | |
---|
| 195 | "Fake Liquid Molar Fraction" |
---|
| 196 | x = 1; |
---|
| 197 | |
---|
| 198 | "Fake Vapour Molar Fraction" |
---|
| 199 | y = 1; |
---|
| 200 | |
---|
[841] | 201 | case "Fake_Conditions": |
---|
[794] | 202 | |
---|
[808] | 203 | "Fake Vapourisation Fraction" |
---|
| 204 | OutletVapour.v = Fake_Vfrac; |
---|
[806] | 205 | |
---|
[794] | 206 | "Fake output temperature" |
---|
[808] | 207 | OutletVapour.T = Fake_Temperature; |
---|
[806] | 208 | |
---|
[841] | 209 | "Fake Liquid Molar Fraction" |
---|
| 210 | x = 1; |
---|
[806] | 211 | |
---|
[841] | 212 | "Fake Vapour Molar Fraction" |
---|
| 213 | y = 1; |
---|
[794] | 214 | |
---|
[698] | 215 | end |
---|
| 216 | |
---|
[841] | 217 | end |
---|
| 218 | |
---|
[698] | 219 | Model reboilerReact |
---|
| 220 | ATTRIBUTES |
---|
[721] | 221 | Pallete = false; |
---|
[698] | 222 | Icon = "icon/Reboiler"; |
---|
| 223 | Brief = "Model of a dynamic reboiler with reaction."; |
---|
| 224 | Info = |
---|
| 225 | "== Assumptions == |
---|
| 226 | * perfect mixing of both phases; |
---|
| 227 | * thermodynamics equilibrium; |
---|
| 228 | * no liquid entrainment in the vapour stream; |
---|
| 229 | * the reaction takes place only in the liquid phase. |
---|
| 230 | |
---|
| 231 | == Specify == |
---|
| 232 | * the kinetics variables; |
---|
| 233 | * the inlet stream; |
---|
| 234 | * the liquid inlet stream; |
---|
[735] | 235 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
[698] | 236 | * the heat supply. |
---|
| 237 | |
---|
| 238 | == Initial Conditions == |
---|
[735] | 239 | * the reboiler temperature (OutletLiquid.T); |
---|
[698] | 240 | * the reboiler liquid level (Level); |
---|
[735] | 241 | * (NoComps - 1) OutletLiquid (OR OutletVapour) compositions. |
---|
[698] | 242 | "; |
---|
| 243 | |
---|
[721] | 244 | PARAMETERS |
---|
[698] | 245 | outer PP as Plugin(Type="PP"); |
---|
| 246 | outer NComp as Integer; |
---|
| 247 | Across as area (Brief="Cross Section Area of reboiler"); |
---|
| 248 | V as volume (Brief="Total volume of reboiler"); |
---|
| 249 | |
---|
| 250 | stoic(NComp) as Real(Brief="Stoichiometric matrix"); |
---|
| 251 | Hr as energy_mol; |
---|
| 252 | |
---|
[721] | 253 | Initial_Level as length (Brief="Initial Level of liquid phase"); |
---|
| 254 | Initial_Temperature as temperature (Brief="Initial Temperature of Reboiler"); |
---|
| 255 | Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition"); |
---|
| 256 | |
---|
| 257 | VARIABLES |
---|
[735] | 258 | in InletLiquid as stream (Brief="Liquid inlet stream", PosX=0, PosY=0.5254, Symbol="_{inL}"); |
---|
| 259 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.2413, PosY=1, Symbol="_{outL}"); |
---|
| 260 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.5079, PosY=0, Symbol="_{outV}"); |
---|
[721] | 261 | InletQ as power (Brief="Heat supplied", PosX=1, PosY=0.6123, Symbol="_{in}"); |
---|
[698] | 262 | |
---|
[721] | 263 | M(NComp) as mol (Brief="Molar Holdup in the tray"); |
---|
| 264 | ML as mol (Brief="Molar liquid holdup"); |
---|
| 265 | MV as mol (Brief="Molar vapour holdup"); |
---|
| 266 | E as energy (Brief="Total Energy Holdup on tray"); |
---|
| 267 | vL as volume_mol (Brief="Liquid Molar Volume"); |
---|
| 268 | vV as volume_mol (Brief="Vapour Molar volume"); |
---|
| 269 | Level as length (Brief="Level of liquid phase"); |
---|
| 270 | Vol as volume; |
---|
| 271 | rhoV as dens_mass; |
---|
| 272 | r3 as reaction_mol (Brief = "Reaction resulting ethyl acetate", DisplayUnit = 'mol/l/s'); |
---|
| 273 | C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); |
---|
[698] | 274 | |
---|
[721] | 275 | INITIAL |
---|
| 276 | |
---|
| 277 | Level = Initial_Level; |
---|
[735] | 278 | OutletLiquid.T = Initial_Temperature; |
---|
| 279 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
[721] | 280 | |
---|
| 281 | EQUATIONS |
---|
| 282 | "Molar Concentration" |
---|
[735] | 283 | OutletLiquid.z = vL * C; |
---|
[698] | 284 | |
---|
[721] | 285 | "Reaction" |
---|
[735] | 286 | r3 = exp(-7150*'K'/OutletLiquid.T)*(4.85e4*C(1)*C(2) - 1.23e4*C(3)*C(4)) * 'l/mol/s'; |
---|
[698] | 287 | |
---|
[721] | 288 | "Component Molar Balance" |
---|
[735] | 289 | diff(M)= InletLiquid.F*InletLiquid.z- OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z + stoic*r3*ML*vL; |
---|
[698] | 290 | |
---|
[721] | 291 | "Energy Balance" |
---|
[735] | 292 | diff(E) = InletLiquid.F*InletLiquid.h- OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ + Hr * r3 * vL*ML; |
---|
[698] | 293 | |
---|
[721] | 294 | "Molar Holdup" |
---|
[735] | 295 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
[698] | 296 | |
---|
[721] | 297 | "Energy Holdup" |
---|
[735] | 298 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*V; |
---|
[698] | 299 | |
---|
[721] | 300 | "Mol fraction normalisation" |
---|
[735] | 301 | sum(OutletLiquid.z)=1.0; |
---|
[698] | 302 | |
---|
[721] | 303 | "Liquid Volume" |
---|
[735] | 304 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
[721] | 305 | |
---|
| 306 | "Vapour Volume" |
---|
[735] | 307 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
[721] | 308 | |
---|
| 309 | "Vapour Density" |
---|
[735] | 310 | rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
[698] | 311 | |
---|
[721] | 312 | "Level of liquid phase" |
---|
[698] | 313 | Level = ML*vL/Across; |
---|
| 314 | |
---|
| 315 | Vol = ML*vL; |
---|
| 316 | |
---|
[721] | 317 | "Mechanical Equilibrium" |
---|
[735] | 318 | OutletLiquid.P = OutletVapour.P; |
---|
[698] | 319 | |
---|
[721] | 320 | "Thermal Equilibrium" |
---|
[735] | 321 | OutletLiquid.T = OutletVapour.T; |
---|
[698] | 322 | |
---|
[721] | 323 | "Geometry Constraint" |
---|
[698] | 324 | V = ML*vL + MV*vV; |
---|
| 325 | |
---|
[721] | 326 | "Chemical Equilibrium" |
---|
[735] | 327 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = |
---|
| 328 | PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
[698] | 329 | |
---|
[735] | 330 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
[698] | 331 | |
---|
| 332 | end |
---|
[757] | 333 | |
---|
[793] | 334 | Model reboiler |
---|
[757] | 335 | |
---|
[767] | 336 | ATTRIBUTES |
---|
[793] | 337 | Pallete = true; |
---|
| 338 | Icon = "icon/Reboiler"; |
---|
[767] | 339 | Brief = "Model of a dynamic reboiler - kettle with control."; |
---|
[757] | 340 | Info = |
---|
[793] | 341 | "== ASSUMPTIONS == |
---|
[757] | 342 | * perfect mixing of both phases; |
---|
| 343 | * thermodynamics equilibrium; |
---|
| 344 | * no liquid entrainment in the vapour stream. |
---|
[869] | 345 | |
---|
| 346 | == SET == |
---|
| 347 | *Orientation: vessel position - vertical or horizontal; |
---|
| 348 | *Heads (bottom and top heads are identical) |
---|
| 349 | **elliptical: 2:1 elliptical heads (25% of vessel diameter); |
---|
| 350 | **hemispherical: hemispherical heads (50% of vessel diameter); |
---|
| 351 | *Diameter: Vessel diameter; |
---|
| 352 | *Lenght: Side length of the cylinder shell; |
---|
| 353 | |
---|
[793] | 354 | == SPECIFY == |
---|
| 355 | * the InletLiquid stream; |
---|
[757] | 356 | * the outlet flows: OutletVapour.F and OutletLiquid.F; |
---|
[793] | 357 | * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model). |
---|
[757] | 358 | |
---|
[793] | 359 | == OPTIONAL == |
---|
| 360 | * the reboiler model has three control ports |
---|
| 361 | ** TI OutletLiquid Temperature Indicator; |
---|
| 362 | ** PI OutletLiquid Pressure Indicator; |
---|
| 363 | ** LI Level Indicator of Reboiler; |
---|
| 364 | |
---|
| 365 | == INITIAL CONDITIONS == |
---|
[757] | 366 | * Initial_Temperature : the reboiler temperature (OutletLiquid.T); |
---|
[821] | 367 | * Levelpercent_Initial : the reboiler liquid level in percent (LI); |
---|
[757] | 368 | * Initial_Composition : (NoComps) OutletLiquid compositions. |
---|
| 369 | "; |
---|
| 370 | |
---|
| 371 | PARAMETERS |
---|
[793] | 372 | outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); |
---|
[757] | 373 | outer NComp as Integer (Brief="Number of Components"); |
---|
| 374 | |
---|
[821] | 375 | Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); |
---|
[793] | 376 | Initial_Temperature as temperature (Brief="Initial Temperature of Reboiler"); |
---|
| 377 | Initial_Composition(NComp) as positive (Brief="Initial Liquid Composition",Lower=1E-6); |
---|
[757] | 378 | |
---|
| 379 | VARIABLES |
---|
| 380 | |
---|
[879] | 381 | Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); |
---|
| 382 | |
---|
[793] | 383 | in InletLiquid as stream (Brief="Liquid inlet stream", PosX=0.17, PosY=1, Symbol="_{in}^{Liquid}"); |
---|
| 384 | out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.53, PosY=1, Symbol="_{out}^{Liquid}"); |
---|
| 385 | out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.17, PosY=0, Symbol="_{out}^{Vapour}"); |
---|
| 386 | in InletQ as power (Brief="Heat supplied", Protected = true, PosX=1, PosY=0.08, Symbol="Q_{in}"); |
---|
[757] | 387 | |
---|
[793] | 388 | out TI as control_signal (Brief="Temperature Indicator of Reboiler", Protected = true, PosX=0.44, PosY=0); |
---|
| 389 | out LI as control_signal (Brief="Level Indicator of Reboiler", Protected = true, PosX=0.53, PosY=0); |
---|
| 390 | out PI as control_signal (Brief="Pressure Indicator of Reboiler", Protected = true, PosX=0.35, PosY=0); |
---|
[757] | 391 | |
---|
[793] | 392 | M(NComp) as mol (Brief="Molar Holdup in the tray", Protected = true); |
---|
| 393 | ML as mol (Brief="Molar liquid holdup", Protected = true); |
---|
| 394 | MV as mol (Brief="Molar vapour holdup", Protected = true); |
---|
| 395 | E as energy (Brief="Total Energy Holdup on tray", Protected = true); |
---|
| 396 | vL as volume_mol (Brief="Liquid Molar Volume", Protected = true); |
---|
| 397 | vV as volume_mol (Brief="Vapour Molar volume", Protected = true); |
---|
| 398 | rhoV as dens_mass (Brief="Vapour Density", Protected = true, Symbol="\rho"); |
---|
| 399 | Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); |
---|
[757] | 400 | |
---|
| 401 | INITIAL |
---|
| 402 | |
---|
[821] | 403 | "Initial level Percent" |
---|
| 404 | LI = Levelpercent_Initial; |
---|
[757] | 405 | |
---|
[793] | 406 | "Initial Temperature" |
---|
| 407 | OutletLiquid.T = Initial_Temperature; |
---|
| 408 | |
---|
| 409 | "Initial Composition" |
---|
| 410 | OutletLiquid.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); |
---|
| 411 | |
---|
[757] | 412 | EQUATIONS |
---|
[793] | 413 | |
---|
[757] | 414 | "Component Molar Balance" |
---|
| 415 | diff(M)= InletLiquid.F*InletLiquid.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z; |
---|
| 416 | |
---|
| 417 | "Energy Balance" |
---|
| 418 | diff(E) = InletLiquid.F*InletLiquid.h - OutletLiquid.F*OutletLiquid.h - OutletVapour.F*OutletVapour.h + InletQ; |
---|
| 419 | |
---|
| 420 | "Molar Holdup" |
---|
| 421 | M = ML*OutletLiquid.z + MV*OutletVapour.z; |
---|
| 422 | |
---|
| 423 | "Energy Holdup" |
---|
[879] | 424 | E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*Geometry.Vtotal; |
---|
[757] | 425 | |
---|
[767] | 426 | "Mol Fraction Normalisation" |
---|
[757] | 427 | sum(OutletLiquid.z)=1.0; |
---|
[767] | 428 | |
---|
| 429 | "Mol fraction Constraint" |
---|
[757] | 430 | sum(OutletLiquid.z)=sum(OutletVapour.z); |
---|
| 431 | |
---|
| 432 | "Vapour Density" |
---|
| 433 | rhoV = PP.VapourDensity(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
| 434 | |
---|
| 435 | "Liquid Volume" |
---|
| 436 | vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z); |
---|
| 437 | |
---|
| 438 | "Vapour Volume" |
---|
| 439 | vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z); |
---|
| 440 | |
---|
| 441 | "Chemical Equilibrium" |
---|
| 442 | PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z = PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z; |
---|
| 443 | |
---|
| 444 | "Mechanical Equilibrium" |
---|
| 445 | OutletLiquid.P = OutletVapour.P; |
---|
| 446 | |
---|
| 447 | "Thermal Equilibrium" |
---|
| 448 | OutletLiquid.T = OutletVapour.T; |
---|
| 449 | |
---|
[768] | 450 | "Pressure Drop" |
---|
| 451 | OutletLiquid.P = InletLiquid.P - Pdrop; |
---|
| 452 | |
---|
[757] | 453 | "Geometry Constraint" |
---|
[879] | 454 | Geometry.Vtotal = ML*vL + MV*vV; |
---|
[757] | 455 | |
---|
[869] | 456 | "Liquid Level" |
---|
[879] | 457 | ML * vL = Geometry.Vfilled; |
---|
[757] | 458 | |
---|
[767] | 459 | "Temperature Indicator" |
---|
[793] | 460 | TI * 'K' = OutletLiquid.T; |
---|
[764] | 461 | |
---|
[767] | 462 | "Pressure Indicator" |
---|
[793] | 463 | PI * 'atm' = OutletLiquid.P; |
---|
[767] | 464 | |
---|
[764] | 465 | "Level indicator" |
---|
[879] | 466 | LI*Geometry.Vtotal= Geometry.Vfilled; |
---|
[764] | 467 | |
---|
[757] | 468 | end |
---|