Research on dynamical overflow characteristics of a vertical H2S‐containing natural gas well

This work aims to explore the overflow characteristics of a vertical H2S‐containing natural gas well. A two‐phase flow model for H2S‐containing natural gas well combining with a transient temperature prediction model was established to simulate the overflow process of a vertical H2S‐containing natural gas well. The model was validated by reproducing the field data of Well Longhui #2. The effects of H2S content, mud displacement, drilling fluid density, geothermal gradient, and reservoir permeability on the overflow characteristics of a vertical H2S‐containing natural gas well were studied and analyzed in this work. Results indicate that bubble, slug, and churn flows constitute the main flow patterns in the whole overflow process. The higher the H2S content is, the more obviously the gas void fraction increases. The phase change position of H2S is closer to the wellhead at lower H2S content. An increase in mud displacement indicates the decreases in overflow time. As drilling fluid density increases, the release position of H2S moves up, and the overflow time and shut‐in casing pressure increase. The initial gas void fraction is higher and the gas invasion volume will be larger in gas reservoirs with higher permeability. As the reservoir permeability increases, the shut‐in casing pressure rises while the overflow time declines. With higher geothermal gradient, the wellbore temperature tends to be higher at the same depth, leading to an increase in the H2S solubility. The gasification starting position is further away from the wellhead at higher geothermal gradient. The results of this work could provide important theoretical basis and technical guidance for drilling engineers to reduce a blowout risk during drilling of H2S‐containing natural gas well.


| 2597
posing a considerable threat to people and property. H 2 S is in a supercritical state at the bottom of a well and is nearly dissolved in drilling fluid. As the drilling fluid rises along the wellbore, the temperature and pressure drop, and once they drop below the critical level, H 2 S is released. The rapid change in pressure and temperature in the wellbore may increase the difficulty in well control and even cause a blowout accident. 1,2 For instance, the "12·23" gas blowout accident in Kaixian County of Chongqing has brought irreparable damage to the national property and people's safety. 3,4 H 2 Scontaining natural gas wells must be further developed given the growing demand for natural gas energy. Therefore, the overflow characteristics of an H 2 S-containing natural gas reservoir must be investigated.
In recent years, more attention has been paid to the study of gas-liquid two-phase flow in a vertical wellbore. In earlier studies, the patterns of flow in a vertical wellbore, which generally are bubble, slug, churn, and annular flow patterns, [5][6][7][8] were explored, and systematic calculation models for key parameters of multiphase flow were established. [9][10][11][12] Further, several studies on the model of two-phase flow in a pure natural gas well were conducted. Shirdel and Sepehrnoori presented a fully implicit transient two-fluid pseudocompositional and thermal model for two-phase flow in wellbores and found that the interphase and wall shear stresses in a variety of flow regimes can significantly affect the results of the model. 13 Pan et al 14 16 simulated the gas kick development and well killing for an HP/HT Well in Western China using a dynamic hydraulic and well control simulator powered by transient multiphase flow model, and the results showed that the killing pump rate was not adequate given the gas kick in the wellbore. The dynamic simulations successfully revealed the reason for the gas suspension in the wellbore during shut-in and predicted the gas cap. Xu et al developed a nonisothermal two-phase flow model to investigate the effect of major parameters on the two-phase flow behavior in the wellbore. They found that temperature, pressure, and solubility fields are mutually influential. The gas solubility effect and heat transfer effect influence gas kick characteristics significantly. 17, 18 Yang et al 19 developed a transient hydro-thermo-bubble model for gas kick simulation in deepwater drilling based on oil-based mud and found that the mass transfer, heat transfer, and bubble-bubble interaction are mutually coupled.
However, a typical method is only based on the gas-liquid two-phase flow for the wellbore multiphase flow simulation, which may lead to a high data error for the flow simulation of an H 2 S-containing natural gas well. Based on earlier studies, Sun et al 20 investigated the phase change in acid-gas mixture considering the H 2 S content in a wellbore through experimental analysis and highlighted that the acid-gas mixture in the supercritical phase exists at certain wellbore temperature and pressure, resulting in an abrupt change in its physical properties near the critical point. Sun et al 21 also established a multiphase flow model with consideration of the phase transition and the solubility of the H 2 S components in the natural gas and found that the solubility of natural gas with H 2 S content of 100% is 130 times that of natural gas with H 2 S content of 0%. He et al 22 developed a two-phase model for sour gas kicks in vertical well and discussed the effects of sour gas content on multiphase flow during kick circulation; results showed that as the percentage of H 2 S in total gas increased, the maximum pit gain/casing pressure both decreased. Despite these studies, quantitative analysis on the dynamical overflow characteristics of a vertical H 2 S-containing natural gas well is scarce.
Previous studies [20][21][22] have focused on the change in H 2 S solubility along the wellbore and the variation in gas volume before and after H 2 S gasification was also studied. However, when H 2 S is released, the gas volume increases abruptly; the multiphase flow behavior is influenced; and the flow pattern distribution in the annulus, pit gain, annular pressure distribution, and bottom hole pressure will be greatly affected accordingly, which have a great impact on well control operations such as overflow monitoring and well killing in drilling engineering. However, these analyses have been ignored in existing studies. Besides, the effects of drilling parameters (such as mud displacement and drilling fluid density) and geological parameters (such as permeability and geothermal gradient) on dynamical overflow characteristics of a vertical H 2 S-containing natural gas well are not seen in the existing studies. Therefore, it is necessary to conduct a more in-depth and comprehensive research on dynamical overflow characteristics of a vertical H 2 S-containing natural gas well, so as to guide field production and ensure well control safety.
On the basis of previous studies, the present work aims to explore the overflow characteristics of a vertical H 2 Scontaining natural gas well. A two-phase flow model for H 2 S-containing natural gas well combining with a transient temperature prediction model was established to simulate the overflow process of a vertical H 2 S-containing natural gas well. The model was validated by reproducing the field data of Well Longhui #2. The effect of H 2 S content, mud displacement, drilling fluid density, geothermal gradient, and reservoir permeability on the overflow characteristics of an H 2 S-containing natural gas well was obtained and analyzed in this work. The results of this work could provide important theoretical basis and technical guidance for drilling engineers to reduce a blowout risk during drilling of H 2 S-containing natural gas well.

