1 Introduction

There are great risks in the exploitation and utilization of coal, which are inseparable from the contact between coal and gas. The research on the adsorption mechanism of coal and mixed gas is of great significance for preventing and avoiding various dangers in the process of coal mining and utilization (Qin et al.2021; Lu et al.2016). In the mining process of coal mines, the most serious risk is the spontaneous combustion of coal (Onifade and Genc 2020), which is attributed to the physical adsorption of oxygen in coal, which makes the coal temperature rise until it causes spontaneous combustion of coal (Zhao et al.2023). Since the study of coal spontaneous combustion, various theories have emerged to explain the cause of coal spontaneous combustion, such as the theory of pyrite induction, the theory of bacteria induction, the theory of phenolic origin, the theory of coal-oxygen recombination, and the theory of pore group action (Wang et al.1999), hydrogen primary action theory (Lopez et al.1998) and free radical action theory (Li 1996), among which most scholars generally agree with the theory of coal-oxygen recombination.

In actual adsorption processes, there is often adsorption between coal porous media and various gases in most cases, rather than just a single gas (Wang et al. 2008). Additionally, CO2, CH4 and N2 in several common gases have little impact on coal oxygen adsorption as they cannot adsorb onto active groups, and only H2O has a relatively significant influence on coal oxygen adsorption (Liu 2018; Wu 2011). Therefore, it is crucial to investigate the influence of H2O on coal oxygen adsorption. Most of the existing related researches are about the adsorption of single gas by coal (Xu et al.2022), the adsorption of CO2/CH4/H2O by coal (Gensterblum et al.2014; Ullah et al. 2022; Li et al. 2023; Liu et al. 2023), or the effect of coal's internal water content on coal spontaneous combustion (Yu et al.2021; Jiang et al.2023), but there is limited research on the impact of external water in the form of water vapor on coal oxygen adsorption. Therefore, it is of great significance to conduct a study on the adsorption of O2/H2O mixed gas by coal to enhance the comprehension of coal spontaneous combustion.

For the study of gas adsorption in porous media, experimental exploration and numerical simulation methods are mostly used. Jia et al. (2019) analyzed the oxygen uptake characteristics and flammability of four different coals by thermogravimetric analyzer (TG), differential scanning calorimeter test (DSC) and X-Ray diffraction test. Yuan et al. (2018) used hydrothermal dehydration (HTD) to dehydrate Ximen lignite to study the behavior and physicochemical properties of coal. Wilson et al. (2020) used gravimetric adsorption method to study the adsorption capacity of carbon dioxide and carbon monoxide by various porous media. These related studies all adopt traditional experimental exploration methods, revealing the relevant mechanism of coal adsorption of gas from different aspects.

However, there are many uncontrollable factors in the experimental process, and the experimental instruments used are demanding and costly. Following closely behind, many scholars gradually adopt numerical simulation methods to study. Pakdel et al. (2022) simulated the adsorption and separation of mixed gas on carbon nitride film by molecular dynamics method. Hong et al. (2020) studied the adsorption of gases such as nitrogen, carbon dioxide and water on carbon nanotubes by Monte Carlo method. Zhou et al. (2016) simulated the process of silica gel adsorption of water vapor by lattice Boltzmann method and revealed the mechanism of gas adsorption process in porous media. Sermoud et al. (2020) discussed and analyzed the adsorption behavior of nanopores by PC-SAFT-QSDFT coupling method. Since molecular simulation method can simulate the adsorption inside particles but can't simulate the adsorption and mass transfer between particles, and LBM method can't calculate the competitive adsorption in mixed gas, Wang et al. (2018) proposed a method of coupling MC and LBM and verified the feasibility of this method.

Therefore, in this study, it was decided to use the method of combining the giant Canonical Monte Carlo method and lattice Boltzmann method to simulate the adsorption of O2/H2O mixture by coal porous medium. Firstly, the MC method is used to simulate and calculate the competitive adsorption process of two gases inside the particles, and the formula of saturated adsorption capacity with pressure is obtained by curve fitting according to the saturated adsorption capacity and the adsorption model of the gas. Then, the LBM method is used to simulate and calculate the adsorption on the surface of coal particles, the convection, diffusion and adsorption between particles, and the diffusion and adsorption within the particles.

2 MC simulation and model

2.1 Building a structural model

The MC simulations in this study were performed in the simulation software Materials Studio (MS), a molecular simulation software developed by BIOVIA company that builds models at the atomic level to simulate the structure and motion of molecules to achieve the physical and chemical properties of the system to be studied (Yan et al. 2021). Due to the variety and complexity of macromolecular structure models of coal, the Hatcher lignite model (Hatcher 1990) is selected here to construct the chemical structure of coal macromolecules, oxygen molecules and water vapor molecules, and then perform geometric optimization, annealing and relaxation treatment in turn, and the processed molecular structure is consistent with the actual molecular structure. Based on the constructed molecular structure, the AC module in MS is used to construct the structure model of coal porous medium, and the structural model after structural optimization is shown in Fig. 1.

