GoSimulationVisualizationUpdated February 17, 2026

View the repository

fluid is an interactive Eulerian fluid simulation built on a staggered grid. It combines semi-Lagrangian advection with optional BFECC correction and exposes the solver through visual modes for smoke, pressure, velocity magnitude, and vorticity.

A staggered fluid grid with pressure values at cell centers, horizontal velocity on vertical faces, and vertical velocity on horizontal faces.
Pressure lives at cell centers while velocity components live on the faces they cross, making each cell's net flow and the pressure correction natural to compute.

Live controls turn the numerical method into an effective learning tool. Walls, forces, sources, sinks, particles, border conditions, and presets can all be changed while the simulation runs. Toggling BFECC or vorticity confinement exposes tradeoffs such as numerical diffusion directly in the simulation.

The three views show the same paused state. Smoke makes transport visible, velocity arrows expose the vector field carrying it, and signed vorticity separates clockwise from counterclockwise rotation in the wake.

Why it is worth exploring

  • It connects numerical techniques to immediate visual feedback.
  • Multiple presets, including jet flow, a lid-driven cavity, and a Kármán vortex street, exercise the same solver under different conditions.
  • The controls make it a useful test bench for comparing stability, sharpness, and performance choices.

Begin with the grid and simulation-step code, then trace how the visualization modes turn solver fields into something inspectable.

Updated: