The lid-driven cavity is a popular problem within the field of computational fluid dynamics (CFD) for validating computational methods. While the boundary conditions are relatively simple, the flow features created are quite interesting and complex. The lid-driven cavity consists of a square cavity filled with fluid. At the top boundary, a tangential velocity is applied to drive the fluid flow in the cavity. The remaining three walls are defined as no-slip conditions; that is, the velocity is 0.
Geometric setup
Lx = Ly = 1.0
ν = 0.01 (Re =100)
ρ =1
Ulid =1
dx = dy; 1st set of cases should be done with dx = 0.1.
Second set of cases with dx = 0.05.
Δt = C min (1/4 * Δx^2/y , Δx/umax , Δy/vmax) , with C = 1
ω =1.6 (SOR)
GOVERNING EQUATIONS AND DISCRETIZATION
The following discussion is taken from the paper "The 2D lid-driven cavity problem revisited".
The Navier–Stokes equations
Let Ω = (0,1) × (0, 1) be a 2D square cavity and T > 0 the simulation time, the governing equations of an unsteady incompressible flow are the evolution Navier–Stokes equations written in primitive variables as:
where U = (u, v) and p are, respectively, the velocity and the pressure, Γ1 is the top boundary, Γ0 represents the three other sides and U0 is an initial datum. The boundary condition is chosen so that the primary vortex is positive. Most of the time, the flow is assumed to start from rest and thus U0 = 0.
Time discretization
The system of equation (1) is discretized by means of either a first-order Euler scheme or a second-order Gear scheme. The linear terms are treated implicitly whereas the convection terms are treated explicitly. We denote by Un the approximation of U at time tn = nδt where n belongs to Natural number and δt is the time step. Thus, the Euler semi-discretized system reads
and the Gear semi-discretized system reads
Space discretization
The system of equations (2) and (3) are discretized in space by finite differences on an uniform staggered grid Gh the mesh size of which is h = δx = δy, where δx and δy are the step discretization in each direction. The discrete values of the pressure are located at the center of each cell and those of the velocity field are located at the middle of the sides as shown in figure below
Space descretization staggered cell
The data is validated from U. GHIA, K. N. GHIA, AND C. T. SHIN (1982) "High-Re Solutions for Incompressible Flow Using the Navier-Stokes Equations and a Multigrid Method," JOURNAL OF COMPUTATIONAL PHYSICS 48, 387-411"
Tabulated u-velocity profiles along a VERTICAL line passing through the geometric center of the cavity at various Reynolds numbers.
y_p (y cordinate)=[1.0000 0.9766 0.9688 0.9609 0.9531 0.8516 0.7344 0.6172 0.5000 0.4531 0.2813 0.1719 0.1016 0.0703 0.0625 0.0547 0.0000];
u_re100 (u velocity at Re =100)=[1.0000 0.8412 0.7887 0.7372 0.68717 0.2315 0.0033 -0.1364 -0.2058 -0.2109 -0.1566 -0.1015 -0.0643 -0.04775 -0.0419 -0.0371 0.0000];
Tabulated v-velocity profiles along a horizontal line passing through the geometric center of the cavity at various Reynolds numbers.
x_p(x cordinate)=[1.0000 0.9688 0.9609 0.9531 0.9453 0.9063 0.8594 0.8047 0.5000 0.2344 0.2266 0.1563 0.0938 0.0781 0.0703 0.0625 0.0000];
v_re100 (v velocity at Re =100)=[0.0000 -0.05906 -0.0739 -0.0886 -0.10313 -0.16914 -0.22445 -0.24533 0.05454 0.17527 0.17507 0.16077 0.12317 0.1089 0.1009 0.0923 0.0000];
Kinetic energy at dx = 0.1
Kinetic energy at dx = 0.05
U Velocity comparison at dx = 0.1
U Velocity comparison at dx = 0.05
V Velocity comparison at dx = 0.1
V Velocity comparison at dx = 0.05
Residue at dx = 0.1
Residue at dx = 0.05
u velocity profile at dx = 0.1
u velocity profile at dx = 0.05
v velocity profile for dx = 0.1
V profile for dx = 0.05
Flow profile at dx = 0.1
Flow profile at dx = 0.05
The MATLAB code and animation are available here