Model based flow measurement using venturi flumes for return flow during drilling

In an oil well drilling operation, a proper knowledge of the return fluid flowrate is necessary both for the stabilization of the bottom hole pressure of the well and also as a primary indication of a kick or loss. In practice, the drill fluid flowing through the return line is usually measured with Coriolis meters. However this method is both expensive and has some downsides. For instance there is a risk of blockage due to drill cuttings while measuring the discharge. The presence of gas and cuttings in the drilling fluid will also have a negative effect in the measurement i.e. for multi-phase fluid, the readings from Coriolis meters may not be accurate. A cheaper alternative would be to use an open channel for the measurement of the discharge from the return flowline. In this paper, a venturi rig is used as the open channel and modeled by the Saint Venant equations. Experimental verification of the simulation results show a promising behavior of the model based measurement of the return fluid flow.


Introduction
Oil drilling is performed by drilling rigs where a drill bit is attached to a large pipe often called a drill string.During drilling, the drill bit is lowered and rotated using a drive system at the top side to cut or crush rocks, soil etc.A fluid with a desired density and viscosity often called drill mud or just drilling fluid, is pumped through the drill string and into the annulus through a non return valve.The drill mud will then flow upwards through the annulus and through a choke valve to a return line or drain back flowline.In the top side, the mud is filtered and stored in tanks (mud pits) before being pumped into the well again.Figure 1 shows a simplified schematic for such a system.The mud circulation has multiple purposes, the two most important being to retrieve the cuttings from the bottom of the well and to exert hydrostatic pressure against the walls of the well to prevent fluids from flowing into the well (Bourgoyne et al., 1986).
Depending on the bottom hole pressure of the well and the reservoir pore pressure, flows can either enter into the annulus or penetrate the formation which will result in a loss of the circulating drill mud.An unwanted flow of reservoir fluid into the annulus is commonly referred to as a kick.If the occurrence of a kick is not regulated, it can cause a blowout where the fluids from the reservoir rise uncontrolled to the surface (Grace, 1994).
The discharge from the drain back flowline is constantly measured as a primary indicator of kicks and mud losses.If the flow in the drain back flowline is more than what was injected into the well, it indicates a kick and vice versa.In oil industries, the measurement of the flow coming from the choke valve i.e. the drain back flow is measured directly using Coriolis meters.Figure 1 shows one type of installation using a Coriolis meter but there are multiple variants.However, this type of equipment is both expensive and presents many challenges.For instance Coriolis meters do not work well with multi-phase fluids and completely removing all gas bubbles and pockets from drilling fluid can be challenging specially from fluids with high viscosity.The flow measured by the Coriolis meter must also be pipe flow.Since the drill mud flowing from the choke valve will contain drill cuttings, there will be a risk of blockage caused by the accumulation of the cuttings inside the pipes.Methods to avoid this will make the system more complex and will increase the price of installation.These are some of the reasons why there is an interest in the research community for developing cheaper and more efficient methods to replace the Coriolis meter for flow measurement.A possibility is to measure the discharge from the drain back flowline as an open channel flow with the use of a venturi flume instead of using a Coriolis meter.The paper is organized as follows: In Section 2, a general information about venturi channels is presented.A dynamic model of a venturi flume is developed in Section 3 and the numerical solution for the mathematical model is provided in Section 4. In Section 5, the most common method to estimate the discharge through venturi channels using energy balance is presented.Section 6 explains how the level measurements from the ultrasonic sensors can be filtered before using it with the mathematical model.The simulation results, experimental validation and discussion on the obtained results are provided in Section 7. Finally con-

