#*--------------------------------------------------------------------- * 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"; PARAMETERS pi as positive (Brief="Pi value", Default=3.141593); 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", DisplayUnit='cm^3'); Vt as volume (Brief="Tank volume", DisplayUnit='cm^3'); L as length (Brief="Tank length", DisplayUnit='cm'); Level as length (Brief="Tank level", DisplayUnit='cm'); D as length (Brief="Tank diameter", DisplayUnit='cm'); Across as area (Brief="Tank cross section area", DisplayUnit='cm^2'); EQUATIONS "Content volume" V = Across*Level; switch Orientation case "vertical": switch Geometry case "flat": "Tank volume" Vt = pi*(D^2)*L/4; "Level tank volume" V = pi*(D^2)*Level/4; case "spherical": "Tank volume" Vt = pi*D^3/6; "Level tank volume" V = pi/3*Level^2*(3*D/2 - Level); end case "horizontal": switch Geometry case "flat": "Tank volume" Vt = pi*(D^2)*L/4; "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*D^3/6; "Level tank volume" V = pi/3*Level^2*(3*D/2 - Level); end end end