Smoke Fluid Simulation
A fluid solving the incompressible Navier–Stokes equations. Drag to stir up smoke and flow. A free physics simulation in your browser (Navier–Stokes equations, Incompressibility, Viscosity).
How it works and what to look for
∂u/∂t + (u·∇)u = −∇p/ρ + ν∇²u + f 、 ∇·u = 0
This solves the incompressible Navier–Stokes equations with Jos Stam's Stable Fluids method. Each step smooths velocity by viscosity (diffusion), carries things along the flow (advection), and removes divergence with pressure (projection).
Incompressibility (∇·u = 0) means fluid never appears or disappears anywhere. You can check it by "Divergence" staying at a few percent or less (it isn't exactly 0 because the iterative solve stops early).
With high viscosity the flow smooths out quickly and moves slowly, like honey. With low viscosity vortices last longer and small ones keep forming. In "Vorticity" view, counterclockwise vortices are red and clockwise ones blue.
Today's question: How does increasing viscosity change the smoke's vortices?
- Turn the jet on. Fix buoyancy and fade rate, choose low viscosity, and reset.
- Run for a fixed time. Record vortex detail and the divergence measurement.
- Increase only viscosity, reset, and compare after the same time.
Read the explanation and model assumptions
Viscosity smooths differences in fluid velocity. Fine vortices are smoothed more strongly at high viscosity; complex eddies can persist at lower viscosity. Smoke color is a tracer that makes the flow visible.
Smoke fading is not fluid compression. A finite grid and time step mean divergence may not be exactly zero. Smoke amount and fluid mass are different quantities.
Everyday examples
- The swirls when you pour milk into coffee are described by the equations of fluid motion.
- An aircraft wing changes the airflow around it to produce an upward force (lift).
- Honey flows slowly and water flows easily because their viscosities are very different.
Common misconceptions
- Misconception: The faster a fluid flows, the higher its pressure.
- In fact: In a flow with low viscosity, faster regions along the same streamline have lower pressure (Bernoulli's principle).
- Misconception: Water is easy to compress.
- In fact: In ordinary flows, water hardly changes volume at all, so it can be treated as incompressible.