Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Statistical mechanics of fluids

General exprssion of probability distribution of fluids in phase space

  • The probability of a state in a classical fluid system is f(xN,pN)f(x^N, p^N)

f(xN,pN)=eβH(xNpN)Z{f(x^N, p^N) = \frac{e^{-\beta H(x^N p^N)}}{Z}}
  • Momentum and position coordinates are separated thanks to the form of kinetic and potential energy terms

H(xN,pN)=K(pN)+U(xN)H(x^N, p^N) = K(p^N) + U(x^N)
f(xN,pN)=Φ(pN)P(rN)f(x^N, p^N) = \Phi(p^N) P(r^N)
  • Kinetic energy part giveus us Maxwell-Botlzman distribution or the ideal gas part of the partition function ZpZ_p

  • Potential energy part gives us configruational parition function ZxZ_x evaluation of which is non-trivial and mostly can be done via simulaions:

Z(β,V,N)=ZpZx=1λ3N!Q(β,V,N)Z(\beta, V, N) = Z_{p} \cdot Z_x = \frac{1}{\lambda^3 N!} Q(\beta, V, N)
Q=dxNeβU(xN)Q = \int dx^N e^{-\beta U(x^N)}

Pressure is related to Free energy as

p=FV=VlogdxNeβU(xN)p= - \frac{\partial F}{\partial V} = \frac{\partial }{\partial V} log \int dx^N e^{-\beta U(x^N)}
  • Volume dependence of partition function is in the integration limits! As volume grows, so does partition function. Therefore p is always positive. We can thus conclude that in equilibrium pressure is always a positive quantity

Reduced configruational distribution functions

  • Key fact: The full configurational probability P(rN)P(r^N) and the partition function QQ do not factorize due to interparticle interactions. Stronger interactions lead to stronger positional correlations.

  • Joint probability of particle positions:
    To describe the probability of finding particles at positions r1,r2,,rNr_1, r_2, \dots, r_N:

P(rN)=P(r1,r2,,rN){P(r^N) = P(r_1, r_2, \dots, r_N)}
  • Marginal (reduced) probability density:
    Probability of finding particles 1 and 2 at positions r1r_1 and r2r_2, regardless of others:

ρ(2)(r1,r2)=dr3drNP(rN){\rho^{(2)}(r_1, r_2) = \int dr_3 \dots dr_N \, P(r^N)}
  • Symmetrized reduced pair distribution:
    When particles are indistinguishable, the reduced two-particle distribution becomes:

ρ(2)(r1,r2)=N(N1)dr3drNP(rN){\rho^{(2)}(r_1, r_2) = N(N-1) \int dr_3 \dots dr_N \, P(r^N)}

Radial Distribution Function (RDF)

For an isotropic fluid, the one-particle probability density is uniform:

ρ(1)=Ndr2drNdr1drN=NVN1VN=NV=ρ\rho^{(1)} = N \frac{\int dr_2 \dots dr_N}{\int dr_1 \dots dr_N} = N \frac{V^{N-1}}{V^N} = \frac{N}{V} = \rho

For an ideal gas, the two-particle (joint) probability density simplifies as:

ρ(2)=N(N1)dr3drNdr1drN=N(N1)VN2VNρ2\rho^{(2)} = N(N-1) \frac{\int dr_3 \dots dr_N}{\int dr_1 \dots dr_N} = N(N-1) \frac{V^{N-2}}{V^N} \approx \rho^2
  • To quantify spatial correlations between particles, we define the Radial Distribution Function (RDF) as:

g(r1,r2)=ρ(2)(r1,r2)ρ2{g(r_1, r_2) = \frac{\rho^{(2)}(r_1, r_2)}{\rho^2}}
  • For an isotropic and homogeneous fluid, RDF depends only on the distance between particles:

g(r)=g(r2r1){g(r) = g(|r_2 - r_1|)}

Physical meaning of RDF

  • Since ρ=ρ(1)\rho = \rho^{(1)}, the conditional probability density of finding a particle at distance rr from a tagged particle at the origin is:

ρ(2)(0,r)ρ=ρg(r)\frac{\rho^{(2)}(0, r)}{\rho} = \rho g(r)
  • Thus, ρg(r)\rho g(r) represents the average local density at distance rr, given a particle is fixed at the origin.

Source
import numpy as np
import matplotlib.pyplot as plt

# === System parameters ===
N_side = 20                # particles per side for lattice
N = N_side**2              # total particles
L = 10.0                   # box length (L x L)
r_max = L / 2              # max distance for RDF
nbins = 100

