Fluid Dynamics — LBM, Navier-Stokes & Real CFD in the Browser

Eight simulations powered by the same computational fluid dynamics methods used in aerospace and climate research: Lattice-Boltzmann D2Q9, SIMPLE Navier-Stokes, Boussinesq convection, SPH particle fluids, shallow-water equations, and ocean surface waves.

Mesh-Based CFD

Computational fluid dynamics divides into two broad families: methods that work on a fixed grid (Eulerian) and methods that follow fluid parcels as they move (Lagrangian). Most industrial solvers — ANSYS Fluent, OpenFOAM — are Eulerian finite-volume codes. The simulations here cover both families, letting you see how the same physical flow emerges from very different mathematical frameworks.

LBM D2Q9 — BGK Collision Step

f_i(x + e_i·Δt, t + Δt) = f_i(x, t) − (1/τ)[f_i − f_i^eq]

Equilibrium distribution:  f_i^eq = ρ·w_i·[1 + (e_i·u)/c_s² + (e_i·u)²/(2c_s⁴) − u²/(2c_s²)]

9 velocity directions (D2Q9), weights w_i = 4/9, 1/9, 1/36
Relaxation time τ controls kinematic viscosity: ν = c_s²(τ − 0.5)Δt
Macroscopic density ρ = Σf_i, momentum ρu = Σf_i·e_i

Particle & Wave Methods

While grid methods excel at steady and mildly unsteady flows, particle and wave methods shine for free-surface problems — splashing droplets, breaking ocean waves, sloshing tanks. The key advantage: the free surface is implicit in the particle positions; you never need to track an interface separately.

Why choose LBM over traditional Navier-Stokes solvers? The Lattice-Boltzmann method never explicitly solves the incompressibility pressure equation — the costliest step in finite-volume CFD. Instead, simple streaming and collision rules on a regular lattice recover the Navier-Stokes equations in the macroscopic limit (Chapman-Enskog expansion). This makes LBM trivially parallelisable and ideal for GPU implementation.

Reynolds Number — The Universal Fluid Parameter

Every fluid dynamics simulation is ultimately characterised by the Reynolds number Re = ρUL/μ, the ratio of inertial to viscous forces. Below Re ≈ 40, flow past a cylinder is steady and symmetric. Between 40 and 200, Kármán vortex shedding begins. Above 1000, the wake becomes turbulent. The same sequence appears whether the fluid is air, water, or blood — only the characteristic length and velocity differ.

Algorithms at a Glance

LBM D2Q9 BGK Zou-He boundary SIMPLE algorithm Vorticity-streamfunction Boussinesq convection Carreau-Yasuda viscosity SPH Wendland kernel MacCormack FDM Gerstner waves JONSWAP spectrum Beta-plane Coriolis Chapman-Enskog expansion

Suggested Learning Paths

📘 Physics / Engineering Students
  1. Kármán Vortex — Reynolds number basics
  2. Bénard Convection — buoyancy-driven flow
  3. Shallow-Water Waves — wave propagation
  4. Blood Flow — non-Newtonian rheology
  5. Cyclone — geophysical fluid dynamics
🎓 CFD / Scientific Computing
  1. Lattice-Boltzmann — mesh-free CFD method
  2. SPH Fluid — particle hydrodynamics
  3. Kármán Vortex — SIMPLE solver internals
  4. Bénard Convection — Boussinesq approximation
  5. Ocean Waves — spectral wave modelling