Application of Radial Basis Function (RBF) neural networks to estimate oil field drilling fluid density at elevated pressures and temperatures

The petroleum industry today has no choice, but to explore new and ever more deep and challenging pay zones as the most of the shallow oil and gas producing pay zones are severely depleted during the years of production. For improved drilling fluid performance in deep and hostile environment wells, accurate knowledge about the fluid density at high temperature and pressure conditions is an essential step. To achieve this mission, this study is aiming at developing a new computer-based tool is designed and applied for accurate calculation of drilling fluid density at HPHT conditions. In order to seek the comprehensiveness of the developed tool, four different kinds of fluids including water based, oil based, Colloidal Gas Aphron (CGA) based and also synthetic fluids are selected for modeling purpose. Radial Basis Function (RBF) network is considered as the modeling network. The results calculated via the proposed algorithm are compared to data reported in the literature. To make a judgment based on various statistical quality measures, it is concluded that the developed tool is reliable and efficient for density calculations of various fluids at extreme conditions.


Introduction
Drilling fluids are complex liquids composed of heterogeneous combinations of a variety of chemical additives and base fluids which their structure should remain stable and fixed in the range of desired temperature and pressures. As a crucially important property, density of a drilling fluid is cardinal in wellbore pressure calculation as well as for success of the drilling and completion operation [1]. In addition, downhole variations of temperature and pressure have a considerable impact on effective drilling fluid density, which highlights its importance even more during drilling operations [2]. Reductions of exploitable reserves from shallow horizons have led to an increase in deeper exploration activity [3]. In High Pressure and High Temperature (HPHT) wells, as drilling operation proceeds while increasing the Total Vertical Depth (TVD), extreme density variations of density are observed [2,4,5]. These variations are mainly due to an increase in the bottom-hole temperature, as well as increase height of the mud column in the HPHT wells.
Temperature and pressure have contrast influences on Equivalent Circulating Density (ECD). ECD increases as the height of oil column increases. On the contrary, the thermal expansion which is caused by temperature increase in the wellbore results in the reduction of ECD. Most frequently, it is believed that these two impacts balance each other out [6]. Nevertheless, this is not always true particularly when dealing with HPHT wells.
The accurate density behavior of a drilling fluid at HPHT can be acquired only via actual measurements [1]. Density measurement needs accurate density measuring devices. In addition the measuring process is difficult, time consuming and expensive. Moreover, obtaining experimental data covering all the bottom-hole temperature and pressure conditions is not within the realm of possibility. Therefore, introduction of a rapid, robust and accurate technique which could integrate the aforementioned measurements is of paramount importance. In recent years, intelligent techniques such as Radial Basis Function (RBF) have received great attention in solving complex classification and regression problems [7][8][9]. The RBF strategy has successfully been implemented in several different applications in petroleum and natural engineering such as Pressure-Volume-Temperature (PVT) properties estimation, gas properties prediction, measurement of porosity and permeability, and many more [7][8][9][10][11][12][13][14]. In this work, more than 880 datasets including various types of mud, initial density, pressure and temperature have been gathered from several published works [15][16][17]. In order to develop an effective model the gathered data were divided into three sets namely train, validation and test sets. For the training phase, 80% of actual data points were used to construct the model. For the validation set, 10% of data points were used to check the exactness of model. Finally the remaining 10% were used as test set to evaluate the performance of model for estimation of unseen data. The accuracy and precision of model were examined using different statistic and graphical representation methods.

