# The Application of REV-LBM Double Mesh Local Refinement Algorithm in Porous Media Flow Simulation

Authors: Zhongkun Niu; Zhengming Yang; Yutian Luo; Yapu Zhang; Debin Xia; Taiyi Zheng; Xinli Zhao
Journal: Geofluids
 (2022)

---

## Abstract

REV-scale LBM (representative elementary volume scale lattice Boltzmann method) provides a possible way for the unified microscopic simulation of transscale seepage combined with pore-scale LBM. However, shown by numerical results, when simulated fluid flows in tight porous media with discrete microfractures or dispersed dissolution pore, the nonphysical oscillation phenomenon will occur in the region of relatively greater velocity gradient, due to the insufficient computational node caused by computational capability constraints. And for that reason, the increase in simulation scale under certain computational capability will be restricted. In order to solve this problem, this paper extends the application of the original LBM local refinement algorithm into REV-LBM and corrects the original REV-LBM velocity processing method, such that REV-scale LBM has a more reasonable local refinement algorithm. Through conventional computation example, this paper proves that the local refinement algorithm can maintain well computational accuracy while at least double the time efficiency and could save more than 30% of CPU time in the practical application. This algorithm has a great potential of application in simulating flows in larger size porous media with complex micro-nano structures and can provide a new idea to transscale simulation in porous media.


---

## Body

## 1. Introduction

The computational fluid dynamics (CFD) applied in fluid flow and transportation simulation in porous media includes two types of calculation methods—the conventional N-S equation and the particle solver, including three scale simulation methods: macro continuous media simulation, mesoscopic kinetic simulation, and microscopic molecular dynamics simulation [1]. Among them, the mesoscopic kinetic simulation method based on the mesoscopic kinetic model not only has free constraints in continuity assumptions as the microscopic molecular dynamics simulation does but also maintains the simplicity of the continuous media simulation method which ignores the description of individual molecular motion. Therefore, it is suitable for simulating flow patterns in porous media with micro-nano pore throat structure (e.g., tight sandstone [2, 3], shale [4, 5], fibrous porous media [6], and porous electrode [7]). This simulation method mainly has lattice Boltzmann method (LBM) [8], direct simulation Monte-Carlo (DSMC) [9], dissipative particle dynamics (DPD) [10], etc. Whereas due to the simple and advantageous boundary conditions processing of the LBM method, it is more suitable to simulate flows in complex porous media.The LBM simulation method for flows in porous media includes pore-scale LBM and REV-scale LBM. The pore-scale combined with the numerical model of porous media [11–13] can be used to study the microscopic flow of complex fluid such as multiphase flow, multicomponent fluid flow [14, 15], and non-Newtonian flow and is the popular trend of micro-nano pore-network seepage simulation. However, when the pore-scale LBM simulates the transscale porous media model, which could have the matrix of large-scale multicontinuum representation and discrete microfractures or dispersed dissolution pore, it will be insufficient due to the excessive number of nodes required for calculation. Unlike pore-scale LBM, REV-scale LBM avoids pore-throat detail characterizations and simulates the flow in the porous media which must have a REV’s size firstly. This method not only includes changing the classical well rebound form to fit the partial rebound model of Darcy equation [16] but also includes the resistance model constructed by adding external force term to transform into Stokes or Brinkman function. Among them, the generalized Lattice Boltzmann equation (GLBE) resistance model proposed by Guo and Zhao [17] is used most extensively. By only adjusting the porosity of the calculated grid, GLBE can accommodate all types of porous medium node, including adjusting the porosity and permeability to nearly achieve a blank or structure node which both referred in pore-scale LBM [18]. Thus, GLBE-based REV-scale LBM has good compatibility with pore-scale LBM. By simulating the fluid transportation in micrometer-scale shale containing microfractures, Zhang et al. [19, 20] confirmed that the combined REV-scale LBM and pore-scale LBM can simulate flows in homogeneous porous media, complex heterogeneous porous media, and single-phase flow in porous media with discrete microfractures. Therefore, GLBE-based REV-scale LBM provides an effective simulation method for the unified simulation of transscale seepage in porous media with micro-nano pore-throat structure. However, even so, shown by numerical simulation results, when simulating the seepage problem related to tight porous media with low permeability, the large velocity gradient generated by the wall boundary (near the fixed structure) or the fracture boundary (junction of the matrix-fracture system) will cause nonphysical oscillation in the boundary region when the calculation nodes are insufficient, thus leading to false perceptions of flow field and restricting the simulation size shown as chapter 4.1 in the reference [21]. Usually, the nonphysical oscillations caused by a lack of nodes can be solved by refining blocks or locally refining nodes to increase the nodes in rapidly varied boundary areas, in which the local refinement approach has more practical benefits. The local refinement algorithm applied to LBM was first proposed by Filippova and Hanel (FH algorithm) [22]. After several improvements [23, 24], it was mainly applied to simulate single-phase and multiphase flow [25, 26] or to explore particle transportation law [27], etc. However, the application to REV-scale LBM in simulating fluid seepage in porous media remains blank, and the REV-scale LBM has been used in the tight porous medium contained microfractures or dispersed dissolution pore with no verification of accuracy at the boundary layer having a large velocity gradient [20].In order to make up the gap of the existing local refinement algorithm application and solve the nonphysical oscillation problem in the boundary region caused by insufficient nodes, this paper extends the application of the original local refinement algorithm to REV-LBM and adjusts the equilibrium velocity model of Guo’s REV-LBM to make the local refinement algorithm more suitable for REV-scale LBM. In this way, the local refinement algorithm can ensure the calculation accuracy as much as possible under certain calculation capacity constraints, saving calculation nodes, reducing the time consumption of at least one time to reach the simulated equilibrium condition, and enlarging the simulation size as well as the efficiency of the porous media flow simulation with complex microfractures or dispersed dissolution pore, when combined with pore-scale LBM. Therefore, it can provide a direction for future flow simulation of large size tight porous media and develop a new idea for simulations of transscale flow in porous media.


## 2. Porous Media Flow Simulation by Using REV-LBM with Multigrid Refinement Approach

### 2.1. REV-Scale Lattice Boltzmann Method

In the LBM method, fluid is assumed to be elements with finite discrete velocities distributed along a regular grid; through the collision and migration evolution, simulation of fluid motion is realized. Similar to the traditional LBM model, the REV-scale LBM model of porous media can establish the seepage resistance model by modifying the traditional rebound format to fit the seepage law or adding the external force term.Taking the D2Q9 model [28] LBM as an example, its discrete velocity model is shown in Figure 1.Figure 1
D2Q9 discrete velocity model.The corresponding parameters are shown in Table1.Table 1
The D2Q9 velocity set in explicit form.
i012345678cix∗0+10−10+1−1−1+1ciy∗00+10−1+1+1−1−1ωi4/91/91/91/91/91/361/361/361/36For BGK model or LBM with single relaxation time [29], its specific evolution equation is as follows:Collision:(1)f~ix,t=fix,t+Δtτfieqx,t−fix,t+1−Δt2τFiΔt.Streaming:(2)fix+ciΔt,t+Δt=f~ix,t.Wherein the equilibrium distribution function and the force source term are as follows:(3)fieq=ωiρ1+ciαuαcs2+ciαciβ−cs2δαβuβuα2cs4,(4)Fi=ωiciaFαcs2+ciαciβ−cs2δαβuβFαcs4.Guo realizes the REV-LBM algorithm by adding an appropriate resistance term of porous media. This algorithm integrates porosity into equilibrium state distribution function and force source term to meet the porous media seepage model, i.e.,(5)fieq=ωiρ1+ciαuαcs2+ciαciβ−cs2δαβuβuα2εcs4,(6)Fi=ωiciaFαcs2+ciαciβ−cs2δαβuβFαεcs4.To ensure the computational accuracy, the macroscopic fluid density and macroscopic velocity brought into the equation of equilibrium state areρeq=∑ifi and ρueq=∑ifici+1/2FΔt, respectively. The fluid force in porous media includes the resistance term and the external force term, which is F=−εμ/Ku−λρu2+εG (Where, the first term on the right is the Darcy flow term, the second term is the nonlinear seepage term, and the third term is the external force term. Considering that there are various models of nonlinear seepage terms and external force terms, in this paper, the most universal algorithm is focused on; thus, the most common model is only discussed for Darcy flow to demonstrate the local refinement algorithm of REV-LBM). Since the force model is related to velocity, it is an implicit equation of velocity. Guo’s velocity model treats it as a simple quadratic equation.
(7)ρueq=ρu0+12FueqΔt.When the seepage is classified as Darcy flow without external force term, the equilibrium macroscopic velocity can be simplified asueq=1+1/2εν/KΔt−1u0.To facilitate calculation, all physical quantities are uniformly nondimensionalized, and letΔl∗=Δl/Cl=1, Δt∗=Δt/Ct=1, ρ∗=ρ/Cρ=1, and thus, the equation of REV-LBM is transformed into as follows:Collision:(8)f~i∗x∗,t∗=fi∗x∗,t∗+1τ∗fieq,∗x∗,t∗−fi∗x∗,t∗+1−12τ∗Fi∗.Streaming:(9)fi∗x∗+ci∗,t∗+1=f~i∗x∗,t∗.Equilibrium distribution function:(10)fieq,∗=ωi1+ciα∗uα∗cs∗2+ciα∗ciβ∗−cs∗2δαβuβ∗uα∗2εcs∗4.Force source term:(11)Fi∗=ωiciα∗Fα∗cs∗2+ciα∗ciβ∗−cs∗2δαβuβ∗Fα∗εcs∗4.Force model of porous media:(12)F∗=−εν∗K∗u∗−λ∗u∗2+εG∗.


### 2.2. Multiblock Local Grid Refinement Approach

#### 2.2.1. Parameter Settings

