← Back to blog

Navier–Stokes and Fluid Dynamics: The Physics Behind Fluid Simulation

This is for graphics/CFD/curious readers who want the meaning behind the symbols. By the end, you’ll be able to (1) interpret each term in incompressible Navier–Stokes, and (2) see why common simulation steps—especially the pressure projection/Poisson solve—exist.

What (and what to visualize)

Fluid dynamics studies how fluids (liquids and gases) move. The Navier–Stokes equations are the “rules of motion” for fluids in the same way Newton’s laws describe motion for solid objects.

A practical mental model for simulation is the continuum view: instead of tracking molecules, imagine arrows on a grid (or samples in space). At each point x\mathbf{x} and time tt, the fluid has fields such as:

  • Velocity u(x,t)\mathbf{u}(\mathbf{x}, t) (a vector field): direction and speed
  • Pressure p(x,t)p(\mathbf{x}, t) (a scalar field): how strongly it pushes
  • Density ρ\rho (scalar): mass per unit volume
  • Viscosity (how strongly it resists shear), often expressed via kinematic viscosity ν\nu

The core idea is still Newton’s second law applied everywhere:

For a tiny moving parcel of fluid: mass × acceleration = sum of forces.

The incompressible Navier–Stokes equations (with assumptions)

In many classical fluids problems and a lot of graphics water/smoke solvers, we use the incompressible form in 2D or 3D (same equations; only the dimension changes).

Assumptions (what we’re leaving out)

When we write the common incompressible system below, we typically assume:

  • Continuum fluid (fields vary smoothly at our scale)
  • Newtonian fluid (viscous stress proportional to rate of strain)
  • Constant density ρ\rho (typical for liquids; also good for low-Mach gas flows)
  • Constant kinematic viscosity ν\nu (often treated as a constant material parameter)
  • Incompressibility enforced as u=0\nabla\cdot\mathbf{u}=0 (divergence-free velocity)
  • Body forces f\mathbf{f} such as gravity or buoyancy

Equations and symbols (defined at first use)

The incompressible momentum equation is:

ut+(u)u=1ρp+ν2u+f\frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u}\cdot\nabla)\mathbf{u} = -\frac{1}{\rho}\nabla p + \nu \nabla^2 \mathbf{u} + \mathbf{f}

with the incompressibility constraint:

u=0\nabla\cdot \mathbf{u} = 0

Where:

  • u(x,t)\mathbf{u}(\mathbf{x},t): velocity (vector)
  • p(x,t)p(\mathbf{x},t): pressure (scalar)
  • ρ\rho: density (scalar)
  • ν\nu: kinematic viscosity (scalar)
  • f\mathbf{f}: external/body force per unit mass (vector)
  • \nabla: gradient operator (spatial derivatives)
  • \nabla\cdot: divergence (turns a vector field into a scalar)
  • 2\nabla^2: Laplacian (second spatial derivatives; applied component-wise to u\mathbf{u})
  • (Later) ×\nabla\times: curl (turns a vector field into a vector; used for vorticity)

A note on wording: “incompressible” is often casually described as “constant density,” but in solvers the enforced condition is divergence-free velocity (u=0\nabla\cdot\mathbf{u}=0). Constant density is a common accompanying assumption that makes this model consistent for many flows.

Why this matters

Fluid behavior is everywhere:

  • Weather/climate: winds, storms, ocean currents
  • Engineering: aircraft lift, pipelines, turbines
  • Medicine: blood flow, lung airflow
  • Astrophysics: gas clouds, accretion disks
  • Game development/VFX: smoke, fire, splashes

For simulation, Navier–Stokes matters because it tells you what you must preserve (or plausibly approximate) to get believable motion: inertia/advection, pressure enforcing volume conservation, and viscosity smoothing shear.

It also matters mathematically: global regularity of 3D Navier–Stokes is a Clay Millennium Prize Problem.

History (and why it still shows up in modern solvers)

