---
title: "How One Moving Wall Drives an Entire Fluid Interactive Lab | Sandbox Physics"
description: "Do more than watch a vortex: place the transient numerical solution on a classic benchmark. Why does a right-moving lid create one giant clockwise circulation inside a sealed cavity?"
canonical_url: "https://sandboxphysics.com/labs/lid-driven-cavity/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/lid-driven-cavity/"
---

Fluid dynamics · CFD benchmark workbench

# Lid-Driven Cavity

The moving lid injects vorticity into a sealed cavity. This workbench advances three two-dimensional grids together and shows the live vorticity field, both centerline velocity profiles, residual history, and a direct comparison with the steady Ghia 1982 data.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

This Lab solves the two-dimensional incompressible vorticity–streamfunction system $\frac{\partial\omega}{\partial t}+\boldsymbol{u}\cdot\nabla\omega=\nu\nabla^2\omega,\qquad \nabla^2\psi=-\omega$. The Ghia data are a steady reference on a $129\times129$ grid; the three low-order grids here are still evolving. Same-time RMSE combines transient, discretization, and solver error and must not be read as engineering CFD accuracy.

Physics tutorial

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

**Background** Three walls of a square container remain fixed while only the lid moves right. The no-slip condition gives adjacent fluid the same horizontal speed, then viscosity diffuses that momentum into the interior. The workbench places the live two-dimensional solution and published steady centerline data on the same axes.

**Why it matters** This spare geometry still contains wall shear, vorticity production, primary recirculation, and secondary corner eddies, so it has long served as 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 continuously injects negative vorticity. Kinematic viscosity $\nu$ diffuses it while advection transports it, and Reynolds number sets the competition.

### Core mathematical model

#### Incompressible Navier–Stokes equations

$$
\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

$$
\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 transports scalar vorticity, then recovers a streamfunction and an automatically divergence-free velocity field from a Poisson equation.

#### Reynolds number

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

Low Reynolds number means stronger viscous diffusion. Raising it thins the wall-shear layer and concentrates recirculation.

### Common difficulties

#### A transient curve is not a steady benchmark

**Typical misconception** A live curve near the Ghia markers proves that the grid has converged.

**Better mental model** The Ghia markers are steady results from a finer grid, while the live curve is still evolving. Separation among the three grids shows same-time resolution sensitivity, not a formal steady grid-convergence study.

#### Color shows rotation, not speed

**Typical misconception** The deepest blue region must be moving fastest.

**Better mental model** Vorticity measures local rotation and shear, while speed is $\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 Ghia Reynolds number 100, reset the 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 remain at the same nondimensional time. Their separation reflects spatial discretization, but error against the steady reference still includes transience.

3. 03

   #### Compare transport methods

   At Reynolds number 400, switch semi-Lagrangian transport off and compare equal step counts with the first-order upwind result.

   **What to observe:** The two low-order methods have different numerical diffusion, so their wall layer, residual path, and centerline error do not coincide.

Physical conclusion

One moving boundary can continuously generate vorticity, while viscous diffusion and nonlinear advection organize a sealed region into circulation across multiple scales.

Conceptual inspiration: [FluidMotion](http://www.bugman123.com/FluidMotion/index.html). Original simulations and graphics; the model limits are described above.

Fields & matter · Starter path

## From a field to an electron microscope

Read a field, steer a charge, give an electron a wavelength, then use it to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
