1. Introduction
One of the important phases in extracting oil and gas is drilling from the surface down to the reservoir. Due to high temperature and pressure conditions in the bottom-hole, there is a high risk of failure while drilling. Drilling fluid circulation plays a vital role in safe and efficient drilling operations. The drilling fluid can be water-based or oil-based depending on the type of reservoir. While drilling, the drilling fluid is continuously pumped down into the wellbore through the drill pipe. The circulating drilling fluid returns to the surface through the annulus, i.e., the space between the drill pipe and the wellbore. The drilling fluid circulation continues until the desired depth is reached. The primary functions of drilling fluid circulation are stabilizing the wellbore, the cleaning borehole and transporting rock cuttings. These functions are dependent on the properties of drilling fluid, among which density, viscosity and flow rate are the most important ones. The viscosity and other rheological properties of circulating fluid regulate the hole cleaning and transportation of rock cuttings [
1].
In the context of this paper, variations of viscosity are not taken into account. The drilling fluid density is responsible for wellbore stability. For any reservoir, there exists a certain pressure window where the drilling operation can be performed safely. The pressure window extends from formation pressure (
) to formation fracture pressure (
). The wellbore pressure must be maintained within this pressure window (
) for safe drilling. In the case of reservoir failure, two main problems might occur. If the wellbore or bottom-hole pressure (
) is greater than formation pressure (
), the high-pressure drilling fluid displaces the formation fluids and enters into the formation pores, causing a fluid loss. If the drilling fluid pressure is greater than formation fracture pressure (
), it fractures the formation, and the fluid loss further increases, which is a state of lost circulation while drilling. Alternatively, if (
), the high-pressure formation fluids and gasses displace the drilling fluid, which is the state of kick while drilling. The kick should be detected as early as possible, as it can initially lead to wellbore stability problems, and in the extreme case, it might result in the blowout of the whole rig, e.g., the Deepwater Horizon explosion [
2]. The bottom-hole pressure depends on the hydrostatic pressure exerted by the circulating drilling fluid, choke pressure and frictional pressure. The hydrostatic pressure is mainly responsible for bottom-hole pressure, which is dependent on the density of drilling fluid or drilling fluid weight. In this way, by monitoring the density of circulating drilling fluid, the wellbore pressure can be maintained within the acceptable pressure window [
1].
Loss of the drilling fluid, kick, unexpected changes in surge pressure and any uncontrolled high flow rates of drilling fluid should be indicated to the operator (human or autonomous) by a timely and preventive alarm, so that the operator takes the necessary actions to limit material damages and hazards to personnel. The early detection of these problems can lead to less fluid loss, less formation damage, lower drilling costs and, above all, increased safety with minimized maintenance costs. One of the simplest methods for early detection is the so-called delta flow method, which utilize the difference between inflow and outflow measurements in a circulation loop. To implement the delta flow method, two flow measurements for drilling fluid entering the well (inflow) and drilling fluid returning from the well (outflow) are needed. When the inflow exceeds outflow, lost circulation in the loop is a possibility. On the other hand, for inflow less than outflow, the possible occurrence of kick is indicated. Other different methods for kick and lost circulation detection are discussed in [
3,
4,
5,
6].
Therefore, the aim is to accurately determine the delta flow in the circulation loop. There are different types of flow measurement systems for delta flow measurement in the literature [
7,
8,
9,
10,
11]. To point out some of them, the conventional pump strokes counter, rotatory pump speed counter and Coriolis mass flowmeter can be used for inflow measurement and the standard paddle meter, ultrasonic level meter, a prototype rolling float meter and open channel Venturi flow meter can be used for outflow measurements. With some adjustments, the magnetic flow meter and Doppler ultrasonic flow meter can be used for both inflow and outflow measurements, although due to high attenuation of ultrasonic signals in drilling fluids, this might not be a suitable option. The Coriolis mass flowmeter delivers one of the smallest uncertainties in flow metering. It has a very high accuracy with both Newtonian and non-Newtonian fluids. However, bubbles and mechanical vibrations affect the Coriolis measurement [
12]. Therefore, it is not appropriate to use for outflow measurement, where the returning fluid contains rock cuttings, formation gasses and formation liquids. In addition, the Coriolis meter is an expensive option. Different flowmeters based on reliability and accuracy are discussed in [
11]. The analysis concludes that the magnetic flowmeter or Doppler ultrasonic flowmeter can be used for inflow measurement, and prototype rolling float meters can be used for outflow measurement. Speers and Gerhrig [
8] have presented the usage of magnetic flowmeters for delta flow measurement. However, magnetic flowmeters are limited to water-based or conductive drilling fluids. Another problem with magnetic flowmeters is the the requirement of a U-tube designed pipe to ensure a complete filled pipe. With this desgin, there will be a settlement of rock cuttings in the U-tube when the flow velocity is low. In this paper, the usage of an open channel with Venturi constriction is presented where the limitations using the magnetic flowmeter no longer exist [
9,
10].
In an open channel with Venturi constriction, the upstream pressure relative to the level in the control section is used to estimate the flow rate of the fluid [
13]. Fluids flow from the subcritical to supercritical flow condition due to the Venturi effect [
14]. The critical depth is determined within the control section, and the level of the fluid in the upstream is measured. Ultrasonic or radar sensors can be used for level measurement, which can be used to estimate the flow of the fluid through the open channel [
15].
To study the possibility of using Venturi constriction in an open channel for flow measurement, a flow loop is available at University College of Southeast Norway (USN), Campus Kjølnes, Norway. As a part of this study, the Computational Fluid Dynamics (CFD) simulation study is investigated in [
16,
17]. The possibility of using the Saint Venant equation for non-Newtonian fluid through the open channel is presented in [
18]. The usage of the Ensemble Kalman Filter (EnKF) for estimating non-Newtonian fluid flow in an open channel is studied in [
19]. This mathematical approach presented in [
18,
19] is computationally demanding and is only applicable to a slow system with a large sampling time. These considerations indicate that for real-time monitoring and controlling purposes, these approaches are not suitable. In [
20], static Artificial Neural Network (ANN) and Support Vector Regression (SVR) techniques are implemented for flow measurement in an open channel. The simulation-based study shows that both static ANN and SVR models have more than a 100-times faster response time as compared to the mechanistic model presented in [
18,
19]. With an assumption of delta flow measurement as a dynamic problem, dynamic ANN with different learning algorithms is investigated in [
21]. Further, the Bernoulli equation can be implemented for the flow rate estimation. The fundamental Bernoulli equation for the flow of an incompressible fluid in an inclined channel takes the following form:
where
P,
u,
z,
and
g are fluid pressure, fluid velocity, elevation of the channel relative to the datum, fluid density and acceleration due to gravity, respectively, with the subscripts indicating two distinct positions in the inclined channel. The further simplification of Equation (
1) along with continuity equation,
gives Equation (
2),
where
,
,
,
and
are volumetric flow rate, upstream level measurement, level measurement at the throat, area before the constriction and area at the constriction, respectively. The mass flow rate
of the fluid can be calculated as
.
In theory, the simplified equation (Equation (
2)) can be used to estimate the flow rate using a set of spatial samplings of the open surface of the fluid in the Venturi channel, leading to a set of level measurements. However, due to non-ideal conditions (for example: compressible fluid, sediments leading to variations of the cross-sections, fluctuations of the open surface of the non-Newtonian fluid, varying velocity profile in the cross-section of the channel, etc.) and uncertainties in the geometrical parameters (for example: cross-sectional area of the fluid in the channel, channel elevation, etc.), we are resorting to a soft sensor approach using non-invasive measurements in this work. Hence, the present paper focuses on using different empirical methods such as fuzzy logic, ANN and Support Vector Machine (SVM) with both simulation and experimental results.
The system description is presented in
Section 3, and different proposed methods are described in
Section 4. Finally, the results from simulations and experimental studies are presented in
Section 5 and
Section 6, respectively.
3. System Description
Figure 1 shows a flow loop available at USN consisting of a mud tank and a blender for mixing. Different model-drilling fluids are available for testing purposes. The centrifugal pump is used to pump the model-drilling fluid from the mud tank through the pipelines to the open channel with Venturi constriction as shown in
Figure 1b. The pumped fluid flows through the open channel and down to the mud tank forming a complete flow loop. The flow loop includes different types of measurement systems like the pressure transmitter, temperature transmitter, Coriolis mass flowmeters, Gamma sensor dedicated for density measurement, differential pressure sensor, an open channel with Venturi constriction, an inclination sensor and different ultrasonic level sensors.
In this study, an accurate Coriolis mass flowmeter is used as a reference meter for all comparisons of results from empirical models. The open channel has a trapezoidal cross-section with Venturi constriction. The upstream length is long enough to ensure fully developed flow before entering the constriction. Further, the channel can be inclined to the horizontal at different angles to analyze different flow conditions. Three different ultrasonic level sensors are installed over the open channel, giving levels of fluid in the channel, which will be used for flow measurements, as discussed in the following sections.
Figure 2a shows the 3D view of open channel with Venturi constriction and three ultrasonic level sensors. The schematic of the system is given in
Figure 2b.
For the current study, a model-drilling fluid consisting of potassium carbonate (as the densifier) and xanthan gum (as the viscosifier) is used. The fluid is viscoplastic in nature with a density of 1153 kg/m, and its viscosity values are within 23–180 cP for corresponding shear rates within 500–1 s.
This water-based non-Newtonian fluid with the properties given above is used in assessing the performance of a method of estimating its volumetric flow by sampling the levels of the open surface of the fluid flowing in the Venturi channel with an array of non-invasive ultrasonic level sensors. The performance of this soft sensing of the flow rate should satisfy the criteria outlined in
Section 2.
The first step in conceiving of a suitable empirical model is the identification of suitable input feature space for estimating the mass flow rate of a drilling fluid. The Partial Least Square (PLS) method used in steady state conditions from earlier studies [
20] shows that two upstream level measurements, LT-1 and LT-2, and the level measurement at the throat, LT-3, are highly correlated with Coriolis mass flow measurement, as shown in the loading weights plot in
Figure 3. The list of different measurement devices with the respective technical specifications considered for the identification of input and output features for empirical models is presented in
Table 1.
For developing models, about 1800 data samples are used for each of the three input variables (ultrasonic levels) and the single output variable (Coriolis flow rate). The samples are obtained at the data sampling rate of one sample per second using compactDAQ in the LabVIEW environment. The ranges, units and input/output types of each variable considered for modeling are tabulated in
Table 2. The simultaneous inputs and output measurements are shown in
Figure 4. In
Figure 4a, the level measurements LT-1 and LT-2 are measuring almost the same upstream levels. LT-1 measures comparatively lower levels, which is due to the energy losses during the backward flow of the fluid initiated by the hydraulic jump near the constriction. The level measurements are noisy due to the presence of foams in the flowing fluid and due to random uncertainties in ultrasonic measurements. The data samples are normalized in the range of 0–1. From the 1800 normalized data samples,
,
and
of the data are used for training, validation and testing purposes, respectively.
5. Simulation Study
Based on the setup discussed in
Section 3, the results of the simulation study are presented under this section. As discussed in
Section 3, we have measurements from three level measurements from ultrasonic sensors LT-1, LT-2 and LT-3 and the Coriolis mass flowmeter. All the models are evaluated using Mean Absolute Percentage Error (MAPE) and coefficient of determination
. The low value of MAPE represents the better performance of the model, as it gives the error percentage value. On the other hand, the value of
closer to
indicates that the model predictions and target values are highly correlated. The parameter tuning of models is one of the most important steps in empirical modeling. In this paper, the parameters of ANN models are tuned based on the grid search method followed by some adjustment using trial and error. Most of the parameters of the Sugeno-type fuzzy logic model are tuned automatically, and the rest of the parameters are based on trial and error. Optimal selection of SVR model parameters is made using the process described in [
45].
Table 4 shows the optimal parameters used in all the models. All the symbols used in
Table 4 are given in
Appendix A.
Figure 10 shows the flow rate estimations of non-Newtonian fluid using all the proposed empirical models compared to the Coriolis mass flow measurements. From these simulation studies, it can be seen that all the proposed models can track the changes in flow rates with high accuracy and are capable of describing both the steady state and dynamic behaviors of the fluid flow.
Table 5 shows the comparison of the results from different proposed models based on MAPE and
. Based on these performance criteria, feedforward ANN with Bayesian Regularization and Levenberg–Marquardt learning algorithms are the best models to be implemented with the lowest percentage error and highest correlation with target values. However, other proposed models also have very accurate predictions.
For further analysis, four different types of models are selected, one from each method. The cross-validation technique with 10-folds is implemented in each of the selected models.
Table 6 shows the selected models with corresponding cross-validation error. Based on the cross-validation check, the best model for flow rate estimation is feedforward ANN with the Bayesian regularization model, which has the lowest cross-validation error. It is due to the fact that the BR learning algorithm uses regularization for the generalization of a model. The regularization parameter prevents the model from being over-fit by minimizing the connection weights.
6. Experimental Study
Based on the simulation study, four different models, the Sugeno-type fuzzy logic model, feedforward ANN with BR learning model, feedback ANN with RTRL learning and SVR with RBF kernel model, are implemented in the flow loop.
Figure 11 shows the experimental results obtained with non-Newtonian fluid using these models. During the experiments, the set point is randomly varied between 250 and 475 kg/min. In response, all the models can track the varying references with good accuracy.
Table 7 shows the comparison of the experimental performance of different models based on MAPE,
and Root Mean Squared Error (RMSE). From the performance table, it can be seen that the feedforward ANN with BR learning model having the lowest MAPE and RMSE of
and 0.3 L/s respectively, and the highest
of
is the best generalized model for estimating the flow rate of the non-Newtonian fluid. However, all these models give much smaller RMSE with acceptable uncertainties for a flowmeter needed for the current application.
Figure 12 shows box plots for Coriolis flowmeter readings and feedforward ANN estimates at different flow rates. As a reference, a varying setpoint is also included in the plots. In the box plot, a blue box is an Interquartile Range (IQR), and the central red line is a median of measurements/estimates. Two whiskers above and below the box are
from the edge of the box, which corresponds to the 99.3% confidence interval for a normal distribution. Hence, the size of a box represents the spread or variance of measurements/estimates.
Figure 12a shows that the sizes of boxes for Coriolis readings are very small, and the medians are very close to the reference line. This represents the high accuracy of the Coriolis flowmeter; whereas, the size of boxes for the estimates of feedforward ANN are comparatively larger, as shown in
Figure 12b. The sizes of boxes are small at low flow rates and large at high flow rates, representing low and high variances, respectively. In addition, the medians for feedforward ANN are slightly displaced from the reference line showing some limited accuracy in estimations.
Further, feedforward ANN is considered under the repeatability test as shown in
Figure 13. Under similar conditions, three experiments are performed, and the estimates of feedforward ANN are compared. For the comparison, only the steady state measurements are considered.
Table 8 shows the results of the repeatability test. The calculated MAPE and
show that the estimates of feedforward ANN are highly repeatable.
The simulation and experimental study is summarized in
Figure 14.
7. Conclusions
The drilling operation is one of the main phases of extracting oil and gas from the reservoir in oil and gas industries. In the context of geothermal applications, it helps to reach the necessary depth for achieving the high-temperature environment for heat transfer. In the context of oil and gas boring operations, due to extreme conditions in the bottom-hole, there is a high risk of failure while drilling. In unusual cases, there might be two problems while drilling: the influx of formation fluid (i.e., kick) and loss of circulation fluid. One of the best ways to detect these problems is the delta flow method, which utilizes the difference in inflow and outflow measurements of drilling fluid in a flow loop. There are different methods to perform accurate inflow measurements discussed in the literature. However, it is complicated to measure the outflow measurement accurately, particularly so for non-Newtonian fluids. In this paper, we introduce different empirical models and present both simulation and experimental results based on the comparison to readings from the Coriolis mass flowmeter. The starting point for this particular investigation is the set of three ultrasonic height measurements. The question is whether we can estimate the bulk flow velocity based only on these three parameters using non-invasive techniques. This is where soft sensor models come into play. The results from extensive experiments with non-Newtonian model-drilling fluids in the research laboratory of Statoil and in the flow loop at USN are used to develop the soft sensor models presented in this paper.
Different empirical models presented in this work are: the Sugeno-type fuzzy logic model, feedforward ANN models with three learning algorithms (Levenberg–Marquardt learning, Bayesian regularization learning and scaled conjugate gradient learning), feedback ANN models with three learning algorithms (back propagation through time, real-time recurrent learning and extended Kalman filter learning) and support vector regression model with the radial basis function as the kernel function. For these models, the partial least square method is used to identify the inputs and output variables. In the simulation study, feedforward ANN with LM learning and BR learning are found to be the best models based on the MAPE and
. Further, some of the models are considered under the 10-fold cross-validation technique for suitable model selection. In this study, feedforward ANN with BR learning is selected to be the best generalized model with the lowest cross-validation error. Similar to simulation results, the flow rate estimates using feedforward ANN with BR learning are close to the results from the experiments. However, all the presented models are capable of tracking both the static and dynamic behavior of time-varying non-Newtonian fluid flow. The results presented here along with the measurements based on the array of ultrasonic transducers confirm that the flow rate of the drilling fluids could be measured satisfying the requirements specified in [
9].
For future work, the quality and quantity of the training and validating datasets can be improved. As the proposed modeling is mainly dependent on the type of data, we believe that improvement in data measurement and extraction will improve the performance of the models. For this purpose, the first step will be filtering the noise from the data and performing other signal processing techniques to improve the signal information.
The technique presented here paves the way for realizing a simple and effective soft sensing system for monitoring a commonly-occurring module in the fossil fuel and renewable industries, viz. the operational unit for transport, cleaning recovery and mass balance budgeting of a costly and environmentally-hazardous drilling fluid, which is non-Newtonian. The soft sensing of the fluid flow rate using an array of non-intrusive and non-invasive ultrasonic transducers could spare the operators expensive maintenance costs and improve autonomous operation of plants in conventional fossil fuel and emerging renewable energy industries. For interested researchers, the data used in this study are made available in the web portal of this journal.