Virial Equation of State Calculator

Compute the compressibility factor Z and pressure from the virial equation of state truncated at the second virial coefficient, Z=1+B(T)/Vm, with B(T) estimated from van der Waals constants.

🎈 Virial Equation of State Calculator
K
m³/mol
Compressibility factor (Z)
Real-gas pressure
2nd virial coeff. B(T)
Step-by-step working

🎈 What is the Virial Equation of State Calculator?

This virial equation of state calculator computes the compressibility factor Z and real-gas pressure from the virial equation truncated at the second virial coefficient, Z=1+B(T)/Vm. It is a systematic, statistical-mechanically grounded correction to the ideal gas law, more general than a single fixed correction like the van der Waals equation, since the virial series can in principle be extended with as many higher-order terms (C(T)/Vm2, D(T)/Vm3, and so on) as needed.

The second virial coefficient B(T) physically represents the net effect of pairwise intermolecular forces at a given temperature. A negative B(T) means attractive forces between molecules dominate, pulling real pressure below the ideal gas prediction. A positive B(T) means the molecules' own finite, excluded volume dominates instead, pushing real pressure above the ideal prediction. This calculator estimates B(T) from standard, widely tabulated van der Waals constants using B(T)=b-a/(RT), a practical convenience rather than a precisely measured reference value, an approximation this page discloses explicitly throughout.

Gas presets are provided for carbon dioxide, nitrogen, oxygen, and helium using standard textbook van der Waals constants, converted internally from the commonly tabulated units (L2·atm/mol2 for a, L/mol for b) to SI units. A custom option is also available for entering your own a and b constants directly in SI units.

This calculator is useful for physical chemistry and chemical engineering students studying real-gas behavior through the virial expansion, and for anyone wanting a quick estimate of how far a gas deviates from ideal behavior at a given temperature and molar volume, without needing a full table of measured virial coefficients.

📐 Formula

Z  =  1 + B(T)/Vm
P = (RT/Vm)·Z, the real-gas pressure using the virial correction
R = 8.314462618 J/(mol·K), Vm = molar volume (m³/mol)
B(T)  =  b − a/(RT)
Second virial coefficient, estimated from van der Waals constants a (Pa·m⁶/mol²) and b (m³/mol)
Conversion from tabulated units: aSI = aL·atm×10−6×101325, bSI = bL×10−3
Example: CO₂ at T=300 K: B(300) ≈ −105.19 cm³/mol; at Vm=0.0245 m³/mol, Z ≈ 0.995706, P ≈ 101.37 kPa (vs ideal 101.81 kPa).

📖 How to Use This Calculator

Steps

1
Choose a gas preset or custom a/b constants - CO2, N2, O2, He, or custom van der Waals constants.
2
Enter the temperature and molar volume - T in Kelvin, Vm in cubic meters per mole.
3
Read the compressibility factor and pressure - See Z and the real-gas pressure compared against the ideal gas prediction.

💡 Example Calculations

Example 1 - Carbon dioxide near room temperature

1
CO₂, T = 300 K, Vm = 0.0245 m³/mol
2
aSI = 0.368823 Pa·m⁶/mol², bSI = 4.267×10−5 m³/mol
3
B(300) = 4.267×10−5 − 0.368823/(8.314463×300) = −1.0519×10−4 m³/mol (−105.19 cm³/mol)
4
Z = 1 + B/Vm = 1 − 0.0042934 = 0.995706; P = (RT/Vm)×Z ≈ 101.37 kPa (ideal gas: 101.81 kPa), a net-attractive, below-ideal result consistent with CO₂'s known behavior near room temperature
Z = 0.995706, P = 101.37 kPa
Try this example →

Example 2 - Nitrogen, weaker deviation from ideal

1
N₂, T = 300 K, Vm = 0.0245 m³/mol
2
B(300) ≈ −17.33 cm³/mol, much smaller in magnitude than CO₂'s, since N₂ interacts far more weakly
3
Z = 1 + B/Vm0.999292; P ≈ 101.74 kPa (ideal gas: 101.81 kPa), much closer to ideal than CO₂ at the same conditions
Z = 0.999292, P = 101.74 kPa
Try this example →

