Real gas calculator
This real gas calculator applies the four classic cubic equations of state (van der Waals, Redlich-Kwong, Soave-Redlich-Kwong and Peng-Robinson) to find the pressure from temperature and molar volume, or the molar volume, compressibility factor Z, density and fugacity from temperature and pressure, with every real root of the cubic shown.
Real gas calculator: solve a cubic equation of state
Real gas calculator vs ideal gas: compare all four equations
Equation of state constants a and b for the real gas calculator
How to use the real gas calculator
The first panel is the main real gas calculator. Choose whether you know the pressure (then it finds the molar volume, Z, density and fugacity) or the molar volume (then it finds the pressure). Select one of twelve built-in gases or “Custom”, pick the equation of state, and enter the temperature in K, °C, °F or °R. When the cubic in Z has three real roots, the panel lists all of them and reports the stable root by default, which is the one with the lower fugacity; you can also choose the vapor or the liquid root, and the result is then labeled “metastable” if that root is not the stable one. The second panel runs the same state through all four equations side by side against the ideal gas law, which is the quickest way to see how much the answer depends on the model. The third panel prints the constants a and b, the form many homework problems ask for.
Why real gases deviate from PV = nRT
The ideal gas law ignores two things: molecules take up space, and they attract each other. At low pressure both effects are negligible, which is why the Ideal Gas Law Calculator is accurate for air at ambient conditions. As the gas is compressed or cooled toward its boiling point, attraction lowers the pressure below the ideal value (Z below 1), and at very high density the finite molecular volume pushes it above (Z above 1). Cubic equations of state model both effects with just two constants: b, a co-volume that accounts for molecular size, and a, an attraction term. Because they are cubic in volume, they also describe the liquid and the vapor with one equation, which no ideal gas model can do.
The four cubic equations in this real gas calculator
Here V is the molar volume, Tr = T/Tc the reduced temperature and ω the acentric factor, which measures how far a molecule’s vapor pressure curve departs from that of a simple spherical molecule such as argon. To solve for volume, each equation is rewritten as a cubic in Z = PV/RT using A = aP/(RT)² and B = bP/(RT). For Peng-Robinson the cubic is Z³ − (1 − B)Z² + (A − 3B² − 2B)Z − (AB − B² − B³) = 0; for RK and SRK it is Z³ − Z² + (A − B − B²)Z − AB = 0. The real gas calculator solves the cubic analytically, polishes each root with Newton’s method and discards any root with Z ≤ B, which would mean a volume smaller than the molecules themselves.
Worked example: saturated n-butane at 350 K
The vapor pressure of n-butane at 350 K is 9.4573 bar, so both saturated liquid and saturated vapor exist there. This is the classic real gas calculator test from Smith, Van Ness and Abbott’s Introduction to Chemical Engineering Thermodynamics, and it is the default of the first panel. With Tc = 425.12 K, Pc = 37.96 bar and ω = 0.200, Tr = 0.8233, and for Peng-Robinson κ = 0.6723, α = 1.1284, a = 1.6982 Pa·m⁶/mol² and b = 72.44 cm³/mol. Then A = 0.18965 and B = 0.023543, and the cubic has three real roots: Z = 0.03660, 0.13181 and 0.80806. The largest gives the saturated vapor volume V = 0.80806 × 8.314462618 × 350 / 945,730 = 2486 cm³/mol, and the smallest gives the liquid volume, 112.6 cm³/mol. Measured values are about 2482 and 115.0 cm³/mol, so Peng-Robinson is within 0.2% for the vapor and 2% for the liquid.
The fugacity coefficients of the two outer roots are 0.8380 and 0.8374, almost equal, which is exactly what phase equilibrium requires at the vapor pressure. The vapor root has the slightly lower value, so it is the stable root that the panel reports by default (the 2486 cm³/mol result); choose the liquid root to see 112.6 cm³/mol, labeled metastable. A real gas calculator that only returns one root hides this, so check the “All real roots” line whenever T is below Tc. Repeating the calculation in the real gas calculator with each equation gives the comparison below.
| Equation of state | Saturated vapor V (cm³/mol) | Saturated liquid V (cm³/mol) | Vapor Z |
|---|---|---|---|
| van der Waals | 2667 | 191.0 | 0.8667 |
| Redlich-Kwong | 2555 | 133.3 | 0.8305 |
| Soave-Redlich-Kwong | 2520 | 127.8 | 0.8191 |
| Peng-Robinson | 2486 | 112.6 | 0.8081 |
| Measured (reference data) | ≈ 2482 | ≈ 115.0 | ≈ 0.807 |
| Ideal gas | 3077 | – | 1 |
The ideal gas law overestimates the vapor volume by 24% here. Van der Waals is far off, especially for the liquid, while SRK and Peng-Robinson are close for the vapor; Peng-Robinson gives the better liquid density, which is the reason it was developed in 1976.
Critical constants used by the real gas calculator
The built-in data are from Poling, Prausnitz and O’Connell, The Properties of Gases and Liquids (5th ed., Appendix A); air uses the pseudo-critical values of Smith, Van Ness and Abbott. You can compare them with the NIST Chemistry WebBook thermophysical property data, which also gives accurate reference densities for checking any result of this real gas calculator.
| Gas | Tc (K) | Pc (bar) | ω | M (g/mol) |
|---|---|---|---|---|
| Nitrogen, N₂ | 126.20 | 33.98 | 0.037 | 28.014 |
| Oxygen, O₂ | 154.58 | 50.43 | 0.022 | 31.999 |
| Air (pseudo-critical) | 132.2 | 37.45 | 0.035 | 28.96 |
| Carbon monoxide, CO | 132.85 | 34.94 | 0.045 | 28.010 |
| Carbon dioxide, CO₂ | 304.12 | 73.74 | 0.225 | 44.010 |
| Hydrogen, H₂ | 33.19 | 13.13 | −0.216 | 2.016 |
| Methane, CH₄ | 190.56 | 45.99 | 0.011 | 16.043 |
| Ethane, C₂H₆ | 305.32 | 48.72 | 0.099 | 30.070 |
| Propane, C₃H₈ | 369.83 | 42.48 | 0.152 | 44.097 |
| n-Butane, C₄H₁₀ | 425.12 | 37.96 | 0.200 | 58.123 |
| Ammonia, NH₃ | 405.40 | 113.53 | 0.257 | 17.031 |
| Water, H₂O | 647.14 | 220.64 | 0.344 | 18.015 |
How accurate is a real gas calculator based on cubic equations?
The default of the second panel of the real gas calculator, methane at 25 °C and 100 bar, shows typical behavior for a supercritical gas. Ideal gas gives 247.9 cm³/mol; van der Waals 200.9, Redlich-Kwong 211.3, SRK 214.8 and Peng-Robinson 205.7 cm³/mol. The reference value from a high-accuracy multiparameter equation is about 211.1 cm³/mol (Z ≈ 0.852), so RK and SRK land within 2% and Peng-Robinson within 3%, while the ideal gas law is 17% high. As rough guidance: SRK and Peng-Robinson give gas-phase Z within 1–3% for light hydrocarbons, nitrogen and CO₂ away from the critical point; liquid densities from SRK are often 10–20% low and from Peng-Robinson 5–10% low; near the critical point every cubic is less reliable. Polar and associating fluids (water, ammonia, alcohols) and quantum gases (hydrogen, helium at low temperature) are handled worst. For high-pressure nitrogen, for example at 200 bar and 20 °C, Peng-Robinson gives Z = 1.022 against about 1.052 from reference data, a 3% error that matters for cylinder inventory.
When the question is only “how far from ideal is this gas?”, the Compressibility Factor Calculator is the faster tool: it gives Z from reduced conditions with the Pitzer correlation and Peng-Robinson and plots it. Use this real gas calculator when you need the full equation of state: pressure from volume, both roots below Tc, fugacity, or the a and b constants. For water and steam, the real gas calculator is a rough check only; the IAPWS steam tables are the reference.
Common mistakes when using a real gas calculator
Mixing units in R, a and b. If a is in L²·bar/mol², R must be 0.08314 L·bar/(mol·K) and V in L/mol; the real gas calculator works in SI throughout and converts at the end. Taking the wrong root. Below Tc the cubic can have three roots; the middle one is never physical, and reporting the vapor root for a compressed liquid gives a density ten or twenty times too low. Using gauge pressure. All equations need absolute pressure. Using Redlich-Kwong constants with a temperature-independent a. In RK, a is divided by √T; forgetting this gives errors of tens of percent at low temperature. Expecting accurate liquid densities. Cubic equations are tuned for vapor pressure and gas density; use measured liquid densities or a volume translation for liquids. Forgetting the acentric factor. SRK and Peng-Robinson need ω; leaving it at zero is only correct for simple fluids such as argon or methane.
Related calculators
Start from the Ideal Gas Law Calculator for low-pressure gases, use the Compressibility Factor Calculator for quick Z values, and take enthalpy changes from the Enthalpy Calculator. Real gas densities feed the Pressure Drop Calculator for high-pressure gas lines.
- Ideal Gas Law Calculator
- Compressibility Factor Calculator
- Heat Capacity Calculator
- Enthalpy Calculator
- Pressure Drop Calculator
- All chemical engineering calculators
Frequently asked questions
Which equation of state is the most accurate?
In a real gas calculator, the choice matters. For hydrocarbons, light gases and CO₂, Peng-Robinson and Soave-Redlich-Kwong give similar gas-phase accuracy (usually within 1–3% in Z); Peng-Robinson gives better liquid densities. Van der Waals is mainly for teaching. For water and steam use the IAPWS steam tables.
What is the difference between a real gas and an ideal gas?
An ideal gas has point molecules with no forces between them, so Z = PV/(RT) = 1 exactly. A real gas has molecular volume and attraction, so Z differs from 1, most strongly at high pressure and near condensation.
Why does the real gas calculator show three roots?
Below the critical temperature the cubic equation can have three real solutions for volume. The smallest corresponds to liquid, the largest to vapor, and the middle one is unphysical. The stable phase is the root with the lower fugacity; at the vapor pressure the two fugacities are equal.
What is the acentric factor ω?
ω = −1 − log₁₀(Psat/Pc) at Tr = 0.7. It is close to zero for simple spherical molecules (argon, methane) and grows with molecular size and polarity, for example 0.200 for n-butane and 0.344 for water.
Is this real gas calculator free?
Yes. It runs in your browser, needs no sign-up and does not store or send the values you enter.