REV-LBM local refinement mesh model is the same as the conventional LBM local refinement mesh model. For double mesh, the local refinement mesh model has two block systems with different block distances. The schematic model is shown in Figure2. The lattice spacing of the coarse block is Δlc, and the boundary nodes that intersect the fine blocks are represented by blue squares. The lattice spacing of the fine block is Δlf, and boundary nodes that intersect the coarse blocks are represented by red circles.Figure 2
Local refinement structure with two blocks.Similar to the conventional LBM local refinement algorithm data processing method, when it denotes the ratio between fine and coarse blocks asnref=Δlc/Δlf to ensure the consistency in the lattice speed of sound between two different block systems, let Δl/Δt=const then:
(13)ΔtcΔtf=ΔlcΔlf=nref.By using the kinematic viscosity of the macroscopic fluid and the porous media’s local permeability that is independent of block size, it can be obtained that:(14)cs2τc∗−12Δtc=cs2τf∗−12Δtf,(15)νc∗Δlc2Δtc=νf∗Δlf2Δtf,(16)Kc∗Δlc2=Kf∗Δlf2.The relation between fine block parameters and coarse block parameters can be obtained as follows:(17)τf∗=nrefτc∗−12+12,(18)νf∗=νc∗nref,(19)Kf∗=nref2Kc∗.After adjusting the basic physical parameters, it can be found that if the REV-LBM local refinement algorithm still uses the macro velocity processing in the equilibrium equation without external force in Guo’s model, then after a single step duration in the coarse block, due touceq,∗=1+1/2ενc∗/Kc∗−1u0∗≠1+1/2ενf∗/Kf∗−nrefu0∗=ufeq,∗, the equilibrium velocities of the same block node on coarse and fine block systems are not matched, and the velocity on the coarse block node is slightly higher than that on the fine block node, making the simulation result of local refinement algorithm to produce unreasonable convex phenomenon in coarse block velocity. The convex velocity marked by blue can be observed in the simulation results in Figure 3. To fix this problem, the second term on the right side of the quadratic equation in the original Equation (7) is converted to the summation term, namely:
(20)ρueq=ρu0+12limn⟶∞∑nFuΔtn.Figure 3
Poiseuille flow solved by local grid refinement method with two different velocity models.Similarly, considering that the flow in porous media is Darcy flow without external force, the equilibrium macroscopic velocity can be expressed as follows:(21)ueq=limn⟶∞1+12ενKΔtn−nu0=exp−12ενKΔtu0.After nondimensionalized, the macroscopic velocity model in the equilibrium equation becomesueq,∗=exp−1/2εν∗/K∗u0∗. After a single step duration in the coarse block, uceq,∗=exp−1/2ενc∗/Kc∗u0∗=exp−nref1/2ενf∗/Kf∗u0∗=ufeq,∗ would satisfy the velocity matching of nodes on coarse and fine block systems. Based on the macroscopic equilibrium velocity expression, the coarse block velocity convex problem caused by the local refinement algorithm simulation due to the original velocity processing equation can be improved to a certain degree. Figure 3 illustrates that the macroscopic equilibrium velocity expression is more scientific. Though certain velocity convex in coarse block zone’s nodes can still be observed, the convex is resulted from different cumulative errors on the fine and coarse blocks with different accuracy, and compared with the original equilibrium state velocity processing model, the modified equilibrium velocity processing model in this paper reduces the original velocity calculation error Err=umodel−uexact/uexact×100% from 1.6% to about 0.8%.


#### 2.2.2. Multigrid Algorithm

To ensure the regular collision, migration, and evolution of the coarse and fine block systems, the nodes on the coarse and fine block need to exchange data. Same as the conventional LBM local refinement algorithm, take distribution functions into considerationfi=fieq+fineq, where fineq≈τ∗ΔtDfi/Dt≈τ∗ΔtDfieq/Dt. Since fi,ceq=fi,feq, fi,fneq=τf∗Δtf/τc∗Δtcfi,cneq=τf∗/τc∗nreffi,cneq. The data exchange method on common points of coarse and fine blocks can thus be obtained.Coarse to fine:(22)fi,f=τf∗τc∗nreffi,c−fieq+fieq.Fine to coarse:(23)fi,c=τc∗nrefτf∗fi,f−fieq+fieq.To avoid the singularity problem occurred inτ∗=1 of FH algorithm, the idea of data exchange before the collision is adopted, which based on the DC algorithm [24]. The specific algorithm flow is shown in Figure 4.Figure 4
Multigrid REV-LBM program flowchart.Among them, the nodes that need spatial interpolation on the fine block boundary adopt the serendipity element as shown in Figure5 for interpolation calculation, that is fi=1/2fi,3+fi,4−fi,1−fi,2+fi,6. Since the interpolation element only depends on known nodes, which means different interpolation nodes are independent of each other. Moreover, the interpolation requirements on the four boundaries can be satisfied by rotation, and the calculation formulas before and after rotation are similar, so the parallel ability of the whole algorithm can be improved.Figure 5
Serendipity element used in spatial interpolation for nodes on the boundary of the fine block.The original REV-LBM algorithm features high parallel computing capability, which mainly focuses on collision and migrations, whereas the local refinement algorithm has multiple parallel parts besides collision and migration parts on different block systems, which also includes the delivery of node values on coarse and fine blocks as well as the calculation of interpolated nodes on fine blocks. Therefore, the local refinement algorithm is capable of turning a single major task assignment into multiple small parallel assignments. Due to the peak performance of a single logical CPU, the local refinement algorithm can take advantage of computational capability for each line by disassembling major assignments under certain computational capability restrictions.


## 2.1. REV-Scale Lattice Boltzmann Method

