Incompressible Navier–Stokes, decomposed
Fluid is not a texture. Each frame moves the field, disturbs it, measures compression, and removes that compression so ∇·u = 0. Stam’s stable-fluids decomposition is the method;[113] the claim is perceptual rather than numerical — that an incompressible field is what makes the motion read as fluid rather than as a smear. Dijkstra’s point about abstraction holds here too: the field is exact at a level other than the numeric readout.[036][Th.]
Momentum
Incompressible Navier–Stokes
Momentum, divergence-free flow, and the pressure Poisson solve — the three relations the fluid chapter depends on.
Velocity field
How a 2D flow looks on a grid.
A synthetic curl-noise field for teaching — not the Metal advection or vorticity kernels. Click a mode to focus on flow, swirl, or speed.
01 · FlowEach arrow is a velocity sample. Direction is where the fluid moves; longer means faster.
Teaching velocity field (curl noise). Arrows show flow; tint shows swirl. Not the Metal vorticity kernel.
Pressure makes the field incompressible
Sixteen red/black pairs on Apple Silicon; twenty Jacobi sweeps on the fallback. Same constraint, two ownership models. Bridson’s fluids notes are the engineering reading of that constraint.[022]
Pressure solve
Checkerboard updates, faster convergence.
Brightness is pressure on a 14×9 grid. Red and black cells take turns so neighbours stay fixed during each sweep — about 2× faster than Jacobi for the same sweep count.
01 · RedUpdate every red cell from its four black neighbours. Half the grid advances in one parallel pass.
Checkerboard pressure solve on a 14×9 grid. Red then black sweeps; sixteen pairs on Apple Silicon.
A second field for wave memory
A damped wave rides the carrier and couples back into velocity. Roll and azimuth become rings, not badges.
Wave profile
A 1D slice of the ripple field.
Same damped wave update as WaveCompute.metal. Open ends, two pulse sites, defaults c=0.4 and d=0.02.
01 · HeightSolid curve is wave height h(x,t) right now — the surface the ripples ride on.
1D damped wave matching WaveCompute.metal. Ghost = previous frame; pulses ≈ oar entry (c=0.4, d=0.02).