Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 4, No. 3, 2022 149 Research and Application of Cuttings Flow Prediction Model for Horizontal Well Zhao Pan, Haibo Liang* School of mechanical and electrical engineering, Southwest Petroleum University, Sichuan 610000, China * Corresponding author Abstract: In the process of horizontal well drilling and logging, real-time and continuous monitoring of returned cuttings is needed to monitor the cleanliness of the hole and reduce complex drilling accidents, such as bit mud bag, wall collapse, stuck drilling, and leakage, which may affect drilling construction and logging operations. However, when the cuttings metering device fails or the acquisition data packet is lost, the cuttings data can be incomplete and discontinuous, which poses a challenge for well cleaning monitoring. In order to solve the problem of incomplete and discontinuous cuttings data caused by instrument failure or collection data packet loss of the cuttings weighing device in operation, this paper studies and compares three cuttings flow measurement prediction models to solve the problem of abnormal data caused by the failure of the cuttings weighing device or collection data packet loss. It provides a reliable means for reducing nonproductive time, monitoring and evaluating borehole cleaning. Keywords: Borehole cleaning, Cuttings weighing, BP neural network. 1. Introduction Borehole cleaning monitoring is always a very important problem in drilling and logging. In horizontal well drilling and logging, returned cuttings provide a basis for borehole cleaning monitoring [1]. Therefore, continuous, real-time and accurate measurement of cuttings flow rate during drilling and logging is very important to establish formation profile, reduce drilling accidents and improve drilling efficiency [2.3]. According to the literature reviewed, there are mainly the following monitoring methods for debris return: expert experience, downhole engineering subs and surface debris weighing device [4]. Expert experience is too subjective, so this method has limitations on well cleaning and horizontal logging. The annulus pressure is measured by the downhole engineering nipple, and then the annulus cuttings concentration is calculated according to the annulus pressure to analyze the borehole cleaning condition. However, this method has high cost of downhole tools and is not conducive to widespread popularization. Installing a cuttings weighing device at the discharge port of the vibrating screen, real-time cuttings flow measurement is the most common method at present. Xiao Jingtao, Ren Zhonghong, Wang Qiang, Cui Zhongfeng, Li Yanfeng, Li Fukai, Hu Fengbo proposed a wireless cuttings flow measurement device and its application [5]. Zeng Yongwen, Wang Dongsheng, Zhang Jijun, and Zhang Liang put forward the calculation method and analysis process of cuttings volume balance to carry out wellbore cleaning analysis of horizontal Wells [6], but they did not study the problem of incomplete and discontinuous data caused by instrument failure or packet loss of cuttings weighing device. Based on the problem of instrument failure or data packet loss in the cuttings weighing device, this paper studied and analyzed the cuttings weighing and measuring principle, established three kinds of cuttings flow metering prediction models, realized the prediction of cuttings data in the weighing and sampling cycle, and solved the problem of data loss caused by instrument failure or data packet loss in the cuttings weighing device. It is of great significance to monitor borehole cleaning in real time, optimize and analyze drilling aging, and reduce non-productive time. 2. Principle of Cuttings Flow Measurement The overall design scheme of cuttings flow measurement system is shown in Figure 1. 150 Figure 1. Overall design of cuttings flow measurement system Cuttings flow measurement system is composed of comprehensive logging instrument, cuttings weighing device and cuttings weighing upper unit [7,8]. The following are discussed: 1. Comprehensive logging instrument The main purpose of the integrated logging instrument is to provide the cuttings flow metering system with hole number, depth, date, time, weight on bit, hook load, speed, rotary torque, and inlet and outlet flow data. 2. Cuttings weighing device The main function of the cuttings weighing device is to complete the collection, measurement, dumping, hanging sweep, weighing and other functions of returned cuttings [9]. Cuttings weighing device includes programmable logic controller, weighing sensor, position sensor, pressure sensor and other sensors and cylinder actuator. The programmable logic controller not only completes the collection, measurement, dumping, hanging sweep, weighing and other functions of the returned cuttings, but also sends the collected data to the upper computer through the corresponding communication port. Figure 2. Cuttings weighing device 3. Cuttings weighing upper machine The main function of the cuttings weighing upper computer is to control the cuttings weighing device, calculate, analyze and store the data collected by the cuttings weighing device in combination with the data of the comprehensive logging instrument, and display the real-time curve of the theoretical and practical instantaneous, whole-meter and column cuttings flow [10]. Meanwhile, it is necessary to synchronize communication with the cuttings weighing device and the comprehensive logging instrument. Although the cuttings flow measurement system can measure the mass flow rate of returned cuttings in real time, due to the harsh working environment and other factors at the site, the cuttings weighing device may fail or the acquisition data may be lost. These failures will result in incomplete data, which will affect the drilling and logging of horizontal Wells and lead to safety accidents. The cuttings flow prediction model in this paper is to predict the data of a certain point in the acquisition cycle of the cuttings weighing device, which solves the problem of incomplete data caused by the failure of the cuttings weighing device. 3. Establishment of Cuttings Flow Prediction Model In order to solve the problem of incomplete and discontinuous cuttings flow data caused by the failure of cuttings flow metering device, three cuttings flow metering prediction models are studied in this paper, which are polynomial fitting model, least square linear fitting model and BP neural network model. The cuttings metering device collected a total of N quality data of returned cuttings during the metering period, and each data was composed of x and y variables. Variable x represents the time interval for recording the quality of returned cuttings; y is the mass of the returned cuttings. Let's use  , , 1, 2,3, ,i ix y i N � to represent a point in the data. 3.1. Polynomial prediction model Polynomial prediction model: 1 2 0 1 2 1ˆ n n n n ny a x a x a x a x a       � (1) Substitute into equation (1) to get: 1 2 0 1 2 1ˆ n n n i i i i n i ny a x a x a x a x a       � (2) All deviations from ˆiy and sample point iy are represented by the sum of error squares, denoted as:     2 2 1 2 0 1 2 1 1 1 ˆ N N n n n i i i i i n i n i i i y y a x a x a x a x a y                  � (3) 151 ( 0,1, , )ja j n � , where  is minimized, is the best fitting coefficient. The partial derivative of equation (3) with respect to ( 0,1, , )ja j n � is obtained by setting the partial derivative equal to 0.  1 2 0 1 2 1 1 2 0 N n j n n n i i i i n i n i ij x a x a x a x a x a y a                   � (4) According to Equation (4), a set of fitting coefficients ( 0,1, , )ja j n � can be solved to minimize , which is the best fitting coefficient. 3.2. Least square linear prediction model The calculation method of the least square linear prediction model for the flow of returned cuttings is shown in Formula (5). y m x c  (5) According to the definition of square loss function, the calculation method of square loss function is shown in formula (6). 2 1 1 ( ) N n n L y y N    (6) Substitute equation (5) into equation (6), as shown in Equation (7). 2 2 2 2 1 1 [ 2 2 ( ) c ] N n n n n n n L y y c mx c y m x N        (7) The partial derivatives of variables c and m in formula (7) are calculated respectively, and the results are shown in equations (8) and (9). 1 1 1 2 2 2 N N n n n n L c m x y c N N         (8) 2 1 1 1 2 2 (c ) N N n n n n n L m x y x m N N         (9) If : 0 L c    , 0 L m    , 1 1 N n n x x N    , 1 1 N n n y y N    ,then: 1 2 1 1 1 N n n n N n n x y yx N m x xx N        (10) c y m x  (11) If : 1 1 N n n n xy x y N    , 2 2 1 1 N n n x x N    ,then: 2 2( ) yx yx m x x    (12) Put equations (11) and (12) into equations (5), then: 2 2 2 2( ) ( ) yx yx yx yx y x y x x x x x        (13) 3.3. BP neural network prediction model BP neural network is a kind of back propagation neural network with forward propagation of information and back propagation of error[11]. It is usually composed of input layer, hidden layer and output layer. BP neural network calculation consists of two stages[12]. The first stage is information forward propagation. The input information is processed from the input layer to the output layer through the hidden layer to get the predicted output. Then, the error between the predicted output and the expected output is weighed. If the error between the predicted output and the expected output does not reach the expected accuracy, it enters the second stage of error back propagation. The error confidence is back propagated from the output layer to the input layer to adjust the weights and thresholds from the input layer to the hidden layer and from the hidden layer to the output layer. Repeat the above stage until the error reaches the expected accuracy. Figure 3. Typical 3-layer BP neural network model Forward information transmission stage: Suppose the weight between node 𝑖 and node 𝑗 is 𝜔 ,the threshold of node 𝑗 is 𝑏 , and the output value of each node is 𝑦 ,and the output value of each node is realized according to the output value of all nodes in the upper layer, the weight of the current node and all nodes in the upper layer, the threshold value of the current node and the activation function. The specific calculation method is as follows: 152 1 0 m j ij i j i S y b     (14)  j jy f S (15) Where 𝑓 𝑥 is the activation function, and S-type function   1 1 x f x e   or linear function is generally selected. In BP neural network, input layer node has no threshold. Error back propagation stage: Let the predicted output of the output layer be 𝑑 and the expected output be 𝑦 , and the loss function take the mean- square error function as follows:     21 0 1 , 2 n j j j E b d y     (16) Repeated correction of weights and thresholds: According to the gradient descent method, the correction of the weight vector is proportional to the gradient of  ,E b at the current position. For the 𝑗 output node, there is:  , ij ij E b         (17) Suppose the activation function 𝑓 selects   1 1 x f x e   , then:                       21 0 , 1 2 1 1 n j j j j j j j j j jij ij ij ij j j j j j ij j j j j i ij i d SE b d y d y d y f S S d y f S f S d y f S f S x x                                              (18) Where      1ij j j j jd y f S f S       . The same is true for 𝑏 :  , ij j E b b      (19) According to the combination of gradient descent method (18) and (19), the weights and thresholds are adjusted as follows:   1 1 , ij ij ij ij i ij E b x                  (20)   2 2 , j j j ij j E b b b b b             (21) 4. Simulation of Cuttings Flow Prediction Model A total of 106 groups of returned cuttings quality data were collected by the cuttings metering device during the metering period. Three cuttings flow metering prediction models were used for analysis and simulation, and the performance indexes of the three models were calculated. Figure 4-Figure 9 shows the results. 4.1. Simulation of polynomial prediction model Figure 4. Simulation results of polynomial prediction model Figure 5. Polynomial prediction model error The fitting results of polynomial model are shown in Figure 4. The mean square error is 0.5658, and the correlation coefficient is 0.9898. The maximum error is 1.9560 and the minimum error is 0.0022, which appear at the 89th and 40th data groups respectively. The error distribution curve is shown in Figure 5. 153 4.2. Simulation of least square linear fitting model Figure 6. Simulation results of least square linear fitting model Figure 7. Linear fitting error of the least square method The fitting results of the least square linear prediction model are shown in Figure 6. The mean square error is 0.5913, and the correlation coefficient is 0.9894. The maximum error is 2.0777 and the minimum error is 0.0008, which appear at the 89th and 52nd data groups respectively. The error distribution curve is shown in Figure 7. 4.3. BP neural network model simulation Figure 8. Simulation results of BP neural network model Figure 9. Error of BP neural network model BP neural network simulation results are shown in Figure 8. The mean square error is 0.4480, and the correlation coefficient is 0.9919. The maximum error is 1.7280 and the minimum error is 0.0102, which appear respectively at the 88th and 71st data groups. The error distribution curve is shown in Figure 10. Table 1. Evaluation parameters of the three models Polynomial model Least square model Bp neural network model Maximum error 1.9560 2.0777 1.7280 Minimum error 0.0022 0.0008 0.0102 Mean square error 0.5658 0.5913 0.4480 Correlation coefficient 0.9898 0.9894 0.9919 5. Summary Based on the cuttings quality measurement data, three cuttings quality measurement prediction models are studied in this paper, which solves the problem of inaccurate and discontinuous cuttings quality measurement caused by the failure of cuttings weighing device or the loss of acquisition data, and provides a basis for the evaluation of borehole cleaning in the process of horizontal well drilling and logging. The following conclusions are obtained in the research: 1. Combined with the cuttings quality measurement data, the cuttings flow prediction polynomial, least square method and BP neural network model are established. At the same time, the BP neural network model is superior to the other two models in the parameters of maximum error, minimum error and mean square error. 2. The cuttings flow prediction model based on BP neural network can help diagnose wellbore cleaning problems, realize real-time and uninterrupted cuttings quality measurement, and reduce non-productive time such as stuck drill. 3. In the next step, the frequency of data collection should 154 be increased to comprehensively consider the loss or failure of cuttings quality data due to other factors. References [1] Chen Aimin. Influencing factors and countermeasures of cuttings logging [J]. Petrochemical Technology, 2021, 28(09): 182-183. [2] Shi Lei, Sun Shuaishuai, Wang Yimin. Analysis of borehole cleaning technology in extended reach Wells [J]. Petroleum and Chemical Equipment, 2019, 22(08):71-72. [3] LIU Xiping. Discussion on logging method of directional well with large deflection [J]. Vitality, 2005(4) :233-234. [4] Wang Jianlong, Zheng Feng, Liu Xuesong, CAI Yugui, Bai Bing, Yang Zhen, Sun Yalong. Research progress and prospect of borehole cleaning tools [J]. China Petroleum Machinery, 2018, 46(09):18-23. [5] Xiao Jingtao, Ren Zhonghong, Wang Qiang, Cui Zhongfeng, Li Yanfeng, Li Fukai, Hu Fengbo. Development and field experiment of wireless cuttings flow measuring device [J]. Logging Engineering,2018,29(04):66-69+102. [6] Zeng Yongwen, Wang Dongsheng, Zhang Jijun, Zhang Liang. Research and application of cuttings volume balance calculation method in horizontal well [J]. Logging Engineering, 2019, 30(01):13-16+136. [7] Zeng Jianxin, Wu Shenyao, Luo Yi, Tan Ting, Lei Yin, Lu Hang, Zheng Ke, Peng Wen, Ding Jianping. Application of borehole cleaning monitoring system in southwest oil and gas field [J]. Logging Engineering,2021,32(02):96-101. [8] ZHAO Haoliang. Research on Borehole cleaning real-time monitoring and analysis System [D]. Southwest Petroleum University,2018. [9] Yan Tie, Shao Shuai, Sun Xiaofeng, Zheng Liming, Yuan Zhenyu, Luan Shizhu. Study on the movement of cuttings under the action of borehole cleaning tools [J]. Oil Drilling & Production Technology,2013,35(03):1-4. [10] Jin Wenming,Ni Pengbo,Mao Ming,Qin Tianbao.Application of a new borehole cleaning monitoring system in drilling efficiency improvement [J]. China Science and Technology Information,2021(12):74-75. [11] Zipser D,Andersen R A. A back-propagation programmed network that simulates response properties of a subset of posterior parietal neurons.[J]. Nature,1988,331(6158). [12] Liu Tianshu. Improvement Research and Application of BP Neural Network [D]. Northeast Agricultural University,2011.