Venturi rig for drain back flow measurement
Venturi flumes are normally used to measure the discharge of open channel flows in the irrigation industry.The proposal in this paper is to install a venturi flume (to replace the Coriolis meter), specifically a trapezoidal flume at the end of the drain back flowline (see Figure 2) as a part of the drilling fluid circulating system for oil well drilling.Trapezoidal flumes are venturi flumes with a trapezoidal cross sectional area.These are normally used to measure flows through channels where the debris load can be expected to be high.The inclination of the side wells of the channel helps to avoid the debris from getting stuck at the converging section of the channel.This installation will be both simpler and cheaper to operate and maintain than using a Coriolis meter for discharge measurement.At the university college of South-East Norway (USN), a venturi rig has been constructed.The rig is a closed loop system consisting of a trapezoidal venturi flume, a Coriolis meter (used as a reference meter for fluid flow), a storage tank (acting as the active mud pit) and a pump as shown in Figure 3.The rig has three ultrasonic sensors installed to measure the level of the fluid flowing through the flume.These sensors can be freely moved and positioned at different sections of the is available to be used for experiments.Figure 4 shows the real picture of the rig at USN.The main idea is to use the fluid level measured by the ultrasonic sensors to indirectly measure the flowrate through the channel.In order to do so, a mathematical model for the flow through the venturi flume is needed.In this paper, two different approaches for modeling flow through venturi channel are used. (1) (2) (3) (4) (5)