Fig. 1
figure 1

Porous structure model of coal

The model is a cubic box containing 20 coal molecules with a density of 1.2 g/cm3 and dimensions of 3.779 × 3.779 × 3.779 nm. The model constructed without structural optimization is quite different from the actual porous media structure. In order to make the model used in subsequent simulations with lower energy and more suitable for the actual porous structure, it is necessary to optimize the structure of the model to obtain a relatively stable structure before it can be used in subsequent adsorption simulations. The structure optimization of the structure model generally includes three steps of geometry optimization, annealing and structure relaxation, and the structure optimization is realized by the Forcite module in MS. Geometry Optimization is selected for the task of geometry optimization, COMPASS force field is used for the force field, Forcefield assigned is selected for the charge, and Ewald and Atom based are used to calculate the electrostatic interaction and van der Waals interaction respectively. Select Anneal for the annealing task, the selection of force field and charge, and the calculation method of electrostatic potential and van der Waals force remain unchanged, set the temperature to 298 K and NVT ensemble, set the molecular dynamics structure relaxation process task to Dynamics, and set the rest of the parameters as above to be consistent.

2.2 Simulation process

The adsorption simulation uses the Sorption module in MS. Firstly, the structural models of the two gases, oxygen and water vapor, which have been optimized in the previous structure, are added to the adsorbate, and the adsorption fugacity is set to 2000 kPa. The selection of force field and charge, the calculation method of electrostatic potential and Van der Waals force are the same as before, the temperature is set to 298 K and NVT ensemble, and then the step size is set to 1 × 107 for adsorption simulation. After the adsorption simulation is completed, information files such as the total energy distribution diagram of the adsorption process, the skeleton diagram with field distribution, saturated adsorption capacity, and adsorption heat can be obtained. Because the number of molecules adsorbed in the model can be directly obtained by calculation when MS software is used for adsorption simulation, it could be converted by the following formula.

$${N}_\text{m}^{*}=1000\frac{{N}_\text{am}}{{S}_\text{n}{M}_\text{s}}$$
(1)

In the formula, \({N}_\text{m}^{*}\) represents the adsorption amount of gas in mmol/g, \({N}_\text{am}\) refers to the number of gas molecules adsorbed, \({S}_\text{n}\) refers to the number of unit cells (\({S}_\text{n}=20\)), \({M}_\text{s}\) refers to the molecular weight of a single unit cell (molecular weight of one coal molecule), if \({S}_\text{n}*{M}_\text{s}\) is taken as a whole, that is, the molecular weight of the adsorbent skeleton, the adsorption amount in units of mmol/g can be obtained through the calculation of the above formula, and \({S}_\text{n}*{M}_\text{s}\) is calculated to be 3890 according to the molecular formula of the lignite porous structure model constructed earlier.

2.3 Adsorption model

The adsorption model used in this study is an extended Langmuir-BET model proposed by Li et al. (2009), which is a binary adsorption model based on the Langmuir model and the BET model. Since the binary adsorption system contains gas L (oxygen) characterized by the working characteristics of Langmuir isotherm and gas B (water vapor) is BET isotherm, assuming that there is no lateral interaction between different species and each gas maintains its own rate constant of single component adsorption and desorption, the adsorbent surface energy is uniform and each molecule occupies an adsorption site, the extended binary LBET isotherm adsorption relationship between gas B and gas L is as follows:

$${N}_\text{m2}=\frac{{M}_\text{B}{K}_\text{B1}{P}_\text{B}}{\left(1-{K}_\text{B2}{P}_\text{B}\right)\left[1-{K}_\text{B2}{P}_\text{B}+{K}_\text{B1}{P}_\text{B}+{K}_\text{L}{P}_\text{L}\left(1-{K}_\text{B2}{P}_\text{B}\right)\right]}$$
(2a)
$${N}_\text{m1}=\frac{{M}_\text{B}{K}_\text{B1}{P}_\text{B}\left(1-{K}_\text{B2}{P}_\text{B}\right)}{1-{K}_\text{B2}{P}_\text{B}+{K}_\text{B1}{P}_\text{B}+{K}_\text{L}{P}_\text{L}\left(1-{K}_\text{B2}{P}_\text{B}\right)}$$
(2b)

