#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *-------------------------------------------------------------------- * Model of valves: * * - Linear * - Parabolic * - Equal * - Quick * - valve: a very simple model * *-------------------------------------------------------------------- * - Assumptions * * Steady State * * Isentalpic * * Liquid * *--------------------------------------------------------------------- * Author: Estefane Horn, Núbia do Carmo Ferreira *$Id: valve.mso 109 2007-01-11 22:03:27Z arge $ *-------------------------------------------------------------------*# using "streams"; using "pressure_changers/flux_machine_basic"; Model valve_basic as flux_machine_basic_TP PARAMETERS ext PP as CalcObject (Brief = "External Physical Properties", File = "vrpp"); ext NComp as Integer (Brief = "Number of chemical components", Lower = 1); rho60F as dens_mass; VARIABLES Pdiff as press_delta (Brief = "Pressure Increase", Unit = "kPa"); Qv as flow_vol (Brief = "Volumetric Flow"); fc as positive (Brief = "Opening Function"); cv as positive (Brief = "Valve Coefficient", Unit = "m^3/h/kPa^0.5"); Gf as positive (Brief = "Specific Gravity"); rho as dens_mass; vm as vol_mol (Brief = "Mixture Molar Volume", Unit = "m^3/kmol"); SET rho60F = 999.2 * "kg/m^3"; EQUATIONS "Calculate Outlet Stream Pressure" Inlet.P - Outlet.P = Pdiff; "Enthalpy Balance" Outlet.h = Inlet.h; "Molar Balance" Outlet.F = Inlet.F; "Calculate Outlet Composition" Outlet.z = Inlet.z; if Pdiff > 0 then "Valve Equation - Flow" Qv = fc*cv*sqrt(Pdiff/Gf); else "Valve Equation - Closed" Qv = 0 * "m^3/h"; end "Calculate Gf" Gf = rho/rho60F; "Calculate Specific Mass" rho = PP.LiquidDensity(Inlet.T,Inlet.P,Inlet.z); "Calculate Mass Flow" Qv = Inlet.F*vm; "Calculate Liquid Molar Volume" vm = PP.LiquidVolume(Inlet.T,Inlet.P,Inlet.z); end Model valve_linear as valve_basic VARIABLES x as fraction (Brief = "Opening"); EQUATIONS "Opening Equation" fc = x; end Model valve_parabolic as valve_basic PARAMETERS n as positive (Brief = "Constant", Lower = 1.4, Upper = 2.6); VARIABLES x as fraction (Brief = "Opening"); EQUATIONS "Opening Equation" fc = x^n; end Model valve_equal as valve_basic PARAMETERS a as Real (Brief = "Constant", Default = 100); VARIABLES x as fraction (Brief = "Opening"); EQUATIONS "Opening Equation" fc = a^(x-1); end Model valve_quick as valve_basic PARAMETERS a as positive (Brief = "Constant", Default = 0.05); n as positive (Brief = "Constant", Default = 5); VARIABLES x as fraction (Brief = "Opening"); EQUATIONS "Opening Equation" fc = (1-(a*(1-x)-(a-1)*(1-x)^n)); end #*------------------------------------------------------------------- * Model of a valve (simplified) *-------------------------------------------------------------------- * * Streams: * * an inlet stream * * an outlet stream * * Assumptions: * * no flashing liquid in the valve * * the flow in the valve is adiabatic * * dynamics in the valve are neglected * * linear flow type * * Specify: * * the inlet stream * * one of: plug position (x), outlet temperature (Outlet.T) or * outlet pressure (Outlet.P) * or * * the inlet stream excluding its flow (Inlet.F) * * the outlet pressure (Outlet.P) OR outlet flow (Outlet.F) * * the plug position (x) * * *---------------------------------------------------------------------- * Author: Paula B. Staudt *--------------------------------------------------------------------*# Model valve PARAMETERS ext PP as CalcObject; ext NComp as Integer; VARIABLES in Inlet as stream; out Outlet as stream_therm; x as fraction (Brief="Plug Position"); rho as dens_mass (Brief="Fluid Density", Default=1e3); v as vol_mol (Brief="Specific volume", Default=1e3); PARAMETERS rho_ref as dens_mass (Brief="Reference Density", Default=1e4); k as Real (Brief="Valve Constant", Unit="gal/min/psi^0.5"); EQUATIONS "Molar Balance" Inlet.F = Outlet.F; Inlet.z = Outlet.z; "Energy Balance" Inlet.h = Outlet.h; "Vapourisation Fraction" Outlet.v = Inlet.v; "Density" rho = Inlet.v*PP.VapourDensity((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z) + (1-Inlet.v)*PP.LiquidDensity((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z); "Volume" v = Inlet.v*PP.VapourVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z) + (1-Inlet.v)*PP.LiquidVolume((Inlet.T+Outlet.T)/2, (Inlet.P+Outlet.P)/2, Outlet.z); if Inlet.P > Outlet.P then "Flow" Outlet.F * v = k*x*sqrt((Inlet.P - Outlet.P)*rho_ref / rho ) ; else "Closed" Outlet.F = 0 * "kmol/h"; end end