#*------------------------------------------------------------------- * 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: Rafael de Pelegrini Soares * $Id: tanksmodel.mso 190 2007-03-07 18:09:13Z rafael $ *--------------------------------------------------------------------*# using "types"; Model tank PARAMETERS A as area (Brief="Tank area", Default=2); VARIABLES k as Real (Brief="Valve Constant", Unit = 'm^2.5/h', Default=4); h as length(Brief="Tank level"); Fin as flow_vol(Brief="Input flow"); out Fout as flow_vol(Brief="Output flow"); EQUATIONS "Mass balance" diff(A*h) = Fin - Fout; "Valve equation" Fout = k*sqrt(h); end