Fuel Farm Tank Volume Formula?

Graueradler

Pattern Altitude
Joined
Apr 11, 2005
Messages
2,021
Location
Russellville, AR
Display Name

Display name:
Graueradler
Does anyone have an equation for gallons of fuel in a horizontal cylindrical tank as a function of level? I've got a table and tried to get excel to do a curve fit and give me the equation. It gave me an excellent polynomial curve fit with the trend line going right through the plotted points and R squared = 1. It displays an equation but when I apply the equation, it doesn't produce the same rewults as the curve fit. I've gone over it many times trying to find my mistake but I am correctly inputing the equation. It just doesn't seem to be the correct equation. I'm trying to avoid interpolating between points in the table by just putting inches of level into a spreadsheet equation.:dunno:
 
pi*r^2*h will give you volume. pick your units. then convert to gallons.

r is the radius of the cylinder
h is the level of the gas
 
tonycondon said:
pi*r^2*h will give you volume. pick your units. then convert to gallons.

r is the radius of the cylinder
h is the level of the gas

That would work for a vertical cylinder I think...

Try...

v = l * (((pi*r^2)/2)-(r^2*(arcsin(1-h/r)))-((r-h)*sqrt(h(2r-h))))
r = radius
h = height of liquid
l = length of tank
v = volume
 
tonycondon said:
pi*r^2*h will give you volume. pick your units. then convert to gallons.

r is the radius of the cylinder
h is the level of the gas
Tony, you are calculating the volume of a vertical cylinder. For a horizontal cylinder you need the area of a circle segment (the area of a circle between a chord line and the circle boundary). I only know how to calculate that when the "fuel level" is at or below half full. Above that I'd have to take the segment area of the area above the fuel and subtract it from the total area of the circle that forms the end of the tank.

The area of a circle segment is equal to the area of the sector (pie slice) whose endpoints on the circle are co-located with the endpoints of the segment minus the area of the triangle above the segment.

The formula for the sector area is where R is the radius of the circle and h is the height of the segment (fuel level) This is assuming the ArcCos function returns Radians:

R^2 * ArcCos(1-h/R)

The formula for the triangle area is:
2 * (R-h) * Sqrt(2 * R * h - h^2)

Therefore the area of the segment is:

R^2 * ArcCos(1-h/R)
- 2 * (R-h) * Sqrt(2 * R * h - h^2)

To get the volume multiply that area by the length of the cylinder and like I said earlier this only works if the tank is half full or less.

Edit: I tried it in a spreadsheet and it seems that the formula works even if the tank is more than half full. So the volume in CuFt would be:
L* (R^2 * ArcCos(1-h/R)- 2 * (R-h) * Sqrt(2 * R * h - h^2))

...where L and R are in feet. To convert from CuFt to gallons multiply by 7.48
 
Last edited:
oh duh, the obvious answer is to flip the cylinder on the end, then its easy! :)
 
SJP said:
That would work for a vertical cylinder I think...

Try...

v = l * (((pi*r^2)/2)-(r^2*(arcsin(1-h/r)))-((r-h)*sqrt(h(2r-h))))
r = radius
h = height of liquid
l = length of tank
v = volume

Steve, I tried your formula and it doesn't work when the fuel level is zero or full (=2R).
 
lancefisher said:
Steve, I tried your formula and it doesn't work when the fuel level is zero or full (=2R).

If no fuel is measured - it's empty ;)
If h = 2r, it's full ;)
 
SJP said:
If no fuel is measured - it's empty ;)
If h = 2r, it's full ;)

OK. I incorrectly assumed that because you included Pi, your arcsin function returned degrees instead of radians. With that mistake corrected your results equal mine.
 
Steve said:
Hey Bobby, I saw your picture in the June 2006 issue of Fly-Low! Congrats!

Ralph McCormick, the publisher of Fly-Low, has his office at KRUE so we are well acquainted.
 