Fluid mechanics grew from practical needs—ships, canals, pumps—long before modern equations.

  • 18th century (Euler): Euler derived equations for inviscid (ν=0\nu=0) flow.
  • 19th century (Navier, Stokes): Navier and Stokes incorporated viscosity, producing the modern form.
  • Late 19th–20th century (Prandtl and others): boundary layers, turbulence research, experimental aerodynamics.
  • Late 20th century to today: CFD and graphics simulation made numerical solutions central.

Why this matters today: many practical methods still reflect this history—e.g., treating the bulk flow as nearly inviscid (Euler-like) while handling near-wall behavior with viscosity/boundary layers, plus turbulence modeling when you can’t resolve all scales.

Key terms (quick reference)

  • Field: a quantity defined everywhere in space/time.
  • Gradient p\nabla p: points toward increasing pp.
  • Divergence u\nabla\cdot\mathbf{u}: local expansion/compression tendency.
  • Curl ×u\nabla\times\mathbf{u}: local rotation.
  • Laplacian 2u\nabla^2\mathbf{u}: local “curvature”; drives diffusion/smoothing.
  • Kinematic viscosity ν=μ/ρ\nu=\mu/\rho: momentum diffusivity (with dynamic viscosity μ\mu).
  • Vorticity ω=×u\boldsymbol{\omega}=\nabla\times\mathbf{u}: rotation/spin of the flow.
  • Reynolds number Re=UL/ν\mathrm{Re}=UL/\nu: inertia vs viscosity.

Next we’ll use the “arrows on a grid” picture to read the equation as a set of effects, then map those effects directly to simulation steps.

Equation anatomy: what each term does (with concrete examples)

Start from:

ut+(u)u=1ρp+ν2u+f\frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u}\cdot\nabla)\mathbf{u} = -\frac{1}{\rho}\nabla p + \nu \nabla^2 \mathbf{u} + \mathbf{f}

Left-hand side: changes in velocity (acceleration)

  • Local time change ut\frac{\partial \mathbf{u}}{\partial t}

    • Example: you turn on a fan; at a fixed point in the room, the air speed increases over time.
  • Advection / convection (u)u(\mathbf{u}\cdot\nabla)\mathbf{u}

    • Intuition: the flow carries its own momentum into new locations.
    • Example: a fast jet of water entering still water keeps pushing forward and pulls surrounding fluid into shear layers and roll-ups.

A compact way to express “acceleration felt by a moving parcel” is the material derivative:

DuDt=ut+(u)u\frac{D\mathbf{u}}{Dt} = \frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u}\cdot\nabla)\mathbf{u}

Right-hand side: forces per unit mass

  • Pressure gradient 1ρp-\frac{1}{\rho}\nabla p

    • Pressure forces push from high to low pressure.
    • Example: squeeze one side of a water balloon—pressure rises locally and drives flow elsewhere.
  • Viscous diffusion ν2u\nu\nabla^2\mathbf{u}

    • Intuition: viscosity diffuses momentum the way heat conduction diffuses temperature.
    • Example: Couette flow—fluid between two plates, one moving and one stationary. Viscosity transfers motion from the moving plate into the interior, creating a smooth velocity gradient.
  • Body forces f\mathbf{f}

    • Commonly gravity, buoyancy, or user-applied forces in graphics.
    • Example: hot smoke rises because buoyancy acts like an upward body force.

Constraints & pressure: what “incompressible” really means

The incompressibility condition is:

u=0\nabla\cdot \mathbf{u} = 0

Read it as: locally, the velocity field must not create or destroy volume. A little cube of fluid may shear and stretch, but it cannot expand or shrink.

Pressure is a constraint enforcer (and why it becomes a global solve)

In incompressible flow, pressure is best thought of as the quantity that adjusts so the updated velocity satisfies u=0\nabla\cdot\mathbf{u}=0. Mathematically, pressure acts like a Lagrange multiplier for the divergence-free constraint.

