1336 words
7 minutes
Virial Expansion for Hard Spheres

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 PV=NkBTPV = Nk_BT works well, but it rests on two assumptions that fail for real gases.

  1. The particles are point-like, i.e. they have zero volume.
  2. 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,

PVNkBT=1+B2ρ+B3ρ2+⋯\frac{PV}{Nk_BT} = 1 + B_2\rho + B_3\rho^2 + \cdots

where ρ=N/V\rho = N/V is the number density. The virial coefficients B2,B3,…B_2, B_3, \ldots contain the information about how interactions and finite size change the pressure. At low density (ρ→0\rho \to 0) 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 σ\sigma, with the potential

U(r)={∞if r<σ0if r>σU(r) = \begin{cases} \infty & \text{if } r < \sigma \\ 0 & \text{if } r > \sigma \end{cases}

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 NN particles with the Hamiltonian

H=∑i=1Npi22m+∑i>jU(rij)H = \sum_{i=1}^N \frac{p_i^2}{2m} + \sum_{i>j} U(r_{ij})

the classical partition function splits into a momentum part and a position part,

Z(N,V,T)=1N!λ3N∫∏id3ri e−β∑j<kU(rjk)Z(N, V, T) = \frac{1}{N!\lambda^{3N}} \int \prod_i d^3r_i\, e^{-\beta\sum_{j<k} U(r_{jk})}

where λ=2πℏ2/(mkBT)\lambda = \sqrt{2\pi\hbar^2/(mk_BT)} 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

Q(N,V,T)=∫∏id3ri e−β∑j<kU(rjk)Q(N, V, T) = \int \prod_i d^3r_i\, e^{-\beta\sum_{j<k} U(r_{jk})}

For interacting particles the Boltzmann factor e−βUe^{-\beta U} does not factorize, so this integral cannot be split into NN independent pieces. This is where the Mayer expansion comes in.


The Mayer f-function#

The trick is to define

f(r)=e−βU(r)−1f(r) = e^{-\beta U(r)} - 1

which measures how much the Boltzmann factor of a pair deviates from the non-interacting value of 1. So f=0f = 0 means the pair does not interact, and f=−1f = -1 means complete exclusion (the particles cannot overlap). For hard spheres the function is very simple,

f(r)={−1if r<σ0if r>σf(r) = \begin{cases} -1 & \text{if } r < \sigma \\ 0 & \text{if } r > \sigma \end{cases}

In terms of ff, the configurational integral becomes

Q=∫∏id3ri ∏j>k(1+fjk)Q = \int \prod_i d^3r_i\, \prod_{j>k} (1 + f_{jk})

where fjk=f(rjk)f_{jk} = f(r_{jk}), and we can now expand the product,

∏j>k(1+fjk)=1+∑j>kfjk+∑j>k,l>mfjkflm+⋯\prod_{j>k} (1 + f_{jk}) = 1 + \sum_{j>k} f_{jk} + \sum_{j>k, l>m} f_{jk}f_{lm} + \cdots

Each term corresponds to a cluster of interacting particles. The 11 gives the ideal gas, the terms linear in ff (∑fjk\sum f_{jk}) 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 ff,

Q≈∫∏id3ri (1+∑j>kfjk)Q \approx \int \prod_i d^3r_i\, \left(1 + \sum_{j>k} f_{jk}\right)

The 11 gives VNV^N, the ideal gas contribution. For the second term we need integrals of the form

∫∏id3ri f12=VN−2∫d3r1 d3r2 f(r12)\int \prod_i d^3r_i\, f_{12} = V^{N-2} \int d^3r_1\,d^3r_2\, f(r_{12})

All N(N−1)/2N(N-1)/2 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,

R⃗=12(r⃗1+r⃗2),r⃗=r⃗1−r⃗2\vec{R} = \frac{1}{2}(\vec{r}_1 + \vec{r}_2), \qquad \vec{r} = \vec{r}_1 - \vec{r}_2

The Jacobian is 11, and the integral factorizes,

∫d3r1 d3r2 f(r12)=(∫d3R)(∫d3r f(r))=V∫d3r f(r)\int d^3r_1\,d^3r_2\, f(r_{12}) = \left(\int d^3R\right) \left(\int d^3r\, f(r)\right) = V \int d^3r\, f(r)

The centre-of-mass integral gives the volume VV, and all the physics is in the integral over the relative coordinate.


The second virial coefficient#

Carrying the algebra through (taking the logarithm of QQ and differentiating with respect to VV), the equation of state becomes

PVNkBT=1−N2V∫d3r f(r)\frac{PV}{Nk_BT} = 1 - \frac{N}{2V}\int d^3r\, f(r)

For hard spheres, f=−1f = -1 inside a sphere of radius σ\sigma and zero outside, so

∫d3r f(r)=−4π∫0σr2 dr=−4πσ33\int d^3r\, f(r) = -4\pi \int_0^\sigma r^2\, dr = -\frac{4\pi\sigma^3}{3}

i.e. minus the volume of the region around one sphere that the centre of another sphere cannot enter. Plugging this in,

PVNkBT=1+2πσ33ρ=1+B2ρ\frac{PV}{Nk_BT} = 1 + \frac{2\pi\sigma^3}{3}\rho = 1 + B_2\rho

and the second virial coefficient is

B2=2πσ33=4×4π3(σ2)3\boxed{B_2 = \frac{2\pi\sigma^3}{3} = 4 \times \frac{4\pi}{3}\left(\frac{\sigma}{2}\right)^3}

So geometrically, B2B_2 is four times the volume of one sphere. The factor of 4 comes from two places. Each particle excludes a sphere of radius σ\sigma (not σ/2\sigma/2) 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

PkBT=NV−Vex\frac{P}{k_BT} = \frac{N}{V - V_{\text{ex}}}

where Vex=N×2πσ33V_{\text{ex}} = N \times \frac{2\pi\sigma^3}{3} 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 σ\sigma cannot have their centres closer than σ\sigma, so each particle keeps the centre of every other particle out of a sphere of radius σ\sigma around itself. That region has volume 4π3σ3\frac{4\pi}{3}\sigma^3, which is 8 times the particle’s own volume πσ36\frac{\pi\sigma^3}{6}. Each exclusion is shared by a pair, so each particle is charged half of it, 2π3σ3\frac{2\pi}{3}\sigma^3 per particle, or 4 particle volumes. For NN particles this gives Vex=23πNσ3V_{\text{ex}} = \frac{2}{3}\pi N\sigma^3.

The pressure is therefore higher than for the ideal gas at the same density and temperature,

Phard sphere>PidealP_{\text{hard sphere}} > P_{\text{ideal}}

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 B2B_2. The next term comes from three-particle clusters and gives B3B_3, and by dimensional analysis the hard-sphere coefficients scale as

B2∝σ3,B3∝σ6,B4∝σ9,…B_2 \propto \sigma^3, \quad B_3 \propto \sigma^6, \quad B_4 \propto \sigma^9, \quad \ldots

Each higher coefficient needs more complicated cluster integrals. A convenient variable is the packing fraction x=π6ρσ3x = \frac{\pi}{6}\rho\sigma^3, which is the fraction of the volume actually occupied by spheres (equivalently x=Vex/4Vx = V_{\text{ex}}/4V). In terms of it,

PVNkBT=1+∑n=1∞anxn\frac{PV}{Nk_BT} = 1 + \sum_{n=1}^\infty a_n x^n

where the ana_n are pure numbers fixed by geometry. Their values are

a1=4,a2=10,a3≈18.36,a4≈28.22,a5≈39.8,…a_1 = 4,\quad a_2 = 10,\quad a_3 \approx 18.36,\quad a_4 \approx 28.22,\quad a_5 \approx 39.8,\quad \ldots

Only a1a_1 (from B2B_2) and a2a_2 (from B3B_3) are integers. a3a_3 is known in closed form, but it is an ugly expression involving arccos⁡(1/3)\arccos(1/3), and the higher ones come from increasingly nasty cluster integrals that are evaluated numerically. They all lie very close to the integers n2+3nn^2 + 3n, i.e. 4,10,18,28,40,…4, 10, 18, 28, 40, \ldots. If we sum that integer sequence exactly, we get the Carnahan–Starling equation of state,

PVNkBT≈1+2(−2+x)x(−1+x)3=1+x+x2−x3(1−x)3\boxed{\frac{PV}{Nk_BT} \approx 1 + \frac{2(-2 + x)x}{(-1 + x)^3} = \frac{1 + x + x^2 - x^3}{(1 - x)^3}}

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, x≈0.49x \approx 0.49. The pole at x=1x = 1 is unphysical. Hard spheres cannot be packed beyond x=π/18≈0.74x = \pi/\sqrt{18} \approx 0.74 (close packing), and the fluid branch ends well before that anyway.

When does any of this matter? The expansion parameter is x∼ρσ3x \sim \rho\sigma^3. For gases at STP, ρσ3∼10−3\rho\sigma^3 \sim 10^{-3}, so B2B_2 is a small correction. For liquids, ρσ3∼1\rho\sigma^3 \sim 1, 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 f(r)f(r) inside the cluster integrals.

Virial Expansion for Hard Spheres
https://rohankulkarni.me/posts/notes/virial-expansion-hard-spheres/
Author
Rohan Kulkarni
Published at
2024-04-03
License
CC BY-NC-SA 4.0
Share Post
Comments