#*--------------------------------------------------------------------- * 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. * *---------------------------------------------------------------------- * Model for tank volume calculation *---------------------------------------------------------------------- * * Routine to calculate tank volume and level tank volume from * different geometries and orientations. * * Geometry: * * Flat (no head) (default) * * Spherical * * Orientation: * * Vertical (default) * * Horizontal * *---------------------------------------------------------------------- * Author: Rodolfo Rodrigues * $Id$ *--------------------------------------------------------------------*# using "types"; Model vol_tank ATTRIBUTES Pallete = false; Brief = "Routine to calculate tank volume"; Info = " Based in 2 geometry and 2 configurations/orientations == Geometry == * Flat (no head) (default) * Spherical == Orientation == * Vertical (default) * Horizontal "; PARAMETERS pi as positive (Brief="Pi value", Default=3.141593, Symbol="\pi", Hidden=true); Geometry as Switcher (Brief="Tank head type", Valid=["flat","spherical"], Default="flat"); Orientation as Switcher(Brief="Tank orientation", Valid=["vertical","horizontal"], Default="vertical"); VARIABLES V as volume (Brief="Level tank volume"); Vt as volume (Brief="Tank volume"); L as length (Brief="Tank length"); Level as length (Brief="Tank level"); D as length (Brief="Tank diameter"); Across as area (Brief="Tank cross section area"); EQUATIONS "Content volume" V = Across*Level; switch Orientation case "vertical": switch Geometry case "flat": "Tank volume" Vt = pi/4*(D^2)*L; "Level tank volume" V = pi/4*(D^2)*Level; case "spherical": "Tank volume" Vt = pi/6*D^3; "Level tank volume" V = pi/3*Level^2*(3*D/2 - Level); end case "horizontal": switch Geometry case "flat": "Tank volume" Vt = pi/4*(D^2)*L; "Level tank volume" V = ((D^2)*acos((D - 2*Level)/D)/4/"rad" - (D - 2*Level)*sqrt(D*Level - Level^2)/2)*L; case "spherical": "Tank volume" Vt = pi/6*D^3; "Level tank volume" V = pi/3*Level^2*(3*D/2 - Level); end end end