In fluid dynamics, a lid-driven cavity or driven cavity, is a closed container of viscous fluid set in motion by one of its walls, the lid, sliding in its own plane. The most frequently modeled two-dimensional case is a square with a lid moving at constant speed over three stationary walls. It is one of the most common benchmarks in computational fluid dynamics because its square geometry is simple, various corner singularities are present, and its boundary conditions are unambiguous, only requiring Dirichlet boundary conditions. Together this makes it possible for all kinds of discretization method to simulate the lid-driven cavity and allows for detailed comparison between experiment, theory, and computation.
The sliding lid drives a large primary vortex, with weaker counter-rotating eddies in the lower corners. As the Reynolds number increases, the core of the vortex approaches solid-body rotation. The two corners where the lid meets the stationary walls are singular. The velocity on the boundary is discontinuous there, and the pressure and vorticity become infinite. In two dimensions the flow becomes unsteady through a Hopf bifurcation near Reynolds number 8000 and is chaotic by 22,000. Real cavity flows are three-dimensional, however, with instabilities arising at much lower Reynolds numbers.

The standard problem involves an incompressible Newtonian fluid with kinematic viscosity filling a square of side . The top wall moves in its own plane at constant speed , and the other three walls are at rest. Measuring lengths in units of and velocities in units of gives the dimensionless Navier–Stokes equations where is the velocity, is the pressure, and the Reynolds number is the only dimensionless parameter in the equations.
On the unit square, and , the no-slip condition gives and on the top wall with the lid, and on the other three stationary walls.
In two dimensions, the velocity can be written in terms of a stream function : and the vorticity has a single component :
Taking the curl of the momentum equation eliminates the pressure and gives the vorticity equation The walls are streamlines, so on all four. The normal derivative of vanishes on the stationary walls, and on the lid. Many benchmark solutions use this formulation. With the lid moving in the direction, the primary vortex turns clockwise, and both and are negative at its center.
Kawaguti published the first numerical study in 1961, computing creeping and nonlinear flows at low Reynolds numbers in cavities with depth-to-width ratios of 0.5, 1 and 2. In 1966 Burggraf combined the analysis of a model eddy with numerical solutions for a square cavity. The model showed an inviscid core developing at high Reynolds numbers, as George Batchelor had envisaged. The numerical solutions, presented mainly for Reynolds numbers from 0 to 400, also showed such a core at the higher Reynolds numbers, along with secondary eddies in the bottom corners at all Reynolds numbers. After his study the cavity became a benchmark for Navier–Stokes solvers and a paradigm for vortex dynamics in closed systems. Pan and Acrivos followed in 1967 with work on rectangular cavities, including the stacked eddies of deep cavities and experimental support for the uniform-vorticity core.
In 1982 Ghia, Ghia and Shin used a multigrid method on grids of up to 257 × 257 points to reach Re = 10,000. Botella and Peyret described their paper in 1998 as the most referred-to source of results on the flow. In 1983 Schreiber and Keller combined Newton iteration with Richardson extrapolation and showed that some earlier calculations had produced spurious solutions. Large differences between numerical schemes prompted an experimental program by Koseff and Street, which showed that the real flow is three-dimensional. In 1998 Botella and Peyret reached a new level of accuracy by combining spectral methods with a special treatment of the singular corners.
At very low Reynolds numbers the inertial terms are negligible, and the stream function satisfies the biharmonic equation . This Stokes flow is symmetric about the vertical centerline. A single primary vortex fills most of the square and much smaller eddies occupy both bottom corners, each bounded by a streamline. The problem can also be solved by series expansions in eigenfunctions of the biharmonic equation.
Inertia destroys the reflectional symmetry about the vertical centerline. At Re = 100 the center of the primary vortex moves a little lower and toward the downstream wall, the one the lid moves toward. By Re = 400 it is even lower and back toward the centerline, and as the Reynolds number increases further it moves toward the geometric center of the square. Above Re = 17,500 the primary vortex's location is almost invariant. The magnitude of at the centre grows with the Reynolds number up to about Re = 10,000 and then falls slowly.
The corner eddies grow as well. With the lid moving to the right, they are labelled BL (bottom left, upstream), BR (bottom right, downstream) and TL (top left), with the subscripts on BL and BR counting along each sequence toward the corner. BR1 grows more than BL1 and becomes stronger. A new eddy, TL1, appears next to the upstream wall just below the lid, at about Re = 1200. This is a genuine change in the flow's topology. Being attached to a plane wall, it differs in character from the eddies in the bottom corners.
Finer grids reveal more eddies. Spectral calculations at Re = 1000 resolve a second eddy in each bottom corner. Steady calculations show BR3 by Re = 5000, BL3 by Re = 10,000, and TL2 by Re = 12,500. However, fine grids are required to correctly resolve the secondary and tertiary eddies as BL3 appears at Re = 10,000 on a 601 × 601 grid and at Re = 7500 on a 1025 × 1025 grid.
At large Reynolds numbers thin boundary layers form along the walls, around a core in nearly inviscid motion. According to the Prandtl–Batchelor theorem, a steady two-dimensional flow with closed streamlines has uniform vorticity in such a core. The core then approaches solid-body rotation with circular streamlines, and the velocity profiles along the centerlines become linear across it. The boundary layers determine the value of the uniform vorticity.
The local flows near the corners of the cavity correspond to two classical problems of theoretical fluid dynamics: Taylor scraping flow at the top right corner, and Moffatt eddies at both bottom corners.

