Selection of a Suitable Rheological Model for Drilling Fluid Using Applied Numerical Methods

: The accuracy of ﬁtting the rheological model to the properties of actual drilling ﬂuid minimises the errors of the calculated technological parameters applied while drilling oil wells. This article presents the methodology of selecting the optimum drilling ﬂuid rheological model. Apart from classical rheological models, i.e., the Newtonian, Bingham Plastic, Casson, Ostwald de Waele and Herschel–Bulkley models, it has been proposed to consider the Vom Berg and Hahn-Eyring models, which have not been applied to describe drilling ﬂuids so far. In the process of determining rheological parameters for the Bingham Plastic, Casson, Ostwald de Waele and Newtonian models, it is proposed to use a linear regression method. In the case of the Herschel–Bulkley, Vom Berg and Hahn-Eyring models, it is suggested to use a non-linear regression method. Based on theoretical considerations and mathematical relations developed in the Department of Drilling and Geoengineering, Drilling, Oil and Gas Faculty, at AGH University of Science and Technology, an original computer program called Rheosolution was developed, which enables automation of the process of determining the optimum drilling ﬂuid rheological model. Some examples show the practical application of the method of selecting the optimum drilling ﬂuid rheological model. Taking into account data from actual measurements of drilling ﬂuid properties, it has been proven that the Vom Berg and Hahn-Eyring rheological models are best ﬁtted to the description of drilling ﬂuid rheological parameters.


Introduction
For over 150 years, different drilling fluids such as drilling muds, drill-in fluids, spacers and washers, cement slurries and fracturing fluids have been used in the drilling practice. Each of them has to fulfil strictly specified functions so that the borehole making process is safe both for the natural environment and people working on a drilling rig. For instance, drilling mud is aimed at cleaning the borehole bottom off drill cuttings, removing cuttings up to the area surface, ensuring the stability of borehole walls both during drilling and circulation breaks, protecting against eruption (by exerting hydrostatic pressure), maintaining cuttings in a state of suspension during breaks in circulation, cleaning teeth of a drilling tool, lubricating drill bearings, cooling down a drill, and at supplying energy to the borehole bottom in order to support the drilling process. In addition, during directional drilling, horizontal drilling and multilateral drilling, drilling mud provides drive to mud motors (PDM motors, turbine drilling motors, RSS systems) and enables control of the trajectory course (Measurement-While-Drilling systems).
Together with the development of new drilling technologies such as high pressure and high temperature (HPHT technology), underbalance drilling (UBD drilling), managed pressure drilling (MPD technology), it becomes more and more important to determine precisely drilling mud and drilling fluid parameters and properties. Technological properties of the applied fluids depend, inter alia, on their rheological parameters. In order to describe cause and effect relations occurring between rheological parameters of a fluid and the technology of its use, rheological models are developed. The knowledge of a fluid rheological model is crucial since the accuracy of fitting a rheological model to the actual property of fluid minimises errors of values being calculated, including the nature of the fluid flow, fluid flow resistance in the circulatory system, diameters of drilling or extending tool nozzles, mechanical and hydraulic parameters of the drilling technology, particle sedimentation and the effectiveness of cuttings removal, injection radius and the technology of its application (stream of flow volume, pressure and time of injection performance), power consumption during mixing, mixing efficiency and issues relating to thermal conductivity during flow and mixing.
A number of rheological models have been developed in the drilling practice, however, none of them is universal enough to describe precisely the behaviour of drilling fluids in a wide range of shear rates. Rheological models form a mathematical description of the behaviour of Newtonian fluids. Those models may be divided into two groups: − relations between the shear rate and shear stress, − relations between the shear rate or shear stress and apparent viscosity. Models in both groups are different with respect to the applied function and parameters approximating actual fluid behaviour. Models from the first group are applied for the analysis of drilling fluids.

