#*------------------------------------------------------------------- * 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. * *--------------------------------------------------------------------- * Plant of n-Tanks *---------------------------------------------------------------------- * * Description: * Plant of n-tanks * * Devices: * * inlet and outlet feeds * * mixer * * splitter * * tank * *---------------------------------------------------------------------- * Author: Rodolfo Rodrigues *--------------------------------------------------------------------*# using "types"; using "reactors/vol_tank"; #*--------------------------------------------------------------------- * Simple feed model *--------------------------------------------------------------------*# Model stream ATTRIBUTES Brief = "Simple stream model"; VARIABLES F as flow_vol (Brief="Volumetric flow", DisplayUnit='cm^3/s'); end Model feed_inlet ATTRIBUTES Pallete = true; Brief = "Simple inlet stream"; Icon = "icon/inlet"; VARIABLES out Outlet as stream (Brief="Outlet stream", PosX=0.5, PosY=0, Symbol="_{out}"); end Model feed_outlet ATTRIBUTES Pallete = true; Brief = "Simple outlet stream"; Icon = "icon/outlet"; VARIABLES in Inlet as stream (Brief="Inlet stream", PosX=0.5, PosY=0, Symbol="_{in}"); end #*--------------------------------------------------------------------- * Simple splitter model *--------------------------------------------------------------------*# Model simple_splitter ATTRIBUTES Pallete = true; Icon = "icon/connection"; Brief = "Simple model of a splitter with 2 outlet streams."; VARIABLES in Inlet as stream (Brief="Inlet stream", PosX=0.5, PosY=1, Symbol="_{in}"); out Outlet1 as stream (Brief="Outlet stream 1", PosX=1, PosY=0.5, Symbol="_{out,1}"); out Outlet2 as stream (Brief="Outlet stream 2", PosX=0.5, PosY=0, Symbol="_{out,2}"); X as fraction (Brief="Fraction to Outlet 1"); EQUATIONS "Material balance" Outlet1.F + Outlet2.F = Inlet.F; "Outlet stream 1" Outlet1.F = Inlet.F*X; end #*--------------------------------------------------------------------- * Simple mixer model *--------------------------------------------------------------------*# Model simple_mixer ATTRIBUTES Pallete = true; Icon = "icon/connection"; Brief = "Simple model of a mixer with 2 inlet streams."; VARIABLES in Inlet1 as stream (Brief="Inlet stream 1", PosX=0, PosY=0.5, Symbol="_{in,1}"); in Inlet2 as stream (Brief="Inlet stream 2", PosX=0.5, PosY=0, Symbol="_{in,2}"); out Outlet as stream (Brief="Outlet stream", PosX=0.5, PosY=1, Symbol="_{out}"); EQUATIONS "Material balance" Outlet.F = Inlet1.F + Inlet1.F; end #*--------------------------------------------------------------------- * Simple tank model *--------------------------------------------------------------------*# Model simple_tank ATTRIBUTES Pallete = true; Icon = "icon/tank"; Brief = "Simple model of a tank."; PARAMETERS g as acceleration(Brief="Acceleration of gravity", Default=9.80665); VARIABLES in Inlet as stream (Brief="Inlet stream", PosX=0.5, PosY=0, Symbol="_{in}"); out Outlet as stream (Brief="Outlet stream", PosX=0.5, PosY=1, Symbol="_{out}"); tank as vol_tank (Brief="Tank volume routine calculation", Symbol="_{tank}"); K as Real (Brief="Discharge constant", Unit='cm^2.5/s'); a as area (Brief="Cross-section of outlet hole", DisplayUnit='cm^2'); EQUATIONS "Material balance" diff(tank.V) = Inlet.F - Outlet.F; "Outlet flow" Outlet.F = K*sqrt(tank.Level); "Discharge constant" K = a*sqrt(2*g); end