Lattice Boltzmann Method — LBM CFD Solver

Lattice Boltzmann CFD explained: D2Q9 and D3Q19 lattices, BGK and MRT collision, bounce-back walls and Zou-He boundaries. Run D2Q9 and D3Q19 simulations in your browser with WebGPU.

The lattice Boltzmann method (LBM) is a discrete velocity method that sits between molecular dynamics and the Navier–Stokes equations. Instead of discretising the continuum equations on a staggered grid, it evolves a population of fictitious particles moving along fixed lattice directions, and recovers the macroscopic velocity, density and pressure as moments of that distribution.

CFD Lab implements D2Q9 for two-dimensional flow and D3Q19 for three-dimensional flow. Both run on WebGPU when the browser exposes it, with a CPU fallback that produces identical results. In two dimensions the D3Q19 path defaults to the RMMRT-9 regularised nine-moment collision operator rather than plain BGK, which is the measured-stable choice at Re ≥ 320 where single-relaxation-time BGK becomes fragile.

Boundary conditions are the usual LBM strengths. Bounce-back enforces a no-slip wall by reflecting distributions back along their incoming path, and Zou-He velocity and pressure boundaries impose inflow and outflow without the ghost-cell machinery a finite-volume scheme needs. Geometry as complex as a cylinder wake or a backward-facing step is simply an obstacle mask in the lattice.

The trade-off is honest: LBM is weakly compressible, so it wants Mach numbers below about 0.1, and its viscosity is set by the relaxation time rather than imposed directly. Within that envelope it is remarkably robust, highly parallel, and degrades gracefully — which is why it is the default path for the browser experience.

Frequently asked questions

What is the difference between D2Q9 and D3Q19?

The naming is lattice dimensions (D) and velocity directions (Q). D2Q9 is the standard nine-direction two-dimensional lattice; D3Q19 is the nineteen-direction three-dimensional lattice. D3Q19 offers a good balance between accuracy and computational cost for 3D flows.

What is the relaxation time tau?

Tau controls how quickly the distribution relaxes toward equilibrium and therefore sets the viscosity via nu = cs² (tau − 0.5). Small tau means low viscosity and a demanding stability problem; large tau means slow flow that relaxes easily.

Why does CFD Lab prefer MRT over BGK collision?

Single-relaxation-time BGK relaxes every moment at the same rate, which makes high-Reynolds-number flows prone to instability. Multiple-relaxation-time schemes relax the conserved moments slowly and the non-conserved ones quickly, which widens the stable range measurably. The RMMRT-9 operator is the variant verified stable on-device.

Try it now

The page you are reading is a static, crawler-readable summary. The interactive tool runs in your browser — nothing is uploaded.

Open CFD Lab Back to home