# Simulation of Lid-Driven Cavity Flow with Internal Circular Obstacles
## 2 Numerical Method  
### Governing Equation  
In this study, the shape of a cavity considered is a square of size \(1\times 1\) (aspect ratio \(K=1\)), which includes three non-moving no-slip walls and a moving wall (\(U=0.1\)) at the top lid having a uniform horizontal velocity. In order to observe the flow instability in the calculation, which was our main concern in this study, \(Re\) values ranging from 100 to 5000 were considered. In order to calculate the cavity flow, the Lattice Boltzmann equation (LBE) was adopted in this study.  
The LBE with the BGK collision operator is given as follows:  
\[f_{i}(\mathbf{x}+\mathbf{c}_{i}\triangle t,t+\triangle t)-f_{i}(\mathbf{x},t) =-\frac{1}{\tau}(f_{i}(\mathbf{x},t)-f_{i}^{eq}(\mathbf{x},t)) \tag{1}\]where \(f_{i}(\mathbf{x},t)\) and \(f_{i}^{eq}(\mathbf{x},t)\) are the discrete distribution function and its equilibrium state, respectively, which form the nine-point integer D2Q9 lattice shown in Figure 1. In addition, \(\mathbf{x}\) is the spatial vector, \(\mathbf{c_{i}}\) is the discrete velocity in the \(i\)th direction, \(\mathbf{i}\) is the moving index of a particular particle, and \(\tau\) is the SRT that manages the rate of distribution function approaching the equilibrium state.  
The equilibrium distribution function can be presented as follows:  
\[f_{i}^{eq}=\rho\mathbf{w_{i}}\left[1+3\mathbf{c_{i}}\cdot\mathbf{u}+\frac{9}{ 2}(\mathbf{c_{i}}\cdot\mathbf{u})^{2}-\mathbf{u}\cdot\mathbf{u}\right] \tag{2}\]  
In Equation (2), \(\mathbf{w_{i}}\) is the weight factor, \(\mathbf{u}\) is the macroscopic velocity, \(\rho\) is the density, and \(p\) is the pressure, which can be obtained using the following equations:  
\[\rho=\sum_{i}f_{i} \tag{3}\]  
\[\rho\mathbf{u}=\sum_{i}f_{i}\mathbf{c_{i}} \tag{4}\]  
\[p=\rho c_{s}^{2} \tag{5}\]  
where \(c_{s}=\frac{1}{\sqrt{3}}\frac{\triangle x}{\triangle t}\) is the lattice sound speed. The Chapman-Enskog expansion shows that the LBE satisfies the continuity and momentum equations. The implementation of the controlling equation can be divided into the collision process and streaming process as follows:  
\[\text{Collision process}:\;\tilde{f}_{i}(\mathbf{x},t)=f_{i}(\mathbf{x},t)- \frac{1}{\tau}(f_{i}(\mathbf{x},t)-f_{i}^{eq}(\mathbf{x},t)) \tag{6}\]  
\[\text{Streaming process}:\;f_{i}(\mathbf{x}+\mathbf{c_{i}}\triangle t,t+ \triangle t)=\tilde{f}_{i}(\mathbf{x},t) \tag{7}\]  
In Equations (6) and (7), \(\overline{f_{i}}\) indicates the post-collision distribution function. In LBM, the relaxation time should be related to the viscosity of the fluid through the Chapman-Enskog expansion in such a manner that the microscopic variables computed from the LBM can satisfy the Navier-Stokes equation with second-order accuracy ([PERSON] et al. [8]). The relaxation time \(\tau\) depends on several variables--the fluid kinematic viscosity \(\
u\), the lattice spacing \(\triangle x\), the time step \(\triangle t\), and the density of the fluid \(\rho\), as follows:  
\[\tau=\frac{1}{2}+\frac{\
u}{\rho\triangle tc_{s}^{2}} \tag{8}\]  
where the lattice spacing \(\triangle x\) and time step \(\triangle t\) are set to a unit. In the LBM, there are several lattice models that can be used for the simulation. In the case of a two-dimension domain, the possible directions (i.e., \(c_{i}\)) in which the particles move would comprise nine different nodes, including the original node (i.e., 0) (D2Q9 model), as shown in Figure 1. When a particle moves and contacts the  
Figure 1: Schematic of the D2Q9 lattice model.  
no-slip wall, it then bounces back in the oncoming direction while retaining its own speed, as shown in Figure 2.  
In addition, \(\mathbf{w}_{i}\) and \(\mathbf{c_{i}}\) in the D2Q9 lattice are represented as follows:  
\[\mathbf{w_{i}}=\begin{cases}4/9&i=0,\\ 1/9&i=1,2,3,4,\\ 1/36&i=5,6,7,8\end{cases} \tag{9}\]  
\[\mathbf{c_{i}}=\begin{cases}0&i=0,\\ c(\cos(\frac{(i-1)\pi}{4}),\sin(\frac{(i-1)\pi}{4})&i=1,2,3,4,\\ \sqrt{2}c(\cos(\frac{(i-1)\pi}{4}),\sin(\frac{(i-1)\pi}{4})&i=5,6,7,8\end{cases} \tag{10}\]