#*------------------------------------------------------------------- * 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: Maurício Carvalho Maciel * $Id: sepComp.mso 364 2007-09-08 19:46:13Z arge $ *--------------------------------------------------------------------*# using "streams"; Model sepComp_n ATTRIBUTES Pallete = true; Icon = "icon/splitter_n"; Brief = "Model of a separator of components"; Info = "== Assumptions == * thermodynamics equilibrium * adiabatic == Specify == * the inlet stream * (NComp - 1) molar fractions to (Noutlet - 1) outlet streams * (Noutlet - 1) frac (fraction of split of the outlet streams): frac(i) = (Mole Flow of the outlet stream i / Mole Flow of the inlet stream) where i = 1, 2,...,Noutlet or * (Noutlet - 1) recovery (Recovery of the component specified in the outlet stream i): recovery(i) = (Mole Flow of the component specified in the Outlet stream i/ Mole Flow of the component specified in the inlet stream) where i = 1, 2,...,Noutlet "; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); VARIABLES in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5, Symbol="_{in}"); out Outlet(NOutlet) as stream (Brief = "Outlet streams", PosX=1, PosY=0.5059, Symbol="_{out}"); frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams", Symbol="\phi"); recovery(NOutlet) as fraction (Brief = "Recovery of the component specified", Symbol="\eta"); EQUATIONS "Flow" sum(Outlet.F) = Inlet.F; for i in [1:NOutlet-1] "Mol fraction normalisation" sum(Outlet(i).z) = 1; end for i in [1:NComp] "Composition" sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); end for i in [1:NOutlet] "Flow" Outlet(i).F = Inlet.F*frac(i); "Recovery" recovery(i)*Inlet.z(mainComp) = frac(i)*Outlet(i).z(mainComp); "Pressure" Outlet(i).P = Inlet.P; "Enthalpy" Outlet(i).h = (1-Outlet(i).v)*PP.LiquidEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z) + Outlet(i).v*PP.VapourEnthalpy(Outlet(i).T, Outlet(i).P, Outlet(i).z); "Temperature" Outlet(i).T = Inlet.T; "Vapourization Fraction" Outlet(i).v = PP.VapourFraction(Outlet(i).T, Outlet(i).P, Outlet(i).z); end end Model sepComp ATTRIBUTES Pallete = true; Icon = "icon/splitter"; Brief = "Model of a separator of components"; Info = "== Assumptions == * thermodynamics equilibrium * adiabatic == Specify == * the inlet stream * (NComp - 1) molar fractions to 1 of the outlet streams * the fraction of split of the outlet streams "; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); VARIABLES in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{in}"); out Outlet1 as stream (Brief = "Outlet stream 1", PosX=1, PosY=0.3027, Symbol="_{out1}"); out Outlet2 as stream (Brief = "Outlet stream 2", PosX=1, PosY=0.7141, Symbol="_{out2}"); frac as fraction (Brief = "Fraction to Outlet 1", Symbol="\phi"); recovery as fraction (Brief = "Recovery of the component specified", Symbol="\eta"); EQUATIONS "Flow" Outlet1.F = Inlet.F * frac; Outlet1.F + Outlet2.F = Inlet.F; recovery*Inlet.z(mainComp) = frac*Outlet1.z(mainComp); sum(Outlet1.z) = 1; for i in [1:NComp] "Composition" Outlet1.F*Outlet1.z(i) + Outlet2.F*Outlet2.z(i) = Inlet.F*Inlet.z(i); end "Pressure" Outlet1.P = Inlet.P; Outlet2.P = Inlet.P; "Enthalpy" Outlet1.h = (1-Outlet1.v)*PP.LiquidEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z) + Outlet1.v*PP.VapourEnthalpy(Outlet1.T, Outlet1.P, Outlet1.z); Outlet2.h = (1-Outlet2.v)*PP.LiquidEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z) + Outlet2.v*PP.VapourEnthalpy(Outlet2.T, Outlet2.P, Outlet2.z); "Temperature" Outlet1.T = Inlet.T; Outlet2.T = Inlet.T; "Vapourization Fraction" Outlet1.v = PP.VapourFraction(Outlet1.T, Outlet1.P, Outlet1.z); Outlet2.v = PP.VapourFraction(Outlet2.T, Outlet2.P, Outlet2.z); end