Thanks for the responses guys. Now, any ideas as to why my approach with Excel didn't work (File attached)? Looks like Excel isn't permitted so I pasted it into Word
 

Attachments

  • Fuel Farm Tank Inventory.doc
    30.5 KB · Views: 20
Graueradler said:
Thanks for the responses guys. Now, any ideas as to why my approach with Excel didn't work (File attached)? Looks like Excel isn't permitted so I pasted it into Word

I can't see how to debug your spreadsheet without seeing the actual spreadsheet. Try zipping it and then attaching the zipped file.
 
Graueradler said:
Thanks for the responses guys. Now, any ideas as to why my approach with Excel didn't work (File attached)? Looks like Excel isn't permitted so I pasted it into Word

What are the measurements of your tank ?
 
If the volume of a full cylinder is 1/2 * Pi * r2* l

why could I not take that result and then multiply it by the percentage of the level of the fluid as measured to the diameter of the cylinder?


For instance if the full volume of the cylinder is V and the fluid level in the cylinder is 50% the diameter then V*.50 is half the volume.

To put this in a math formula the Va (actual fluid volume)=V * (Fluid Level)/Diameter

If the diameter say were 4 feet accross and the fluid level measured 2.5feet form teh the deepest point of the cylinder to the fluid level top then then term would be .625 or the cylinder is only filled to 62.5% of its capacity. Multiply that by the full volume and you have the actual volume of the fluid. This is how the dip sticks work BTW
 
smigaldi said:
If the volume of a full cylinder is 1/2 * Pi * r2* l

why could I not take that result and then multiply it by the percentage of the level of the fluid as measured to the diameter of the cylinder?
Because the cylinder is laying on it's side, As you move up, the circular cross-section means that the increase in volume is not linear in respect to increase in height. Plus, once you pass the mid-point, the increase per inch of height is less each time...hence all the math...

For example, a 100" diameter cylinder of length 24", has a total volume of about 816 gallons. One can assume that 50% full (50% of Diameter), you would have 408 gals, and you'd be right. However, you cannot assume that at 25% diameter, you would have 204 gals...in fact, at 25"...you only have 159.5 Gals. 25% full is not met until just under 30". Grab a empty pop bottle and a tape measure ;)

Try the attached spreadsheet. Just put in the Diameter and length, and it will work out the gallons at each inch measured. I made it up to 120 inches...easy enough to expand if you need. You can also just enter a number under 'Measured Height' and it will calculate gallons based on your diameter and Length.

But basically, this is what you want to put in an Excel cell...

=(length*((radius^2*(ACOS((radius-height)/radius)))-(SQRT(2*(radius*height)-height^2)*(radius-height))))/231

(assumes units are in inches, and you want it in gallons - thats the /231 at the end, and flat endcaps)
 

Attachments

  • tankvol.zip
    4.4 KB · Views: 21
Last edited by a moderator:
Here is an excel that will allow you to enter the values and get an answer. I populated it with a 4 foot diameter cylinder that in 10 feet long and then figured the amount of fluid in cubic feet and gallons for each inch of fluid if the cylinder is laying on it side.

Sorry about the zip but PoA will not allow excell files to be uploaded.
 

Attachments

  • Volume_Calc.zip
    3.7 KB · Views: 20
smigaldi said:
Here is an excel that will allow you to enter the values and get an answer. I populated it with a 4 foot diameter cylinder that in 10 feet long and then figured the amount of fluid in cubic feet and gallons for each inch of fluid if the cylinder is laying on it side.

Sorry about the zip but PoA will not allow excell files to be uploaded.

Unless I mis-understood the original question, I don't think that Pi * r-squared * height is going to work ;)

The cylinder is laying on it's side...not on it's circular base - hence the volume cannot be calculated by taking the area of the circle and multiplying by the height. Think Pepsi can laying on its side...

With a horizontal cylinder, the area involved is NOT pi * r-squared, because the cross-section of the fluid is NOT a circle...it's a hemisphere.
a-1_tn.jpg
 