In the LBM method, fluid is assumed to be elements with finite discrete velocities distributed along a regular grid; through the collision and migration evolution, simulation of fluid motion is realized. Similar to the traditional LBM model, the REV-scale LBM model of porous media can establish the seepage resistance model by modifying the traditional rebound format to fit the seepage law or adding the external force term.Taking the D2Q9 model [28] LBM as an example, its discrete velocity model is shown in Figure 1.Figure 1
D2Q9 discrete velocity model.The corresponding parameters are shown in Table1.Table 1
The D2Q9 velocity set in explicit form.
i012345678cix∗0+10−10+1−1−1+1ciy∗00+10−1+1+1−1−1ωi4/91/91/91/91/91/361/361/361/36For BGK model or LBM with single relaxation time [29], its specific evolution equation is as follows:Collision:(1)f~ix,t=fix,t+Δtτfieqx,t−fix,t+1−Δt2τFiΔt.Streaming:(2)fix+ciΔt,t+Δt=f~ix,t.Wherein the equilibrium distribution function and the force source term are as follows:(3)fieq=ωiρ1+ciαuαcs2+ciαciβ−cs2δαβuβuα2cs4,(4)Fi=ωiciaFαcs2+ciαciβ−cs2δαβuβFαcs4.Guo realizes the REV-LBM algorithm by adding an appropriate resistance term of porous media. This algorithm integrates porosity into equilibrium state distribution function and force source term to meet the porous media seepage model, i.e.,(5)fieq=ωiρ1+ciαuαcs2+ciαciβ−cs2δαβuβuα2εcs4,(6)Fi=ωiciaFαcs2+ciαciβ−cs2δαβuβFαεcs4.To ensure the computational accuracy, the macroscopic fluid density and macroscopic velocity brought into the equation of equilibrium state areρeq=∑ifi and ρueq=∑ifici+1/2FΔt, respectively. The fluid force in porous media includes the resistance term and the external force term, which is F=−εμ/Ku−λρu2+εG (Where, the first term on the right is the Darcy flow term, the second term is the nonlinear seepage term, and the third term is the external force term. Considering that there are various models of nonlinear seepage terms and external force terms, in this paper, the most universal algorithm is focused on; thus, the most common model is only discussed for Darcy flow to demonstrate the local refinement algorithm of REV-LBM). Since the force model is related to velocity, it is an implicit equation of velocity. Guo’s velocity model treats it as a simple quadratic equation.
(7)ρueq=ρu0+12FueqΔt.When the seepage is classified as Darcy flow without external force term, the equilibrium macroscopic velocity can be simplified asueq=1+1/2εν/KΔt−1u0.To facilitate calculation, all physical quantities are uniformly nondimensionalized, and letΔl∗=Δl/Cl=1, Δt∗=Δt/Ct=1, ρ∗=ρ/Cρ=1, and thus, the equation of REV-LBM is transformed into as follows:Collision:(8)f~i∗x∗,t∗=fi∗x∗,t∗+1τ∗fieq,∗x∗,t∗−fi∗x∗,t∗+1−12τ∗Fi∗.Streaming:(9)fi∗x∗+ci∗,t∗+1=f~i∗x∗,t∗.Equilibrium distribution function:(10)fieq,∗=ωi1+ciα∗uα∗cs∗2+ciα∗ciβ∗−cs∗2δαβuβ∗uα∗2εcs∗4.Force source term:(11)Fi∗=ωiciα∗Fα∗cs∗2+ciα∗ciβ∗−cs∗2δαβuβ∗Fα∗εcs∗4.Force model of porous media:(12)F∗=−εν∗K∗u∗−λ∗u∗2+εG∗.


## 2.2. Multiblock Local Grid Refinement Approach

### 2.2.1. Parameter Settings

REV-LBM local refinement mesh model is the same as the conventional LBM local refinement mesh model. For double mesh, the local refinement mesh model has two block systems with different block distances. The schematic model is shown in Figure2. The lattice spacing of the coarse block is Δlc, and the boundary nodes that intersect the fine blocks are represented by blue squares. The lattice spacing of the fine block is Δlf, and boundary nodes that intersect the coarse blocks are represented by red circles.Figure 2
Local refinement structure with two blocks.Similar to the conventional LBM local refinement algorithm data processing method, when it denotes the ratio between fine and coarse blocks asnref=Δlc/Δlf to ensure the consistency in the lattice speed of sound between two different block systems, let Δl/Δt=const then:
(13)ΔtcΔtf=ΔlcΔlf=nref.By using the kinematic viscosity of the macroscopic fluid and the porous media’s local permeability that is independent of block size, it can be obtained that:(14)cs2τc∗−12Δtc=cs2τf∗−12Δtf,(15)νc∗Δlc2Δtc=νf∗Δlf2Δtf,(16)Kc∗Δlc2=Kf∗Δlf2.The relation between fine block parameters and coarse block parameters can be obtained as follows:(17)τf∗=nrefτc∗−12+12,(18)νf∗=νc∗nref,(19)Kf∗=nref2Kc∗.After adjusting the basic physical parameters, it can be found that if the REV-LBM local refinement algorithm still uses the macro velocity processing in the equilibrium equation without external force in Guo’s model, then after a single step duration in the coarse block, due touceq,∗=1+1/2ενc∗/Kc∗−1u0∗≠1+1/2ενf∗/Kf∗−nrefu0∗=ufeq,∗, the equilibrium velocities of the same block node on coarse and fine block systems are not matched, and the velocity on the coarse block node is slightly higher than that on the fine block node, making the simulation result of local refinement algorithm to produce unreasonable convex phenomenon in coarse block velocity. The convex velocity marked by blue can be observed in the simulation results in Figure 3. To fix this problem, the second term on the right side of the quadratic equation in the original Equation (7) is converted to the summation term, namely:
(20)ρueq=ρu0+12limn⟶∞∑nFuΔtn.Figure 3
Poiseuille flow solved by local grid refinement method with two different velocity models.Similarly, considering that the flow in porous media is Darcy flow without external force, the equilibrium macroscopic velocity can be expressed as follows:(21)ueq=limn⟶∞1+12ενKΔtn−nu0=exp−12ενKΔtu0.After nondimensionalized, the macroscopic velocity model in the equilibrium equation becomesueq,∗=exp−1/2εν∗/K∗u0∗. After a single step duration in the coarse block, uceq,∗=exp−1/2ενc∗/Kc∗u0∗=exp−nref1/2ενf∗/Kf∗u0∗=ufeq,∗ would satisfy the velocity matching of nodes on coarse and fine block systems. Based on the macroscopic equilibrium velocity expression, the coarse block velocity convex problem caused by the local refinement algorithm simulation due to the original velocity processing equation can be improved to a certain degree. Figure 3 illustrates that the macroscopic equilibrium velocity expression is more scientific. Though certain velocity convex in coarse block zone’s nodes can still be observed, the convex is resulted from different cumulative errors on the fine and coarse blocks with different accuracy, and compared with the original equilibrium state velocity processing model, the modified equilibrium velocity processing model in this paper reduces the original velocity calculation error Err=umodel−uexact/uexact×100% from 1.6% to about 0.8%.


