Real Gas Density Calculator — Z-Factor Correction, Ideal-Gas Deviation & Flow Impact
Calculate real-gas density from pressure, temperature, specific gas constant and a known Z-factor, then quantify density and optional volumetric-flow deviation from the ideal-gas baseline.
Enter the known values and review the calculated result
Input parameters
Use consistent values and select the intended engineering units.
Thermodynamic state
Flow impact (optional)
Results
Calculation tools Save, export and manage your results
Save your calculation, export available results, or store a finalized engineering artifact in your account.
Method, application and limitations
Review the calculation method, intended application and engineering assumptions before using the result in a design decision.
Formula and calculation method
Real-gas density with compressibility factor
The calculator treats the compressibility factor Z as a known input for the specified gas state. Real-gas density is calculated as:
ρreal = p / (Z · R · T)
The corresponding ideal-gas density at the same pressure, temperature and specific gas constant is:
ρideal = p / (R · T)
Therefore, the real-to-ideal density correction factor is:
ρreal / ρideal = 1 / Z
Density deviation from the ideal-gas baseline
The percentage density deviation is calculated relative to the ideal-gas density:
Δρ = [(ρreal − ρideal) / ρideal] · 100%
which is equivalent to:
Δρ = (1 / Z − 1) · 100%
Optional volumetric-flow impact
If mass flow rate ṁ is provided, the calculator also evaluates real and ideal volumetric flow:
V̇real = ṁ / ρreal
V̇ideal = ṁ / ρideal
At the same mass flow rate:
V̇real / V̇ideal = Z
and the volumetric-flow deviation from the ideal-gas baseline is:
ΔV̇ = (Z − 1) · 100%
Symbols
- p — absolute gas pressure [Pa]
- T — absolute gas temperature [K]
- Z — compressibility factor [−]
- R — specific gas constant [J/(kg·K)]
- ρreal — real-gas density [kg/m³]
- ρideal — ideal-gas density [kg/m³]
- ṁ — mass flow rate [kg/s], optional
- V̇ — volumetric flow rate [m³/s]
When to use this calculator
When to use this calculator
Use this calculator when the gas pressure, temperature, specific gas constant and compressibility factor are known and you want to determine how non-ideal gas behavior changes density relative to the ideal-gas assumption.
It is particularly useful for:
- calculating real-gas density from a known compressibility factor Z,
- checking whether an ideal-gas density estimate introduces a significant error,
- quantifying the percentage density correction caused by non-ideal gas behavior,
- estimating the effect of Z on volumetric flow when mass flow is known,
- preliminary assessment of compressed-gas systems, piping calculations, vessel calculations and compressor-related analyses where gas density is required.
The calculator is intended for a known gas state. The entered Z-factor must correspond to the relevant pressure, temperature and gas composition.
When not to use it
This calculator does not determine the compressibility factor from pressure and temperature, does not solve an equation of state, and does not contain a gas-composition or phase-equilibrium model.
If Z is unknown, it must first be obtained from an appropriate property source, equation of state, correlation or other validated method applicable to the gas and operating state.
The calculator also does not determine pressure drop, compressor power, heat transfer, phase change or transient system behavior. Those effects require separate engineering analysis.
How to interpret the result
How to interpret the results
Real-gas density
ρreal is the gas density after applying the entered compressibility factor Z. It is the primary corrected density result for the specified pressure, temperature and specific gas constant.
Ideal-gas density
ρideal is the density obtained for the same pressure, temperature and specific gas constant when Z is effectively equal to 1. It provides the baseline against which real-gas effects are measured.
Density correction factor
The value 1/Z is the ratio of real-gas density to ideal-gas density.
- 1/Z = 1 — real and ideal density are equal.
- 1/Z > 1 — calculated real-gas density is higher than the ideal-gas value.
- 1/Z < 1 — calculated real-gas density is lower than the ideal-gas value.
Density deviation
Δρ expresses the density difference relative to the ideal-gas baseline.
- Positive Δρ — the real-gas density is higher than the ideal-gas estimate.
- Negative Δρ — the real-gas density is lower than the ideal-gas estimate.
- Δρ = 0% — there is no density difference for the entered state.
Volumetric-flow deviation
ΔV̇ shows the percentage change in volumetric flow caused by the entered Z-factor when mass flow is held constant. Because V̇real/V̇ideal = Z, a Z below 1 produces a lower real volumetric flow, while a Z above 1 produces a higher real volumetric flow.
Effect of the main inputs
- Increasing absolute pressure increases both real and ideal density when the other entered values remain unchanged.
- Increasing absolute temperature decreases both calculated densities when the other entered values remain unchanged.
- Increasing Z decreases calculated real-gas density relative to the ideal baseline.
- Changing mass flow does not change the calculated density or percentage deviations; it changes only the optional volumetric-flow values.
A small deviation from the ideal-gas result only indicates that the supplied Z-factor produces a small correction in this calculation. It does not independently confirm the accuracy of Z, the validity of the gas-property data or the suitability of the result for a complete system design.
Calculation example
Example: effect of Z on gas density and volumetric flow
Consider an illustrative gas state for which the compressibility factor has already been determined independently.
- Absolute pressure: p = 1.0 MPa = 1,000,000 Pa
- Gas temperature: T = 300 K
- Compressibility factor: Z = 0.90
- Specific gas constant: R = 287.05 J/(kg·K)
- Mass flow rate: ṁ = 1.00 kg/s
1. Ideal-gas density
ρideal = p / (R · T)
ρideal = 1,000,000 / (287.05 · 300)
ρideal ≈ 11.612 kg/m³
2. Real-gas density
ρreal = ρideal / Z
ρreal = 11.612 / 0.90
ρreal ≈ 12.903 kg/m³
3. Density correction and deviation
1 / Z = 1 / 0.90 = 1.1111
Δρ = (1 / 0.90 − 1) · 100% ≈ +11.11%
The real-gas model therefore predicts a density approximately 11.1% higher than the ideal-gas baseline for the entered state.
4. Volumetric flow at the same mass flow
V̇real = 1.00 / 12.903 ≈ 0.07750 m³/s
V̇ideal = 1.00 / 11.612 ≈ 0.08612 m³/s
The flow deviation is:
ΔV̇ = (0.90 − 1) · 100% = −10.0%
At the same mass flow rate, the real-gas volumetric flow is therefore 10% lower than the ideal-gas estimate.
Limitation: the example assumes that Z = 0.90 is already known and valid for the specified pressure, temperature and gas. The calculator does not determine whether that Z-value is appropriate.
Assumptions and limitations
Assumptions and limitations
- The gas is represented by a single compressibility factor Z at the evaluated pressure and temperature.
- The entered Z-factor is assumed to be valid for the actual gas or gas mixture and operating state.
- The calculator does not determine Z from an equation of state, reduced properties, critical properties, gas composition or empirical correlation.
- Pressure must represent absolute pressure and must be greater than zero.
- Temperature must represent an absolute thermodynamic temperature and must be greater than zero.
- The specific gas constant R must be consistent with the evaluated gas or gas mixture and must be greater than zero.
- The calculation assumes a single gas-phase state. It does not model condensation, evaporation, two-phase equilibrium or phase boundaries.
- The optional volumetric-flow comparison assumes the same mass flow for the real-gas and ideal-gas cases.
- The calculator does not account for pressure drop, heat transfer, changing gas composition, transient storage effects or variation of Z along a system.
- No uncertainty analysis is performed for pressure, temperature, R or Z. Uncertainty in these inputs directly affects the calculated density and flow comparison.
- For conditions where gas properties vary significantly across the system, evaluate Z and the thermodynamic state locally or use a more complete property or equation-of-state model.
