Changeset 782
- Timestamp:
- Jun 30, 2009, 10:53:56 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/eml/stage_separators/tank.mso
r781 r782 125 125 * the Inlet stream; 126 126 * the outlet flow; 127 * the tank Q.127 * the InletQ (requires an energy source). 128 128 129 129 == Initial Conditions == 130 * the tank initial temperature (OutletL.T);131 * the tank initial level (Level);132 * (NoComps - 1) OutletL (OR OutletV) compositions.130 * the tank initial temperature; 131 * the tank initial level; 132 * the tank initial composition. 133 133 "; 134 134 135 135 PARAMETERS 136 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 137 outer NComp as Integer; 138 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true); 139 radius as length (Brief="Tank radius"); 140 L as length (Brief="Tank length"); 141 Vtotal as volume (Brief="Tank total volume"); 142 143 Initial_Level as length (Brief="Initial Level of the Tank"); 144 Initial_Temperature as temperature (Brief="Initial Temperature of Liquid"); 145 Initial_Composition(NComp) as fraction (Brief="Initial Liquid Composition"); 136 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 137 outer NComp as Integer (Brief = "Number of Components"); 138 139 pi as positive (Brief="Pi value", Default=3.141593,Hidden=true); 140 eps as positive (Brief="small number",Default=1E-8,Hidden=true); 141 Diameter as length (Brief="Tank internal Diameter",Default=1.5); 142 radius as length (Brief="Tank radius",Hidden=true); 143 L as length (Brief="Tank length",Default=5); 144 145 Initial_Level as length (Brief="Initial Level of the Tank",Default=1); 146 Initial_Temperature as temperature (Brief="Initial Temperature of Liquid",Default=300); 147 Initial_Composition(NComp) as positive (Brief="Initial Liquid Composition",Lower=1E-8,Default=0.1); 146 148 147 149 SET 148 Vtotal = (0.25*pi*(2*radius)^2)*L;150 radius = Diameter/2; 149 151 150 152 VARIABLES 151 in Inlet as stream (Brief = "Inlet stream", PosX=0.1825, PosY=0, Symbol="_{in}"); 152 out Outlet as liquid_stream (Brief = "Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}"); 153 in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}"); 154 Level as length (Brief="Tank level"); 155 Vfilled as volume (Brief="Tank volume content"); 156 Across as area (Brief="Tank cross section area", Default=2); 157 M(NComp) as mol (Brief="Molar Holdup in the tank"); 158 E as energy (Brief="Total Energy Holdup on tank"); 159 vL as volume_mol (Brief="Liquid Molar Volume"); 153 in Inlet as stream (Brief="Inlet stream", PosX=0.1825, PosY=0, Symbol="_{in}"); 154 out Outlet as liquid_stream (Brief="Outlet liquid stream", PosX=1, PosY=1, Symbol="_{out}"); 155 in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.6160, Symbol="_{in}",Protected=true); 156 Level as length (Brief="Tank level",Protected=true); 157 Vtotal as volume (Brief="Tank total volume",Protected=true); 158 Vfilled as volume (Brief="Tank volume content",Protected=true); 159 Across as area (Brief="Tank cross section area", Default=2,Protected=true); 160 E as energy (Brief="Total Energy Holdup on tank",Protected=true); 161 vL as volume_mol (Brief="Liquid Molar Volume",Protected=true); 162 M(NComp) as mol (Brief="Molar Holdup in the tank",Protected=true); 160 163 161 164 INITIAL 162 165 163 Level = Initial_Level; 164 Outlet.T = Initial_Temperature; 165 Outlet.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); 166 "Initial Level" 167 Level = Initial_Level; 168 169 "Initial Liquid Temperature" 170 Outlet.T = Initial_Temperature; 171 172 "Initial Liquid Composition" 173 Outlet.z(1:NComp-1) = Initial_Composition(1:NComp-1)/sum(Initial_Composition); 166 174 167 175 EQUATIONS 168 176 177 "Tank total volume" 178 Vtotal = (0.25*pi*(Diameter)^2)*L; 179 169 180 "Mass balance" 170 181 diff(M) = Inlet.F*Inlet.z - Outlet.F*Outlet.z; … … 186 197 187 198 "Cylindrical Area" 188 Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) + (Level-radius)*sqrt(Level*(2*radius - Level)+ 1E-8);199 Across = radius^2 * (asin(1) - asin((radius-Level)/radius) ) + (Level-radius)*sqrt(Level*(2*radius - Level)+eps*'m^2'); 189 200 190 201 "Level of liquid phase" … … 194 205 Vfilled = L*Across; 195 206 196 end197 198 Model tank_simplified199 ATTRIBUTES200 Pallete = true;201 Icon = "icon/Tank";202 Brief = "Model of a simplified tank.";203 Info =204 "== Specify ==205 * the Inlet flow rate;206 207 == Initial Conditions ==208 * the tank initial level (Level);209 ";210 211 PARAMETERS212 k as Real (Brief="Valve Constant", Unit = 'm^2.5/h', Default=4);213 A as area (Brief="Tank area", Default=2);214 215 VARIABLES216 Level as length(Brief="Tank level");217 in Fin as flow_vol(Brief="Input flow", PosX=0.3037, PosY=0);218 out Fout as flow_vol(Brief="Output flow", PosX=1, PosY=1);219 220 EQUATIONS221 "Mass balance"222 diff(A*Level) = Fin - Fout;223 224 "Valve equation"225 Fout = k*sqrt(Level);226 207 end 227 208
Note: See TracChangeset
for help on using the changeset viewer.