# A Novel Adaptive Transient Model of Gas Invasion Risk Management While Drilling
## 2 Multiphase Flow Model
### Boundary Conditions  
The invasion of formation fluids into the annulus is not considered during the whole gas invasion process or simulated gas invasion process, so the mass of the liquid phase flowing into the annulus from the top of the drill pipe is always balanced with the mass of the liquid phase flowing into the annulus from the bottom of the drill pipe. The gas invasion rate is controlled by the differential pressure at the bottom of the well, formation permeability, and seepage radius and can be calculated by the following equation:  
\[Q_{\mathrm{G}}=\frac{2.64\times 10^{-20}KH\big{(}P_{\mathrm{r}}^{2}-BHP^{2} \big{)}}{(0.8+\ln t_{\mathrm{D}})\big{[}(T+18.15)Z\mu_{\mathrm{G}}\big{]}} \tag{8}\]  
where \(Q_{\mathrm{G}}\) is the gas invasion rate in \(\mathrm{m^{3}/s}\); \(K\) is the permeability of the drilled encounter with the high-pressure formation in \(\mathrm{m}\); \(H\) is the drainage thickness of the high-pressure formation in \(\mathrm{m}\); \(P_{\mathrm{r}}\) is the pore pressure of the high-pressure formation in \(\mathrm{Pa}\); \(BHP\) is the bottom hole pressure in \(\mathrm{Pa}\); \(T\) is the formation temperature in \({}^{\circ}\)C; \(Z\) is the compressibility  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Flow Pattern** & \multicolumn{2}{c}{**Convection Heat Transfer Coefficient**} & **Parameter Description** \\  & **and Its Supplementary Equation** & \\ \hline Bubble flow & \(h_{\mathrm{M}}=\frac{N_{\mathrm{H}_{\mathrm{M}}}N_{\mathrm{H}_{\mathrm{M}}}}{2 \big{(}\big{(}\big{(}\big{(}\big{(}\big{(}\big{(}\big{(}\big{}\big{(}\big{}\big{} \big{(}\big{}\big{}\big{}\big{}\big{}\big{}\big{}\big{}\big{}\big{}}\big{)} \big{)}\big{)}\big{)}\big{)}\big{)}\) & \(h\) is the convection heat transfer coefficient in \(\mathrm{W/m^{2}/^{\circ}C}\); \(h\) is the thermal conductivity in \(\mathrm{W/m^{\circ}C}\); \(Nu\) is the Nussel number; \(C_{\mathrm{p}}\) is the specific heat capacity in \(\mathrm{J/kg/^{\circ}C}\); \(f\) is the friction factor; \(Re\) is the Reynolds number; \(Pr\) is the Prandtl number; \(\mu\) is the viscosity in Pa-s; and subscript M is the mixture. \\ \hline Slug flow & \(h_{\mathrm{M}}=h_{\mathrm{TBX}}+h_{\mathrm{BS}}(1-\chi)\) & \\  & \(h_{\mathrm{TB}}=2.08\mu_{\mathrm{K}}^{2}-2^{3}h_{\mathrm{TB}}\) & Subscripts TB and LS are the Taylor bubble region and liquid slug region, respectively. \\  & \(h_{\mathrm{LS}}=\frac{N_{\mathrm{H}_{\mathrm{LS}}}2\big{(}\big{(}\big{(}\big{(} \big{(}\big{(}\big{(}\big{(}\big{}\big{(}\big{(}\big{}\big{}\big{}\big{}\big{} \big{}\big{)}\big{)}\big{)}\big{)}\big{)}\big{)}\big{)}}{45}\) & Subscript LTB is the Taylor bubble zone liquid film. \\  & \(N_{\mathrm{H}_{\mathrm{LS}}}=\frac{\big{(}\frac{\mu}{2}R_{\mathrm{GS}}p_{\mathrm{ TS}}}{1.07+127\sqrt{\big{(}p_{\mathrm{TB}}^{2}C_{\mathrm{s}}^{2})}}\Big{(}\frac{\mu_{ \mathrm{R}}}{\big{(}\big{(}\big{(}\big{(}\big{(}\big{}\big{(}\big{(}\big{}\big{)} \big{)}\big{)}\big{)}}\big{)}^{1/4}\Big{)}\) & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Convection heat transfer coefficient of different flow patterns.  
factor; \(\mu_{\rm G}\) is the viscosity of gas in Pa-s; and \(t_{\rm D}\) denotes the dimensionless time, and its calculation is shown as follows:  
\[t_{\rm D}=\max\left(10,\frac{1.47\times 10^{-9}t}{r_{\rm ca3,i}^{2}}\frac{K}{ \phi\mu_{\rm G}{\rm G}_{\rm G}}\right) \tag{9}\]  
where \(t\) is the actual gas invasion time in s; \(\phi\) is the porosity of the high-pressure gas layer in %; and \(c_{\rm G}\) is the gas-phase compression coefficient of the invasion gas.  
The solid phase in the annulus is considered an incompressible phase, and its volume flow rate is a function of the rate of penetration.  
\[Q_{\rm S}=ROP\cdot\pi r_{\rm ca3,i}^{2} \tag{10}\]  
where \(Q_{\rm S}\) is the volume flow rate of the solid phase in m\({}^{3}\)/s, and \(ROP\) is the rate of penetration in m/s.