 Timestamp:
 Aug 1, 2008, 4:40:50 PM (14 years ago)
 Location:
 branches/gui
 Files:

 1 added
 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/gui/eml/pressure_changers/valve.mso
r585 r586 260 260 end 261 261 262 Model valve_liquid_test 263 ATTRIBUTES 264 Pallete = true; 265 Icon = "icon/Valve"; 266 Brief = "testing Model of a valve."; 267 268 269 PARAMETERS 270 valve_type as Switcher (Valid = ["linear", "parabolic", "equal", "quick", "hyperbolic"], Default = "linear"); 271 outer PP as Plugin (Brief = "External Physical Properties", Type = "PP"); 272 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 273 rho60F as dens_mass; 274 tau as time_sec (Brief="valve time constant"); 275 276 VARIABLES 277 Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); 278 Qv as flow_vol (Brief = "Volumetric Flow"); 279 fc as positive (Brief = "Opening Function"); 280 cv as positive (Brief = "Valve Coefficient", Unit = 'm^3/h/kPa^0.5'); 281 Gf as positive (Brief = "Specific Gravity"); 282 rho as dens_mass; 283 vm as vol_mol (Brief = "Mixture Molar Volume"); 284 vactual as fraction (Brief = "Actual valve stem position"); 285 vsp as fraction (Brief = "Valve stem position"); 286 in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.7365, Symbol="_{in}"); 287 out Outlet as streamPH (Brief = "Outlet stream", PosX=1, PosY=0.7365, Symbol="_{out}"); 288 in vsignal as fraction (Brief="Flow Signal", PosX=0.5, PosY=0); 289 290 SET 291 rho60F = 999.02 * 'kg/m^3'; 292 293 EQUATIONS 294 295 "valve dynamics" 296 tau*diff(vactual) = vspvactual; 297 298 vsp=vsignal; 299 300 "Pressure Drop" 301 Outlet.P = Inlet.P  Pdrop; 302 303 "Enthalpy Balance" 304 Outlet.h = Inlet.h; 305 306 "Molar Balance" 307 Outlet.F = Inlet.F; 308 309 "Outlet Composition" 310 Outlet.z = Inlet.z; 311 312 if Pdrop > 0 then # update the flow equation !!!! 313 314 "Valve Equation  Flow" 315 Qv = 1000*fc*cv*sqrt(Pdrop/Gf); 316 317 else 318 319 "Valve Equation  Closed" 320 Qv = 0.1*fc*cv*sqrt(Pdrop/Gf); 321 322 end 323 324 "Calculate Gf" 325 Gf = rho/rho60F; 326 327 "Calculate Specific Mass" 328 rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); 329 330 "Calculate Mass Flow" 331 Qv = Inlet.F*vm; 332 333 "Calculate Liquid Molar Volume" 334 vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z); 335 336 switch valve_type # update the valve characteristic !!!! 337 case "linear": 338 339 "Opening Equation" 340 fc = vactual; 341 342 case "parabolic": 343 344 "Opening Equation" 345 fc = vactual^2; 346 347 case "equal": 348 349 "Opening Equation" 350 fc = vactual^2/(2vactual^4)^(1/2); 351 352 case "quick": 353 354 "Opening Equation" 355 fc = 10*vactual/sqrt(1+99*vactual^2); 356 357 case "hyperbolic": 358 359 "Opening Equation" 360 fc = 0.1*vactual/sqrt(10.99*vactual^2); 361 362 end 363 364 end 365
Note: See TracChangeset
for help on using the changeset viewer.