2D Navier-Stokes Flow

Click & drag to inject velocity · Stam's stable fluid simulation

Controls

Parameters

Stam's "stable fluids" (1999) uses semi-Lagrangian advection (backward tracing particle positions), Helmholtz decomposition to enforce incompressibility (divergence-free velocity field via pressure solve), and implicit diffusion — all unconditionally stable regardless of timestep. Vorticity confinement adds back fine-scale swirl lost to numerical dissipation.