Example 3 - Helium, excluded-volume-dominated (Z > 1)

1
He, T = 250 K, Vm = 0.02 m³/mol
2
B(250) ≈ +22.04 cm³/mol, positive, since helium's tiny intermolecular attraction is outweighed by its excluded volume at this density
3
Z = 1 + B/Vm1.001102, greater than 1; P ≈ 104.05 kPa (ideal gas: 103.93 kPa), above the ideal prediction, the opposite sign of the CO₂ and N₂ examples above
Z = 1.001102, P = 104.05 kPa
Try this example →

❓ Frequently Asked Questions

What is the virial equation of state?+
The virial equation of state is a power-series correction to the ideal gas law, Z=1+B(T)/Vm+C(T)/Vm^2+..., where Z is the compressibility factor and B(T), C(T) are the second, third, and higher virial coefficients. This calculator truncates the series at the second virial coefficient, B(T), the dominant correction term at low to moderate pressure.
What does the second virial coefficient B(T) represent?+
B(T) captures the net effect of pairwise intermolecular forces on a gas's pressure. A negative B(T) means attractive forces dominate at that temperature, pulling real pressure below the ideal gas prediction. A positive B(T) means the molecules' own finite (excluded) volume dominates instead, pushing real pressure above the ideal prediction.
Why does this calculator estimate B(T) from van der Waals constants instead of using measured values?+
This is a practical convenience versus precision trade-off, explicitly disclosed: B(T)=b-a/(RT) is a well-known approximation derived from the van der Waals equation, convenient because van der Waals constants are widely tabulated for many gases. Precisely measured B(T) values exist separately for real gases and can differ somewhat from this van der Waals-derived estimate, especially far from room temperature.
Why does Z approach 1 as molar volume grows large?+
As Vm becomes very large, the correction term B(T)/Vm shrinks toward 0 regardless of the sign or size of B(T), so Z approaches exactly 1, the ideal gas limit. Physically, at low density molecules are so far apart on average that intermolecular forces and excluded volume become negligible, exactly the assumption behind the ideal gas law.
What is the compressibility factor Z?+
Z is the ratio of a real gas's actual molar volume behavior to what the ideal gas law would predict at the same pressure and temperature, Z=PVm/(RT). Z=1 means the gas behaves ideally, Z less than 1 means attraction dominates (the gas is more compressible than ideal), and Z greater than 1 means excluded volume dominates (the gas resists compression more than ideal).
How accurate is the van der Waals estimate for B(T)?+
It gives physically sensible, correctly-signed results in the right ballpark, for example this calculator's CO2 estimate near room temperature comes out around -105 cm3/mol, while precisely measured values for CO2 near 300 K are typically in the -100 to -130 cm3/mol range depending on the exact temperature and source. Treat the van der Waals estimate as a reasonable approximation, not a high-precision reference value.
What van der Waals constants does this calculator use?+
Standard textbook values for CO2, N2, O2, and He, each entered in the commonly tabulated units of L2*atm/mol2 for a and L/mol for b, then converted internally to SI units (Pa*m6/mol2 and m3/mol respectively). These are approximate textbook values, not high-precision reference constants, consistent with this calculator's overall approximate B(T) approach.
When is the second-virial-coefficient truncation a good approximation?+
It works best at low to moderate pressure (roughly up to a few atmospheres for most gases), where higher-order terms like C(T)/Vm^2 remain small compared to 1+B(T)/Vm. At high pressure or low temperature near a gas's condensation point, higher virial coefficients and the truncation itself become less accurate.
Why might Z come out greater than 1 for helium but less than 1 for CO2 at similar conditions?+
Helium has an extremely small van der Waals 'a' (weak attraction) but a nontrivial 'b' (excluded volume), so at typical densities its positive excluded-volume contribution to B(T) can outweigh its tiny attractive contribution, giving B(T) greater than 0 and Z greater than 1. CO2 has a much larger 'a' relative to its 'b', so attraction dominates instead, giving B(T) less than 0 and Z less than 1, near room temperature.
Is the virial equation of state used in real engineering calculations?+
Yes, truncated virial equations are a standard, widely used method for real-gas property calculations at low to moderate pressure in chemical and process engineering, precisely because the virial coefficients have a rigorous statistical-mechanical foundation, unlike some purely empirical equations of state. For higher pressures, cubic equations of state like Redlich-Kwong or Peng-Robinson are typically used instead.

