p✳ PopFun.org
Fluid Lab

A PLAYGROUND FOR THE INVISIBLE

Go with the flow.

Stir a little color into science. Make a swirl. See what moves.

4 models · 13 experiments
Switch freely. Each model keeps its state.
Pause freezes time. Reset restarts this experiment with your current controls.
LIVE SIMULATION
THE FLUID IS YOUR CANVASColor traces where the fluid travels.
Drag to stir · Tap to add dye 2D / 96 × 96
Dye is a tracer. Its color is not temperature or pressure.

FOLLOW YOUR CURIOSITY

Three little experiments.

Choose one. Change something. Watch.

Catch a current: follow the ribbons. Switch to Rotation to find the centers of spinning motion.

A LITTLE UNDERSTANDING GOES A LONG WAY

Why does it curl?

Different parts of the fluid move at different speeds and in different directions. Their local rotation is called vorticity. In Rotation view, coral and teal mark opposite spin directions.

What keeps it moving?

Your brush adds momentum. The flow carries that motion onward, while viscosity smooths velocity differences. Pressure is adjusted to keep the simulated fluid approximately incompressible.

A model, with boundaries.

This is a flat, enclosed tank with reflecting, free-slip walls. It models flow and dye, not waves, splashes, gravity, or a water surface. Colors fade slowly to keep the canvas readable.

UNDER THE SURFACE

A little fluid, a lot to discover.

The 3D Flow Volume uses an original 20 × 20 × 20 cell solver with three velocity components, six-neighbor implicit diffusion, trilinear semi-Lagrangian advection, and 30-iteration three-dimensional pressure projection. All six cube walls reflect normal velocity and allow tangential slip. The 3D cloud is rendered as translucent cell markers in a perspective view; this is a volumetric illustration, not physical light scattering. Speed/curl views show only dye-containing cells, while graphs measure all fluid cells, excluding solids. Cross-section selects a narrow Z band for display only. The camera, tool, depth, slice and zoom are included in settings/snapshots; the additional Z velocity and 3D fields have their own snapshot compatibility tag. Older 2D links remain supported.

Objects occupy cells of the coarse 20³ grid. Pressure and diffusion respect their free-slip, no-through-flow faces; dye backtraces stop at solid boundaries. The visible stair-step surfaces show the actual occupied cells. Objects remain fixed during simulation; repositioning or resizing clears cells whose occupancy changes without applying a moving-body force. Graphs average over fluid cells only. Background: NVIDIA GPU Gems 3, 3D fluids and solid boundaries.

Like the 2D flow, this is based on the Stable Fluids method. The coarse 3D grid introduces substantial numerical diffusion. There is no liquid surface, splashing, adaptive mesh, combustion, or calibrated engineering/turbulence prediction. The rising-cloud scene uses simplified concentration-driven buoyancy. Simulation speed depends on the device; the shared clock waits for both comparison panels.

Fluid Lab numerically approximates two-dimensional incompressible flow on a 96 × 96 square grid. Each simulation step diffuses velocity, projects it toward a divergence-free field, advects it using semi-Lagrangian backtracing, and projects again. Three passive dye channels diffuse and advect in that flow.

The method is based on Jos Stam’s Stable Fluids (1999). Code and interface are original. Viscosity and dye diffusivity use normalized simulation units, not calibrated real-world liquids. Speed and rotation colors use fixed display scales and can saturate; arrows indicate direction and relative speed.

Pressure is an internal numerical correction, not a displayed measurement. Finite grid resolution, 30 pressure iterations, and interpolation introduce error and numerical diffusion even when the diffusion slider is zero. Flow is not a validated engineering prediction or a calibrated turbulence model.

Dye Tank has no-through-flow, free-slip walls and no gravity or buoyancy. Rising Smoke adds an illustrative upward force proportional to the average dye concentration; it does not solve temperature, combustion, or true density differences. The chamber is closed, including its ceiling. Related background: Fedkiw, Stam & Jensen, Visual Simulation of Smoke (2001). This simplified implementation does not reproduce that paper’s full model.

Water Ripples uses a separate linear, damped two-dimensional wave equation, integrated with finite differences. A surface height field and vertical velocity evolve on a uniform grid, with zero normal height gradient at reflecting walls. The wave Courant number stays between 0.12 and 0.48. Small-amplitude, nondispersive waves are illustrative: there is no wave breaking, horizontal flow, surface tension or realistic deep-water dispersion. Background: MIT, Finite Differences: Partial Differential Equations. Damping and wave speed are in normalized simulation units.

Compare two simulations side by side to vary settings under a shared clock. Linked brush gestures apply the same position and direction using each panel’s own strength, size and color. Copy A setup to B restarts both experiments, without copying evolved fields. Settings saves, compact links, and settings files restart experiments paused. Full comparison snapshots save the two active fluid fields, painted disturbances, exact internal time, brush positions, and graph history. Open a browser snapshot, snapshot file, or full-snapshot link to resume that moment, paused. Copy snapshot link stores an immutable snapshot on PopFun; anyone with the link can open it, including its title, fields and graph history. Creating a new link does not update an existing link. Snapshots do not include inactive models or guarantee identical rendering on different browsers. The solver uses the saved Float32 field values and normalized fixed-step algorithms. Different models use normalized units; equal steps do not imply equal physical time.

Flow and 3D share this workspace; the Waves section retains Ripple Lab’s full workspace, existing library and recovery. Switching sections holds inactive simulations at their current moment. All four classic simulations keep independent state and settings while this page stays open; reloading starts over. URL fragments #flow, #smoke, #water and #volume open the chosen model. Time advances in fixed steps, capped at 30 updates per second; slow devices run more slowly. Pause freezes the solver but you can still interact; Step once advances one step. Continuous source toggles ongoing forcing; clearing the canvas does not turn it off. Reset keeps settings, objects, source state, and pause state; choosing an experiment restores its starting settings. Reduced-motion preferences start paused.

FLUID LAB

Changelog

v2.0.0 · November 1, 2026

v1.7.0 · November 1, 2026

v1.6.0 · November 1, 2026

v1.5.0 · November 1, 2026

v1.4.0 · November 1, 2026

v1.3.0 · November 1, 2026

v1.2.0 · November 1, 2026

v1.1.0 · November 1, 2026

v1.0.0 · November 1, 2026