Thermodynamics

Real Gas Density Deviation Calculator — Compressibility Factor Impact on Density and Flow

Calculate real gas density using pressure, temperature, compressibility factor, and specific gas constant.

Unit-aware inputs Deterministic calculation Engineering interpretation
Calculation workspace

Enter the known values and review the calculated result

Deterministic calculation
01
Parameters

Input parameters

Use consistent values and select the intended engineering units.

Thermodynamic state

Flow conditions

02
Output

Results

Live
Ready to calculate Complete the required inputs and run the calculation.
Engineering Pro Save, document and continue this calculation

Turn this result into a reusable engineering record with saving, PDF export and reporting workflows.

Engineering reference

Method, application and limitations

Review the calculation method, intended application and engineering assumptions before using the result in a design decision.

01
Method

Formula and calculation method

Real gas density formula:

ρideal = p / (R · T)

ρreal = ρideal / Z

ε = ((ρreal − ρideal) / ρideal) · 100%

where:

  • ρreal — real gas density (kg/m³)
  • ρideal — ideal gas density (kg/m³)
  • ε — density deviation (%)
  • p — pressure (Pa)
  • T — temperature (K)
  • Z — compressibility factor (−)
  • R — specific gas constant (J/(kg·K))
02
Application

When to use this calculator

When to use this calculator:

  • Compare real gas density against ideal gas density for a specified pressure, temperature, compressibility factor, and gas constant.
  • Evaluate the density deviation caused by compressibility factor before using ideal-gas density in flow calculations.
  • Calculate real and ideal volumetric flow from the same mass flow rate.
  • Check whether compressibility correction changes density enough to require non-ideal gas treatment.
  • Convert a selected compressibility factor into density correction factor and flow ratio.
03
Decision support

How to interpret the result

Real gas density is defined as ideal gas density corrected by compressibility factor.

Density deviation is defined as the percentage difference between real gas density and ideal gas density. It depends directly on the compressibility factor correction.

  • Safe — absolute density deviation is below 5%.
  • Warning — absolute density deviation is from 5% to 15%.
  • Unsafe — absolute density deviation is above 15%.
  • Invalid — one or more required inputs violate the validation limits from the calculator.

Increasing pressure increases both ideal and real density. Increasing temperature or specific gas constant decreases both ideal and real density. Increasing compressibility factor decreases real gas density and reduces the density correction factor.

04
Worked case

Calculation example

Example:

A user wants to check how much the selected compressibility factor changes gas density and volumetric flow compared with the ideal-gas assumption.

  • p — Pressure = 500000 Pa
  • T — Temperature = 300 K
  • Z — Compressibility factor = 0.90
  • R — Specific gas constant = 287 J/(kg·K)
  • ṁ — Mass flow rate = 1 kg/s

ρideal = 5.807 kg/m³, ρreal = 6.452 kg/m³, ε = 11.111%.

05
Model boundaries

Assumptions and limitations

  • Ideal gas density is calculated from pressure, specific gas constant, and temperature.
  • Real gas density is calculated by applying compressibility factor to ideal gas density.
  • Density deviation is evaluated relative to ideal gas density.
  • Volumetric flow is calculated from mass flow rate divided by density.
  • The compressibility factor must remain between 0.2 and 5.
  • Temperature must remain between 50 K and 2000 K.
  • Pressure must not exceed 100000000 Pa.
  • Specific gas constant must remain between 50 and 1000 J/(kg·K).
06
Questions

Frequently asked questions

How to calculate real gas density?
Real gas density is calculated by first calculating ideal gas density from pressure divided by specific gas constant and temperature, then dividing that density by compressibility factor. Real gas density depends on pressure, temperature, specific gas constant, and compressibility factor.
What affects real gas density the most?
Real gas density increases with pressure. Real gas density decreases when temperature, specific gas constant, or compressibility factor increases.
When is the real gas density formula not valid?
The formula is not valid when pressure, temperature, compressibility factor, mass flow rate, or specific gas constant is not positive. It is also rejected when temperature is below 50 K, temperature is above 2000 K, pressure is above 100000000 Pa, compressibility factor is below 0.2, compressibility factor is above 5, or specific gas constant is outside the range from 50 to 1000 J/(kg·K).
Can this calculator be used to compare real and ideal volumetric flow?
It can be used when mass flow rate and both calculated densities are positive. Real volumetric flow is mass flow rate divided by real gas density, while ideal volumetric flow is mass flow rate divided by ideal gas density.
Add an engineering note