### 2.2.2. Multigrid Algorithm

To ensure the regular collision, migration, and evolution of the coarse and fine block systems, the nodes on the coarse and fine block need to exchange data. Same as the conventional LBM local refinement algorithm, take distribution functions into considerationfi=fieq+fineq, where fineq≈τ∗ΔtDfi/Dt≈τ∗ΔtDfieq/Dt. Since fi,ceq=fi,feq, fi,fneq=τf∗Δtf/τc∗Δtcfi,cneq=τf∗/τc∗nreffi,cneq. The data exchange method on common points of coarse and fine blocks can thus be obtained.Coarse to fine:(22)fi,f=τf∗τc∗nreffi,c−fieq+fieq.Fine to coarse:(23)fi,c=τc∗nrefτf∗fi,f−fieq+fieq.To avoid the singularity problem occurred inτ∗=1 of FH algorithm, the idea of data exchange before the collision is adopted, which based on the DC algorithm [24]. The specific algorithm flow is shown in Figure 4.Figure 4
Multigrid REV-LBM program flowchart.Among them, the nodes that need spatial interpolation on the fine block boundary adopt the serendipity element as shown in Figure5 for interpolation calculation, that is fi=1/2fi,3+fi,4−fi,1−fi,2+fi,6. Since the interpolation element only depends on known nodes, which means different interpolation nodes are independent of each other. Moreover, the interpolation requirements on the four boundaries can be satisfied by rotation, and the calculation formulas before and after rotation are similar, so the parallel ability of the whole algorithm can be improved.Figure 5
Serendipity element used in spatial interpolation for nodes on the boundary of the fine block.The original REV-LBM algorithm features high parallel computing capability, which mainly focuses on collision and migrations, whereas the local refinement algorithm has multiple parallel parts besides collision and migration parts on different block systems, which also includes the delivery of node values on coarse and fine blocks as well as the calculation of interpolated nodes on fine blocks. Therefore, the local refinement algorithm is capable of turning a single major task assignment into multiple small parallel assignments. Due to the peak performance of a single logical CPU, the local refinement algorithm can take advantage of computational capability for each line by disassembling major assignments under certain computational capability restrictions.


## 2.2.1. Parameter Settings

REV-LBM local refinement mesh model is the same as the conventional LBM local refinement mesh model. For double mesh, the local refinement mesh model has two block systems with different block distances. The schematic model is shown in Figure2. The lattice spacing of the coarse block is Δlc, and the boundary nodes that intersect the fine blocks are represented by blue squares. The lattice spacing of the fine block is Δlf, and boundary nodes that intersect the coarse blocks are represented by red circles.Figure 2
Local refinement structure with two blocks.Similar to the conventional LBM local refinement algorithm data processing method, when it denotes the ratio between fine and coarse blocks asnref=Δlc/Δlf to ensure the consistency in the lattice speed of sound between two different block systems, let Δl/Δt=const then:
(13)ΔtcΔtf=ΔlcΔlf=nref.By using the kinematic viscosity of the macroscopic fluid and the porous media’s local permeability that is independent of block size, it can be obtained that:(14)cs2τc∗−12Δtc=cs2τf∗−12Δtf,(15)νc∗Δlc2Δtc=νf∗Δlf2Δtf,(16)Kc∗Δlc2=Kf∗Δlf2.The relation between fine block parameters and coarse block parameters can be obtained as follows:(17)τf∗=nrefτc∗−12+12,(18)νf∗=νc∗nref,(19)Kf∗=nref2Kc∗.After adjusting the basic physical parameters, it can be found that if the REV-LBM local refinement algorithm still uses the macro velocity processing in the equilibrium equation without external force in Guo’s model, then after a single step duration in the coarse block, due touceq,∗=1+1/2ενc∗/Kc∗−1u0∗≠1+1/2ενf∗/Kf∗−nrefu0∗=ufeq,∗, the equilibrium velocities of the same block node on coarse and fine block systems are not matched, and the velocity on the coarse block node is slightly higher than that on the fine block node, making the simulation result of local refinement algorithm to produce unreasonable convex phenomenon in coarse block velocity. The convex velocity marked by blue can be observed in the simulation results in Figure 3. To fix this problem, the second term on the right side of the quadratic equation in the original Equation (7) is converted to the summation term, namely:
(20)ρueq=ρu0+12limn⟶∞∑nFuΔtn.Figure 3
Poiseuille flow solved by local grid refinement method with two different velocity models.Similarly, considering that the flow in porous media is Darcy flow without external force, the equilibrium macroscopic velocity can be expressed as follows:(21)ueq=limn⟶∞1+12ενKΔtn−nu0=exp−12ενKΔtu0.After nondimensionalized, the macroscopic velocity model in the equilibrium equation becomesueq,∗=exp−1/2εν∗/K∗u0∗. After a single step duration in the coarse block, uceq,∗=exp−1/2ενc∗/Kc∗u0∗=exp−nref1/2ενf∗/Kf∗u0∗=ufeq,∗ would satisfy the velocity matching of nodes on coarse and fine block systems. Based on the macroscopic equilibrium velocity expression, the coarse block velocity convex problem caused by the local refinement algorithm simulation due to the original velocity processing equation can be improved to a certain degree. Figure 3 illustrates that the macroscopic equilibrium velocity expression is more scientific. Though certain velocity convex in coarse block zone’s nodes can still be observed, the convex is resulted from different cumulative errors on the fine and coarse blocks with different accuracy, and compared with the original equilibrium state velocity processing model, the modified equilibrium velocity processing model in this paper reduces the original velocity calculation error Err=umodel−uexact/uexact×100% from 1.6% to about 0.8%.


