#*------------------------------------------------------------------- * 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 744 2009-03-06 22:56:26Z bicca $ *--------------------------------------------------------------------*# using "streams"; Model sepComp_n ATTRIBUTES Pallete = false; Icon = "icon/splitter_n"; Brief = "Model of a separator of components (NOT Handled by the GUI)"; 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] do "Mol fraction normalisation" sum(Outlet(i).z) = 1; end for i in [1:NComp] do "Composition" sum(Outlet.F*Outlet.z(i)) = Inlet.F*Inlet.z(i); end for i in [1:NOutlet] do "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/SepComp"; Brief = "Model of a separator of components"; Info = "== Assumptions == * thermodynamics equilibrium == Specify == * the inlet stream * (NComp) Overhead_Splits or (NComp) Bottom_Splits * the Pressure and Temperature of the outlet streams "; PARAMETERS outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); outer NComp as Integer (Brief = "Number of chemical components"); VARIABLES in Inlet as stream (Brief = "Inlet stream", PosX=0, PosY=0.5001, Symbol="_{Inlet}"); out Overhead_Outlet as streamPH (Brief = "Overhead_Outlet stream", PosX=0.5, PosY=0, Symbol="_{Overhead}"); out Bottom_Outlet as streamPH (Brief = "Bottom_Outlet stream", PosX=0.5, PosY=1, Symbol="_{Bottom}"); in InletQ as power (Brief="Rate of heat supply", PosX=1, PosY=0.7559, Symbol="_{in}"); Overhead_Splits(NComp) as fraction (Brief = "Fraction to Overhead_Outlet", Symbol="\phi_{overhead}"); Bottom_Splits(NComp) as fraction (Brief = "Fraction to Bottom_Outlet", Symbol="\phi_{bottom}"); EQUATIONS "Composition Overhead" Overhead_Outlet.F*Overhead_Outlet.z = Inlet.F * Inlet.z*Overhead_Splits; "Bottom Composition Constraints" sum(Bottom_Outlet.z) = 1; "Sum Of Splits" Overhead_Splits+Bottom_Splits = 1; "Overhead Composition Constraints" sum(Overhead_Outlet.z) = 1; "Global Composition" Overhead_Outlet.F*Overhead_Outlet.z + Bottom_Outlet.F*Bottom_Outlet.z = Inlet.F*Inlet.z; "Energy Balance" Inlet.F*Inlet.h = Overhead_Outlet.F*Overhead_Outlet.h + Bottom_Outlet.F*Bottom_Outlet.h - InletQ; #"Overhead Pressure" # Overhead_Outlet.P = Inlet.P; #"Bottom Pressure" # Bottom_Outlet.P = Inlet.P; #"Overhead Temperature" # Overhead_Outlet.T = Inlet.T; #"Bottom Temperature" # Bottom_Outlet.T = Inlet.T; end