Learning path

Full curriculum

Full curriculum

Arrows go from each prerequisite to the units that depend on it. Hover or focus a unit to highlight its path.

Unit content

Pressure projection for incompressible fluid simulation

A numerical incompressible-flow solver must advance velocity while enforcing

$$\nabla\cdot\mathbf v=0.$$

A common strategy is a projection method: first predict a velocity without the new pressure correction, then use pressure to project that velocity onto a divergence-free field.

Predict velocity

Advection, viscosity and body forces produce an intermediate velocity $\mathbf v^*$ that generally does not satisfy incompressibility exactly.

Solve for pressure

Choose the pressure correction so that

$$\mathbf v^{n+1}=\mathbf v^*-\frac{\Delta t}{\rho}\nabla p$$

has zero divergence. Taking the divergence gives a pressure Poisson equation of the form

$$\nabla^2p=\frac{\rho}{\Delta t}\nabla\cdot\mathbf v^*.$$

After spatial discretization this becomes a large sparse linear system. The projection idea does not depend on one particular direct or iterative linear solver.

Project the field

After the pressure equation is solved, subtracting its gradient removes the divergent component of the intermediate velocity.

A simple incompressible simulator repeatedly combines advection, force application, diffusion and pressure projection. The visual result depends on the physical model, boundary conditions, discretization and numerical error.