A crucial nuance for both physics and numerics:

  • Pressure is not “advected like dye.”
  • Pressure is determined by a global constraint: enforcing u=0\nabla\cdot\mathbf{u}=0 leads to an elliptic equation (a Poisson-type solve) whose solution depends on the whole domain and boundary conditions.

This is the conceptual reason a local tweak in velocity can require a domain-wide pressure adjustment.

Boundary conditions (where you see the physics)

Boundaries strongly shape real and simulated flows:

  • No-slip: fluid velocity matches the wall velocity (common for viscous liquids). This creates strong near-wall shear and is where viscosity and boundary layers become visible.
  • Free-slip (or slip): no penetration through the wall, but tangential motion can slide—often used as a simplification in graphics or idealized flows.

Pressure boundary conditions also matter: they influence how the Poisson solve distributes pressure to enforce incompressibility.

Turbulence & scaling: Reynolds number, vorticity, and why detail explodes

Reynolds number with a quick back-of-the-envelope

Reynolds number compares inertia to viscosity:

Re=ULν\mathrm{Re} = \frac{UL}{\nu}

Example: water in a 1 cm diameter pipe.

  • Take U=1m/sU = 1\,\text{m/s}, L=0.01mL = 0.01\,\text{m}, and water ν106m2/s\nu \approx 10^{-6}\,\text{m}^2/\text{s}.
Re(1)(0.01)106=104\mathrm{Re} \approx \frac{(1)(0.01)}{10^{-6}} = 10^4

Re104\mathrm{Re}\sim 10^4 is typically in the turbulent regime for internal pipe flow—meaning lots of multiscale structure unless you model or resolve it.

Turbulence is multiscale structure, not just “randomness”

Turbulence often involves an energy cascade:

  • Large eddies stretch and fold the flow, creating smaller eddies.
  • This continues to finer scales.
  • Viscosity dissipates energy primarily at the smallest scales.

Navier–Stokes contains both ingredients:

  • Nonlinear advection transfers motion/energy across scales.
  • Viscosity removes energy (especially at small scales).

One vorticity sentence (why vortices persist)

With vorticity ω=×u\boldsymbol{\omega}=\nabla\times\mathbf{u}, a key 3D effect is vortex stretching: when a vortex tube is stretched by the flow, its vorticity magnitude can increase, helping vortices persist and intensify—one reason 3D turbulence is so rich.

From physics to code: how solvers map terms to simulation steps

The title promise is “physics behind simulation,” so here’s the direct correspondence most incompressible solvers use (grid-based MAC, FLIP, many CFD schemes; details vary):

  1. Add body forces (f\mathbf{f})

    • Update velocity with gravity/buoyancy/user forces.
  2. Advect velocity (the advection term (u)u(\mathbf{u}\cdot\nabla)\mathbf{u})

    • Transport the velocity field along itself (semi-Lagrangian, upwind, WENO, particle advection, etc.).
  3. Diffuse (optional) viscosity (ν2u\nu\nabla^2\mathbf{u})

    • Apply momentum diffusion; often implicit for stability.
  4. Project to incompressible (enforce u=0\nabla\cdot\mathbf{u}=0)

    • Compute a pressure field pp by solving a Poisson-type equation derived from the divergence of the intermediate velocity.
    • Subtract the pressure gradient to remove divergence:
uu1ρp\mathbf{u} \leftarrow \mathbf{u} - \frac{1}{\rho}\nabla p

That last step is the numerical manifestation of “pressure as constraint enforcer.”

Common misconceptions (quick callout)

  • “Incompressible” doesn’t mean “motionless.” It means the velocity field is divergence-free; the flow can still be fast and highly vortical.
  • Viscosity is not the same thing as turbulence. High viscosity tends to suppress small-scale motion; turbulence is primarily driven by inertia at high Re\mathrm{Re}.
  • Pressure isn’t a transported substance like dye. In incompressible flow, it’s determined by a global constraint (often a Poisson solve in practice).

Big takeaway