At the two top corners the boundary velocity jumps between its value on the lid and zero on the side wall. Close to such a corner viscous forces dominate, and the flow approaches Taylor scraping flow, the Stokes flow in a corner where one plane slides over another. The streamfunction at the corner is then in polar coordinates centered on the corner, where depends only on the angle. The velocity therefore does not depend on , so it has no single value at the corner. The vorticity and pressure diverge there. The solution holds for , and higher-order terms depend on the Reynolds number.
A discontinuous velocity is physically unrealistic. In an experiment a gap between the lid and the side wall is hard to prevent, and it causes pumping and leakage. Also, the low pressure at the corner where the lid moves away from the wall leads to cavitation. Even so, Stokes flow studies that treat the corners in detail found that the effects were confined to their neighborhood, and the singularity plays only a minor role in the overall flow. The singularity also does not prevent a numerical solution from converging in the rest of the domain. Hansen and Kelmanson gave a justification of the idealized boundary conditions in 1994.

At the bottom corners both walls are at rest. In 1964 Keith Moffatt showed that when two plane walls meet at less than a critical angle, any flow sufficiently near the corner must consist of a sequence of eddies of decreasing size and rapidly decreasing intensity, now known as Moffatt eddies. The critical angle between two rigid walls is about 146°. In a right angle, each eddy is about 16 times smaller than the last, and its velocities are about 2000 times weaker. The stream function near these corners behaves like where and are about 3.73 and 1.12, and and are bounded trigonometric functions. This singularity is much weaker than the one at the lid, because only the second derivatives of the pressure and vorticity are unbounded.
The singularities at the boundaries harm the convergence and accuracy of any numerical solution. Spectral methods are especially affected, because their usual rate of convergence is lost and the error spreads across the whole domain. Grid refinement also behaves differently for different quantities. The kinetic energy converges, but the enstrophy and palinstrophy grow without limit as the mesh size goes to zero.
Many calculations ignore the singularities, on the grounds that their effect is local. Others use the known asymptotic form of the solution. In the subtraction method, the leading singular terms are removed analytically and a less singular remainder is computed, which significantly improves grid convergence. Botella et al. obtained their benchmark and stability results this way.
A different approach, regularization, changes the problem itself. The uniform lid speed is replaced by a smooth profile that vanishes at the corners, along with its derivative, such as . The enstrophy and palinstrophy then converge. Shankar and Deshpande called this "the evasion of a genuine issue", since an experiment would normally involve a uniformly moving lid. Rigorous studies of how regularization affects properties such as stability boundaries are still lacking.
Several features make the cavity a convenient test. The geometry needs no complicated meshing, and it is well suited to regular square grids. Only Dirichlet boundary conditions are needed, and there are no inflow or outflow boundaries. The domain stays the same as the Reynolds number increases. Thin shear layers, weak corner eddies, and the singular corners nevertheless make accurate solutions demanding.
The problem has been solved with finite difference, finite volume, finite element, spectral, and lattice Boltzmann methods, in stream-function and primitive-variable formulations. Molecular dynamics and smoothed-particle hydrodynamics have also been used to compute the flow, and Monte Carlo methods have been applied to micro-cavity flows. Textbooks use it to teach and test numerical methods: Kundu et al. give codes for it, and Ferziger and Perić use it at Re = 1000 to compare grids and discretization schemes.
Results are usually compared through the extreme velocities along the two centerlines. Papers also tabulate the velocities along those lines, the vorticity along the lid, the stream function and vorticity at the vortex centers. The stream function at the primary vortex center appears to be a reliable indicator of accuracy, whereas the location of the center is limited by the mesh size and the vorticity there is sensitive to the wall boundary conditions. Global quantities such as the kinetic energy can be compared as well, although the enstrophy and palinstrophy do not converge under grid refinement.

