# Optimization and Application of Drilling Parameters Based on Gas-Solid Coupling Simulation
## 2 Coupled Gas-Solid Modeling of Gas Extraction
### Mathematical Model  
#### 2.2.1 Gas Diffusion Control Equation  
The porosity, permeability, initial permeability, and initial porosity of gas in a coal body conform to the cubic law. The cubic law formula is shown in Equation (1):  
\[\frac{\varphi}{\varphi_{0}}=\frac{\phi^{3}}{\phi_{0}^{3}} \tag{1}\]  
where \(\varphi\) is permeability; \(\phi\) is porosity; \(\varphi_{0}\) is initial permeability; and \(\phi_{0}\) is initial porosity.  
During gas extraction, mass exchange occurs between the coal matrix and the fissures. The mass exchange equation is shown in Equation (2):  
\[\mathrm{Q_{S}}=\mathrm{D}\xi(\rho_{\mathrm{m}}-\rho_{\mathrm{f}}) \tag{2}\]  
where \(\mathrm{Q_{S}}\) is the mass exchange between the coal matrix and the fissure; \(\mathrm{D}\) is the gas diffusion coefficient; \(\xi\), is the shape factor of the coal matrix; and \(\rho_{\mathrm{m}}\) and \(\rho_{\mathrm{f}}\) are the densities of gas in the coal matrix and the fissure in the standard state.  
The coal matrix shape factor needs to be determined by adsorption tests. The coal matrix shape factor is calculated as shown in Equation (3):  
\[\xi=\frac{1}{\tau\mathrm{D}} \tag{3}\]  
where \(\tau\) is the adsorption time.  
Associative Formulas (2) and (3) are derived as follows:  
\[\mathrm{Q_{S}}=\frac{1}{\tau}(\rho_{\mathrm{m}}-\rho_{\mathrm{f}}) \tag{4}\]  
Under ideal conditions and ignoring the effect of temperature variations, the gas in the coal seam conforms to the ideal gas equation of state. The density of gas in the coal matrix is shown in Equation (5), and the density of gas in the coal fissure is shown in Equation (6):  
\[\rho_{\mathrm{m}}=\frac{\mathrm{M_{c}}}{\mathrm{RT}}P_{m}=\frac{\mathrm{M_{c} }}{\mathrm{V_{m}}} \tag{5}\]  
\[\rho_{f}=\frac{M_{c}}{RT}.\rho_{f} \tag{6}\]  
where \(\mathrm{M_{c}}\) is the molar mass of gas; \(\mathrm{R}\) is the ideal gas molar constant; \(\mathrm{T}\) is the coal seam temperature; \(\mathrm{P_{m}}\) and \(\mathrm{P_{f}}\) are the coal matrix and fissure gas pressures; and \(\mathrm{V_{m}}\) is the molar volume of gas in the standard state.  
The total mass of gas within the coal matrix consists of both adsorbed and free gas [10]. The total mass of gas in the coal matrix is calculated as shown in Equation (7):  
\[\mathrm{m_{m}}=\mathrm{m_{mm}}+\mathrm{m_{mf}}=\frac{\mathrm{M_{c}}\rho_{ \mathrm{c}}}{\mathrm{V_{m}}}\frac{\mathrm{V_{t}}\mathrm{P_{m}}}{\mathrm{P_{L} }+\mathrm{P_{m}}}+\frac{\mathrm{\phi_{f}}\mathrm{M_{c}}\mathrm{P_{m}}}{ \mathrm{RT}}\mathrm{v_{f}}=-\frac{\mathrm{\varphi_{f}}}{\mu}\
abla\mathrm{P_{ f}} \tag{7}\]  
where \(\mathrm{\varphi_{c}}\) is the density of coal; \(\mathrm{V_{L}}\) is the Langmuir volume constant; and \(\mathrm{P_{L}}\) is the Langmuir pressure constant.  
Mass exchange of gas in the coal matrix and coal fissures follows the law of conservation of mass. The law of conservation of mass is shown in Equation (8):  
\[\frac{\partial\mathrm{m_{m}}}{\partial\mathrm{t}}=-\mathrm{Q_{S}}=-\frac{ \mathrm{M_{c}}}{\tau\mathrm{RT}}(\mathrm{P_{m}}-\mathrm{P_{f}}) \tag{8}\]  
The diffusion equation of gas in the coal matrix is obtained by joining Equations (7) and (8). The gas diffusion equation in the coal matrix is shown in Equation (9):  
\[\frac{\partial}{\partial\mathrm{t}}\bigg{(}\frac{\mathrm{M_{c}}\mathrm{ \varphi_{c}}}{\mathrm{V_{m}}}\frac{\mathrm{V_{L}}\mathrm{P_{m}}}{\mathrm{P_{L} }+\mathrm{P_{m}}}+\frac{\mathrm{\phi_{f}}\mathrm{M_{c}}\mathrm{P_{m}}}{ \mathrm{RT}}\bigg{)}=-\frac{\mathrm{M_{c}}}{\tau\mathrm{RT}}(\mathrm{P_{m}}- \mathrm{P_{f}}) \tag{9}\]