| Governing equations for mass and momentum
During drilling, two flow types, namely single-phase flow and gas-liquid two-phase flow, exist in the wellbore before gas reaches the wellhead. The parameters of the drilling fluid in a single-phase flow can be obtained by general theory of fluid mechanics. For the gas-liquid two-phase flow, a numerical model has been established in this work to obtain the flow parameters of the drilling fluid.
To simplify the calculation, the following assumptions are made: (a) the gas and drilling fluid flow in a vertical wellbore is regarded as one-dimensional; (b) the compressibility of the drilling fluid is ignored; (c) gas and liquid phases are continuous in the control unit; and (d) the influence of annulus eccentricity is disregarded. Thus, simplified continuity equations and a momentum equation can be obtained on the basis of these assumptions.
In contrast to methane, the solubility of H 2 S in drilling fluid is more likely to be affected at specific temperature and pressure. H 2 S is in a supercritical state at the bottom of the well and can dissolve completely in a drilling fluid due to its high solubility at high temperature and pressure. 23 As the temperature and pressure in the wellbore gradually decrease with well depth, solubility of H 2 S drops, and consequently, H 2 S is released from the drilling fluid. Figure 1 shows the physics model of gas-phase mass conservation. According to the law of mass conservation, the change in the mass of control unit is the incoming mass of the control unit minus the outgoing mass. 18 For gas phase, the incoming mass of the control unit is: The outgoing mass of the control unit is: The internal mass change caused by the change of gas void fraction is: Therefore, the continuity equations of gas phase are expressed as: Similarly, the continuity equations of liquid phase are expressed as: q H 2 S (Non -Overflow) , F I G U R E 1 Physics model of gas phase mass conservation d g g g g g g g g ms l gs m g g g ms m gs l l d where q g is the gas production; q H 2 S is the gasified H 2 S, which is calculated in "2.4.1"; g and l are the densities of gas and drilling fluid, respectively; v g and v l are the velocities of gas and drilling fluid, correspondingly; E g is the gas void fraction; E l is the liquid holdup; A is the cross-sectional area; B m is the local volume coefficient of the drilling fluids; R ms is the local solution gas-drilling fluid ratio; and gs is the gas density under the standard condition.
According to the law of conservation of momentum, the change rate of the object's momentum with respect to time is equal to the sum of the external forces applied to the object. The change rate of the object's momentum with respect to time has two parts: local derivative and convective derivative. Thus, as shown in Figure 1, the momentum equation can be obtained as follows: 15 For gas, the momentum equation can be expressed as: For liquid, the momentum equation can be expressed as: In a control unit, Thus, the total momentum equation can be written as: where g is the local acceleration of gravity; l and g are the shear stress between liquid, gas and well wall, respectively; and P z fr is the friction pressure drop between the fluid and wellbore wall.

