[582] | 1 | #*--------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
| 7 | * |
---|
| 8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
| 9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
| 10 | * All rights reserved. |
---|
| 11 | * |
---|
| 12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
| 13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 14 | * |
---|
| 15 | *---------------------------------------------------------------------- |
---|
| 16 | * Model for tank volume calculation |
---|
| 17 | *---------------------------------------------------------------------- |
---|
| 18 | * |
---|
| 19 | * Routine to calculate tank volume and level tank volume from |
---|
| 20 | * different geometries and orientations. |
---|
| 21 | * |
---|
| 22 | * Geometry: |
---|
| 23 | * * Flat (no head) (default) |
---|
| 24 | * * Spherical |
---|
| 25 | * |
---|
| 26 | * Orientation: |
---|
| 27 | * * Vertical (default) |
---|
| 28 | * * Horizontal |
---|
| 29 | * |
---|
| 30 | *---------------------------------------------------------------------- |
---|
| 31 | * Author: Rodolfo Rodrigues |
---|
| 32 | * $Id$ |
---|
| 33 | *--------------------------------------------------------------------*# |
---|
| 34 | |
---|
| 35 | using "types"; |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | Model vol_tank |
---|
| 39 | ATTRIBUTES |
---|
| 40 | Pallete = false; |
---|
| 41 | Brief = "Routine to calculate tank volume"; |
---|
| 42 | Info = " |
---|
| 43 | Based in 2 geometry and 2 configurations/orientations |
---|
| 44 | |
---|
| 45 | == Geometry == |
---|
| 46 | * Flat (no head) (default) |
---|
| 47 | * Spherical |
---|
| 48 | |
---|
| 49 | == Orientation == |
---|
| 50 | * Vertical (default) |
---|
| 51 | * Horizontal |
---|
| 52 | "; |
---|
| 53 | |
---|
| 54 | PARAMETERS |
---|
| 55 | pi as positive (Brief="Pi value", Default=3.141593, Symbol="\pi"); |
---|
| 56 | Geometry as Switcher (Brief="Tank head type", Valid=["flat","spherical"], Default="flat"); |
---|
| 57 | Orientation as Switcher(Brief="Tank orientation", Valid=["vertical","horizontal"], Default="vertical"); |
---|
| 58 | |
---|
| 59 | VARIABLES |
---|
| 60 | V as volume (Brief="Level tank volume"); |
---|
| 61 | Vt as volume (Brief="Tank volume"); |
---|
| 62 | L as length (Brief="Tank length"); |
---|
| 63 | Level as length (Brief="Tank level"); |
---|
| 64 | D as length (Brief="Tank diameter"); |
---|
| 65 | Across as area (Brief="Tank cross section area"); |
---|
| 66 | |
---|
| 67 | EQUATIONS |
---|
| 68 | "Content volume" |
---|
| 69 | V = Across*Level; |
---|
| 70 | |
---|
| 71 | switch Orientation |
---|
| 72 | case "vertical": |
---|
| 73 | switch Geometry |
---|
| 74 | case "flat": |
---|
| 75 | "Tank volume" |
---|
| 76 | Vt = pi/4*(D^2)*L; |
---|
| 77 | "Level tank volume" |
---|
| 78 | V = pi/4*(D^2)*Level; |
---|
| 79 | |
---|
| 80 | case "spherical": |
---|
| 81 | "Tank volume" |
---|
| 82 | Vt = pi/6*D^3; |
---|
| 83 | "Level tank volume" |
---|
| 84 | V = pi/3*Level^2*(3*D/2 - Level); |
---|
| 85 | end |
---|
| 86 | case "horizontal": |
---|
| 87 | switch Geometry |
---|
| 88 | case "flat": |
---|
| 89 | "Tank volume" |
---|
| 90 | Vt = pi/4*(D^2)*L; |
---|
| 91 | "Level tank volume" |
---|
| 92 | V = ((D^2)*acos((D - 2*Level)/D)/4/'rad' - |
---|
| 93 | (D - 2*Level)*sqrt(D*Level - Level^2)/2)*L; |
---|
| 94 | |
---|
| 95 | case "spherical": |
---|
| 96 | "Tank volume" |
---|
| 97 | Vt = pi/6*D^3; |
---|
| 98 | "Level tank volume" |
---|
| 99 | V = pi/3*Level^2*(3*D/2 - Level); |
---|
| 100 | end |
---|
| 101 | end |
---|
| 102 | end |
---|