In incompressible Navier–Stokes, fluid motion changes because:

  • Advection carries momentum through space,
  • Pressure redistributes velocity to enforce u=0\nabla\cdot\mathbf{u}=0,
  • Viscosity diffuses momentum and smooths shear,
  • Forces add external acceleration.

If you can look at the equation and attach a concrete picture to each term (jet → advection, balloon squeeze → pressure gradient, Couette flow → viscosity), you’re not just seeing math—you’re reading the simulation’s rulebook.

Optional sidebar: what changes for compressible flow?

For compressible fluids (high-speed gas dynamics, acoustics), density is no longer constant and you don’t enforce u=0\nabla\cdot\mathbf{u}=0. Instead you solve a continuity equation for ρ\rho, and pressure becomes a thermodynamic variable linked by an equation of state (e.g., ideal gas law). Numerically, this shifts the problem toward wave propagation (sound/shocks) rather than pressure projection.

Next steps

If you want to go from “I understand the terms” to “I can build or tune a solver,” good follow-ons are:

  • Pressure projection in detail (deriving the Poisson equation; boundary conditions)
  • Discretization choices: grids (MAC), particles (SPH/FLIP), hybrids
  • Stability and time stepping: CFL condition, semi-Lagrangian vs higher-order advection
  • Turbulence modeling: LES/RANS, vorticity confinement (graphics), subgrid models

Test Your Knowledge

30 questions

  1. 1. In the continuum view used for many simulations, what is being modeled instead of individual molecules?

  2. 2. Which quantity is described as a vector field giving direction and speed at each point?

  3. 3. In the blog post’s framing, what is the core physical law applied everywhere to derive Navier–Stokes?

  4. 4. Which constraint is explicitly enforced in incompressible solvers according to the post?

  5. 5. What does the post say is often casually meant by “incompressible,” even though solvers enforce a different condition?

  6. 6. In the incompressible momentum equation, which term represents advection/convection?

  7. 7. What is the material derivative Du/Dt equal to in the post?

  8. 8. Which right-hand-side term pushes fluid from high pressure to low pressure?

  9. 9. Which term is described as viscous diffusion that smooths velocity gradients?

  10. 10. In the post, which example is used to illustrate viscous momentum transfer creating a smooth velocity gradient?

  11. 11. What does the Laplacian ∇²u represent in the post’s intuition?

  12. 12. Which operator turns a vector field into a scalar and measures local expansion/compression tendency?

  13. 13. Which operator is used to define vorticity ω in the post?

  14. 14. How is kinematic viscosity ν related to dynamic viscosity μ and density ρ?

  15. 15. What does the Reynolds number Re compare?

  16. 16. According to the post, which ingredient in Navier–Stokes transfers energy/motion across scales in turbulence?

  17. 17. According to the post, where does viscosity primarily dissipate energy in turbulent flows?

  18. 18. What 3D effect is mentioned as helping vortices persist and intensify?

  19. 19. In the post’s interpretation, what is pressure best thought of as in incompressible flow?

  20. 20. Why does enforcing incompressibility lead to a global pressure adjustment in many solvers?

  21. 21. Which statement about pressure is explicitly called out as a misconception?

  22. 22. What does the incompressibility condition ∇·u = 0 mean in the post’s physical picture?

  23. 23. Which boundary condition is described as fluid velocity matching the wall velocity, creating strong near-wall shear?

  24. 24. Which boundary condition is described as allowing tangential sliding while preventing penetration through the wall?

  25. 25. In the solver step list, what is typically done immediately after adding body forces?

  26. 26. In the solver step list, what is the purpose of the projection step?

  27. 27. What velocity update is applied after solving for pressure in the projection step?

  28. 28. Which historical figure is associated in the post with deriving the inviscid (ν = 0) equations?

  29. 29. What major open mathematical issue is mentioned regarding 3D Navier–Stokes?

  30. 30. According to the compressible-flow sidebar, what changes compared to incompressible flow?

0/30 answered