#*------------------------------------------------------------------- * 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 basic streams *---------------------------------------------------------------------- * Author: Paula B. Staudt and Rafael de P. Soares * $Id: streams.mso 147 2007-01-31 19:02:46Z bicca $ *---------------------------------------------------------------------*# using "types"; Model stream ATTRIBUTES Pallete = false; Brief = "General Material Stream"; Info = "This is the basic building block for the EML models. Every model should have input and output streams derived from this model."; PARAMETERS outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); VARIABLES F as flow_mol; T as temperature; P as pressure; z(NComp) as fraction(Brief = "Overall Molar Fraction"); h as enth_mol; v as fraction(Brief = "Vapourisation fraction"); end Model liquid_stream as stream ATTRIBUTES Pallete = false; Brief = "Liquid Material Stream"; Info = "Model for liquid material streams. This model should be used only when the phase of the stream is known ''a priori''."; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); EQUATIONS "Liquid Enthalpy" h = PP.LiquidEnthalpy(T, P, z); "Liquid stream" v = 0; end Model vapour_stream as stream ATTRIBUTES Pallete = false; Brief = "Vapour Material Stream"; Info = "Model for vapour material streams. This model should be used only when the phase of the stream is known ''a priori''."; PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); EQUATIONS "Vapour Enthalpy" h = PP.VapourEnthalpy(T, P, z); "Vapour stream" v = 1; end Model streamPH as stream PARAMETERS outer PP as Plugin(Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); VARIABLES x(NComp) as fraction(Brief = "Liquid Molar Fraction"); y(NComp) as fraction(Brief = "Vapour Molar Fraction"); EQUATIONS "Flash Calculation" [v, x, y] = PP.FlashPH(P, h, z); "Enthalpy" h = (1-v)*PP.LiquidEnthalpy(T, P, x) + v*PP.VapourEnthalpy(T, P, y); end Model source ATTRIBUTES Info = "Material stream source. This model should be used for boundary streams. Usually these streams are known and come from another process units."; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); M(NComp) as molweight (Brief="Component Mol Weight"); SET M = PP.MolecularWeight(); VARIABLES out Outlet as stream; x(NComp) as fraction(Brief = "Liquid Molar Fraction"); y(NComp) as fraction(Brief = "Vapour Molar Fraction"); hl as enth_mol; hv as enth_mol; zmass(NComp) as fraction (Brief = "Mass Fraction"); Mw as molweight (Brief="Average Mol Weight"); vm as volume_mol (Brief="Molar Volume"); rho as dens_mass (Brief="Stream Density"); Fw as flow_mass (Brief="Stream Mass Flow"); Fvol as flow_vol (Brief = "Volumetric Flow"); EQUATIONS "Flash Calculation" [Outlet.v, x, y] = PP.Flash(Outlet.T, Outlet.P, Outlet.z); "Overall Enthalpy" Outlet.h = (1-Outlet.v)*PP.LiquidEnthalpy(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourEnthalpy(Outlet.T, Outlet.P, y); hl = PP.LiquidEnthalpy(Outlet.T, Outlet.P, x); hv = PP.VapourEnthalpy(Outlet.T, Outlet.P, y); "Average Molecular Weight" Mw = sum(M*Outlet.z); "Mass Density" rho = (1-Outlet.v)*PP.LiquidDensity(Outlet.T,Outlet.P,x) + Outlet.v*PP.VapourDensity(Outlet.T,Outlet.P,y); "Flow Mass" Fw = Mw*Outlet.F; "Molar Volume" vm = (1-Outlet.v)*PP.LiquidVolume(Outlet.T, Outlet.P, x) + Outlet.v*PP.VapourVolume(Outlet.T,Outlet.P,y); "Volumetric Flow" Fvol = Outlet.F*vm ; "Mass Fraction" zmass = M*Outlet.z / Mw; end Model sink ATTRIBUTES Info = "Material stream sink. This model should be used for boundary streams."; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); M(NComp) as molweight (Brief="Component Mol Weight"); SET M = PP.MolecularWeight(); VARIABLES in Inlet as stream; v as fraction; x(NComp) as fraction (Brief = "Liquid Molar Fraction"); y(NComp) as fraction (Brief = "Vapour Molar Fraction"); zmass(NComp) as fraction (Brief = "Mass Fraction"); Mw as molweight (Brief="Average Mol Weight"); vm as volume_mol (Brief="Molar Volume"); rho as dens_mass (Brief="Stream Density"); Fw as flow_mass (Brief="Stream Mass Flow"); Fvol as flow_vol (Brief = "Volumetric Flow"); EQUATIONS "Flash Calculation" [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z); "Average Molecular Weight" Mw = sum(M*Inlet.z); "Mass Density" rho = (1-v)*PP.LiquidDensity(Inlet.T,Inlet.P,x) + v*PP.VapourDensity(Inlet.T,Inlet.P,y); "Flow Mass" Fw = Mw*Inlet.F; "Molar Volume" vm = (1-v)*PP.LiquidVolume(Inlet.T, Inlet.P, x) + v*PP.VapourVolume(Inlet.T,Inlet.P,y); "Volumetric Flow" Fvol = Inlet.F*vm ; "Mass Fraction" zmass = M*Inlet.z / Mw; end