1 Introduction

Due to the sustained growth of global energy demand, unconventional shale gas formations have received extensive attention in recent years as a major source of hydrocarbon production (Cheng et al. 2024; Cui et al. 2018; Guo et al. 2016; Liu, et al. 2019). In contrast to conventional formations, shale formations generally develop multiscale pores form nano-scale organic pores to centimeter-scale hydraulic fracture (Wang et al. 2020). In this case, the transport mechanism of shale gas is complex and multiplex, including Darcy flow, slip flow, Knudsen diffusion, Fick diffusion, surface diffusion, etc. (Cao et al. 2017; Zhang et al. 2019). Among these transport mechanisms, the gas diffusion is an important mechanical behavior during shale gas recovery (SGR), which reflects the migration process of shale gas from nanopores to larger pores or fracture networks, and determines the principle of long-term gas production (Kim et al. 2015; Yang et al. 2016; Zhong et al. 2019). Therefore, comprehensively revealing the diffusion process of shale gas is a crucial step in modeling SGR and estimating gas production.

Currently, unipore classical diffusion model (UCDM) is widely used to describe the gas diffusion process in porous media, which thinks the diffusion coefficient is directly proportional to gas concentration difference and has no relationship with diffusion time (Li et al. 2016b, a; Pillalamarry et al. 2011). According to this model, considerable investigations have conducted to model gas migration during SGR. For example, Wu et al. (2016) proposed a gas transport model considering multiple migration mechanisms, and revealed the contribution share for each mechanism. Cai et al. (2019) calculated the apparent permeability for shale gas and analyzed the impact of molecular diffusion and surface diffusion on it. Wei et al. (2018) established a model of gas multiscale flow adopting triple-porosity geological assumption, and obtained the cumulative gas production curves in different pore system of shale reservoir.

Though a number of significant findings about shale gas migration have been publish based on UCDM, however, an accumulating body of research indicated that the UCDM cannot reflect the whole process of gas diffusion in porous media. Li et al. (2016b, a) found that the gas effective diffusivity of coal matrix is in exponential attenuation with diffusion time, and the UCDM may only describe a small period of gas diffusion process. Zhao et al. 2017) presented an experimental technique to obtain the gas diffusion coefficients in coal matrix during certain periods, and the results showed that the UCDM has a low fitting degree with experimental values. The authors stressed the constant gas diffusion coefficient in UCDM is the essential reason for above phenomenon. In addition, based on UCDM, Nie et al. (2001) deduced the relationship between gas diffusion amount and diffusion coefficient:

$${\text{ln}}\left( {1 - \frac{{Q_{t} }}{{Q_{\infty } }}} \right) = - \frac{{\pi ^{2} D}}{{r_{0}^{2} }}\;t + {\text{ln}}\;\frac{{\pi ^{2} }}{6}$$
(1)

where \({Q}_{t}\) is the total diffusion amount at diffusion time \(t\), \({Q}_{\infty }\) is total diffusion amount at the end of diffusion process, \({r}_{0}\) is the particle radius of porous media, \(D\) is gas diffusion coefficient. According to related experimental results (Sun 2020; Yuan et al. 2014), the fitting curves between experimental data of shale gas diffusion and Eq. (1) were depicted in Fig. 1. It can be seen that the correlation coefficients of fitting curves were 0.581 and − 0.129 respectively, indicating the fitting results were relatively poor. In this case, it can be concluded that the diffusion process of shale gas characterized by UCDM has considerable gap with the real situation. Actually, in Fig. 1, the slopes of experimental data generally decrease with diffusion time. This means the diffusion coefficient of shale gas is not a constant during diffusion process, but obviously attenuates with time, which is not in accordance with the conception of UCDM. In summary, UCDM cannot comprehensively model shale gas diffusion during SGR, and the related investigations based on UCDM may be inaccurate.

Fig. 1
figure 1

Experimental data of shale gas diffusion and corresponding fitting curve

Besides UCDM, several models of gas diffusion in porous media have also been proposed in recent years to further reveal the gas diffusion process in shale or coal, such as bidisperse model (Ruckenstein et al. 1971), double exponential model (DEM) (Fletcher et al. 2007), linear driving force model (LDFM) (Fletcher et al. 2007) and Fickian diffusion-relaxation model (FDM) (Staib et al. 2013). However, most of the above models have no clear physical meanings and cannot explain the mechanism of gas diffusion in porous media. To solve the problem, in 2016, Li et al. (2016b, a) proposed a simple time-dependent model of methane diffusion in coal matrix. This model attributes the attenuation of gas diffusion coefficient to the fractal characteristics of coal matrix, which has been applied in a number of investigations. Zhao et al. (2017) and Liu et al. (2019) respectively established time-dependent gas diffusion models based on the momentum conservation theorem. Both the new models can better fit the experimental results compared to UCDM.

All the above three time-dependent models of gas diffusion focus on coal rather than shale, and these models don’t consider the difference in mineral composition of pore wall. In shale matrix, it is widely acknowledged that pores can be classified into two categories based on their substance composition: organic pores and inorganic pores (Yang et al. 2023; Zhang et al. 2020; Wu et al. 2020). In the two types of pores, the gas diffusion mechanism and behavior are quite different (Sun et al. 2017; Wang et al. 2018). Therefore, the gas diffusion models for coal matrix are not applicable to shale matrix, and an effective dynamic model with definite physical meaning for shale gas diffusion in organic and inorganic pores is still deficient.

In this study, a mathematical dynamic model for gas diffusion in shale matrix is firstly proposed based on the momentum conservation theorem, and the time-dependent gas diffusion coefficients of shale organic and inorganic pores are also determined. Then, the proposed model is validated by experimental results under multiple conditions. Finally, adopting the new dynamic diffusion model, the whole process of shale gas diffusion is analyzed from numerical simulation, and the time-dependent characteristic of shale gas diffusion is comprehensively discussed. To display the logic of this paper, a clear research roadmap is provided and shown in Fig. 2.

