Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 13, No. 3, 2024 265 Realโ€time Optimization Method of Drilling Fluid Rheological Model Based on Pipe Viscosity Measurement Hai Yang, Peng Zhang Southwest Petroleum University, Chengdu, Sichuan 610500, China Abstract: The rheology of drilling fluid is crucial for bottom hole pressure control, hydraulic fracturing, and wellbore stability. Currently, manual methods like rotational viscometers are used on drilling sites, which have long measurement cycles and are prone to human interference. Existing online measurement devices with pipe viscometers are affected by fluid pulsation from diaphragm pumps and motor vibrations, making it hard to accurately determine and monitor rheological parameters in real-time. To address these issues, this paper proposes a real-time optimization method for the rheological model of drilling fluid based on a pipe viscometer. First, the rheological model of drilling fluid and the calculation method for piep viscometer parameters were analyzed, and a pulsation interference suppression model for the pressure difference in the rheological measurement pipe based on empirical mode decomposition was established. Then, preprocessing and regression analysis of the drilling fluid rheological model were carried out, and a real-time optimization method based on univariate linear regression and the golden section search algorithm was constructed. Finally, an experimental platform for online monitoring of drilling fluid rheology using a single measuring pipe was set up. Experimental results show that the proposed method effectively suppresses pulsation interference on the pressure difference in the measuring pipe. The shear stress-shear rate rheological model curve of the drilling fluid better matches the manual rotational viscometer parameters compared to directly measured parameters. The real-time optimization accuracy of the drilling fluid rheological model exceeds 95%, significantly improving the real-time measurement accuracy of drilling fluid rheological parameters. Keywords: Drilling fluid, Rheological parameters, Real-time measurement, Pipeline viscometer, Rheological model real-time optimization. 1. Introduction Drilling fluid is the blood of drilling and plays an important role in the drilling process. The drilling fluid not only has the effect of carrying cuttings to complete the wellbore purification and stabilizing the formation without collapse, but also can control the bottom hole pressure balance, avoid causing well kick and blowout, and prevent accidents such as sticking. [1],[2]. At present, the measurement of drilling fluid rheological properties is still based on traditional manual measurement methods [3]. The commonly used drilling fluid performance measuring instruments include rotary viscometer, funnel viscometer and vibrating viscometer. These instruments generally use off-line, manual or semi-automatic methods to achieve measurement. The test process is complex and takes a long time. Sometimes it is necessary to manually calculate the measurement results. If an accident occurs in the wellbore, it cannot be known at the first time and the best treatment time is missed. Real-time online measurement of drilling fluid performance has become a research hotspot. The real-time measurement technology of drilling fluid rheology mainly includes the following three methods: (1) automatic rotary viscometer, (2) tuning fork viscometer, (3) pipeline viscometer. Broussard et al. [4] developed an real- time rotating Couette viscometer and conducted experiments in water-based and oil-based mud wells. It demonstrates the possibility of automatic drilling fluid measurement using an real-time rotating Couette viscometer. However, the viscometer of this scheme is easily blocked by gel particles and solid particles. Miller et al. [5]introduced a system for continuous measurement and recording of mud density and viscosity using instruments based on tuning fork technology. When a significant change in density or viscosity occurs, a manual calibration instrument assembly using a standard Malvern funnel viscometer is required. Since the real-time rotating Couette viscometer is easily clogged, instruments based on tuning fork technology require manual calibration. Sercan Gul [6] and Knut Taugbรธl [7] used a pipeline viscometer to test the rheological properties of drilling fluid. In the actual measurement, the use of high-power diaphragm pump to extract drilling fluid will cause serious pulsation of drilling fluid in the pipeline, and will also cause vibration of the pipeline, which will seriously affect the measurement accuracy. In order to optimize the rheological model of drilling fluid, this paper proposes a real-time optimization method for measuring the rheological properties of drilling fluid by single pipe. By controlling the drilling fluid to flow through the measuring pipe at different flow rates, the pressure difference at different flow rates can be obtained, which can significantly improve the measurement accuracy of drilling fluid performance and the optimization accuracy of drilling fluid rheological model. In view of the influence of the diaphragm pump on the measurement, Xu Ming et al. [8] analyzed the suppression mechanism of the fluid pulsation of the hydraulic accumulator on the basis of the accumulator modeling. The simulation model of the servo vibration generator was established by Amesim, and the good suppression effect of the accumulator on the fluid pulsation was verified by simulation. J. Berrebi et al. [9] modeled a flow pulsation model containing harmonics for the sampling error caused by 266 improper processing of the flow time average value, and finally reduced the sampling error through correct average processing; tianyi Zhou et al. [10]analyzed the dynamic characteristics of the differential pressure signal of gas-liquid two-phase flow in a 4mm diameter pipe, designed a differential pressure acquisition system, and used EMD and SVM to complete the flow pattern recognition. In order to accurately identify the stable pressure difference data, considering the regular pulsation of the diaphragm pump and the stable vibration characteristics of the motor, a feature recognition method of pressure difference parameters based on empirical model decomposition is proposed to ensure the accurate identification of effective pressure difference data under stable flow conditions. After obtaining stable pressure difference data, the corresponding shear stress and shear rate of the fluid can be calculated. The core problem of drilling fluid rheology is to study the relationship between shear stress and shear rate of various drilling fluid systems [11],[12] . At present, the least square method is mostly used to determine the rheological parameters of drilling fluid. The least square method has an important application when the drilling fluid is a linear rheological model. Its modeling is easy and the calculation process is relatively simple [13],[14]. However, when the drilling fluid is a nonlinear rheological model ( power law model, Carson model, Herschel-Barclay model, etc. ), the linear least squares method cannot meet the characteristics of the minimum variance of the calculation results and is no longer applicable. Many scholars have proposed a variety of methods for determining rheological parameters. Ojewumi et al. [15] ( 2018 ) used the error variance statistical parameters of five rheological models to propose a rheological model evaluation strategy of nonlinear least squares estimation algorithm, and realized the optimization of fluid rheological models. For the five rheological models commonly used in drilling fluids, Gucuyener [16] ( 2022 ) used the linear least squares method to parameterize the three-parameter nonlinear model, and realized the rapid solution of rheological parameters. However, for the nonlinear fluid rheological model, the versatility and calculation accuracy of the model still need to be improved. For a given drilling fluid system and formulation, real-time measurement should be performed to select the most suitable rheological model to describe its actual rheology. In view of the above problems, this paper proposes a fault- tolerant optimization method of drilling fluid rheological model based on real-time monitoring device of drilling fluid performance. By measuring the pressure difference and flow rate at both ends of the pipeline, by controlling the flow rate through the measuring pipeline, different pressure difference values can be obtained. By solving different pressure difference and flow rate parameters, the shear stress-shear rate curve of the drilling fluid is calculated, and the rheological model of the measured drilling fluid is judged by using the linear regression-golden section search algorithm, and the final rheological model of the drilling fluid is obtained. 2. Rheological Model and Principle of Drilling Fluid 2.1. Common rheological models of drilling fluid The rheological models of drilling fluid are: Bingham model, power law model, Carson model and power law model with yield value (also known as Herschel-Barr-Clay model). The relationship between shear stress and shear rate obtained by the measurement and calculation of drilling fluid can accurately describe the rheological properties of drilling fluid. [17],[18],[19]. At present, the rheological models commonly used in the field are mainly divided into two-parameter rheological models: Bingham model, power-law model and Carson model. Three-parameter rheological model: Herschel-Bulkley (H-B) model. The constitutive equation of drilling fluid can be written as ๐œ ๐‘“ ๐œ, ๐›พ . The rheological model of drilling fluid commonly used in the drilling site and its corresponding rheological parameter calculation formula are shown in table 1. 2.2. Rheological measurement principle of pipe viscometer The calculation of the rheological properties of the pipeline viscometer is based on the pressure loss transformation of the fluid in the pipeline viscometer. The rheological properties of the fluid are divided into two types according to different measurement principles: constant speed type and constant pressure type. The former mainly measures the pressure difference, and the latter mainly measures the flow rate. Usually in practical engineering, most of the high-pressure tubular rheological instruments used are constant-speed type. The principle of using a constant-speed tubular rheometer to measure fluid performance parameters is based on the Hagen- Poiseuille theorem [20]. Pressure sensors are installed at both ends of the flow pipe. When the fluid flows through the flow pipe at a certain flow rate, the pressure at different positions in the pipe will change. Therefore, the viscosity of the fluid can be calculated according to the parameters such as the length and diameter of the flow pipe. The measurement principle is shown in Figure 1: Table 1. Common drilling fluid rheological model and its corresponding rheological parameter calculation formula Name of rheological model Characteristics of rheological model Constitutive equation of rheological model Bingham model The Bingham rheological model is one of the simplest rheological models, which is suitable for describing Newtonian fluids, that is, the shear stress is proportional to the shear rate. At any shear rate, the viscosity of the fluid remains unchanged. 0๏ด ๏ด ๏จ๏ง๏€ฝ ๏€ซ Power Low model The power-law rheological model is suitable for non-Newtonian fluids, and there is a power-law relationship between shear stress and shear rate. With the increase of shear rate, the viscosity of the fluid will change. nK๏ด ๏ง๏€ฝ Cassonโ€™s model The Carson rheological model combines the characteristics of Newtonian fluid and non-Newtonian fluid, and is suitable for describing complex non-Newtonian fluid, such as fluid containing particles or multiphase fluid. 1/2 1/2 (1/2) 1/2 c๏ด ๏ด ๏จ ๏ง๏‚ฅ๏€ฝ ๏€ซ Herschel-Bulkely model The HB rheological model is a more flexible rheological model, which has wider applicability and can describe more complex fluid behavior. The model combines a variety of rheological properties, including shear stress, time dependence, etc. 0 nK๏ด ๏ด ๏ง๏€ฝ ๏€ซ 267 In Table 1, ๐œโ€”โ€”shear stress, ๐‘ƒ๐‘Ž; ๐œ โ€”โ€” yield value, ๐‘ƒ๐‘Ž; ๐›พโ€”โ€”shear rate, ๐‘  ; ๐œ‚โ€”โ€”Bingham plastic viscosity, ๐‘ƒ๐‘Ž. ๐‘ ; ๐œ‚ โ€”โ€” Carson plastic viscosity, ๐‘ƒ๐‘Ž. ๐‘  ; ๐พโ€”โ€”consistency coefficient, ๐‘ƒ๐‘Ž. ๐‘ , ๐‘›โ€”โ€”flow index. Figure 1. Pipe drilling fluid rheological model measurement schematic diagram The shear stress of the pipe wall can be obtained by the pressure difference between the two ends of the measuring pipe measured by the differential pressure sensor : 4 pD w l๏ด ๏€ฝ (1) In above equations, D is the inner diameter of the pipe, p is the pressure difference between the two ends of the measuring pipe, l is the length of the measuring pipe. the wall shear rate ๐›พ inside the pipe can be expressed as : ๏€จ ๏€ฉ ๏€จ ๏€ฉ 8 w ln w ln 1 8 3 4 v Dd d v D๏ด๏ง ๏ƒฉ ๏ƒน๏€ซ๏ƒช ๏ƒบ๏ƒซ ๏€ฝ ๏ƒป (2) Let: ๏€จ ๏€ฉ ๏€จ ๏€ฉ w 8 ln ln v D d d N ๏ด๏€ฝ (3) There are : 3 1 8 w 4 N v N D๏ง ๏€ซ๏€ฝ (4) where ๐›พ is the shear rate at the pipe wall, ๐‘  ; ๐‘ฃ is the velocity of the fluid through the measuring pipe, ๐‘š/๐‘  ; N is a dimensionless parameter. According to the measured value, N can be obtained in the velocity gradient curve of ๐‘™๐‘› ๐œ ๐‘™๐‘› . After the N value is determined, the rheological parameter values of each rheological model can be obtained. 3. Parameter Calculation Model of Drilling Fluid Single Pipe Differential Pressure Signal Based on Empirical Mode Decomposition Pipeline measurement method to measure drilling fluid rheological model, the accuracy of measurement depends on the drawing accuracy of the flow curve, and the premise of accurately drawing the flow curve is to obtain accurate and stable pressure difference and flow rate values. When measuring the physical quantities of pressure difference and flow rate, because the equipment will produce diaphragm pump pulsation and motor vibration, the pressure difference signal measured by the pressure difference sensor will be affected, resulting in complex pulsation interference. It is impossible to obtain the accurate pressure difference signal of the drilling fluid in the constant current state, which seriously affects the calculation accuracy of the rheological parameters of the drilling fluid, so that the optimal drilling fluid rheological model cannot be optimized. Empirical Mode Decomposition ( EMD ) is a signal processing technology. EMD is proposed by Norden E. Huang in 1998, which is used to decompose nonlinear and non-stationary signals into several Intrinsic Mode Functions ( IMFs ) for signal analysis and processing. The pulsating interference signal generated by mechanical action is a nonlinear and non-stationary signal, so the empirical mode decomposition is used to process the signal. There are some limitations in the use of EMD : ( 1 ) The number of local extreme points and zero-crossing points must be equal or at most one in the whole time range of the function ; ( 2 ) At any time point, the envelope of the local maximum ( upper envelope ) and the envelope of the local minimum ( lower envelope ) must be zero on average. The process of EMD decomposition of pressure difference signal is as follows : (1) For a given differential pressure curve ( )tu , find the maximum point and the minimum point ; (2) the maximum point and the minimum point are connected by different curves, and the maximum point envelope max( )tf and the minimum point envelope min( )tf are given respectively. (3) The average curve ( )ta = max( ) min( )( ) / 2t tf f๏€ซ is obtained by averaging the two envelope curves. (4) Subtracting the average curve, we get a new function 1 ( ) ( )( ) t tr t u a๏€ฝ ๏€ญ , 1( )r t is an IMF component. (5) Replacing the original ( )tu with the newly obtained curve 1( )r t , and then repeating steps 1-4 to obtain different ( )ir t ( 2,3,4, )i ๏€ฝ ๏Œ , until ( )ir t can not meet the limiting condition cut-off, so there are : 268 ( ) 1 n t i n i u IMF r ๏€ฝ ๏€ฝ ๏€ซ๏ƒฅ (5) ๐ผ๐‘€๐น , ๐ผ๐‘€๐น , โ‹ฏ ๐ผ๐‘€๐น is the intrinsic mode function of the differential pressure signal, and ๐‘Ÿ is the residual, which represents the oscillation trend of the signal. The original pressure difference signal is decomposed by EMD to obtain multiple intrinsic mode functions, and each stationary signal is related to different factors. In order to find the IMF component of the pressure difference stationary signal related to the fluid pulsation, he kurtosis sensitive to the fluctuation is selected as the characteristic parameter of the steady flow pressure difference signal. By conducting kurtosis analysis, we identify the intrinsic mode function (IMF) component that encompasses the pressure difference signal under stable flow conditions, and then, through spectrum analysis, it is determined that the kurtosis K of the pulsation frequency is a numerical statistic, which reflects the distribution characteristics of the vibration signal and is a normalized fourth-order central moment. This statistic is very sensitive to sharp changes in variables, such as impact vibration. The larger the value, the stronger the pulsation. The expression is: 4 4 [ ( ) ] ( )x t x r x dx K ๏ณ ๏€ญ ๏€ญ๏ƒฒ๏€ฝ +โˆž โˆž (6) In above equations, ๐‘ฅ is the instantaneous amplitude, ๏ฟฝฬ…๏ฟฝ is the mean amplitude, ๐‘Ÿ is the probability density, and ๐œŽ is the standard deviation. For discretely sampled differential pressure fluctuation data, the formula is 4 1 1 ( ) N i i i x x K N ๏ณ๏€ฝ ๏€ญ ๏€ฝ ๏ƒฅ (7) In above equations, ๐‘ฅ is the signal value, ๏ฟฝฬ…๏ฟฝ is the signal mean, N is the sampling length, and ๐œŽ is the standard deviation. 4. Optimization Model of Drilling Fluid Rheological Model 4.1. Regression analysis For the assumed rheological model, the rheological parameters that maximize the determination coefficient of the fitting curve or minimize the standard error are sought. By comparing the calculation results of different rheological models, the optimal rheological model is obtained. Numerical analysis and optimization theory are used to solve this extreme value problem. In this paper, a simple linear regression-golden section search algorithm is used to solve the problem, which is simple in principle, easy to program and can fully meet the accuracy requirements. Regression analysis is an effective tool to deal with the correlation between variables. According to the simple and representative case of sample values ๐‘ฅ , ๐‘ฆ ๐‘ฅ , ๐‘ฆ โ‹ฏ ๐‘ฅ , ๐‘ฆ , ๐‘ฆ and ๐‘ฅ have a linear relationship ๐‘ฆ ๐‘Ž๐‘ฅ ๐‘ . The problem of estimating the mathematical expectation of y by using the linear function ๐‘Ž๐‘ฅ ๐‘ . It is called a linear regression problem. For each value of the sample has ๐‘ฆ: ๐‘ ๐‘Ž๐‘ฅ ๐‘, ๐œŽ , the normal assumption ๐‘ฆ ๐‘Ž๐‘ฅ ๐‘ ๐œ€ , ๐œ€: ๐‘ 0, ๐œŽ is called a linear regression model We take ๐‘ฆ โˆง ๐‘Ž โˆง ๐‘ฅ ๐‘ โˆง as the estimation of the regression model. Gauss-Markov proves that ๐‘Ž โˆง and ๐‘ โˆง are unbiased estimators of ๐‘Ž and ๐‘, and the variance is the smallest among all unbiased estimators using linear functions of ๐‘ฆ. Regression analysis is an effective tool to deal with the correlation between variables. According to the sample values ๐‘ฅ , ๐‘ฆ ๐‘ฅ , ๐‘ฆ โ‹ฏ ๐‘ฅ , ๐‘ฆ , ๐‘ฆ ๐‘“ ๐‘ฅ is determined. The simplest case is that ๐‘ฆ has a linear relationship with ๐‘ฅ, that is, ๐‘ฆ ๐‘Ž๐‘ฅ ๐‘ Through the appropriate mathematical transformation of various rheological models, the rheological parameters of drilling fluid were calculated by one-dimensional linear regression analysis, and the program was compiled. The calculation of the rheological parameters of the Bingham and power-law models is simple and easy to implement, while the calculation of the Carson and H-B rheological models is relatively complex, especially the H-B rheological model, which requires computer iteration and interpolation. As far as the regression equation itself is concerned, it is not necessary to know in advance which rheological model is more reasonable for the relationship between the two variables. The sum can be obtained by the regression equation, and then judged according to the quantitative index of the correlation coefficient ๐‘… 4.2. Rheological equation preprocessing Four rheological equations are used as approximation functions ( For nonlinear equations, they are linearized by taking logarithms on both sides of the equation at the same time, and their fitting curves are made by using the least square method, and their correlation coefficient ๐‘… is obtained. By comparing the size of the correlation coefficient ๐‘… , the most suitable rheological equation can be selected. The specific calculation steps are as follows : Firstly, the four rheological models are linearized : (1) Bingham fluid model : 0๏ด ๏ด ๏จ๏ง๏€ฝ ๏€ซ , let y ๏ด๏€ฝ , 0 0a ๏ด๏€ฝ , 1a ๏จ๏€ฝ , x ๏ง๏€ฝ , then 0 1y a a x๏€ฝ ๏€ซ (2) Power-law fluid model : nK๏ด ๏ง๏€ฝ , take the logarithm at both ends of the equation, and get : ln ln lnK n๏ด ๏ง๏€ฝ ๏€ซ (8) Suppose lny ๏ด๏€ฝ , 0 lna K๏€ฝ , 1a n๏€ฝ , lnx ๏ง๏€ฝ (3) The Carson fluid model : 1/2 1/2 (1/2) 1/2 c๏ด ๏ด ๏จ ๏ง๏‚ฅ๏€ฝ ๏€ซ , can also be written as 21/2 (1/2) 1/2( c๏ด ๏ด ๏จ ๏ง๏‚ฅ๏€ฝ ๏€ซ ๏ผ‰ (9) Let 1/2y ๏ด๏€ฝ , 1 0 /2 ca ๏ด๏€ฝ , (1/2) 1a ๏จ๏‚ฅ๏€ฝ , 1/2x ๏ง๏€ฝ . (4) H-B rheological model ( Herschel-Bulkely ) fluid model : ๐œ ๐œ ๐พ๐›พ , Transforming ๐œ ๐œ ๐พ๐›พ , we take the logarithm at both ends of the formula, and get : 269 0 )ln ln( ln K n๏ด ๏ด ๏ง๏€ญ ๏€ฝ ๏€ซ (10) Let 0 )ln(y ๏ด ๏ด๏€ญ๏€ฝ , 0 lna K๏€ฝ , 1a n๏€ฝ , lnx ๏ง๏€ฝ . And ๐‘… can be obtained from the following formula : ๏€จ ๏€ฉ ๏€จ ๏€ฉ N 2n i i i 1 N 2 i i 1 y kx 2 y 1 i y R ๏€ฝ ๏€ฝ ๏€ญ ๏€ญ ๏ƒฅ ๏€ฝ ๏€ญ ๏ƒฅ (11) ๐œ - shear stress, Pa ; ๐œ - yield value, Pa ; ๐›พ - shear rate, ๐‘  ; ๐œ‚ - Bingham plastic viscosity, Pa.s ; ๐œ‚โˆž - Carson plastic viscosity, Pa.s ; ๐พ - consistency coefficient, Pa.s ; n -flow index. 4.3. Unary linear regression-golden section search algorithm The principle of the golden section search method is to quickly converge to the optimal value by continuously narrowing the search interval. The golden section method, also known as the 0.618 method, is a one-dimensional search method for the univariate function f(x) to search for the minimum point in a given interval [ a, b ]. The " golden section " refers to dividing a line segment into two segments, so that the ratio of the length of the whole segment to the length of the longer segment is equal to the ratio of the length of the longer segment to the length of the shorter segment, that is, 1 : L = L : ( 1-L ), and the solution is : L = 0.618. The search process of the golden section method : the golden section method requires the position of the insertion points ๐‘ฅ and ๐‘ฅ to be symmetrical with respect to the two ends of the interval [ a b ], that is, the point is taken in a given interval [ a b ]. ๐‘ฅ1 ๐‘ ๐ฟ ๐‘ ๐‘Ž , if ๐‘“ ๐‘ฅ1 ๐‘“ ๐‘ฅ2 ๏ผŒlet ๐‘Ž ๐‘ฅ1. If ๐‘“ ๐‘ฅ1 ๐‘“ ๐‘ฅ2 , let ๐‘ ๐‘ฅ2, restart the search. 1 2 0.382( ) 0.618( ) x a b a x a b a ๏€ฝ ๏€ซ ๏€ญ๏ƒฌ ๏ƒญ ๏€ฝ ๏€ซ ๏€ญ๏ƒฎ (12) Since the Herschel-Barclay fluid is a three-parameter model, its characteristics lead to nonlinearity, and linear regression analysis alone cannot solve the problem. In this paper, the golden section search method is used to optimize. Assuming that ๐œ is known, n and K values can be obtained according to regression analysis. This will return to the linear problem. According to the ๐œ value obtained from the rheological equation, the golden section search method is used to search ๐œ , and the process is repeated with the assumed accuracy until the local minimum value is reached, and the final ๐œ value is obtained. The specific search process is shown in the program flow chart, as shown in Figures 2 : Figure 2. Golden section optimization algorithm flow chart 5. Construction of The Experiment Platform In this paper, an on-line monitoring device for drilling fluid rheology was built. The overall frame of the measuring device is built of stainless steel rectangular pipeline. The measuring pipe is a stainless steel circular pipe of รธ16.0 mm ร— 1.6 m and the wall thickness is 2 mm. The pressure difference sensor is installed at both ends of the measuring pipe. The outlet end of the electric diaphragm pump is connected with the mass flowmeter by a stainless steel circular pipe, and the flange connection is used between the pipelines to facilitate the disassembly and assembly of the pipelines and the sectional cleaning. The inlet end of the electric diaphragm pump is connected with the drilling fluid tank and the measuring outlet end by hose. The viscosity of drilling fluid is greatly affected by temperature. In order to eliminate this interference, the whole measuring device is now placed in the box. When the temperature fluctuation is large, the necessary insulation equipment is added to ensure the accuracy of the device measurement. The pressure difference parameters, temperature, drilling fluid density, mass flow rate, volume flow rate and other parameters collected by the equipment are transmitted to the industrial computer. On the industrial computer, the EMD method of the differential pressure signal mentioned in this paper is used to obtain the real differential 270 pressure signal under the constant current state. Combined with the rheological solution model, the calculation of the shear stress and shear rate of the drilling fluid is completed. Finally, Based on the obtained shear stress and shear rate data, the rheological model of the drilling fluid was optimized by employing the model selection approach described in this paper, resulting in the most accurate rheological model for the drilling fluid. The field test diagram of the device is shown in Fig.3. Figure 3. Device physical diagram 6. Experimental Result Analysis The validation experiment for the proposed model in this paper was conducted using an real-time monitoring device for the rheological properties of drilling fluid. Firstly, the drilling fluid in the mud tank is extracted by an electric diaphragm pump, and the drilling fluid flows through the mass flowmeter and a single measuring pipe in turn. Real-time data on the drilling fluid's density, temperature, flow rate, and the pressure difference across the measurement pipe were collected. The experiment utilized a variable frequency drive to adjust the frequency of the diaphragm pump, with 8 different frequency settings ranging from low to high. Let each frequency last the same time to control the stability of the flow rate in the pipeline so as to obtain the pressure difference in the steady state of the flow rate in real time. Among them, the original data collected by the pressure difference sensor after performing a complete pressure difference sensor is shown in Figure 4. Figure 4. The original pressure difference of the measuring pipe collected by the pressure difference sensor It can be seen from Fig.4 that the original pressure difference parameters of the measuring pipe have complex fluctuations and interference. At the same time, in each stable flow stage artificially set by the diaphragm pump, the measured pressure difference parameters still have large fluctuations, and are greatly affected by the pulsation effect of the diaphragm pump, pipeline vibration, and measurement noise. It has been unable to smoothly find the pressure difference parameters in the stable flow stage. Therefore, it is impossible to judge the constant current state of the diaphragm pump by using the pressure difference parameters shown in Fig.4, and it is impossible to obtain the actual stable pressure difference parameters of the measuring pipe, which leads to the inability to solve the rheological parameters of the drilling fluid. The above original pressure difference parameters of the measuring pipe are brought into the empirical mode decomposition model proposed in this paper, and the noise interference signals under different modes in the original pressure difference signal can be obtained. The empirical mode decomposition of the pressure difference parameters of the long measuring pipe is shown in Figure 5. Figure 5. Measuring pipe pressure difference parameter empirical mode decomposition waveform It can be seen from Fig.5 that the pressure difference data 271 are interfered by the errors of multiple different frequency bands, which makes it impossible to accurately identify the pressure difference data under the actual constant flow rate, and affects the calculation of drilling fluid rheological parameters. Therefore, the pressure difference parameters after empirical mode decomposition are shown in Figure 6. Figure 6. The original pressure difference of the measuring pipe collected by the pressure difference sensor It can be seen from Fig.6 that the pressure difference data after empirical mode decomposition eliminates a lot of noise and fluctuation compared with the original data, and the performance is more smooth. At the same time, the eight constant flow rate states are set, and the constant phenomenon of the pressure difference data can also be directly observed, and the simple variance threshold determination method can be used directly to judge the set constant current state, and read out the pressure difference parameters corresponding to each constant current state. After obtaining the stable pressure difference parameters, the drilling fluid flow rate under the current pressure difference is obtained by the mass flowmeter. Combined with the diameter of the experimental device, the length of the pipe is measured, and the above shear stress and shear rate calculation model is used to obtain the rheological parameters. In order to illustrate the practicability of the method proposed in this paper, 10 groups of drilling fluid experiments were carried out. Table 2 lists the typical data samples of drilling fluid to configure 10 groups of drilling fluid into the drilling fluid rheology real-time measurement device for test. For comparison, we have tested the readings of ten drilling fluid viscometers, as shown in Table 2. Table 2. Drilling fluid laboratory test data Drilling fluid number Rotary viscometer readings ๐œ‘ ๐œ‘ ๐œ‘ ๐œ‘ ๐œ‘ ๐œ‘ 1 0.6 0.8 2.8 4.4 6.3 9.2 2 1.5 2 7 12 18 35 3 19 20 23 23.5 29 33 4 15 17 30 35 44 61 5 23 25 49 56 66 74 6 3 4 14.5 26 37 71 7 2 4 21 36 50 91.5 8 3 5 29 48.5 67 119 9 4 7 35.5 59 79 137 10 10 14.5 52 83 103 181 There is a fluctuation in the pressure difference, and the measured data is preprocessed. Using the above EMD method and the pressure difference data from the determination condition to the constant current, the corresponding shear stress-shear rate is calculated according to the corresponding pressure difference and flow rate brought into the above model. At the same time, the shear stress-shear rate calculated by the reading of the paradigm rotating viscometer is used as the standard. The representative 5,7,9 groups of drilling fluids were measured and substituted into the shear stress-shear rate curve calculated by the model described in this paper. The image is shown in Figure 7(a),(b),(c) (a) (b) (c) Figure 7. Shear stress-shear rate curve of drilling fluid.(a) Shear stress-shear rate curves of 5 group of uncalibrated drilling fluid before and after pressure difference calibration.(b) Shear stress-shear rate curves of 7 group of uncalibrated drilling fluid before and after pressure difference calibration. (c) Shear stress-shear rate curves of 9 group of uncalibrated drilling fluid before and after pressure difference calibration It can be seen from the Fig.7 that the shear stress-shear rate curve of the uncalibrated drilling fluid, the shear stress-shear rate curve of the measuring pipe ( the blue box symbol in the 272 figure ) and the shear stress-shear rate curve of the standard paradigm rotary viscometer ( the red * symbol in the figure ) do not completely coincide, and there is a large deviation. According to the principle that the drilling fluid flowing through the measuring pipe and the drilling fluid measured by the rotary viscometer are the same performance drilling fluid, the shear stress-shear rate curve of the measuring pipe should coincide with the shear stress-shear rate curve of the rotary viscometer. The uncalibrated shear stress-shear rate curve of the drilling fluid in the Fig.7 has a large deviation from the shear stress-shear rate curve of the paradigm rotary viscometer. This is due to the pulsation of the diaphragm pump and the vibration of the motor during the operation of the equipment. Therefore, the differential pressure data measured by the differential pressure sensor will be affected, resulting in complex pulsation interference. It can be seen from the figure that at the same shear rate, the maximum difference between the shear stress of the measuring pipe and the shear stress of the paradigm rotary viscometer is 19 Pa. From the lower part of Fig.7, it can be seen that the shear stress-shear rate curve of the measuring pipe after calibration can coincide well with the shear stress-shear rate curve of the normal rotary viscometer. At the same shear rate, the maximum difference between the shear stress of the measuring pipe and the shear stress of the paradigm rotary viscometer is 3Pa, which can effectively improve the optimization accuracy of the drilling fluid rheological model. In order to better illustrate the effectiveness of the search method based on empirical mode decomposition and univariate linear regression-golden section, the shear stress- shear rate scatter plots measured by the drilling fluid rheology real-time detection device of the 10 groups of drilling fluids participating in the experiment were brought into the program. The results are shown in Fig. 8 (a),(b),(c). (a) (b) (c) Figure 8. linear regression analysis showed 0 200 400 600 800 1000 1200 0 20 40 60 80 100 S he ar s tr es s (P a) Shear rate(s-1) Bingham model linear fitting 1 2 3 4 5 6 7 8 9 10 1 set of fitting curves 2 set of fitting curves 3 set of fitting curves 4 set of fitting curves 5 set of fitting curves 6 set of fitting curves 7 set of fitting curves 8 set of fitting curves 9 set of fitting curves 10 set of fitting curves 2 3 4 5 6 7 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 Power law model linear fitting 1 2 3 4 5 6 7 8 9 10 1 set of fitting curves 2 set of fitting curves 3 set of fitting curves 4 set of fitting curves 5 set of fitting curves 6 set of fitting curves 7 set of fitting curves 8 set of fitting curves 9 set of fitting curves 10 set of fitting curvesSh ea r st re ss (P a) Shear rate(s-1) 0 5 10 15 20 25 30 35 1 2 3 4 5 6 7 8 9 10 Carson model linear fitting 1 2 3 4 5 6 7 8 9 10 1 set of fitting curves 2 set of fitting curves 3 set of fitting curves 4 set of fitting curves 5 set of fitting curves 6 set of fitting curves 7 set of fitting curves 8 set of fitting curves 9 set of fitting curves 10 set of fitting curvesS he ar s tr es s( Pa ) Shear rate(s-1) 273 The results show that the 10 groups of drilling fluids are linearized in Bingham model, power law model , Carson model respectively. Because the H-B model cannot be directly linearly fitted. Taking drilling fluid 5 as an example, the golden section search method quickly converges to the optimal value by continuously narrowing the search interval. As shown in Fig.9(a), the ๐œ is searched according to the regression analysis and the golden section search method. The golden section search process is completed according to the given conditions, and the corresponding ๐œ is obtained. The n and K values are obtained by linear regression, and the corresponding rheological model of the drilling fluid is judged according to ๐‘… . The results in Fig.9 (b) shows that the 10 groups of drilling fluids are linearized in H-B model respectively. (a) (b) Figure 9. H-B model golden section search process of drilling fluid 5 The golden section-linear regression algorithm was used to fit the 10 groups of drilling fluids. The 10 groups of drilling fluids all regressed the optimal results and obtained the corresponding ๐‘… values. Linear regression is performed to obtain the correlation coefficient value, which can quantitatively determine the most consistent rheological model, that is, when the correlation coefficient ๐‘… is closest to 1, the theoretical correlation is the largest. From Table 3,4 and Fig.10, it can be seen that the regression effect of Bingham, power law and Carson model in different drilling fluid systems is better by converting into linear model, but it is only applicable to specific types of drilling fluid. The regression effect of the linear regression-golden section search algorithm used in the H-B model is better, which can better express the rheology of the drilling fluid and has certain adaptability. (a) Rotary viscometer optimization results (b) Rotary viscometer optimization results Figure 10. The final calculated ๐‘… histogram Table 4. Comparison of drilling fluid rheological model optimization results Drilling fluid number Rotary viscometer optimization results Optimization results of drilling fluid on-line monitoring device 1 Power-law model fluid Power-law model fluid 2 Bingham model fluid Bingham model fluid 3 Bingham model fluid Bingham model fluid 4 Carson model fluid Carson model fluid 5 Herschel-Bulkely model fluid Herschel-Bulkely model fluid 6 Bingham model fluid Bingham model fluid 7 Bingham model fluid Bingham model fluid 8 Bingham model fluid Bingham model fluid 9 Carson model fluid Carson model fluid 10 Carson model fluid Carson model fluid 2 3 4 5 6 7 0 1 2 3 4 5 H-B model linear fitting 1 2 3 4 5 6 7 8 9 10 1 set of fitting curves 2 set of fitting curves 3 set of fitting curves 4 set of fitting curves 5 set of fitting curves 6 set of fitting curves 7 set of fitting curves 8 set of fitting curves 9 set of fitting curves 10 set of fitting curvesS he ar s tr es s( P a) Shear rate(s-1) 0. 97 96 0. 98 63 0. 95 37 0. 97 17 0. 83 37 0. 99 58 0. 99 49 0. 99 36 0. 98 98 0. 98 74 0. 98 35 0. 86 04 0. 76 88 0. 94 94 0. 99 78 0. 94 54 0. 93 94 0. 97 33 0. 97 81 0. 98 58 0. 98 95 0. 94 71 0. 90 95 0. 98 88 0. 95 24 0. 98 1 0. 98 52 0. 99 24 0. 99 2 0. 99 46 0. 98 35 0. 87 13 0. 77 25 0. 95 37 0. 99 79 0. 94 54 0. 98 94 0. 97 33 0. 97 81 0. 98 63 1 2 3 4 5 6 7 8 9 10 0.0 0.2 0.4 0.6 0.8 1.0 L in ea r fi tt in g va ri an ce o f ro ta ry v is co m et er Number of drilling fluid groups Bingham model variance Power law model variance Carson model variance H-B model variance 0. 98 2 0. 98 3 0. 91 4 0. 97 1 0. 88 3 0. 98 2 0. 99 3 0. 99 2 0. 99 4 0. 98 7 0. 93 5 0. 83 3 0. 62 2 0. 91 0. 99 5 0. 9 0. 96 4 0. 97 4 0. 97 8 0. 98 0. 98 3 0. 94 7 0. 83 7 0. 97 7 0. 97 7 0. 96 3 0. 99 1 0. 99 1 0. 99 4 0. 99 6 0. 94 6 0. 87 9 0. 62 6 0. 91 6 0. 99 6 0. 92 6 0. 97 9 0. 98 4 0. 98 5 0. 98 4 1 2 3 4 5 6 7 8 9 10 0.0 0.2 0.4 0.6 0.8 1.0 L in ea r fi tt in g va ri an ce o f dr il li n g fl ui d on li n e m on it or in g d ev ic e Number of drilling fluid groups Bingham model variance Power law model variance Carson model variance H-B model variance 274 Table 3. Linear regression results of drilling fluid rheological parameters Drilling fluid number Bingham model fluid Power-law model fluid Carson model fluid Herschel-Bulkely model fluid ๐‰๐ŸŽ ๐œผ ๐‘น๐Ÿ ๐‘ฒ ๐’ ๐‘น๐Ÿ ๐‰๐’„ ๐Ÿ ๐Ÿ ๐œผ ๐Ÿ ๐Ÿ ๐‘น๐Ÿ ๐‰๐ŸŽ ๐‘ฒ ๐’ ๐‘น๐Ÿ 1 0.0532 4.674 0.9817 0.5137 0.3296 0.9346 0.1902 1.4441 0.9829 0.0033 0.5138 0.3287 0.9347 2 0.6408 0.0175 0.9834 0.4994 0.450769 0.8329 0.6669 0.1099 0.947 0.0031 0.4997 -0.7992 0.8331 3 10.459 0.0074 0.914 0.1012 7.956586 0.6221 3.0467 0.0346 0.8367 0.0044 0.1012 2.0736 0.6221 4 10.932 0.0188 0.9705 0.2377 5.048545 0.9096 2.7964 0.0808 0.9774 0.0037 0.2378 1.6186 0.9096 5 19.376 0.0218 0.8832 0.2283 7.921654 0.9952 3.6915 0.0851 0.9774 12.9952 0.7724 -1.9808 0.9959 6 0.1445 0.04 0.9819 0.5747 0.600856 0.9 0.7011 0.1725 0.9625 0.0047 0.575 -0.5117 0.9001 7 2.5443 0.0475 0.993 0.6074 0.623504 0.9643 0.9417 0.1866 0.9908 0.0047 0.6077 -0.4746 0.9643 8 3.0073 0.0603 0.9923 0.6286 0.713481 0.974 1.0162 0.2159 0.9911 0.0034 0.6285 -0.337 0.974 9 5.409 0.0668 0.9935 0.6013 0.994913 0.9777 1.3197 0.2238 0.9944 0.0048 0.6015 -0.0065 0.9778 10 12.614 0.0741 0.9872 0.5052 2.346442 0.9801 2.2366 0.2208 0.9958 0.0047 0.5053 0.8521 0.9801 It can be seen from the calculation results that the device can measure the rheological properties of drilling fluid in real time, automatically select the corresponding rheological model of drilling fluid through the algorithm, and continuously record the change process of the rheological properties of drilling fluid. In this experiment, the method of this paper is used to optimize the rheological model of drilling fluid. The results are the same as the actual drilling fluid rheological model, and the accuracy rate is above 95 %. 7. Conclusion In this paper, aiming at the problems of low measurement accuracy and poor stability caused by the influence of fluid pulsation, motor vibration and bias error of differential pressure measurement in the existing pipeline viscometer real-time measurement device, a differential pressure signal calibration method based on empirical mode decomposition is proposed on the basis of single-pipe differential pressure pipeline viscometer. The differential pressure signal processing is carried out by using the real-time monitoring experimental platform of drilling fluid performance. Firstly, the original differential pressure signal of single measuring pipe is collected, and the original differential pressure signal is decomposed and filtered by the established empirical mode decomposition model. The filtered curve can significantly capture the state of diaphragm pump under each constant current control compared with the original differential pressure curve, and can obtain accurate differential pressure signal, which provides data support for the subsequent calculation of shear stress and shear rate. Then, the rheological experiments of 10 groups of drilling fluids with different viscosities were completed by using flow rate, pressure difference and measuring pipe size parameters. The shear stress-shear rate curves were drawn by using the actual measured pressure parameters and the calibrated pressure values in this paper. The calibrated shear stress-shear rate curve can be consistent with the curve of the rotary viscometer, and the maximum shear stress difference is reduced from 19 Pa to 3 Pa. According to the one-dimensional linear regression-golden section search algorithm proposed in this paper, the above 10 groups of drilling fluids are optimized. The optimized results are completely consistent with the actual rheological model of drilling fluid, and the automatic process of determining the optimal rheological model of drilling fluid is completed , with an accuracy rate of more than 95 %. The established drilling fluid model optimization method is of great significance for monitoring the rheology of drilling fluid, optimizing drilling operations, and avoiding problems such as wellbore cleaning, sticking, and leakage. Acknowledgements This work was supported in part by the National Natural Science Foundation of China under Grant 52204013, in part by the Scientific Research and Technological Development Project of CNPC 2023ZZ0603, in part by the National Key Research and Development Program of China 2023YFF0611101, and in part by the Science and Technology Cooperation Project of the China National Petroleum Corporation (CNPC)-Southwest Petroleum University (SWPU) Innovation Alliance under Grant 2020CX040000. References [1] J. Njuguna, S. Siddique, L. Bakah Kwroffie, S. Piromrat, K. Addae-Afoakwa and U. Ekeh-Adegbotolu, "The fate of waste drilling fluids from oil & gas industry activities in the exploration and production operations, "Waste Management, Vol. 139, pp. 362-380,2022. [2] J. A. Ali, D. Y. Abbas, M. Abdalqadir, T. Nevecna, P. T. Jaf and A. D. Abdullah, "Evaluation the effect of wheat nano- biopolymers on the rheological and filtration properties of the drilling fluid: Towards sustainable drilling process"Colloids and Surfaces A: Physicochemical and Engineering , Vol. 683,Aspects 2024. [3] A.K.Vajargah, G.Sullivan and E. Van.Oort, "Automated Fluid Rheology and ECD Management, " In Proceedings of the SPE Deepwater Drilling & Completions Conference, Galveston, TX, USA, pp. 14โ€“15. September 2016. [4] A.K.Vajargah, E.van.Oort, "Automated drilling fluid rheology characterization with downhole pressure sensor data, "In Proceedings of the SPE/IADC Drilling Conference and Exhibition, London, UK, 17 March 2015. [5] S. Broussard,P. Gonzalez and R. Murphy, "Making Real-Time Fluid Decisions with Real-Time Fluid Data at the Rig Site, " In Proceedings of the Abu Dhabi International Petroleum Exhibition and Conference, Abu Dhabi, United Arab Emirates, 1โ€“4 November 2010 [6] S.Gul, E.Van.Oort, C.Mullin, D.Ladendorf, P.N.Resources and R.Dutch, "Automated Surface Measurements of Drilling Fluid Properties: Field Application in the Permian Basin, "SPE Dril & Compl ,pp. 525โ€“534 2020. [7] K.Taugbรธl,B, Sola, M.Forshaw, and A. Fjogstad, "Automatic Drilling Fluids Monitoring." SPE/IADC International Drilling Conference and Exhibition, Virtual, March 2021. [8] K.Taugbรธl, Knut ,J.O. Brevik, and B. Rudshaug, "Automatic Drilling Fluid Measurements." SPE Russian Petroleum Technology Conference, Moscow, Russia, October 2019. [9] J. Berrebi, J. van Deventer and J. Delsing, "Reducing the flow measurement error caused by pulsations in flows, "Flow Measurement and Instrumentation,Vol 15, pp. 311-315,2004. 275 [10] T. Zhou, H. Ji, Z. Huang, B. Wang and H. Li, "On differential pressure fluctuation signals of gas-liquid two-phase flow in small-size pipe," 2016 35th Chinese Control Conference (CCC), Chengdu, China , pp. 5056-5060, 2016. [11] Cayeux, Eric, "Time, Pressure and Temperature Dependent Rheological Properties of Drilling Fluids and their Automatic Measurements." the IADC/SPE International Drilling Conference and Exhibition, Galveston, Texas, USA, March 2020. [12] A. Abdelaal,A. Ibrahim and S. Elkatatny, "Rheological Properties Prediction of Flat Rheology Drilling Fluids." the 56th U.S. Rock Mechanics/Geomechanics Symposium, Santa Fe, New Mexico, USA, June 2022. [13] Glen Mullineux, "Non-linear least squares fitting of coefficients in the Herschelโ€“Bulkley model, "Applied Mathematical Modelling,Vol 32, pp. 2538-2551,2008, [14] Wang . K., Yuan . Y., Han . S and Niu . Y. " Application of infrared spectroscopy and partial least-squares for modeling the correlation of bitumen dynamic shear rheological with temperature. " Petroleum Science and Technology, pp. 1194โ€“ 1200,2018. [15] O. M. Elizabeth,O. K. Gbolahan,E. M. Eterigho and O. J. Olusegun, "Data on the rheological behavior of cassava starch paste using different models, "Data in Brief,Vol 19, pp. 2163- 2177,2018. [16] G. I. Hakki,G. O. Kazim and Y. Samed, "A COMPREHENSIVE EVALUATION OF RHEOLOGICAL MODELS FOR NON-AQUEOUS DRILLING FLUIDS,".Proceedings of the International Conference on Offshore Mechanics and Arctic Engineering - OMAE, Vol.10,2022. [17] R.Wiล›niowski, K.Skrzypaszek and T.Maล‚achowski, "Selection of a Suitable Rheological Model for Drilling Fluid Using Applied Numerical Methods. " Energies , Vol 13, 2020. [18] N. Liu,D. Zhang,H. Gao,Y. Hu and L. Duan, "Real-Time Measurement of Drilling Fluid Rheological Properties: A Review, " Sensors (Basel, Switzerland), Vol.21, 2021. [19] G. Wang, H. Du, "Rheological properties of KCl/polymer type drilling fluids containing particulate loss prevention material,"Applied Rheology, Vol.28,2018. [20] H. Yang, P. Zhang, X. Meng, S. Gao and H. Liang, "On the Online Calibration of Drilling Fluid Rheological Parameters Using EMD and MLE," IEEE Sensors Journal, vol. 23, pp. 19861-19870, 1 Sept.1, 2023.