@ventz, This is a neat project.
I copied/pasted the chart from the Tank Size WebPage that @thefloyd linked to Here, straight into MS Excel and created a trendline for each tank.
You could use a #Define Statement (or similar) at the beginning of the Code for the User to Select their Tank Size, and calculate the gallons directly in the Loop.
y = Gallons , x = Inches
Below are the Equations from Excel:
TANK : EQUATION
275H : y = 10.909x - 10.023
275V : y = 6.8046x - 13.626
500 : y = -0.005x3 + 0.3626x2 + 4.9946x - 4.7142
550 : y = -0.0056x3 + 0.3993x2 + 5.2575x - 4.2845
1000 : y = -0.0099x3 + 0.7115x2 + 9.8384x - 8.7038
Decent fits for a quick stab…