Rheological Models of Drilling Fluids
The following rheological models are most frequently applied for drilling technologies [1,2]: Herschel-Bulkley : (Yield-Power Law) : The Bingham Plastic model has been applied most frequently due to its relative simplicity and ease in calculating flow resistances [1]. Yet, at high shear rates and more complex drilling fluid formulas, particularly those using polymers, this model does not describe the nature of drilling fluids in a precise way.
When computers started to be used more commonly, it became possible to support computational processes commonly and numerically, which helped to popularise the power model and the Herschel-Bulkley model (YPL), which describes drilling fluids the best among those currently used in the drilling practice [3,4]. Presently, computers are commonly available, and their computational power enables the performance of quite complex and extended numerical calculations in a short time. Therefore, it seems reasonable to analyse other models, which could prove to be better than those applied so far, and the use of which could have been impractical so far, due to calculations complexity. The Vom Berg model and the Hahn-Eyring model have been selected for the analysis [5,6]. The main selection criterion was another nature of the curve describing the dependency of shear stresses on the shear rate. Contrary to the Ostwald-de Waele (Powel Law) model and the Herschel-Bulkley (Yeld-Power Law) model, and also similar models, such as the Sisko model or the Robertson-Stiff model [6], the curve in the analysed models is described by an inverse hyperbolic function instead of a power function. The second criterion was very good results of applying those models in other industries, which would justify considering them in the context of describing drilling fluids by means of them. Both the Vom Berg model and the Hahn-Eyring model have successfully been applied to the description of cement slurries used in the construction industry, which is confirmed in the literature [6]. The last condition was potentially high flexibility and possibility to fit into measurement data. In this case (similarly to the YPL model), it is ensured by three parameters, which can be adapted to the fluid under analysis.
New Vom Berg and Hahn-Eyring models, proposed to be applied in the drilling sector, are described as follows [5][6][7]: Hahn-Eyring : The authors make an attempt to demonstrate the usefulness of the Vom Berg and Hahn-Eyring models (not used in calculations for drilling fluids yet) in minimising errors in the calculation of rheological parameters and, in consequence, more accurate determination of flow resistance of drilling fluids.

Methodology
Laboratory tests of real drilling fluids were performed by means of rotational viscometers. The result of those tests was a set of measurement points, in which values of shear stresses (τ) occurring in the fluid under the influence of different shear rates ( . γ = − dv dr ) were determined. In order to determine the optimum rheological model, it has been suggested to conduct a regression analysis, since it specifies the most probable function linking average values of both variables. The procedure of determining a regression function is called the least-squares method. This principle boils down to the statement that among all functions illustrating dispersion of measurement results the best one is the one for which the sum of squares of measurement points deviations from that function is the lowest [8].
In the case of the Bingham Plastic, Casson, Ostwald de Waele and Newtonian models, the authors propose to apply a linear regression method. In case of the Herschel-Bulkley, Vom Berg and Hahn-Eyring models, they suggest applying a non-linear regression method.

Linear Regression
In the case of linear regression, the optimum function is expected to take the form of a linear Equation [8]: The least squares estimation is presented in the following form: Taking into account Equation (8), a sum of squared residuals is obtained: Equation (10) is a function of coefficients a and b. The condition of function U minimisation can be thus expressed in the form of the following equations: By solving a system of Equation (11), one can acquire formulas for linear regression coefficients, known from the literature: For the Bingham Plastic model, Equations (12) and (13) can be used directly, by applying substitutions: η = a, τ y = b, . γ = x and τ= y. Rheological parameters are determined from the following relation: For the Ostwald-de Waele (Power Law) model and the Casson model, their linearisation is necessary. Linearisation of the Ostwald-de Waele (Power Law) model is acquired by logarithmic Equation (3) on both sides as follows: and using substitutions n = a, lnk = b, ln . γ = x, lnτ = y. Rheological parameters are determined from the following relation: Energies 2020, 13, 3192

of 17
Linearisations of the Casson model are performed by applying substitutions: γ = x and √ τ = y. Rheological parameters are determined from the following relation: For the Newtonian model, when applying the least squares method, a regression function in the following form is assumed:ŷ = ax.
The least-squares condition given with Equation (9), taking into account Equation (21) is described with the formula: By differentiating Equation (22) against coefficient a, the following formula is obtained: from which, after comparing to zero, one can designate the value of coefficient a A rheological parameter of the Newtonian model (dynamic viscosity η) is thus determined from the following relationship:

Non-Linear Regression
The Herschel-Bulkley model cannot be linearised since while determining parameter equations an implicit equation with one variable occurs. The condition of function U minimisation can thus be expressed in the form of equations: (26) A system of Equation (26) after ordering variables boils down to the following form: [4] Equation (27) is an implicit equation with one variable n. In order to solve it, it is suggested to apply one of the numerical methods, e.g., the bisection method [9].
In this method, a function is constructed in the following form: [4]   The starting range [A, B] is divided into two in order to determine the value of the coordinate of the interval centre: n sr = A+B 2 . Next, the value of the g(n sr ) function is determined and compared to the g(A) value. If the function changes the sign, it means that the root of the g(n) function is in the range [A, nś r ]; otherwise, the root is in the range [nś r , B]. Calculations are made until the range width is smaller or equal to accuracy ε assumed at the beginning. The root of the function is then determined based on the formula: n sr = A+B 2 , whereas the error of its estimation is calculated from the dependency: blad = B−A 2 . The algorithm of Equation (28), with the use of the bisection method, has been provided in Figure 2.  Given the designated value of the parameter n, the other rheological parameters in the Herschel-Bulkley model can be specified from Equations (29) and (30): Similarly, to the Herschel-Bulkley (YPL) model, also in the case of the Vom Berg and Hahn-Eyring models, linearisation of their rheological equations is not possible: The condition of the function U minimisation for the Vom Berg model, using substitutions can be expressed in the form of a system of equations: The condition of the function U minimisation for the Hahn-Eyring model, by applying substitutions can be expressed in the form of a system of equations: There are a number of available non-linear regression methods [10,11]. With regard to the Vom Berg and Hahn-Eyring models, it is proposed to apply gradient descent [12]. This algorithm enables us to find local minima of a function and to determine the global minimum from among them. It consists of selecting a starting point to be found in the domain of the analysed function. This function is a function which specifies fitting of the analysed model equation (the sum of squared residuals) and designates a vector in it with the direction of a given function gradient and the sense opposite to it. The length of a step (vector) is equal to one multiplied by the vector length coefficient. This coefficient can be freely adapted to optimise the algorithm: After the computational sequence has been performed, the model parameters are modified with the vector value and the algorithm selects a given point as a new starting point. The process is repeated until a local minimum is achieved, with the assumed precision. Then, the starting point changes and another local minimum is searched for. After repeating calculations, the assumed number of times, the smallest of the local minima being found is selected and considered the global minimum.
The flow chart of calculations is presented in Figures 3 and 4.
To simplify the equation, particular rheological model parameters are ascribed to variables a, b, c, whereas constant y i and x i are data from subsequent measurement points. With every step, only the variables are modified. Assignment of model equations to the diagram: the Vom Berg model : the Hahn-Eyring model : Partial derivatives are calculated according to Equation (31) or Equation (32). The gradient descent can be also applied when designating rheological parameters under the Herschel-Bulkley model.

Numerical Support of the Process of Selecting a Drilling Fluid Rheological Model
Development of the methodology of fitting rheological parameters in research data has enabled us to create a numerical tool making it possible to select the optimum drilling fluid rheological model. A new version of the Rheosolution program, version 4.0, has been developed, in which apart from the Newtonian, Bingham Plastic, Ostwald-de Waele, Casson and Herschel-Bulkley models, handling of the Vom Berg model and the Hahn-Eyring model was introduced. A number of other changes were made, including, inter alia, modernisation and reconstruction, together with rewriting the program from the Pascal language into C++/CLI and also adding the English version.
Rheosolution in the new version 4.0 adapts the parameters of seven rheological models to the measurement data being introduced. The program calculates rheological parameters for each of the

Numerical Support of the Process of Selecting a Drilling Fluid Rheological Model
Development of the methodology of fitting rheological parameters in research data has enabled us to create a numerical tool making it possible to select the optimum drilling fluid rheological model. A new version of the Rheosolution program, version 4.0, has been developed, in which apart from the Newtonian, Bingham Plastic, Ostwald-de Waele, Casson and Herschel-Bulkley models, handling of the Vom Berg model and the Hahn-Eyring model was introduced. A number of other changes were made, including, inter alia, modernisation and reconstruction, together with rewriting the program from the Pascal language into C++/CLI and also adding the English version.
Rheosolution in the new version 4.0 adapts the parameters of seven rheological models to the measurement data being introduced. The program calculates rheological parameters for each of the analysed models and indicates the model with the highest degree of fitting. Data and diagrams are exported to files, images and spreadsheets.
The way of fitting rheological parameters depends on a model. In case of the Newtonian and Bingham Plastic models, linear regression is applied, which enables designation of linear equation parameters. Ostwald-de Waele and Casson equations are linearised, and next, linear regression is applied. The last three models are designated by means of gradient descent.
The user interface has been provided in Figure 5. The method of program operation is shown in Figure 6. The user interface has been provided in Figure 5. The method of program operation is shown in Figure 6.

Results and Discussion
In order to exemplify the relations presented in this article, laboratory tests of different drilling fluids were made [1]. The measurements were made in the Drilling Fluids Laboratory in the Department of Drilling and Geoengineering, Faculty of Drilling, Oil and Gas on a Fann viscometer. The tested fluids were the following: • Cement slurry o w/c = 0.5, without any additives, • Cement slurry o w/c = 0.5 with addition of 0.3% PSP 042 superplasticizer, • 3% bentonite drilling mud without any additives. • 3% bentonite drilling mud with an addition of 2% XCD polymer. Table 1 shows the results of rheological measurements of four drilling fluid formulas performed on a Fann viscometer, with the arrangement of Rotor-Bob cylinders (R1-B1) and an applied spring

Results and Discussion
In order to exemplify the relations presented in this article, laboratory tests of different drilling fluids were made [1]. The measurements were made in the Drilling Fluids Laboratory in the Department of Drilling and Geoengineering, Faculty of Drilling, Oil and Gas on a Fann viscometer. The tested fluids were the following: • Cement slurry o w/c = 0.5, without any additives, • Cement slurry o w/c = 0.5 with addition of 0.3% PSP 042 superplasticizer, • 3% bentonite drilling mud without any additives. • 3% bentonite drilling mud with an addition of 2% XCD polymer. Table 1 shows the results of rheological measurements of four drilling fluid formulas performed on a Fann viscometer, with the arrangement of Rotor-Bob cylinders (R1-B1) and an applied spring Table 2 shows relations between shear stresses and the shear rate obtained from laboratory tests on a Fann viscometer, with the arrangement of Rotor-Bob cylinders (R1-B1) and an applied spring (F1) [1]. Tables 3 and 4 present the calculated values of rheological parameters pertaining to fluids  under analysis, approximated with particular rheological models. Tables 5 and 6 present rheological model selection results, pertaining to the analysed fluids, obtained from Rheosolution. Figures 7-10 present drawings to show a comparison of the selected rheological models for the tested drilling mud and cement slurry. To maintain the clarity of the drawing, models recommended by the American Petroleum Institute (Bingham Plastic and Ostwald de Waele models) were selected for comparison.  2  15  2  2  2  4  2  24  3  18  3  3  3  5  3  26  6  25  6  4  6  6  6  28  10  32  10  6  10  6  10  31  20  47  20  10  20  6  20  35  30  54  30  14  30  6  30  38  60  67  60  28  60  8  60  45  100  80  100  48  100  10  100  51  200  108  200  91  200  14  200  65  300  132  300  141  300  18  300  76  600  183  600  237  600  28 600 98   The tests were successful. In the case of pure slurry, the Ostwald-de Waele model turned out to be the best-fitted model. For slurry with addition of PSP 042 superplasticizer, the Vom Berg model was the best fitted model. Pure bentonite drilling mud was best described by means of the Casson model, and polymer inhibited mud, by means of the Hahn-Eyring model. For drilling muds and cement slurries without additives, differences between the correlation coefficient are not that significant among some models and linear models have a good correlation in these cases.
Preliminary studies on sample drilling mud and cement slurries encourage more accurate analysis; the results indicate that the multi-parameter models of Vom Berg and Hahn-Eyring have a high correlation for drilling fluids with an addition of polymers or superplasticizers. This is due to the fact that such additions most often cause non-linear increases in the value of rheological parameters, therefore, models based on exponential functions better illustrate these changes. The use of computational methodology, Rheosolution 4.0 and viscometers such as Brookfield R/S (multi shear rate measurement points) can improve the adjustment of a rheological model to the behaviour of the actual drilling fluid during its flow. Energies 2020, 13, x FOR PEER REVIEW 16 of 20     Recently, progress has been made in the use of nanoparticles as an addition to drilling fluids in order to adjust their rheological parameters. Authors [13,14] emphasise in their works that the Power Law model or the Herschel Bulkley model can be used to predict drilling fluids behaviour during flow, whereas the application of the Bingham Plastic model can sometimes only capture the trend. This is a group of new drilling fluids which might require further studies to optimise the best mathematical model. The issue seems to be interesting and worth analysing since these drilling fluids, as indicated in some papers [15,16], describe exponential models well and such rheological models include also the Vom Berg and Hahn-Eyring models.
Energies 2020, 13, x FOR PEER REVIEW 17 of 20 Figure 9. Comparison of the selected rheological models, 3% drilling mud. The tests were successful. In the case of pure slurry, the Ostwald-de Waele model turned out to be the best-fitted model. For slurry with addition of PSP 042 superplasticizer, the Vom Berg model was the best fitted model. Pure bentonite drilling mud was best described by means of the Casson model, and polymer inhibited mud, by means of the Hahn-Eyring model. For drilling muds and cement slurries without additives, differences between the correlation coefficient are not that significant among some models and linear models have a good correlation in these cases.  The tests were successful. In the case of pure slurry, the Ostwald-de Waele model turned out to be the best-fitted model. For slurry with addition of PSP 042 superplasticizer, the Vom Berg model was the best fitted model. Pure bentonite drilling mud was best described by means of the Casson model, and polymer inhibited mud, by means of the Hahn-Eyring model. For drilling muds and cement slurries without additives, differences between the correlation coefficient are not that significant among some models and linear models have a good correlation in these cases.

