#*------------------------------------------------------------------- * Model of a separator of components *-------------------------------------------------------------------- * * Streams: * * a inlet stream * * "Noutlet" outlet streams * * 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 * *---------------------------------------------------------------------- * Author: Maurício Carvalho Maciel * $Id: sepComp.mso 1 2006-06-20 17:33:53Z rafael $ *--------------------------------------------------------------------*# using "streams"; Model sepComp_n PARAMETERS ext PP as CalcObject (Brief = "External Physical Properties"); ext 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; out Outlet(NOutlet) as stream; frac(NOutlet) as fraction (Brief = "Distribution of the Outlet streams"); recovery(NOutlet) as fraction (Brief = "Recovery of the component specified"); 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 PARAMETERS ext PP as CalcObject (Brief = "External Physical Properties"); ext 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; out Outlet1 as stream; out Outlet2 as stream; frac as fraction (Brief = "Fraction to Outlet 1"); recovery as fraction (Brief = "Recovery of the component specified"); 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