Changeset 831 for branches/gui/eml/stage_separators/tank.mso
- Timestamp:
- Aug 14, 2009, 5:20:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/tank.mso
r828 r831 62 62 Mw(NComp) as molweight (Brief="Mol Weight", Hidden=true); 63 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 64 66 65 67 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); … … 73 75 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 74 76 77 low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); 78 zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true); 79 KfConst as Real (Brief="Constant for K factor pressure drop", Unit= 'mol/(s*(Pa^0.5))',Default = 1, Hidden=true); 80 Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E-8, Default = 2); 81 82 NormalFlow as Switcher (Brief="Normal Flow", Valid = ["on", "off"], Default = "on",Hidden=true); 83 75 84 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 76 85 Temperature_Initial as temperature (Brief="Initial Liquid Temperature", Default = 330); … … 80 89 81 90 Mw=PP.MolecularWeight(); 82 91 g = 9.81 * 'm/(s^2)'; 83 92 Vhead_elliptical = (pi*Diameter^3)/12; 84 93 Vhead_hemispherical = (pi*Diameter^3)/6; 85 94 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 86 95 radius = 0.5*Diameter; 96 97 low_flow = 1E-6 * 'kmol/h'; 98 zero_flow = 0 * 'kmol/h'; 99 KfConst = 1*'mol/(s*(Pa^0.5))'; 87 100 88 101 VARIABLES … … 105 118 Level as length (Brief="liquid height", Protected=true); 106 119 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}"); 107 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true);108 120 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 121 Peq as pressure (Brief="Equilibrium pressure on the liquid surface", Protected=true, Symbol="\Delta P_{eq}"); 122 Pstatic as pressure (Brief="Static head at the bottom of the tank", Protected = true, Symbol="P_{static}^{Liquid}"); 109 123 110 124 out TI as control_signal (Brief="Temperature Indicator", PosX=0.525, PosY=0, Protected=true); … … 213 227 end 214 228 229 switch NormalFlow 230 231 case "on": 232 Inlet.F = Kfactor *sqrt(Pdrop)*KfConst; 233 234 when Inlet.F < low_flow switchto "off"; 235 236 case "off": 237 Inlet.F = zero_flow; 238 239 when Inlet.P > OutletVapour.P switchto "on"; 240 241 end 242 215 243 "Component Molar Balance" 216 244 diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z - OutletVapour.F*OutletVapour.z; … … 232 260 233 261 "Liquid Volume" 234 vL = PP.LiquidVolume(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z);262 vL = PP.LiquidVolume(OutletLiquid.T, Peq, OutletLiquid.z); 235 263 236 264 "Vapour Volume" 237 vV = PP.VapourVolume(OutletVapour.T, OutletVapour.P, OutletVapour.z);265 vV = PP.VapourVolume(OutletVapour.T, Peq, OutletVapour.z); 238 266 239 267 "Chemical Equilibrium" 240 PP.LiquidFugacityCoefficient(OutletLiquid.T, OutletLiquid.P, OutletLiquid.z)*OutletLiquid.z =241 PP.VapourFugacityCoefficient(OutletVapour.T, OutletVapour.P, OutletVapour.z)*OutletVapour.z;268 PP.LiquidFugacityCoefficient(OutletLiquid.T, Peq, OutletLiquid.z)*OutletLiquid.z = 269 PP.VapourFugacityCoefficient(OutletVapour.T, Peq, OutletVapour.z)*OutletVapour.z; 242 270 243 271 "Thermal Equilibrium" … … 245 273 246 274 "Mechanical Equilibrium" 247 OutletVapour.P = OutletLiquid.P; 275 OutletVapour.P = Peq; 276 277 "Static Head" 278 Pstatic = PP.LiquidDensity(OutletLiquid.T, Peq, OutletLiquid.z) * g * Level; 279 280 "Mechanical Equilibrium for the Liquid Phase" 281 OutletLiquid.P = Peq + Pstatic; 248 282 249 283 "Pressure Drop" 250 OutletLiquid.P = Inlet.P - Pdrop; 251 252 "Pressure Ratio" 253 OutletLiquid.P = Inlet.P * Pratio; 284 Pdrop = Inlet.P - OutletVapour.P; 254 285 255 286 "Geometry Constraint" … … 323 354 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 324 355 356 low_flow as flow_mol (Brief = "Low Flow",Default = 1E-6, Hidden=true); 357 zero_flow as flow_mol (Brief = "No Flow",Default = 0, Hidden=true); 358 KfConst as Real (Brief="Constant for K factor pressure drop", Unit= 'mol/(s*(Pa^0.5))',Default = 1, Hidden=true); 359 Kfactor as positive (Brief="K factor for pressure drop", Lower = 1E-8, Default = 2); 360 361 NormalFlow as Switcher (Brief="Normal Flow", Valid = ["on", "off"], Default = "on",Hidden=true); 362 363 325 364 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 326 365 Temperature_Initial as temperature (Brief="Initial Liquid Temperature", Default = 330); … … 333 372 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 334 373 radius = 0.5*Diameter; 374 375 low_flow = 1E-6 * 'kmol/h'; 376 zero_flow = 0 * 'kmol/h'; 377 KfConst = 1*'mol/(s*(Pa^0.5))'; 335 378 336 379 VARIABLES … … 457 500 end 458 501 502 #* 503 switch NormalFlow 504 505 case "on": 506 Inlet.F = Kfactor *sqrt(Pstatic)*KfConst; 507 508 when Inlet.F < low_flow switchto "off"; 509 510 case "off": 511 Inlet.F = zero_flow; 512 513 when Inlet.P > OutletLiquid.P switchto "on"; 514 515 end 516 *# 459 517 "Component Molar Balance" 460 518 diff(TotalHoldup)=Inlet.F*Inlet.z - OutletLiquid.F*OutletLiquid.z;
Note: See TracChangeset
for help on using the changeset viewer.