Skip to main content
Sandbox Physics

Fluid dynamics · a classic CFD benchmark

Lid-Driven Cavity

Why does a right-moving lid create one giant clockwise circulation inside a sealed cavity? The lid drags the fluid just below it to the right, so it keeps feeding clockwise rotation into the top of the box. Viscosity spreads that rotation downward and the flow carries it around the walls, until the whole cavity turns as one big clockwise eddy. The Reynolds number sets the balance between spreading and carrying.

The moving lid injects vorticity into a sealed cavity. Three two-dimensional grids advance together, and you see the live vorticity field, the velocity profiles along both centerlines, the residual history and a comparison with the steady Ghia 1982 data on the same plot.

Interactive modelLid-Driven Cavity
Nondimensional time tU/LtU/L0.0960.096
Active solution65×65  semi-Lagrangian65\times65\;\mathrm{semi\text{-}Lagrangian}
Steady residual RωR_\omega00
Ghia profile RMSE00
Divergence RMS ∥∇⋅u∥2\lVert\nabla\cdot\boldsymbol{u}\rVert_200
Primary vortex center(0.50, 0.70)\left(0.50,\,0.70\right)

Physics tutorial

Lid-Driven Cavity: how one wall moves an entire fluid

BackgroundThree walls of a square container stay fixed, and only the lid slides to the right. Because of the no-slip condition, the fluid touching the lid moves with it at the same horizontal speed, and viscosity spreads that momentum into the interior. The Lab plots the live two-dimensional solution on the same axes as published steady centerline data.

Why it mattersThe geometry is about as simple as it gets, yet it has wall shear, vorticity production, a primary recirculation and secondary corner eddies. That is why it has long been a benchmark for incompressible-flow algorithms.

Start with the essentials

Focus question
If the lid only travels right, why does one giant clockwise circulation emerge in the cavity?
One-sentence intuition
The lid keeps injecting negative vorticity. Kinematic viscosity ν\nu spreads it out and advection carries it away; the Reynolds number decides which one wins.

Core mathematical model

Incompressible Navier–Stokes equations

∂u∂t+(u⋅∇)u=−1ρ∇p+ν∇2u,∇⋅u=0\frac{\partial\boldsymbol{u}}{\partial t}+\left(\boldsymbol{u}\cdot\nabla\right)\boldsymbol{u}=-\frac{1}{\rho}\nabla p+\nu\nabla^2\boldsymbol{u},\qquad \nabla\cdot\boldsymbol{u}=0

Inertia, pressure, and viscosity determine the velocity field. Zero divergence means fluid is neither created nor destroyed inside the cavity.

Vorticity–streamfunction form

∂ω∂t+u⋅∇ω=ν∇2ω,u=(∂ψ∂y,−∂ψ∂x),∇2ψ=−ω\frac{\partial\omega}{\partial t}+\boldsymbol{u}\cdot\nabla\omega=\nu\nabla^2\omega,\qquad \boldsymbol{u}=\left(\frac{\partial\psi}{\partial y},-\frac{\partial\psi}{\partial x}\right),\qquad \nabla^2\psi=-\omega

The two-dimensional model carries scalar vorticity along, then solves a Poisson equation for the streamfunction. The velocity derived from the streamfunction is automatically divergence-free.

Reynolds number

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

At low Reynolds number, viscous diffusion is stronger. Raising it thins the shear layer at the walls and concentrates the recirculation.

Common difficulties

A transient curve is not a steady benchmark

Typical misconceptionA live curve near the Ghia markers proves that the grid has converged.

Better mental modelThe Ghia markers are steady results from a finer grid, while the live curve is still changing in time. The gap between the three grids shows how sensitive the result is to resolution at one moment; it is not a formal steady grid-convergence study.

Color shows rotation, not speed

Typical misconceptionThe deepest blue region must be moving fastest.

Better mental modelVorticity measures local rotation and shear, while speed is ∥u∥\lVert\boldsymbol{u}\rVert. A thin wall layer can carry intense vorticity without being the fastest part of the whole flow.

Run the experiment

  1. 01

    Watch vorticity and profiles develop together

    Choose the Ghia Reynolds number 100 preset, press Reset study, and watch panels A, B and C together.

    What to observe: Strong clockwise vorticity appears at the top first, then the live centerline curves move gradually toward the steady reference markers.
  2. 02

    Inspect grid sensitivity

    Pause the solver and press Step 24 repeatedly while comparing the three-grid RMSE in panel D.

    What to observe: All three grids stay at the same dimensionless time, so the gap between them comes from spatial discretization. Their error against the steady reference still includes transient error.
  3. 03

    Compare transport methods

    At Reynolds number 400, turn off Semi-Lagrangian transport and compare with the first-order upwind result after the same number of steps.

    What to observe: The two low-order methods have different numerical diffusion, so their wall layers, residual curves and centerline errors do not coincide.

Conceptual inspiration: FluidMotion. Original simulations and graphics; the model limits are described above.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy