Real Gases & Equations of State
Real gases deviate from ideal behaviour at high pressures and low temperatures, where intermolecular forces and finite molecular volumes become significant. This chapter develops the major equations of state β van der Waals, virial, and corresponding states β and introduces the thermodynamic quantities (compressibility factor, fugacity) needed to treat non-ideal systems rigorously.
1. Introduction: Deviations from Ideal Gas Behaviour
The ideal gas law $PV = nRT$ treats molecules as non-interacting point particles. This approximation works well at low pressures and high temperatures, where the average intermolecular separation is much larger than the molecular diameter. However, systematic deviations appear under other conditions:
Why Ideal Gas Fails
- β’ Attractive forces: At moderate distances molecules attract one another (van der Waals, dipole-dipole, London dispersion). These attractions reduce the pressure below the ideal prediction because molecules approaching the walls are pulled back by interior molecules.
- β’ Finite molecular volume: Each molecule occupies a nonzero volume, reducing the effective volume available for translation. At high densities, the excluded volume becomes a significant fraction of the container volume.
- β’ Critical phenomena: Near the critical point, density fluctuations extend over macroscopic length scales and no simple equation of state can capture the true critical exponents. Nevertheless, classical equations of state provide a qualitatively correct description of the liquid-gas transition.
Experimentally, the extent of deviation is quantified by the compressibility factor:
$Z = \frac{PV}{nRT}$
For an ideal gas $Z = 1$ at all conditions. For real gases, $Z < 1$ when attractive forces dominate (moderate pressures) and $Z > 1$ when repulsive excluded-volume effects dominate (very high pressures). The remainder of this chapter develops the theoretical framework for understanding and predicting these deviations.
2. Derivation: The Van der Waals Equation
Johannes Diderik van der Waals (1873) proposed the first physically motivated equation of state for real gases. His approach modifies the ideal gas law by introducing two corrections that account for the dominant molecular interactions.
Step 1: Volume Correction (Excluded Volume)
Each molecule has a finite size characterised by an effective hard-sphere diameter $d$. When two molecules approach, the centre of one cannot come closer than a distance $d$ from the centre of the other. The excluded volume per pair of molecules is:
$v_{\text{excl}} = \frac{4}{3}\pi d^3$
For $N$ molecules there are $N(N-1)/2 \approx N^2/2$ pairs, so the total excluded volume per mole is:
$b = \frac{N_A}{2} \cdot \frac{4}{3}\pi d^3 = \frac{2\pi N_A d^3}{3}$
The effective free volume available per mole is therefore $V - nb$ rather than $V$. The parameter $b$ is the co-volume and is roughly four times the actual molecular volume per mole.
Step 2: Pressure Correction (Intermolecular Attraction)
A molecule about to strike the container wall experiences a net inward pull from the surrounding molecules. The magnitude of this internal pressure is proportional to the square of the number density $(n/V)^2$, because both the number of molecules at the wall and the number pulling them back scale as $n/V$:
$P_{\text{internal}} = a\left(\frac{n}{V}\right)^2$
Here $a > 0$ is a constant characterising the strength of the attractive interactions. The measured pressure $P$ is less than the kinetic pressure by this amount, so the kinetic pressure is $P + a(n/V)^2$.
Step 3: The Van der Waals Equation
Substituting both corrections into the ideal gas law $P_{\text{kinetic}} \cdot V_{\text{free}} = nRT$ gives:
$\left(P + \frac{an^2}{V^2}\right)(V - nb) = nRT$
For one mole ($n = 1$), with $V$ denoting the molar volume:
$\left(P + \frac{a}{V^2}\right)(V - b) = RT$
This is a cubic equation in $V$ at fixed $T$ and $P$. Below the critical temperature, it admits three real roots corresponding to liquid, unstable, and gas volumes.
Step 4: Critical Constants from Van der Waals Equation
At the critical point, the three roots of the cubic equation coalesce into one. This means both the first and second derivatives of $P$ with respect to $V$ vanish simultaneously. Writing the pressure explicitly:
$P = \frac{RT}{V - b} - \frac{a}{V^2}$
Setting the first and second derivatives to zero at the critical point:
$\left(\frac{\partial P}{\partial V}\right)_{T_c} = -\frac{RT_c}{(V_c - b)^2} + \frac{2a}{V_c^3} = 0$
$\left(\frac{\partial^2 P}{\partial V^2}\right)_{T_c} = \frac{2RT_c}{(V_c - b)^3} - \frac{6a}{V_c^4} = 0$
Dividing the first equation by the second eliminates $T_c$:
$\frac{V_c - b}{2} = \frac{V_c}{3} \quad \Longrightarrow \quad V_c = 3b$
Substituting back gives the critical temperature and pressure:
$T_c = \frac{8a}{27Rb}, \qquad P_c = \frac{a}{27b^2}$
The critical compressibility factor is a universal constant for van der Waals gases:
$Z_c = \frac{P_c V_c}{RT_c} = \frac{3}{8} = 0.375$
Step 5: Law of Corresponding States
Introducing reduced variables $P_r = P/P_c$, $V_r = V/V_c$, and $T_r = T/T_c$, the van der Waals equation takes a universal, parameter-free form. Substituting $P = P_r P_c$,$V = V_r V_c$, $T = T_r T_c$ and the critical constants:
$\left(P_r + \frac{3}{V_r^2}\right)\!\left(V_r - \frac{1}{3}\right) = \frac{8T_r}{3}$
This is the law of corresponding states: all van der Waals gases obey the same reduced equation of state. When plotted in reduced variables, the isotherms of all gases collapse onto a single set of universal curves. This principle extends approximately to real gases and is the theoretical basis for generalised correlation charts in engineering thermodynamics.
3. Derivation: The Virial Equation of State
While the van der Waals equation is heuristic, the virial equation of state provides a rigorous, systematic expansion of the equation of state in powers of density. First proposed empirically by Kamerlingh Onnes (1901) and later derived from statistical mechanics, it connects macroscopic thermodynamic properties directly to intermolecular potentials.
Step 1: The Virial Expansion
The compressibility factor is expanded as a power series in inverse molar volume:
$Z = \frac{PV}{nRT} = 1 + \frac{B(T)}{V} + \frac{C(T)}{V^2} + \frac{D(T)}{V^3} + \cdots$
Equivalently, as a power series in pressure:
$Z = 1 + B'(T)\,P + C'(T)\,P^2 + \cdots$
The coefficients $B(T)$, $C(T)$, $D(T)$, ... are the second, third, fourth, ... virial coefficients. They depend only on temperature and encode successively higher-order molecular interactions: $B$ describes pair interactions, $C$ describes three-body interactions, and so on.
Step 2: Statistical Mechanical Foundation
From the grand canonical partition function, the pressure of a classical gas can be expressed through the cluster expansion. For a gas of $N$ identical particles interacting via pairwise additive potentials $u(r_{ij})$, the configuration integral is:
$Q_N = \frac{1}{N!}\int \prod_{i<j} e^{-u(r_{ij})/k_BT}\, d^3r_1 \cdots d^3r_N$
Introducing the Mayer f-function, $f(r) = e^{-u(r)/k_BT} - 1$, which vanishes at large separations, we expand the product of Boltzmann factors. Systematic grouping by cluster diagrams yields the virial expansion, where each virial coefficient corresponds to a sum of connected cluster integrals.
Step 3: Second Virial Coefficient from Pair Potential
The second virial coefficient is given exactly by the integral over the Mayer f-function. For a spherically symmetric pair potential $u(r)$:
$B(T) = -2\pi N_A \int_0^{\infty} \left(e^{-u(r)/k_BT} - 1\right) r^2 \, dr$
This remarkable equation connects a macroscopic measurable quantity $B(T)$ directly to the microscopic pair potential $u(r)$. The integral has two contributions:
- β’ Repulsive core ($u \gg k_BT$): The exponential is nearly zero, so the integrand is $\approx -r^2$, giving a positive contribution to $B$(excluded volume).
- β’ Attractive well ($u < 0$): The exponential exceeds unity, giving a negative contribution to $B$ (cohesive effect).
At low temperatures the attractive well dominates and $B < 0$; at high temperatures the repulsive core dominates and $B > 0$.
Step 4: B(T) for the Lennard-Jones Potential
The Lennard-Jones 6-12 potential is the standard model for nonpolar molecules:
$u(r) = 4\varepsilon\left[\left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6}\right]$
Substituting into the integral for $B(T)$ and changing variables to $x = r/\sigma$:
$B^*(T^*) = \frac{B}{b_0} = -3\int_0^{\infty}\left[\exp\!\left(-\frac{4}{T^*}\left(x^{-12} - x^{-6}\right)\right) - 1\right] x^2\, dx$
where $T^* = k_BT/\varepsilon$ is the reduced temperature and $b_0 = (2\pi/3)N_A\sigma^3$. This reduced form depends only on $T^*$, providing another manifestation of the principle of corresponding states. The integral must be evaluated numerically; see the Fortran simulation below.
4. Derivation: Compressibility Factor & Boyle Temperature
The compressibility factor $Z$ provides the most direct measure of non-ideal behaviour. Its dependence on pressure and temperature reveals a special temperature β the Boyle temperature β at which the gas behaves most nearly ideally.
Step 1: Z in Terms of Virial Coefficients
From the virial expansion truncated at the second term:
$Z = 1 + \frac{B(T)}{V} + \mathcal{O}(V^{-2})$
Converting to a pressure series using $V \approx RT/P$ at leading order:
$Z \approx 1 + \frac{B(T)P}{RT}$
The slope of $Z$ versus $P$ at low pressures is therefore $B(T)/(RT)$. When $B < 0$, $Z$ initially decreases below unity (attractive forces dominate); when $B > 0$, $Z$ increases above unity (repulsive forces dominate).
Step 2: The Boyle Temperature
The Boyle temperature $T_B$ is defined as the temperature at which the second virial coefficient vanishes:
$B(T_B) = 0$
At the Boyle temperature, the initial slope of $Z$ versus $P$ is zero, so$Z \approx 1$ for moderate pressures. The attractive and repulsive contributions to the second virial coefficient exactly cancel, and the gas behaves most nearly ideally.
Step 3: Boyle Temperature from Van der Waals Equation
To find $T_B$ for a van der Waals gas, we first extract its virial coefficients. Expanding the van der Waals equation at low density (large $V$):
$P = \frac{RT}{V-b} - \frac{a}{V^2} = \frac{RT}{V}\cdot\frac{1}{1-b/V} - \frac{a}{V^2}$
Expanding $(1 - b/V)^{-1} = 1 + b/V + b^2/V^2 + \cdots$ and collecting powers of $1/V$:
$Z = 1 + \frac{1}{V}\left(b - \frac{a}{RT}\right) + \frac{b^2}{V^2} + \cdots$
The van der Waals second virial coefficient is therefore $B_{\text{vdW}}(T) = b - a/(RT)$. Setting this to zero:
$T_B = \frac{a}{Rb}$
Notice that $T_B/T_c = 27/8 = 3.375$. The Boyle temperature is always significantly above the critical temperature. For example, nitrogen has $T_c = 126\,\text{K}$ and$T_B \approx 327\,\text{K}$, consistent with this ratio.
Step 4: Physical Interpretation
Below $T_B$, attractive forces dominate at moderate pressures ($Z < 1$). Above $T_B$, repulsive forces dominate even at moderate pressures ($Z > 1$). Exactly at $T_B$, the gas follows Boyle's law ($PV = \text{const}$) over an extended pressure range. This is why the Boyle temperature is named after Robert Boyle β at this temperature, the gas obeys his law most faithfully. For the Lennard-Jones potential,$T_B^* = k_BT_B/\varepsilon \approx 3.42$, which is very close to the van der Waals prediction.
5. Derivation: Fugacity & Real Gas Thermodynamics
For an ideal gas, the chemical potential depends logarithmically on pressure:$\mu = \mu^\circ + RT\ln(P/P^\circ)$. For real gases, we need a quantity that preserves this convenient functional form while encoding all non-ideal corrections. This quantity is the fugacity.
Step 1: Definition of Fugacity
The fugacity $f$ of a real gas is defined so that the chemical potential retains its ideal-gas form:
$\mu = \mu^\circ + RT\ln\!\left(\frac{f}{P^\circ}\right)$
with the boundary condition that as $P \to 0$, $f \to P$ (the gas becomes ideal). The fugacity coefficient is defined as $\phi = f/P$, so $\phi \to 1$ for an ideal gas.
Step 2: Deriving the Fugacity Coefficient
Starting from the fundamental relation for the molar Gibbs energy at constant temperature:
$d\mu = V_m\,dP$
For a real gas: $d\mu = V_m\,dP = \frac{ZRT}{P}\,dP$. For an ideal gas at the same temperature: $d\mu^{\text{ideal}} = \frac{RT}{P}\,dP$. The difference is:
$d(\mu - \mu^{\text{ideal}}) = RT\,\frac{Z - 1}{P}\,dP$
Integrating from $P = 0$ (where both real and ideal chemical potentials coincide) to pressure $P$:
$\mu - \mu^{\text{ideal}} = RT\int_0^{P} \frac{Z - 1}{P'}\,dP'$
Since $\mu - \mu^{\text{ideal}} = RT\ln(f/P)$, we obtain the key result:
$\ln\!\left(\frac{f}{P}\right) = \ln\phi = \int_0^{P} \frac{Z - 1}{P'}\,dP'$
Step 3: Fugacity from the Virial Equation
Using the truncated virial equation $Z = 1 + B'P$ where $B' = B/(RT)$:
$\ln\phi = \int_0^{P} \frac{B'P'}{P'}\,dP' = B'P = \frac{BP}{RT}$
Therefore:
$f = P\exp\!\left(\frac{BP}{RT}\right)$
At the Boyle temperature where $B = 0$, $f = P$ exactly, confirming that the gas behaves ideally. Below $T_B$, $B < 0$ and $f < P$: the gas is easier to compress than an ideal gas because of attractive forces. Above $T_B$, $f > P$.
Step 4: Fugacity from Van der Waals Equation
For the van der Waals gas, we use an alternative form of the fugacity relation based on volume integration. Starting from $\mu - \mu^{\text{ideal}} = \int_0^P (V_m - V_m^{\text{ideal}})\,dP$and transforming to a volume integral:
$\ln\phi = \frac{b}{V_m - b} - \frac{2a}{RTV_m} + \ln\!\left(\frac{V_m}{V_m - b}\right) - \ln Z$
This expression shows explicitly how the excluded volume ($b$ terms) and attractive interactions ($a$ term) each contribute to the departure from ideality. In the limit$a \to 0$, $b \to 0$, we recover $\phi = 1$ as expected.
6. Applications
Industrial Gas Compression
Compressor design requires accurate equations of state to predict the work needed at high pressures. The van der Waals and more advanced cubic equations (Peng-Robinson, Soave-Redlich-Kwong) are used routinely to calculate compression ratios, intercooler duties, and discharge temperatures. At pressures above 100 atm, deviations from ideal behaviour can exceed 50%, making real gas corrections essential for safe and efficient design.
Supercritical Fluids
Above the critical point, a substance exists as a supercritical fluid with properties intermediate between liquid and gas. Supercritical CO$_2$ ($T_c = 304\,\text{K}$,$P_c = 73\,\text{atm}$) is widely used for caffeine extraction, dry cleaning, and chromatography. The tunability of density (and hence solvent power) near the critical point is a direct consequence of the flat P-V isotherms predicted by the equations of state developed here.
Natural Gas Processing
Natural gas is a mixture of methane, ethane, propane, and heavier hydrocarbons at high pressures. Accurate phase equilibrium calculations using fugacity coefficients are essential for designing separation processes (distillation, absorption, membrane separation). The virial equation and cubic equations of state with mixing rules form the backbone of process simulation software (Aspen Plus, HYSYS, PRO/II).
Joule-Thomson Effect
When a real gas expands through a porous plug at constant enthalpy, its temperature changes. The Joule-Thomson coefficient $\mu_{JT} = (\partial T/\partial P)_H$ is zero for an ideal gas but nonzero for real gases due to intermolecular forces. Below the inversion temperature,$\mu_{JT} > 0$ and expansion causes cooling β the principle behind the Linde process for gas liquefaction. The inversion temperature is related to the Boyle temperature: for a van der Waals gas, $T_{\text{inv}} = 2a/(Rb) = 2T_B$.
7. Historical Context
Thomas Andrews & the Critical Point (1869)
Thomas Andrews's meticulous measurements of CO$_2$ isotherms revealed the critical point β the temperature above which no amount of pressure can liquefy a gas. His work demonstrated the continuity of the liquid and gaseous states and provided the experimental foundation that van der Waals would explain theoretically four years later. Andrews identified the critical temperature of CO$_2$ as approximately 304 K (31Β°C).
Johannes Diderik van der Waals (1873)
In his doctoral thesis βOver de ContinuΓ―teit van den Gas- en Vloeistoftoestandβ (On the Continuity of the Gaseous and Liquid States), van der Waals proposed his equation of state with just two parameters $a$ and $b$. This was the first equation to predict the liquid-gas phase transition and explain the critical point quantitatively. The work earned him the Nobel Prize in Physics in 1910. James Clerk Maxwell called it βa most important step in molecular science.β
Heike Kamerlingh Onnes & the Virial Equation (1901)
Kamerlingh Onnes, working at the Leiden cryogenics laboratory where he would later liquefy helium (1908), introduced the virial equation of state as a systematic power series expansion. He coined the term βvirial coefficientβ from the Latin vis (force). The virial approach proved superior to ad hoc equations because each coefficient has a precise statistical mechanical interpretation connecting macroscopic measurements to microscopic molecular interactions.
Joseph Mayer & the Cluster Expansion (1937)
Joseph Mayer and Maria Goeppert Mayer developed the cluster expansion formalism that rigorously derived the virial equation from statistical mechanics. By introducing the Mayer f-function and systematically classifying cluster diagrams, they showed that each virial coefficient is an integral over connected cluster diagrams involving the intermolecular potential. This work provided the theoretical foundation connecting $B(T)$ to the pair potential $u(r)$.
8. Python Simulation: Van der Waals Isotherms & Maxwell Construction
This simulation plots the pressure-volume isotherms for CO$_2$ using the van der Waals equation at several reduced temperatures. The left panel shows the full set of isotherms from subcritical ($T_r < 1$, dashed) to supercritical ($T_r > 1$, solid), with the critical isotherm highlighted. The right panel demonstrates the Maxwell equal-area construction for a subcritical isotherm, which determines the true coexistence pressure by requiring the areas above and below the horizontal tie-line to be equal. This construction replaces the unphysical van der Waals loop with a horizontal segment representing the two-phase (liquid-vapour) coexistence region.
Click Run to execute the Python code
Code will be executed with Python 3 on the server
9. Fortran Simulation: Second Virial Coefficients from Lennard-Jones Potential
This Fortran program computes the second virial coefficient $B(T)$ by numerical integration of the Mayer f-function for the Lennard-Jones 6-12 potential. Results are computed for five common gases (Ar, N$_2$, O$_2$, CO$_2$, CH$_4$) across a range of temperatures from 100 K to 1500 K. The program also locates the Boyle temperature $T_B$ for each gas by bisection, finding where $B(T_B) = 0$. The Lennard-Jones parameters$\varepsilon/k_B$ and $\sigma$ are taken from standard compilations of experimental data.
Click Run to execute the Fortran code
Code will be compiled with gfortran and executed on the server
Key Equations Summary
Van der Waals Equation
$\left(P + \frac{a}{V^2}\right)(V - b) = RT$
Virial Equation
$Z = 1 + \frac{B}{V} + \frac{C}{V^2} + \cdots$
Second Virial Coefficient
$B = -2\pi N_A\!\int_0^\infty\!(e^{-u/k_BT}-1)\,r^2\,dr$
Critical Constants
$T_c = \frac{8a}{27Rb},\; P_c = \frac{a}{27b^2},\; V_c = 3b$
Boyle Temperature
$B(T_B) = 0 \;\;\Rightarrow\;\; T_B = \frac{a}{Rb}$
Fugacity Coefficient
$\ln\!\left(\frac{f}{P}\right) = \int_0^P \frac{Z-1}{P'}\,dP'$
Law of Corresponding States
$\left(P_r + \frac{3}{V_r^2}\right)\!\left(V_r - \frac{1}{3}\right) = \frac{8T_r}{3}$
Compressibility Factor
$Z = \frac{PV}{nRT}$