Results from different methods agree closely up to Re = 1000 but differ noticeably above it. Grid requirements are severe. Schreiber and Keller showed that mild grid refinement can appear to converge to what is really a spurious solution. Erturk et al. considered even a 401 × 401 grid under-resolved at Re = 1000 for a second-order scheme.
It is well established that the flow, if restricted to two dimensions, becomes time-dependent through a Hopf bifurcation near Re = 8000. Early work on the square cavity overlooked this, and for a long time it was unclear whether the steady solutions reported at Re = 10,000 were stable. Between 1987 and 1991, oscillations were found in a cavity twice as deep as it is wide and in a square cavity with a regularized lid.
Published values of the critical Reynolds number for the square cavity are scattered, because the thin boundary layers must be modeled very accurately. Linear stability analyses by Poliashenko and Aidun in 1995 and by Fortin et al. in 1997 gave 7763 ± 2% and 7998.5. In 2002 Auteri et al. located the bifurcation between 8017.6 and 8018.8 by bisection, using direct simulations with a spectral method and singularity subtraction, and attributed the difference from Fortin et al. to that study's lack of an adequate treatment of the corners. Bruneau and Saad's range of 8000 to 8050, from 2006, is consistent with this, and Nuriev et al. obtained 8051 in 2016 by extrapolating linear stability results from grids of up to 512 × 512. Coarse grids can be far off though. Peng et al. found about 7400 on a 100 × 100 grid, a low value that Kuhlmann and Romanò attribute to the moderate resolution.
Just above the threshold the flow settles into a periodic oscillation. The velocity, pressure and vorticity throughout the cavity vary with a frequency of about 0.45 in units of , a period of about 2.2 . It has the form of a vortex street that travels around the primary vortex, in the thin shear layer that separates it from the secondary eddies, and seems to arise from the loss of stability of that layer. Reaching this state takes very long simulations: perturbations of the steady flow shrink by a factor of e in about 13 at Re = 1000, but only in about 380 at Re = 8000, and a solution can seem to be steady before it starts to oscillate.
At higher Reynolds numbers the flow becomes more complex, but the details are not settled. A second frequency appears near Re = 10,000, and studies have found a succession of Hopf bifurcations and quasi-periodic and subharmonic flows, with hysteresis. The reported frequencies scatter, and Kuhlmann and Romanò state that no definitive conclusion can be drawn yet. By Re = 22,000 the flow is chaotic. At Re = 100,000, simulations started from different initial conditions evolve to the same statistical state, which is evidence for a chaotic attractor.
Steady solvers can still converge above the threshold: Erturk et al. obtained steady solutions up to Re = 21,000, and Auteri et al. suggested that such solvers may be finding the unstable equilibrium left after the bifurcation. Erturk has argued that strictly two-dimensional stability analyses of this flow have no physical meaning, since the real flow is neither two-dimensional nor steady at high Reynolds numbers. Kuhlmann and Romanò regard the two-dimensional sequence of bifurcations as an interesting route to turbulence.
Genuinely two-dimensional cavity flow cannot be realized experimentally with Shankar and Deshpande calling such flows "almost fictitious".
Koseff and Street studied a cavity of equal depth and width, with a span three times its width, at Reynolds numbers from 1000 to 10,000. The time-averaged flow on the central plane had one main circulation cell and three secondary eddies. The end walls weakened the flow compared with the two-dimensional case, and vortices formed in the corners along them. Longitudinal Taylor–Görtler-like vortices formed near the downstream secondary eddy. Mean velocity profiles from two-dimensional simulations differed significantly from those measured on the symmetry plane. The flow near the downstream eddy was unsteady at higher Reynolds numbers, and it showed some turbulent characteristics at Re = 10,000 but not at 3200. The corner vortices at the end walls strongly influence the size of the downstream eddy.
End walls are not needed for the flow to become three-dimensional. For a square cross-section of infinite span, linear stability analysis gives , for a steady mode of short spanwise wavelength. Experiments in a cavity with a span 10.88 times its width found Taylor–Görtler vortices at Re = 791 ± 15. The vortices are so named because they resemble Görtler vortices, and the mean velocity profile resembles that above a concave wall. This threshold is about ten times lower than that of the two-dimensional Hopf bifurcation, which therefore cannot be observed experimentally.
When the span is comparable with the width, the secondary flow induced by the end walls makes the flow three-dimensional at any Reynolds number. The flow in a cube becomes time-dependent through a subcritical bifurcation at . Kuhlmann and Romanò review these flows in detail.
The depth of the cavity changes the pattern of vortices. In Stokes flow, there is one primary vortex when the depth is at most equal to the width, two when the depth is twice the width, and four when it is five times the width. New primary vortices form by the growth and merger of the corner eddies. In an infinitely deep cavity the vortices are spaced about 1.4 widths apart, and falls by a factor of about 357 from one to the next.
Other variations on the lid-driven cavity exist. With two facing walls moving, the two-dimensional flow can lose its uniqueness. Other cavity shapes besides square have also been studied: these include triangular, trapezoidal, circular and toroidal cavities. A cavity may be buoyancy-driven instead with where differences in wall temperature add buoyancy and give mixed convection and stratified flows. The lid may oscillate, and time-dependent driving can produce chaotic particle paths even in Stokes flow, which makes the cavity a model for studying chaotic mixing. The fluid is incompressible in the classical lid-driven cavity but extensions include compressible, magnetohydrodynamic, non-Newtonian and viscoelastic flows, suspended particles, and flows through porous media. The shear-driven cavity, open to an outer flow rather than closed by a lid, is a distinct but closely related flow.
The flow has industrial relevance. In the short-dwell coater used to produce high-grade paper and photographic film, the structure of the flow in the liquid pond can strongly affect the quality of the coating. Cavity flows are also relevant to melt spinning, and their eddies give insight into drag-reducing riblets and into cavities for mixing polymer composites. Shankar and Deshpande nevertheless considered the problem's overwhelming importance to lie in the basic study of fluid mechanics, since its unambiguous boundary conditions allow detailed comparison between experiment, theory, and computation.