# === Make ideal gas configuration ===
positions_ideal = np.random.uniform(0, L, size=(N, 2))

# === Make square lattice configuration ===
spacing = L / N_side
x, y = np.meshgrid(np.linspace(0, L - spacing, N_side),
                   np.linspace(0, L - spacing, N_side))
positions_lattice = np.vstack([x.ravel(), y.ravel()]).T

def compute_rdf(positions, L, r_max, nbins):
    N = len(positions)
    dists = []
    for i in range(N):
        for j in range(i + 1, N):
            dx = positions[i, 0] - positions[j, 0]
            dy = positions[i, 1] - positions[j, 1]
            
            # Periodic boundary conditions
            dx -= L * np.round(dx / L)
            dy -= L * np.round(dy / L)
            r = np.sqrt(dx**2 + dy**2)
            if r < r_max:
                dists.append(r)
    
    dists = np.array(dists)
    r_bins = np.linspace(0.0, r_max, nbins + 1)
    r_centers = 0.5 * (r_bins[:-1] + r_bins[1:])
    hist, _ = np.histogram(dists, bins=r_bins)
    
    dr = r_bins[1] - r_bins[0]
    area = L**2
    rho = N / area
    shell_area = 2 * np.pi * r_centers * dr
    norm = rho * shell_area * (N - 1) / 2  # expected number in each shell
    g_r = hist / norm
    
    return r_centers, g_r

# === Compute RDFs ===
r_ideal, g_ideal = compute_rdf(positions_ideal, L, r_max, nbins)
r_lattice, g_lattice = compute_rdf(positions_lattice, L, r_max, nbins)

# === Plot ===
plt.figure(figsize=(8, 4))
plt.plot(r_ideal, g_ideal, label='Ideal Gas', lw=2)
plt.plot(r_lattice, g_lattice, label='Square Lattice', lw=2)
plt.axhline(1.0, color='gray', linestyle='--')
plt.xlabel('Distance $r$')
plt.ylabel('$g(r)$')
plt.title('Radial Distribution Function Comparison')
plt.legend()
plt.grid(True)
plt.tight_layout()
plt.show()
<Figure size 800x400 with 1 Axes>

Coordination shells and structure in fluids

Reversible work theorem and potential of mean force

dU(rN)dr1r1,r2=dr3...drNdU(rN)dr1eβUdr3...rNeβU=β1ddr1dr3...drNeβUdr3...drNeβU=β1ddr1logdr3...drNeβU\Big \langle -\frac{d U(r^N)}{dr_1} \Big \rangle_{r_1, r_2} = -\frac{\int dr_3...dr_N \frac{dU(r^N)}{dr_1} e^{-\beta U}}{\int dr_3...r_N e^{-\beta U}} = \frac{\beta^{-1} \frac{d}{d r_1} \int dr_3...dr_N e^{-\beta U}}{\int dr_3...dr_N e^{-\beta U}} = \beta^{-1} \frac{d}{d r_1} log \int dr_3...dr_N e^{-\beta U}
dU(rN)dr1r1,r2=β1ddr1logN(N1)dr3...drNeβU=β1g(r1,r2)\Big \langle -\frac{d U(r^N)}{dr_1} \Big \rangle_{r_1, r_2} = \beta^{-1} \frac{d}{d r_1} log N (N-1)\int dr_3...dr_N e^{-\beta U} = \beta^{-1} g(r_1, r_2)

Thermodynamic properites of g(r)g(r)

E=Np22m+j>iu(rirj)\langle E \rangle = N \Big\langle \frac{p^2}{2m} \Big\rangle + \Big\langle \sum_{j>i} u(|r_i - r_j|)\Big \rangle
E/N=32kBT+12ρdrg(r)u(r){E/N = \frac{3}{2}k_B T +\frac{1}{2}\rho \int dr g(r) u(r) }

Low density approximation for g(r)g(r)

w(r)=u(r)+Δw(r)w(r) =u(r) +\Delta w(r)
g(r)=eβu(r)(1+O(ρ))g(r) = e^{-\beta u(r)} \Big (1 +O(\rho) \Big)

Density expanesion and virial coefficients

βp=ρ+B2(T)ρ2+O(ρ3)\beta p = \rho + B_2(T) \rho^2+ O(\rho^3)
B2(T)=12dr(eβu(r)1)B_2(T) = -\frac{1}{2} \int dr (e^{-\beta u(r)}-1)