New & Expanded: Fluid Dynamics Collection

Six fluid dynamics simulations have been added or significantly upgraded — Lattice Boltzmann Method (D2Q9), Kármán vortex street, Rayleigh-Bénard convection, blood flow Navier-Stokes, shallow-water ocean waves, and bath wave simulation. All use real CFD algorithms.

Fluid dynamics is one of the hardest areas of computational physics to simulate correctly — and one of the most visually rewarding when you do. These simulations span the range from incompressible viscous flow at low Reynolds number through turbulent wake formation, heat convection instabilities, and wave propagation on shallow-water surfaces.

💧 Browse the Fluid Dynamics Collection →

The Simulations

🔵 Lattice Boltzmann Method D2Q9 LBM simulation of incompressible viscous flow past a cylinder. Adjust Reynolds number to watch laminar flow, vortex shedding onset, and turbulent wake formation. Velocity and vorticity fields visualised in real time. D2Q9 LBM · BGK collision · Zou-He boundary conditions 🌀 Kármán Vortex Street Von Kármán vortex street — alternating vortices shed from a bluff body at moderate Reynolds numbers (Re 100–300). See how the Strouhal number St ≈ 0.2 emerges from the shedding frequency. SIMPLE algorithm · vorticity-streamfunction · Strouhal number ♨️ Rayleigh-Bénard Convection A fluid layer heated from below develops convection cells when the Rayleigh number exceeds a critical threshold Ra ≈ 1708. Adjust temperature difference and viscosity to control cell formation. Boussinesq approximation · Rayleigh number · finite difference 🩸 Blood Flow Pulsatile non-Newtonian blood flow through a bifurcating vessel. Poiseuille flow in straight segments, recirculation zones at the bifurcation, and particle trajectories visualised. Navier-Stokes · Carreau-Yasuda viscosity model · FEM 🌊 Ocean Surface Waves Gerstner wave superposition for ocean surface simulation with foam accumulation on crests. Interactive wind direction and Beaufort number control the wave height spectrum. Gerstner waves · JONSWAP spectrum · Three.js vertex shader 🛁 Bath Wave Simulator 2D shallow water equations solved by explicit MacCormack scheme. Drag the surface to generate waves; watch dispersion, reflection from walls, and sloshing modes. Shallow water equations · MacCormack FD scheme · sloshing modes

Why Lattice Boltzmann?

Traditional CFD solves the Navier-Stokes equations directly — a system of coupled non-linear PDEs that require implicit pressure solvers, iterative convergence, and careful treatment of boundary conditions. Lattice Boltzmann is a different paradigm: instead of tracking fluid velocity at grid points, it tracks the statistical distribution function of notional fluid particles moving on a regular lattice. The macroscopic Navier-Stokes equations emerge from this mesoscale model through a Chapman-Enskog expansion.

The advantage for browser simulation is that LBM is embarrassingly parallel — every lattice site updates independently — and maps directly to GPU compute shaders. The D2Q9 model (2D, 9 velocity directions) gives accurate incompressible flow at low Mach number with just 9 distribution functions per cell.

Reynolds number is everything in fluid dynamics. Re = ρUL/μ (density × velocity × length scale / dynamic viscosity). Below Re ≈ 5: fully laminar, attached flow. Re 40–200: steady vortex pair behind cylinder. Re 200–400: periodic vortex shedding (Kármán street). Re > 400: turbulent wake. You can explore this entire range in the Lattice Boltzmann simulation by adjusting the viscosity slider.