Newly Developed Correlations to Predict the Rheological Parameters of High-Bentonite Drilling Fluid Using Neural Networks

High-bentonite mud (HBM) is a water-based drilling fluid characterized by its remarkable improvement in cutting removal and hole cleaning efficiency. Periodic monitoring of the rheological properties of HBM is mandatory for optimizing the drilling operation. The objective of this study is to develop new sets of correlations using artificial neural network (ANN) to predict the rheological parameters of HBM while drilling using the frequent measurements, every 15 to 20 min, of mud density (MD) and Marsh funnel viscosity (FV). The ANN models were developed using 200 field data points. The dataset was divided into 70:30 ratios for training and testing the ANN models respectively. The optimized ANN models showed a significant match between the predicted and the measured rheological properties with a high correlation coefficient (R) higher than 0.90 and a maximum average absolute percentage error (AAPE) of 6%. New empirical correlations were extracted from the ANN models to estimate plastic viscosity (PV), yield point (YP), and apparent viscosity (AV) directly without running the models for easier and practical application. The results obtained from AV empirical correlation outperformed the previously published correlations in terms of R and AAPE.


Introduction
Drilling Fluids play a pivotal role during the drilling operation [1]. There are three main categories of the drilling fluid, namely water-based mud, oil-based mud, and synthetic-based mud, used to enhance the drilling operation performance under downhole conditions of pressure and temperature [2]. The main function of a drilling fluid is to clean the wellbore by lifting the drilled cuttings from the bottom of the hole up to the surface; then the cuttings are treated by the solid control equipment before being pumped again into the well [3]. Special viscous mud (known as spud mud) is commonly used while drilling surface sections to help remove large cuttings out of the drilled hole [4]. Moreover, it enhances wellbore stability by forming an impermeable filter cake and minimize fluid loss by stopping mud filtration [5].

High-Bentonite Mud (HBM)
HBM is a certain type of spud mud, which contains high-bentonite concentration. Generally, bentonite is used in drilling fluids to increase its viscosity and provide more colloidal solids, which form an impermeable filter cake and reduces [6]. Increasing the plastic viscosity of drilling fluid leads

Drilling Fluid Rheology
Rheology of drilling fluid is the controlling factor for enhancing the hole cleaning efficiency and optimizing the drilling performance [11,12]. These rheological properties include plastic viscosity (PV), yield point (Y P ), and apparent viscosity (AV) for evaluating the mud performance during drilling operation [13].
Plastic viscosity (PV) indicates the amount of solids existing in the drilling fluid [14]. Uncontrolled increase of the mud solid content may lead to many critical problems while drilling like pipe sticking and reducing the rate of penetration [15]. Yield point is another rheological parameter measuring the attractive forces among colloidal particles within the drilling fluid [14]. Optimizing Y P significantly affects hole-cleaning efficiency [15].
Mud rheological properties are experimentally estimated using conventional rheometer and mud balance. The rheometer can be simply described as a coaxial cylindrical rotational viscometer. During the measurement of the rheological properties of the drilling fluid using rheometer, the drilling fluid is contained in the annular space or the shear gap between the cylinders. Then the viscosity is determined based on the measurements of applied shear rate and the corresponding shear stress at different rotation speeds. More details on the rheometer design and the measuring technique are described in [16,17]. Common field practice comprises only measuring mud density by mud balance and mud viscosity by Marsh funnel periodically every fifteen minutes to monitor any changes in the rheology of the drilling fluid. A complete mud test (including all mud rheological properties) is performed twice a day since it consumes considerable time.
In 1960, Marsh funnel viscosity (FV) was introduced to indicate the changes in the rheology of the drilling fluid and measured by the Marsh funnel device. This tool is effectively practical because it takes a short operating time and can be utilized to frequently measure FV [18]. Some empirical models have been developed to determine rheological parameters of the drilling fluid using Marsh funnels. Some of the proposed models monitor the change in the mud height in Marsh funnel with time and correlate it with the fluid rheological properties such as PV, Y P , and AV [19][20][21][22]. The shear rate and the shear stress are estimated on the sides of the Marsh funnel using the volume of the mud coming out at different points. The measured shear rate and shear stress are then correlated to the rheological parameters. The Marsh funnel was used to investigate several water-based drilling fluids and it was proved that both PV and AV can be estimated using consistency plots [23].
Results from these models were extremely different from the measurements of the Marsh funnel and conventional rheometer. Other trials were conducted for accuracy improve by using polynomial functions of a high order to model the fluid flow volume through the marsh funnel instead of the simple equations used before [24,25]. These trials accurately simulated the change in fluid height within the Marsh funnel with time and achieved better estimations of the rheological parameters compared to those obtained from the standard rheometer.
The main objective of this study is to identify the rheological flow model of HBM experimentally and develop new sets of correlations using artificial neural networks to estimate the rheological parameters of HBM from available.

Predicting the Rheological Properties of Drilling Fluid While Drilling
Periodic monitoring of the parameters controlling the drilling operation is crucial for improving the drilling performance and avoiding any drilling problems. Therefore, hole cleaning and bit hydraulics should be optimized [26]. Optimization of drilling hydraulics accounts for the pressure losses, which depends mainly on the rheological properties of the drilling fluid used. Pressure losses through the annulus can be determined once the parameters of the Bingham plastic model (Y P and PV) are known using Equation (1), assuming laminar flow [27]. Moreover, equivalent circulating density (ECD) can be estimated using Equation (2), which represents the apparent mud weight in dynamic conditions. ECD accounts for many drilling problems like loss of circulation and well control incidents.
where ∆P is the pressure losses through the annulus (psi), PV is the plastic viscosity of the drilling fluid (cP), v is the average velocity (ft/s), Y P is the yield point (lb/100ft 2 ), d 1 is hole diameter (in), d 2 is the drill pipe outer diameter (in), L is the annulus length (ft), ECD is the equivalent circulation density (lb/ft 3 ), MD is the mud density (lb/ft 3 ), and h is true vertical depth (ft). Furthermore, surge and swab pressures can be estimated using Equation (1); after replacing the value of the average velocity (v) in Equation (1) with the effective velocity (v e ), which can be calculated using Equation (3) [28].
where v m is the mud velocity (ft/s), v p is the pipe velocity (ft/s), k is the clinging constant.

Experimental Work
The rheological models are critical for simulating the characteristics of drilling mud under dynamic conditions to determine key parameters such as equivalent circulating density, pressure drop, hole cleaning efficiency. All of these parameters are required to design and evaluate the hydraulics and assess the functionality of the mud system [29]. There are three well-known mathematical models used to describe the mud rheology; Power Law model, Bingham Plastic model, and Hershel Buckley Model [30,31]. Each model has specific parameters to describe the drilling fluid performance such as shear stress, shear rate, flow behavior index, and consistency coefficient. To study the rheological behavior of HBM and identify the most appropriate rheological model that follows, mud samples were prepared based on the formulation listed in Table 2. The standard Rheometer was operated at different shear rates and the corresponding shear stress was recorded at 120 • F and atmospheric pressure. The results presented in Figure 1 shows the relation between the shear rate and shear stress for HBM. HBM was believed to follow Bingham plastic behavior due to the linear relationship found between shear stress and shear rate [32]. Mud exhibiting Bingham plastic behavior need shear stress that is higher than a critical value, called the yield point (Y P ), to start flowing. Once the yield point is reached, changes in shear stress and shear rate are directly proportional. The slope of the curve gives the plastic viscosity (PV) [33]. Based on this result, the behavior of HBM can be described by the two-parameter in the Bingham plastic model, PV and Y P . Bingham plastic model does not accurately predict fluid flow behavior at low shear rates' therefore, only high shear rates are considered in Figure 1. However, it is useful for continuous monitoring and controlling of the drilling fluids' performance [34].  The standard Rheometer was operated at different shear rates and the corresponding shear stress was recorded at 120 °F and atmospheric pressure. The results presented in Figure 1 shows the relation between the shear rate and shear stress for HBM. HBM was believed to follow Bingham plastic behavior due to the linear relationship found between shear stress and shear rate [32]. Mud exhibiting Bingham plastic behavior need shear stress that is higher than a critical value, called the yield point (YP), to start flowing. Once the yield point is reached, changes in shear stress and shear rate are directly proportional. The slope of the curve gives the plastic viscosity (PV) [33]. Based on this result, the behavior of HBM can be described by the two-parameter in the Bingham plastic model, PV and YP. Bingham plastic model does not accurately predict fluid flow behavior at low shear rates' therefore, only high shear rates are considered in Figure 1. However, it is useful for continuous monitoring and controlling of the drilling fluids' performance [34].

