Changeset 879 for branches/gui/eml/stage_separators/flash.mso
- Timestamp:
- Nov 9, 2009, 2:11:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.