In the formula, the \({K}_\text{B1}\), \({K}_\text{B2}\) are the adsorption energy constants of the primary and secondary adsorption sites of gas B (water vapor), the \({K}_\text{L}\) is the adsorption energy constant of gas L, the \({P}_\text{L}\) and \({P}_\text{B}\) are the relative pressures of gas L and gas B, and the \({M}_\text{L}\) and \({M}_\text{B}\) are the surface adsorption sites of gas L and gas B, respectively, also known as the maximum monolayer adsorption capacity. Since one of the main requirements of multicomponent isotherms is that the equation can be reduced to an effective one-component equation, the parameters in the above equation can be obtained by fitting the formula between the saturated adsorption amount and pressure of a single gas, and if gas L or gas B are removed from the above equation, the adsorption equation for the two gases will be as follows:

$${N}_\text{m2}^{*}=\frac{{M}_\text{B}{K}_\text{B1}{P}_\text{B}}{\left(1-{K}_\text{B2}{P}_\text{B}\right)\left(1-{K}_\text{B2}{P}_\text{B}+{K}_\text{B1}{P}_\text{B}\right)}$$
(3a)
$${N}_\text{m1}^{*}=\frac{{M}_\text{L}{K}_\text{L}{P}_\text{L}}{1+{K}_\text{L}{P}_\text{L}}$$
(3b)

3 LBM simulation and model

3.1 Coal porous media structure model

Due to the complexity and high cost of the traditional method of using high-precision instruments to scan the porous medium of coal to reconstruct the pore structure model, and the random four-parameter growth method (Wang and Pan 2007) has the characteristics of high efficiency, simple construction, zero cost, good pore connectivity and ability to characterize the structure morphology of porous media (Yu et al.2020), it was decided to use this method to randomly generate the porous media structure. Set the parameter values of growth kernel probability, growth probability in different directions and porosity according to the need and generate several two-dimensional porous media structures with the characteristics shown in the following Table 1.

Table 1 Structural features of porous media

Among them, S-1 to S-4 are porous media structure models with the same particle size and different porosity, and S-5 to S-8 are porous media structure models with the same porosity and different average particle sizes. The resulting porous structures are all 416×416 lattice sizes, considering that the regional boundary and the flow rate at the entrance and exit may affect the simulation results, and the lattice length is increased by 50 lattice lengths before and after the transverse region and 7 lattice lengths before and after the longitudinal region. Figure 2 shows a schematic diagram of the physical model of LBM simulation, in which the white area represents the pore phase, the black area represents the solid phase (coal medium), and the mixed gas enters the pores through the porous structure from the left for flow, diffusion and adsorption, and then flows out from the right outlet.

Fig. 2
figure 2

Physical model of LBM simulation

3.2 Mathematical model

In the adsorption process of coal on mixed gas, the gas first flows and diffuses in the outer field and then reaches the surface of the coal for diffusion and adsorption. As there are many pores on the coal surface, the gas will enter the inside of the particles through the pores to continue the diffusion and adsorption. The equations governing the fluid field and the concentration field in the outer field can be expressed as:

$$\frac{\partial \rho }{{\partial t}} + \nabla \cdot \left( {\rho {\varvec{u}}} \right) = 0$$
(4)
$$\frac{\partial \left(\rho {\varvec{u}}\right)}{\partial t}+\nabla \bullet \left(\rho {\varvec{u}}{\varvec{u}}\right)=-\nabla p+\nabla \bullet \left(\mu \nabla {\varvec{u}}\right)$$
(5)
$${\partial }_{t}{C}_{1}+\nabla \left({C}_{1}{\varvec{u}}\right)=\nabla \bullet \left({D}_{1}\nabla {C}_{1}\right)$$
(6)
$${\partial }_{t}{C}_{2}+\nabla \left({C}_{2}{\varvec{u}}\right)=\nabla \bullet \left({D}_{2}\nabla {C}_{2}\right)$$
(7)

where u is the velocity vector, ρ is the density, p is the pressure, μ is the dynamic viscosity coefficient, C1 and C2 refer to the concentration of oxygen and water vapor, D1 and D2 refer to the gas diffusion coefficient of oxygen and water vapor respectively. Since there is oxygen and water vapor in the mixed gas, the relevant parameter amount of oxygen in the subsequent calculation is represented by subscript “1”, and the relevant parameter amount of water vapor is represented by subscript “2”.

Assuming that the mixed gas in the simulation is an ideal mixture, the mass-weighted density can be expressed as:

$$\rho ={C}_{1}{M}_{1}+{C}_{2}{M}_{2}$$
(8)

where \({M}_{1}\) and \({M}_{2}\) refer to the molecular weight of oxygen and water vapor, respectively, and the dynamic viscosity in the flow field can be expressed as:

$$\mu ={m}_{1}{\mu }_{1}+{m}_{2}{\mu }_{2}$$
(9)

where \({m}_{1}\) and \({m}_{2}\) are the mass fractions of oxygen and water vapor, respectively, and \({\mu }_{1}\) and \({\mu }_{2}\) are the dynamic viscosities of oxygen and water vapor, respectively.