Implementation of Artificial Neural Network (ANN) to Predict HBM Rheology
ANN is an artificial intelligence (AI) powerful tool that can imitate different complex problems which cannot be treated using conventional regression techniques. Without defining the physics behind the studied phenomenon, ANN can analyze its characteristics [35]. ANN processes the data through a network that mimics biological neural systems [36]. Artificial neurons are the elementary units in ANN. An ANN model consists of three fundamental layers: input layer, hidden layers, and an output layer. These layers are connected and processed with special training algorithm and transfer functions to represent the nature of the problem [35]. The neurons existing in each layer are linked by weighted connections called weights and bias [37]. The output layer is commonly assigned to an activation function of ''pure linear" while there are many available options for the transfer functions assigned to hidden layers such as log-sigmoidal and tan-sigmoidal types [38]. Recently, AI has been widely used in the area of drilling fluid [39]. Some of these applications are drilling optimization [40], optimizing drilling hydraulics [41], and prediction of rheological properties of invert emulsion mud, KCl water-based mud, CaCl2 drilling fluid, NaCl water-based drill-in fluid

Implementation of Artificial Neural Network (ANN) to Predict HBM Rheology
ANN is an artificial intelligence (AI) powerful tool that can imitate different complex problems which cannot be treated using conventional regression techniques. Without defining the physics behind the studied phenomenon, ANN can analyze its characteristics [35]. ANN processes the data through a network that mimics biological neural systems [36]. Artificial neurons are the elementary units in ANN. An ANN model consists of three fundamental layers: input layer, hidden layers, and an output layer. These layers are connected and processed with special training algorithm and transfer functions to represent the nature of the problem [35]. The neurons existing in each layer are linked by weighted connections called weights and bias [37]. The output layer is commonly assigned to an activation function of "pure linear" while there are many available options for the transfer functions assigned to hidden layers such as log-sigmoidal and tan-sigmoidal types [38]. Recently, AI has been widely used in the area of drilling fluid [39]. Some of these applications are drilling optimization [40], optimizing drilling hydraulics [41], and prediction of rheological properties of invert emulsion mud, KCl water-based mud, CaCl 2 drilling fluid, NaCl water-based drill-in fluid rheological properties [42][43][44][45]. Additionally, new systems were developed using the integration between sensitive sensors measurements and AI application to estimate rheological parameters of non-Newtonian fluids [46]. Furthermore, an automated Marsh funnel was developed using data-driven sensors to allow real-time measurement of FV [47]. Therefore, integration between the developed models and such automated funnel would lead to a complete real-time monitoring system for estimating the rheological properties of the drilling fluid while drilling.