What is the virial equation of state?

The virial equation of state is a power-series correction to the ideal gas law, Z=1+B(T)/Vm+C(T)/Vm^2+..., where Z is the compressibility factor and B(T), C(T) are the second, third, and higher virial coefficients. This calculator truncates the series at the second virial coefficient, B(T), the dominant correction term at low to moderate pressure.

What does the second virial coefficient B(T) represent?

B(T) captures the net effect of pairwise intermolecular forces on a gas's pressure. A negative B(T) means attractive forces dominate at that temperature, pulling real pressure below the ideal gas prediction. A positive B(T) means the molecules' own finite (excluded) volume dominates instead, pushing real pressure above the ideal prediction.

Why does this calculator estimate B(T) from van der Waals constants instead of using measured values?

This is a practical convenience versus precision trade-off, explicitly disclosed: B(T)=b-a/(RT) is a well-known approximation derived from the van der Waals equation, convenient because van der Waals constants are widely tabulated for many gases. Precisely measured B(T) values exist separately for real gases and can differ somewhat from this van der Waals-derived estimate, especially far from room temperature.

Why does Z approach 1 as molar volume grows large?

As Vm becomes very large, the correction term B(T)/Vm shrinks toward 0 regardless of the sign or size of B(T), so Z approaches exactly 1, the ideal gas limit. Physically, at low density molecules are so far apart on average that intermolecular forces and excluded volume become negligible, exactly the assumption behind the ideal gas law.

What is the compressibility factor Z?

Z is the ratio of a real gas's actual molar volume behavior to what the ideal gas law would predict at the same pressure and temperature, Z=PVm/(RT). Z=1 means the gas behaves ideally, Z less than 1 means attraction dominates (the gas is more compressible than ideal), and Z greater than 1 means excluded volume dominates (the gas resists compression more than ideal).

How accurate is the van der Waals estimate for B(T)?

It gives physically sensible, correctly-signed results in the right ballpark, for example this calculator's CO2 estimate near room temperature comes out around -105 cm3/mol, while precisely measured values for CO2 near 300 K are typically in the -100 to -130 cm3/mol range depending on the exact temperature and source. Treat the van der Waals estimate as a reasonable approximation, not a high-precision reference value.

What van der Waals constants does this calculator use?

Standard textbook values for CO2, N2, O2, and He, each entered in the commonly tabulated units of L2*atm/mol2 for a and L/mol for b, then converted internally to SI units (Pa*m6/mol2 and m3/mol respectively). These are approximate textbook values, not high-precision reference constants, consistent with this calculator's overall approximate B(T) approach.

When is the second-virial-coefficient truncation a good approximation?

It works best at low to moderate pressure (roughly up to a few atmospheres for most gases), where higher-order terms like C(T)/Vm^2 remain small compared to 1+B(T)/Vm. At high pressure or low temperature near a gas's condensation point, higher virial coefficients and the truncation itself become less accurate.

Why might Z come out greater than 1 for helium but less than 1 for CO2 at similar conditions?

Helium has an extremely small van der Waals 'a' (weak attraction) but a nontrivial 'b' (excluded volume), so at typical densities its positive excluded-volume contribution to B(T) can outweigh its tiny attractive contribution, giving B(T) greater than 0 and Z greater than 1. CO2 has a much larger 'a' relative to its 'b', so attraction dominates instead, giving B(T) less than 0 and Z less than 1, near room temperature.

Is the virial equation of state used in real engineering calculations?

Yes, truncated virial equations are a standard, widely used method for real-gas property calculations at low to moderate pressure in chemical and process engineering, precisely because the virial coefficients have a rigorous statistical-mechanical foundation, unlike some purely empirical equations of state. For higher pressures, cubic equations of state like Redlich-Kwong or Peng-Robinson are typically used instead.