| Wellbore temperature
To accurately predict the phase change behavior of H 2 S in wellbore, a transient temperature prediction model is developed based on finite volume method. 24 The unsteady two-dimensional convection-diffusion and unsteady two-dimensional diffusion equations are used to describe the heat transfer models as follows: (1) Heat transfer model in the drilling string: (2) Heat transfer model of drilling string: (3) Heat transfer model in the annular: (4) Heat transfer model of casing, cement sheath, and formation: where i is the density of the drilling fluid; c i is the specific heat capacity of the drilling fluid; T i is the drilling fluid temperature;u p ,u a are the velocities of the drilling fluid inside the drilling pipe and annulus in the x direction;v p , v a are the velocities of the drilling fluid inside the drilling pipe and annulus in the y direction; Γ ix is the overall coefficient of heat transfer of the drilling fluid in the x direction; Γ iy is the overall coefficient of heat transfer of the drilling fluid in the y direction; and S p ,S a are the energy source of the drilling fluid inside the drilling pipe and annulus, respectively.

Initial conditions
At the initial stage of overflow, there is no natural gas in the wellbore, which is filled with drilling fluid. In this case, the distributions of pressure and velocity in the wellbore under normal drilling conditions can be obtained and used as the initial conditions of a well kick.
where h is the well depth, in m; Q l is the mud displacement, in L/s.

Boundary conditions
It is assumed that the wellhead pressure is equal to atmospheric pressure until overflow occurs, and the well is closed. Accordingly, the total flow is the sum of drilling fluid flow and gas overflow. In drill engineering, once the pit gain reaches a certain threshold, the well will be shut in immediately. Thus, the maximum pit gain in this work is 7 m 3 in accordance with gas field experience, and the boundary conditions can be set as follows: where V pg is the pit gain at shut-in time, in m 3 ; P 0 is the wellhead pressure, in Pa.

| Flow pattern discriminant
According to earlier studies, the main patterns of a gas-liquid two-phase flow are bubble, slug, churn, and annular flow patterns 7 : Bubble flow: Slug flow: Churn flow: Annular flow: In these equations, v sg and v sl are the superficial velocities of liquid and gas, in m/s; v oo is the limit rising velocity of bubble, in m/s; and is the surface tension, in N/m.

| Calculation of H 2 S solubility
The solubility of H 2 S in the drilling fluid can be expressed as: 21 where y i and x i are the mole fractions of H 2 S in the gas and liquid, respectively; v i and l i are the fugacity coefficients of H 2 S in the gas and liquid, which can be calculated by the Peng-Robinson equation.
with A = ap R 2 T 2 , B = bp RT , and Z = PV RT , Equation (13) can be written as where a and b are the coefficients, which can be solved by the following equations: and where k ij is the interaction coefficient between H 2 S and hydrocarbon components in natural gas; T ci and P ci are the critical temperature and pressure of H 2 S, in K and Pa, respectively; T ri is the correspondent temperature of H 2 S, in K; and w is the acentric factor of H 2 S.
Thus, the fugacity coefficient of a certain component is expressed as: � .
The solubility of H 2 S in the liquid can be obtained by combining Equation (22) with (30).

| Drift flux model and distribution coefficient
Drift flux model is an application model extensively used in current multiphase flow calculation. In the drift flux model, 25 gas velocity is defined as where v gr is the drift velocity, in m/s; C 0 is the distribution coefficient.
The distribution coefficient reflects the uneven distribution of the velocity and phases of the fluid at the cross section. The corresponding slip rate of the gas phases and distribution coefficient in case of different flow patterns are as follows: 25 Bubble flow: Slug flow: Churn and annular flows: where D is the borehole size, in m; d is the drill pipe diameter, in m. Thus, once the gas slip velocity and distribution coefficient are determined, the gas void fraction can be obtained by the following equations: where v m is the mixed velocity of gas and liquid, m/s.

| Calculation of friction pressure drop
In case of a single-phase flow (drilling fluid), its friction pressure drop can be obtained using the friction factor of the power-law fluid.
where Hr is the viscous friction head; l is the density of the drilling fluid, in kg/m 3 ; v l is the velocity of the drilling fluids, in m/s; D e is the equivalent diameter, in m; n is the flow index of the drilling fluid; and R e is the mean Reynolds number of the mixed fluids, which is provided in Gao's work. 25 In case of a gas-liquid two-phase flow, the friction pressure drop can be calculated based on the following equations established by Sun et al 20 Bubble flow: where e is the equivalent absolute roughness, in m; m is the correction coefficient. Slug flow: Churn and annular flows:

| Gas production
For oil and gas development, researchers have made substantial efforts to calculate the gas production. In this work, the most frequently used equation is adopted to calculate the gas production: 26 where Q g is the gas production, in m 3 /s; P p is the formation pressure, in Pa; P b is the bottom hole pressure, in Pa; h is the gas reservoir thickness, in m; r w is the hole radius, in m; K is the reservoir permeability, in mD; c is the system compressibility, in Pa −1 ; g is the gas viscosity, in Pa·s; T is the absolute temperature, in K; t is the overflow time, in s; and Z is the natural gas compression factor, which is provided in Elsharkawy's work. 27

| Gas density
The gas density can be described by introducing a compression factor into the ideal gas equation, as defined in the equation below 28 where W g is the molar mass of natural gas, in kg/kmol; R is the molar gas constant, which is 0.00847MPa·m 3 /kmol·K).

| Solution for mass and momentum governing equations
The finite difference method is used in this work to solve the two-phase flow model, and the solution is completed by three steps: generating discrete grids, constructing discrete equations, and solving these equations.

Generating discrete grids
Grids are used to represent discrete time and space domains. During the overflow simulation, the time domain is the whole time from the overflow to the shut-in, and the space domain represents all the annulus nodes from well bottom to wellhead. Figure 2 shows the schematic diagram of solution of the mass and momentum governing equations. As shown in Figure 2A, Δz is the grid size of space, which is a fixed value, and Δt is the grid size of time, which changes with the gas velocity. The following equation defines the relationship between Δz and Δt: Figure 2B shows the cell grid integration area D. So the partial differential equation in the mathematical model can be written as: 26 Then, by integrating this equation into area D, a curvilinear integral along the boundary of L can be obtained according to Green's theorem.

Model discretization
The above equation can be converted to the following equation through simplification:

Numeralization of the continuity equation
For gas-phase continuity equation, let.
Thus, the gas-phase difference equation can be obtained by combining Equations (53) and (54).

For nonoverflow formation:
Similarly, liquid-phase difference equation can be obtained as follows:

Numeralization of the momentum equation
Based on Equation (45), the mixed momentum difference equation can be expressed as:

| Solution for transient temperature prediction model
Finite volume method was used to solve the wellbore temperature prediction model, and Figure 3 shows the schematic diagram of solution of the temperature prediction model. 24 Discretized scheme of the heat transfer control equations is expressed as follows: where T is the temperature variable; t is time node; Δt is the time increment; i indicates the node number in the well depth direction; j is the node number in the radius direction;

| Solution process
The phase behavior of H 2 S is greatly influenced by temperature and pressure; thus, firstly, the transient temperature prediction model was solved and the node pressure was predicted. Then, the H 2 S solubility and mass of the released natural gas can be obtained. The gas velocity and liquid velocity can be obtained by combining the continuity equations, and the gas void fraction can be obtained by combining the drift flux model. Finally, the node pressure can be calculated from the momentum equation. In the whole calculation process, the prediction-correction method was used to ensure the calculation accuracy of gas void fraction and node pressure. The solution flowchart is depicted in Figure 4. (57)