Fig. 2
figure 2

Research road map of the study

2 Modeling

2.1 Model hypotheses

Based on the investigation of Lowell et al. (2004) though shale pores possess highly irregular shape, they still can be regarded as cylindrical tube in general. Therefore, we assumed the diffusion channel of shale gas is a cylindrical tube with radius R in this study. In addition, the proposed mathematical model also satisfies the following assumptions:

  1. (1)

    The deformation of shale matrix during gas diffusion is neglected

  2. (2)

    The impact of water or vapor on gas diffusion is neglected

  3. (3)

    The temperature and dynamic viscosity of methane remain constant throughout the diffusion process

  4. (4)

    Shale pores are classified into organic pore and inorganic pore. In organic pore, the diffusion mechanism of shale gas includes bulk diffusion and surface diffusion; while in inorganic pore, only the bulk diffusion is considered

  5. (5)

    The gas exchange between organic pores and inorganic pores is neglected

  6. (6)

    The desorption of shale gas is neglected in organic pores.

2.2 Gas diffusion in inorganic pores

2.2.1 Physical model

To comprehensively reveal the mechanism of gas dynamic diffusion in shale matrix, the physical model of gas diffusion in inorganic pores was firstly constructed, which is shown in Fig. 3. Because of the hydrophily of shale inorganic pores, in the physical model, shale gas exists only in free state, and the adsorbed state is ignored (see Fig. 3b).

Fig. 3
figure 3

Physical model for shale gas diffusion in inorganic pores

2.2.2 Kinetic process of free gas diffusion in inorganic pores

The gas diffusion process in shale pores can be considered as the gas migration process as a result of unbalanced force. In the proposed physical model, the force analysis of shale gas in inorganic pores is shown in Fig. 3c, which is the theoretical basis for characterizing the gas dynamic diffusion process and quantitatively obtaining the dynamic diffusion coefficient of shale gas. From Fig. 3c, it can be seen that the free gas in shale inorganic pores is mainly subjected to three forces, which are internal pressure \({p}_{\begin{array}{c}mi\\ \end{array}}\), external pressure \({p}_{\begin{array}{c}fi\\ \end{array}}\) and frictional resistance from pore wall \({F}_{\begin{array}{c}fi\\ \end{array}}\), respectively. Before the shale gas diffusion, the value of \({p}_{\begin{array}{c}mi\\ \end{array}}\) equals to the value of \({p}_{\begin{array}{c}fi\\ \end{array}}\), and the gas exchange between shale matrix and fracture is in equilibrium. While during SGR and diffusion process, the value of \({p}_{\begin{array}{c}fi\\ \end{array}}\) begins to decline first, thus the value of \({p}_{\begin{array}{c}mi\\ \end{array}}\) is higher than the value of \({p}_{\begin{array}{c}fi\\ \end{array}}\). In this case, the pressure difference between \({p}_{\begin{array}{c}mi\\ \end{array}}\) and \({p}_{\begin{array}{c}fi\\ \end{array}}\) can be regarded as the dynamic force of free gas diffusion, which is:

$${F}_{d}=\uppi {{R}_{io}}^{2}\left({p}_{mi}-{p}_{fi}\right)$$
(2)

where \({F}_{d}\) is the dynamic force of free gas caused by pressure difference, and \({R}_{io}\) is the radius of shale inorganic pores. In addition, according to Newton theorem, the frictional resistance between free gas and inorganic pore wall can be expressed as(Lu et al. 2021):

$${F}_{fi}=2\uppi {R}_{io}{L}_{io}{\mu }_{{\text{g}}}\frac{{\text{d}}{v}_{i}}{{\text{d}}r}{|}_{r={R}_{io}}$$
(3)

where \({L}_{io}\) is the length of the inorganic pore, \({\mu }_{{\text{g}}}\) is the dynamic viscosity of free shale gas, \({v}_{i}\) is the diffusion velocity of free gas, and \(r\) is the distance between any point in the inorganic pore and the centerline of the pore.

Assuming that the shale gas is viscous and incompressible, Hagen–Poiseuille equation can be adopted to describe the migration process of shale gas in the cylindrical channel (Mattia and Calabro 2012):

$$\frac{1}{r}\frac{{\text{d}}}{{\text{d}}r}\left(r\frac{{\text{d}}{v}_{i}}{{\text{d}}r}\right)=\frac{1}{{\mu }_{{\text{g}}}}\frac{\partial p}{\partial x}$$
(4)

where \(p\) is gas pressure at any point in the pore, and \(x\) is the coordinate along the gas diffusion direction. By solving the above equation, we can obtain the diffusion velocity of free gas at any point in the inorganic pore:

$${v}_{i}=\frac{{r}^{2}}{4{\mu }_{{\text{g}}}}\frac{\partial p}{\partial x}$$
(5)

Further, the average bulk diffusion velocity of free gas in the inorgainc pore can be calculated by the following equation:

$$\overline{{v }_{i}}=\frac{{{R}_{io}}^{2}}{8{\mu }_{{\text{g}}}}\frac{\partial p}{\partial x}$$
(6)

Substituting Eqs. (3), (5) and (6), the frictional resistance between free gas and inorganic pore wall can be rewritten as:

$${F}_{fi}=8\uppi {L}_{io}{\mu }_{{\text{g}}}\overline{{v }_{i}}$$
(7)

Therefore, the momentum conservation theory for free gas in inorganic pore can be expressed as:

$$\pi {{R}_{io}}^{2}\left({p}_{mi}-{p}_{fi}\right)-8\uppi {L}_{io}{\mu }_{{\text{g}}}\overline{{v }_{i}}=\frac{{\text{d}}\left(m\overline{{v }_{i}}\right)}{{\text{d}}t}$$
(8)