Literature survey
Models used for prediction of drilling fluid density can be divided into two categories: linear empirical correlation and the analytical model as well as intelligent methods. In the past, several researchers developed linear empirical correlation and analytical models for estimation of drilling fluid density at HPHT [2,5,[18][19][20].
It is very important to account for the effects of temperature and pressure while estimating the ECD [6]. Peters et al. [20] successfully implemented the Hoberock et al. [21] compositional model to capture the volumetric behavior of drilling fluids in which the mineral oil and diesel are as base fluids in their structure. They measured the density of each liquid components of drilling fluid at pressures in the range of 0-15 000 psi and temperatures ranging from 78 to 350°F. The combination of their results and results obtained by Hoberock et al. leads to accurate predictions of drilling fluids density at high temperature and pressures. The obtained error for their results was <1% over the range of experimental pressure and temperature.
Another model which gained little success, was developed by Sorelle et al. [18]. Their model was based on correlations presenting the relation between hydrocarbon and water densities at different temperature and pressures. A similar correlation was developed by Kutasov [19] for prediction of behavior of water density at different pressure and temperatures which provided accurate water densities with much smaller error at HPHT region. Isambourg et al. [5] developed a polynomial with nine variables to define the behavior of liquid components in drilling fluids. The model was valid in the range of 60-400°F and 14.5-20 000 psi. Their model was a compositional based model which was similar to that developed by Hoberock et al. [21]. The model is based on the assumption that just liquid phase is responsible for volumetric changes in the drilling fluid. In order to apply their model, the accurate reference density of mud at surface condition must be specified Despite the success of linear empirical correlation and the analytical methods to model the drilling fluid densities, these methods have overlooked the effect of drilling fluid type on the density assessment at HPHT which limits their application only to drilling fluids of specific surface density [1]. Intelligent methods could be thought of as useful alternatives in considering effect of drilling fluid type on density assessment at HPHT. In recent years, different models were made to model the behavior of drilling fluid densities using Artificial Neural Network (ANN). Osman and Aggour [15] developed an ANN model to predict mud density as a function of mud type, pressure and temperature. The gathered density data of drilling fluids which their base liquids were water and oil at different pressures ranging from 0 to 1400 psi and temperatures up to 400°F were used for training and testing phases of the ANN model. Excellent agreement was observed between density values predicted by ANN with experimental measurements. Despite the success of ANN methodology, these techniques are afflicted by a number of disadvantages, such as overfitting, difficulty in achieving a stable solution, the need for a large training data set, and poor generalization ability to unseen data [1]. Support Vector Machine (SVM) and Least Squares Support Vector Machine (LSSVM) approach can be a good candidate to solve the aforementioned problems owing to its power for solving nonlinear prediction problems of small sample size and its well performance when tested for measurements outside the training set [7][8][9][22][23][24].

Details of intelligent model
Although the application of RBF neural network is the same as the Multilayer Perceptron (MLP) neural network, the structure of the RBF network is simpler than the MLP network. The RBF network structure consists of just three layers, which this structure makes the training process of the RBF network easier in comparison with the MLP network [25]. One of the most advantages of RBF networks is that they can be applied to highly noisy data [26]. The function which is applied to the weighting vector of the hidden layer is a non-linear transformation function. Prediction of multivariable continuous functions with acceptable accuracy is one of the capabilities of this type of networks. The other feature of RBF neural networks is that the obtained solution would be the best solution based on cost function immunization and oscillation control around the best solution. Moreover, the RBF network exploits the linear unknown coefficient to improve the optimal prediction capability [27]. In recent years, RBF neural networks have been used in many studies; so, in order to make this study brief and concise, the mathematical backgrounds of RBF are omitted. For a detailed description of RBF, readers may refer to the literature [28][29][30][31][32][33][34][35].

Data acquisition
In order to develop a dependable and general model it is essential to use valid data that covers a wide range of variables. In this respect, a total data set of 884 data points were gathered from literature [15][16][17]. In order to model the drilling fluid density, it was considered to be a function of pressure, temperature, type of mud, and initial density value. Table 1 shows the statistical parameters of the input and target data. In order to quantitate the mud type, the indices of 1, 2, 3, and 4 were utilized to denote the waterbased and oil-based, Colloidal Gas Aphron (CGA), and synthetic drilling fluids, respectively. As it is obvious, the used data covers a wide range of pressure and temperature for different drilling fluid types. The physical properties of the used drilling fluids are presented in Supplementary Material, Appendix A.

Model development
First of all, the data set values were normalized between +1 and À1. After that, the data set was randomly divided to train and test data in ratio of 4:1. This division was such that there is no local accumulation of train or test data points. In this way, 707 and 177 data points were allocated to train and test groups, respectively.
Matlab Ò 2014a was utilized to implement the RBF code. There are two main adjustable parameters in Matlab implementation, namely, Spread and Maximum Number of Neuron. The respective values of 0.93 and 269 resulted in acceptable results, which are discussed in following parts.

Accuracy of the proposed model and validation
Both graphical and statistical methods were used to evaluate the effectiveness of developed model. The cross-plot of the proposed model outputs versus the experimental values are depicted in Figure 1. As it is shown, a tight cloud of data points exists around the 45°line which indicates that there is good agreement between experimental data and model outputs.
The relative error is depicted in Figure 2. These figures suggest that the maximum value of absolute relative error is less than 0.04. Figure 3 shows the simultaneous depiction of predicted and experimental values versus the index of data points. As it is shown, the predicted values by the developed RBF model are very close to actual values.
Four different statistical parameters of correlation factor (R 2 ), Average Absolute Relative Deviation (AARD), Standard Deviation (SD), and Root Mean Squared Error (RMSE) are utilized (Eqs. (1)-(4)) to determine the effectiveness and precision of implemented model. The formulation of these parameters is as follows: ½ðk Pred ðiÞ À k Exp ðiÞÞ k Exp ðiÞ ; ð2Þ SD ¼ ðk Pred ðiÞ À k Exp ðiÞÞ 2 N ! 0:5 : ð4Þ   The values for the mentioned parameters are listed in Table 2. These values indicate the well performance of the proposed RBF network. In addition, the utilized data for prediction of the mud density as well as the predicted values using the developed RBF model are presented in Supplementary Material, Appendix B.

Comparison of developed model against available literature models
It is interesting to compare developed RBF neural network model with the existing models in the literature. A thorough investigation of the literature shows that there are six models developed for prediction of drilling fluid density at HPHT conditions [36,37]. Table 3 reports the statistical quality measures of the literature models as well as developed RBF neural network model in this study. As can be seen from this table, the proposed RBF model in this study has accuracy than all existing models in the literature.

Conclusion
One of the main functions of drilling fluid is to control the flow of formation fluids into the wellbore during drilling operation. For this reason, it is very important to determine density of drilling fluid accurately. The goal of this study is accurate determination of drilling fluid density using a smart model, namely, RBF neural network. The results show good consistency between actual data and model outputs. The prediction of constructed model comparing with corresponding experimental values yielding AARD and RMSE of 0.17% and 0.003%, respectively that confirm the superiority of the model. Another important point about this model is generality of the proposed RBF model that can predict the density of four types of drilling fluids namely, water-based, oil-based, CGA, and synthetic drilling fluids. The predicted density values of this model can be used for designing of any drilling operations of oil and gas fields with specific conditions.  Table 3. Statistical indexes of the proposed RBF model in comparison to existing models in the literature [36,37] for estimating the drilling f luid density at wellbore conditions.  [36] 0.7273 67.0907 GA-FIS [36] 0.9397 0.091 LSSVM [37] 0.9999 0.000145 ANFIS [37] 0.8502 35.002 PSO-ANFIS [37] 0.9321 0.01008