PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 85 in Math Visualization.

View category →
NewUniversity / research

Finite Element Poisson Solver (2D)

Launch Simulator

Triangular P1 finite elements for -Δu=f on a square: assemble stiffness matrices, pin Dirichlet nodes or add natural Neumann flux, solve by CG, and view potential as a colored membrane.

NewUniversity / research

Conjugate Gradient Solver

Launch Simulator

SPD system Ax=b as quadratic minimization: contour geometry, CG vs steepest descent path, residual norm, and condition number.

NewUniversity / research

Finite-Volume Advection-Diffusion 2D

Launch Simulator

Conservative scalar transport on a 2D grid: face fluxes, upwind vs central interpolation, Peclet number, CFL, and numerical diffusion.

NewUniversity / research

Flow Field Particles

Launch Simulator

Synthetic v(x,y,t); advection with wrap; optional arrow grid.

NewUniversity / research

Newton Fractal

Launch Simulator

Basins of attraction for Newton iteration on zⁿ−1 with adjustable relaxation ω.

NewUniversity / research

Mandelbrot Deep Zoom

Launch Simulator

Drag/wheel deep zoom into the Mandelbrot set with smooth continuous coloring and named landmarks.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/Lattice Boltzmann D2Q9 Flow

Lattice Boltzmann D2Q9 Flow

Interactive D2Q9 BGK solver: lid-driven cavity or flow past a cylinder, vorticity colors, Reynolds-number control, and bounce-back walls.

D2Q9 flow setup

120
0.055
5

Measured values

Relaxation time τ0.5178
Lattice viscosity ν0.00594
Collision rate ω1.931
Grid96×54
Stability hintlow τ

This is a compact teaching LBM: small grid, BGK collision, simple bounce-back walls, and qualitative inlet/outlet boundaries. It is meant for numerical-method intuition rather than production CFD.

Live graphs

About this model

The lattice Boltzmann method (LBM) solves fluid-like motion by evolving particle distribution functions on a lattice instead of directly discretizing the Navier-Stokes equations. This simulator uses the standard D2Q9 velocity set and a BGK relaxation step: distributions collide toward local equilibrium, stream to neighboring cells, and bounce back from solid boundaries. Two setups are included: a lid-driven cavity and flow past a circular cylinder. The canvas colors vorticity so recirculation, shear layers, and wake structures become visible as Reynolds number changes.

Who it's for: Scientific computing, numerical methods, computational fluid dynamics, applied math, and physics students learning mesoscopic solvers.

Key terms

  • Lattice Boltzmann method
  • D2Q9
  • BGK collision
  • Vorticity
  • Reynolds number
  • Bounce-back boundary

How it works

Interactive D2Q9 lattice Boltzmann fluid simulation with lid-driven cavity and flow past a cylinder, vorticity colors, and Reynolds-number control.

Key equations

D2Q9: f_i(x+c_i,t+1) = f_i(x,t) − ω(f_i − f_i^eq)
ν = c_s²(τ−1/2), c_s²=1/3, Re = U L / ν

Frequently asked questions

Why does LBM use distribution functions instead of velocity directly?
LBM evolves small populations moving in discrete lattice directions. Macroscopic density and velocity are moments of those populations, which makes streaming local and boundary handling intuitive.
What does the relaxation time tau control?
For D2Q9 BGK, viscosity is nu = (tau - 1/2)/3 in lattice units. Tau too close to 0.5 means very low viscosity and can become numerically unstable.