The Ideal Gas Law Equation
You may be familiar with the ideal gas law in the following commonly used form: PV = nRT. This equation gives the relationship among the pressure, P, volume, V, and temperature, T, of n moles of an ideal gas, using an ideal gas constant, R. We can introduce the density of the gas into the equation by making use of the fact that molecular weight (MW) has units of mass/mole, and thus that n = m/MW, and that the ideal gas law can be written as: PV = (m/MW)RT. Noting that m/V is density, ρ, the equation can be written as P(MW) = (m/V)RT = ρRT. Solving for density gives the following equation for the density of an ideal gas in terms of its MW, pressure and temperature.
ρ = (MW)P/RT
with commonly used U.S. units as follows:
ρ = density of the gas in slugs/ft3,
MW = molecular weight of the gas in slugs/slugmole (or kg/kgmole, etc.) (NOTE: MW of air = 29),
P = absolute gas pressure in psia (NOTE: Absolute pressure equals pressure measured by a gauge plus atmospheric pressure.),
T = absolute temperature of the gas in oR (NOTE: oR = oF + 459.67)
R = ideal gas constant = 345.23 psia-ft3/slugmole-oR.
If we can treat air as an ideal gas, then the ideal gas law in this form can be used to calculate the density of air at different pressures and temperatures.
An Excel spreadsheet works well for ideal gas law/gas density calculations. For a downloadable Excel template to calculate gas density with the ideal gas law, see the article, "Excel Templates for Venturi and Orifice Flow Meter Calculations."