Vessel
INDEX — 001.00 / STUDY
PRIMING THE FIELD
Drag anywhere001 / 001

vessel[001]

§ A study in fluid

Navier-Stokes. Solved every frame. In your browser.

Resolution

512 × 288

Pressure iterations

24 per frame

Index

— 001

§ 01 — The study

A fluid,
a vessel,
nothing
else.

This page is one idea, executed with no concessions. There are no sliders. There is no parallax. There is no second screen of products. There is a fluid — computed from first principles — and a single word of type for it to disturb.

Behind the canvas, a shader pipeline solves the incompressible Navier-Stokes equations: velocity is advected along itself, divergence is computed, pressure is resolved through twenty-four Jacobi iterations, and the gradient is subtracted to keep the field true to the continuum.

When you drag, you inject energy. The dye moves because the velocity moved it, not because we animated it. This is simulation, not animation.

01

Splat

Mouse velocity injected into velocity and dye fields

per pointer move

02

Advect

Semi-lagrangian advection. Field moves along itself

∂u/∂t + (u·∇)u

03

Divergence

Compute ∇·u per texel, store in scalar field

∇·u → b

04

Pressure

Solve ∇²p = ∇·u via 24 Jacobi passes

∇²p = b

05

Subtract

u ← u − ∇p. The field is now divergence-free

∇·u = 0