Changeset 796 for branches/gui/eml/stage_separators/flash.mso
- Timestamp:
- Jul 18, 2009, 6:08:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/flash.mso
r714 r796 24 24 Pallete = true; 25 25 Icon = "icon/Flash"; 26 Brief = "Model of a dynamic flash.";26 Brief = "Model of a Dynamic Flash Vessel."; 27 27 Info = 28 "== Assumptions == 29 * Both phases are perfectly mixed. 30 31 == Specify == 32 * The feed stream; 33 * The outlet flows: OutletVapour.F and OutletLiquid.F. 34 35 == Initial Conditions == 36 * The flash initial temperature (Temperature_Initial); 37 * The flash initial level (Levelpercent_Initial); 38 *The Outlet Liquid Composition (Composition_Initial). 28 "== ASSUMPTIONS == 29 * perfect mixing of both phases; 30 * thermodynamics equilibrium. 31 32 == SET == 33 *Orientation: vessel position - vertical or horizontal; 34 *Heads (bottom and top heads are identical) 35 **elliptical: 2:1 elliptical heads (25% of vessel diameter); 36 **hemispherical: hemispherical heads (50% of vessel diameter); 37 **flat: flat heads (0% of vessel diameter); 38 *Diameter: Vessel diameter; 39 *Lenght: Side length of the cylinder shell; 40 41 == SPECIFY == 42 * the Inlet stream; 43 * the outlet flows: OutletVapour.F and OutletLiquid.F; 44 * the InletQ (the model requires an energy stream, also you can use a controller for setting the heat duty using the heat_flow model). 45 46 == OPTIONAL == 47 * the Flash model has three control ports 48 ** TI OutletLiquid Temperature Indicator; 49 ** PI OutletLiquid Pressure Indicator; 50 ** LI Level Indicator; 51 52 == INITIAL CONDITIONS == 53 * Initial_Temperature : the Flash temperature (OutletLiquid.T); 54 * Initial_Level : the Flash liquid level (Level); 55 * Initial_Composition : (NoComps) OutletLiquid compositions. 39 56 "; 40 57 41 58 PARAMETERS 42 43 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 44 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 45 46 VesselVolume as volume (Brief="Total Volume of the flash"); 47 Mw(NComp) as molweight (Hidden=true); 48 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 49 Diameter as length (Brief="Vessel diameter"); 50 51 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 52 Temperature_Initial as temperature (Brief="Initial Liquid Temperature", Default = 330); 53 Composition_Initial(NComp) as fraction (Brief="Initial Composition", Default = 0.10); 54 59 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 60 outer NComp as Integer (Brief = "Number of components", Lower = 1); 61 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 65 Orientation as Switcher (Valid=["vertical","horizontal"],Default="vertical"); 66 Heads as Switcher (Valid=["elliptical","hemispherical","flat"],Default="flat"); 67 Diameter as length (Brief="Vessel diameter", Symbol="D_{i}"); 68 Lenght as length (Brief="Side length of the cylinder shell", Symbol="L_{vessel}"); 69 70 Vhead_elliptical as volume (Brief="Elliptical Head Total Volume",Hidden=true, Symbol="V_{head}^{elliptical}"); 71 Vhead_hemispherical as volume (Brief="Hemispherical Head Total Volume",Hidden=true, Symbol="V_{head}^{hemispherical}"); 72 Vcylinder as volume (Brief="Cylinder Total Volume",Hidden=true, Symbol="V_{cylinder}"); 73 radius as length (Brief="Vessel radius",Hidden=true, Symbol="R_{cylinder}"); 74 75 Levelpercent_Initial as positive (Brief="Initial liquid height in Percent", Default = 0.70); 76 Temperature_Initial as temperature (Brief="Initial Liquid Temperature", Default = 330); 77 Composition_Initial(NComp) as fraction (Brief="Initial Composition", Default = 0.10); 78 55 79 SET 56 80 57 81 Mw=PP.MolecularWeight(); 58 82 83 Vhead_elliptical = (pi*Diameter^3)/12; 84 Vhead_hemispherical = (pi*Diameter^3)/6; 85 Vcylinder = 0.25*(pi*Diameter^2)*Lenght; 86 radius = 0.5*Diameter; 87 59 88 VARIABLES 60 89 61 in Inlet as stream (Brief="Feed Stream", PosX=0, PosY=0.5421, Symbol="_{in}"); 62 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.4790, PosY=1, Symbol="_{outL}"); 63 out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.4877, PosY=0, Symbol="_{outV}"); 64 in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Protected =true,Symbol="_{in}"); 90 in Inlet as stream (Brief="Feed Stream", PosX=0, PosY=0.48, Symbol="_{in}"); 91 out OutletLiquid as liquid_stream (Brief="Liquid outlet stream", PosX=0.43, PosY=1, Symbol="_{out}^{Liquid}"); 92 out OutletVapour as vapour_stream (Brief="Vapour outlet stream", PosX=0.43, PosY=0, Symbol="_{out}^{Vapour}"); 93 in InletQ as power (Brief="Heat Duty", PosX=1, PosY=0.81, Protected =true,Symbol="Q_{in}"); 94 95 Vtotal as volume (Brief="Vessel total volume",Protected=true, Symbol="V_{total}"); 96 Vfilled as volume (Brief="Vessel volume content",Protected=true, Symbol="V_{filled}"); 65 97 66 98 TotalHoldup(NComp) as mol (Brief="Molar Holdup in the Vessel", Protected=true); 67 LiquidHoldup 68 VapourHoldup 69 70 E as energy 99 LiquidHoldup as mol (Brief="Molar liquid holdup", Protected=true); 100 VapourHoldup as mol (Brief="Molar vapour holdup", Protected=true); 101 102 E as energy (Brief="Total Energy Holdup in the Vessel", Protected=true); 71 103 vL as volume_mol (Brief="Liquid Molar Volume", Protected=true); 72 104 vV as volume_mol (Brief="Vapour Molar volume", Protected=true); 73 Level as length 74 Across as area (Brief="Flash Cross section area", Protected=true);75 vfrac as positive 76 Pratio as positive 105 Level as length (Brief="liquid height", Protected=true); 106 Across as area (Brief="Vessel cylinder shell Cross section area", Hidden=true, Symbol="A_{cross}"); 107 vfrac as positive (Brief="Vapourization fraction", Symbol="\phi", Protected=true); 108 Pratio as positive (Brief = "Pressure Ratio", Symbol ="P_{ratio}", Protected=true); 77 109 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P", Protected=true); 78 110 79 out TI as control_signal (Brief="Temperature Indicator", PosX=1, PosY=0. 2, Protected=true);80 out PI as control_signal (Brief="Pressure Indicator", PosX=1, PosY=0. 3, Protected=true);81 out LI as control_signal (Brief="Level Indicator", PosX=1, PosY=0. 4, Protected=true);111 out TI as control_signal (Brief="Temperature Indicator", PosX=1, PosY=0.39, Protected=true); 112 out PI as control_signal (Brief="Pressure Indicator", PosX=1, PosY=0.21, Protected=true); 113 out LI as control_signal (Brief="Level Indicator", PosX=1, PosY=0.59, Protected=true); 82 114 83 115 INITIAL 84 116 85 # Initial level Percent 117 "Initial level Percent" 86 118 LI = Levelpercent_Initial; 87 119 88 # Initial Outlet Liquid Temperature 120 "Initial Outlet Liquid Temperature" 89 121 OutletLiquid.T = Temperature_Initial; 90 122 91 # Initial Outlet Liquid Composition Normalized 123 "Initial Outlet Liquid Composition Normalized" 92 124 OutletLiquid.z(1:NComp - 1) = Composition_Initial(1:NComp - 1)/sum(Composition_Initial); 93 125 94 126 EQUATIONS 127 128 switch Orientation 129 130 case "vertical": 131 132 "Vessel Cross Section Area" 133 Across = 0.25*(pi*Diameter^2); 134 135 switch Heads 136 137 case "elliptical": 138 139 "Vessel Total Volume" 140 Vtotal = Vhead_elliptical + Vcylinder; 141 142 if Level < 0.25*Diameter then 143 144 "Vessel Filled Volume" 145 Vfilled = 0.25*pi*(((Diameter*Level)/(0.25*Diameter))^2)*(0.25*Diameter-Level/3); 146 147 else 148 149 "Vessel Filled Volume" 150 Vfilled = 0.25*pi*(Diameter^2)*(Level - 0.25*Diameter/3); 151 152 end 153 154 case "hemispherical": 155 156 "Vessel Total Volume" 157 Vtotal = Vhead_hemispherical + Vcylinder; 158 159 if Level < 0.5*Diameter then 160 161 "Vessel Filled Volume" 162 Vfilled = 0.25*pi*(Level^2)*(2*Diameter-4*Level/3); 163 164 else 165 166 "Vessel Filled Volume" 167 Vfilled = 0.25*pi*((2/3)*((0.5*Diameter)^3) - (0.25*(Diameter)^3) + Level*Diameter^2); 168 169 end 170 171 case "flat": 172 173 "Vessel Total Volume" 174 Vtotal = Vcylinder; 175 176 "Vessel Filled Volume" 177 Vfilled = Across*Level; 178 179 end 180 181 case "horizontal": 182 183 "Vessel Cross Section Area" 184 Across = (radius^2)*acos((radius-Level)/radius)-(radius-Level)*sqrt((2*radius*Level-Level^2)); 185 186 switch Heads 187 188 case "elliptical": 189 190 "Vessel Total Volume" 191 Vtotal = Vhead_elliptical + Vcylinder; 192 193 "Vessel Filled Volume" 194 Vfilled = 0.5236*Level^2*(1.5*Diameter-Level) + Across*Lenght; 195 196 case "hemispherical": 197 198 "Vessel Total Volume" 199 Vtotal = Vhead_hemispherical + Vcylinder; 200 201 "Vessel Filled Volume" 202 Vfilled = 1.0472*Level^2*(1.5*Diameter-Level) + Across*Lenght; 203 204 case "flat": 205 206 "Vessel Total Volume" 207 Vtotal = Vcylinder; 208 209 "Vessel Filled Volume" 210 Vfilled = Across*Lenght; 211 212 end 213 214 end 95 215 96 216 "Component Molar Balance" … … 104 224 105 225 "Energy Holdup" 106 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*V esselVolume;226 E = LiquidHoldup*OutletLiquid.h + VapourHoldup*OutletVapour.h - OutletLiquid.P*Vtotal; 107 227 108 228 "Mol fraction normalisation" … … 138 258 139 259 "Geometry Constraint" 140 V esselVolume= LiquidHoldup * vL + VapourHoldup * vV;141 142 "Temperature indicator in Celsius Degree"143 TI * 'K' = OutletLiquid.T - 273.15*'K';260 Vtotal = LiquidHoldup * vL + VapourHoldup * vV; 261 262 "Temperature indicator" 263 TI * 'K' = OutletLiquid.T; 144 264 145 265 "Pressure indicator" … … 147 267 148 268 "Level indicator" 149 LI*VesselVolume= Level*Across; 150 151 switch Orientation 152 case "vertical": 153 "Cross Section Area" 154 Across = 0.5 * asin(1) * Diameter^2; 155 156 "Liquid Level" 157 LiquidHoldup * vL = Across * Level; 158 159 case "horizontal": 160 "Cylindrical Side Area" 161 Across = 0.25*Diameter^2 * (asin(1) - asin((Diameter - 2*Level)/Diameter)) + 162 (Level - 0.5*Diameter)*sqrt(Level*(Diameter - Level)); 163 164 "Liquid Level" 165 0.5 * asin(1) * Diameter^2 * LiquidHoldup* vL = Across * VesselVolume; 166 end 269 LI*Vtotal= Vfilled; 270 271 "Liquid Level" 272 LiquidHoldup * vL = Vfilled; 167 273 168 274 end
Note: See TracChangeset
for help on using the changeset viewer.