1156 words
6 minutes
Virial Expansion for Hard Spheres

Problem: Derive the virial expansion for a classical gas of hard spheres, showing how the excluded volume correction emerges and computing higher-order virial coefficients.


Why the virial expansion? What are we actually computing?#

Before diving into the hard sphere model, it’s worth being precise about what the virial expansion actually does and why we need it.

The ideal gas law PV=NkBTPV = Nk_BT works remarkably well, but it makes two simplifying assumptions that break down for real gases:

  1. Particles are point-like (zero volume)
  2. Particles don’t interact (no forces between them)

Real atoms and molecules violate both: they have finite size and exert forces on each other. The virial expansion systematically corrects for these effects by expanding 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 encode how interactions and finite size change the pressure. At low density (ρ→0\rho \to 0), we recover the ideal gas. As density increases, higher-order terms become important.

The hard sphere model captures the simplest finite-size effect: particles are impenetrable balls of diameter Οƒ\sigma. The potential is:

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

This isn’t just a toy model β€” it’s the starting point for understanding real gases, liquids, and even the glass transition. The question is: how does this simple exclusion affect the equation of state?


The partition function and why it’s hard to compute#

For NN particles with 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 separates into momentum and position integrals:

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 integral is easy (it gives the ideal gas result), but the position integral is the challenge:

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} doesn’t factorize, so we can’t separate this integral into NN independent pieces. This is why we need the Mayer expansion.


The Mayer f-function: turning a hard problem into a series#

The key trick is to define:

f(r)=eβˆ’Ξ²U(r)βˆ’1f(r) = e^{-\beta U(r)} - 1

For hard spheres, this is remarkably simple:

f(r)={βˆ’1ifΒ r<Οƒ0ifΒ r>Οƒf(r) = \begin{cases} -1 & \text{if } r < \sigma \\ 0 & \text{if } r > \sigma \end{cases}

Why this helps: The partition function 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}). Now we can 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 represents a distinct cluster of interacting particles. The first term (11) gives the ideal gas. The linear terms (βˆ‘fjk\sum f_{jk}) represent two-particle interactions. The quadratic terms represent three- and four-particle clusters, and so on.

Physical interpretation: The Mayer ff-function measures how much the pair correlation deviates from no interaction. f=0f = 0 means no interaction (particles independent). f=βˆ’1f = -1 means complete exclusion (particles can’t overlap).


Keeping only the first correction: why this is enough at low density#

At low density, most particles are far apart and don’t interact. We only need to keep terms where a small number of particles are close together. Keeping 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 first term gives VNV^N (the ideal gas contribution). The second term requires evaluating:

∫∏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 contribute equally, so we just need to compute one integral and multiply by the number of pairs.

Variable transformation: Change to center-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 separates:

∫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 center-of-mass integral just gives the volume VV. The relative coordinate integral is what contains the physics.


The second virial coefficient: what it actually means#

Carrying through the algebra, 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:

∫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}

This integral is the volume excluded by one sphere (of radius Οƒ\sigma) β€” but with a negative sign because f=βˆ’1f = -1 in the excluded region.

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

where 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}

Geometric meaning: B2B_2 is four times the volume of one sphere. The factor of 4 comes from: each particle excludes a sphere of radius Οƒ\sigma around itself (volume 4Ο€3Οƒ3\frac{4\pi}{3}\sigma^3), and we have to divide by 2 to avoid double-counting pairs.


Excluded volume: the physical picture#

Rewriting 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, we see something beautiful:

The hard sphere gas behaves like an ideal gas with reduced volume.

Each particle excludes a sphere of radius Οƒ/2\sigma/2 around itself (volume πσ36\frac{\pi\sigma^3}{6}). For NN particles, the total excluded volume is N×πσ36N \times \frac{\pi\sigma^3}{6}, but we must multiply by 2 because each pair shares the exclusion. This gives Vex=23Ο€NΟƒ3V_{\text{ex}} = \frac{2}{3}\pi N\sigma^3.

Physical consequence: The pressure is higher than the ideal gas at the same density and temperature:

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

This makes intuitive sense: collisions between finite-sized particles transfer momentum more effectively than non-interacting point particles. The particles β€œbounce off” each other, increasing the pressure on the container walls.


Higher-order corrections: when do we need them?#

The virial expansion doesn’t stop at B2B_2. The next term involves three-particle clusters and gives B3B_3. For hard spheres:

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 involves more complicated cluster integrals. A clever approach uses the reduced variable x=Vex/Vx = V_{\text{ex}}/V (the fraction of volume excluded):

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

where the coefficients ana_n are pure numbers determined by geometry. Computing them:

a1=1,a2=4,a3=10,a4=18,a5=28,…a_1 = 1,\quad a_2 = 4,\quad a_3 = 10,\quad a_4 = 18,\quad a_5 = 28,\quad \ldots

The generating function for this sequence is:

PVNkBT=1+2(βˆ’2+x)x(βˆ’1+x)3\boxed{\frac{PV}{Nk_BT} = 1 + \frac{2(-2 + x)x}{(-1 + x)^3}}

Expanding this confirms the coefficients above. This resummed expression is valid for x<1x < 1 β€” physically, the excluded volume can’t exceed the total volume.

When does 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.


Summary#

QuantityResultPhysical meaning
Mayer ff-functionf(r)=βˆ’1f(r) = -1 for r<Οƒr < \sigma, 00 otherwiseMeasures deviation from non-interacting
Second virial coefficientB2=2πσ33=4Γ—VsphereB_2 = \frac{2\pi\sigma^3}{3} = 4 \times V_{\text{sphere}}Four times the volume of one sphere
Excluded volumeVex=23πNσ3V_{\text{ex}} = \frac{2}{3}\pi N\sigma^3Volume unavailable to other particles
Pressure correctionP=Pideal(VVβˆ’Vex)P = P_{\text{ideal}}\left(\frac{V}{V - V_{\text{ex}}}\right)Ideal gas with reduced volume

Key insight: The virial expansion provides a systematic way to go from point particles to real gases with finite size. Even the first correction captures the essential physics of excluded volume β€” particles have less room to move than they would in an ideal gas, so they hit the walls more often and increase the pressure.

This framework generalizes to arbitrary intermolecular potentials: just replace the hard-sphere f(r)f(r) with the appropriate function and recompute the cluster integrals. The hard sphere result is the foundation for understanding real gases, liquids, and the dense matter physics that connects them.

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