## 2.2.2. Multigrid Algorithm

To ensure the regular collision, migration, and evolution of the coarse and fine block systems, the nodes on the coarse and fine block need to exchange data. Same as the conventional LBM local refinement algorithm, take distribution functions into considerationfi=fieq+fineq, where fineq≈τ∗ΔtDfi/Dt≈τ∗ΔtDfieq/Dt. Since fi,ceq=fi,feq, fi,fneq=τf∗Δtf/τc∗Δtcfi,cneq=τf∗/τc∗nreffi,cneq. The data exchange method on common points of coarse and fine blocks can thus be obtained.Coarse to fine:(22)fi,f=τf∗τc∗nreffi,c−fieq+fieq.Fine to coarse:(23)fi,c=τc∗nrefτf∗fi,f−fieq+fieq.To avoid the singularity problem occurred inτ∗=1 of FH algorithm, the idea of data exchange before the collision is adopted, which based on the DC algorithm [24]. The specific algorithm flow is shown in Figure 4.Figure 4
Multigrid REV-LBM program flowchart.Among them, the nodes that need spatial interpolation on the fine block boundary adopt the serendipity element as shown in Figure5 for interpolation calculation, that is fi=1/2fi,3+fi,4−fi,1−fi,2+fi,6. Since the interpolation element only depends on known nodes, which means different interpolation nodes are independent of each other. Moreover, the interpolation requirements on the four boundaries can be satisfied by rotation, and the calculation formulas before and after rotation are similar, so the parallel ability of the whole algorithm can be improved.Figure 5
Serendipity element used in spatial interpolation for nodes on the boundary of the fine block.The original REV-LBM algorithm features high parallel computing capability, which mainly focuses on collision and migrations, whereas the local refinement algorithm has multiple parallel parts besides collision and migration parts on different block systems, which also includes the delivery of node values on coarse and fine blocks as well as the calculation of interpolated nodes on fine blocks. Therefore, the local refinement algorithm is capable of turning a single major task assignment into multiple small parallel assignments. Due to the peak performance of a single logical CPU, the local refinement algorithm can take advantage of computational capability for each line by disassembling major assignments under certain computational capability restrictions.


## 3. Numerical Case

### 3.1. Poiseuille Flow in Homogeneous Porous Media

The accuracy and efficiency of the local encryption algorithm were verified by simulating the Poiseuille flow in homogeneous porous media. The model size of the porous media is50μm×16μm, the local permeability is 3.33×10−3μm2, the local porosity is 10%, the fluid viscosity is 1×10−6 m2/s, and the fluid density is 1×103 kg/m3. The fluid is driven by fixed pressure difference at both ends, and the centerline flow rate is always maintained at u∗=1×10−6. Nonequilibrium extrapolation scheme is adopted for the inlet and outlet boundary, and the halfway bounce-back scheme is adopted for the upper and lower walls.The local refinement method of the model block is shown in Figure6, and the parameters of each simulation method are shown in Table 2.Figure 6
Physical model.Table 2
Parameter sets.
Simulation methodBlock sizeRefined region sizeTotal nodes countRelaxation time (∗coarse block/fine block)Coarse100×32—32000.52Refinement-1100×32199×13×283470.52/0.54∗Refinement-2100×32199×23×2123540.52/0.54∗Fine200×64—128000.54The simulation results are shown in Figure7. It can be found that when only coarse blocks are used for simulation, the lack of calculation nodes on the solid wall boundary will cause about 8% abrupt error, while the local refinement algorithm can obviously eliminate the nonphysical oscillation on the boundary caused by the insufficient calculation nodes in a single coarse block system. Besides, although the number of nodes used in the local refinement method of Refinement-1 and Refinement-2 is different, the calculated results of the two methods are similar. Also, either Refinement-1 or Refinement-2 can get results close to fine block accuracy, which shows that as long as the refinement region covers large velocity gradient nodes, the error control of such abrupt velocity nodes can be realized, and the appropriate reduction of the local refinement region will not cause obvious changes in the overall results or cause nonphysical oscillations again.Figure 7
Poiseuille flow solution with different grid settings.In order to fully illustrate the efficiency of the local refinement algorithm, this paper doubled the simulation size with the local refinement block model as shown in Figure6. At this point, the local refinement algorithm will further highlight the advantages of saving nodes and will be more prominent when under constraints of certain computational capability limits; the local refinement algorithm spends a shorter time to obtain a relatively good simulation result. The simulation parameters of each method are as shown in Table 3.Table 3
Parameter sets.
Simulation methodBlock sizeRefined region sizeTotal nodes countRelaxation time (∗coarse block/fine block)Coarse200×64—128000.52Refinement200×64399×13×2231740.52/0.54∗Fine400×128—512000.54OpenMP was adopted for parallel acceleration in the above three simulation methods, and the maximum number of logical CPU cores for parallel programs was set as 8 cores. After repeated running several times, the running time results are shown in Figure8. It can be found that when the same number of time steps t∗=2000 is simulated, the single duration of each local refinement method is smaller than that of the fine block, and the average duration of the local refinement method is 431.101 s, less than that of the fine block 473.182 s, which exemplifies the time advantage of local refinement method. Moreover, the time required by the local refinement method is about 4.5 times that of a single coarse block. This is because, under a single step duration of the coarse block, the local refinement algorithm needs to carry out two node data exchanges between coarse and fine boundary, two collision migrations in the refinement region, and one collision migration in the coarse block region. Combined with the simulation parameters, the computational task load is found out to be about 4 to 5 times that of the coarse block, meaning that the local refinement algorithm has made full use of the computational capacity of a single logical processor. However, the computational task load of the overall refined block is 4 times that of the coarse block, but the time required is about 5.0 times that of the coarse block only, which shows that the overall refined block approach has exceeded the optimal peak of a single logical processor under the computational force constraints. The local refinement algorithm’s ability to make full use of each line’s computational capability by dissembling a major task under certain computational constraints is illustrated. In addition, the local refinement method has a similar relaxation time with coarse block, thus enabling the local refinement method to reach equilibrium faster and obtain about 2 times the calculation efficiency. At the same time shows the local encryption algorithm compared with the overall elaboration grid in the same stability condition by the simulation speed of at least one times, which also shows that the local refinement algorithm improves the simulation speed at least twice as fast as the overall refined block method under the same stability condition.Figure 8
(a) Running time whent∗=2000. (b) The central velocity change with dimensionless time step in different grid settings.
(a)(b)


