Kick Risk Forecasting and Evaluating During Drilling Based on Autoregressive Integrated Moving Average Model

: Timely forecasting of the kick risk after a well kick can reduce the waiting time after well shut-in and provide more time for well killing operations. At present, the multiphase ﬂow model is used to simulate and forecast the pit gain and casing pressure. Due to the complexity of downhole conditions, calculation of the multiphase ﬂow model is di ﬃ cult. In this paper, the time series analysis method is used to excavate the information contained in the time-varying data of pit gain and casing pressure. A forecasting model based on a time series analysis method of pit gain and casing pressure is established to forecast the pit gain and casing pressure after a kick. To divide the kick risk level and achieve the forecasting of the kick risk before and after well shut-in, kick risk analysis plates based on pit gain and casing pressure are established. Three pit gain cases and one casing pressure case are studied, and a comparison between measured data and predicted data shows that the proposed method has high prediction accuracy and repeatability.


Introduction
During drilling operation, a permanent concern is kick risk forecasting and well control. A kick is defined as the uncontrolled influx of formation fluid or gas into the wellbore, which occurs when the wellbore pressure at a certain location is less than the formation pressure, and requires a well control emergency plan [1]. Influx fluids tend to have a high pressure; a gas kick is much more detrimental than a liquid kick due to gas expansion and, as a result, has a higher variation in pressure. Late kick detection and risk forecast increase the amount of formation fluid that enters the well borehole, which increases the kick pressure and makes it hard to control the kick and can even lead to an uncontrolled blowout. For well control safety, it is necessary to forecast the risk of a kick to reduce the shut-in time of a well and provide more time for the killing operation.
As a kick can pose a significant threat to safety drilling, a lot of work has been devoted to detecting kicks. Nowadays, kick-detection methods have developed from simple thresholding methods [2] into complex intelligent methods based on machine learning [3][4][5][6][7][8][9][10]. Sun et al. [3] proposed one integrated pattern-recognition model consisting of a dynamic multiphase wellbore flow model and improved the piecewise approximation and similarity measure algorithms for kick diagnosis. P. Andia and R. R. Israel [4] utilized a cyber-physical approach that combined physics-based modeling with Bayesian mathematics for detecting a kick. Shi et al. [5] adopted the random forest and support vector machine algorithms to detect a kick during drilling in real-time. Alouhali et al. [6] trained and evaluated five models-Decision Tree, K-Nearest Neighbor (KNN), Sequential Minimal Optimization (SMO)

Mathematical Models
In the field of statistics, a set of random variables arranged in chronological order (X 1 , X 2 , . . . , X t , . . . ) is often used to represent the time series of a random event, denoted as {X t , t∈T}. The n ordered observations of the series are represented by {x t , t = 1, 2,..., n}, referred to as the series of observations of series length n. The purpose of studying time series is to reveal the properties of a random time series {X t }. To get the properties of a random time series {X t }, we need to analyze the properties of its observation series {x t } and infer the properties of the random time series {X t } from the properties of the observation series [25].
As the series of kick characterization parameters, such as the pit gain or casing pressure, are mostly a non-stationary time series, the autoregressive moving average model (ARIMA) is the most suitable [26]. The expression of ARIMA (p,d,q) is ε , E(ε t ε s ) = 0, s t Ex s ε t = 0, ∀s < t (1) where {x t } is the observation series, φ p is the autoregressive coefficient, {ε t } is the random interference series, E is the mean value, Var is the variance, B is the delay operator, d is the differential order, Φ(B) = 1 − φ 1 B − · · · − φ p B p is the autoregressive coefficient polynomial for the stationary reversible ARMA (p,q) model, and Θ(B) = 1 − θ 1 B − · · · − θ q B q is the moving smoothing coefficient polynomial for the stationary reversible ARMA (p,q) model.

Methodology
The steps to establish the model are as follows ( Figure 1): Energies 2019, 12, x FOR PEER REVIEW 3 of 21 moving average model (ARIMA) to predict pit gain before shut-in and casing pressure after shut-in and uses the predicted values of pit gain and casing pressure to analyze the kick risk before and after shut-in.

Mathematical Models
In the field of statistics, a set of random variables arranged in chronological order (X1, X2, …, Xt, …) is often used to represent the time series of a random event, denoted as {Xt, t∈T}. The n ordered observations of the series are represented by {xt, t = 1, 2,..., n}, referred to as the series of observations of series length n. The purpose of studying time series is to reveal the properties of a random time series {Xt}. To get the properties of a random time series {Xt}, we need to analyze the properties of its observation series {xt} and infer the properties of the random time series {Xt} from the properties of the observation series [25].
As the series of kick characterization parameters, such as the pit gain or casing pressure, are mostly a non-stationary time series, the autoregressive moving average model (ARIMA) is the most suitable [26]. The expression of ARIMA (p,d,q) is x is the observation series, p φ is the autoregressive coefficient, { } t ε is the random interference series, E is the mean value, Var is the variance, B is the delay operator, d is the differential order,

Methodology
The steps to establish the model are as follows ( Figure 1): Steps to establish the forecast model, AC is the autocorrelation coefficient and PAC is the partial autocorrelation coefficient A gas well named SC-X1 in Sichuan Basin encountered a gas kick during the drilling of the gas zone. Figure 2 is a time sequence diagram of the measured pit gain data before well shut-in. This is used to introduce how to use this methodology in combination with the theoretical model. Steps to establish the forecast model, AC is the autocorrelation coefficient and PAC is the partial autocorrelation coefficient.
A gas well named SC-X1 in Sichuan Basin encountered a gas kick during the drilling of the gas zone. Figure 2 is a time sequence diagram of the measured pit gain data before well shut-in. This is used to introduce how to use this methodology in combination with the theoretical model.

