Fluid simulator FAQ
Is this a real physics simulation?
Yes — it runs Jos Stam's classic "stable fluids" Navier-Stokes solver (diffusion, pressure projection and advection) on a grid every frame, the same technique behind most real-time smoke and ink effects, plus vorticity confinement to restore the small eddies a stable solver smooths away.
What are the eight fluids?
Ink in water, smoke, lava, plasma, aurora, wet paint, milk in coffee and mercury. They are not just colour swaps: each sets its own viscosity, dye diffusion, dissipation, buoyancy and vorticity, so lava crawls as a thick ribbon, smoke rises and thins, plasma throws off filaments, and mercury settles almost immediately.
Does it run on the GPU?
No. It is plain JavaScript over typed-array grids on the main thread — one small file, no WebGL context to lose and no shaders to compile, so it behaves the same where WebGL is blocked or software-emulated. The cost is that the grid must fit one CPU core: about 3.7ms a frame at Low, 8.5 to 10ms at Medium and 14ms at High, against the 16.7ms a 60fps frame allows.
What do the Brush, Force and Swirl sliders do?
Brush sets the radius of dye and force injected under the pointer. Force scales how hard a stroke pushes the velocity field. Swirl scales vorticity confinement — turn it up for whipping filaments, down for a smooth, syrupy flow. Quality changes the grid resolution and the number of pressure iterations, which is the main trade between how much the fluid swirls and how fast it runs.
Why does the colour change as I drag?
On the dye fluids — ink, wet paint and milk — each stroke starts at a fresh hue and drifts as it travels, and that hue is carried through the flow by the same advection as the dye itself, so colours blend where strokes cross. The other fluids read their colour straight off a fixed gradient driven by density, which is what makes fire and plasma glow rather than mix.
Does this use my camera, microphone or any personal data?
No — it only reads mouse or touch position on this page. Nothing is recorded, uploaded or stored. It also stops simulating entirely when the tab is not visible, so it is not quietly burning battery in a background tab.
Is this physically accurate?
No. It solves a simplified form of the Navier-Stokes equations on a coarse grid with numerical diffusion that smooths away fine detail, and vorticity confinement puts energy back at small scales by a rule that is chosen for looks, not derived from the physics. It is built to look convincing at sixty frames per second, not to be quantitatively correct.
Why does it slow down on a large screen?
Cost scales with the number of grid cells, so with the square of the resolution — doubling the linear resolution quadruples the work. The iterative pressure solve is the most expensive part. The frame rate is shown under the canvas, and the quality drops a step automatically if the machine cannot hold sixty.