### 3.2. Flow in Fractured Porous Media

This method can also eliminate the nonphysical oscillation located at fracture boundary (REV-scale LBM is only used for the matrix, but the fracture flow is calculated by pore-scale LBM. The junction of the matrix-fracture system has a large velocity gradient which will lead to the nonphysical oscillation.). The size of porous media model with real fractures, shown as Figure9, is 320μm×160μm. In addition, this model is only contained 28800 nodes which will be cost about twice by means of FEM (finite element method) under the same structure accuracy. And the local permeability of matrix is 3.33×10−3 μm2; the local porosity of matrix is 10%. With the same simulation parameters and settings as the previous case, the simulation result is as follow in Figure 10.Figure 9
Imaginary homogenous porous media model with real microfracture: the black color is the homogenous porous media, while the white color is the microfractures.Figure 10
Velocity distribution colormap: (a) original coarse algorithm result; (b) refinement algorithm result.
(a)(b)From the velocity distribution colormap of the simulation results (Figure10(a)), it can be clearly observed that many discontinuous color speckles appear at the fracture edge, and discontinuous color bands appear at the solid wall boundary, which is due to the numerical oscillation at the fracture edge and solid wall boundary caused by the original single coarse grid algorithm. Compared with Figure 10(a), it can be found that the discontinuous color speckles and color strip disappear in Figure 10(b).As the partial enlarged view of Figure10(a) is shown in Figure 11, it can be discovered that the bright speckles (green circles) appear at a certain distance from the fracture edge, while the dark speckles (red dash circles) are almost close to the fractures edge. This phenomenon is consistent with the previous case (Section 3.1), which shows that the single coarse grid algorithm will cause extremely serious nonphysical oscillation when the velocity gradient is large and will cause great interference to the simulation results of the porous media model. The smooth transition of the velocity distribution near the fractures edge in Figure 10(b) also proves the superiority of the numerical accuracy of the local refinement algorithm. What is more, it could save more than 30% of CPU time in this practical application, which is similar as the previous conventional example mentioned in Section 3.1.Figure 11
The partial enlarged view of shadow region in Figure10(a).


## 3.1. Poiseuille Flow in Homogeneous Porous Media

