Skip to content

The D2Q9 Lattice

Source: PHY653B Ch. 7

Intuition

Lattice Boltzmann inverts the usual relationship between kinetic theory and fluid dynamics. Instead of deriving fluid equations from kinetics and then discretising them, LBM discretises the kinetic equation so crudely — nine velocities, in two dimensions — that it seems impossible it could recover Navier–Stokes. It does, exactly, and understanding why is the point of the chapter.

Nine velocities are not an ansatz

The D2Q9 stencil has a rest velocity, four axis velocities and four diagonals, with weights

\[w_0 = \frac49,\qquad w_{1\text{–}4} = \frac19,\qquad w_{5\text{–}8} = \frac1{36}\]

These look like fitted constants. They are the abscissae and weights of the third-order Gauss–Hermite quadrature of velocity space. The continuous moment integral \(\int f(\mathbf{v})\psi(\mathbf{v})\,d\mathbf{v}\) is being replaced by a quadrature rule that is exact for polynomial \(\psi\) up to third order — and that is the entire content of the lattice.

The moment conditions

The lattice must satisfy, exactly:

\[\sum_i w_i = 1,\qquad \sum_i w_i c_{i\alpha} = 0,\qquad \sum_i w_i c_{i\alpha}c_{i\beta} = c_s^2\delta_{\alpha\beta},\qquad \sum_i w_i c_{i\alpha}c_{i\beta}c_{i\gamma} = 0\]
\[\sum_i w_i c_{i\alpha}c_{i\beta}c_{i\gamma}c_{i\delta} = c_s^4\left(\delta_{\alpha\beta}\delta_{\gamma\delta} + \delta_{\alpha\gamma}\delta_{\beta\delta} + \delta_{\alpha\delta}\delta_{\beta\gamma}\right)\]

Applying the second condition to the D2Q9 weights gives

\[c_s^2 = \frac13\]

in lattice units — a property of the quadrature, not a free parameter. Adjusting \(c_s\) does not give you a different fluid; it gives you a lattice that fails the moment conditions and recovers no fluid at all. The widget verifies every one of these to machine precision.

The equilibrium is a truncated Hermite expansion

\[f_i^{\rm eq} = w_i\rho\left[1 + \frac{\mathbf{c}_i\cdot\mathbf{u}}{c_s^2} + \frac{(\mathbf{c}_i\cdot\mathbf{u})^2}{2c_s^4} - \frac{u^2}{2c_s^2}\right]\]

This is the Maxwellian expanded in Hermite polynomials and truncated at second order in \(\mathbf{u}\). That truncation is the origin of LBM's defining limitation: it is a low-Mach method. Errors go as \(O(\mathrm{Ma}^2)\) and appear as spurious compressibility. Keep \(u/c_s \lesssim 0.1\); no grid refinement fixes a truncation error in velocity space.

The algorithm

Two lines, genuinely:

\[\underbrace{f_i^*(\mathbf{x}) = f_i(\mathbf{x}) - \frac{1}{\tau}\left(f_i - f_i^{\rm eq}\right)}_{\text{collide — purely local}} \qquad \underbrace{f_i(\mathbf{x} + \mathbf{c}_i, t+1) = f_i^*(\mathbf{x}, t)}_{\text{stream — exact, just a memory shift}}\]

Collision touches only local data; streaming is an exact copy with no interpolation and no truncation error. This structure is why LBM parallelises almost perfectly and why it handles complex geometry cheaply — solid boundaries are implemented by reflecting populations (bounce-back), which is a few lines of code and requires no body-fitted mesh.

Common mistakes

  • Treating \(c_s^2 = 1/3\) as tunable. It is fixed by the quadrature.
  • Running at high Mach number. The equilibrium truncation makes the result wrong in a way that looks like compressibility.
  • Forgetting lattice units. \(\Delta x = \Delta t = 1\) by construction; converting to physical units at the end is a separate, error-prone step that must be done via dimensionless groups.

Knowledge graph position

Prerequisites: kinetic theory, collision operators, Navier–Stokes. Leads to: Chapman–Enskog, thermal LBM, complex-geometry and multiphase flow solvers.

Quiz

Q1 (conceptual). In what sense are the D2Q9 weights not arbitrary?

Answer

They are the weights of the third-order Gauss–Hermite quadrature of velocity space, chosen so that moments of the Maxwellian up to third order are integrated exactly by a nine-point sum. \(c_s^2 = 1/3\) then follows from the second moment condition rather than being selected.

Q2 (conceptual). Why is LBM restricted to low Mach number?

Answer

The equilibrium distribution is a Hermite expansion of the Maxwellian truncated at second order in \(\mathbf{u}\). The neglected terms scale as \(\mathrm{Ma}^3\) and appear as spurious compressibility. Because it is a truncation in velocity space, refining the spatial grid does not reduce it.

Q3 (MCQ). The streaming step in LBM introduces:

  • (a) second-order spatial error
  • (b) no truncation error at all — it is an exact shift of data between neighbouring nodes
  • (c) numerical diffusion proportional to \(\tau\)
  • (d) a CFL constraint
Answer

(b). Populations move exactly one lattice unit per time step by construction, so streaming is an exact memory copy. All the modelling error lives in the collision and in the truncated equilibrium.