When the gas reaches the surface of the coal, part of it will be adsorbed on the surface, and the remaining gas will continue to diffuse and adsorb inside the particles through the pores, and the control equation of the adsorption amount is:

$$\frac{\partial {N}_{1}}{\partial t}={D}_{\text{s}1}\left(\frac{{\partial }^{2}{N}_{1}}{\partial {x}^{2}}+\frac{{\partial }^{2}{N}_{1}}{\partial {y}^{2}}\right)$$
(10a)
$$\frac{\partial {N}_{2}}{\partial t}={D}_{\text{s}2}\left(\frac{{\partial }^{2}{N}_{2}}{\partial {x}^{2}}+\frac{{\partial }^{2}{N}_{2}}{\partial {y}^{2}}\right)$$
(10b)

where \({D}_{\text{s}1}\) and \({D}_{\text{s}2}\) are the solid diffusion coefficients in oxygen and water vapor particles, respectively.

The interfacial mass transfer on the outer surface of the sorbent particles can be described by the Langmuir adsorption kinetics, which is given by the following formula:

$${\left.{D}_{1}\frac{\partial {C}_{1}}{\partial {\varvec{n}}}\right|}_{sf-}={k}_{11}{C}_{1}\left({N}_\text{m1}-{N}_{1}\right)-{k}_{-11}{N}_{1}$$
(11a)
$${\left.{D}_{2}\frac{\partial {C}_{2}}{\partial {\varvec{n}}}\right|}_{sf-}={k}_{12}{C}_{2}\left({N}_\text{m2}-{N}_{2}\right)-{k}_{-12}{N}_{2}$$
(11b)

The equation inside the particle is expressed as:

$${\left.\frac{\partial {N}_{1}}{\partial t}\right|}_{sf+}={k}_{11}{C}_{1}\left({N}_{m1}-{N}_{1}\right)-{k}_{-11}{N}_{1}$$
(12a)
$${\left.\frac{\partial {N}_{2}}{\partial t}\right|}_{sf+}={k}_{12}{C}_{2}\left({N}_{m2}-{N}_{2}\right)-{k}_{-12}{N}_{2}$$
(12b)

Among them, \({k}_{11}\) and \({k}_{-11}\) refer to the adsorption rate and desorption rate of oxygen, \({k}_{12}\) and \({k}_{-12}\) refer to the adsorption rate and desorption rate of water vapor, and \({N}_\text{m1}\) and \({N}_\text{m2}\) refer to the saturated adsorption capacity of oxygen and water vapor in mixed adsorption when the competitive adsorption between two gases is considered at the same time, and the saturated adsorption capacity of gas are obtained by MC fitting.

3.3 LBM model

The simulation of fluid flow in the field uses the multiple relaxation time model of the D2Q9 model, and its evolution equations are expressed as:

$${\varvec{f}}\left({{\varvec{r}}}_{i}+\Delta \widehat{t}{{\varvec{e}}}_{i},\widehat{t}+\Delta \widehat{t}\right)-{\varvec{f}}\left({{\varvec{r}}}_{i},\widehat{t}\right)=-{{\varvec{M}}}^{-1}\widehat{{\varvec{S}}}\left[{\varvec{m}}\left({\varvec{r}},\widehat{t}\right)-{{\varvec{m}}}^{eq}\left({\varvec{r}},\widehat{t}\right)\right]$$
(13)

where, \({{\varvec{r}}}_{i}\) refers to the position of the particle, \({{\varvec{e}}}_{i}\) represents the discretized velocity direction, f refers to the column vector of velocity in nine directions, and the velocity distribution function can be converted into velocity moment by matrix M, and the conversion method and matrix M are as follows:

$${\varvec{m}}={\varvec{M}}\bullet {\varvec{f}}$$
(14)
$${\varvec{M}}=\left[\begin{array}{ccccccccc}1& 1& 1& 1& 1& 1& 1& 1& 1\\ -4& -1& -1& -1& -1& 2& 2& 2& 2\\ 4& -2& -2& -2& -2& 1& 1& 1& 1\\ 0& 1& 0& -1& 0& 1& -1& -1& 1\\ 0& -2& 0& 2& 0& 1& -1& -1& 1\\ 0& 0& 1& 0& -1& 1& 1& -1& -1\\ 0& 0& -2& 0& 2& 1& 1& -1& -1\\ 0& 1& -1& 1& -1& 0& 0& 0& 0\\ 0& 0& 0& 0& 0& 1& -1& 1& -1\end{array}\right]$$
(15)

The diagonal collision matrix of the relaxation rate in the evolution equation is expressed by the compact method as:

$$\widehat{{\varvec{S}}}=diag\left(\text{1.0,1.1,1.0,1.0,8}\frac{2\tau -1}{8\tau -1},\text{1.0,8}\frac{2\tau -1}{8\tau -1},\frac{1}{\tau },\frac{1}{\tau }\right)$$
(16)

The relaxation time is calculated by the kinematic viscosity, and the relaxation time, density and velocity are calculated as follows:

$$\tau =3\widehat{\upsilon }+0.5$$
(17)
$$\widehat{\rho }=\sum_{i=0}^{8}{f}_{i}$$
(18)
$$\widehat{{\varvec{u}}}\widehat{\rho }=\sum_{i=0}^{8}{e}_{i}{f}_{i}$$
(19)

The mass transfer simulation adopts the single relaxation time (MRT) model of D2Q5. Compared with the multi-relaxation model, the computational efficiency of this model is higher. The evolution equation of the mass transfer is:

$${\text{g}}_{{i1}}\left({\varvec{r}}+\Delta \widehat{t}{{\varvec{e}}}_{i},\widehat{t}+\Delta \widehat{t}\right)-{\text{g}}_{{i1}}\left({\varvec{r}},\widehat{t}\right)=-\frac{1}{{\tau }_{1}}\left[{\text{g}}_{{i1}}\left({\varvec{r}},\widehat{t}\right)-{\text{g}}_{i1}^{eq}\left({\varvec{r}},\widehat{t}\right)\right]$$
(20a)
$${\text{g}}_{{i2}}\left({\varvec{r}}+\Delta \widehat{t}{{\varvec{e}}}_{i},\widehat{t}+\Delta \widehat{t}\right)-{\text{g}}_{{i2}}\left({\varvec{r}},\widehat{t}\right)=-\frac{1}{{\tau }_{2}}\left[{\text{g}}_{{i1}}\left({\varvec{r}},\widehat{t}\right)-{\text{g}}_{i2}^{eq}\left({\varvec{r}},\widehat{t}\right)\right]$$
(20b)

where \({g}_{i1}\) and \({g}_{i2}\) refer to the concentration distribution functions, and \({\tau }_{1}\) and \({\tau }_{2}\) refer to the relaxation times. The equilibrium distribution function is expressed as:

$${\text{g}}_{i1}^{eq}\left({\varvec{r}},\widehat{t}\right)={\widehat{C}}_{1}{\omega }_{i}\left(1+3{{\varvec{e}}}_{i}\cdot \widehat{{\varvec{u}}}\right)$$
(21a)
$${\text{g}}_{i2}^{eq}\left({\varvec{r}},\widehat{t}\right)={\widehat{C}}_{2}{\omega }_{i}\left(1+3{{\varvec{e}}}_{i}\cdot \widehat{{\varvec{u}}}\right)$$
(21b)

where \({w}_{i}\) is the weight coefficient, when i is 0, the weight coefficient takes 1/3, when i is 1 to 4, the weight coefficient takes 1/6, and the formula for calculating the mass diffusion coefficient is:

$${\widehat{D}}_{1}=\left({\tau }_{1}-0.5\right)/3$$
(22a)
$${\widehat{D}}_{2}=\left({\tau }_{2}-0.5\right)/3$$
(22b)
$${\widehat{D}}_{\text{s}1}=\left({\tau }_{\text{s}1}-0.5\right)/3$$
(23a)
$$\hat{D}_{\text{s}2} = \left( {\tau_{\text{s}2} - 0.5} \right)/3$$
(23b)

The concentration of the adsorbate is

$${\widehat{C}}_{1}=\sum_{i=0}^{4}{g}_{i1}$$
(24a)
$${\widehat{C}}_{2}=\sum_{i=0}^{4}{g}_{i2}$$
(24b)

The dynamic adsorption capacity of the adsorbate can be expressed as:

$${\widehat{N}}_{\left(\widehat{t}\right)1}={\widehat{N}}_{\left(\widehat{t}-1\right)1}+\Delta \widehat{t}\left[{\widehat{k}}_{11}{\widehat{C}}_{1}\left({\widehat{N}}_\text{m1}-{\widehat{N}}_{\left(\widehat{t}-1\right)1}\right)-{\widehat{k}}_{-11}{\widehat{N}}_{\left(\widehat{t}-1\right)1}\right]$$
(25a)
$${\widehat{N}}_{\left(\widehat{t}\right)2}={\widehat{N}}_{\left(\widehat{t}-1\right)2}+\Delta \widehat{t}\left[{\widehat{k}}_{12}{\widehat{C}}_{2}\left({\widehat{N}}_\text{m2}-{\widehat{N}}_{\left(\widehat{t}-1\right)2}\right)-{\widehat{k}}_{-12}{\widehat{N}}_{\left(\widehat{t}-1\right)2}\right]$$
(25b)