Dynamic model of a venturi flume
A dynamic model for the flow through a venturi flume was developed by taking into account the dimensions of the venturi flume at USN.The dimensions of this channel are listed in Table 1.
Figure 5 shows a simple schematic of the top view of the venturi flume.The flume can be divided into five sections (labelled as 1 -5 in Figure 5): (1) The upstream section, (2) converging section, (3) throat, (4) diverging section and (5) the downstream section.There are no fluid losses through the channel so the discharge will be constant at every section of the channel at the steady state.The flow passing through the upstream section before entering the converging section is usually a sub-critical flow.While flowing through the converging section, its velocity will increase which will cause the level of the fluid to decrease.If the level of the fluid at the throat becomes smaller than a critical level, the flow becomes super-critical.The level of the fluid will continue to decrease at the diverging section.Finally in the downstream section, the kinetic energy carried by the higher velocity fluid is converted back to the potential energy resulting in a hydraulic jump.
A common way to represent the dynamics of open channel flows is with the help of the Saint Venant equations.These are a set of partial differential equations derived by the French engineer Adhmar Barr de Saint-Venant in 1871 (Chaudhry, 2008).Consider an incompressible fluid flowing through a trapezoid channel with a cross-sectional area A and a discharge Q as shown in Figure 6.The channel has a length ∆x and an inclination of angle φ between the bottom of the bed and a horizontal line.The volumetric discharge from the channel will change with respect to time and length of  the channel during transients when the boundary conditions are changed.Following the law of conservation of mass, the partial derivative of the discharge with respect to the length of the channel will be equal to the flow going into the channel minus the flow out of the channel.There is also a change in the fluid volume along the channel (i.e. the cross-sectional area of the flow) with respect to time.Both of these terms are of equal magnitude but different sign and combining them thus gives the continuity equation.
For the momentum equation, the forces acting on the fluid are a frictional resistance of the channel acting along the channel, a force due to the change in static pressure acting horizontally and a gravitational force acting downwards.For non-prismatic channels, the hydrostatic pressure will depend both on the changes in the cross-sectional area of the flow and the changes in the width of the channel.Applying the momentum balance, Here, v is the velocity of fluid flowing through the channel, ρ is the density of the fluid, g is the gravitational constant, S f is the friction term and I 1 &I 2 represent the static pressures.
After simplification, the momentum balance of the Saint Venant equation is obtained as, (4) The hydrostatic pressure due to the changes in the cross-sectional area of the flow (I 1 ) can be written as where W represents the base width of the channel and S L is the side slope.I 2 represents the changes in static pressure due to the width variations.For trapezoidal channels, For uniform flow of Newtonian fluids in channels of simple cross section, the friction term S f can be represented by using the Manning's equation.
Here, n is the Manning's roughness coefficient and P w is the wetted perimeter.In the case of trapezoidal channels, the wetted perimeter can be calculated as To calculate the fluid level from the cross-sectional area of the flow, the non-linear equation ( 9) can be used.
A = (S l h + W )h (9) In reality, the drilling fluids are non-Newtonian.However, to simplify the model, the Manning's equation is used for the drilling fluids.The friction can also be estimated by using more complex models such as the Herschel-Bukley model.
In a compact form, equations ( 1) and ( 4) can be written as follows where U vector is the vector of conserved variables F is the vector of fluxes and S is the source term 4 Numerical solution for the venturi flume model The model for the venturi flume is a hyperbolic partial differential equation and is very challenging to solve numerically.To solve the model, the Kurganov-Petrova second order central upwind scheme (KP07 for short) was implemented.For more information about the development of this scheme refer to Kurganov and Petrova (2007) and Sharma (2015).The scheme is based on Finite Volume Method (FVM) where the channel is divided into number of control volumes or cells as shown in Figure 7.The average value of the conserved variables at the center of each cell are calculated by applying the REA algorithm.With j representing the j th control volume, the average of the conserved variables at a time t = t n can be written as The KP07 scheme is a semi-discrete scheme where the partial differential equation (PDE) model of equation (10) is discretized in space into a set of ordinary differential equations (ODEs) of equation ( 15).
S is the average value of the source term of equation ( 13) calculated using the average values of the conserved variables.H j± 1 2 represent the fluxes flowing into the cell (minus sign) and out of the cell (plus sign)respectively.Assuming that there are no changes in the bed slope the fluxes are given by where the local speed of wave propagations a ± j± 1 2 can be calculated as the largest and smallest eigenvalues of the Jacobian of the system.
Here h d is the hydraulic depth and is equal to the cross-sectional area of the flow divided by the length of the flow surface that is exposed to the atmospheric pressure (h d = A/T ).For trapezoidal channels Utilizing this scheme and simulating the model of the flume from the upstream section to the end of the throat, the model is able to converge with the use of only one boundary condition (the cross-sectional area of the flow at the left boundary of the first control cell).For this, it is assumed that the flow will become super-critical at some point while flowing through the converging section and the throat of the channel.Under normal operating conditions and flow rates, this assumption is usually valid.
This dynamic model of the venturi flume can be used to simulate or estimate both the fluid flow rate and the level of the fluid at any point in the channel.The boundary condition can be directly measured using the ultrasonic level sensors.The ultrasonic sensors can be used to measure the level of the fluid at the upstream section and at the throat of the venturi channel and then the Bernoulli's equation can be used to estimate the discharge.The Bernoulli's equation shows the relation between pressure and the potential and kinetic energy of an incompressible fluid where other external forces like frictional forces are neglected.Considering a fluid flowing through a channel, the force applied to the fluid inside the channel will push the fluid to a certain distance from one point to another.For incompressible liquids along the same streamline, the fluid will be displaced by a distance that is dependent on the dimensions of the channel.
Neglecting the friction, the change in the work between the two points will be equal to Here, A represents the cross-sectional area of the flow and P the pressure at each point.Considering the changes in the kinetic and the potential energy and neglecting any other energy changes, Here, h 1 and h 2 are the level of the fluid at given points in the upstream section and the throat of the channel respectively.Similarly, v 1 and v 2 are the velocities of the fluid at these two points, and m is the mass of the fluid.The work-energy theorem states that the work done by all forces acting on a particle equals the change in the particle's kinetic energy.This means that the change in the work is equal to the change in the system energy.Combining and simplifying equations ( 21) and ( 22), one can derive the Bernoulli's equation.
Assuming that the discharge (Q) is constant along the channel and equal to the cross-sectional area times the velocity of the flow, a relation for the discharge through the venturi flume based on the changes in the level of the fluid can be derived.
Although Bernoulli's equation shows a simple relationship between discharge and fluid level, it has the following restrictions: • The flow must be steady • Friction losses are negligible • The two points must be along a single streamline As the drilling mud can have a high viscosity and the flow coming out of the drain back flowline will be carrying drill cuttings, it is possible that the error in the estimation of discharge using the Bernoulli's equation may be very high.

