Understanding the van der Waals real gas calculator — concept and principle
The van der Waals equation corrects the ideal gas law for two facts that the ideal model ignores: molecules take up space, and they attract each other. Enter the amount of gas, the volume, the temperature and the gas's two van der Waals constants, and the calculator returns the predicted pressure next to the ideal-gas pressure. The defaults are the tabulated constants for carbon dioxide.
How it is calculated
(P + a n² / V²)(V − n b) = n R T, solved for pressure:
P = n R T / (V − n b) − a n² / V²
- n: amount in moles; V: volume in litres; T: absolute temperature in kelvin.
- a (L²·bar/mol²): strength of the attraction between molecules.
- b (L/mol): volume excluded by one mole of molecules.
- R = 0.0831446 L·bar/(mol·K), so the result is in bar. The ideal value is n R T / V.
The principle
Johannes Diderik van der Waals proposed the equation in 1873. The term V − nb replaces the container volume with the free volume that molecules can actually move in, because each mole of molecules blocks roughly b litres; this raises the pressure. The term a n²/V² accounts for attraction: a molecule about to hit the wall is pulled back by its neighbours, so it strikes less hard. The pull depends on how many neighbours there are and how many molecules are hitting the wall, both proportional to n/V, which is why the correction scales with (n/V)².
Worked example
- Inputs: n = 1 mol, V = 1 L, T = 300 K, a = 3.640 L²·bar/mol², b = 0.04267 L/mol (CO₂).
- Ideal pressure: 1 × 0.0831446 × 300 / 1 = 24.94338 bar.
- Repulsion term: 24.94338 / (1 − 0.04267) = 24.94338 / 0.95733 = 26.05515 bar.
- Attraction term: 3.640 × 1² / 1² = 3.640 bar.
- Van der Waals pressure: 26.05515 − 3.640 = 22.4151534 bar.
| Volume (L) | Pressure, van der Waals (bar) |
|---|---|
| 0.25 | 62.06762552 |
| 0.5 | 39.9813159 |
| 0.75 | 28.79302303 |
| 1 | 22.4151534 |
| 1.25 | 18.33035213 |
| 1.5 | 15.4980299 |
| 2 | 11.83357415 |
How to read the result
The ratio of the two pressures is the compressibility factor Z = P_real / P_ideal, here about 0.899. Z below 1 means attraction dominates and the gas is easier to compress than an ideal gas; Z above 1 means the excluded volume dominates, which happens at very high densities. A difference of only a percent or two means the ideal gas law is good enough. Here the deviation is about 10%.
Common mistakes
- Mixing unit systems: a and b must be in L²·bar/mol² and L/mol to match R in L·bar/(mol·K).
- Entering temperature in °C instead of kelvin.
- Choosing V smaller than n b, which makes the free volume negative and the result meaningless.
Frequently asked questions
Where do I find a and b for other gases?
They are tabulated in handbooks such as the CRC Handbook of Chemistry and Physics, and can also be estimated from a gas's critical temperature and pressure.
Why is the real pressure lower than the ideal one here?
At this density and temperature the attraction term (3.64 bar) outweighs the extra pressure from excluded volume (about 1.11 bar).
Sources: P. Atkins and J. de Paula, Atkins' Physical Chemistry, Oxford University Press · CRC Handbook of Chemistry and Physics, "Van der Waals Constants for Gases", CRC Press