#*------------------------------------------------------------------- * 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. * *---------------------------------------------------------------------- * Author: Marcos L. Alencastro, Estefane S. Horn (Revised Gerson B. Bicca) * $Id: expander.mso 687 2008-11-20 19:42:33Z bicca $ *--------------------------------------------------------------------*# using "streams"; Model expander ATTRIBUTES Pallete = true; Icon = "icon/expander"; Brief = "Model of an expander."; Info = "To be documented == References == [1] GPSA, 1979, Engineering Data Book, Chapter 4, 5-9 - 5-10. [2] Bloch, Heinz P., A Practical Guide to Compressor Technology, John Wiley & Sons, Incorporate, 2006."; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); Rgas as positive (Brief = "Constant of Gases", Unit= 'kJ/kmol/K', Default = 8.31451,Hidden=true); Mw(NComp) as molweight (Brief = "Molar Weight",Hidden=true); MechanicalEff as positive (Brief = "Mechanical efficiency",Lower=1E-3); IsentropicEff as positive (Brief = "Isentropic efficiency",Lower=1E-3); VARIABLES Pratio as positive (Brief = "Pressure Ratio", Lower = 1E-6, Symbol ="P_{ratio}"); Pdrop as press_delta (Brief = "Pressure Drop", DisplayUnit = 'kPa', Symbol ="\Delta P"); Pdecrease as press_delta (Brief = "Pressure Decrease", DisplayUnit = 'kPa', Symbol ="P_{incr}"); PowerLoss as power (Brief = "Power Losses",Lower=0); Head as energy_mass (Brief = "Actual Head", Protected=true); HeadIsentropic as energy_mass (Brief = "Isentropic Head", Protected=true); FluidPower as power (Brief = "Fluid Power", Protected=true); BrakePower as power (Brief = "Brake Power", Protected=true); IseCoeff as positive (Brief = "Isentropic Coefficient", Lower=0.2,Protected=true); Tisentropic as temperature (Brief = "Isentropic Temperature",Protected=true); hise as enth_mol (Brief = "Enthalpy at constant entropy",Hidden=true); Mwm as molweight (Brief = "Mixture Molar Weight",Hidden=true); rho_in as dens_mass (Brief = "Mass Density at inlet conditions", Lower = 1E-6, Protected=true); rho_out as dens_mass (Brief = "Mass Density at outlet conditions", Lower = 1E-6, Protected=true); Zfac_in as fraction (Brief = "Compressibility factor at inlet", Lower = 1E-3, Protected=true); Zfac_out as fraction (Brief = "Compressibility factor at outlet", Lower = 1E-3, Protected=true); in Inlet as stream (Brief = "Inlet stream", PosX=0.14, PosY=0.0, Symbol="_{in}"); out Outlet as streamPH (Brief = "Outlet stream", PosX=0.83, PosY=1, Symbol="_{out}"); out WorkOut as power (Brief = "Work Outlet", PosX=1, PosY=0.45, Protected=true); SET Mw = PP.MolecularWeight(); Rgas = 8.31451*'kJ/kmol/K'; EQUATIONS "Overall Molar Balance" Outlet.F = Inlet.F; "Component Molar Balance" Outlet.z = Inlet.z; "Average Molecular Weight" Mwm = sum(Mw*Inlet.z); "Pressure Ratio" Outlet.P = Inlet.P * Pratio; "Pressure Drop" Outlet.P = Inlet.P - Pdrop; "Pressure Decrease" Outlet.P = Inlet.P - Pdecrease; "Mass Density at inlet conditions" rho_in = PP.VapourDensity(Inlet.T, Inlet.P, Inlet.z); "Mass Density at outlet conditions" rho_out= PP.VapourDensity(Outlet.T, Outlet.P, Outlet.z); "Enthalpy at isentropic conditions" hise = PP.VapourEnthalpy(Tisentropic, Outlet.P, Outlet.z); "Compressibility factor at Inlet Conditions" Zfac_in = PP.VapourCompressibilityFactor(Inlet.T,Inlet.P,Inlet.z); "Compressibility factor at Outlet Conditions" Zfac_out = PP.VapourCompressibilityFactor(Outlet.T,Outlet.P,Outlet.z); "Actual Head" Head*Mwm = (Outlet.h-Inlet.h); if IsentropicEff >= 1 then "Discharge Temperature" Outlet.T = Tisentropic; else "Discharge Temperature" (Outlet.h-Inlet.h)= (hise-Inlet.h)*IsentropicEff; end "Isentropic Outlet Temperature" PP.VapourEntropy(Tisentropic, Outlet.P, Outlet.z) = PP.VapourEntropy(Inlet.T, Inlet.P, Inlet.z); "Brake Power" BrakePower = WorkOut; "Brake Power" BrakePower = FluidPower*MechanicalEff; "Power Loss" PowerLoss = BrakePower - FluidPower; "Fluid Power" FluidPower = HeadIsentropic*Mwm*Inlet.F*IsentropicEff; "Isentropic Coefficient" HeadIsentropic*Mwm*((IseCoeff-1.001)/IseCoeff) = (0.5*Zfac_in+0.5*Zfac_out)*Rgas*Inlet.T*((Pratio)^((IseCoeff-1.001)/IseCoeff) - 1); "Isentropic Head" HeadIsentropic*Mwm = (hise -Inlet.h); end