#*------------------------------------------------------------------- * 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 125 2007-01-22 19:57:16Z rafael $ *---------------------------------------------------------------------*# 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); 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; 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); 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); VARIABLES in Inlet as stream; v as fraction; x(NComp) as fraction(Brief = "Liquid Molar Fraction"); y(NComp) as fraction(Brief = "Vapour Molar Fraction"); EQUATIONS "Flash Calculation" [v, x, y] = PP.FlashPH(Inlet.P, Inlet.h, Inlet.z); end