Considering that the processing of boundary conditions is crucial to the simulation process, the non-equilibrium extrapolation method with second-order accuracy in time and space proposed by Guo et al. (2002) is selected here, and the method of calculating the unknown concentration distribution function during mass transport is as follows:

$${\text{g}}_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}>0\right)1}=\frac{\left[{\widehat{C}}_{w1}-{\sum }_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}\le 0\right)}{\text{g}}_{{i1}}\right]{w}_{i}}{{\sum }_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}>0\right)}{w}_{i}}$$
(26a)
$${\text{g}}_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}>0\right)2}=\frac{\left[{\widehat{C}}_{w2}-{\sum }_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}\le 0\right)}{\text{g}}_{{i2}}\right]{w}_{i}}{{\sum }_{i\left({{\varvec{e}}}_{i}\bullet {\varvec{n}}>0\right)}{w}_{i}}$$
(26b)

where n refers to the normal direction of the boundary node and \({C}_{w}\) refers to the boundary concentration, where the concentration at the inlet is constant (both gas concentrations are 20.435 mol/m3), the concentration flux assumes an accurate three-point finite difference format, and the expression of the concentration gradient is:

$$\frac{\partial {\widehat{C}}_{w1}}{\partial {\varvec{n}}}=\frac{3{\widehat{C}}_{w1}-4{\widehat{C}}_{\left(j,n+1\right)1}+{\widehat{C}}_{\left(j,n+2\right)1}}{2\Delta n}$$
(27a)
$$\frac{\partial {\widehat{C}}_{w2}}{\partial {\varvec{n}}}=\frac{3{\widehat{C}}_{w2}-4{\widehat{C}}_{\left(j,n+1\right)2}+{\widehat{C}}_{\left(j,n+2\right)2}}{2\Delta n}$$
(27b)

The mass transport performance within the adsorbent particles can be revealed by the transient value of the overall average of the dimensionless adsorption capacity, which \(\eta\) defined as the ratio of the dynamic total adsorption capacity to the saturated adsorption capacity, which is calculated as follows:

$$\eta =\sum_{i}^{416}\sum_{j}^{416}\frac{{\widehat{N}}_{\left(\widehat{t}\right)\left(i,j\right)}}{{\widehat{N}}_{m\left(\widehat{t}\right)\left(i,j\right)}}$$
(28)

where \({\widehat{N}}_{\left(\widehat{t}\right)\left(i,j\right)}\) refers to the total dynamic adsorption at the lattice node (i,j) at the t moment, \({\widehat{N}}_{m\left(\widehat{t}\right)\left(i,j\right)}\) refers to the saturated adsorption amount at the lattice node (i, j) at the t moment, and the effective transfer coefficient characterizes the transport level of the adsorbate in the bulk fluid, this parameter can be directly measured by the simulation of LBM, and the calculation formula can be expressed as

$${D}_\text{eff}/D=\frac{\left({\int }_{0}^{H}\frac{\partial C}{\partial x}dy\right)/H}{\left({C}_\text{in}-{C}_\text{out}\right)/L}$$
(29)

where \({C}_\text{in}\) and \({C}_\text{out}\) respectively represent the concentration of the gas adsorbate at the inlet and outlet, respectively, which can be calculated from the simulation, D refers to the diffusion coefficient of the gas, L and H respectively refer to the width and thickness of the porous medium structure model, respectively, \({D}_\text{eff}\) includes the overall influence of convection, interparticle diffusion and interfacial adsorption reaction on the degree of interparticle transport during the adsorption process, \({D}_\text{eff}/D\) can describe the effective diffusivity and can directly express the diffusion of the fluid in the porous structure.

Permeability is an inherent characteristic of porous media, describing the obstruction of fluid flow in the pore structure by porous morphology, and the physical quantity used to measure the strength of permeability is called permeability. At low Reynolds numbers, the permeability of porous media can be calculated by Darcy's law, defined as:

$$k=-\frac{\overline{u}\mu }{\nabla p }$$
(30)

where \(\overline{u }\) is the average flow rate, \(\mu\) is the dynamic viscosity, \(\nabla p\) is the pressure gradient, and the expression is calculated in lattice units as \(\nabla p=\nabla \rho {{c}_{s}}^{2}\), and the known pressure (\({p}_\text{inlet}>{p}_\text{outlet}\)) is specified at the inlet and outlet during simulation, and periodic boundary conditions are set for the upper and bottom walls.

4 Results and discussion

4.1 MC Fitting results and model validation

To test the feasibility of the model in Monte Carlo simulations, we conducted adsorption simulations at equivalent temperatures but varying pressures, comparing the yielded results to the corresponding experimental data. The simulated oxygen and water vapor adsorption data were compared to the experimental data in Zhou (2022) and Xu et al. (2022), as illustrated in Fig. 3 for conditions of 0–100 kPa and 0–4323 Pa at 30℃. The relative deviation of water vapor adsorption varied from 3.15% to 13.06%, while for oxygen adsorption, it ranged from 1.51% to 11.96%. These findings indicate that utilizing the Monte Carlo method for simulation is feasible.

