Toys
Hydrodynamics
Lattice Boltzmann
This toy uses a D2Q9 Lattice Boltzmann BGK scheme: each pixel stores nine particle populations, streams them to neighboring lattice sites, relaxes them toward a local Maxwellian equilibrium, and derives the visible velocity, density, ink, and vorticity fields from those populations.
The implementation reuses the same WebGL2 float-texture ping-pong pattern as the reaction-diffusion PDE engine. Flat mode runs on the periodic square lattice. Torus mode treats the same periodic coordinates as a donut surface, renders the true torus, and applies torus-aware forcing and display scaling so the flow responds to the curved geometry.
The ink view advects a circular hue tracer with the flow, so numerical averaging no longer collapses the image toward one RGB mean color. A small refresh term can slowly restore color variety after backtracing softens it; set Hue Refresh to zero for a purely passive tracer.
Numerical note: the viscosity slider controls the LBM relaxation through nu = (1 / omega - 1 / 2) / 3. Low viscosity keeps vortices sharp; high viscosity damps them quickly.