SJP said:
Try the attached spreadsheet. Just put in the Diameter and length, and it will work out the gallons at each inch measured. I made it up to 120 inches...easy enough to expand if you need. You can also just enter a number under 'Measured Height' and it will calculate gallons based on your diameter and Length.

But basically, this is what you want to put in an Excel cell...

=(length*((radius^2*(ACOS((radius-height)/radius)))-(SQRT(2*(radius*height)-height^2)*(radius-height))))/231

(assumes units are in inches, and you want it in gallons - thats the /231 at the end, and flat endcaps)

That spreadsheet does exactly what I needed. Thanks a bunch.

My tanks are 96"dia. and 324" long, basically 10,000 gal. tanks.

When I figure out how to zip a file, I'll upload the spreadsheet I did using the Excel curve fit function that fit the curve very nicely but displayed the non-functional equation.
 
Graueradler said:
That spreadsheet does exactly what I needed. Thanks a bunch.

My tanks are 96"dia. and 324" long, basically 10,000 gal. tanks.

When I figure out how to zip a file, I'll upload the spreadsheet I did using the Excel curve fit function that fit the curve very nicely but displayed the non-functional equation.

Welcome - sometimes it's easier to see it, that for it to be explained ;)

Zipping is easy - www.winzip.com is probably the most common format. WinRAR is still very useful too. Both integrate directly into Explorer, just right click the file, pick Add to xxxxx.zip and you're done ;) I'm sure there is an equivalent Mac package too.
 
I guess I need to download a zip utility. You can do the same process on your spread sheet though. I tried it on yours and got the same bad result. I know the Excel curve fit is just that but I can't figure out why the process isn't working. Select your data table and make an x-y chart out of it. Select the chart and use the chart menu to add a trend line. I used a 6 power polynomial fit. In the chart type dialoge box options, tell it to display the formula. It will put the formula on the chart but I can then not get the formula provided to repoduce the curve it is supposed to be generating.
 
Warning - Math Content ahead !!!! :D

Excel formats the formula it uses to fit the chart - so the accuracy is compromised significantly -
  1. In the chart, select the trendline equation.
  2. On the Format menu, click Selected Data Labels.
  3. Click on the Number tab, and then click Number in the Category list.
  4. In the Decimal Places box, change the number to 30
  5. Click OK.
For an example, I did a 3 power polynomial fit to your 96x324 tank, and got the following formulas

at default settings :

y = -0.0127x3 + 1.8643x2 + 45.104x - 118.01

at 30 decimal places :

y = -0.012682110240389100000000000000x3 + 1.864270205337340000000000000000x2 + 45.103930751382600000000000000000x - 118.006852434387000000000000000000


While not a perfect fit at the start and end, it's pretty close - add in some forward and backward prediction and a 6 power fit and I got this :

y = 0.000000000000000052041704279304x6 - 0.000001772679860991000000000000x5 + 0.000434306563280699000000000000x4 - 0.050614504500292700000000000000x3 + 3.269251926849110000000000000000x2 + 25.024035924640300000000000000000x - 47.6975879389357000000000000

That was never more than 136 gallons off throughout the curve when directly putting in values to the displayed formula - somewhere around 2.5% at the midpoint. Given that you are trying to estimate a complex curve based on a pretty small number of points...thats probably as good as you are going to get without knowing the actual formula that made the points in the first place ;)

I attached a text file with the rounded output of the last formula...probably within the range of accuracy of the dipstick ( 1/8th of an inch at the midpoint is almost 20gallons ).

(btw, if you make 32000 points, and do a 6power fit with 2000+/- prediction, the resulting formula fits almost perfectly...but if you actually made 32000 measurements, why you would you need a graph to predict the unknown values :D Pretty much kills Excel tho...)

 

Attachments

  • output.txt
    841 bytes · Views: 3
Back
Top