PetroCalcHub

Engineering lesson

Calculate gas density with absolute pressure and temperature

Calculate gas density using absolute pressure, absolute temperature, molecular weight and a compatible Z factor. Gauge pressure and Celsius cannot be inserted directly into an absolute gas-law expression.

By PetroCalcHub Team · Updated October 24, 2026 · Free to read and use

Match the gas constant to the units

The site's field expression uses P in psia, molecular weight in lb/lbmol, T in degrees Rankine and R in psia·ft³/(lbmol·°R). Its density is lb/ft³.

The SI expression uses pascals, kelvin and a matching molar gas constant. Mixing a field R with SI inputs is not a small coefficient error.

Supply Z at the same state

Z is dimensionless but state dependent. A Z taken from a different pressure, temperature or composition makes the density inputs inconsistent.

The teaching sweep fixes Z and temperature to isolate pressure proportionality. It is explicitly not a Z correlation over the whole range.

Check limiting and ratio behavior

At fixed T, molecular weight and Z, density scales with absolute pressure. At fixed pressure and Z it scales inversely with absolute temperature.

These ratios provide checks before using a more complex fluid model. They do not eliminate the need for phase and composition consistency.

Explore the example

Replayed with the same equation record and calculation engine as /calculators/real-gas-density. Original synthetic inputs; engine outputs are saved in the downloadable record.

1,000

Select one of 5 recorded scenarios. Intermediate states are not interpolated.

Selected scenario

Pressure (psia) = 1000. rho_g (lb/ft³): 3.44006015.

Selected result05.1610.31001,5503,000Scenario input
  • rho_g (lb/ft³)
rho_g (lb/ft³) versus Pressure (psia). Green marks the selected row. Lines connect recorded points for orientation; exact solved values are tabulated below.

Worked example

Real Gas Density

Fixed controls: M_g = 18.82855 lb/lbmol; z = 0.85 dimensionless; R = 10.732 psia ft³/(lbmol °R); T = 600 °R. P is varied as shown.

Relation and unit basis

rho_g = P M_g / (z R T)

P: Pressure (psia). M_g: Gas Molecular Weight (lb/lbmol). z: Gas Compressibility Factor (dimensionless). R: Gas Constant (psia ft³/(lbmol °R)). T: Temperature (°R).

  1. 1. Define the baseline

    Pressure (psia) = 1000

    Fixed controls: M_g = 18.82855 lb/lbmol; z = 0.85 dimensionless; R = 10.732 psia ft³/(lbmol °R); T = 600 °R. P is varied as shown.

  2. 2. Select the relation

    rho_g = P M_g / (z R T)

    P: Pressure (psia). M_g: Gas Molecular Weight (lb/lbmol). z: Gas Compressibility Factor (dimensionless). R: Gas Constant (psia ft³/(lbmol °R)). T: Temperature (°R).

  3. 3. Substitute the values

    P = 1000; M_g = 18.82855; z = 0.85; R = 10.732; T = 600 → rho_g = 3.44006015 lb/ft³

    Retain intermediate precision. The displayed values are rounded only after evaluation.

  4. 4. Read the result

    rho_g (lb/ft³) = 3.44006015

    Z and absolute temperature are held fixed to isolate pressure proportionality.

Result and interpretation

rho_g (lb/ft³) = 3.44006015

Z and absolute temperature are held fixed to isolate pressure proportionality.

Only absolute pressure varies. The retained constant Z is an experimental control.

Exact scenario data

Replayed with the same equation record and calculation engine as /calculators/real-gas-density. Original synthetic inputs; engine outputs are saved in the downloadable record.

Exact recorded values for Real Gas Density. Units are included in the headers.
Pressure (psia)rho_g (lb/ft³)
1000.344006
5001.72003
1,0003.44006
2,0006.88012
3,00010.32018

Scroll the table to see all columns. The highlighted row is the worked baseline. Downloads retain full numerical precision.

Test your understanding

Work through the question before revealing its answer. Use the stated assumptions and include units in every numerical step.

  1. 1. Does doubling Celsius temperature halve gas density?

    Show the worked answer

    No. The inverse relationship uses absolute temperature in kelvin or Rankine, not Celsius.

  2. 2. Reproduce the baseline rho_g (lb/ft³) without rounding intermediate values.

    Show the worked answer

    P = 1000; M_g = 18.82855; z = 0.85; R = 10.732; T = 600 → rho_g = 3.44006015 lb/ft³. rho_g (lb/ft³) = 3.44006015. Z and absolute temperature are held fixed to isolate pressure proportionality.

  3. 3. Compare the first and last recorded scenarios. Which input changes?

    Show the worked answer

    Pressure (psia) changes from 100 to 3000. Other controls remain as stated in the premise. rho_g (lb/ft³) changes from 0.344006015 to 10.3201804.

  4. 4. What would be needed to apply this example to a different physical system?

    Show the worked answer

    Replace the synthetic controls with compatible documented inputs and check the relation's assumptions. P: Pressure (psia). M_g: Gas Molecular Weight (lb/lbmol). z: Gas Compressibility Factor (dimensionless). R: Gas Constant (psia ft³/(lbmol °R)). T: Temperature (°R). Z and absolute temperature are held fixed to isolate pressure proportionality.

Before using the result

  • Use absolute P and T.
  • Match R to all input units.
  • Use Z from the same state and mixture.

Z and absolute temperature are held fixed to isolate pressure proportionality.

Continue in the calculator with your documented inputs →

Continue learning

Start with the broader workflow guide · Related method guide

Sources and method

The explanation and synthetic examples are original PetroCalcHub teaching material. The references below support the definitions and model context. They do not supply field validation for the synthetic scenarios.

Report a correction · Read the calculation review method