A real-time incompressible Navier-Stokes solver: Jos Stam's Stable Fluids (1999) -
running in pure JavaScript, no libraries. Drag anywhere on the canvas to stir ink into the
velocity field; the solver advects it, keeps the field divergence-free
(∇·u = 0), and adds vorticity confinement so the small swirls don't dissipate.
Each frame solves the incompressible Navier-Stokes equations on a 120×120 staggered-ish grid:
My undergrad thesis trained and compressed PINN surrogates for non-Newtonian (Carbopol) fluid simulation: so classical CFD solvers and their costs are close to home.
This is the other end of the spectrum: a coarse but fully interactive solver at 60 fps, the kind of resolution/speed trade-off that makes learned surrogates (PINNs, neural operators) so attractive for the expensive cases. See the FNO vs. Solver demo for that story.