Fig. 3
figure 3

Predicted data of O2 and H2O adsorption compared with experimental data

The constructed oxygen and water vapor gas molecules were added to the adsorbate column at the same time, and the saturated adsorption capacity of the two gases under different pressures was obtained by setting the temperature of 298 K and the pressure of 0–4000 kPa, respectively, and the adsorption curves shown in Figs. 4 and 5 were obtained by fitting these data points on the basis of Eqs. (3a) and (3b). Obviously, under the same temperature conditions, with the continuous increase of oxygen partial pressure, the oxygen adsorption rate continues to slow down and the adsorption capacity eventually tends to be stable and unchanged, which is in line with the characteristics of monolayer adsorption, while the adsorption rate of water vapor on the right side shows a trend of first decreasing and then increasing with the increase of water vapor partial pressure, which is in line with the characteristics of multi-layer adsorption. By comparing MC simulation results with other scholars' experimental findings, we observe a consistency in the change of adsorption capacity with pressure (Cheng et al. 2021; Liu 2019). These results indicate that the MC model is feasible. The LBM model used in this study has been validated in previous studies (Li et al. 2022).

Fig. 4
figure 4

Oxygen adsorption curve fitting

Fig. 5
figure 5

Water vapor adsorption curve fitting

4.2 Simulations at different porosities

The four porous structures of S-1 to S-4 were used to simulate the adsorption under different porosities, and the relevant data obtained by the simulation were visualized in order to facilitate the subsequent discussion and analysis of the simulation results. Figure 6 shows the concentration distribution contours of oxygen and water vapor in different porosity structures (S-1, S-3), which were obtained at 102 μs. The concentration distribution of both gases decreases in steps from left to right, and the gas diffuses towards the outlet direction over time, indicating that the adsorbate is progressing smoothly in the pores. The concentration diffusion rate of oxygen and water vapor increases with the increase of porosity, but compared with the concentration distribution of the two gases in the same porous structure at the same time step, it is clear that water vapor diffuses faster than oxygen.

Fig. 6
figure 6

Gas concentration distribution map under different porosity

The dimensionless adsorption capacity of the mixed gas in the porous medium of coal with the same particle size and different porosity with time is shown in Figs. 7 and 8, respectively, with the passage of time, the dimensionless adsorption capacity of both gases increases and eventually tends to a stable state, and the saturated adsorption time of both gases decreases with the increase of porosity. Since the mass transfer resistance of intraparticle diffusion and adsorption mainly depends on the particle size, the mass transfer resistance of the two gases in the particle is not much different under the same particle size, the difference is negligible, and increasing the porosity of the porous medium in the case of fixed particle size can enhance the convection of the gas, thereby reducing the resistance between particles to achieve the effect of accelerating the gas adsorption rate. In addition, the time history of dimensionless adsorption capacity also shows that water vapor reaches saturation faster than oxygen adsorption.

Fig. 7
figure 7

Time history diagram of the average adsorption capacity of oxygen

Fig. 8
figure 8

Time history diagram of average water vapor adsorption capacity

As illustrated in Fig. 9, the lattice permeability value is obtained through LBM simulation across varying porosities, alongside determining the effective diffusivity of the two gases within coal's porous structure. With the rise of porosity, both the permeability of porous materials and the effective diffusivity of the two gases indicate an upward trend. This trend is primarily due to reduced fluid and diffusion resistance between particles resulting in the increased spread and diffusion of gas within the porous structure. However, over time, the gas is increasingly adsorbed, eventually approaching a state of equilibrium. As a result, the effective transfer coefficient between non-dimensional particles gradually decreases.

Fig. 9
figure 9

Permeability and effective diffusion coefficient at different porosities

4.3 Simulations under different particle sizes

In order to study the effect of porous structure of different particle sizes on adsorption, S-5, S-6, S-7 and S-8 porous structures with porosity of 0.6 are simulated as the structural model of LBM, as shown in Fig. 10, the concentration distribution of oxygen and water vapor in the mixed gas by the porous structure of different particle sizes at 102μs is obvious, the concentration distribution of the two gases is decreasing from the inlet to the outlet direction and continues to spread to the right with time, it can be seen that the gas is smoothly carried out in the porous structure. As the particle size increases, the concentration diffusion of both gases accelerates, but water vapor diffuses relatively faster than oxygen at the same time.

Fig. 10
figure 10

Gas concentration distribution map under different particle sizes

