# How to calculate air tank capacity from tank displacement, tank fill (gauge) pressure, and specific type of gas?

I am trying to calculate the amount of a specific compressed gas that will fit in an air tank of specific displacement, at a specific pressure. This is in reference to compressed air guns.

The inputs are:

• Tank Displacement (units: cubic inches or cubic centimeters)
• Tank Fill (Gauge) Pressure (units: psi or bar)
• Type of Gas:
• Dry Air
• Carbon Dioxide
• Nitrogen
• Helium

*For this scenario, Temperature is assumed to be constant @ 20C / 68F / 293.15K.

The output is:

• Tank Capacity (units: cubic feet or cubic meters)
• In other words... an example of a possible question that could be asked pertaining to this would be: "How many cubic feet of helium will fit in a 122cc tank when filled at 3000psi?"

My question is: What amount of specific gas will fit in an air tank of specific displacement when filled at a specific pressure? (Please provide equation along with an explanation)

I am having trouble coming up with the proper equation to use with the given inputs. I have tried the Ideal Gas Law, Boyle's Law, and the Combined Gas Law. I have no way to verify if the answer I am getting is correct because I'm not sure if I'm using the correct equation.

Note: this is not homework. I am a PHP developer. This is functionality I am implementing for a client's website.

Thanks!

• Welcome to Chemistry SE! You should still put some of your calculations, so we can see what was wrong. Dec 16, 2015 at 0:26
• Well for Carbon Dioxide, Nitrogen, and Helium you can assume that the ideal gas law works and it will be "reasonably close" $$PV = nRT$$ Dry air is a bit funny in that it is a mixture of gases. You should be able to find the mass of a liter of dry air at some combination of T,V and P. 22.4 liters would be a "mole" of air.
– MaxW
Dec 16, 2015 at 0:51
• The gist is that the "cubic feet" is measured at standard temperature and pressure and then pumped into the smaller volume under pressure.
– MaxW
Dec 16, 2015 at 0:58
• @MaxW How do the inputs above plug into the Ideal Gas Law? P = Tank Fill Pressure V = Tank Displacement n = # moles = mass of specific gas / molar mass R = Specific gas constant T = Temperature Where I'm getting confused is how there is only one Volume in the equation. If I'm given Tank Displacement (as volume), how can I solve for Tank Capacity (as volume)? Dec 16, 2015 at 16:58
• The compressibility factor (z factor) for carbon dioxide under the conditions in the tank is about 0.35. So the ideal gas law will not be accurate enough for CO2. You should use PV=znRT, with z = 0.35 for inside the tank. Dec 22, 2015 at 13:23

"Quick and Dirty" for gases other than carbon dioxide

You're trying to figure out what volume of gas as STP (standard temperature and pressure) would fill a 122 cc tank at 3000 psi. From ideal gas laws:

$PV = nRT$

but since nRT is constant

$P_1V_1 = P_2V_2$

so

$V_{14.7psi} = \dfrac{(3000\text{ psi})V_{3000psi}}{14.7\text{ psi}} = 204 \times V_{3000psi}$

It takes one tank of gas to fill the "empty" tank, so 203 more tanks of gas can be pumped into the tank full of gas at 14.7 psi to get to $3000 \text{ psi}$.

$203 \times 122 \text{ cubic centimeters} = 24.7 \text{ liters}$

1 liter is 0.0353147 cubic feet. So:

$24.7 * 0.0353147 = 0.87$ cubic feet of whatever gas.

I lifted the following figure from this webpage. In basically shows that for a given temperature and amount of gas (number of moles) then the product of pressure and volume, PV, ought to be a constant which isn't observed with "real" gases. The lines show the real behavior and the data points estimates from the Van der Waals equations. The gist here that for most normal gases at 3000 psi (200 atmospheres), you'll only be off by about 20%.

More exact solution using Van der Waals equation for gases other than carbon dioxide

Starting from the Van der Waals equation

$(P + \dfrac{an^2}{V^2})(V - nb) = nRT$

Where:

• P - pressure
• V - volume
• n - number of moles
• T - absolute temperature
• R - ideal gas constant = 0.08206 L atm/(K mol)
• a - constant
• b - constant

T must be an absolute temperature. Typically in science the Kelvin scale is used.

P is conveniently converted to atmospheres where 1 atmosphere = 14 psi.

a,b are looked up in tables of gas constants

In the following table the constant $a$ has units $L^2 \cdot \text{atm} \cdot mole^{-2}$ (assuming 1 bar = 0.987 atm )and $b$ has units $L \cdot mole^{-1}$

   Gas                a             b
Nitrogen          1.352          0.0387
Helium            0.0342         0.0238
Dry Air(a)        1.33           0.0366
Carbon dioxide    3.593          0.04267