The accuracy and efficiency of the local encryption algorithm were verified by simulating the Poiseuille flow in homogeneous porous media. The model size of the porous media is50μm×16μm, the local permeability is 3.33×10−3μm2, the local porosity is 10%, the fluid viscosity is 1×10−6 m2/s, and the fluid density is 1×103 kg/m3. The fluid is driven by fixed pressure difference at both ends, and the centerline flow rate is always maintained at u∗=1×10−6. Nonequilibrium extrapolation scheme is adopted for the inlet and outlet boundary, and the halfway bounce-back scheme is adopted for the upper and lower walls.The local refinement method of the model block is shown in Figure6, and the parameters of each simulation method are shown in Table 2.Figure 6
Physical model.Table 2
Parameter sets.
Simulation methodBlock sizeRefined region sizeTotal nodes countRelaxation time (∗coarse block/fine block)Coarse100×32—32000.52Refinement-1100×32199×13×283470.52/0.54∗Refinement-2100×32199×23×2123540.52/0.54∗Fine200×64—128000.54The simulation results are shown in Figure7. It can be found that when only coarse blocks are used for simulation, the lack of calculation nodes on the solid wall boundary will cause about 8% abrupt error, while the local refinement algorithm can obviously eliminate the nonphysical oscillation on the boundary caused by the insufficient calculation nodes in a single coarse block system. Besides, although the number of nodes used in the local refinement method of Refinement-1 and Refinement-2 is different, the calculated results of the two methods are similar. Also, either Refinement-1 or Refinement-2 can get results close to fine block accuracy, which shows that as long as the refinement region covers large velocity gradient nodes, the error control of such abrupt velocity nodes can be realized, and the appropriate reduction of the local refinement region will not cause obvious changes in the overall results or cause nonphysical oscillations again.Figure 7
Poiseuille flow solution with different grid settings.In order to fully illustrate the efficiency of the local refinement algorithm, this paper doubled the simulation size with the local refinement block model as shown in Figure6. At this point, the local refinement algorithm will further highlight the advantages of saving nodes and will be more prominent when under constraints of certain computational capability limits; the local refinement algorithm spends a shorter time to obtain a relatively good simulation result. The simulation parameters of each method are as shown in Table 3.Table 3
Parameter sets.
Simulation methodBlock sizeRefined region sizeTotal nodes countRelaxation time (∗coarse block/fine block)Coarse200×64—128000.52Refinement200×64399×13×2231740.52/0.54∗Fine400×128—512000.54OpenMP was adopted for parallel acceleration in the above three simulation methods, and the maximum number of logical CPU cores for parallel programs was set as 8 cores. After repeated running several times, the running time results are shown in Figure8. It can be found that when the same number of time steps t∗=2000 is simulated, the single duration of each local refinement method is smaller than that of the fine block, and the average duration of the local refinement method is 431.101 s, less than that of the fine block 473.182 s, which exemplifies the time advantage of local refinement method. Moreover, the time required by the local refinement method is about 4.5 times that of a single coarse block. This is because, under a single step duration of the coarse block, the local refinement algorithm needs to carry out two node data exchanges between coarse and fine boundary, two collision migrations in the refinement region, and one collision migration in the coarse block region. Combined with the simulation parameters, the computational task load is found out to be about 4 to 5 times that of the coarse block, meaning that the local refinement algorithm has made full use of the computational capacity of a single logical processor. However, the computational task load of the overall refined block is 4 times that of the coarse block, but the time required is about 5.0 times that of the coarse block only, which shows that the overall refined block approach has exceeded the optimal peak of a single logical processor under the computational force constraints. The local refinement algorithm’s ability to make full use of each line’s computational capability by dissembling a major task under certain computational constraints is illustrated. In addition, the local refinement method has a similar relaxation time with coarse block, thus enabling the local refinement method to reach equilibrium faster and obtain about 2 times the calculation efficiency. At the same time shows the local encryption algorithm compared with the overall elaboration grid in the same stability condition by the simulation speed of at least one times, which also shows that the local refinement algorithm improves the simulation speed at least twice as fast as the overall refined block method under the same stability condition.Figure 8
(a) Running time whent∗=2000. (b) The central velocity change with dimensionless time step in different grid settings.
(a)(b)


## 3.2. Flow in Fractured Porous Media

This method can also eliminate the nonphysical oscillation located at fracture boundary (REV-scale LBM is only used for the matrix, but the fracture flow is calculated by pore-scale LBM. The junction of the matrix-fracture system has a large velocity gradient which will lead to the nonphysical oscillation.). The size of porous media model with real fractures, shown as Figure9, is 320μm×160μm. In addition, this model is only contained 28800 nodes which will be cost about twice by means of FEM (finite element method) under the same structure accuracy. And the local permeability of matrix is 3.33×10−3 μm2; the local porosity of matrix is 10%. With the same simulation parameters and settings as the previous case, the simulation result is as follow in Figure 10.Figure 9
Imaginary homogenous porous media model with real microfracture: the black color is the homogenous porous media, while the white color is the microfractures.Figure 10
Velocity distribution colormap: (a) original coarse algorithm result; (b) refinement algorithm result.
(a)(b)From the velocity distribution colormap of the simulation results (Figure10(a)), it can be clearly observed that many discontinuous color speckles appear at the fracture edge, and discontinuous color bands appear at the solid wall boundary, which is due to the numerical oscillation at the fracture edge and solid wall boundary caused by the original single coarse grid algorithm. Compared with Figure 10(a), it can be found that the discontinuous color speckles and color strip disappear in Figure 10(b).As the partial enlarged view of Figure10(a) is shown in Figure 11, it can be discovered that the bright speckles (green circles) appear at a certain distance from the fracture edge, while the dark speckles (red dash circles) are almost close to the fractures edge. This phenomenon is consistent with the previous case (Section 3.1), which shows that the single coarse grid algorithm will cause extremely serious nonphysical oscillation when the velocity gradient is large and will cause great interference to the simulation results of the porous media model. The smooth transition of the velocity distribution near the fractures edge in Figure 10(b) also proves the superiority of the numerical accuracy of the local refinement algorithm. What is more, it could save more than 30% of CPU time in this practical application, which is similar as the previous conventional example mentioned in Section 3.1.Figure 11
The partial enlarged view of shadow region in Figure10(a).


## 4. Conclusion

In this paper, the existing LBM local refinement algorithm is extended to combine with the REV-scale LBM algorithm, and because of that, REV-scale LBM is more applicable to solve the complex porous media seepage problem independently or with the cooperation of pore-scale LBM. By adjusting the processing of macroscopic velocity in the equilibrium state equation in Guo’s original model, the problem of velocity mismatch on coarse and fine block caused by the application of the original model to the local refinement algorithm is eliminated. The simulation results show that the local refinement algorithm based on REV-scale LBM can achieve high computational accuracy with limited computational capability and less computational time (nearly 9 times error reduction at the boundary layer with only 70% CPU time), which can provide an idea for the flow simulation of transscale porous media with matrix meeting the REV’s size and complex microfractures or dissolution pore structures.



---

*Source: 1082386-2022-03-31.xml*