Data Description
Field measurements (200 data points) include MD, FV, Y p , PV, and AV for HBM were collected from field measurements that follow the recommended practice for field testing drilling fluids by API RP 13B-1 [48]. The HBM data represented HBM prepared using the same formulation and mixed with the same service company. During field measurements, the rheometer was used to measure the shear stresses at shear rates of 300 and 600 donated by R600 and R300, respectively. These readings were used to estimate Yp, PV, and AV using Equations (4)-(6), respectively [49,50]. Mud density was measured using a mud balance device. MD and FV measurements were conducted at 80 • F, which is the average surface temperature of the region in which the field under study exists. Therefore, it is recommended to use the developed model for fields within the same surface temperature.
The MD ranges from 64 to 73 lb/ft 3 , FV ranges from 45 to 150 s/quart, PV ranges from 11 to 56 cP, YP ranges from 20 to 46 lb/100 ft 2 , and AV ranges from 23 to 79 cP. MD has a low correlation coefficient (R) with Y p , PV, and AV, 0.06 at maximum as shown in Figure 2. On the other hand, FV has a correlation coefficient (R) of 0.45, 0.59, and 0.62 with Y P , PV, and AV respectively. This higher R-value between the rheological properties with FV compared to MD can be explained as HBM is characterized by its high content of bentonite, which mainly affects the mud viscosity, not the mud weight. Table 3 lists different statistical parameters for the HBM rheological data used in building the ANN models, while Table 4 lists a sample of the obtained data used for training the networks. rheological properties [42][43][44][45]. Additionally, new systems were developed using the integration between sensitive sensors measurements and AI application to estimate rheological parameters of non-Newtonian fluids [46]. Furthermore, an automated Marsh funnel was developed using datadriven sensors to allow real-time measurement of FV [47]. Therefore, integration between the developed models and such automated funnel would lead to a complete real-time monitoring system for estimating the rheological properties of the drilling fluid while drilling.

Data Description
Field measurements (200 data points) include MD, FV, Yp, PV, and AV for HBM were collected from field measurements that follow the recommended practice for field testing drilling fluids by API RP 13B-1 [48]. The HBM data represented HBM prepared using the same formulation and mixed with the same service company. During field measurements, the rheometer was used to measure the shear stresses at shear rates of 300 and 600 donated by R600 and R300, respectively. These readings were used to estimate Yp, PV, and AV using Equations (4)-(6), respectively [49,50]. Mud density was measured using a mud balance device. MD and FV measurements were conducted at 80 °F, which is the average surface temperature of the region in which the field under study exists. Therefore, it is recommended to use the developed model for fields within the same surface temperature.
The MD ranges from 64 to 73 lb/ft 3 , FV ranges from 45 to 150 s/quart, PV ranges from 11 to 56 cP, YP ranges from 20 to 46 lb/100 ft 2 , and AV ranges from 23 to 79 cP. MD has a low correlation coefficient (R) with Y , PV, and AV, 0.06 at maximum as shown in Figure 2. On the other hand, FV has a correlation coefficient (R) of 0.45, 0.59, and 0.62 with YP, PV, and AV respectively. This higher R-value between the rheological properties with FV compared to MD can be explained as HBM is characterized by its high content of bentonite, which mainly affects the mud viscosity, not the mud weight. Table 3 lists different statistical parameters for the HBM rheological data used in building the ANN models, while Table 4 lists a sample of the obtained data used for training the networks.

Quality Check and Data Filtration
The higher the quality of the training data is, the better the accuracy of AI models [51]. Thus, the obtained dataset quality was checked using both statistical and technical tools. Unrealistic values like negative and zero values were removed. Then outlier values which show significant deviation from the normal trend of the data were eliminated using the box and whisker plot method [52]. This method comprises two limits (top and bottom) called whiskers representing the upper and lower limits of the data [53]. Values exceeding these two whiskers are considered outliers thus would be removed. These whiskers can be determined using some statistical parameters such as the minimum, maximum, mean, and median parameters (listed in Table 3). According to the reference ranges of the rheological properties of the HBM formulation listed in Table 5, it is clear that the collected data for building the model covers a wide range of these properties, which gives a promising indication on the distribution and the quality of the obtained models.