Stationarity Test of Parameter Series
There are three main methods that test the stability of the parameter series-the time series diagram test, the autocorrelation diagram test, and the unit root test [27]:

Time Series Diagram Test
For a stationary parametric time series, the series' mean and variance are constant, so the sequence shown in the sequence diagram fluctuates around a constant value and the range of fluctuation is bounded. If the sequence presents an obvious trend and periodicity, the sequence is not stable.

Autocorrelation Diagram Test
The stationary series has a short-term correlation, that is, the autocorrelation coefficient (ACF), ˆk ρ , of the parameter sequence decays to zero quickly with the increase in the number of delay periods, k. However, for non-stationary series, the autocorrelation coefficient decays to zero faster than the stationary series: whereˆ( ) k γ is the estimation of the delayed k-phase auto-covariance function andˆ(0) γ is the estimation of the population variance:

Unit Root Test
By calculating the augmented Dickey-Fuller (ADF) test statistic of the series, it can be compared with the critical value of the τ test statistic to calculate the probability of the critical value being less than the τ test statistic. A probability, P, of less than 0.05 indicates that the series is stable.
The hypotheses H0: Xt is non-stationary and H1: Xt is stationary and are tested with the regression equation . H0 is accepted with a P-value > 0.05, otherwise H1 is accepted.

Stationarity Test of Parameter Series
There are three main methods that test the stability of the parameter series-the time series diagram test, the autocorrelation diagram test, and the unit root test [27]:

Time Series Diagram Test
For a stationary parametric time series, the series' mean and variance are constant, so the sequence shown in the sequence diagram fluctuates around a constant value and the range of fluctuation is bounded. If the sequence presents an obvious trend and periodicity, the sequence is not stable.

Autocorrelation Diagram Test
The stationary series has a short-term correlation, that is, the autocorrelation coefficient (ACF),ρ k , of the parameter sequence decays to zero quickly with the increase in the number of delay periods, k. However, for non-stationary series, the autocorrelation coefficient decays to zero faster than the stationary series: whereγ(k) is the estimation of the delayed k-phase auto-covariance function andγ(0) is the estimation of the population variance:γ

Unit Root Test
By calculating the augmented Dickey-Fuller (ADF) test statistic of the series, it can be compared with the critical value of the τ test statistic to calculate the probability of the critical value being less than the τ test statistic. A probability, P, of less than 0.05 indicates that the series is stable.
From Figure 2 it can be seen that there is a marked downward trend in the sequence diagram. Figure 3 shows the autocorrelation coefficient and the partial autocorrelation coefficient of the pit gain time series, and it can be seen that the autocorrelation coefficient decreases slowly to zero and the  The unit root test results of the  pit gain time series are shown in Table 1, and the probability (P) of the ADF test statistic is greater than 0.05. Therefore, the pit gain series is not a stationary sequence and can be derived from Figure 2, Figure 3, and Table 1. To establish the time series prediction model, differential processing is needed. From Figure 2 it can be seen that there is a marked downward trend in the sequence diagram. Figure 3 shows the autocorrelation coefficient and the partial autocorrelation coefficient of the pit gain time series, and it can be seen that the autocorrelation coefficient decreases slowly to zero and the autocorrelation coefficient map shows obvious triangular symmetry. The unit root test results of the pit gain time series are shown in Table 1, and the probability (P) of the ADF test statistic is greater than 0.05. Therefore, the pit gain series is not a stationary sequence and can be derived from Figure  2, Figure 3, and Table 1. To establish the time series prediction model, differential processing is needed.

Processing of Non-Stationary Parameter Series
For non-stationary parameter series, it is necessary to process and extract the effective information in the sequence, that is, the deterministic information contained in the series. Generally, the difference method is used to extract the deterministic information of non-stationary series [28]. Figure 4 shows the autocorrelation coefficient and partial autocorrelation coefficient of the pit gain time series after the first-order difference. Table 2 shows the unit root test results of the pit gain time series after the first-order difference. As the probability (P) of the ADF test statistic is greater than 0.05, the series is still not a stationary sequence after the first-order difference, and second-order differential processing is needed.

Processing of Non-Stationary Parameter Series
For non-stationary parameter series, it is necessary to process and extract the effective information in the sequence, that is, the deterministic information contained in the series. Generally, the difference method is used to extract the deterministic information of non-stationary series [28]. Figure 4 shows the autocorrelation coefficient and partial autocorrelation coefficient of the pit gain time series after the first-order difference. Table 2 shows the unit root test results of the pit gain time series after the first-order difference. As the probability (P) of the ADF test statistic is greater than 0.05, the series is still not a stationary sequence after the first-order difference, and second-order differential processing is needed. From Figure 2 it can be seen that there is a marked downward trend in the sequence diagram. Figure 3 shows the autocorrelation coefficient and the partial autocorrelation coefficient of the pit gain time series, and it can be seen that the autocorrelation coefficient decreases slowly to zero and the autocorrelation coefficient map shows obvious triangular symmetry. The unit root test results of the pit gain time series are shown in Table 1, and the probability (P) of the ADF test statistic is greater than 0.05. Therefore, the pit gain series is not a stationary sequence and can be derived from Figure  2, Figure 3, and Table 1. To establish the time series prediction model, differential processing is needed.

