# A Parallel Algorithm Based on Regularized Lattice Boltzmann Method for Multi-Layer Grids
## 2 RLBM Based on Multi-Layer Grids  
### Governing Equation for RLBM  
The advantage of RLBM is that it can improve stability and accuracy without materially increasing computational effort. The idea of the regularized model is to introduce a pre-collision distribution function in front of the collision and streaming. The evolution equation for the RLBM is as follows:  
\[f_{i}(\mathbf{r}+\mathbf{e}_{i}\delta_{t},t+\delta_{t})=(1-\frac{1}{\tau})f_{i}^{1}( \mathbf{r},t)+f_{i}^{eq}(\mathbf{r},t) \tag{1}\]  
where \(f_{i}\) is the distribution function [37] at site \(\mathbf{r}\) and time \(t\), \(f_{i}^{1}\) is the first-order distribution function. \(\delta_{t}\) is the lattice time step. \(\tau\) is the dimensionless relaxation time, which is determined by the fluid viscosity of the fluid. \(\mathbf{e}_{i}\) is the discrete velocity. The distribution function satisfies the following relationship:  
\[f_{i}-f_{i}^{eq}=f_{i}^{\text{neq}} \tag{2}\]  
where \(f_{i}^{eq}\) is the equilibrium distribution function and \(f_{i}^{\text{neq}}\) is the non-equilibrium distribution function. The explicit formula for \(f_{i}^{\text{neq}}\) is in Appendix A. \(f_{i}^{\text{neq}}\) is approximately equal to the \(f_{i}^{1}\). The first-order distribution function \(f_{i}^{1}\) has the following relationship:  
\[f_{i}^{\text{neq}}\approx f_{i}^{1}=\frac{\omega_{i}}{2c_{s}^{4}}\prod_{\mathbf{ \alpha}\beta}^{\text{neq}}Q_{i\alpha\beta} \tag{3}\]  
where \(\prod_{\mathbf{\alpha}\beta}^{\text{neq}}\) is the stress tensor. \(\prod_{\mathbf{\alpha}\beta}^{\text{neq}}\) satisfies the following relationship:  
\[\Pi_{\mathbf{\alpha}\beta}^{\text{neq}}=\Pi_{\mathbf{\alpha}\beta}-\sum_{i}f_{i}^{eq} \mathbf{e}_{i\mathbf{\alpha}}\mathbf{e}_{i\beta} \tag{4}\]  
The equilibrium distribution function \(f_{i}^{eq}\) can be obtained from the following equation:  
\[f_{i}^{eq}=\rho w_{i}\bigg{[}\frac{3}{c_{s}^{2}}\mathbf{e}_{i}\cdot\mathbf{u}+\frac{9 }{2c_{s}^{4}}(\mathbf{e}_{i}\cdot\mathbf{u})^{2}-\frac{3}{2c_{s}^{2}}\mathbf{u}\cdot\mathbf{u} +1\bigg{]} \tag{5}\]  
where \(\rho\) is the macroscopic density, \(c_{s}\) is the lattice sound velocity, \(c_{s}=1/\sqrt{3}\). \(\omega_{i}\) is the weighting factor of the corresponding grid direction, \(\mathbf{u}\) is the macroscopic velocity. As shown in Figure 1, this paper uses the D2Q9 model to solve the two-dimensional problem. The weighting factor \(\omega_{i}\) is represented as follows:  
\[\omega_{i}=\left\{ \begin{array}{ll}4/9,&\quad\quad\quad i=0,\\ 1/9,&\quad\quad i=1,2,3,4,\\ 1/36,&\quad\quad i=5,6,7,8.\end{array} \right. \tag{6}\]  
The discrete velocity \(\mathbf{e}_{i}\) is represented as follows:  
\[\mathbf{e}_{i}= \begin{bmatrix}\mathbf{e}_{0},\mathbf{e}_{1},\dots,\mathbf{e}_{8}\end{bmatrix}  = \begin{bmatrix}0&1&0&-1&0&1&-1&-1&1\\ 0&0&1&0&-1&1&1&-1&-1\end{bmatrix}  \tag{7}\]  
As shown in Figure 2, this paper uses the D3Q19 model to solve the three-dimensional problem. The weighting factor \(\omega_{i}\) is represented as follows:  
\[\omega_{i}=\left\{ \begin{array}{ll}1/3,&i=0,\\ 1/18,&i=1,2,\ldots,6,\\ 1/36,&i=7,8,\ldots,18.\end{array} \right. \tag{8}\]  
The discrete velocity \(\mathbf{e}_{i}\) is represented as follows:  
\[\mathbf{e}_{i}=\left[ \begin{array}{cccccccccccccccccccc}0&1&-1&0&0&0&0&1&-1&1&-1& 1&-1&1&-1&0&0&0&0\\ 0&0&0&1&-1&0&0&1&-1&-1&1&0&0&0&0&1&-1&-1&1\\ 0&0&0&0&0&1&-1&0&0&0&0&1&-1&-1&1&1&-1\end{array} \right] \tag{9}\]  
The symmetric tensor \(Q_{i\alpha\beta}\) is defined as follows:  
\[Q_{i\alpha\beta}=e_{i\alpha}e_{i\beta}-c_{5}^{2}\delta_{\alpha\beta} \tag{10}\]  
In the RLBM model, the momentum flux tensor, the macroscopic velocity and the macroscopic density are given by  
\[\Pi_{\alpha\beta}=\sum_{i=0}f_{i}\mathbf{e}_{i\alpha}e_{i\beta} \tag{11}\]  
\[\rho\mathbf{u}=\sum_{i=1}\mathbf{e}_{i}f_{i}=\sum_{i=1}\mathbf{e}_{i}f_{i}^{eq} \tag{12}\]  
\[\rho=\sum_{i=0}f_{i}=\sum_{i=0}f_{i}^{eq} \tag{13}\]  
The evolution equation consists of two parts:  
Figure 1: (**a**) The D2Q9 velocity discrete model. (**b**) The D2Q9 distribution function model.