Filtering of measured data
The level measurements taken from the venturi flume at USN are very noisy.Small waves appear as the fluid enters the venturi flume and there may also be small layer of bubbles and foam on the surface of the flowing fluid.These act as disturbances or noises to the level sensors.A moving average filter was used to reduce the effects of noise and the disturbances.The advantage of using this type of filter in such a situation is that the delay caused by the filter is known and can be adjusted by the user.
Various sample sizes for the filter were tested.Figure 8 shows the raw (unfiltered) values and the filtered values when the moving average from 60 measurements were considered.Since the ultrasonic sensors have a sample time of one second, this filter will introduce a delay equal to one minute.Figure 8 shows that the filter will get rid of most of the measurement noises.However, the filtered values are still oscillating and this may be most likely due to the unwanted waves.Assuming that the changes in the level caused by the waves will have a zero mean, a moving average filter with a larger number of samples will be able reduce these disturbances.Figure 9 shows the results of using a moving average filter that takes the averages of 180 measurements (3 minutes).Although this filter will compensate for most of the disturbances, it will introduce a longer delay in the estimation of the flow.Nevertheless, a simple moving average filter was adequate for removing noises and disturbances.

Simulation and experimental results
The level of the fluid were measured by ultrasonic sensors at two different points on the venturi rig at USN.The first level measurement was taken at 235 cm from the start of the channel just before the converging section.The second level measurement was taken at the middle of the throat, 320 cm from the start of the channel.For all the experiments the angle of inclination of the channel bed was set to be constant and equal to 0.1 degrees.Two methods were used to estimate the discharges: • Using relation (24) derived from the Bernoulli's equation and the real measurements from the two level sensors.

Estimated dischages
Coriolis meter Using Bernoulli Model The estimation or calculation of the discharge through the venturi flume using the mean of 16 sets of measurements of around 200 samples each for 8 different discharges (two sets for each) is shown in Figure 10.In addition, the readings from the Coriolis meter is also plotted.It is worth mentioning that the Coriolis meter readings have not been used for the calculation or estimation of the discharge and are simply shown for reference.
Figure 11 shows the estimation of the fluid flow rate through the channel from a single measurement set without any changes in the flow i.e. at the steady state.
Here also the readings from the Coriolis meter is plotted as a reference value.
Figure 12  From all of the above results, it can be without reservation said that the model based estimation or calculation of the discharge through the venturi flume are satisfactory.They show good estimation not only at the steady state but also during the transients.The fluid used in the rig is a non-Newtonian and resembles a real drilling fluid to a large extent.The promising results obtained in this paper open up the possibility of actually implementing the proposed method i.e. use of a venturi flume for the measurement of drain back fluid flow during the drilling of an oil well.The proposed method is both cheaper and simpler to install and maintain.

Conclusion
A venturi flume has a big potential to be implemented as a cheaper alternative to measure the drain back flow to the active mud pit during oil well drilling.Two methods were implemented to measure the discharge of a non-Newtonian fluid through a venturi flume.One method uses a simple static model based on the Bernoulli's equation and the other method uses a more complex dynamic model of a venturi flume.The results from both methods were satisfactory.In addition, the model based on open channel dynamics is described by a set of ODEs after being discretized in space using the KP scheme.This structure of the venturi channel model can be further used for the purpose of designing controllers and for the design of online and adaptive estimators or observers to adapt to unknown parameters like the friction factor, density etc.

Figure 1 :
Figure 1: Drilling fluid circulating system with a Coriolis meter

Figure 2 :
Figure 2: Proposed drilling fluid circulating system with a venturi flume

Figure 3 :
Figure 3: Block diagram of the venturi rig at USN

Figure 5 :
Figure 5: Top view of the venturi flume at USN

Figure 6 :
Figure 6: Side view of a trapezoidal flume

Figure 9 :
Figure 8: Moving average filter with a size of 60 samples Figure 10: Flow estimation for multiple discharges

Figure 11 :
Figure 11: Flow estimation of a single data set

Figure 12 :
Figure 12: Flow estimation after a step change