Based on the law of conservation of mass, the following relation can be determained:

$$\frac{dm}{dt}=8\uppi \frac{M{\mu }_{{\text{g}}}}{{R}_{{\text{g}}}T}{L}_{io}^{2}\frac{{\text{d}}\overline{{v }_{i}}}{{\text{d}}t}$$
(9)

where \(m\) is mass of free gas in inorganic pore, \(M\) is molar mass of methane, \({R}_{{\text{g}}}\) is gas constant, and \(T\) is temperature. Substituting Eq. (8) and Eq. (9), we can obtain:

$$\left({p}_{mi}-{p}_{fi}\right)-\frac{8{L}_{io}{\mu }_{{\text{g}}}\overline{{v }_{i}}}{{{R}_{io}}^{2}}={L}_{io}{\rho }_{{\text{g}}}\frac{{\text{d}}\overline{{v }_{i}}}{{\text{d}}t}+\overline{{v }_{i}}\frac{8M{\mu }_{{\text{g}}}}{{R}_{{\text{g}}}T{{R}_{io}}^{2}}{L}_{io}^{2}\frac{{\text{d}}\overline{{v }_{i}}}{{\text{d}}t}$$
(10)

where \({\rho }_{{\text{g}}}\) is density of free shale gas. Solving the Eq. (10), we yeild the evolution of average bulk diffusion velocity of sale gas in inorganic pore with diffusion time:

$$\left(\overline{{v }_{i}}-{\eta }_{1}\right){\gamma }_{1}^{\overline{{v }_{i}}}={C}_{1}{{\text{e}}}^{-{\xi }_{1}t}$$
(11)

Considering the bulk diffusion velocity of sale gas is extremely low, we can reckon that \({\gamma }_{1}^{\overline{{v }_{i}}}\approx 1\) and the Eq. (11) can be simplified as:

$$\overline{{v }_{i}}={\beta }_{1}{{\text{e}}}^{-{\xi }_{1}t}+{\eta }_{1}$$
(12)

where \({\beta }_{1}\) is a constant, \({\xi }_{1}\) and \({\eta }_{1}\) can be expressed as following:

$${\xi }_{1}=\frac{{{R}_{io}}^{2}{\rho }_{{\text{g}}}}{8{\mu }_{{\text{g}}}}+\frac{{{R}_{io}}^{2}\left({p}_{mi}-{p}_{fi}\right)M}{8{\mu }_{{\text{g}}}{R}_{{\text{g}}}T}$$
(13)
$${\eta }_{1}=\frac{{{R}_{io}}^{2}\left({p}_{mi}-{p}_{fi}\right)}{8{\mu }_{{\text{g}}}{L}_{io}}$$
(14)

2.3 Gas diffusion in organic pores

2.3.1 Physical model

To further reveal the mechanism of gas dynamic diffusion in shale matrix, in this section, the physical model for shale gas diffusion in organic pores was conducted (see Fig. 4). Different from shale inorganic pores, shale organic pores generally possess strong hydrophobic. Therefore, in organic pores, both free gas and adsorbed gas exist, and accordingly, diffusion mechanism of shale gas involves bulk diffusion and surface diffusion (see Fig. 4b).

Fig. 4
figure 4

Physical model for shale gas diffusion in organic pores

2.3.2 Kinetic process of free gas diffusion in organic pores

Similar with shale gas diffusion in inorganic pores, the force analysis is also the theoretical basis to model diffusion process of shale gas in organic pores. For free gas, it is mainly subjected to three forces (see Fig. 4c), which are internal pressure \({p}_{mo}\), external pressure \({p}_{\begin{array}{c}fo\\ \end{array}}\) and frictional resistance from adsorbed gas \({F}_{\begin{array}{c}fo\\ \end{array}}\), respectively. It can be seen that the force condition of free gas in organic pores is the same as the free gas in inorganic pores. Therefore, by substituting \({R}_{io}\) with \({R}_{o}-{R}_{a}\), the equations derived in Sect. 2.2.2 can also be used in this section, that is:

$$\overline{{v }_{o}}={\beta }_{2}{{\text{e}}}^{-{\xi }_{2}t}+{\eta }_{2}$$
(14)
$${\xi }_{2}=\frac{{\left({R}_{o}-{R}_{a}\right)}^{2}{\rho }_{{\text{g}}}}{8{\mu }_{{\text{g}}}}+\frac{{\left({R}_{o}-{R}_{a}\right)}^{2}\left({p}_{mo}-{p}_{fo}\right)M}{8{\mu }_{{\text{g}}}{R}_{{\text{g}}}T}$$
(15)
$${\eta }_{1}=\frac{{\left({R}_{o}-{R}_{a}\right)}^{2}\left({p}_{mo}-{p}_{fo}\right)}{8{\mu }_{{\text{g}}}{L}_{o}}$$
(16)

where \(\overline{{v }_{o}}\) is average bulk diffusion velocity of free gas in the orgainc pore, \({\beta }_{2}\) is a constant, \({L}_{o}\) is the length of the organic pore, \({R}_{o}\) is the radius of shale organic pores and \({R}_{a}\) is the thickness of adsorbed shale gas.

2.3.3 Kinetic process of adsorbed gas diffusion in organic pores

Based on Fig. 4c, the adsorbed shale gas is subjected to four forces during surface diffusion, which are internal pressure \({p}_{mo}\), external pressure \({p}_{\begin{array}{c}fo\\ \end{array}}\), friction between free gas and adsorbed gas \({F}_{\begin{array}{c}fo\\ \end{array}}\), and frictional resistance between adsorbed gas and organic pore wall \({F}_{\begin{array}{c}fa\\ \end{array}}\), respectively. It is widely acknowledged that the migration velocity of adsorbed gas in organic pores is lower than that of free gas. Therefore, for adsorbed shale gas, the deriction of \({F}_{\begin{array}{c}fo\\ \end{array}}\) is consistent with the pressure gradient, while the deriction of \({F}_{\begin{array}{c}fa\\ \end{array}}\) is opposite to the pressure gradient. In this condition, the momentum conservation theory for adsorbed gas in organic pore can be given as:

$$\left[\uppi {R}_{{\text{o}}}^{2}-\uppi {\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}\right]\left({p}_{mo}-{p}_{{\text{fo}}}\right)-8\uppi {L}_{o}{\mu }_{{\text{a}}}\overline{{v }_{a}}-{F}_{fa}=\frac{{\text{d}}\left(m\overline{{v }_{a}}\right)}{{\text{d}}t}$$
(18)

where \({\mu }_{{\text{a}}}\) is the dynamic viscosity of adsorbed shale gas, and \(\overline{{v }_{a}}\) is average surface diffusion velocity of adsorbed gas. In addition, according to Newton theorem, the frictional resistance between adsorbed gas and organic pore wall can be written as:

$${F}_{a}=2\uppi {R}_{o}{L}_{o}{\mu }_{{\text{a}}}\frac{{\text{d}}{v}_{a}}{{\text{d}}r}{|}_{r={R}_{o}}$$
(19)

Based on Hagen-Poiseuille equation, the derivative of migration velocity of adsorbed gas along radial direction can be expressed as:

$$\frac{d{v}_{{\text{a}}}}{dr}=\frac{r}{2{\mu }_{{\text{a}}}}\frac{\partial p}{\partial x}$$
(20)

By integrating Eq. (20), we can obtain the average surface diffusion velocity of adsorbed gas:

$${\overline{v} }_{{\text{a}}}=\frac{1}{\uppi {R}_{{\text{o}}}^{2}-\uppi {\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}{\int }_{{R}_{{\text{o}}}-{R}_{{\text{a}}}}^{{R}_{{\text{o}}}}2\uppi r{v}_{{\text{a}}}{\text{d}}r=\frac{{R}_{{\text{o}}}^{2}-{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}{8{\mu }_{{\text{ag}}}}\frac{\partial p}{\partial x}$$
(21)

Substituting Eqs. (18)–(20), we yeilds:

$${F}_{{\text{a}}}=8\pi {L}_{{\text{o}}}{\mu }_{{\text{a}}}{\overline{v} }_{{\text{a}}}\frac{{R}_{{\text{o}}}^{2}}{{R}_{{\text{o}}}^{2}-{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}$$
(22)

Further, the Eq. (18) can be rewritten as:

$$\left[2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right]\left({p}_{mo}-{p}_{{\text{fo}}}\right)-8{L}_{{\text{o}}}{\mu }_{{\text{a}}}{\overline{v} }_{{\text{a}}}\left[\frac{{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}{2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}}\right]=\frac{{\text{d}}\left(m{\overline{v} }_{{\text{a}}}\right)}{\mathrm{\pi d}t}$$
(23)

where:

$$\frac{dm}{dt}=8\uppi \frac{M{\mu }_{{\text{a}}}}{{R}_{{\text{g}}}T}{L}_{o}^{2}\frac{{\text{d}}{\overline{v} }_{{\text{a}}}}{{\text{d}}t}$$
(24)

Substituting Eq. (23) and Eq. (24), the following differential equation can be derived:

$$\frac{\left({p}_{mo}-{p}_{{\text{fo}}}\right)}{{L}_{o}}-\frac{8{\mu }_{{\text{a}}}{\overline{v} }_{{\text{a}}}{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}{{\left(2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right)}^{2}}=\left({\rho }_{{\text{a}}}+{\overline{v} }_{{\text{a}}}\frac{8M{\mu }_{{\text{a}}}}{{R}_{{\text{g}}}T\left[2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right]}{L}_{o}\right)\frac{{\text{d}}{\overline{v} }_{{\text{a}}}}{{\text{d}}t}$$
(25)

where \({\rho }_{{\text{a}}}\) is density of adsorbed shale gas. Solving the Eq. (25), we yeild the evolution of average surface diffusion velocity of sale gas with diffusion time:

$$\left({\overline{v} }_{{\text{a}}}-{\eta }_{3}\right){\gamma }_{3}^{{\overline{v} }_{{\text{a}}}}={\beta }_{3}{{\text{e}}}^{-{\xi }_{3}t}$$
(26)

Similarly, considering the surface diffusion velocity of sale gas is extremely low, we can reckon that \({\gamma }_{3}^{\overline{{v }_{i}}}\approx 1\) and the Eq. (26) can be simplified as:

$${\overline{v} }_{{\text{a}}}={\beta }_{3}{{\text{e}}}^{-{\xi }_{3}t}+{\eta }_{3}$$
(27)

where \({\beta }_{3}\) is a constant, \({\xi }_{3}\) and \({\eta }_{3}\) can be expressed as following:

$${\xi }_{3}=\frac{{\left({2R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right)}^{2}{\rho }_{{\text{a}}}}{8{\mu }_{{\text{a}}}{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}+\frac{{\left(2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right)}^{2}\left({p}_{mo}-{p}_{{\text{fo}}}\right)M}{8{\mu }_{{\text{a}}}{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}{R}_{{\text{g}}}T}$$
(28)
$${\eta }_{3}=\frac{{\left(2{R}_{{\text{o}}}{R}_{{\text{a}}}-{R}_{{\text{a}}}^{2}\right)}^{2}\left({p}_{mo}-{p}_{{\text{fo}}}\right)}{8{\mu }_{{\text{o}}}{L}_{{\text{o}}}{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}}$$
(29)

2.4 Time-dependent diffusion coefficient of shale gas

Based on Fick’s law, the law of conservation of mass for shale gas diffusion can be described as (Yang et al. 2019):

$$\frac{{\text{d}}m}{{\text{d}}t}=-\frac{A}{\varphi }\cdot D\frac{\Delta c}{l}$$
(30)

where \(m\) is gas mass in unit volume of shale matrix, \(\varphi\) is the porosity of shale matix, \(A\) is cross-sectional area of shale pores, \(D\) is diffusion coefficient, and \(\frac{\Delta c}{l}\) is concentration gradient. For free gas in inoeganic pores, Eq. (30) can be written as:

$$8\uppi \frac{M{\mu }_{{\text{g}}}}{{R}_{{\text{g}}}T}{L}_{io}^{2}\frac{{\text{d}}\overline{{v }_{i}}}{{\text{d}}t}=\frac{\pi {{R}_{io}}^{2}}{{\varphi }_{i}}\cdot {D}_{bi}\frac{M\left({p}_{mi}-{p}_{fi}\right)}{{R}_{{\text{g}}}T{L}_{io}}$$
(31)

where \({\varphi }_{i}\) is inorganic porosity, and \({D}_{bi}\) is gas bulk diffuion coefficient in inorganic pores. Substituting Eq. (6), Eq. (12) and Eq. (31), we can yeild:

$${D}_{{\text{bi}}}={{\varphi }_{i}a}_{1}\left(1-\frac{{c}_{1}}{{{\text{e}}}^{-{b}_{1}t}+{c}_{1}}\right)$$
(32)

where \({a}_{1}=2{\xi }_{1}{L}_{io}^{2}\), \({b}_{1}={\eta }_{1}/{\beta }_{1}\), and \({c}_{1}={\xi }_{1}\).

Analyzing Eq. (32), it can be concluded that \({D}_{{\text{bi}}}\) decreases with diffusion time, and when diffuion time \(t=0\), \({D}_{{\text{bi}}0}={{\varphi }_{i}a}_{1}\left[1/\left(1+{c}_{1}\right)\right]\). Therefore, \({D}_{{\text{bi}}0}\) can be defined as initial bulk diffusion coefficient of shale gas in inorganic pores, and \({b}_{1}\) can be defined as attenuation coefficient of \({D}_{{\text{bi}}}\). The higher the value of \({b}_{1}\), the more obvious the \({D}_{{\text{bi}}}\) decreases over diffusion time.

Similarly, for free gas in organic pores, Eq. (30) can be written as:

$$8\uppi \frac{M{\mu }_{{\text{a}}}}{{R}_{{\text{g}}}T}{L}_{o}^{2}\frac{{\text{d}}\overline{{v }_{o}}}{{\text{d}}t}=\frac{\pi {\left({R}_{o}-{R}_{a}\right)}^{2}}{{\varphi }_{o}}\cdot {D}_{b}\frac{M\left({p}_{mo}-{p}_{fo}\right)}{{R}_{{\text{g}}}T{L}_{o}}$$
(33)

where \({\varphi }_{o}\) is organic porosity, \({D}_{b}\) is gas bulk diffuion coefficient in organic pores. Substituting Eq. (6), Eq. (15) and Eq. (33), we can yeild:

$${D}_{{\text{b}}}={{\varphi }_{o}a}_{2}\left(1-\frac{{c}_{2}}{{{\text{e}}}^{-{b}_{2}t}+{c}_{2}}\right)$$
(34)

where \({a}_{2}=2{\xi }_{2}{L}_{o}^{2}\), \({b}_{2}={\eta }_{2}/{\beta }_{2}\), \({c}_{2}={\xi }_{2}\).

Analyzing Eq. (34), it can be concluded that \({D}_{{\text{b}}}\) decreases with diffusion time, and when diffuion time \(t=0\), \({D}_{{\text{b}}0}={{\varphi }_{o}a}_{2}\left[1/\left(1+{c}_{2}\right)\right]\). Therefore,\({D}_{{\text{b}}0}\) can be defined as initial bulk diffusion coefficient of shale gas in organic pores, and \({b}_{2}\) can be defined as attenuation coefficient of \({D}_{{\text{b}}}\). The higher the value of \({b}_{2}\), the more obvious the \({D}_{{\text{b}}}\) decreases over diffusion time.

In addition, for adsorbed gas in organic pores, Eq. (30) can be written as:

$$8\uppi \frac{M{\mu }_{{\text{a}}}}{{R}_{{\text{g}}}T}{L}_{o}^{2}\frac{{\text{d}}{\overline{v} }_{{\text{a}}}}{{\text{d}}t}=\frac{\pi \left[{R}_{{\text{o}}}^{2}-{\left({R}_{{\text{o}}}-{R}_{{\text{a}}}\right)}^{2}\right]}{{\varphi }_{o}}\cdot {D}_{s}\frac{M\left({p}_{mo}-{p}_{fo}\right)}{{R}_{{\text{g}}}T{L}_{o}}$$
(35)

where \({D}_{s}\) is gas surface diffuion coefficient. Substituting Eq. (21), Eq. (27) and Eq. (35), we can yield:

$${D}_{{\text{s}}}={{\varphi }_{o}a}_{3}\left(1-\frac{{c}_{3}}{{{\text{e}}}^{-{b}_{3}t}+{c}_{3}}\right)$$
(36)

where \({a}_{3}=2{\xi }_{3}{L}_{o}^{2}\), \({b}_{3}={\eta }_{3}/{\beta }_{3}\), \({c}_{3}={\xi }_{3}\).

Analyzing Eq. (36), it can be concluded that \({D}_{{\text{s}}}\) decreases with diffusion time, and when diffusion time \(t=0\), \({D}_{{\text{s}}0}={{\varphi }_{o}a}_{3}\left[1/\left(1+{c}_{3}\right)\right]\). Therefore, \({D}_{{\text{s}}0}\) can be defined as initial surface diffusion coefficient of shale gas, and \({b}_{3}\) can be defined as attenuation coefficient of \({D}_{{\text{s}}}\). The higher the value of \({b}_{3}\), the more obvious the \({D}_{{\text{s}}}\) decreases over diffusion time.

Above all, the total diffusion coefficient of shale gas can be expressed as:

$${D}_{{\text{t}}}={D}_{{\text{bi}}}+{D}_{{\text{b}}}+{D}_{{\text{s}}}$$
(37)

where \({D}_{{\text{bi}}}\) is contributed by inorganic pores, while \({D}_{{\text{b}}}+{D}_{{\text{s}}}\) is contributed by organic pores. From Eq. (32), Eq. (34), Eq. (36) and Eq. (37), it can be found that the total diffusion coefficient of shale gas is time-dependent and decays with time. In addition, the initial value and decay trend of \({D}_{{\text{t}}}\) is also controlled by organic porosity, inorganic porosity, pore radius, pore length, pore pressure difference, temperature, etc.

2.5 Diffusion model of shale gas based on time-dependent diffusion coefficient

In previous study, the diffusion model of shale gas is generally derived by traditional diffusion coefficient, which is constant with diffusion time. However, based on the analysis in the last section, the diffusion coefficient of shale gas is time-dependent. Therefore, to more accurately characterize the dynamic diffusion process of shale gas, a time-dependent diffusion model is urgently needed.

Based on the investigations of Zhao et al. (2017) and Li et al. (2016b, a), the cumulative diffusion amount of shale gas at diffusion time \(t\) can be calculated as:

$${Q}_{t}={6Q}_{\infty }\sqrt{\frac{{\int }_{0}^{t}{D}_{{\text{t}}}{\text{d}}t}{\pi {r}_{0}^{2}}}$$
(38)

where \({Q}_{\infty }\) is total gas amount in shale pores, and \({r}_{0}\) is radius of shale particle. Substituting Eq. (32), Eq. (34) and Eqs. (3537), the time-dependent diffusion model (TDM) for shale gas can be expressed as:

$$\frac{{Q}_{{\text{t}}}}{{Q}_{\infty }}=6\sqrt{\frac{{P}_{1}+{P}_{2}+{P}_{3}}{\pi {r}_{0}^{2}}}$$
(39)

where:

$${P}_{1}={a}_{1}t+\frac{{a}_{1}}{{b}_{1}}{\text{ln}}\frac{1+{c}_{1}}{1+{c}_{1}{{\text{e}}}^{-{b}_{1}t}}$$
(40)
$${P}_{2}={a}_{2}t+\frac{{a}_{2}}{{b}_{2}}{\text{ln}}\frac{1+{c}_{2}}{1+{c}_{2}{{\text{e}}}^{-{b}_{2}t}}$$
(41)
$${P}_{3}={a}_{3}t+\frac{{a}_{3}}{{b}_{3}}{\text{ln}}\frac{1+{c}_{3}}{1+{c}_{3}{{\text{e}}}^{-{b}_{3}t}}$$
(42)

3 Model validation

3.1 Experimental validates for time-dependent diffusion coefficient

Gas diffusion coefficient is the most critical parameter to control diffusion process. Therefore, comparing Eq. (37) with the diffusion coefficient obtained from experiments is an effective way to verify the reliability of proposed diffusion model. In this section, we fitted Eq. (37) with several sets of experimental data of gas diffusion coefficient, and the results are shown in Fig. 5 (the experimental data comes from Yuan et al. (2014) Sun et al. (2020) Long et al. (2017) and the authors respectively). It can be seen that all the experimental data suggests the diffusion coefficient of shale gas decreases with time. On the early stages of gas diffusion, the attenuation in diffusion coefficient is very severe, while as the gas diffusion progresses, the value of diffusion coefficient tends towards stability. The above phenomenon proves that the UCDM cannot effectively characterize the whole diffusion process of shale gas. In addition, the results in Fig. 5 also indicates that the fitting curve is in good agreement with the experimental data (all the fitting coefficients exceed 0.950), which implies the TDM is reliable and accurate. It also should be noted that the values of \({\varphi }_{i}\) and \({\varphi }_{o}\) are determained by the method proposed in Zhang et al. (2020).

Fig. 5
figure 5

Fitting results of time-dependent diffusion coefficient with the experimental data

3.2 Experimental validates for time-dependent diffusion model

To further validate the rationality of proposed TDM, in this section, the UCDM and TDM were respectively used to fit the experimental data of gas diffusion in shale, as shown in Fig. 6 (the experimental data in Fig. 6 corresponds to Fig. 5). It can be seen that the fitting degree of TDM is obviously higher than UCDM, and all the fitting coefficients of TDM exceed 0.961, which demonstrates the TDM can describe the whole diffusion process of shale gas under different conditions. Further, the results also indicate that the UCDM has great limitations in characterizing the whole process of shale gas diffusion. For example, in Fig. 6a, the theoretical value of UCDM is obvious higher than the experimental data on the middle stages of diffusion. And in Fig. 6d, the UCDM can only model the middle and later stages of gas diffusion, while at the initial stage of diffusion, the theoretical value is significantly lower than the experimental data. In addition, in Fig. 6b, the fitting curve of UCDM have a large gap with the experimental data in the whole process of diffusion, whose fitting coefficient is only 0.061. This may be caused by the strong attenuation effect of shale gas diffusion. Above all, compared with UCDM, the TDM possesses better accuracy and wider applicability.

Fig. 6
figure 6

Fitting results of UCDM and TDM with the experimental data

4 Numerical analysis for dynamic diffusion process of shale gas

In order to present the gas dynamic diffusion process in shale matrix more intuitively, in this section, we conducted sound numerical simulation for shale gas diffusion based on the proposed TDM. The numerical analysis in this section mainly focuses on the two following aspects. The first is the variation law of flow-field information in shale matrix during SGR, and the second is the comparison between the proposed TDM and UCDM.

4.1 Governing equations and geometric model for numerical simulation

To rigorously conduct the numerical calculation, we first made the following reasonable hypotheses: (1) The impact of temperature on diffusion process is ignored. (2) The adsorption quantity of shale gas obeys Langmuir curve. (3) The numerical simulations only emphasize the diffusion process of shale gas, and the multi-component gas diffusion in shale matrix is not considered. (4) The shale pores involved in simulations is mainly micropore, which means the migration of shale gas is dominated by diffusion.

Based on above hypotheses, we can express the law of conservation of mass for dynamic diffusion process of shale gas:

$$\frac{\partial m}{\partial t}=\nabla \cdot \left({D}_{{\text{t}}}\nabla c\right)$$
(43)

For shale gas in inorganic pores, Eq. (43) can be rewritten as:

$${\varphi }_{{\text{i}}}\frac{\partial \left({p}_{mi}\right)}{\partial t}-\nabla \cdot \left({D}_{{\text{bi}}}\nabla {p}_{mi}\right)=0$$
(44)

And for shale gas in organic pores, Eq. (43) can be rewritten as:

$${\varphi }_{o}\frac{\partial {p}_{mo}}{\partial t}+\frac{{\omega }_{i}{\rho }_{s}{p}_{a}{v}_{L}{p}_{L}}{{\left({p}_{mo}+{p}_{L}\right)}^{2}}\frac{\partial {p}_{mo}}{\partial t}-\nabla \cdot \left[\left({D}_{{\text{b}}}+{D}_{{\text{s}}}\right)\nabla {p}_{mo}\right]=0$$
(45)

where \({\omega }_{i}\) is the proportion of inorganic matter in shale matrix, \({v}_{L}\) and \({p}_{L}\) are Langmuir volume constant and Langmuir pressure constant respectively, \({\rho }_{s}\) is density of shale organic matrix, and \({p}_{a}\) is gas pressure under standard state.

It is widely acknowledged that shale matrix contains both organic matter (OM) and inorganic matter (IM), and gas diffusion mechanism in the two mediums is entirely different(Chen et al. 2019; Wu et al. 2020; Wang et al. 2018). Therefore, directly simulating the gas diffusion process in shale matrix is difficult to achieve. To solve the problem, we converted the geometric model of shale gas diffusion in this study, which is depicted in Fig. 7. In the converted geometric model, the shale matrix is divided into IM and OM, and the gas diffusion process in the two components is governed by Eq. (44) and Eq. (45) respectively during simulation. It should be noted that the volume of IM and OM in the converted geometric model are consist with the volume of the raw geometric model (the side length is 0.1 mm), and the values of \({\varphi }_{{\text{i}}}\) and \({\varphi }_{o}\) in the converted geometric model are same with their values in the raw geometric model. After the above conversion, the new geometric model can not only reduce the difficulty of numerical simulation, but also ensure the rationality of the calculation results.

Fig. 7
figure 7

The geometric model of shale matrix and gas diffusion

To proceed the numerical calculation, COMSOL software is adopted and the Dirichlet boundary conditions are set up on the surface of geometric model, and the gas pressure on the boundary is 0.1 MPa. In addition, we adopted the situation of Fig. 6a as the numerical example in this study. According to the fitting curve in Fig. 6a, the values of coefficients \({a}_{1}\), \({a}_{2}\), \({a}_{3}\), \({b}_{1}\), \({b}_{2}\), \({b}_{3}\), \({c}_{1}\), \({c}_{2}\) and \({c}_{3}\) are \(6.05\times {10}^{-13}\), \(3.65\times {10}^{-12}\), \(7.56\times {10}^{-13}\), 0.0004, 0.0015, 0.00063, 2.41, 12.4 and 6.50 respectively. The other related parameters used in numerical calculation are listed in Table 1.

Table 1 The related parameters used in numerical calculation

4.2 The variation law of flow-field information in shale matrix

4.2.1 The variation law of different gas diffusion coefficients

Figure 8a shows the variation of different gas diffusion coefficients during SGR. It can be seen that as the diffusion time increases, all the three gas diffusion coefficients generally exhibit an exponential attenuation. This phenomenon is consistent with the theoretical result and experimental data. Combining with the proposed model in this study, it can be also determined that the attenuation degree of gas diffusion coefficient is controlled by many factors, such as pore size, pore length, pressure difference and adsorption capacity of shale.

Fig. 8
figure 8

The variation law of different gas diffusion coefficients

In Fig. 8b, the contribution rates of different gas diffusion mechanism are illustrated. The contribution rate means the ratio of flux induced by specific diffusion mechanism to the total flux induced by diffusion. From Fig. 8b, it can be found that at the early stage of diffusion, the contribution rate of bulk diffusion is higher than that of surface diffusion, while with the process of diffusion, the contribution rate of surface diffusion gradually exceeds the contribution rate of bulk diffusion in organic pores. In addition, Fig. 8b also shows the contribution rate of bulk diffusion in inorganic pores increases with diffusion time, while the contribution rates of bulk diffusion in organic pores and surface diffusion decrease with diffusion time. This indicates in the numerical example, the attenuation degree of gas diffusion coefficient in organic pores are more severe than that in inorganic pores.

4.2.2 The variation law of gas pressure

Gas pressure is one of the most concerned parameters during SGR. Figure 9 shows the variation of average gas pressure within shale matrix over diffusion time. It can be found that for both inorganic shale matrix and organic shale matrix, the gas pressure exponentially decreases with time, which exhibits a similar trend with gas diffusion coefficients. This is because at the beginning of diffusion, the values of diffusion coefficients are relatively high, thus shale gas can migrate out of the shale matrix at a high diffusion velocity, and the gas pressure decreases rapidly; while with the diffusion time increases, the values of diffusion coefficients exponentially reduce, thus the decrease rates of gas pressure gradually slow down until they reach a stable value. It also should be noted that because of the exponential attenuation effect of gas diffusion coefficients, the average gas pressure in shale matrix will not decrease to 0.1 MPa (the gas pressure at matrix boundary). In addition, the spatial distribution of gas pressure in middle cross-section of matrix is also depicted in Fig. 9. It is obvious that for the margin of shale matrix, the gas pressure begins to decrease at the beginning of diffusion, and the value can reach the gas pressure at matrix boundary; while for the central section of shale matrix, the gas pressure begins to decrease at the middle stage of diffusion, but the value remains at a high level at the end of the diffusion process. The above results indicate that in practical engineering, the shale gas deep in shale matrix is difficult to be fully exploited.

Fig. 9
figure 9

The variation law of gas pressure

4.3 The model comparison

In this section, we compared the proposed TDM and UCDM from the view of numerical simulation. For comprehensive analysis, we set up three calculation cases, which are present in Table 2. Based on previous studies(Zhao et al. 2014; Lu et al. 2015), the effective diffusion coefficient \({D}_{{\text{e}}}\) in Table 2 can be described as:

Table 2 The calculation cases for model comparison
$${Q}_{{\text{t}}}={Q}_{\infty }\sqrt{1-{{\text{e}}}^{-\left(\frac{4\pi {D}_{{\text{e}}}t}{{r}_{0}^{2}}\right)}}$$
(46)

As is stated above, \({Q}_{\infty }\) is total diffusion amount at the end of diffusion process. Therefore, in this section, the value of \({Q}_{\infty }\) is the total diffusion amount at the diffusion time of 15000 s, which corresponds to the end diffusion time in Fig. 5a.

Figure 10 illustrates the residual gas ratio (RGR) in shale matrix under the three cases. The RGR means the ratio of residual gas content to total gas reserves in shale matrix. From Fig. 10, it can be seen that for case 1, the decrease of RGR mainly occurs in the early and middle stages of diffusion owing to the attenuation of gas diffusion coefficients. When the diffusion time is 2000s, the RGR of case 1 is 43%, while when the diffusion time is 15000 s, the RGR is 40%, which suggests in practical engineering, the promoting of diffusion to shale gas migration significantly attenuates at the later stage of SGR. In addition, the 3D cloud map in Fig. 10 indicates that for case 1, a large amount of shale gas remains trapped in the central portion of matrix at the end of diffusion process. This result once again proves that the gas deep in shale matrix cannot be fully exploited during SGR. Comparing to case 1, the decrease of RGR is more severe under case 2. When the diffusion time is 15000 s, the RGR of case 2 is only 6%, 34% lower than case 1. That means if the UCDM is used to model SGR, and the diffusion coefficient is the initial value of \({D}_{{\text{t}}}\), the gas production will be overestimated. For case 3, the decrease of RGR is more moderate than case 1. Comparing to case 1, the decrease of RGR is slower at the early stage of diffusion, but faster at the later stage under case 3. This is because the value of \({D}_{{\text{e}}}\) is lower than the initial value of \({D}_{{\text{t}}}\), but as the diffusion time increase, the value of \({D}_{{\text{e}}}\) gradually exceeds the value of \({D}_{{\text{t}}}\). When the diffusion time is 15000 s, the RGR of case 3 is 39%, almost equal to case 1. However, if the calculation time continues to extend, the RGR of case 3 will inevitably be lower than that of case 1, as there is no attenuation process in \({D}_{{\text{e}}}\). Therefore, using \({D}_{{\text{e}}}\) as the diffusion coefficient of UCDM for modeling SGR will still overestimate the gas production. In a word, if the time-dependent gas dynamic diffusion process in shale matrix is ignored, the shale gas production will be overestimated.

Fig. 10
figure 10

The residual gas ratio in shale matrix under the three calculation cases

5 Conclusions

This paper proposes a physical model for gas diffusion in shale, in which the matrix is divided into organic matter and inorganic matter, and the pores are accordingly divided into organic pores and inorganic pores. In organic pores, both bulk diffusion of free gas and surface diffusion of absorbed gas are considered, while in inorganic pores, only bulk diffusion of free gas is considered. For free gas, it is subjected to three forces during bulk diffusion, namely internal pressure, external pressure and frictional resistance from pore wall or adsorbed gas. For adsorbed gas, it is subjected to four forces during surface diffusion, namely internal pressure, external pressure, friction from free gas and pore wall.

Based on the physical model, the kinetic processes of shale gas diffusion are revealed from the perspectives of force analysis and fluid dynamics. Further, the mathematical expression for gas dynamic diffusion coefficient is obtained, which consists of three terms, namely bulk diffusion coefficient of free gas in inorganic pores and organic pores, and surface diffusion coefficient of adsorbed gas. From the view of theoretical equations, the gas dynamic diffusion coefficient is determined by an initial value and an analogous exponential attenuation process. By combining gas dynamic diffusion coefficient and unipore diffusion model, a time-dependent diffusion model (TDM) for shale gas is established. The fitting results show that the TDM has good agreement with experimental data and is superior to unipore classical diffusion model (UCDM).

The numerical analysis of gas dynamic diffusion process in shale matrix indicates that at the end of diffusion, a large amount of shale gas remains trapped in the central portion of matrix, and the gas deep in shale matrix is difficult to be fully exploited because of the attenuation of gas diffusion coefficient. In addition, the gas production inferred by UCDM is higher than the actual situation, whether the initial value of gas dynamic diffusion coefficient or the effective gas diffusion coefficient is adopted. This is because the time-dependent gas dynamic diffusion process in shale matrix is ignored in UCDM.