In this post we derive the virial expansion for a classical gas of hard spheres. I think the nice part is that the excluded-volume correction comes out of the algebra by itself, without being put in by hand. At the end we look at the higher-order coefficients, which lead to a surprisingly good closed-form equation of state.
What the virial expansion actually computes
The ideal gas law works well, but it rests on two assumptions that fail for real gases.
- The particles are point-like, i.e. they have zero volume.
- The particles do not interact, i.e. there are no forces between them.
Real atoms and molecules violate both, since they have a finite size and they exert forces on each other. The virial expansion corrects for this systematically by expanding the equation of state in powers of the density,
where is the number density. The virial coefficients contain the information about how interactions and finite size change the pressure. At low density () we are back to the ideal gas, and as the density goes up the higher-order terms start to matter.
The hard sphere model is the simplest way to include finite size. The particles are impenetrable balls of diameter , with the potential
This is more than a toy model, since it is the starting point for treating real gases, liquids and even the glass transition. The question for this post is how this simple exclusion changes the equation of state.
The partition function and why it is hard to compute
For particles with the Hamiltonian
the classical partition function splits into a momentum part and a position part,
where is the thermal wavelength. The momentum integrals are Gaussian and give the ideal gas result. All the difficulty is in the position integral, the configurational partition function
For interacting particles the Boltzmann factor does not factorize, so this integral cannot be split into independent pieces. This is where the Mayer expansion comes in.
The Mayer f-function
The trick is to define
which measures how much the Boltzmann factor of a pair deviates from the non-interacting value of 1. So means the pair does not interact, and means complete exclusion (the particles cannot overlap). For hard spheres the function is very simple,
In terms of , the configurational integral becomes
where , and we can now expand the product,
Each term corresponds to a cluster of interacting particles. The gives the ideal gas, the terms linear in () are two-particle interactions, the quadratic terms describe three- and four-particle clusters, and so on.
Keeping only the first correction
At low density most particles are far apart and do not interact, so we only need terms in which a small number of particles are close together. To first order we keep only the linear term in ,
The gives , the ideal gas contribution. For the second term we need integrals of the form
All pairs give the same contribution, so it is enough to compute this one integral and multiply by the number of pairs.
To do it we change to centre-of-mass and relative coordinates,
The Jacobian is , and the integral factorizes,
The centre-of-mass integral gives the volume , and all the physics is in the integral over the relative coordinate.
The second virial coefficient
Carrying the algebra through (taking the logarithm of and differentiating with respect to ), the equation of state becomes
For hard spheres, inside a sphere of radius and zero outside, so
i.e. minus the volume of the region around one sphere that the centre of another sphere cannot enter. Plugging this in,
and the second virial coefficient is
So geometrically, is four times the volume of one sphere. The factor of 4 comes from two places. Each particle excludes a sphere of radius (not ) around itself, which has 8 times its own volume, and we divide by 2 so that each pair is not counted twice.
Excluded volume: the physical picture
We can rewrite the result as
where is the excluded volume (to first order in the density the two forms agree). The statement is then very clean.
The hard sphere gas behaves like an ideal gas in a reduced volume.
Let us check the counting once more. Two spheres of diameter cannot have their centres closer than , so each particle keeps the centre of every other particle out of a sphere of radius around itself. That region has volume , which is 8 times the particle’s own volume . Each exclusion is shared by a pair, so each particle is charged half of it, per particle, or 4 particle volumes. For particles this gives .
The pressure is therefore higher than for the ideal gas at the same density and temperature,
which makes sense. The particles have less room to move, so they hit the walls of the container more often, and the pressure on the walls goes up.
Higher-order corrections
The expansion does not stop at . The next term comes from three-particle clusters and gives , and by dimensional analysis the hard-sphere coefficients scale as
Each higher coefficient needs more complicated cluster integrals. A convenient variable is the packing fraction , which is the fraction of the volume actually occupied by spheres (equivalently ). In terms of it,
where the are pure numbers fixed by geometry. Their values are
Only (from ) and (from ) are integers. is known in closed form, but it is an ugly expression involving , and the higher ones come from increasingly nasty cluster integrals that are evaluated numerically. They all lie very close to the integers , i.e. . If we sum that integer sequence exactly, we get the Carnahan–Starling equation of state,
This is an approximation and not an exact resummation, but it is an excellent one. It agrees with simulations of the hard-sphere fluid to within about a percent all the way up to the freezing point, . The pole at is unphysical. Hard spheres cannot be packed beyond (close packing), and the fluid branch ends well before that anyway.
When does any of this matter? The expansion parameter is . For gases at STP, , so is a small correction. For liquids, , and many terms are needed.
Where this leaves us
The virial expansion takes us systematically from point particles to particles of finite size, and the very first correction is the excluded volume. For any other intermolecular potential the procedure is identical, only with a different inside the cluster integrals.