| MODEL VERIFICATION
To validate the calculation model, the overflow process of an H 2 S-containing natural gas well (Longhui #2) was simulated in this model. The overflow was found in Well Longhui #2 at the drilling depth of 4420 m, and the initial pit gain was 2 m 3 at 7:30. The pit gain was recorded every five minutes, and the gas well was shut in when the pit gain reached 8.9 m 3 at 8:13. Table 1 shows the drilling parameters of Well Longhui #2, 29 and Figure 5 compares the simulation results and field data from Well Longhui #2. According to Figure 5, the simulation results are in good agreement with the field data from Well Longhui #2. After H 2 S is released, the pit gain shows a sudden increase both in simulation results and field data, between which the slight difference may lie in the fact that the compressibility of the drilling fluid is disregarded.

| CASE STUDY
A blowout took place at an H 2 S-containing gas well in Sichuan, which is a vertical well, shortly after an overflow was found during the drilling. 22 The well was approximately 2500 m deep with its structure and drilling assembly depicted in Figure 6 and major calculation parameters given in Table 2 below.

| Effect of H 2 S content on the overflow characteristics of a gas well
The content of H 2 S is affected by reservoir characteristics and temperature, and it can even reach 92% in some gas wells in Southwest and Northwest China. 30 Therefore, in the present work, varied H 2 S contents at 0%, 10%, 20%, 40%, and 60% were selected to study the effect of H 2 S content on the overflow characteristics of a gas well. As shown in Figure 7, in the overflow process of a normal gas well (with H 2 S content of 0%), the gas void fraction rises abruptly to approximately 0.45 in the deep well section (1,900-2,500 m) and then shows low increasing trend in the shallow well section (0-1,900 m), which may be attributed to the following reasons: (a) According to Figure 8A, the density of natural gas (methane) decreases with the well depth. However, the gas-liquid slip velocity of a gas with high density is lower. 31 As a result, in Figure 9A, the gas velocity is higher in the shallow well section than that in the deep well section; thus, the time consumed for gas to pass through a fixed distance is longer in the deep well section. (b) Besides, the radius change rate of a bubble can be understood as a function of the radius and position in an isothermal environment, as expressed below 32 : where is the radius change rate of the bubble; r is the bubble radius; z is the position of the bubble; and p 0 is the barometric pressure. Figure 8B exhibits the variation in the radius change rate of a bubble with well depth, according to which the radius change rate of the bubble is higher in the deep well section. As a result, there is a significant change in the gas void fraction adjacent to the deep well section because the time required for the gas to pass through the fixed distance is considerably longer. Therefore, the gas void fraction shows a more evident increase in the deep well section. Figure 7 also indicates that the gas void fraction in the shallow well section rises more rapidly in the overflow process of an H 2 S-containing gas well than a normal gas well. The H 2 S release starts at approximately 1400 m from the wellhead, and the gas volume expanded abruptly. The higher the H 2 S content is, the faster the gas void fraction increases, which can be explained with the phase change of H 2 S. As the temperature ( Figure 8C and pressure decrease from bottom well to the wellhead, the H 2 S solubility decreases accordingly. Figure 8D  to the well depth but the decreasing trend suddenly turns higher at about 1400 m. No phase transition of H 2 S occurs below 1400 m because the H 2 S concentration dissolved in the drilling fluid is less than the H 2 S solubility. When the H 2 S solubility begins to decrease rapidly at 1400 m, the H 2 S concentration exceeds the H 2 S solubility, and H 2 S gasification starts. Obviously, the H 2 S gasification starting position is deeper at higher H 2 S content, as shown in Figure 7. Moreover, the amount of H 2 S released at a certain position depends on the content of H 2 S. That is, the higher the H 2 S content, the more the H 2 S gasifies. Therefore, the extreme value of the gas void fraction is approximately 0.52, when the H 2 S content is 0%, and reaches 0.72 when the H 2 S content is 60% as shown in Figure 7. Mud displacement was adopted for drilling fluid circulation. In case of an overflow, the level of the mud displacement rises. The pit gain in the mud sump is equal to the gas volume in the wellbore, and it increases with the gas void fraction. Once the pit gain exceeds a set value, the drilling engineer will perform shut-in operations. Thus, in consideration of practical application, the whole simulation of an overflow will be terminated once the pit gain exceeds 7 m 3 . The holdup goes to zero at different depths and different H 2 S contents (as seen in Figure 7) because the gases fail to reach the wellhead at shut-in time and their final elevations in the wellbore are different. Figure 9B exhibits the change in mixture velocity with well depth and time. The final mixture velocity decreases with the increase in the H 2 S content, which can be attributed to the difference in overflow time. Figure 10 shows that the pit gain increases more rapidly after H 2 S release with higher H 2 S content. Therefore, overflow time decreases with the increase in the H 2 S content. Thus, when the H 2 S content is relatively high, the simulation will end before the final velocity reaches a high value.
As shown in Figure 11, in the overflow process of a normal gas well (with H 2 S content of 0%), the single-phase and the gas-liquid two-phase flows appear simultaneously in the annulus wellbore. Three flow patterns, that is, bubble, slug, and churn flow patterns, are found in the gas-liquid two-phase flow. The boundary positions between the single-phase and churn flows, the churn and slug flows, and the slug and bubble flows are approximately 52.4, 850, and 2125 m from the wellhead, respectively. The boundary positions between the single-phase and churn flows, and the churn and slug flows are closer to the wellhead than those in the overflow process of an H 2 S-containing gas well. Moreover, the boundary positions of other flow patterns move downward with the increase in the H 2 S content, and the length of the single-phase flow increases as H 2 S content increases. In summary, with more H 2 S dissolved in the drilling fluid, gas rapidly expands after the H 2 S release, and the flow patterns are more quickly transformed.
Annular pressure is a key parameter for pressure control in the development process of a natural gas well. In Figure 12, in the shallow well section (approximately 750 m from the wellhead), the annular pressure is higher at higher H 2 S content. By contrast, in the deep well section, the annular pressure is higher at lower H 2 S content. This can be attributed to: (a) at a high H 2 S content, more H 2 S gas is released from the drilling fluid with the decrease in pressure and temperature, and as a result, the gas void fraction increases to a higher value in the shallow well section while the annulus liquid pressure of drilling fluid decreases faster in the deep well section; (b) the mixture density is higher at higher H 2 S content. 31 Thus, the annular pressure is higher at higher H 2 S content in the shallow well section, but this phenomenon is not prominent because H 2 S will gasify at shallow well section.
As shown in Figure 13A, the bottom hole pressure drops rapidly at a high H 2 S content after H 2 S is released from the drilling fluid. This is because, as more H 2 S gasifies, the fluid column pressure in the annulus decreases to a lower value, and the bottom hole pressure is lower. Besides, if the overflow is not stopped in time, the pressure difference between the formation pressure and bottom hole pressure will be enlarged, and more gas will flow into the wellbore, causing blowout accident. Figure 13B illustrates the change in shut-in casing pressure with H 2 S content. The shut-in casing pressure is equal to formation pressure minus bottom hole pressure at shut-in time, which is considerably lower with H 2 S content of 0% than that with H 2 S content of 10%. Moreover, the shut-in casing pressure increases, and the rising trend escalates with the increase in H 2 S content, which is because the pressure drop increases with the H 2 S content, and consequently, gas production and initial gas void fraction increase with the H 2 S content, thereby further aggravating the pressure drop. When shut-in operations are performed, the value of the shut-in casing pressure is a measure of the simplicity of performing an operation. A high shut-in casing pressure indicates a complex operation and an increased risk of blowout accidents. Therefore, blowout accidents are more likely to take place at a high H 2 S content. Consequently, during the drilling of a natural gas well, it is always more difficult to detect and deal with an overflow in H 2 S-containing gas wells than in H 2 S-free gas wells because (a) H 2 S typically releases at a position close to the Thus, during the drilling and production of H 2 S gas wells, safety measures must be observed to prevent blowout accidents caused by H 2 S explosions. First, the detection position of wellbore pressure must be close to the well bottom because the change degree in bottom hole pressure corresponds to the H 2 S content; this condition can reflect the degree of overflow quickly and accurately. Second, once the drilling is suddenly accelerated, drillers must stop the operation and observe if an overflow occurs. Third, if pumping pressure decreases and pumping speed increases, drillers must check the outlet flow and drilling pump immediately to determine whether there is an overflow. Finally, the pit gain must be monitored carefully. If the pit gain exceeds the limit, then a shut-in operation must be performed immediately. 33,34

| Effect of mud displacement on overflow characteristics of an H 2 S-containing gas well
Mud displacement, which directly affects the initial liquid velocity, is a significant parameter in drill engineering. 24 Therefore, different mud displacement values (60, 65, and   70 L/s) were selected in combination with field applications to study the effect of mud displacement on the overflow characteristics of an H 2 S-containing gas well. In Figure 14, the mud displacement affects the distribution of gas void fraction in the deep well section, meaning the gas void fraction is higher at a lower mud displacement. This phenomenon can be attributed to the change in initial gas void fraction caused by various mud displacements. The liquid holdup increases with mud displacement while the initial gas void fraction decreases. At the initial stage of an overflow, the gas void fraction is high at a low mud displacement in the same position. Accordingly, in Figure 15, the boundary positions of slug and churn flows are nearly the same at all mud displacements. The length of bubble flow section slightly increases with the increase in the mud displacement.
At the initial stage of an overflow, gas and mixture velocities are both at a low value, as depicted in Figure 16, with relatively minimal gas-liquid velocity difference. However, the friction between gas-liquid and liquid-wall increases as mud displacement increases. Thus, the annulus pressure is higher with higher mud displacement because of the existence of lower friction, but this difference is rather small as demonstrated in Figure 17. Besides, when the mud displacement increases, the gas velocity increases more rapidly under the carrying effect of the liquid. So, the pit gain reaches 7 m 3 more rapidly at higher mud displacement as shown in Figure 18, and the bottom pressure drops more quickly, as exhibited in Figure 19A. It can be learnt from Figure 19B that the shut-in casing pressure almost keeps constant at different mud displacement due to the similarity of overflow degree at different mud displacements.
Besides, H 2 S is released at nearly the same place at different mud displacements as shown in Figure 14. This is because the effects of mud displacement on annular pressure distribution are small. The solubility of H 2 S keeps constant under the same pressure and temperature. In general, the influence of mud displacement on the distributions of circulation pattern and annulus pressure is minimal but significant regarding overflow time. Therefore, a suitable mud displacement must be selected to allow drill engineers to complete the shut-in operation in enough time with less difficulty.

| Effect of drilling fluid density on overflow characteristics of an H 2 S-containing gas well
In the gas-liquid two-phase flow, drilling fluid density, which is an important parameter for calculating gravity and friction pressure drops, also affects other parameters, such as drilling fluid viscosity and heat transfer coefficient. 35 Thus, different drilling fluid densities (1.2, 1.3, and 1.4 g/cm 3 ) were selected in combination with field applications to study the effect of drilling fluid density on the overflow characteristics of an H 2 S-containing gas well. Figure 20 shows that drilling fluid density influences the release position of H 2 S. A lower drilling fluid density indicates a lower gasification starting position. Correspondingly, the length of slug flow increases as the drilling fluid density increases, as depicted in Figure 21. This phenomenon can be attributed to the solubility effect of H 2 S. The release position of H 2 S moves upwards as drilling fluid density increases. Thus, when H 2 S is released, the gas void fraction decreases at a high drilling fluid density, as demonstrated in Figure 20. Therefore, the pit gain increases faster at lower drilling fluid density, as displayed in Figure 22, which can be attributed to the difference in H 2 S solubility in the same position in case of different drilling fluid densities. The annular pressure is higher in the same position in case of a high drilling fluid density. Thus, the solubility of H 2 S increases at the same position in case of a high drilling fluid density. So, the phase change position of H 2 S is closer to the wellhead at higher drilling fluid density. Thus, as the H 2 S solubility increases, less H 2 S is released.
When drilling fluid density increases, the frictions between gas and liquid and between liquid and well ball increase. Thus, the gas and mixture velocities increase more slowly with the drilling fluid density, as exhibited in Figure  23. Drilling fluid density is proportional to the pressure of the fluid column. So, the annular pressure is higher with higher drilling fluid density, as presented in Figure 24. In Figure  25A, the initial and final well bottom pressure values are high with a high drilling fluid density, and correspondingly in Figure 25B, the shut-in casing pressure decreases with the drilling fluid density. Moreover, the overflow time is extended with a high drilling fluid density because the pit gain reached 7m 3 later at higher drilling fluid density. Therefore, the effect on overflow time and casing pressure must be considered comprehensively in designing drilling fluid density.
Therefore, during the drilling of an H 2 S-containing natural gas, the phase change position of H 2 S will be closer to the wellhead at higher drilling fluid density. Using heavier drilling fluid can effectively delay the time of phase transition of H 2 S, therefore leaving more time for drilling engineers to deal with overflow before phase transition of H 2 S.

| Effect of permeability on overflow characteristics of an H 2 S-containing gas well
The reservoir permeability, which reflects the quality of a natural gas reservoir, is a main parameter that influences gas production. 36 Therefore, different reservoir permeability values (30,40, and 50 mD) were selected in combination with the field application to study the effect of reservoir permeability on the overflow characteristics of an H 2 S-containing gas well. As shown in Figure 26, the gas void fraction in the deep well section is high when reservoir permeability is high. Accordingly, slug flow appears early, as illustrated in Figure 27, which can be attributed to the increase in gas invasion volume given the increase in reservoir permeability. Moreover, after gas enters the upper well section, the gas void fraction is the same under different permeability conditions because the gas expansion capacity is limited under the same pressure at the same H 2 S content. 37 This conclusion can also be drawn from Figure 8A, in which the radius change rate of bubble decreases with the well depths of 0-1000 m and 1900-2500 m, and is almost kept constant at a well depth of 1000-1900 m. Thus, the effect of the initial gas invasion volume on the gas void fraction in the shallow well section is reduced. Therefore, the reservoir permeability only affects the annular pressure of the deep well section significantly, and a high reservoir permeability indicates a rapid annular pressure drop, as exhibited in Figure 28. This phenomenon can be attributed to the following reasons: (a) As shown in Figure 29, the gas and mixture velocities increase rapidly at a high reservoir permeability in the latter stage of an overflow, and as a result, the friction between gas and liquid increases. Thus, the annular pressure is higher at higher reservoir permeability; (b) in deep well section, the gas void fraction is high when reservoir permeability is high. Thus, the mixture (gas and liquid) density decreases as permeability increases, and the annular pressure decreases. In summary, the reason 2 dominants reason 1. Moreover, the pit gain increases more quickly at higher reservoir permeability, as displayed in Figure 30, so overflow time declines accordingly. In summary, as the reservoir permeability increases, the bottom hole pressure decreases rapidly, as shown in Figure 31A, and the shut-in casing pressure increases, as shown in Figure 31B.
What needs illustration is that in the shallow well section, the solubility of H 2 S keeps constant under the same pressure and temperature. Thus, the phase change position of H 2 S is In summary, during the drilling of an H 2 S-containing natural gas, drilling into highly permeable gas reservoirs is very dangerous. The initial gas void fraction is high, and the gas invasion volume will be large in highly permeable gas reservoirs. Thus, reaction time upon the discovery of an overflow is minimal, making the shut-in operation much difficult. Therefore, it is necessary to conduct tests on the well to obtain parameters, such as gas reservoir permeability.

| Effect of geothermal gradient on overflow characteristics of an H 2 S-containing gas well
Geothermal gradient determines the formation temperature distribution, thereby greatly influences the temperature distribution inside the annulus in the wellbore. 28 Therefore, different geothermal gradient values (0.02, 0.025, and 0.03°C/m) were selected in combination with the field application to study the effect of geothermal gradient on the overflow characteristics of an H 2 S-containing gas well. Figure 32 shows the distribution of gas void fraction in the annulus at shut-in time with geothermal gradient of 0.020°C/m, 0.025°C/m, and 0.03°C/m. We can draw a conclusion from Figure 32: The gasification starting position (critical point) is deeper at lower geothermal gradient. This is because, with higher geothermal gradient, the wellbore temperature tends to be higher at the same depth, leading to an increase in the H 2 S solubility. Therefore, in the upper well section, when H 2 S gasifies, the annular pressure decreases, and the annular pressure is lower at lower geothermal gradient, as shown in Figure 33. The phase change of H 2 S increases the gas volume in the wellbore, leading to a decrease in bottom hole pressure. Therefore, the higher the geothermal gradient is, the faster the bottom hole pressure decreases, as shown in Figure 34A. Furthermore, the decrease in bottom hole pressure increases the gas expansion at the well bottom. Therefore, in the deep well section, the gas void fraction is higher with lower geothermal gradient. Thus, we can see from Figure 35 that the slug flow appears earlier at lower geothermal gradient. Bubble flow, slug flow, and churn flow are the main flow patterns in the wellbore annulus. When H 2 S gasifies, the gas volume expands rapidly, leading to an increase in gas velocity. The increase in gas velocity is faster at lower geothermal gradient as shown in Figure 36A. Furthermore, under the carrying effect of the gas, the mixture velocity increases faster at lower geothermal gradient as shown in Figure 36B. Thus, the pit gain increases faster with the decrease in geothermal gradient, as shown in Figure 37.
In summary, when drilling a reservoir with low geothermal gradient, H 2 S will gasify at deep well section, leading to a rapid decrease in bottom hole pressure. The shut-in operation gets complicated because the shut-in casing pressure is high at lower geothermal gradient, as shown in Figure 34B. Thus, heating drilling fluid appropriately when drilling a reservoir with low geothermal gradient can prevent premature gasification of H 2 S. 3. An increase in mud displacement indicates the decreases in overflow time. As drilling fluid density increases, the release position of H 2 S moves up, and the overflow time and shut-in casing pressure increase. The initial gas void fraction is higher and the gas invasion volume will be larger in gas reservoirs with higher permeability. As the reservoir permeability increases, the shut-in casing pressure rises while the overflow time declines. With higher geothermal gradient, the wellbore temperature tends to be higher at the same depth, leading to an increase in the H 2 S solubility. The gasification starting position (critical point) is further away from the wellhead at higher geothermal gradient. 4. Only drilling fluid density and H 2 S content have a significant influence on annular pressure distribution. The drilling fluid displacement and permeability have less effect on annular pressure and temperature distribution. The solubility of H 2 S keeps constant under the same pressure and temperature. Thus, the effects of drilling fluid displacement and permeability on phase change or dissolution of H 2 S are not obvious. 5. During the drilling and production of H 2 S gas wells, the detection position of wellbore pressure should be closer to well bottom and the pit gain should be monitored more carefully. The effect on overflow time and shut-in casing pressure should be considered comprehensively in the design of drilling fluid density and mud displacement. Low mud displacement and high drilling fluid density can reduce the risk of blowout to some extent. It is necessary to carry out well testing to obtain gas reservoir permeability and to be prepared for overflow treatment for gas wells with high reservoir permeability. Moreover, heating drilling fluid appropriately when drilling a reservoir with low geothermal gradient can prevent premature gasification of H 2 S. 6. Complicated calculation of phase equilibrium can improve the calculation accuracy of H 2 S solubility, which should be recommended in the future work.