where $\rho$, $\eta$, $U$, and $L$ are the fluid density, fluid viscosity, lid speed, and lid length, respectively, and $u$ and $v$ are the non-dimensional components of the fluid velocity in the $x$ and $y$ directions. The time scale $\bar t$ for this problem is defined by the characteristic shear rate according to $\bar t = \frac{L}{U}$ and the inertial pressure scale was chosen, equal to $\bar p = \rho U^2$. The boundary conditions are no-slip and no-flow at the cavity walls and the fluid is initially at rest.
Numerical Scheme:
Following Lee and Leveque (2003),1 a fractional step approach is used to solve the system of equations above, which decomposes the problem into the following steps:
Step 1. Solve the convection equation:
A Roe solver $\textemdash$ i.e., a locally linear, approximate Riemann solver based on the Godunov method $\textemdash$ is employed to evaulate $q = (u,v)$ satisfying:
$$ q_t + \hat A \cdot q_x + \hat B \cdot q_y = 0 . $$
where the Roe matrices $\hat A$ and $\hat B$ are apporoximate Jacobian matrices given by
$$ \hat A = \begin{bmatrix}
2\hat u & 0 \\
\hat v & \hat u \end{bmatrix}, $$
and
$$ \hat B = \begin{bmatrix}
\hat v & \hat u \\
0 & 2 \hat v \end{bmatrix}. $$
Here, $\hat u$ and $\hat v$ are Roe averages (in this case, they are linear interpolations of cell-centered velocities) defined at the edge of each grid cell. For example, the Roe averages used to evaluate the matrix $A$ are given by
Dimensional splitting via the donor cell upwind method (DCU) is used to advanced the cell-centered velocities $Q=(U,V)$ forward in time via sweeps in the x-direction
where $F_{i-\frac{1}{2},j}$ is the numerical flux at the interface between cells $(i,j)$ and $(i-1,j)$ for the 1-dimensional problem in the x-direction and, similarly, $G_{i,j-\frac{1}{2}}$ is the flux at the interface between cells $(i,j)$ and $(i,j-1)$ for the 1D problem in the y-direction. In addition, monotenzied central flux limiters are used to achieve second order accuracy for this step where the solution is smooth.
Note, a transverse Riemann solver (rpt2_cavity_roe.f90) has also been defined for this problem so that the corner-transport upwind method can be used instead of the DCU method if desired.
Step 2. Solve the diffusion equation:
An alternating direction implicit (ADI) method is employed to update the numerical solution for diffusion via
$$ q_t = \frac{1}{Re}(q_{xx} + q_{yy}). $$
Two difference equations are used to advance successive time steps of $\frac{\Delta t}{2}$. The first equation is implict in the x-direction
which is then discretized with Nuemann boundary conditions to produce a system of linear equations, $Ax = b$. However, the matrix $A$ is singular because the equation set has an inifinite number of solutions within an arbitrary reference pressure. Hence, a ficticious source term $C_0 p^{n+1}$ has been added with proportionality constant $C_0$, which is defined on the order of 1e-9 to render the influence of the source negligble, so that $A$ is non-singular.
So far, the solution $\widetilde q$ is not divergence free. In order to satisfy continuity, the vector field $\widetilde q$ is projected into a divergence-free vector field by correcting the result for pressure-driven flow via
Streamlines and pressure distribution for $Re = 1000$ and $CFL \leq 0.9$ using the DCU method on a 71x71 cell grid over the time interval $[0, 40]$
Results_streamlines_DCU_CFL_0_9.mp4
Note, there are significant checkerboard oscillations in pressure. However, the oscillations are less prominent when using the CTU method with $CFL \leq 0.5$, as shown in the following video:
CTU_results_streamlines_CFL_0_5.mp4
Numerical results for the x-component of the velocity along a vertical line through the center of the cavity are compared with those of Ghia et al.5 for $Re = 100, 400,$ and $1000$
References:
L.Lee and R.J.LeVeque, 2003. An immersed interface method for incompressible Navier
Stokes equations. SIAM J. Sci. Comput., 25, 832–856.
Clawpack Development Team (2023), Clawpack Version 5.9.2,
http://www.clawpack.org, doi: 10.5281/zenodo.10076317
R. J. LeVeque, 1997. Wave propagation algorithms for multi-dimensional
hyperbolic systems. J. Comput. Phys. 131, 327–353.
R. J. LeVeque. Finite Volume Methods for Hyperbolic Problems. Cambridge
University Press, Cambridge, UK, 2002.
U. Ghia, K. Ghia, C. Shin, 1982. High-Re solutions for incompressible flow using the Navier–Stokes equations and a multigrid method, J. Comput. Phys. 48, 387