The Navier–Stokes equations
Water, air, honey and blood all move according to the same two rules, written down by
Claude-Louis Navier (1822) and George Gabriel Stokes (1845). They are Newton's
force = mass × acceleration, applied to every tiny parcel of a fluid.
What the equations say
-
Momentum. A parcel of water speeds up or turns because of pressure
pushing on it, gravity pulling on it, and viscosity (internal friction) dragging it
toward the speed of its neighbors. It also carries its own velocity along with it,
which is what makes flow swirl and curl.
-
Incompressibility. Water can't be squeezed. Whatever flows into any
small region must flow out again. Pressure is exactly the force needed to keep that
true: it builds up wherever water is being crammed together and pushes it apart.
Why they're famous
Nobody has proved that smooth solutions always exist in 3D, or that they can't suddenly
blow up to infinite speed. It is one of the seven Clay Millennium Prize problems, with a
$1,000,000 reward. The equations are also chaotic at high speeds (turbulence), so even
supercomputers approximate them.
How this simulation works
-
Particles carry the water. About ten thousand particles hold the
water's position and velocity, which gives the free surface where water meets air, and
lets it splash and slosh.
-
A grid enforces incompressibility. Each step, the particle
velocities are copied onto a 120 × 60 grid, pressure is solved so no cell gains or
loses water, and the correction is copied back. This is the FLIP method used for water
in film visual effects.
-
Simplifications. It is 2D and low resolution, with no surface tension
and no explicit viscosity (water's is tiny at this scale).
Colors and sound
Deep blue is the slowest water on screen and white the fastest. The scale follows the fastest
water, shown in the legend. The rushing sound follows the average speed, splashes come
from water hitting things, and the low surf swells as the water sloshes.
Drag on the screen to draw a box. Ctrl/⌘+Z removes the last one.