Figures 11 and 12 display the alteration in the saturated adsorption capacity of oxygen and water vapor in the structure of coal porous media with identical porosity of 0.60, but different particle sizes. Over time, the dimensionless adsorption capacity of both gases increases and ultimately approaches a stable state, while the saturation adsorption time of both gases diminishes with greater particle size. As particle size increases, the interparticle mass transfer resistance decreases while the intraparticle mass transfer resistance increases. However, the decrease in interparticle mass transfer resistance in the outer field is more significant than the increase in intraparticle resistance. Consequently, the saturation adsorption time of gas decreases as particle size increases.

Fig. 11
figure 11

Time history diagram of the average adsorption capacity of oxygen

Fig. 12
figure 12

Time history diagram of the average adsorption capacity of water vapor

Figure 13 displays the diffusion of oxygen and water vapor in porous structures of varying particle sizes. Over time, the diffusion coefficients for both gases decrease, indicating a smooth diffusion process within the porous medium. However, as the particle size of the porous media structure increases, the permeability and effective transfer coefficient of the two gases also increase accordingly. This is primarily caused by a reduction in fluid and diffusion resistance within the pores due to the larger particle size, allowing for improved flow and diffusion of gases.

Fig. 13
figure 13

Permeability and effective diffusion coefficient at different particle sizes

4.4 Simulations at different initial concentrations

In order to study the effect of gas concentration on the adsorption of O2/H2O mixture by coal porous medium, the S-3 structure with porosity of 0.66 and average particle size of 15.13 was used as the porous structure model, and five different initial concentrations in the range of 4.087–53.131 mol/m3 were set to simulate adsorption while keeping the proportion of gas components unchanged, and the time history of gas dimensionless adsorption capacity as shown in Figs. 14 and 15 was obtained. It can be seen from the figure that the initial concentration increase of the gas reduces the time when the adsorption capacity of the two gases reaches the saturation state, that is, the initial concentration increase of the gas accelerates the gas adsorption process and makes the adsorption capacity reach saturation faster.

Fig. 14
figure 14

Effect of initial concentration on oxygen adsorption capacity

Fig. 15
figure 15

Effect of initial concentration on water vapor adsorption

As shown in Fig. 16, it is a trend diagram of the effective diffusion coefficient of the two gases changing with the initial concentration during the process of adsorbing O2/H2O mixed gas on the coal porous medium. As the initial concentration of the mixed gas increases proportionally, the effective diffusion coefficients of oxygen and water vapor both decrease. Diffusion in the pores is hindered, but no matter what value the initial concentration is in the range of 4.087~53.131 mol/m3, the effective diffusion coefficient of oxygen is always greater than that of water vapor. Moreover, an increase in concentration exerts less influence on the effective diffusion coefficient of oxygen. These results indicate that the phenomenon of oxygen molecular aggregation is more pronounced.

Fig. 16
figure 16

Effect of initial concentration on effective diffusion coefficient

5 Conclusions

In this paper, we utilized a four-parameter random growth method to construct a model of the porous medium structure of coal. Subsequently, we applied the Monte Carlo method to compute and fit the saturated competitive adsorption capacity of a mixed gas consisting of O2 and H2O in coal. The Lattice Boltzmann Method (LBM) was applied to simulate the convection, diffusion, and adsorption of gas in a porous structure utilizing the fitting formula. This results in information on gas concentration, adsorption capacity, effective transfer coefficient, and permeability in the mass transfer process. The study's outcomes demonstrate that:

  1. (1)

    When the particle size of the porous structure remains constant, the mass transfer resistance within the particles does not significantly differ, increasing the porosity of the porous structure can enhance the convection between the particles and thereby reduce the mass transfer resistance between the particles. At this time, the diffusion and adsorption of gas are accelerated, and water vapor diffuses faster than oxygen and reaches adsorption saturation earlier.

  2. (2)

    The mass transfer resistance within particles and between them is determined by the particle size of the porous medium. Increasing particle size, while porosity remains constant, results in an increase in mass transfer resistance within particles and a decrease in mass transfer resistance between them. This effect is stronger between particles than within them. Gas flow and diffusion are facilitated in pores, while oxygen and water vapor are adsorbed more rapidly.

  3. (3)

    The final adsorption saturation value obtained from simulations using the same porous structure and a higher initial gas concentration remained relatively unchanged. However, increasing the gas concentration led to a decrease in the time required to reach adsorption saturation, resulting in a decrease in the effective diffusion coefficients of the two gases.

This research will aid in comprehending the gas adsorption traits in coal porous media and the correlation between the two gases during the adsorption process, paving the way for deciphering the impact of diverse variables on spontaneous coal combustion in the adsorption process and devising countermeasures for the same. Based on our research, it is crucial to consider the porosity, particle size, and initial concentration of each gas component in porous media when studying the correlation between porous media and gas adsorption or preventing coal spontaneous combustion. These factors have a significant impact on gas adsorption.