Processing of Non-Stationary Parameter Series
For non-stationary parameter series, it is necessary to process and extract the effective information in the sequence, that is, the deterministic information contained in the series. Generally, the difference method is used to extract the deterministic information of non-stationary series [28]. Figure 4 shows the autocorrelation coefficient and partial autocorrelation coefficient of the pit gain time series after the first-order difference. Table 2 shows the unit root test results of the pit gain time series after the first-order difference. As the probability (P) of the ADF test statistic is greater than 0.05, the series is still not a stationary sequence after the first-order difference, and second-order differential processing is needed.   Figure 5 shows the autocorrelation coefficient and partial autocorrelation coefficient of the pit gain time series after the second-order difference; the second-order difference series has a strong short-term correlation. Table 3 shows the unit root test results of the pit gain time series after the second-order difference. The probability (P) of the ADF test statistic is less than 0.05. Therefore, the series is stable after the second-order difference, and the model can be established.    Figure 5 shows the autocorrelation coefficient and partial autocorrelation coefficient of the pit gain time series after the second-order difference; the second-order difference series has a strong short-term correlation. Table 3 shows the unit root test results of the pit gain time series after the second-order difference. The probability (P) of the ADF test statistic is less than 0.05. Therefore, the series is stable after the second-order difference, and the model can be established.

Model Identification and Order Determination
The values of the autocorrelation coefficient (ACF) and partial autocorrelation coefficient (PACF) are calculated to determine p and q, that is, to identify and order the model [29]: According to the autocorrelation and partial autocorrelation diagram of the second-order difference of the pit gain series, shown in Figure 5, the preliminary order of the model can be determined. It can be seen from the figure that the autocorrelation coefficients fall within two standard deviations after delaying the first-order difference and exhibit tailing. The partial autocorrelation coefficients are within two standard deviations after delaying the first-order

Model Identification and Order Determination
The values of the autocorrelation coefficient (ACF) and partial autocorrelation coefficient (PACF) are calculated to determine p and q, that is, to identify and order the model [29]: According to the autocorrelation and partial autocorrelation diagram of the second-order difference of the pit gain series, shown in Figure 5, the preliminary order of the model can be determined. It can be seen from the figure that the autocorrelation coefficients fall within two standard deviations after delaying the first-order difference and exhibit tailing. The partial autocorrelation coefficients are within two standard deviations after delaying the first-order difference and exhibit tailing. Therefore, it can be preliminarily determined that p = 4 or 5 and q = 1, and the model can be preliminarily determined to be either ARIMA (4,2,1) or ARIMA (5,2,1).

Model Validity Test
After the model is fitted, it is necessary to test or evaluate the effectiveness of the fit of the model. If the fitting effect does not meet the evaluation requirements, it needs to be remodeled. This mainly includes a residual analysis and significant analysis of the parameters [30]:

Residual Analysis
For a model with a good degree of fit, the useful information in the measurement sequence should be extracted. The fitting residual term should have no information related to the sequence, that is, its residual term should tend toward a white noise sequence.
The white noise test process is as follows: it is assumed that the sequence values of the delay period, less than or equal to the m period, are independent of each other, and the Q-statistic method is used for analysis: where n is the measurement sequence period and m is the delay period.
The Q-statistic approximately obeys the chi-square distribution with a degree of freedom of m: It can be seen from Equation (7) that when the Q-statistic is greater than the quantile χ 1−α 2 (m) or if the P-statistic is greater than α, then the hypothesis is accepted and the residual sequence is a white noise sequence.

Significance Test of Parameters
Through the significance test of the parameters, it can be tested whether the unknown parameter is significant to zero, which makes the fitted model more compact and more convenient for predictive calculation.
The test begins with the following assumptions: where β is the least-squares estimation.
n−m . Thus, a test statistic (T-test statistic) can be constructed for testing the significance of unknown parameters: When |T| ≥ t 1−α (n − m), the parameters are significant. The probability (P-value) of the test statistics can also be used for analysis. When P is less than α, the parameters are significant. Table 4 shows the results of the model parameter significance τ statistic test (P-value), and models with P-values less than 0.05 are ARIMA (4,2,1)_d, ARIMA (4,2,1)_h, ARIMA (5,2,1)_l, and ARIMA (5,2,1)_p, that is, all the parameters of the these four models are significant.

Model Optimization
Since more than one model passes the test, to select the optimal model, the model needs to be optimized and selected. The criteria for optimal selection are the Akaike Information Criterion (AIC) and the Bayesian Information Criterion (SBC)-the optimal model being when the AIC and SBC of the fitted model are the smallest [31]: where MLE is the maximum likelihood estimate and NUP is the number of unknown parameters in the model. Table 5 shows the white noise test results and the AIC and SBC values of the four models' residual sequences. It can be seen that the P-values of the Q-statistics of the ARIMA (4,2,1)_h and ARIMA (5,2,1)_p models are greater than 0.05, and their residual sequences are white noise sequences, which satisfy the white noise test. Compared with the AIC and SBC of the ARIMA (4,2,1)_h model and the ARIMA (5,2,1)_p model, the AIC (−3.9) and SBC (−3.7) of ARIMA (4,2,1)_h model are smaller, so the ARIMA (4,2,1)_h model is the best model.

Parameter Estimation
The parameter estimation determines the model structure and order to establish the ARIMA (p,d,q) and then estimate the value of the unknown parameter in the model. In this paper, the least-squares estimation is used for the parameter estimation [32].
For the ARIMA (p,d,q) model, Its residual term is The sum of the squared residuals is The least-squares estimate of β is a set of parameters that minimizes the sum of the squared residuals.
The model parameters are shown in Table 6.

