Vertical Capsule Tank Volume Calculator

How to Calculate Vertical Capsule Tank Volume
To calculate the volume of a vertical capsule tank, we can treat the capsule as a sphere with a diameter of $d$ that is split in half and separated by a cylinder of the same diameter d and height a. Here, r is defined as d/2.
The formula for the volume of the capsule V_capsule is:
$$ V_{\text{capsule}} = \pi r^2 \left( \frac{4}{3}r + a \right) $$
To calculate the fill volume of a vertical capsule tank, we can adopt a similar method to that used for calculating the volume of a vertical oval tank, where r = d/2, which is also equal to the height of each hemispherical end.
Fill Volume Calculation:-
When fill height f < r:
We use the spherical cap method to calculate the volume of the filled part. The formula for the volume of a spherical cap is:
$$ V_{\text{spherical cap}} = \frac{1}{3} \pi h^2 (3R - h) $$
Where R is the radius of the sphere (in this case, r), and h is the height of the spherical cap (in this case, the fill height f). Therefore, the fill volume is the volume of the spherical cap.
-
When r < f < (r + a):
The fill volume is exactly half the volume of the sphere plus the volume of the fill inside the vertical cylinder. The volume of half the sphere is:
$$ V_{\text{half sphere}} = \frac{2}{3} \pi r^3 $$
The volume of the fill inside the cylinder is:
$$ V_{\text{cylinder fill}} = \pi r^2 (f - r) $$
Therefore, the total fill volume is:
$$ V_{\text{fill}} = V_{\text{half sphere}} + V_{\text{cylinder fill}} = \frac{2}{3} \pi r^3 + \pi r^2 (f - r) $$
-
When (r + a) < f < h: (where h is the total height of the capsule tank, i.e., the sum of the heights of the two hemispheres and the cylinder)
We use the spherical cap method to calculate the volume of the empty part and subtract this value from the total volume. The volume of the empty spherical cap is calculated using the same formula, but in this case, h should be the distance from the fill height f to the top of the capsule tank (i.e., h - f, but note that this h - f is actually the height of the spherical cap since we have passed the height of the cylinder). However, a more direct approach is to calculate the volume occupied up to the current fill height f, which typically means we have filled the entire spherical part and the cylinder part, and possibly part of the top spherical cap (if f exceeds r + a). But since our goal is to find the fill volume, we can directly calculate the fill volume up to f without first calculating the empty part. Nevertheless, to illustrate this point, we can say:
$$ V_{\text{fill}} = V_{\text{capsule}} - V_{\text{spherical cap of empty part}} $$
But in practice, we are more likely to directly calculate the volume of the filled part rather than first calculating the total volume and then subtracting the empty part. If f exceeds r + a, then the fill volume will include the volume of the entire hemispherical part, the cylinder, and possibly part of the top spherical cap (if f is less than the total height h of the capsule tank).
Note: In the third case, if f does indeed exceed the total height h of the capsule tank, then the fill volume is the total volume of the capsule tank. However, in practical situations, the fill height usually does not exceed the total design height of the tank.