Fluid Dynamics: The Math Behind Paint Swirls

Watch math flow like water

1

How Fluids Move

A fluid is made of tiny particles that push and pull each other. Move your mouse to disturb the flow. Watch how particles carry momentum and create patterns.

Move your mouse across the canvas to push the particles.

Each particle: velocity += force * dt, position += velocity * dt
This is Euler integration. Apply forces, update velocity, update position. Repeat 60 times per second. Simple rules, complex behavior.
2

Viscosity: Thick vs Thin

Viscosity is a fluid's resistance to flow. High viscosity = thick and slow (honey). Low viscosity = thin and fast (water). Drag the slider to change viscosity and see how the flow changes.

Water
3

Vortices and Turbulence

When fluid flows past an obstacle, it creates spinning vortices behind it. At low speed the flow is smooth (laminar). At high speed it becomes chaotic (turbulent). Adjust the flow speed to see the transition.

Low

Low speed: laminar flow. Particles move in smooth parallel lines.

Fun Fact

Turbulence is so hard to predict that physicist Richard Feynman called it "the most important unsolved problem of classical physics." A $1 million Millennium Prize awaits anyone who can prove the Navier-Stokes equations always have smooth solutions.

4

Fluid Simulation Everywhere

The same math that makes paint swirl powers critical simulations across science and engineering.

Weather Forecasting

The atmosphere is a fluid. Weather models solve fluid dynamics equations on a global grid to predict wind, rain, and storms days in advance.

Aerodynamics

Car and aircraft design uses computational fluid dynamics (CFD) to simulate airflow, reduce drag, and optimize fuel efficiency without building physical prototypes.

Movie Effects

Every ocean wave, smoke plume, and lava flow in visual effects is a fluid simulation. Films like "Moana" used millions of CPU hours to simulate water.

Generative Art

Artists use fluid simulations to create organic, unpredictable patterns. No two runs produce the same result, making each piece unique.

Navier-Stokes: density * (dv/dt + v*grad(v)) = -grad(p) + viscosity*laplacian(v) + forces
This equation governs all fluid motion. It says: acceleration = pressure forces + viscous forces + external forces. Deceptively simple. Impossibly hard to solve exactly.

Fluid Artist!

You've explored how simple rules about velocity and pressure create the complex, beautiful patterns of flowing fluids. The same math that swirls paint powers weather forecasts, aerodynamics, and ocean simulations.

0
Swirls Created
0
Particles Moved
0
Time Exploring

Fluids Follow Rules

Every fluid obeys conservation of mass and momentum. What looks chaotic is actually deterministic math running at every point in space.

Viscosity Is Resistance

Honey has high viscosity (resists flow). Water has low viscosity (flows easily). Viscosity determines whether fluid moves smoothly or creates swirls.

Turbulence Is Complexity

When fluid moves fast enough, smooth flow breaks into chaotic eddies and vortices. Predicting turbulence is one of the hardest unsolved problems in physics.

Simulation Approximates

Real fluid math (Navier-Stokes equations) is too complex to solve exactly. Computers divide space into a grid and approximate the answer, updating millions of cells per frame.

Ready to Create?

Put your new knowledge into practice!

More Discoveries

Suggest a Correction