## 2 Materials and Methods
### Lattice Boltzmann  
The LBM is a numerical method that uses a mesoscopic approach to describe fluid dynamics with complex boundary conditions such as geometry in porous media. It has been used extensively to characterize the transport mechanism in porous media, and has several advantages including having a simple, efficient algorithm in parallel systems suitable for overcoming complex geometries and boundary conditions [18]. In addition, it is a powerful technique for computational modeling of a wide variety of complex fluid flow problems, including single-phase [19; 20] and multi-phase flows in complex geometries [21]. This method naturally accommodates various boundary conditions and can simulate solute transport and solve advection-dispersion equations [22]. Figure 3 shows the schematic of the 2-D Lattice Boltzmann method. The Lattice Boltzmann method employs a particle movement scheme with discrete velocities represented as DnQm, where Dn corresponds to the dimension (n) and Qm denotes the direction of particle movement (m). One widely utilized model is D2Q9 for 2-D simulations, featuring 9 directions of particle movement. This research utilizes the D2Q9 model for Lattice Boltzmann simulation. While higher DnQm values enhance simulation quality, they also increase computational complexity and time requirements, demanding higher computer performance, but the use of such models to improve simulation accuracy has been supported [23]. Equation (1) is the form of the generalized Lattice Boltzmann Equation. \[f_{i}(\mathbf{x}+\mathbf{c}_{i}\Delta t,t+\Delta t)=f_{i}(\mathbf{x},t)+\Omega_{i}(f) \tag{1}\]  
where \(f\) represent the distibution function, while \(f_{i}\) is the specific distribution function represents the density values moving in the \(i\)-th direction with velocity \(\mathbf{c}_{i}\) towards its nearest point,  
Figure 3: Discrete velocity in D2Q9 model scheme. \(x+c_{i}\Delta t\), at time \(t+\Delta t\), \(c_{i}\) is the discrete velocity vector, and the particles also experienced collisions with each other, affected by the collision operator, \(\Omega_{i}(f)\). Using the Bhatnagar-Gross-Krook (BGK) approximation, the calculation of the particle distribution function at each time iteration can be divided into two main steps: the collision step and the streaming step. The collision operator is expressed by Equation (2). \[\Omega_{i}(f)=-\frac{f_{i}-f_{i}^{eq}}{\tau}\Delta t \tag{2}\]  
where \(f_{i}^{eq}\) is the equilibrium distribution function and \(\tau\) is relaxation time. The distribution function that changes due to the collision operator will then be streamed to its nearest point. The equilibrium distribution function is expressed by Equation (3):  
\[f_{i}^{eq}(\mathbf{x},t)=w_{i}\rho\bigg{(}1+\frac{\mathbf{u}\cdot\mathbf{c}_{ i}}{c_{s}^{2}}+\frac{(\mathbf{u}\cdot\mathbf{c}_{i})^{2}}{2c_{s}^{4}}-\frac{ \mathbf{u}\cdot\mathbf{u}}{2c_{s}^{2}}\bigg{)} \tag{3}\]  
where \(c_{s}\) is the lattice speed of sound, \(u\) is the macroscopic velocity, \(c_{i}\) is the discrete velocity vector, \(\rho\) is the density, and \(w_{i}\) is the velocity direction weight for the D2Q9 lattice model. The weight factors for each speed link, as shown in Figure 3, are expressed in Table 1.  
The macroscopic values such as density, \(\rho\), and fluid momentum, \(\rho u\), are derived by summing the distribution functions, as shown in Equation (4). \[\rho=\sum_{i}f_{i} \tag{4}\] \[\rho u=\sum_{i}c_{i}f_{i}\]  
The value of pressure \(P\) is affected by \(c_{s}\) and \(\rho\), and the relaxation time, \(\tau\), is affected by \(c_{s}\) and the kinematic viscosity, \(v\), defined by Equations (5) and (6). \[c_{s}^{2}=\frac{1}{3}\frac{\Delta x^{2}}{\Delta t^{2}} \tag{5}\] \[P=c_{s}^{2}\rho\]  
\[\tau=\frac{\Delta t}{2}+\frac{v}{c_{s}^{2}} \tag{6}\]  
The simulation involved streaming and collision steps, with collisions further categorized into single relaxation time (SRT) models. The widely adopted collision model is the Bhatnagar-Gross-Krook (BGK) approach, characterized by a SRT.