2023 - Mercante, Netto - Virtual Multiphase Flowmeter Using Deep Convolutional Neural Networks
2023 - Mercante, Netto - Virtual Multiphase Flowmeter Using Deep Convolutional Neural Networks
1
Universidade Federal do Rio de Janeiro
Summary
Petroleum wells produce a combination of oil, gas, and water in what is called a multiphase flow. This mixture is transported through
flowlines to a tank separator that isolates and quantifies the volume of each fluid. However, this mechanical gravity separation process
takes a long time, and the tank is often shared between many other wells in a field, making it difficult to allow an individual online
measurement of the extracted fluids. Without this information, operators cannot effectively control production or estimate each well’s
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
depletion rate, leading to losses or reduced profits. This paper aims to propose a low-cost, instantaneous model to perform this measure
using artificial intelligence, commonly known as a virtual flowmeter (VFM). The idea behind it is to use data from pressure and tem-
perature sensors already available on every well in addition to the state of the opening control valve to train a deep neural network with
a convolutional layer to output each fluid’s volume rate. The proposed method is computationally simpler than recurrent neural networks
and provides similar results. However, it still requires data to train the neural network. Adequate free databases of well production with
telemetry are hard to find, so this paper proposes using the Schlumberger OLGA multiphase flow simulator software to provide the data,
adjusting the simulator with fluid and operational information from actual wells. Tests have shown that the approximation with the pro-
posed methods achieves up to 99.6% accuracy, making it possible to replace an expensive multiphase meter or use it as a redundant digital
sensor for fault alerts of possible inaccurate readings.
Introduction
A production field often comprises several wells with a shared pipeline and processing facility. The operator monitors and controls each
well using a valve known as a choke, and the basic concept is to produce a fixed amount of oil and gas, enough to be transported and
processed. Therefore, the ability to effectively control the volume produced is crucial, both technically and commercially (Bikmukhametov
and Jäschke 2020).
However, directly measuring the produced flow is a challenging task. This is because the fluids extracted from each well are composed
of oil, gas, water, and even other solid hydrocarbons such as paraffin and asphaltites (Falcone et al. 2009; Baek and Yucel Akkutlu 2019).
This heterogeneous, complex combination of fluids and solids generates unpredictable stream patterns, known as multiphase flow
(NFOGM 2005).
Although several simple devices measure flow rates, most can only be used if just one fluid is in the pipeline, a monophasic flow. For
instance, a Pitot tube (Baker 2012) is a classic method for obtaining gas flow rate, and an orifice plate is commonly used for gas and liq-
uids (Miller 2010). There are also positive displacement flowmeters (Wight 2020) that use the movement of internal parts to register the
volumetric rate of a fluid and thermic flowmeters (Lee 2008) that can record the mass flow rate with the temperature gradient caused by
the fluid movement.
However, those methods are based on the characteristics of the fluid they measure, such as density, viscosity, surface tension, and how
the fluid reacts to different pressures and temperatures. If only a known fluid is in the pipeline, it is possible to identify the fluid charac-
teristics and perform the measurement.
If there is more than one fluid inside the pipeline, in other words, a multiphase flow, they will interact with each other, creating a flow
pattern. Fluid characteristics will be different and may change with time, so measuring each phase’s flow rate is impossible with simple
flowmeters in these conditions.
The solution to this problem depends on the complexity of the oil field. It is possible to estimate the flow of all producing wells by
measuring the gas, water, and oil volume with a single-phase flowmeter in the separation tank at the end of the pipeline (Liao et al. 2008).
However, this is not an instantaneous measure, as separating the produced fluids can take time. Furthermore, the measurement is only
valid for the entire producing field because the separation tank is usually shared between other wells.
If the production volume of the well is large and profitable enough, there may be an interest in installing an expensive multiphase
flowmeter (MPFM; Hansen et al. 2019). MPFMs are an alternative to measuring the volumetric flow rate of each phase. It is a piece of
equipment installed on wells that requires more than one single-phase meter technique, usually three in combination, to provide a way to
measure the flow of each phase. This equipment uses a combination of techniques such as ultrasound readings (Huang et al. 2013), gamma
ray interference (Denney 1971), electromagnetic sensors (Masoumeh Zargar et al. 2021), and others to physically measure the instanta-
neous volume of each phase.
Over the last few decades, the industry has found a new alternative solution. Using data from low-cost temperature and pressure sen-
sors, already commonly installed in all wells, it is possible to obtain a reasonable estimate of the flow volume in each phase (Amin 2015).
To achieve this, one can solve complex differential equations representing the flow of fluids or use mathematical regression and super-
vised learning with artificial intelligence to predict volume, pressure, and temperature. This approach is known as a multiphase VFM and
is the purpose of this work.
To develop a VFM using artificial intelligence, it is crucial to have a database of telemetry and production from wells. This is a problem
because those databases are difficult to obtain. Operators rarely provide this data, sometimes only with a nondisclosure agreement, making
Objectives. This paper proposes a multiphase VFM using artificial intelligence and machine learning. It will be shown that it is possible to
use standard pressure and temperature telemetry data and the state of the choke valve to train neural networks to predict the volume flow
of produced oil, gas, and water. This paper suggests a new computationally simpler approach using a deep neural network (Schmidhuber
2015) with a convolutional layer (Indolia et al. 2018) that provides a forecast accuracy of about 99.6%. Olga multiphase simulator will
provide data to train and test the neural networks, creating a method to generate a free database of production and telemetry, which is
difficult to find. The proposed deep neural network can also be considered a computational speedup from the multiphase simulator, as it
can provide a prediction in real time , unlike the simulator, which usually takes a few hours to complete.
Motivation. Equipping each of the wells in a field with an MPFM is not feasible. This type of equipment requires a specific, high-cost
installation in addition to constant maintenance and calibration (Falcimaigne and Decarre 2008). However, the VFM proposed in this
paper does not require any changes or modifications, as pressure and temperature sensors are already available in any well. This low-
cost solution can be used as a standalone meter, replacing an MPFM, acting as a backup in case of failure, or even to alert the need for
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
calibration (Barbariol et al. 2020).
The VFM proposed in this paper would only require data to train the neural network; in this case, temperature and pressure sensors
along the pipeline, the status of the choke valve, and the volume of each produced fluid. This data can be provided by a temporarily
installed MPFM or, in the case of this paper, artificially generated using a multiphase flow simulator software.
The simulator can accurately calculate the flow of each fluid in various temperature and pressure conditions, considering several
parameters (Ogazi et al. 2010). However, it may take hours to obtain a result as the software solves complex differential equations to
calculate the flow. The approach used in this paper takes data from a simulated well and trains a neural network that will reach the same
results much faster with almost the same accuracy.
Methodology. This work will first conduct a literature review of VFM studies to compare the results with other papers that follow similar
approaches. Then, the OLGA multiphase flow simulator software (Schlumberger 2022) will generate 240 days of data from a typical well
that produces oil, gas, and water. This data will be separated into three parts: one to train or adjust the regression method, another to avoid
overfitting (Haykin 2008), and the last part to test and evaluate the performance and prediction error.
This paper will show that a deep neural network with a convolution layer provides the best results, and its performance will be com-
pared with six different regression methods, including simple linear and quadratic regression, support vector machines (SVMs; Alharbi
et al. 2022), regression trees (Loh 2011), Gaussian process (Almasov and Onur 2021), and multilayer perceptrons (MLPs; Haykin 2008).
There are several ways to evaluate the performance of models that predict a time series. One of the most common methods is the root
mean squared error (RMSE). However, the RMSE does not allow for a good perception of forecast performance but instead gives an
average value of the absolute prediction error.
Comparing the RMSE with the mean of the series can be a better way to evaluate the quality of the prediction. An RMSE value of
1,000, for example, in a series with an average value of 10,000, can be considered a low forecasting error, which will not occur if the series
has an average value of 2,000. The ratio between the RMSE and the series mean value is a possible evaluation for the forecast model.
Another method of performance assessment is the coefficient of determination, R2. This calculation shows how the forecast model
represents the original data and how well it explains the variance of the data. R2 values usually fall in the range of 0 to 1 (Draper and Smith
1998), with 1 being the perfect prediction.
This paper will compare regression techniques and identify the best overall method using the coefficient of determination R2, the mean
absolute prediction error (MAPE; De Myttenaere et al. 2016), and the ratio of the RMSE to the series mean value. In addition, a final
histogram of the relative error of the neural network will be provided. The relative error of each measurement is the percentual difference
between the actual value x and the value obtained by the model x0.
Literature Review
There are different types of oil and gas wells, both on land and offshore, with the classic configuration being a vertical hole with a depth
of up to 10 km. The well structure has its sides made of concrete and an opening that reduces in size as it goes deeper until it comes in
contact with the reservoir (Lyons et al. 2016).
Although there are wells with directional drilling, where part of the installation is horizontal (Willoughby 2005), the basic idea remains
the same. The pressure of the reservoir itself can be enough to recover oil and gas, or it may be necessary to install a pump to inject water
to ease transport (Bradley 1987).
Inside the pipeline that descends into the well, sensors monitor the temperature and pressure of the fluids. They are necessary for all
installations as there is an optimal setting to facilitate oil or gas extraction. The lower level of the well, also known as the downhole, and
the highest level, called the wellhead, are standard temperature and pressure sensor positions along the pipelines of all wells (AL-Qutami
et al. 2017), as shown in Fig. 1.
Another standard piece of equipment on every well is the choke valve. It is designed to regulate the volume of oil and gas transported
through the outlet pipeline. Operators control this valve, generally by a remote mechanism, to maintain a constant flow even under vari-
ations in reservoir temperature and pressure (Samie 2016). This is crucial because there is a limit to the amount of oil and gas that can be
refined, and excess production will lead to higher inventory costs and even lower market prices.
However, controlling the choke valve requires measuring the multiphase volume produced by the well, which is not a simple task.
Measurement of the Production Flow. There are several ways to measure the volume produced by a well, and their reliability, cost,
and accuracy must be considered. The following sections describe the most common industry solutions, including the proposed VFM.
Flow Measurement by Well Test. A well test is a method to measure oil, gas, and water production using a separation tank. Once the
fluids have been isolated, it is easier to measure each of their volumes. The problem, however, is that several wells are usually connected
to the same pipeline, and the separation tank output will be for the whole production field, not for an individual well (Ajayi et al. 2012).
A valid option to estimate the flow volume of each well is to shut it down so that the drop in field production can be attributed to that
well. This, of course, involves a significant financial loss.
Stable operating conditions must be achieved to measure flow rates using this method, as production can take several hours to reach
the separator. In addition, closing or diverting flow from one well affects the performance of the others, which can lead to inaccurate
estimates (Thorn et al. 2013).
Although well tests are slow and challenging to perform, they are still a legal requirement in several countries. Results from a well test
can be used to calibrate real or VFMs, so they are still necessary but should be avoided if possible.
Multiphase Flowmeters. An MPFM is a type of equipment specially designed to estimate multiphasic flow with sensors that measure
electrical impedance, pressure, temperature, gamma radiation levels, acoustic ultrasonic attenuation, etc. It does not require a separator or
production interruption (Falcone et al. 2002).
MPFMs can provide real-time flow information, which is very important from an operational point of view. However, MPFMs are
expensive and require complex installations and intervention in the event of a failure, which adds to their high operating cost.
Multiphase VFMs. Well tests and MPFMs are expensive for the operator, and the VFM offers them a low-cost alternative. In this case,
data from the field are gathered and used in a numerical model to estimate flow rates (Rasmussen 2004). The flowline’s standard telemetry
used in a VFM model includes the following:
• Opening percentage of the choke valve
• Wellhead pressure
• Wellhead temperature
• Bottomhole pressure
• Bottomhole temperature
Because VFM systems do not require additional hardware installation, they can dramatically reduce operational costs. If designed
correctly, VFMs can predict flow rates in real time and account for variations in different conditions. VFMs could also be used as a backup
system or in association with MPFMs to enhance flow predictions (Amin 2015).
Based on data modeling, there are two main types of VFMs:
• First-principles VFMs based on physical-mathematical models and flow equations
• Data-driven VFMs based on mathematical regression methods
The mechanical modeling of multiphase flows constitutes the foundation of the first-principles VFM. It may be necessary to create
models for the entire production system, from the reservoir to the processing plant. The idea behind this mechanical, fluid-dynamic
approach is to solve mass, energy, and phase conservation equations using information such as tube geometry, fluid properties, and other
technical details, which demands the selection of an appropriate model and the adjustment of many input parameters based on the physical
structure of the well (Mokhtari and Waltrich 2016). The fact that the parameters have physical meaning and can be determined or mea-
sured is an advantage of this method. However, this is not the main objective of this research.
The second approach, the data-driven VFM, typically uses machine learning and has recently gained popularity. Its development usu-
ally begins by gathering field telemetry and developing a regression model, which generally involves supervised learning (AL-Qutami
et al. 2018). In contrast with the first-principles VFM, data-driven models do not offer an accurate description of physical parameters such
as geometry and fluid physical properties.
The data-driven model can measure flow prediction in real time and achieve high accuracy if adequately trained. In-depth production
engineering knowledge is not as crucial in this technique as in mechanistic models. Without requiring complicated multiphase flow sim-
ulations, this type of VFM can be constructed more quickly and affordably (Bikmukhametov and Jäschke 2020).
Even though simple linear or quadratic regression models have been developed to create VFMs, they typically lack the complexity
needed to make a reasonable prediction due to the significantly nonlinear nature of the multiphase flow (Falcone et al. 2009). As a result,
building VFMs using artificial intelligence models, such as the traditional MLP, has garnered considerable interest since the 1990s. One
of the earliest MLP-based studies in the field demonstrated that it is possible to forecast gas and oil flows using information from a Venturi
Deep Learning CNNs for Regression. Deep learning neural networks have been successfully used in a wide range of areas, such as
video classification, image pattern detection, and many other applications (Wang et al. 2021; Valueva et al. 2020), including time series
regression and prediction (Gryzlov et al. 2022).
The difference between traditional and deep neural networks is the use of multiple layers of signal processing, combining several
structures of filters, convolutions, recurrences, LSTM, and perceptrons in a single learning process.
The deep neural network proposed in this paper combines a convolutional layer and an MLP with a rectifier linear unit (ReLU) as an
activation function. The resulting structure is shown in Fig. 2.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Fig. 2—CNN model for regression.
The input data, X1…X N, are the pressure and temperature information from the well sensors and the state of the choke valve. This
input is first applied to a layer where a 1D convolution is performed (Oppenheim and Schafer 2009). The result is a filtered data set XF1…
XFM, possibly smaller in dimension than the input, that is fed to the MLP. The output Y is the flow of gas, oil, or water.
During the training process, the weights of the neurons in the network and the values used as the convolutional kernel are adjusted to
minimize the flow prediction error. This gives the deep learning network a better ability to map the relationship between inputs and out-
puts, using both the MLP network and an adjustable filter to improve the ability to predict the flow.
Steps to Create a Data-Driven Virtual Flow Model. Obtaining an extensive database relevant to the task is the first and most important
step in developing a data-driven virtual flow model. In this case, if the virtual flow model is tailored to a specific well, the extracted data
must come from that location.
The databases used in the virtual flow model bibliography are from three sources: actual well databases (Mercante and Netto 2022;
Akhiiartdinov et al. 2020; Grimstad et al. 2021), experimental data obtained in laboratory flow loops (Shaban and Tavoularis 2014;
Barbariol et al. 2020), and synthetic data generated by flow simulators and complex physical-mathematical models (Andrianov 2018;
Bikmukhametov and Jäschke 2020; Omrani et al. 2018).
The method proposed in this paper for virtual flow modeling uses data generated by a multiphase flow simulator, as shown in the next
section.
Simulation and Data Generation. The OLGA multiphase flow simulator (Schlumberger 2022) is an oil and gas industry standard for
simulating wells, pipelines, reservoirs, valves, sensors, and other equipment. Based on a set of parameters, it is possible to calculate the
volume of oil, gas, and water produced by a well and the pressure and temperature in the entire transmission line.
OLGA version 2017 has several built-in examples, including a 3000-m gas well case study with a reservoir simulator and a choke
valve. This example was modified to accommodate an oil, gas, and water well by changing the basic fluid properties (Schlumberger 2017).
The structure of this simulation is shown in Fig. 3.
Simulated Well Parameters. The simulated well is illustrated in Fig. 4. This is a 3000-m well with 7 5/8 in. of openhole contact with the
reservoir. The pipeline to the surface, up to the choke, is 7 in., and a supporting concrete structure exists at various levels. The wellhead
size is 20 in., changing to 13 3/8 in. at 1095 m and 7 5/8 in. at 2500 m. At the top, there is a 3.5-in. choke valve to control the flow.
The original simulation is called “gas-well liquid-loading,” which is included in the OLGA sample case manual (Schlumberger 2017).
It is an example of how a gas well reacts to a water injection loading. The basic parameters were modified to make the simulation resemble
an oil, gas, and water well. The fluid was changed to a multiphase composition, and the water injection was excluded.
Two observation levels are set in OLGA—one at the downhole and the other at the wellhead. An observation level is a place in the
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
structure where any physical parameters of the fluids can be monitored at every step of the simulation. In this case, temperature and pres-
sure are logged. Downhole observation is the last section of the last pipe before reservoir contact, and wellhead observation is the first
section of the first pipe before the choke valve. It is common to have pressure and temperature sensors on both the downhole and wellhead
in the real world, so the simulation is realistic.
Data obtained from the simulation, logged every 10 minutes, are shown in Table 1.
Data from the North Sea Transition Authority (NSTA 2022) were used to set the simulation parameters to reasonable values and variation.
This public database provides data from 181 wells from the period 1974 to 2020. Three oil, gas, and water wells with the most significant
amount of data provide statistics to adjust the OLGA simulator model parameters so that it can generate a realistic range of data.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Table 2 shows the expected real-world range of values found in the North Sea Transition Authority. Reservoir temperature and pres-
sure vary across wells, but the expected variation within a year for the same well is small and caused by natural changes. The choke valve
will change because operators constantly adjust it, controlling production or performing tests.
Table 2 also depicts expected changes in the composition of the produced mixture. The gas/oil ratio, the ratio between the volume of gas
and oil produced, changes about 30% over the year for the same well.
The five parameters in Table 2 were set in the simulation to match the expected variation and values from the real-world range. OLGA
will randomly change these parameters every 24 hours.
The choke valve will also randomly change every 24 hours to another setting, from 30% to 100%, affecting flow data. This will mimic
an operator adjusting the flow and provide data so that the artificial intelligence can correlate these changes to the flow.
Reservoir simulation is configured to follow a Forchheimer model (Zeng and Zhao 2006). Several parameters represent sections of the well
with many layers of material, including a steel casing and cement. The multiphase simulator is set to calculate transient dynamics, not only
steady-state flow, so changes in the parameters during the simulation, especially in the choke valve, will generate the variations that also exist
in actual wells. Table 3 shows some of the parameters set in the simulation. It would be impossible to include all the settings here, so the project
and all the necessary files are available for download at a GitHub repository with the scripts to recreate the simulation (Oceanica Repository
2022).
Table 3—Well project main parameters used in OLGA multiphase flow simulator.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Gas/oil Ratio
Gas/liquid Ratio 85.8%
Water cut Average of 0.009 m3/m3
Each neural network will essentially perform a numeric regression to find a way to calculate the volume produced for each phase using
the inputs, without having to solve the high-order complex differential equations performed by OLGA to generate the data. Correctly
trained neural networks will be capable of measuring the volume of oil, gas, and water even when the pressure and temperature conditions
are not the exact values present in the database, providing what is called a generalization (Haykin 2008).
Table 6 shows the mean and standard deviation of the target variables. They will be important in assessing each prediction model’s
absolute error values and how challenging the forecast is.
Table 6—Oil, gas, and water flow volume mean and standard deviation of data.
Methodology of Training and Testing. The same methodology will be used for all models to correctly train or adjust the methods in
this paper and allow a simple performance comparison. The 240 days database generated by OLGA will be divided into training (45%),
validation (5%), and testing (50%). Thus, data from the first 108 days of the series (45%) will be used to train or adjust the models. The
following 12 days (5%) will be utilized to test and avoid overfitting (Goodfellow et al. 2016), and the last 120 (50%) days of data will be
used to test and evaluate the performance.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
will be used, and the subsequent results will be compared with a single hidden layer MLP and a deep learning CNN.
Common Regression Methods. Five common regression methods will be used as a basis for comparison with the proposed neural
network strategy, namely a Gaussian process, a regression tree, an SVM, a simple linear regression, and a quadratic regression.
In the case of regression trees, the number of leaves used will be set from 4 to 36 (Rokach and Maimon 2014). The SVM will be tested
with linear, quadratic, cubic, and Gaussian kernels (Cortes and Vapnik 1995). Simple linear or quadratic regression has no additional
configuration. Gaussian process regression will use an exponential or quadratic kernel (MacKay 2003).
Table 8 shows the results of gas, oil, and water flow volume prediction with the coefficient of determination R2, MAPE, and error
percentages for all five regression methods. Only the best result found among all different configurations are shown.
Linear regression results in high errors of 1.6–3.2% with a similar MAPE. This is expected due to the nonlinear nature of the flow.
Decision trees perform slightly better, but not by much. Quadratic regression gives the best results thus far for predicting oil flow, and
SVMs have the best performance in predicting the volume of gas. Gaussian process produces good overall results for predicting water
flow volume. Table 8 shows in bold face the best regression method results for each target.
MLP Neural Networks Used for Regression. MLP neural networks can be trained to perform regression and predict the volume of gas,
oil, and water. In this paper, the MLPs are configured to have only a single hidden layer from 100 to 150 neurons with ReLU function
activation (Haykin 2008). About eight networks were trained for every different neuron configuration using MATLAB® (Mathworks
2021) deep neural networks toolbox. The training configuration is set to use the Adam algorithm (Kingma and Ba 2014) with a maximum
of 2,000 epochs and a learning rate of 0.005 .
Table 9 presents the results of MLP training for regression with the best and average values for MAPE, R2, and prediction error per-
centage (the ratio of the RMSE and the series mean).
R2 MAPE Error%
Neural Network Target Trained Networks Average Best Average Best Average Best
Gas flow 732 0.9960 0.9972 0,54% 0.49% 0.70% 0.58%
Oil flow 732 0.9985 0.9988 0.65% 0.57% 0.55% 0.47%
Water flow 732 0.9503 0.9512 2.00% 1.96% 2.8% 2.4%
MLP results provided in Table 9 are much better than those of linear regression and decision trees and comparable or slightly better to
SVMs, quadratic regression, and Gaussian process regression. A very high coefficient of determination R2 shows that the model can
Deep Learning CNN. Deep learning CNNs apply a layer of convolution to the input data, providing an active adjustable filter that can
be used to improve results (Valueva et al. 2020). The volume to be predicted is a 1D time series with five inputs (as shown in Table 5),
so the convolution kernel size of the filter can be configured from 1×1 to 1×5. This paper suggests varying the filter size from 1×3 to 1×5,
which yields the best results.
After the convolution, there is an MLP layer with ReLU activation, just as in the MLP experiment, with 100 to 150 neurons. Four
different networks were trained for every different configuration with a total of 732 networks, the same number of MLPs as in Table 9.
Once again, the Adam algorithm was used with a maximum of 2,000 epochs and a learning rate of 0.005. Results are shown in Table 10.
R2 MAPE Error%
Neural Network Target Trained Networks Average Best Average Best Average Best
Gas flow 732 0.9990 0.9991 0.32% 0.30% 0.38% 0.32%
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Oil flow 732 0.9991 0.9994 0.30% 0.27% 0.30% 0.26%
Water flow 732 0.9696 0.9829 1.36% 1.33% 1.94% 1.82%
CNNs provide the best R2, MAPE, and error percentage among all the regression techniques. The average results are almost the same
as the best network, which shows the method’s reliability.
Table 11—Overall comparison of results: best regression method, MLPs, and deep learning CNNs.
Table 10 shows that CNN results are better in all cases compared with MLPs or other regression methods. Although CNNs can take a
slightly longer time to train compared to the MLPs, the simulation of the network (the final use after training) is not computationally
intensive.
A comparison between CNNs and the recursive neural networks LSTM and GRU, also presented in Table 10, shows that the results
are very similar, with a minimal performance gain for LSTM on oil and water flow regression. However, considering that recursive neural
networks require more training time (shown in Table 12) and computational resources, CNN is a better choice, especially because it will
be necessary to retrain the network to perform calibrations, which could be done in simple embedded hardware inside the VFM.
Table 12 presents how long it takes to train the model and use the training network to calculate the regression for all the test data. Time
was measured using an Intel i7 4770K 3.4 GHz CPU on MATLAB (version 2022a).
Using a CNN to predict the flow of the phases could also be considered a computational speedup for the simulator. OLGA takes about
2 hours and 16 minutes (as shown in Table 12) to generate the first 50% of the database, but a CNN can train with that data and predict
the final 50% in less than a minute. Unfortunately, the simulator by itself cannot be used as a VFM, not only because it was not designed
to do that but also because it is simply not fast enough to provide real-time flow measurements.
The computational efficiency and simplicity of the CNN, especially compared to recurrent neural networks, can also be considered an
advantage of the proposed method. Table 12 compares the training and testing times of CNNs with several other methods. Training time
for CNNs is considerably lower than that for LSTM and GRU, mostly because the recurrency makes it difficult to use parallel computing
and they are computationally more complex. Training time is important, because the neural network will have to be calibrated with new
data to compensate for fluid differences along the life of the well.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Table 12—Time to train/adjust each model and to test/use the regression methods.
R2 MAPE Error%
Number of Trained
Well Table Target Test Days Networks Average Best Average Best Average Best
29_02c-14A.xlsx Oil 112 2,184 0.732 0.783 4.4% 4.1% 5.1% 4.7%
29_02c-14A.xlsx Gas 112 2,184 0.371 0.507 6.4% 5.2% 8.4% 6.6%
49_12a-k03.csv Gas 132 2,184 0.319 0.430 10.2% 9.1% 11.4% 10.7%
49_22-06z.csv Gas 132 2,184 0.638 0.723 11.7% 10.4% 11.5% 11.4%
Table 13—Experiments with three real wells from the OGA-UK database using CNN.
Table 14—Experiments with three real wells from the OGA-UK database comparing CNN and other regression methods.
Conclusions
Measuring the flow of oil, gas, and water from a well is crucial for the operator as it allows commercial and technical control of how much
is produced. However, making this measurement in real time is quite complex and may require special installation and expensive multi-
phase meters.
This paper suggests that it is possible to create a low-cost VFM that does not require any modification to the well. It uses sensors that
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
are commonly already present in any installation, such as those that measure temperature, pressure, and the status of the choke control
valve.
To prove this concept, the OLGA multiphase simulator is used to generate 240 days of data from a standard 3000-m gas, oil, and water
well, and the performance of several different regression methods will be evaluated. The task is to predict the last 120 days of the data
using the first half to train and adjust the models.
Table 8 shows the results of the five common regression methods that will be compared with more complex neural networks. Linear
regression and decision trees do not provide good results, but the Gaussian process, quadratic regression, and SVMs provide an error of
about 1% to predict oil and gas flow volume and around 2.4% to predict water.
Simple MLPs with one hidden layer achieve slightly better results than all regression methods, as shown in Table 9, but the CNN
suggested in this paper (Table 10) outperforms MLPs, providing results with about 0.3% error for gas and oil flow and 1.8% error for
water.
What the CNN does is provide a 1D adaptable filter for the input data. This simplifies a common step in all VFM designs, which is to
filter the input data noise generated by temperature and pressure sensors. The convolutional kernel used by the filter is adjusted during
training to provide the best forecast results.
Table 11 presents an overall comparison of regression methods and the CNN. The difference is evident, especially in terms of the
coefficient of determination R2, which is at least an order of magnitude higher than MLP and other methods. The CNN provides a predic-
tion error for gas and oil that is 45% lower than that of MLP. For water flow predictions, the CNN can reduce the error by up to 25%. A
plot of forecast and real values for the time series is depicted in Fig. 5 for gas flow, Fig. 6 for oil flow, and Fig. 7 for water flow.
Water flow prediction is comparatively more difficult for this well as the oil composition has a different proportion of water over time,
which also causes changes in the flow pattern. Table 6 shows that the standard deviation percentage for water flow is significantly higher
than that of gas and oil. Water flow volume prediction is also less important for operators.
A small prediction error obtained in this paper is very important, especially if VFMs are used in a well without any other means to
measure the production other than a separation tank. A prediction with error from 0.2% to 0.3% is comparable to physical meters, and it
is enough to reliably monitor the well, considering the low cost of training a CNN and its built-in filter. To provide a comparison with the
accuracy of real meters, a relative error histogram of the best CNN is presented in Fig. 8, showing that most errors will fall between ±0.5%
for oil and gas and between ±3.0% for water.
Although recurrent neural networks such as LSTM and GRU may provide comparable or better results, CNNs have the advantage of
being very fast to train and use, just as standard MLPs. This is crucial because VFMs will have to be retrained to calibrate for fluid changes
Fig. 5—Gas flow prediction obtained by the CNN with a 0.32% error.
Fig. 6—Oil flow prediction obtained by the CNN with a 0.26% error.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Fig. 8—Histogram of relative prediction error (%) with a normal curve fit.
over the life of the well. This makes it perfect for developing a standalone meter with very low processing power in an embedded system.
It is not difficult to train the network and use it inside these low-power central processing unit-limited devices, making this method an
efficient and simple technique to measure the flow of gas, oil, and water from any producing well.
As future work, this paper suggests testing the viability of combining a recurrent neural network and a convolutional layer, adding
more processing power to the regression method. It will also be interesting to investigate how this VFM implementation reacts to changes
in fluid composition that occur over time, especially considering the possibility of retraining the neural network or using the OLGA sim-
ulator to generate data for instrument calibration. To provide more data for the scientific development of VFM, this work recommends
setting up a laboratory experiment that simulates an oilwell on a small scale sharing the data obtained so that other researchers can develop
and test new VFM approaches.
References
Ajayi, A., Fasasi, T., and Okuns, G. 2012. Real Time Flow Estimation Using Virtual Flow Measurement Techniques: A Field Application in Intelligent Well
Completion. Paper presented at the Nigeria Annual International Conference and Exhibition, Lagos, Nigeria, Africa, 6–8 August. SPE-162948-MS.
https://doi.org/10.2118/162948-MS.
Akhiiartdinov, A., Pereyra, E., and Sarica, C. 2020. Data Analytics Application for Conventional Plunger Lift Modeling and Optimization. Paper presented
at the SPE Artificial Lift Conference and Exhibition - Americas, Virtual, 10–12 November. SPE-201144-MS. https://doi.org/10.2118/201144-MS.
Alharbi, B., Liang, Z., Aljindan, J. M. et al. 2022. Explainable and Interpretable Anomaly Detection Models for Production Data. SPE J. 27 (1): 349–363.
SPE-208586-PA. https://doi.org/10.2118/208586-PA.
Alimonti, C. and Bilardo, U. 2001. Measurement of Three-Phase Flow Rates Using Neural Network Approach APUD (Falconi, et al, 2009). Paper
presented at the 4th International Conference on Multiphase Flow, 27 May–1 June, New Orleans, Louisiana, USA.
Alimonti, C. and Stecco, M. 1998. An Artificial Neural Network for Multiphase Flow Metering APUD (Falcone, et al, 2009). Beijing, China: ISMTMF.
Almasov, A. and Onur, M. 2021. Life-Cycle Optimization of the Carbon Dioxide Huff-n-Puff Process in an Unconventional Oil Reservoir Using Least-
Squares Support Vector and Gaussian Process Regression Proxies. SPE J. 26 (4): 1914–1945. SPE-201721-PA. https://doi.org/10.2118/201721-PA.
AL-Qutami, T. A., Ibrahim, R., Ismail, I. et al. 2017. Development of Soft Sensor to Estimate Multiphase Flow Rates Using Neural Networks and Early
Stopping. Int J Smart Sens Intell Syst 10 (1): 1–24. https://doi.org/10.21307/ijssis-2017-209.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Bradley, H. B. 1987. Petroleum Engineering HandBook, third. Dallas, Texas, USA: Society of Petroleum Engineers.
Cortes, C. and Vapnik, V. 1995. Support-Vector Networks. Mach Learn 20 (3): 273–297. https://doi.org/10.1007/BF00994018.
De MyttenaereA.Golden, B., Le Grand, B. et al. 2016. Mean Absolute Percentage Error for Regression Models. Neurocomputing 192: 38–48. https://doi.
org/10.1016/j.neucom.2015.12.114.
Denney, D. 1971. Multiphase-Flowmeter Experience. J Pet Technol 50 (4): 84–86. SPE-0498-0084-JPT. https://doi.org/10.2118/0498-0084-JPT.
Draper, N. R. and Smith, H. 1998. Applied Regression Analysis, third. New York, USA: Wiley. https://doi.org/10.1002/9781118625590.
Falcimaigne, J. and Decarre, S. 2008. Multiphase Production Pipeline Transport Pumping and Metering. Paris, France: Technip.
Falcone, G., Hewitt, G. F., Alimonti, C. et al. 2002. Multiphase Flow Metering: Current Trends and Future Developments. J Pet Technol 54 (4): 77–84.
SPE-74689-JPT. https://doi.org/10.2118/74689-JPT.
Falcone, G., Hewitt, G. F., and Alimonti, C. 2009. Multiphase Flow - Developments In Petroleum Science, first. Amsterdam, The Netherlands: Elsevier
B.V.
Goldberg, D. E. 1989. Genetic Algorithms in Search, Optimization, and Machine Learning, thirteenth. Boston, Massachusetts, USA: Addison-Wesley
Professional.
Goodfellow, I., Bengio, Y., and Courville, A. 2016. Deep Learning. London, England: The MIT Press.
Grimstad, B., Hotvedt, M., Sandnes, A. T. et al. 2021. Bayesian Neural Networks for Virtual Flow Metering: An Empirical Study. Appl Soft Comput 112:
107776. https://doi.org/10.1016/j.asoc.2021.107776.
Gryzlov, A., Safonov, S., and Arsalan, M. 2022. Intelligent Production Monitoring with Continuous Deep Learning Models. SPE J. 27 (2): 1304–1320.
SPE-206525-PA. https://doi.org/10.2118/206525-PA.
Hansen, L. S., Pedersen, S., and Durdevic, P. 2019. Multi-Phase Flow Metering in Offshore Oil and Gas Transportation Pipelines: Trends and Perspectives.
Basel, Switzerland: MDPI Sensors.
Haykin, S. 2008. Neural Networks and Learning Machines, third edition. MacMaster University Canada: Hamilton, Canada.
Huang, S., C., Xie, C., Lenn, W. Y. et al. 2013. Issues of a Combination of Ultrasonic Doppler Velocity Measurement with a Venturi for Multiphase Flow
Metering. Paper presented at the SPE Middle East Oil and Gas Show and Conference, Manama, Bahrain, 10–13 March. SPE-164442-MS. https://doi.
org/10.2118/164442-MS.
Indolia, S., Goswami, A. K., Mishra, S. P. et al. 2018. Conceptual Understanding of Convolutional Neural Network- A Deep Learning Approach. Procedia
Comput Sci: 679–688.
Kingma, D. P. and Ba, J. 2014. Adam: A Method for Stochastic Optimization. https://doi.org/10.48550/arXiv.1412.6980.
Lee, T.-W. 2008. Thermal and Flow Measurements, first. Boca Raton, Florida, USA: CRC Press. https://doi.org/10.1201/b15094.
Liao, R. F., Chan, C. W., Hromek, J. et al. 2008. Fuzzy Logic Control for a Petroleum Separation Process. Eng Appl Artif Intell 21 (6): 835–845. https://
doi.org/10.1016/j.engappai.2007.09.006.
Loh, W.-Y. 2011. Classification and Regression Trees. WIREs Data Mining Knowl Discov 1 (1): 14–23. https://doi.org/10.1002/widm.8.
Lyons, W. C., Plisga, G. J., and Lorenz, M. D. 2016. Standard Handbook of Petroleum and Natural Gas Engineering, third. Boston, Massachusetts, USA:
Elsevier.
MacKay, D. J. 2003. Information Theory, Inference, and Learning Algorithms, seventh edition. Cambridge, UK: Cambridge University Press.
Masoumeh Zargar, M. L. J., Aljindan, J. M., Noui-Mehidi, M. N. et al. 2021. Nuclear Magnetic Resonance Multiphase Flowmeters: Current Status and
Future Prospects. SPE Prod & Oper 36: 423–436. SPE-205351-PA. https://doi.org/10.2118/205351-PA.
Mathworks. 2021. Online. Matlab Statistics and Machine Learning Toolbox. www.mathworks.com/help/stats/naive-bayes-classification.html.
Mercante, R. and Netto, T. A. 2022. Virtual Flow Predictor Using Deep Neural Networks. J Pet Sci Eng 213. https://doi.org/10.1016/j.petrol.2022.110338.
Miller, R. W. 2010. Flow Measurement Engineering Handbook, third edition. New York, USA: McGraw-Hill Companies.
Mokhtari, K. and Waltrich, P. J. 2016. Performance Evaluation of Multiphase Flow Models Applied to Virtual Flow Metering. Paper presented at the 11th
Conference on International Advances in Fluid Mechanics, Virtual, 6–8 July.
NFOGM. 2005. Handbook of Multiphase Flow Metering, 2. Norway: The Norwegian Society for Oil and Gas Measurement.
NSTA. 2022. Online. UK Oil and Gas Authority. www.gov.uk/government/organisations/oil-and-gas-authority.
Oceanica Repository. 2022. Online. Oceanica OLGA GitHub Repository. https://github.com/oceanica1/olga.
Ogazi, A. I. . I., Cao, Y., Yeung, H. et al. 2010. Slug Control With Large Valve Openings To Maximize Oil Production. SPE J. 15 (3): 812–821. SPE-
124883-PA. https://doi.org/10.2118/124883-PA.
Omrani, P. Set al. 2018. Improving the Accuracy of Virtual Flow Metering and Back-Allocation Through Machine Learning. Paper presented at the EAbu
Dhabi International Petroleum Exhibition & Conference, Abu Dhabi, UA, 12–15 November. SPE-192819-MS. https://doi.org/10.2118/192819-MS.
Oppenheim, A. and Schafer, R. 2009. Discrete-Time Signal Processing, third edition. Hoboken, New Jersey, USA: Prentice-Hall.
Rasmussen, Å. 2004. Field Applications of Model-Based Multiphase Flow Computing. Paper presented at the North Sea Flow Measurement Workshop,
London, UK, 18–21 October.
Rokach, L. and Maimon, O. 2014. Data Mining with Decision Trees: Theory and Applications, second edition. Singapore: World Scientific.
Samie, N. N. 2016. Systems and Equipment for Offshore Platform Design. In Practical Engineering Management of Offshore Oil and Gas Platforms,
213–346. Amsterdam, The Netherlands: Elsevier.
Schlumberger. 2017. OLGA Multiphase Flow Simulator User Manual, second edition. Houston, Texas, USA: Schlumberger.
Downloaded from http://onepetro.org/SJ/article-pdf/doi/10.2118/214681-PA/3095351/spe-214681-pa.pdf/1 by Maria Rosa Rocha Tenorio Goes on 28 April 2023
Measurement. IEEE Sensors J 21 (3): 3713–3721. https://doi.org/10.1109/JSEN.2020.3024294.
Xu, L., Zhou, W., Li, X. et al. 2011. Wet Gas Metering Using a Revised Venturi Meter and Soft-Computing Approximation Techniques. IEEE Trans
Instrum Meas 60 (3): 947–956. https://doi.org/10.1109/TIM.2010.2045934.
Zeng, F. and Zhao, G. 2006. Semianalytical Model for Reservoirs With Forchheimer’s Non-Darcy Flow. Paper presented at the SPE Gas Technology
Symposium, Calgary, Alberta, Canada, 15–17 May. SPE-100540-MS. https://doi.org/10.2118/100540-MS.