(a) reference

Steps:

(1) To calculate the number of moles of gas at high pressure, you solve the following cubic equation for $n$. (Knowing $P, V, T, a,$ and $b$). At high pressure (hundreds of atmospheres), and well above the critical temperature there will only be one root for $n$ for all the gases listed except carbon dioxide.

$(\dfrac{ab}{V^2})n^3 - (\dfrac{a}{v})n^2 + (Pb+RT)n -PV = 0$

(2) To calculate the volume of gas at room temperature and pressure, you solve the following cubic equation for volume, V, using $n$ from step 1. (Knowing $P, n, T, a$, and $b$). At room temperatures and pressure there will only be one root for $V$ for all gases including carbon dioxide.

$(P)V^3 -(nbP+nRT)V^2 +(an^2)V -abn^3 = 0$

Solution for carbon dioxide

At room temperature and pressure gaseous carbon dioxide gas would follow Van der Waals equation as noted in step 2 above. However with "moderate" pressure carbon dioxide liquefies at room temperature. Thus a carbon dioxide tank is filled to about 85% of its volume capacity with liquid carbon dioxide.

The overall idea is that the liquid carbon dioxide expands to a gas in an airgun. This creates a relatively stable pressure as the airgun is shot. (You do have to allow the carbon dioxide reservoir to warm back to ambient temperature since vaporizing the liquid to a gas cools the reservoir.)

There are two other considerations here. First above the critical point 304.18 K (31.03 °C, 89 °F) and 72.8 atmospheres, carbon dioxide exists as a supercritical fluid. Second a carbon dioxide tank is never filled completely full of liquid. There is always some gas headspace, hence the 85% fill. Carbon dioxide tanks have been documented to explode in a hot car on a summer day for example.

(Image from Wikipedia)

• Dah... I really need to change the answer. @ChesterMiller is right. CO2 is very different than the other gasses. At "high" pressure (much less than 3000psi) it would be a liquid at room temperature. As far as the Van der Waals equation, you look up the additional constants in a table of such constants for various gases. For example: en.wikipedia.org/wiki/Van_der_Waals_constants_%28data_page%29
– MaxW
Dec 29, 2015 at 2:40
• Which equation to use for each step? Dec 29, 2015 at 21:21
• ?!? The Van der Waals equation of course. // I'm still working on the whole answer. I need coefficients for air and more on CO2.
– MaxW
Dec 29, 2015 at 21:23
• Solving for V in Van der Waals yields a cubic equation. Is this intended? Dec 29, 2015 at 21:25
• To clarify, to solve for n: n = ((P * V) / (R * T)) * (1 + ((n^2 * a) / (P * V^2))) * (1 - ((n * b) / V))? And to solve for V: V = (n * R^3 * T^3) / (((P * R^2 * T^2) + a * P^2) + (n * b))? Dec 29, 2015 at 22:34

You may not be using absolute temperatures in your calculations. It honestly should matter as all of them stem from the Ideal gas law: $$PV = nRT \Rightarrow \frac{P_1V_1}{n_1T_1} = R = \frac{P_2V_2}{n_2T_2}$$ Where $P$ is pressure, $V$ is volume, $n$ is the number of moles, $R$ is the ideal gas constant, and $T$ is the absolute temperature. Boyle's, Charles, Gay Lussac's, and the combined gas Laws assume that the same number of moles (molecules) are used for each initial and final condition ($n_1 = n_2$).

The Combine gas law makes no further assumption than constant number of moles ($n_1 = n_2$) giving: $$\frac{P_1V_1}{T_1} = nR = \frac{P_2V_2}{T_2}$$ Boyle's law, adds that the initial and final temperatures are assumed to be the same ($n_1T_1 = n_2T_2$) thus: $$P_1V_1 = RnT = P_2V_2$$
Charle's law, adds that the initial and final pressures are assumed to be the same ($\frac{P_1}{n_1} = \frac{P_2}{n_2}$) thus: $$\frac{V_1}{T_1} =\frac{V_2}{T_2}$$ Gay-Lussac's law, adds that the initial and final volumes are assumed to be the same ($\frac{V_1}{n_1} = \frac{V_2}{n_2}$) thus: $$\frac{P_1}{T_1} = \frac{P_2}{T_2}$$

The ideal gas law is for ideal gases which gives values close enough to most real gases. If your customer would like to be more accurate though there is the Van Der Waals equation: $$P = \frac{nRT}{V-nb} - \frac{n^2a}{V^2}$$ Where $a$ and $b$ are constants specific to the gas. But again your most likely malfunction is using Celsius temperatrue for $T$ in stead of Kelvin temperatue ($T_\mathrm K = T_\mathrm C+273.15$)