Conclusions
For many years, different drilling fluids such as drilling muds, drill-in fluids, spacers and washes, cement slurries and fracturing fluids have been applied in the drilling practice. Each kind of drilling fluid should be described with the best fitted rheological model. The accuracy of fitting a rheological model to the properties of actual fluid minimises errors in values being calculated, such as the nature of fluid flow, fluid flow resistances in the circulatory system, diameters of drilling or extending tool nozzles, mechanical and hydraulic parameters of the drilling technology, particle sedimentation and the effectiveness of cuttings removal, injection radius and the technology of its application (stream of flow volume, pressure and time of injection performance), power consumption during mixing, mixing efficiency and issues relating to thermal conductivity during flow and mixing.
The methodology developed and presented in this article enables us to select the optimum rheological model of any drilling fluid. In the process of designating rheological parameters for the Bingham Plastic, Casson, Ostwald de Waele and Newtonian models, it is proposed to apply a linear regression method. In the case of the Herschel-Bulkley, Vom Berg and Hahn-Eyring models, it is suggested to apply a non-linear regression method.
An interesting issue seems to be the use of the Vom Berg and the Hahn-Eyring rheological models to describe the flow of drilling fluids with an addition of nanoparticles [13][14][15][16] and this will be one of the later stages in the work of the authors of this article. We draw such conclusions on the basis of observations that multi-parameter models better describe the flow of liquids modified with chemical additives (superplasticizers, polymers).
The original Rheosolution computer program, developed in the Department of Drilling and Geoengineering, Drilling, Oil and Gas Faculty, at AGH University of Science and Technology, enables automation of the process of designating the optimum drilling fluid rheological model. Owing to the mathematical analysis conducted in this study and numerical calculations, taking into account data from actual measurements of drilling fluid properties, it has been proven that the Vom Berg and Hahn-Eyring rheological models fit best to describe drilling fluid rheological parameters. It is worthwhile to take subsequent steps in order to further test those models in terms of their usefulness in the drilling industry. τ y -yield point; [Pa] τ-shear stress determined from rheological model; [Pa] τ-average value of shear stress; [Pa] w/c-water cement ratio. [-]