Forecasting
Future parameters are predicted based on the principle of the minimum mean square error [33]. The ARIMA (p,d,q) model can be represented by a linear function of random perturbation terms, namely, . ψ 1 , ψ 2 , · · · satisfy the following formula: Thus, the true value of x t+l can be obtained with However, the parameters ε t+l and ε t+l−1 cannot be directly obtained, so the estimated value of Energies 2019, 12, 3540 10 of 21 The mean square error between the true and estimated values is In the case of minimizing the mean square error (when ψ * j = ψ l+ j ), the estimated value of the l-period isx The l-period estimation error is Therefore, the estimated value plus the estimated error is the true value of the prediction: Figure 6 is the result of forecasting pit gain after 5 min using the ARIMA (4,2,1) model. It can be seen from the figure that the pit gain has not reached 2 m 3 at 12 min, and the well has not been closed at this time. By predicting the pit gain after 5 min, the predicted pit gain has reached 3.18 m 3 and it is also showing a gradually increasing trend.
However, the parameters t l ε + and 1 t l ε + − cannot be directly obtained, so the estimated value of The mean square error between the true and estimated values is In the case of minimizing the mean square error (when , the estimated value of the l-period is x l ψ ε ψ ε ψ ε The l-period estimation error is Therefore, the estimated value plus the estimated error is the true value of the prediction: Figure 6 is the result of forecasting pit gain after 5 min using the ARIMA (4,2,1) model. It can be seen from the figure that the pit gain has not reached 2 m 3 at 12 min, and the well has not been closed at this time. By predicting the pit gain after 5 min, the predicted pit gain has reached 3.18 m 3 and it is also showing a gradually increasing trend.

Forecast Performance Measure
The mean relative error (MRE) is used for assessing the quality of the forecast. MRE can be considered as the mean of the relative values of the forecast errors and can be expressed with the following formula: where y t is the realized value at time period t, y is the forecast about that period, and N is the number of data points.

Kick Severity Analysis
3.9.1. Analysis of the Kick Severity before Closing the Well It can be seen from the permeation fluid mechanics and natural gas reservoir engineering that when drilling a gas-bearing reservoir the negative pressure difference at the bottom of the well has not yet reached the boundary of the formation, so the fluid flow in the formation can be regarded as the plane radial flow in an infinitely homogeneous isotropic gas reservoir. At this point, the rate at which natural gas invades the wellbore is [34] where Q g is the gas flow rate from the formation into the wellbore in m 3 /d, P i is the supply pressure in MPa, P w f (t) is the bottom hole pressure in MPa, K is the effective permeability in µm 2 , h is the effective thickness of the gas reservoir layer in m, B g is the volume coefficient of gas, µ is the gas viscosity in mPa·s, Z is the natural gas compression factor, T is the formation temperature in K, η is the pressure transmitting coefficient in µm 2 ·MPa/(mPa·s), t is the invasion time in h, and r w is the borehole radius in m.
The amount of natural gas that invades the wellbore in t days is where V is the amount of natural gas that has invaded the wellbore in t time in m 3 and t is the invasion time in h. From Equation (27) and Equation (28), it can be seen that the amount of gas intrusion is related to the reservoir parameters, bottom hole pressure, and time. The pit gain and the growth rate of the pit gain (the change rate of pit gain with time) can reflect the severity of a kick. In the curve of pit gain over time, several horizontal lines are used to distinguish the pit gain level and several straight lines with different slopes are used to distinguish the pit gain rate. Therefore, the kick severity analysis chart before closing the well includes several horizontal lines of pit gain and several oblique lines of the pit gain change rate. According to the well control standard and related operation specifications of the Chuandong area in China [35], the maximum pit gain should not exceed 3 m 3 when drilling the reservoir and the well should be shut in when the overflow is 2 m 3 . Moreover, according to relevant statistics in more than 100 wells, more than two-thirds of the wells had a time interval from the discovery of overflow to the blowout of less than 30 min with more than half of the two-thirds being within 10 min [36]. The kick severity analysis chart based on well control standards and statistical data before closing the well is shown in Figure 7.   Figure 7, there are pit gain vs. time curves for two kicks that are used to evaluate the kick severity. Kick 1 and Kick 2's pit gains are located in Area ① and Area ②, respectively. Comparing the Kick 1 curve and the Kick 2 curve, the pit gain of Kick 1 is 3.5 m 3 , while Kick 2 has a pit gain of 2.5 m 3 in the same time. The pit gain before the well closes is the direct parameter of the kick tolerance and is used to judge whether the well can be shut down safely and to  Figure 7, there are pit gain vs. time curves for two kicks that are used to evaluate the kick severity. Kick 1 and Kick 2's pit gains are located in Area 1 and Area 2 , respectively. Comparing the Kick 1 curve and the Kick 2 curve, the pit gain of Kick 1 is 3.5 m 3 , while Kick 2 has a pit gain of 2.5 m 3 in the same time. The pit gain before the well closes is the direct parameter of the kick tolerance and is used to judge whether the well can be shut down safely and to select killing methods. The kick tolerance is a quantity that represents the amount of residual energy in the process of well killing after a kick occurs. The larger the pit gain's volume, the smaller the kick tolerance, the greater the well shut-down risk, and the greater the risk of conventional killing. Thus, the kick severity of Area 1 is greater than that of Area 2 . The results are as follows: in Area 1 , the pit gain is very large, with a rapid development trend and the greatest risk of kick; in Area 2 , the pit gain is large, with a rapid development trend and a very high kick risk; in Area 3 , the pit gain is less, but its development trend is rapid, and the kick risk is greater; in Area 4 , the pit gain is very large, there is a certain development trend, and the kick risk is very high; in Area 5 , the pit gain is large, there is a certain development trend, and the kick risk is relatively large; in Area 6 , the pit gain is less, there is a slower development trend, and the kick risk is relatively small; in Area 7 , the pit gain is very large, but the pit gain develops slowly, and there is a large kick risk; in Area 8 , the pit gain is large, but the development is slow, and there is a certain kick risk; and in Area 9 , the pit gain is small, the pit gain develops slowly, and the kick risk is small. The order of the kick severity before closing the well is 1 > 2 > 4 > 5 > 7 > 3 > 8 > 6 > 9 .

Analysis of the Kick Severity after Shut-in
After well shut-in, the casing pressure will gradually increase under the influence of wellbore afterflow. When the bottom hole pressure and formation pressure are balanced, the casing pressure tends to be stable, and this point is the "analysis point" that is used to analyze the severity of the kick risk.
The increase in value of the casing pressure during shut-in depends on the difference between the formation pressure and the bottom hole pressure-the greater the difference, the greater the casing pressure, and the more serious the kick risk. Through the analysis of the casing pressure, the size of the unbalance between the bottom hole pressure and the formation pressure can be evaluated, and then the size of the kick risk can be analyzed.
When the underbalanced pressure difference between the formation pressure and the bottom hole pressure is constant, the formation coefficient is proportional to the increase in the casing pressure, that is, the slope of the casing pressure and time can be used to characterize the formation coefficient. The larger the slope is, the larger the formation coefficient is, and the faster the casing pressure increases, the more serious the kick risk is [37]. Through the analysis of the casing pressure recovery curve, the size of the kick risk can be analyzed. The kick severity analysis chart based on the casing pressure recovery curve during the well shut-in period is shown in Figure 3.
In the shut-in casing pressure recovery curve, the pressure value of the analysis point represents the degree of unbalance between the formation pressure and the bottom hole pressure and several pressure value horizontal lines are used to distinguish the casing pressure level. The slope from the analysis point to the starting point indicates the speed at which the casing pressure recovers, which is affected by the formation coefficient. Therefore, the kick severity analysis chart during the well shut-in period includes several horizontal lines dividing the pressure level and several oblique lines dividing the rate of change in the casing pressure. According to information on some wells in the Sichuan Basin in China, the low-medium pressure limit is 4.5 MPa, the medium-high pressure limit is 9 MPa, the lower slope is tan20 • , and the medium-high slope is tan45 • , as shown in Figure 8. It should be noted that the specific values of the pressure limit and the curve slope in other regions were adjusted according to the different stratigraphic conditions of the corresponding regions [37]. Figure 8 is divided into nine regions according to the casing pressure and the casing pressure increase rate. Additionally, in Figure 8, there are casing pressure vs. time curves for two kicks that were used to evaluate the kick and well control severity. Kick 3 and Kick 4's casing pressures are located in Area 1 and Area 7 , respectively. Comparing the Kick 3 curve and Kick 4 curve, it takes 10 min and 45 min to restore a stable casing pressure, respectively. Although the underbalanced pressure difference between the formation pressure and the bottom hole pressure is the same, the velocity of pressure transfer varied greatly. As the velocity of pressure transfer depends largely on the formation coefficient, such as permeability, porosity, and reservoir thickness, the larger the formation coefficient, the faster the pressure transfer velocity. During a well killing operation, by adjusting the opening of the ground valve, the bottom hole pressure should be controlled within a safe range above the formation pressure. However, in a high temperature and high pressure deep well, the complex law of bottom hole pressure changes making it difficult to maintain a safe range, which could cause a secondary kick and increases the difficulty of well killing. Owing to being under the same time and underbalanced pressure conditions, the larger the formation coefficient, the more gas is intruded, and the greater the well control risk. Thus, the kick and well control severity of Area 1 is greater than that of Area 7 . The results are as follows: in Area 1 , the kick is very serious and the risk to well control is very large; in Area 2 , the kick is serious and the well control risk is large; in Area 3 , the kick severity is medium and the well control has a certain difficulty risk; in Area 4 , the kick is more serious and the risk to well control is larger; in Area 5 , the overflow is small and the well control has some risks; in Area 6 , there is a slight risk of a kick and no well control; in Area 7 , the kick is small and the well control has some risks; in Area 8 , there is a slight risk of a kick and no well control; and in Area 9 , there is no overflow risk and no well control risk. The order of the kick severity during the well closed period is 1 Energies 2019, 12, x FOR PEER REVIEW 13 of 21 recovery curve, the size of the kick risk can be analyzed. The kick severity analysis chart based on the casing pressure recovery curve during the well shut-in period is shown in Figure 3.
In the shut-in casing pressure recovery curve, the pressure value of the analysis point represents the degree of unbalance between the formation pressure and the bottom hole pressure and several pressure value horizontal lines are used to distinguish the casing pressure level. The slope from the analysis point to the starting point indicates the speed at which the casing pressure recovers, which is affected by the formation coefficient. Therefore, the kick severity analysis chart during the well shut-in period includes several horizontal lines dividing the pressure level and several oblique lines dividing the rate of change in the casing pressure. According to information on some wells in the Sichuan Basin in China, the low-medium pressure limit is 4.5 MPa, the medium-high pressure limit is 9 MPa, the lower slope is tan20°, and the medium-high slope is tan45°, as shown in Figure 8. It should be noted that the specific values of the pressure limit and the curve slope in other regions were adjusted according to the different stratigraphic conditions of the corresponding regions [37].   Figure 8, there are casing pressure vs. time curves for two kicks that were used to evaluate the kick and well control severity. Kick 3 and Kick 4's casing pressures are located in Area ① and Area ⑦, respectively. Comparing the Kick 3 curve and Kick 4 curve, it takes 10 min and 45 min to restore a stable casing pressure, respectively. Although the underbalanced pressure difference between the formation pressure and the bottom hole pressure is the same, the velocity of pressure transfer varied greatly. As the velocity of pressure transfer depends largely on the formation coefficient, such as permeability, porosity, and reservoir thickness, the larger the formation coefficient, the faster the pressure transfer velocity. During a well killing operation, by adjusting the opening of the ground valve, the bottom hole pressure should be controlled within a safe range above the formation pressure. However, in a high temperature and high pressure deep well, the complex law of bottom hole pressure changes making it difficult to maintain a safe range, which could cause a secondary kick and increases the difficulty of well killing. Owing to being under the same time and underbalanced pressure conditions, the larger the formation coefficient, the more gas is intruded, and the greater the well control risk. Thus, the kick and well control severity of Area ① is greater than that of Area ⑦. The results are as follows: in Area ①, the kick is very serious and the risk to well control is very large; in Area ②, the kick is serious and the well control risk is large;

Results and Discussion
In this section, the proposed method is applied to the kick severity forecast in several wells, which is based on the prediction of pit gain and casing pressure.

Case Study One
In Section 3, the pit gain forecasting model ARIMA (4,2,1) of well SC-X1 was established; Figure 9 shows the measured data and predicted values of pit gain vs. time in different periods. Figure 9a-c show that with an increase in prediction time, the MRE increases gradually (from 8.3% to 8.7% and then to 14%). Specifically, the prediction accuracy decreases with an increase in prediction time, which can also be obtained from Figure 9d,e. By comparing Figure 9a,d, we can see that the more measured data there are, the smaller the MRE is (8.3% and 8%), which can also be obtained from Figure 9b,e. Overall, the MRE based on the measurement data period of 0 to~8.5 min is small (less than 8.2%).

Results and Discussion
In this section, the proposed method is applied to the kick severity forecast in several wells, which is based on the prediction of pit gain and casing pressure.

Case Study One
In Section 3, the pit gain forecasting model ARIMA (4,2,1) of well SC-X1 was established; Figure  9 shows the measured data and predicted values of pit gain vs. time in different periods.   Figure 9c show that with an increase in prediction time, the MRE increases gradually (from 8.3% to 8.7% and then to 14%). Specifically, the prediction accuracy decreases with an increase in prediction time, which can also be obtained from Figure 9d and Figure  9e. By comparing Figure 9a and Figure 9d, we can see that the more measured data there are, the smaller the MRE is (8.3% and 8%), which can also be obtained from Figure 9b and Figure 9e. Overall, the MRE based on the measurement data period of 0 to ~8.5 min is small (less than 8.2%). Figure 10 is the result of forecasting the pit gain after 5 min using the ARIMA (4,2,1) model. The forecasted curve is plotted in the kick severity analysis chart based on the pit gain volume increment. It can be seen from the figure that the data are located in Area ⑥ before the prediction, the pit gain has not reached 2 m 3 at 12 min, and the well has not been closed at this time. By predicting the pit gain after 5 min, it can be seen that the pit gain curve is already in Area ④. At this time, the predicted pit gain has reached 3.18 m 3 and is also showing a gradually increasing trend. The well control risk is already large-the well needs to be immediately shut down and the appropriate well control measures need to be selected.  Figure 10 is the result of forecasting the pit gain after 5 min using the ARIMA (4,2,1) model. The forecasted curve is plotted in the kick severity analysis chart based on the pit gain volume increment. It can be seen from the figure that the data are located in Area 6 before the prediction, the pit gain has not reached 2 m 3 at 12 min, and the well has not been closed at this time. By predicting the pit gain after 5 min, it can be seen that the pit gain curve is already in Area 4 . At this time, the predicted pit gain has reached 3.18 m 3 and is also showing a gradually increasing trend. The well control risk is already large-the well needs to be immediately shut down and the appropriate well control measures need to be selected.

Case Study Two
In this case, one well in [3] is used for analysis; the time sequence diagram of the pit gain before well shut-in is shown in Figure 11. Using the same modeling process as described in Section 3, the model ARIMA (2,2,1) is established. Figure 12 shows the measured data and predicted values of the

Case Study Two
In this case, one well in [3] is used for analysis; the time sequence diagram of the pit gain before well shut-in is shown in Figure 11. Using the same modeling process as described in Section 3, the model ARIMA (2,2,1) is established. Figure 12 shows the measured data and predicted values of the pit gain vs. time in different periods.

Case Study Two
In this case, one well in [3] is used for analysis; the time sequence diagram of the pit gain before well shut-in is shown in Figure 11. Using the same modeling process as described in Section 3, the model ARIMA (2,2,1) is established. Figure 12 shows the measured data and predicted values of the pit gain vs. time in different periods.

Case Study Two
In this case, one well in [3] is used for analysis; the time sequence diagram of the pit gain before well shut-in is shown in Figure 11. Using the same modeling process as described in Section 3, the model ARIMA (2,2,1) is established. Figure 12 shows the measured data and predicted values of the pit gain vs. time in different periods.  From Figure 12, the same rule as Figure 9 can be obtained. Figure 12a, Figure 12b, and Figure  12c show that with an increase in the prediction time, the MRE increases gradually (from 8.6% to 13.4% and then to 20.2%). Specifically, the prediction accuracy decreases with the increase in prediction time, which can also be obtained from Figure 12d and Figure 12e. By comparing Figure  12a and Figure 12d, it can be seen that the more measured data there are, the smaller the MRE is (8.6% and 3.6%), which can also be obtained from Figure 12b and Figure 12e. Overall, the MRE based on the measurement data period 0 to ~129 s is small (less than 5.4%). Figure 13 is the result of the forecasted pit gain in the next 54 s using the ARIMA (2,2,1) model. The forecasted curve is plotted in the kick severity analysis chart based on the pit gain volume increment. It can be seen from the figure that the data are located in Area ⑥ before the prediction, the pit gain is less, there is a slower development trend, and the kick risk is relatively small. By predicting the pit gain after 54 s, it can be seen that the pit gain curve is already in Area ③, and although the pit gain is less, its development trend is rapid and the kick risk is greater. Thus, it needs to be immediately shut down and the appropriate well control measures need to be selected. From Figure 12, the same rule as Figure 9 can be obtained. Figure 12a-c show that with an increase in the prediction time, the MRE increases gradually (from 8.6% to 13.4% and then to 20.2%). Specifically, the prediction accuracy decreases with the increase in prediction time, which can also be obtained from Figure 12d,e. By comparing Figure 12a,d, it can be seen that the more measured data there are, the smaller the MRE is (8.6% and 3.6%), which can also be obtained from Figure 12b,e. Overall, the MRE based on the measurement data period 0 to~129 s is small (less than 5.4%). Figure 13 is the result of the forecasted pit gain in the next 54 s using the ARIMA (2,2,1) model. The forecasted curve is plotted in the kick severity analysis chart based on the pit gain volume increment. It can be seen from the figure that the data are located in Area 6 before the prediction, the pit gain is less, there is a slower development trend, and the kick risk is relatively small. By predicting the pit gain after 54 s, it can be seen that the pit gain curve is already in Area 3 , and although the pit gain is less, its development trend is rapid and the kick risk is greater. Thus, it needs to be immediately shut down and the appropriate well control measures need to be selected. 12a and Figure 12d, it can be seen that the more measured data there are, the smaller the MRE is (8.6% and 3.6%), which can also be obtained from Figure 12b and Figure 12e. Overall, the MRE based on the measurement data period 0 to ~129 s is small (less than 5.4%). Figure 13 is the result of the forecasted pit gain in the next 54 s using the ARIMA (2,2,1) model. The forecasted curve is plotted in the kick severity analysis chart based on the pit gain volume increment. It can be seen from the figure that the data are located in Area ⑥ before the prediction, the pit gain is less, there is a slower development trend, and the kick risk is relatively small. By predicting the pit gain after 54 s, it can be seen that the pit gain curve is already in Area ③, and although the pit gain is less, its development trend is rapid and the kick risk is greater. Thus, it needs to be immediately shut down and the appropriate well control measures need to be selected.  Figure 14 is the time sequence diagram of the casing pressure during well shut-in, and it can be seen that there is a marked upward trend in the sequence diagram. Figure 14 shows the autocorrelation coefficient and partial autocorrelation coefficient of the casing pressure time series. It shows that the autocorrelation coefficient decreases to zero slowly, and the autocorrelation coefficient graph shows obvious triangular symmetry. Therefore, the casing pressure sequence is not a stationary sequence and needs differential processing.  Figure 14 is the time sequence diagram of the casing pressure during well shut-in, and it can be seen that there is a marked upward trend in the sequence diagram. Figure 14 shows the autocorrelation coefficient and partial autocorrelation coefficient of the casing pressure time series. It shows that the autocorrelation coefficient decreases to zero slowly, and the autocorrelation coefficient graph shows obvious triangular symmetry. Therefore, the casing pressure sequence is not a stationary sequence and needs differential processing.  Figure 15 shows the autocorrelation coefficient and partial autocorrelation coefficient of the casing pressure time series after the first-order difference; the first-order difference series has a strong short-term correlation. Table 7 shows the unit root test results of the casing pressure time series after the first-order difference; the probability (P) of the ADF test statistic is less than 0.05. Therefore, the series after the first-order difference is stable, and the model can be established.   Figure 15 shows the autocorrelation coefficient and partial autocorrelation coefficient of the casing pressure time series after the first-order difference; the first-order difference series has a strong short-term correlation. Table 7 shows the unit root test results of the casing pressure time series after the first-order difference; the probability (P) of the ADF test statistic is less than 0.05. Therefore, the series after the first-order difference is stable, and the model can be established.  Based on the autocorrelation and partial autocorrelation diagram of the first-order difference of the casing pressure shown in Figure 16, the preliminary order of the model can be determined. It can be seen from the figure that both the autocorrelation coefficient and partial autocorrelation coefficient fall within two standard deviations after the delay of the first-order, and the model is established by ARIMA (1,1,1). Table 8 shows the residual white noise test of the ARIMA (1,1,1) model. The probability P-value of the Q-statistic is greater than 0.05, so the residual sequence is a white noise sequence, which satisfies the model's requirements. Table 9 shows the ARIMA (1,1,1) model's unknown parameter prediction and the τ statistic's probability P-value. The P-value is less than 0.05, so the model meets the requirements.  Based on the autocorrelation and partial autocorrelation diagram of the first-order difference of the casing pressure shown in Figure 16, the preliminary order of the model can be determined. It can be seen from the figure that both the autocorrelation coefficient and partial autocorrelation coefficient fall within two standard deviations after the delay of the first-order, and the model is established by ARIMA (1,1,1). Table 8 shows the residual white noise test of the ARIMA (1,1,1) model. The probability P-value of the Q-statistic is greater than 0.05, so the residual sequence is a white noise sequence, which satisfies the model's requirements. Table 9 shows the ARIMA (1,1,1) model's unknown parameter prediction and the τ statistic's probability P-value. The P-value is less than 0.05, so the model meets the requirements.   Figure 17, the same rules as Figure 9 and Figure 12 can be obtained. Figure 17a and Figure  17b show that with an increase in prediction time, the MRE increases gradually (from 2.1% to 4%).   From Figure 17, the same rules as Figures 9 and 12 can be obtained. Figure 17a,b show that with an increase in prediction time, the MRE increases gradually (from 2.1% to 4%). Specifically, the prediction accuracy decreases with the increase of prediction time. Generally speaking, the MRE is small (less than 4%). Figure 16. Autocorrelation coefficient and partial autocorrelation coefficient of the casing pressure time series after the first-order difference.  Figure 17, the same rules as Figure 9 and Figure 12 can be obtained. Figure 17a and Figure  17b show that with an increase in prediction time, the MRE increases gradually (from 2.1% to 4%). Specifically, the prediction accuracy decreases with the increase of prediction time. Generally speaking, the MRE is small (less than 4%).  Figure 18 shows the change in casing pressure after well shut-in. The ARIMA (1,1,1) model is constructed by the time series method to predict the future casing pressure. It is predicted that the reading point of the casing pressure will be in Area ④, the kick will be more serious, and the risk to well control will be larger, so it needs to be dealt with in time.  Figure 18 shows the change in casing pressure after well shut-in. The ARIMA (1,1,1) model is constructed by the time series method to predict the future casing pressure. It is predicted that the reading point of the casing pressure will be in Area 4 , the kick will be more serious, and the risk to well control will be larger, so it needs to be dealt with in time.

Discussion
The application of this paper can be divided into two stages-the prediction of pit gain before well shut-in and the prediction of casing pressure after well shut-in. After the occurrence of a kick, the prediction model is established based on the real-time data of the previous pit gain, the development trend of the pit gain is predicted, and the next step is taken with reference to the predicted pit gain. If the predicted pit gain is small (for example less than 2 m 3 ), for the commonly used managed pressure drilling technology at present, the well may not need to be shut in. By adjusting the surface equipment of managed pressure drilling, the bottom hole pressure can be increased, the kick can be recycled out, and drilling time can be saved. If the predicted overflow is large (for example more than 2 m 3 ), closing the well before 2 m 3 can reduce formation fluid intrusion, which will be helpful to reduce the risk of a killing operation. After well shut-in, it is generally

Discussion
The application of this paper can be divided into two stages-the prediction of pit gain before well shut-in and the prediction of casing pressure after well shut-in. After the occurrence of a kick, the prediction model is established based on the real-time data of the previous pit gain, the development trend of the pit gain is predicted, and the next step is taken with reference to the predicted pit gain. If the predicted pit gain is small (for example less than 2 m 3 ), for the commonly used managed pressure drilling technology at present, the well may not need to be shut in. By adjusting the surface equipment of managed pressure drilling, the bottom hole pressure can be increased, the kick can be recycled out, and drilling time can be saved. If the predicted overflow is large (for example more than 2 m 3 ), closing the well before 2 m 3 can reduce formation fluid intrusion, which will be helpful to reduce the risk of a killing operation. After well shut-in, it is generally necessary to wait for casing pressure to return to a stable state on the drilling rig, then calculate the formation pressure, design a well killing construction report, and configure heavy mud. The prediction model in this paper can save killing time by predicting the casing pressure so that drilling operators can make preparations for killing the well in advance.
This method is suitable for short-term prediction but is not very good for long-term prediction. Our future work will consider the multimodel coupling method to improve long-term prediction accuracy.

Conclusions
Studies and field applications of measured data during drilling are kick warning and have been used to determine whether a kick occurs or not. However, there is no research on forecasting the severity of a kick by using measured data after a kick occurs.
In view of the time-varying characteristics of the characterization parameters after a kick, combined with the high degree of fitting a time series analysis method, the established time series model can be used for the prediction of pit gain and casing pressure.
Since pit gain and casing pressure can indirectly reflect the bottom hole condition, the changes in pit gain and casing pressure with time can be used to judge the severity of the kick. Combined with the prediction model, the severity of the kick can be predicted.
In this paper, the proposed method has been applied to pit gain forecasting in two wells and casing pressure forecasting in one well. The same rules can be seen in the case studies-an increase in prediction time, a gradual increase in MRE, and the more measured data, the smaller the MRE. Future work will consider the multimodel coupling method to improve long-term prediction accuracy.
The comparison between measured data and predicted data has shown that the proposed method has high prediction accuracy and repeatability. It has a certain guiding significance for the prediction of kick development trends, the analysis of kick severity, the selection of well control measures by engineers, and the reduction of the risk of a killing operation.