Changeset 879 for branches/gui/eml
- Timestamp:
- Nov 9, 2009, 2:11:31 PM (13 years ago)
- Location:
- branches/gui/eml/stage_separators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/condenser.mso
r877 r879 18 18 *--------------------------------------------------------------------*# 19 19 20 using " streams";20 using "tank"; 21 21 22 22 Model condenserSteady … … 303 303 outer NComp as Integer (Brief="Number of Components"); 304 304 305 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi");306 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);307 308 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical");309 Heads as Switcher (Valid=["elliptical","hemispherical"],Default="elliptical");310 311 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}");312 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}");313 314 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}");315 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}");316 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}");317 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");318 319 305 Mw(NComp) as molweight (Brief = "Component Mol Weight",Hidden=true); 320 306 low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); … … 331 317 332 318 VARIABLES 319 320 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); 333 321 334 322 in InletVapour as stream (Brief="Vapour inlet stream", PosX=0.13, PosY=0, Symbol="_{in}^{Vapour}"); … … 348 336 vV as volume_mol (Brief="Vapour Molar volume", Protected = true); 349 337 rho as dens_mass (Brief ="Inlet Vapour Mass Density",Hidden=true, Symbol ="\rho"); 350 Level as length (Brief="Level of liquid phase", Protected = true);351 338 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 352 339 353 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");354 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");355 Across as area (Brief="Cross Section Area of condenser",Protected=true);356 357 340 SET 358 pi = 3.141593;359 g = 9.81 * 'm/(s^2)';360 Vhead_elliptical = (pi*Diameter^3)/12;361 Vhead_hemispherical = (pi*Diameter^3)/6;362 Vcylinder = 0.25*(pi*Diameter^2)*Lenght;363 radius = 0.5*Diameter;364 365 341 Mw = PP.MolecularWeight(); 366 342 low_flow = 1E-6 * 'kmol/h'; … … 381 357 EQUATIONS 382 358 383 switch Orientation384 385 case "vertical":386 387 "Vessel Cross Section Area"388 Across = 0.25*(pi*Diameter^2);389 390 switch Heads391 392 case "elliptical":393 394 "Vessel Total Volume"395 Vtotal = Vhead_elliptical + Vcylinder;396 397 if Level < 0.25*Diameter then398 399 "Vessel Filled Volume"400 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);401 402 else403 404 "Vessel Filled Volume"405 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);406 407 end408 409 case "hemispherical":410 411 "Vessel Total Volume"412 Vtotal = Vhead_hemispherical + Vcylinder;413 414 if Level < 0.5*Diameter then415 416 "Vessel Filled Volume"417 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);418 419 else420 421 "Vessel Filled Volume"422 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);423 424 end425 426 end427 428 case "horizontal":429 430 "Vessel Cross Section Area"431 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));432 433 switch Heads434 435 case "elliptical":436 437 "Vessel Total Volume"438 Vtotal = Vhead_elliptical + Vcylinder;439 440 "Vessel Filled Volume"441 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;442 443 case "hemispherical":444 445 "Vessel Total Volume"446 Vtotal = Vhead_hemispherical + Vcylinder;447 448 "Vessel Filled Volume"449 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;450 451 end452 453 end454 455 359 switch VapourFlow 456 360 … … 477 381 478 382 "Energy Holdup" 479 E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P* Vtotal;383 E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletVapour.P*Geometry.Vtotal; 480 384 481 385 "Mol fraction normalisation" … … 508 412 509 413 "Geometry Constraint" 510 Vtotal = ML*vL + MV*vV;414 Geometry.Vtotal = ML*vL + MV*vV; 511 415 512 416 "Liquid Level" 513 ML * vL = Vfilled;417 ML * vL = Geometry.Vfilled; 514 418 515 419 "Temperature indicator" … … 520 424 521 425 "Level indicator" 522 LI* Vtotal=Vfilled;426 LI*Geometry.Vtotal= Geometry.Vfilled; 523 427 524 428 end -
branches/gui/eml/stage_separators/flash.mso
r825 r879 17 17 *--------------------------------------------------------------------*# 18 18 19 using " streams";19 using "tank"; 20 20 21 21 Model flash … … 61 61 62 62 Mw(NComp) as molweight (Brief="Mol Weight", Hidden=true); 63 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi"); 64 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 65 66 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 67 Heads as Switcher (Valid=["elliptical","hemispherical","flat"],Default="flat"); 68 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}"); 69 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}"); 70 71 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); 72 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); 73 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); 74 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 63 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 75 64 76 65 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); … … 82 71 Mw=PP.MolecularWeight(); 83 72 84 Vhead_elliptical = (pi*Diameter^3)/12; 85 Vhead_hemispherical = (pi*Diameter^3)/6; 86 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 87 radius = 0.5*Diameter; 88 g = 9.81 * 'm/(s^2)'; 73 Gconst = 9.81 * 'm/(s^2)'; 89 74 90 75 VARIABLES 76 77 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); 91 78 92 79 in Inlet as stream (Brief="Feed Stream", PosX=0, PosY=0.48, Symbol="_{in}"); … … 95 82 in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.81, Protected =true,Symbol="Q_{in}"); 96 83 97 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");98 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");99 100 84 TotalHoldup(NComp) as mol (Brief="Molar Holdup in the Vessel", Protected=true); 101 85 LiquidHoldup as mol (Brief="Molar liquid holdup", Protected=true); … … 105 89 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 106 90 vV as volume_mol (Brief="Vapour Molar volume", Protected=true); 107 Level as length (Brief="liquid height", Protected=true);108 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");109 91 vfrac as positive (Brief="Vapourization fraction", Symbol="\phi", Protected=true); 110 92 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true); … … 131 113 EQUATIONS 132 114 133 switch Orientation134 135 case "vertical":136 137 "Vessel Cross Section Area"138 Across = 0.25*(pi*Diameter^2);139 140 switch Heads141 142 case "elliptical":143 144 "Vessel Total Volume"145 Vtotal = Vhead_elliptical + Vcylinder;146 147 if Level < 0.25*Diameter then148 149 "Vessel Filled Volume"150 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);151 152 else153 154 "Vessel Filled Volume"155 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);156 157 end158 159 case "hemispherical":160 161 "Vessel Total Volume"162 Vtotal = Vhead_hemispherical + Vcylinder;163 164 if Level < 0.5*Diameter then165 166 "Vessel Filled Volume"167 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);168 169 else170 171 "Vessel Filled Volume"172 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);173 174 end175 176 case "flat":177 178 "Vessel Total Volume"179 Vtotal = Vcylinder;180 181 "Vessel Filled Volume"182 Vfilled = Across*Level;183 184 end185 186 case "horizontal":187 188 "Vessel Cross Section Area"189 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));190 191 switch Heads192 193 case "elliptical":194 195 "Vessel Total Volume"196 Vtotal = Vhead_elliptical + Vcylinder;197 198 "Vessel Filled Volume"199 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;200 201 case "hemispherical":202 203 "Vessel Total Volume"204 Vtotal = Vhead_hemispherical + Vcylinder;205 206 "Vessel Filled Volume"207 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;208 209 case "flat":210 211 "Vessel Total Volume"212 Vtotal = Vcylinder;213 214 "Vessel Filled Volume"215 Vfilled = Across*Lenght;216 217 end218 219 end220 221 115 "Component Molar Balance" 222 116 diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z; … … 229 123 230 124 "Energy Holdup" 231 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P* Vtotal;125 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Geometry.Vtotal; 232 126 233 127 "Mol fraction normalisation" … … 257 151 258 152 "Static Head" 259 Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * g *Level;153 Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * Gconst * Geometry.Level; 260 154 261 155 "Mechanical Equilibrium for the Liquid Phase" … … 269 163 270 164 "Geometry Constraint" 271 Vtotal = LiquidHoldup * vL + VapourHoldup * vV;165 Geometry.Vtotal = LiquidHoldup * vL + VapourHoldup * vV; 272 166 273 167 "Temperature indicator" … … 278 172 279 173 "Level indicator" 280 LI* Vtotal=Vfilled;174 LI*Geometry.Vtotal= Geometry.Vfilled; 281 175 282 176 "Liquid Level" 283 LiquidHoldup * vL = Vfilled;177 LiquidHoldup * vL = Geometry.Vfilled; 284 178 285 179 end -
branches/gui/eml/stage_separators/reboiler.mso
r869 r879 18 18 *--------------------------------------------------------------------*# 19 19 20 using " streams";20 using "tank"; 21 21 22 22 Model thermosyphon … … 373 373 outer NComp as Integer (Brief="Number of Components"); 374 374 375 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi");376 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true);377 378 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical");379 Heads as Switcher (Valid=["elliptical","hemispherical"],Default="elliptical");380 381 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}");382 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}");383 384 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}");385 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}");386 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}");387 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}");388 389 375 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 390 376 Initial_Temperature as temperature (Brief="Initial Temperature of Reboiler"); 391 377 Initial_Composition(NComp) as positive (Brief="Initial Liquid Composition",Lower=1E-6); 392 378 393 SET394 pi = 3.141593;395 g = 9.81 * 'm/(s^2)';396 Vhead_elliptical = (pi*Diameter^3)/12;397 Vhead_hemispherical = (pi*Diameter^3)/6;398 Vcylinder = 0.25*(pi*Diameter^2)*Lenght;399 radius = 0.5*Diameter;400 401 379 VARIABLES 380 381 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); 402 382 403 383 in InletLiquid as stream (Brief="Liquid inlet stream", PosX=0.17, PosY=1, Symbol="_{in}^{Liquid}"); … … 417 397 vV as volume_mol (Brief="Vapour Molar volume", Protected = true); 418 398 rhoV as dens_mass (Brief="Vapour Density", Protected = true, Symbol="\rho"); 419 Level as length (Brief="Level of liquid phase", Protected = true);420 399 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 421 400 422 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");423 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");424 Across as area (Brief="Cross Section Area of reboiler",Protected=true);425 426 427 401 INITIAL 428 402 … … 438 412 EQUATIONS 439 413 440 switch Orientation441 442 case "vertical":443 444 "Vessel Cross Section Area"445 Across = 0.25*(pi*Diameter^2);446 447 switch Heads448 449 case "elliptical":450 451 "Vessel Total Volume"452 Vtotal = Vhead_elliptical + Vcylinder;453 454 if Level < 0.25*Diameter then455 456 "Vessel Filled Volume"457 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);458 459 else460 461 "Vessel Filled Volume"462 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);463 464 end465 466 case "hemispherical":467 468 "Vessel Total Volume"469 Vtotal = Vhead_hemispherical + Vcylinder;470 471 if Level < 0.5*Diameter then472 473 "Vessel Filled Volume"474 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);475 476 else477 478 "Vessel Filled Volume"479 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);480 481 end482 483 end484 485 case "horizontal":486 487 "Vessel Cross Section Area"488 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));489 490 switch Heads491 492 case "elliptical":493 494 "Vessel Total Volume"495 Vtotal = Vhead_elliptical + Vcylinder;496 497 "Vessel Filled Volume"498 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;499 500 case "hemispherical":501 502 "Vessel Total Volume"503 Vtotal = Vhead_hemispherical + Vcylinder;504 505 "Vessel Filled Volume"506 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;507 508 end509 510 end511 512 414 "Component Molar Balance" 513 415 diff(M)= InletLiquid.F*InletLiquid.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z; … … 520 422 521 423 "Energy Holdup" 522 E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P* Vtotal;424 E = ML*OutletLiquid.h + MV*OutletVapour.h - OutletLiquid.P*Geometry.Vtotal; 523 425 524 426 "Mol Fraction Normalisation" … … 550 452 551 453 "Geometry Constraint" 552 Vtotal = ML*vL + MV*vV;454 Geometry.Vtotal = ML*vL + MV*vV; 553 455 554 456 "Liquid Level" 555 ML * vL = Vfilled;457 ML * vL = Geometry.Vfilled; 556 458 557 459 "Temperature Indicator" … … 562 464 563 465 "Level indicator" 564 LI* Vtotal=Vfilled;466 LI*Geometry.Vtotal= Geometry.Vfilled; 565 467 566 468 end -
branches/gui/eml/stage_separators/tank.mso
r834 r879 19 19 using "streams"; 20 20 21 Model VesselVolume 22 23 ATTRIBUTES 24 Pallete = false; 25 Brief = "Model to calculate vessel total volume and vessel filled volume from 26 different geometries and orientations."; 27 Info = 28 "== SET == 29 *Orientation: vessel position - vertical or horizontal; 30 *Heads (bottom and top heads are identical) 31 **elliptical: 2:1 elliptical heads (25% of vessel diameter); 32 **hemispherical: hemispherical heads (50% of vessel diameter); 33 **flat: flat heads (0% of vessel diameter); 34 *Diameter: Vessel diameter; 35 *Lenght: Side length of the cylinder shell; 36 "; 37 38 PARAMETERS 39 PI as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi"); 40 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 41 42 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 43 Heads as Switcher (Valid=["elliptical","hemispherical","flat"],Default="flat"); 44 Diameter as length (Brief="Vessel diameter", Default= 2, Symbol="D_{i}"); 45 Lenght as length (Brief="Side length of the cylinder shell", Default= 6, Symbol="L_{vessel}"); 46 47 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); 48 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); 49 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); 50 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 51 52 SET 53 54 Gconst = 9.81 * 'm/(s^2)'; 55 Vhead_elliptical = (PI*Diameter^3)/12; 56 Vhead_hemispherical = (PI*Diameter^3)/6; 57 Vcylinder = 0.25*(PI*Diameter^2)*Lenght; 58 radius = 0.5*Diameter; 59 60 VARIABLES 61 62 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}"); 63 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}"); 64 Level as length (Brief="liquid height", Protected=true); 65 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}"); 66 67 EQUATIONS 68 69 switch Orientation 70 71 case "vertical": 72 73 "Vessel Cross Section Area" 74 Across = 0.25*(PI*Diameter^2); 75 76 switch Heads 77 78 case "elliptical": 79 80 "Vessel Total Volume" 81 Vtotal = Vhead_elliptical + Vcylinder; 82 83 if Level < 0.25*Diameter then 84 85 "Vessel Filled Volume" 86 Vfilled = 0.25*PI*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3); 87 88 else 89 90 "Vessel Filled Volume" 91 Vfilled = 0.25*PI*(Diameter^2)*(Level - 0.25*Diameter/3); 92 93 end 94 95 case "hemispherical": 96 97 "Vessel Total Volume" 98 Vtotal = Vhead_hemispherical + Vcylinder; 99 100 if Level < 0.5*Diameter then 101 102 "Vessel Filled Volume" 103 Vfilled = 0.25*PI*(Level^2)*(2*Diameter-4*Level/3); 104 105 else 106 107 "Vessel Filled Volume" 108 Vfilled = 0.25*PI*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2); 109 110 end 111 112 case "flat": 113 114 "Vessel Total Volume" 115 Vtotal = Vcylinder; 116 117 "Vessel Filled Volume" 118 Vfilled = Across*Level; 119 120 end 121 122 case "horizontal": 123 124 "Vessel Cross Section Area" 125 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2)); 126 127 switch Heads 128 129 case "elliptical": 130 131 "Vessel Total Volume" 132 Vtotal = Vhead_elliptical + Vcylinder; 133 134 "Vessel Filled Volume" 135 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght; 136 137 case "hemispherical": 138 139 "Vessel Total Volume" 140 Vtotal = Vhead_hemispherical + Vcylinder; 141 142 "Vessel Filled Volume" 143 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght; 144 145 case "flat": 146 147 "Vessel Total Volume" 148 Vtotal = Vcylinder; 149 150 "Vessel Filled Volume" 151 Vfilled = Across*Lenght; 152 153 end 154 155 end 156 157 end 158 21 159 Model TankVL 22 160 … … 61 199 62 200 Mw(NComp) as molweight (Brief="Mol Weight", Hidden=true); 63 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi"); 64 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 65 66 67 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 68 Heads as Switcher (Valid=["elliptical","hemispherical","flat"],Default="flat"); 69 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}"); 70 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}"); 71 72 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); 73 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); 74 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); 75 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 76 201 202 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 77 203 low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); 78 204 zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true); … … 89 215 90 216 Mw=PP.MolecularWeight(); 91 g = 9.81 * 'm/(s^2)'; 92 Vhead_elliptical = (pi*Diameter^3)/12; 93 Vhead_hemispherical = (pi*Diameter^3)/6; 94 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 95 radius = 0.5*Diameter; 96 217 Gconst = 9.81 * 'm/(s^2)'; 97 218 low_flow = 1E-6 * 'kmol/h'; 98 219 zero_flow = 0 * 'kmol/h'; … … 100 221 101 222 VARIABLES 223 224 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); 102 225 103 226 in Inlet as stream (Brief="Feed Stream", PosX=0.22, PosY=0, Symbol="_{in}"); … … 106 229 in InletQ as power (Brief="Heat Duty", PosX=0.735, PosY=1, Protected =true,Symbol="Q_{in}"); 107 230 108 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");109 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");110 111 231 TotalHoldup(NComp) as mol (Brief="Molar Holdup in the Vessel", Protected=true); 112 232 LiquidHoldup as mol (Brief="Molar liquid holdup", Protected=true); … … 116 236 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 117 237 vV as volume_mol (Brief="Vapour Molar volume", Protected=true); 118 Level as length (Brief="liquid height", Protected=true);119 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");120 238 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 121 239 Peq as pressure (Brief="Equilibrium pressure on the liquid surface", Protected=true, Symbol="\Delta P_{eq}"); … … 139 257 EQUATIONS 140 258 141 switch Orientation142 143 case "vertical":144 145 "Vessel Cross Section Area"146 Across = 0.25*(pi*Diameter^2);147 148 switch Heads149 150 case "elliptical":151 152 "Vessel Total Volume"153 Vtotal = Vhead_elliptical + Vcylinder;154 155 if Level < 0.25*Diameter then156 157 "Vessel Filled Volume"158 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);159 160 else161 162 "Vessel Filled Volume"163 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);164 165 end166 167 case "hemispherical":168 169 "Vessel Total Volume"170 Vtotal = Vhead_hemispherical + Vcylinder;171 172 if Level < 0.5*Diameter then173 174 "Vessel Filled Volume"175 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);176 177 else178 179 "Vessel Filled Volume"180 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);181 182 end183 184 case "flat":185 186 "Vessel Total Volume"187 Vtotal = Vcylinder;188 189 "Vessel Filled Volume"190 Vfilled = Across*Level;191 192 end193 194 case "horizontal":195 196 "Vessel Cross Section Area"197 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));198 199 switch Heads200 201 case "elliptical":202 203 "Vessel Total Volume"204 Vtotal = Vhead_elliptical + Vcylinder;205 206 "Vessel Filled Volume"207 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;208 209 case "hemispherical":210 211 "Vessel Total Volume"212 Vtotal = Vhead_hemispherical + Vcylinder;213 214 "Vessel Filled Volume"215 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;216 217 case "flat":218 219 "Vessel Total Volume"220 Vtotal = Vcylinder;221 222 "Vessel Filled Volume"223 Vfilled = Across*Lenght;224 225 end226 227 end228 229 259 switch NormalFlow 230 260 … … 251 281 252 282 "Energy Holdup" 253 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P* Vtotal;283 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Geometry.Vtotal; 254 284 255 285 "Mol fraction normalisation" … … 276 306 277 307 "Static Head" 278 Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * g *Level;308 Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * Gconst * Geometry.Level; 279 309 280 310 "Mechanical Equilibrium for the Liquid Phase" … … 285 315 286 316 "Geometry Constraint" 287 Vtotal = LiquidHoldup * vL + VapourHoldup * vV;317 Geometry.Vtotal = LiquidHoldup * vL + VapourHoldup * vV; 288 318 289 319 "Temperature indicator" … … 294 324 295 325 "Level indicator" 296 LI* Vtotal=Vfilled;326 LI*Geometry.Vtotal= Geometry.Vfilled; 297 327 298 328 "Liquid Level" 299 LiquidHoldup * vL = Vfilled;329 LiquidHoldup * vL = Geometry.Vfilled; 300 330 301 331 end … … 341 371 outer NComp as Integer (Brief = "Number of components", Lower = 1); 342 372 343 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true, Symbol="\pi"); 344 g as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 345 346 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 347 Heads as Switcher (Valid=["elliptical","hemispherical","flat"],Default="flat"); 348 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}"); 349 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}"); 350 351 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); 352 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); 353 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); 354 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 355 373 Gconst as acceleration (Brief="Gravity Acceleration",Default=9.81,Hidden=true); 356 374 low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); 357 375 zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true); … … 368 386 SET 369 387 370 Vhead_elliptical = (pi*Diameter^3)/12; 371 Vhead_hemispherical = (pi*Diameter^3)/6; 372 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 373 radius = 0.5*Diameter; 374 388 Gconst = 9.81 * 'm/(s^2)'; 375 389 low_flow = 1E-6 * 'kmol/h'; 376 390 zero_flow = 0 * 'kmol/h'; … … 379 393 VARIABLES 380 394 395 Geometry as VesselVolume (Brief="Vessel Geometry", Symbol=" "); 396 381 397 in Inlet as stream (Brief="Feed Stream", PosX=0.22, PosY=0, Symbol="_{in}"); 382 398 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.43, PosY=1, Symbol="_{out}^{Liquid}"); 383 399 in InletQ as power (Brief="Heat Duty", PosX=0.735, PosY=1, Protected =true,Symbol="Q_{in}"); 384 400 385 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}");386 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}");387 388 401 TotalHoldup(NComp) as mol (Brief="Molar Holdup in the Vessel", Protected=true); 389 402 390 403 E as energy (Brief="Total Energy Holdup in the Vessel", Protected=true); 391 404 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 392 Level as length (Brief="liquid height", Protected=true);393 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}");394 395 405 Pstatic as pressure (Brief="Static head at the bottom of the tank", Protected = true, Symbol="P_{static}^{Liquid}"); 396 406 … … 412 422 EQUATIONS 413 423 414 switch Orientation415 416 case "vertical":417 418 "Vessel Cross Section Area"419 Across = 0.25*(pi*Diameter^2);420 421 switch Heads422 423 case "elliptical":424 425 "Vessel Total Volume"426 Vtotal = Vhead_elliptical + Vcylinder;427 428 if Level < 0.25*Diameter then429 430 "Vessel Filled Volume"431 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3);432 433 else434 435 "Vessel Filled Volume"436 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3);437 438 end439 440 case "hemispherical":441 442 "Vessel Total Volume"443 Vtotal = Vhead_hemispherical + Vcylinder;444 445 if Level < 0.5*Diameter then446 447 "Vessel Filled Volume"448 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3);449 450 else451 452 "Vessel Filled Volume"453 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2);454 455 end456 457 case "flat":458 459 "Vessel Total Volume"460 Vtotal = Vcylinder;461 462 "Vessel Filled Volume"463 Vfilled = Across*Level;464 465 end466 467 case "horizontal":468 469 "Vessel Cross Section Area"470 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2));471 472 switch Heads473 474 case "elliptical":475 476 "Vessel Total Volume"477 Vtotal = Vhead_elliptical + Vcylinder;478 479 "Vessel Filled Volume"480 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght;481 482 case "hemispherical":483 484 "Vessel Total Volume"485 Vtotal = Vhead_hemispherical + Vcylinder;486 487 "Vessel Filled Volume"488 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght;489 490 case "flat":491 492 "Vessel Total Volume"493 Vtotal = Vcylinder;494 495 "Vessel Filled Volume"496 Vfilled = Across*Lenght;497 498 end499 500 end501 502 424 #* 503 425 switch NormalFlow … … 525 447 526 448 "Static Head" 527 Pstatic = PP.LiquidDensity(OutletLiquid.T, Inlet.P, OutletLiquid.z) * g *Level;449 Pstatic = PP.LiquidDensity(OutletLiquid.T, Inlet.P, OutletLiquid.z) * Gconst * Geometry.Level; 528 450 529 451 "Mechanical Equilibrium" … … 537 459 538 460 "Liquid Level" 539 Vfilled = sum(TotalHoldup) * vL;461 Geometry.Vfilled = sum(TotalHoldup) * vL; 540 462 541 463 "Temperature indicator" … … 546 468 547 469 "Level indicator" 548 LI* Vtotal=Vfilled;470 LI*Geometry.Vtotal= Geometry.Vfilled; 549 471 550 472 end
Note: See TracChangeset
for help on using the changeset viewer.