Changeset 690
 Timestamp:
 Nov 21, 2008, 3:02:51 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/gui/eml/pressure_changers/valve.mso
r587 r690 1 #*1 #* 2 2 * EMSO Model Library (EML) Copyright (C) 2004  2007 ALSOC. 3 3 * … … 176 176 ValveType as Switcher (Valid = ["linear", "parabolic", "equal", "quick", "hyperbolic"], Default = "linear"); 177 177 ValidPhases as Switcher (Brief = "Valid Phases for Flash Calculation", Valid = ["VapourOnly", "LiquidOnly"], Default="LiquidOnly"); 178 Tau as time_sec (Brief="valve time constant");178 # Tau as time_sec (Brief="valve time constant"); 179 179 rho60F as dens_mass (Brief = "Water Mass Density at 60 F",Hidden=true); 180 180 181 181 VARIABLES 182 182 W as flow_mass(DisplayUnit='kg/s'); 183 183 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 184 184 Fvol as flow_vol (Brief = "Volumetric Flow"); 185 185 fc as positive (Brief = "Opening Function",Hidden=true); 186 186 Cv as Real (Brief="Valve Flow Coefficient", Unit='gal/min/psi^0.5'); 187 Cv1 as Real (Brief="Valve Flow Coefficient", Unit='m^2'); 188 Cg as Real (Brief="Valve Gas Flow Coefficient", Unit='ft^3/h/psi'); 189 C as Real (Brief="Liquidgas Coefficient Ratio", Unit='(ft^3/gal)*(min/h)/(psi^.5)'); 187 190 StemPosition as fraction (Brief = "Actual valve stem position"); 188 189 191 a as Real; 192 #b as Real (Brief="d", Unit='1/(psi^.5)'); 190 193 vm as vol_mol (Brief = "Mixture Molar Volume"); 191 194 rho as dens_mass (Brief = "Mixture Mass Density"); 192 vsp as fraction (Brief = "Valve stem position",Hidden=true);195 # vsp as fraction (Brief = "Valve stem position",Hidden=true); 193 196 194 197 in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.7365, Symbol="_{in}"); 195 198 out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.7365, Symbol="_{out}"); 196 in vsignal as fraction (Brief = "Flow Signal", PosX=0.5, PosY=0);199 #in vsignal as fraction (Brief = "Flow Signal", PosX=0.5, PosY=0); 197 200 198 201 SET … … 202 205 EQUATIONS 203 206 204 "First order valve dynamics"205 Tau*diff(StemPosition) = vspStemPosition;206 207 "Flow Signal"208 vsp = vsignal;207 #"First order valve dynamics" 208 # Tau*diff(StemPosition) = vspStemPosition; 209 210 #"Flow Signal" 211 # vsp = vsignal; 209 212 210 213 "Pressure Drop" … … 219 222 "Outlet Composition" 220 223 Outlet.z = Inlet.z; 221 222 switch ValidPhases 223 224 225 Cv1=Cv*'1/(gal/min/psi^0.5)'*2.3837e5*'m^2'; 226 227 switch ValidPhases 228 229 ############################################################# 230 224 231 case "LiquidOnly": 225 232 … … 228 235 "Valve Equation  Liquid Flow" 229 236 Fvol = fc*(Cv/sqrt(1/rho60F))*sqrt(Pdrop/rho); 230 237 "Liquidgas Coefficient Ratio" 238 C*Cv=Cg; 239 a=1/(1.6764e2*C*'1/((ft^3/gal)*(min/h)/(psi^.5))')*sqrt(Pdrop/Inlet.P); 231 240 else 232 241 233 242 "Valve Equation  Liquid Flow" 234 243 Fvol = fc*(Cv/sqrt(1/rho60F))*sqrt(Pdrop/rho); 235 244 "Liquidgas Coefficient Ratio" 245 C*Cv=Cg; 246 a=1/(1.6764e2*C*'1/((ft^3/gal)*(min/h)/(psi^.5))')*sqrt(Pdrop/Inlet.P); 236 247 end 237 248 … … 241 252 "Liquid Molar Volume" 242 253 vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z); 254 255 256 257 ############################################################ 243 258 244 259 case "VapourOnly": 245 260 246 261 if Pdrop > 0 then #Update for gas flow !!!! 262 263 "Liquidgas Coefficient Ratio" 264 C*Cv=Cg; 265 a=1/(1.6764e2*C*'1/((ft^3/gal)*(min/h)/(psi^.5))')*sqrt(Pdrop/Inlet.P); 266 267 if 1.5708 > a then 268 "Valve Equation  Vapour Flow" 269 #Fvol = fc*Cg*sqrt(Inlet.P/1000*rho60F/rho);####rho60f/rho ok!!!! 270 #Fvol = fc*Cv*sqrt(Pdrop/1000*rho60F/rho); 271 #W = fc*Cv1*sqrt(Pdrop/1000*rho); 272 Fvol = fc*0.13446*'psi^.5'*Cg*sqrt(Inlet.P/1000*rho60F/rho)*sin(a*'rad'); 273 274 else 275 "Valve Equation  Vapour Flow" 276 Fvol = fc*0.13446*Cv*sqrt(Inlet.P*rho60F/rho); 277 end 278 else 247 279 248 280 "Valve Equation  Vapour Flow" 249 281 Fvol = fc*(Cv/sqrt(1/rho60F))*sqrt(Pdrop/rho); 250 251 else 252 253 "Valve Equation  Vapour Flow" 254 Fvol = fc*(Cv/sqrt(1/rho60F))*sqrt(Pdrop/rho); 255 282 283 "Liquidgas Coefficient Ratio" 284 C*Cv=Cg; 285 a=1/(1.6764e2*C*'1/((ft^3/gal)*(min/h)/(psi^.5))')*sqrt(Pdrop/Inlet.P); 256 286 end 257 287 258 288 "Vapour Mass Density" 259 289 rho = PP.VapourDensity(Inlet.T,Inlet.P,Inlet.z); 260 290 #rho=3.708741*'kg/m^3'; 261 291 "Vapour Molar Volume" 262 292 vm = PP.VapourVolume(Inlet.T,Inlet.P,Inlet.z); … … 264 294 end 265 295 296 ###################################################### 297 266 298 "Calculate Mass Flow" 267 Fvol = Inlet.F*vm; 299 Fvol = Inlet.F*vm; 300 301 W=Fvol*rho; 302 268 303 269 304 switch ValveType #Update the valve Type
Note: See TracChangeset
for help on using the changeset viewer.