Loading the engineShared by all simulations, so the next one opens instantly.
The physics

A square box full of fluid, closed on all sides, with a lid that slides across the top at constant speed. Nothing simpler drives a flow in a closed space, and yet it has boundary layers, a large recirculating vortex, separated eddies in the corners and, at high speed, unsteadiness. That makes it the standard first test for any flow solver: Ghia, Ghia and Shin published reference values in 1982 that codes are still compared against.

What you see

Vorticity in the cavity, 126 by 126 fluid cells: red and blue mark spin of opposite sense. The lid at the top moves to the right and drags the fluid under it, which turns down the right wall, back along the bottom and up the left wall: one big clockwise vortex. Next to the lid sits a thin sheet of strong vorticity; in the bottom corners the flow separates into small eddies turning the other way.

The fluid starts at rest. At 32 lattice steps per frame the flow settles in about 12 seconds at Re = 100, 26 seconds at 400 and close to a minute at 1000.

Equation

The lattice Boltzmann method evolves populations moving along the nine directions of a square lattice, relaxing toward a local equilibrium with relaxation time τ; their moments obey the incompressible Navier-Stokes equations with viscosity ν=(τ−12)/3. Walls reflect populations back the way they came (halfway bounce-back, which puts the wall between two cells). The lid reflects them with extra momentum along its motion (Ladd’s moving bounce-back), so the fluid next to it is dragged at the lid speed U=0.1.

The Reynolds number Re=UL/ν sets the viscosity. At Re = 100 the velocity along the vertical center line matches Ghia’s table within 2% of the lid speed at all seven points tested; its strongest backflow, at 45% of the height, is a fifth of the lid speed. The center of the main vortex lies at (0.560, 0.607) of the box at Re = 400 and at (0.536, 0.567) at Re = 1000, against (0.555, 0.606) and (0.531, 0.563) from Ghia (measured, from the bottom left corner).

Presets

Re = 100: viscous flow. The main vortex sits just above and right of the center, close to the lid; the corner eddies are tiny.

Re = 400: the vortex moves toward the middle of the box and the bottom corner eddies grow.

Re = 1000: the vortex is almost centered, the boundary layers along the walls are thin, and the bottom corner eddies are larger still.

Parameters

Reynolds number Re: 10 to 1000. Applies live: the flow then settles into the new steady state.

Display: vorticity, speed or pressure, with a choice of color map; streamlines can be drawn on top.