LBM · How it works

A fluid, nine numbers
at a time.

Simple local rules. Familiar fluid motion. The lattice Boltzmann method connects the two through a statistical description of matter.

You can start coding before you master the theory. A basic LBM solver is surprisingly compact and straightforward to implement. Understanding why it works takes more time, drawing on kinetic theory and numerical analysis. You can build that understanding gradually, with each simulation giving the mathematics something concrete to explain.

Instead of directly solving for velocity and pressure, LBM evolves populations on a grid. No molecular trajectories to track—just a handful of numbers at each grid point.

1A crowd of velocities

Molecules do not all move at the same velocity. At thermal equilibrium, their velocities follow a Maxwell–Boltzmann distribution. In two-dimensional velocity space, this forms a bell-shaped surface. Below, colour shows its height: the bright centre follows the mean flow, while temperature sets the width.

Continuous 2D Maxwellian

Velocity vₓ →Velocity vᵧ →00

D2Q9 equilibrium populations

Discrete velocity cₓ →Discrete velocity cᵧ →

Both diagrams use the same velocity units and axis directions. Left: brighter means a larger distribution value; the cross marks mean velocity. Right: circle area represents population size. The populations preserve selected moments, rather than sampling the colours on the left. Temperature is fixed.

LBM uses a small, carefully chosen set of velocities. D2Q9 means two dimensions and nine velocities: four along the axes, four along the diagonals, and one at rest.

Each channel stores a population, fᵢ: the fluid density associated with that discrete velocity. Populations are continuous numbers, not counts of individual tracked particles.

How does this connect to the Maxwellian?

The discrete equilibrium is constructed to reproduce essential velocity moments of the continuous distribution, including density, momentum and momentum flux. It is not simply nine samples of the bell curve. Standard isothermal LBM uses a low-speed polynomial approximation of this equilibrium.

Read more: Krüger et al. (2017); He & Luo (1997).

2Collision: shuffle the shares

The collision operator redistributes populations at the same grid point. For the basic fluid model, it preserves total mass and momentum while changing the other properties of the distribution.

The simplest choice, BGK, relaxes the populations towards a local equilibrium determined by density and velocity. Think of nine shares being rebalanced, with the totals kept intact.

A non-equilibrium distribution
Population channel
Mass: 1.000Momentum: (0, 0)

Bars: current populations. Dashed marks: equilibrium targets. This example uses a relaxation rate of 0.8; both distributions have zero mean velocity.

A peek at the collision equation
\[f_i^{*}=f_i+\omega\left(f_i^{\mathrm{eq}}-f_i\right)\]

Read it as “current population + a correction towards equilibrium.” The star marks the post-collision value; ω is the relaxation rate. Relaxation is not always a simple blend: some useful rates exceed one.

For standard BGK, in lattice units, the kinematic viscosity is \(\nu=c_s^2\left(\frac{1}{\omega}-\frac12\right)\), where cₛ is the lattice speed of sound.

More advanced operators relax different moments—weighted combinations of populations—at different rates. Collision design is a major route to improving accuracy and stability. [Read more]

3Streaming: follow your arrow

After collision, each population travels to the neighbouring node selected by its discrete velocity. The resting population stays put. Streaming moves values; it does not change them.

Before streaming

Symbols are separated near the source for visibility. In the full simulation every node sends and receives simultaneously.

At walls, boundary rules redirect or reconstruct populations. A common example is bounce-back, which reverses populations to represent a no-slip wall. Accurate curved and moving boundaries need more care.

4And out comes a fluid

The familiar flow variables are hiding inside the populations:

\[\rho=\sum_i f_i,\qquad \rho\mathbf{u}=\sum_i f_i\mathbf{c}_i\]

Add the populations to get density. Weight them by their discrete velocities to get momentum, then divide by density to obtain fluid velocity. These expressions apply to the basic model without external forcing.

With suitable collision and equilibrium models, LBM recovers the Navier–Stokes equations in the appropriate limit. Standard isothermal models are usually used at low Mach number: the flow is slow compared with the lattice speed of sound.

Collide. Stream. Repeat.
Compact rules make it approachable. Making them accurate, stable and fast is where research begins.

Follow your curiosity

You do not need to read these before getting started. Use the introductory material alongside your first simulations.

Start here

Go deeper: theory and collision models