## 3 Formulation of the Mathematical Model
### Gas Flow Regimes within the Matrix  
#### 3.3.1 Bulk Phase Gas Flow Regimes  
1. Continuum regime  
The application of [PERSON]'s law to viscous gas flow in the continuum regime (\(K_{n}<0.01\)) is more recognized [38; 39]. Mass flux in the continuum regime is given by [31]:  
\[M_{c}=\frac{Mp}{ZRT}\frac{k}{\mu}\Delta p, \tag{21}\]  
where \(M_{c}\) is the mass flux in the continuum regime, \(M\) is the molar mass of the gas, \(Z\) is the compressibility factor, \(k\) is the matrix permeability, \(\mu\) is dynamic viscosity of the fluid, and \(\Delta p\) is the gradient in reservoir pressure.  
2. Slip flow regime  
A porous medium can be considered to be a bundle of capillaries with varying cross-sectional areas. The total mass flux in the slip flow regime is the sum of the mass flux from all the individual capillaries [9]. The mass flux in the slip flow regime through a single capillary is given by a Hagen-Poiseulle-type equation [8], as follows:  
\[m_{s}(r)=\frac{M\pi r^{3}p}{16\mu\tau ZRT}\left(1+\frac{4K_{n}}{1+K_{n}}\right) \Delta p, \tag{22}\]  
where \(m_{s}(r)\) is the mass flux in the slip flow regime through a single capillary, and \(\tau\) is the tortuosity factor of porous media.  
By combining Equations (6) and (21), the total mass flux in the slip flow regime through a shale matrix with different scale pores can be expressed as:  
\[\begin{array}{c}M_{s}(r)=-\int_{r_{K_{n}=0.1}}^{r_{K_{n}=0.01}}m_{s}(r)dN= \int_{r_{K_{n}=0.1}}^{r_{K_{n}=0.01}}\frac{M\pi r^{3}p}{16\mu\tau ZRT}\left(1+ \frac{4K_{n}}{1+K_{n}}\right)\Delta p\times D_{f}r_{K_{n}=0.01}^{D_{f}}r^{-( D_{f}+1)}dr\\ =\frac{M\pi p}{16\mu\tau ZRT}\Delta p\times D_{f}r_{K_{n}=0.01}^{D_{f}}r_{K_{n }=0.1}^{D_{f}}r_{K_{n}=0.1}^{D_{f}}r^{-D_{f}}\left(1+\frac{2\lambda}{r+0.5 \lambda}\right)dr\end{array}, \tag{23}\]  
where \(M_{s}(r)\) is the total mass flux in the slip flow regime through the shale matrix, and \(r_{K_{n}=0.01}\) and \(r_{K_{n}=0.1}\) are the corresponding pore radii with respect to \(K_{n}=0.01\) and \(K_{n}=0.1\) for a given inlet pressure, respectively.  
3. Free molecular and transition regimes (Knudsen diffusion)  
Although some modified conventional models may be applied to the free molecular and transition regimes (i.e., Darcy's law with Knudsen correction and a Hagen-Poiseuille-type equation), the validity of such models with empirical coefficients is questionable. The Knudsen diffusion equation is better equipped to describe the free molecular and transition regimes [8], especially for gas flow with higher Knudsen numbers (close to 10) [39]. So the free molecular and transition regimes in a matrix are collectively referred to as Knudsen diffusion. Furthermore, the Knudsen diffusion coefficient is given by [14]:  
\[D_{f}=\frac{8r_{f}}{3}\frac{\varphi}{\tau}\sqrt{\frac{RT}{2\pi M}}, \tag{24}\]  
where \(D_{f}\) is the Knudsen diffusion coefficient, and \(r_{f}\) is the average effective pore radius of the pores in which free molecular and transition regimes occur. Based on Equations (7) and (9), the \(r_{f}\) can be found by:  
\[r_{f}=\frac{\int_{r_{f-\min}}^{r_{f-\max}}f(r)rdr}{\int_{r_{f-\min}}^{r_{f-\max }}f(r)dr}, \tag{25}\]  
where \(r_{f\text{-}\min}\) and \(r_{f\text{-}\max}\) are the minimum and maximum average effective pore radii for pores in which free molecular and transition regimes occur.  
Furthermore, the mass flux in Knudsen diffusion is given by:  
\[M_{k}(r)=\frac{MD_{f}}{ZRT}\Delta p=\frac{8M\Delta p}{3 ZRT}\frac{\varphi}{\tau }\sqrt{\frac{RT}{2\pi M}}\frac{\int_{r_{f-\min}}^{r_{f-\max}}f(r)rdr}{\int_{r_{ f-\min}}^{r_{f-\max}}f(r)dr}. \tag{26}\]