Model Development
The collected data were used for building the proposed ANN models. For optimizing the developed models, several scenarios were tested including varying ANN parameters. This was achieved using a specially designed MATLAB code to test all the possible combinations between these parameters. For each scenario (parameters' combination), the accuracy of the results was evaluated based on the calculated average absolute percentage error (AAPE), in addition to the correlation coefficient (R), to determine how close the predicted values were to the actual values. The varying ANN parameters and their tested ranges were as follows: -Number of hidden layers (ranges from one to four layers) Thereafter, the tested parameters, which resulted in the most accurate results indicated by the lowest AAPE and highest correlation coefficient between the predicted and actual values, were selected. The optimization process followed is schematically described in the flowchart shown in Figure 3. The optimized parameters were found to be a single hidden layer with 20 neurons, Levenberg-Marquardt backpropagation (trainlm) training algorithm with a learning rate of 0.12, a tan-sigmoidal transfer function between the input and hidden layers in addition to a pure-linear transfer function between the hidden and output layers. Figure 4 shows the schematic structure of the developed ANN models.

Yield Point Prediction
ANN model was developed using MD and FV as inputs to predict Y P . The obtained data were randomly divided using MATLAB program into ratios of 70 percent for training and 30 percent for testing. Figures 5 and 6 show a good match between the predicted Y P values and the actual ones. The high accuracy of the developed model can be inferred from the high R-value of 0.94 for the training process and 0.92 for the testing process in addition to the low AAPE of 2.95% and 4.8% for the training and testing respectively.
Thereafter, a new correlation was developed using the ANN model to predict Y P based on MD and FV. The developed correlation can be used as follows. First, the inputs should be normalized as described in Appendix A. Then, the normalized value of the output (Y p n ) is calculated using Equation (7) with its optimized coefficients listed in Table A1 (Appendix B).
where; (i) is the index of each neuron in the hidden layer, (N) is the optimized number of neurons in the hidden layer, (w 1 ) is the weight vector linking the input and the hidden layer, (w 2 ) is the weight vector linking the hidden and output layer, (b 1 ) is the biases vector for the input layer, (b 2 ) is the biases vector for the output layer. For example, w 1 i,1 represents the weight [associated with the neuron of index (i) in the first layer], which would be multiplied by the normalized value of the first input (MW n ) and similarly w 1 i,2 represents the weight [associated with neuron of index (i) in the first layer], which would be multiplied by the normalized value of the second input (FV n ). The required Y P value can then be obtained by denormalizing Y p n using Equation (8).

Yield Point Prediction
ANN model was developed using MD and FV as inputs to predict YP. The obtained data were randomly divided using MATLAB program into ratios of 70 percent for training and 30 percent for testing. Figures 5 and 6 show a good match between the predicted YP values and the actual ones. The high accuracy of the developed model can be inferred from the high R-value of 0.94 for the training process and 0.92 for the testing process in addition to the low AAPE of 2.95% and 4.8% for the training and testing respectively.  Thereafter, a new correlation was developed using the ANN model to predict YP based on MD and FV. The developed correlation can be used as follows. First, the inputs should be normalized as

Yield Point Prediction
ANN model was developed using MD and FV as inputs to predict YP. The obtained data were randomly divided using MATLAB program into ratios of 70 percent for training and 30 percent for testing. Figures 5 and 6 show a good match between the predicted YP values and the actual ones. The high accuracy of the developed model can be inferred from the high R-value of 0.94 for the training process and 0.92 for the testing process in addition to the low AAPE of 2.95% and 4.8% for the training and testing respectively.  Thereafter, a new correlation was developed using the ANN model to predict YP based on MD and FV. The developed correlation can be used as follows. First, the inputs should be normalized as

Plastic Viscosity Prediction
Similarly, MD and FV were used to predict PV using ANN. The model was trained using 70% of the obtained data while 30% of the data for testing the model performance. Figures 7 and 8 show cross-plots indicating the high match between the measured and the predicted Similarly, MD and FV were used to predict PV using ANN. The model was trained using 70% of the obtained data while 30% of the data for testing the model performance. Figures 7 and 8 show cross-plots indicating the high match between the measured and the predicted PV values from the developed ANN model. The high accuracy of the developed model can be pointed out from the high R-value of 0.95 for training and 0.94 for testing in addition to low AAPE of 4.9% and 5.7% for training and testing, respectively.  Afterwards, an empirical equation was obtained from the developed ANN model to calculate PV from MD and FV. The normalized PVn was first calculated using Equation (9) with the optimized weights and biases listed in Table A2 (Appendix B). MDn and FVn are the normalized input parameters following the procedures described in Appendix A.
The denormalized value for the output (PV) was finally calculated from the normalized value (PVn) using Equation (10). PV values from the developed ANN model. The high accuracy of the developed model can be pointed out from the high R-value of 0.95 for training and 0.94 for testing in addition to low AAPE of 4.9% and 5.7% for training and testing, respectively.
Afterwards, an empirical equation was obtained from the developed ANN model to calculate PV from MD and FV. The normalized PV n was first calculated using Equation (9) with the optimized weights and biases listed in Table A2 (Appendix B). MD n and FV n are the normalized input parameters following the procedures described in Appendix A.

Apparent Viscosity Prediction
Another ANN model was developed to estimate AV based on MD and FV. The obtained data are partitioned into 70/30 ratios for training and testing the model, respectively. Figures 9 and 10 show the high agreement between the measured and the predicted AV values from the developed ANN model as shown in the cross-plots. The high accuracy of the developed model can be confirmed from the high R-value of 0.98 for training and 0.92 for testing, in addition to the low AAPE of 2.8% and 5.6% for training and testing processes, respectively.  Following that, the empirical correlation was extracted from the developed model to calculate AV directly from MD and FV without the need to run the model. The normalized value AVn would first be calculated using Equation (11), the needed weights and biases for this equation are listed in Table A3 (Appendix B).  Following that, the empirical correlation was extracted from the developed model to calculate AV directly from MD and FV without the need to run the model. The normalized value AVn would first be calculated using Equation (11), the needed weights and biases for this equation are listed in Table A3 (Appendix B). Following that, the empirical correlation was extracted from the developed model to calculate AV directly from MD and FV without the need to run the model. The normalized value AV n would first be calculated using Equation (11), the needed weights and biases for this equation are listed in Table A3  (Appendix B).
Finally, AV can be estimated using Equation (12).

Apparent Viscosity Model Validation
Based on the literature, two general models were developed to evaluate the mud rheology using mud weight and Marsh funnel viscosity. One was introduced by Pitt [54] to predict the apparent viscosity from mud density and Marsh funnel measurements, as stated in Equation (13). Later, the previous model was modified by Almahdawi et al. [55] as shown in Equation (14), yielding more accurate results compared to Equation (13).
where AV is the apparent viscosity of the drilling fluid (cP), and the D was the density of mud (g/cm 3 ), and T is the Marsh funnel viscosity (s). The developed AV correlation was validated by comparing its results with the previously published approaches. To verify the developed model, the testing data of MD and FV were utilized to estimate AV using the two previous models in Equations (13) and (14) and the newly developed ANN-AV model. The obtained results showed that the ANN model outperformed with R 2 of 0.94 compared to R 2 of 0.63 for both Equation (13) and Equation (14), respectively as shown in Figures 11 and 12. The superiority of the developed ANN model over the other models can be also indicated in Figure 12, which shows that the error of the developed ANN model was only 3.4% AAPE compared with 63.8% AAPE for Equation (13) and 55.8% for Equation (14).

Apparent Viscosity Model Validation
Based on the literature, two general models were developed to evaluate the mud rheology using mud weight and Marsh funnel viscosity. One was introduced by Pitt [54] to predict the apparent viscosity from mud density and Marsh funnel measurements, as stated in Equation (13). Later, the previous model was modified by Almahdawi et al. [55] as shown in Equation (14), yielding more accurate results compared to Equation (13).

AV = D (T − 28)
where AV is the apparent viscosity of the drilling fluid (cP), and the D was the density of mud (g/cm 3 ), and T is the Marsh funnel viscosity (s). The developed AV correlation was validated by comparing its results with the previously published approaches. To verify the developed model, the testing data of MD and FV were utilized to estimate AV using the two previous models in Equations (13) and (14) and the newly developed ANN-AV model. The obtained results showed that the ANN model outperformed with R 2 of 0.94 compared to R 2 of 0.63 for both Equation (13) and Equation (14), respectively as shown in Figures 11  and 12 The superiority of the developed ANN model over the other models can be also indicated in Figure 12, which shows that the error of the developed ANN model was only 3.4% AAPE compared with 63.8% AAPE for Equation (13) and 55.8% for Equation (14).