Physics-Guided
Machine Learning:
Putting AI to work in industry

Physics-Guided
Machine Learning:
Putting AI to work in industry

Table of contents
Summary............................................................................................................................................ pg. 3
Introduction....................................................................................................................................... pg. 4
What is physics-guided machine learning?.................................................................................... pg. 5
Constructing physics-guided machine learning..................................................................... pg. 5
Mathematical modeling vs machine learning.......................................................................... pg. 6
Adding physics to machine learning models: a deep dive...................................................... pg. 6
Feature engineering................................................................................................................... pg. 8
Proxy models............................................................................................................................... pg. 9
Customizing the loss function using physics knowledge...................................................... pg. 9
Physics-guided machine learning solutions................................................................................... pg. 11
Oil-water separation................................................................................................................... pg. 11
Virtual flow meters..................................................................................................................... pg. 14
Conclusion......................................................................................................................................... pg. 17

About Cognite©COGNITE 2023 — COGNITE.COM

2

Cognite is a global industrial SaaS company that
supports the full-scale digital transformation ofasset-heavy industries around the world. Our core
Industrial DataOps platform, Cognite Data Fusion®,enables data and domain users to collaborate toquickly and safely develop, operationalize, andscale industrial AI solutions and applications.
Cognite Data Fusion® codifies industrial domain
knowledge into software that fits into your existing
ecosystem and enables scale from proofs ofconcepts to truly data-driven operations to deliver
both profitability and sustainability.
WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →CONTACT SALES →Summary
Hydrocarbon production systems generate hugedata sets, often with time series stretching backdecades. However, much of the data may be obsolete due to changing reservoir conditions and modifications to assets, and there may be scant dataclose to optimal operating conditions due to theinadequacy of existing optimization tools.
Data science, artificial intelligence (AI), andmachine learning can contribute significantly tothe optimization of production operations, andthere is a trend toward hybrid AI, which combines
data science with traditional physics-based simulators to deliver added value.

This paper explains how to use physical principles
in feature engineering to improve machine learning outcomes. Equipped with energy, mass, andforce balances; pressure, volume, and temperature (PVT) data for production fluids; and dimensional and order-of-magnitude analyses, oil andgas companies can squeeze additional value froma pure data-based approach while avoiding expensive, time-consuming, and often inaccurate simulations.

©COGNITE 2023 — COGNITE.COM

3

Physics-guided machine learning can add tremendous value to digitalization initiatives across a wide
range of production optimization use cases andspeed up decision processes that mitigate production losses in complex industrial phenomena.

WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →CONTACT SALES →Introduction⇢ One: For many of the classic applications of AI
there are few or zero competing methods. One
example: There are few mathematical models
describing consumer behavior. In the oil and gas
industry, in comparison, the majority of the problems are governed by the laws of physics and canbe described using mathematical and phenomenological models that form the basis of advanced
simulators. The industry has been using thesesimulators for decades to support critical decisions,and while the simulators have varying degrees ofaccuracy and uncertainty, users have an understanding of them and take uncertainty into accountwhen making decisions based on their results.
⇢ Two: For many of the classic applications of AI
the consequence of an erroneous prediction is notsevere, and the size of the error is often not importWHY COGNITE DATA FUSION® →Machine learning has a clear value potential in
the oil and gas industry, but it must go hand-inhand with physics.

⇢ Three: For classic applications of AI the amountof training data may be enormous. For example, theImageNet data set contains more than 14 million
pictures. The amount of text available for natural
language processing is almost unfathomable. For
some applications it is even possible to automatically generate training data. It is a common misconception that the oil and gas industry has large
amounts of data. Although a typical installation
will be instrumented with thousands of sensors
that may have been collecting data for decades,
the actual amount of relevant data is small.
⇢ Four: Finally, an important difference between
some of the industries where AI has been successful and the oil and gas industry is the quality of thedata. A typical data set used by classic applicationsof AI will have no or negligible noise levels. Muchof the data used in oil and gas engineering comesfrom physical sensors located in harsh environments, which means they are subject to varying
degrees of noise and bias and different raw datacompression levels.

BENEFITS FOR YOUR TEAMS →CONTACT SALES →4

There are four main reasons why:

ant. As an example, if an irrelevant advertisement
is displayed on a website, it’s not the end of theworld. Either it results in a click or it doesn’t. For theoil and gas industry, the size of the error is usually
critical. A small error in the predicted surge volume
is usually not a problem, but a large error could leadto a trip or, worse, a flooding incident.

©COGNITE 2023 — COGNITE.COM

Artificial intelligence (AI) has been immensely
successful in areas such as image recognition,
natural language processing, advertising, andgames — let’s call them classic applications of AI.
However, for industries such as oil and gas andmanufacturing, the success stories are fewer,
despite the high value potential. This is because of
the fundamental differences between the classic
applications of AI and those used for industrial
problems.

What is physics-guided machine learning?

Assume we want to predict a set of parameters
Y from a set of observed variables X. Typically X
represents our sensor data. We denote this relationship as
Y=f(X),
where f is our predictive model. One example ofan application is where Y is a property that is notcontinuously measured, such as the quality of a
product. Instead of only relying on infrequent spot
samples, it is possible to create a model f thatapproximates the product quality Y based on thestate X of the system. This is often called a virtualor soft sensor, and it is particularly useful when
the results of spot samples are not available in time
WHY COGNITE DATA FUSION® →There are several ways to create the model f. Historically this was done using physics insight and mathematical modeling. There are various techniques
for deriving such models, where the most rigorous
approach is based on first principles like conservation and balance principles. Relevant examples
are conservation of mass, momentum, volume, andenergy, which are the foundation for many of thesuccessful physics simulators used in the oil andgas industry.
Not all problems are easily described using firstprinciples, or the resulting mathematical model
may be too complex to be solved within a reasonable time frame. An effective approach is to average effects in time or time and space, reducing thecomplexity of the phenomena that are modeled
and sometimes also the number of spatial dimensions. Turbulence modeling is an example of averaging small-scale effects while hydraulic modelingis an example of averaging effects in entire spatial
dimensions.
On the other side of the spectrum we find empirical or phenomenological modeling, where only
measurements are used to derive the model. Puremachine learning belongs to this category. In
between, there is a continuous range from rigor-

BENEFITS FOR YOUR TEAMS →CONTACT SALES →ous first-principle modeling to pure empiricalmodeling, and this is the area we want to explore tounderstand how we can construct physics-guided
machine learning.

5

Constructing physics-guided machinelearning

to carry out mitigating actions if the quality is notsatisfactory.

©COGNITE 2023 — COGNITE.COM

Early in the Fourth Industrial Revolution it was
widely believed that through digitalization all problems would be solved using AI, and that machinelearning would replace mathematical models. That
understanding is changing. AI and machine learning are increasingly seen as complementary tools
to be used with existing industry-specific tools (forexample physics simulators). One example of thisis the use of mathematical modeling and featureengineering to reinforce a machine learning model.

Simulators and machine learning models clearlycomplement each other. Combining the two
methods keeps the strengths and reduces the
weaknesses.

Adding physics to machine learningmodels: a deep dive
One of the most fundamental problems in the oiland gas industry is pressure drop in a pipeline. This
determines the maximum throughput for a given
pipe length and diameter; alternatively, it shows
the need for a pressure boost to meet a required
flow rate.
For the purposes of this section, we will consider
single-phase pressure drop measurements fromtwo different laboratories¹ for six different fluids (He,O₂, N₂, Air, CO₂, and SF₆), two different pipes (bothdiameter D and roughness ϵ), different temperatures T, different pressures P, and different velocities U, giving us six different input variables, where
one is a categorical variable. Assuming we need 10
data points per continuous variable to resolve thebehavior, we need 105 experiments in total per fluid.
In addition, reservoir fluids consist of thousands of
WHY COGNITE DATA FUSION® →¹ Swanson, C. J., Julian, B., Ihas, G. G., and Donnelly,
R. J. 2002. Pipe flow measurements over a wide
range of Reynolds numbers using liquid heliumand various gases. J. Fluid Mech. 461, 51–60.
Zagarola, M. V., and Smits, A. J. 1998. Mean-flow
scaling of turbulent pipe flow. J. Fluid Mech., vol.
373, pp. 33–79.

Physics simulators

Machine learning

Can predict without access to historical data (fromfirst oil)

Requires a large set of training data for relevant
conditions

Tested, tried, and proven across industries, evenfor critical applications

Unproven; considered hard to interpret (“blackbox”)

Require a mathematical model derived from physics principles (not always possible)

Possible to set up without any knowledge of theunderlying physics

Require a complete set of data such as boundary
conditions, geometry, and fluid and material properties

Can work even on a small set of sensors (but may
not be very accurate)

Can predict outside the range of data used tocreate and validate the model (with varying uncertainty)

High uncertainty outside the range of the trainingdata

Can predict future events; transient models

Fewer success stories for predicting time-dependent problems

Provide all values from the equations at all positions in the numerical grid

Provides only the output variables it was trained on

BENEFITS FOR YOUR TEAMS →CONTACT SALES →6

Let’s compare the strengths and weaknesses ofthe more rigorous physics simulators and machinelearning methods: ►different components, leading to a literally infinite
number of possible compositions. This exponentially increasing data requirement as a function of
the number of input parameters is known as thecurse of dimensionality.

©COGNITE 2023 — COGNITE.COM

Mathematical modelingvs machine learning

Obviously it is not realistic to generate such a vast
amount of data, so the goal in this example is totransform the input parameters into new features,
which simplifies the problem the machine learningmodel needs to approximate. From fluid mechanics we know that the pressure gradient depends
on the pipe diameter D and the wall shear stressτ. The wall shear stress is not a measured quantity,
but we know that the wall shear stress depends
on the fluid density ρ and the velocity U. The fluid
density is a property of the chosen fluid and can becomputed using the laws of thermodynamics andthe pressure and temperature for the individual
experiments. The pressure gradient is expressedby a force balance (momentum conservation)

There are three important observations:

There is a remaining unknown in the equation,
namely λ, which is known as the friction factor. An
important step in any data science work is to investigate the data by visualization. We will plot the friction factor instead of the pressure gradient, but westill have the challenge of selecting the parametersthat the friction factors should be plotted against.
Again, from fluid mechanics we know the importance of the Reynolds number Re, and we selectthat as our x-value. Applying this transformationon all the experiments results in Figure 1 ►. Notethat we also did a log transformation of both axes.

Figure 2 ► shows the result of a linear regression
for Re<2300 and a Gaussian Process regression for
Re>4000.

WHY COGNITE DATA FUSION® →1. The transformation collapses all the input
features into one (Reynolds number). Hence, ourmodel Y=f(X) will be λ=f(Re)
2. There seems to be a change in the trend of thefriction factor around Reynolds number 2300.
This is well-known from fluid mechanics and is
the transition from laminar to turbulent flow.

Fig. 1: Single-phase pipe flow experiments from
Oregon (blue) and Princeton (green).

The log transformation from a strongly nonlinear
behavior to a more linear behavior reduced theneed for data. In addition, it also makes it easier to

BENEFITS FOR YOUR TEAMS →CONTACT SALES →7

The transformation reduced our five-parameter input space to one parameter (the Reynolds
number), greatly reducing the data needed. It alsotransformed the problem into a mostly smoothproblem with a linear part and a slowly decaying
part. Importantly, it also allowed us to isolate andmodel the discontinuous behavior around Re=2300.

Fig. 2: Linear regression model for Re<2300 and
Gaussian process regression for Re>4000.

©COGNITE 2023 — COGNITE.COM

3. By using the log transformation, the friction
factor looks very close to linear for Reynolds
numbers less than 2300 and something similar
to a slowly exponentially decaying function for
Reynolds numbers larger than 4000. It seems likea good idea to change our model to (λ) =f((Re)).

One final but very important lesson from this example: We know from fluid mechanics that there exist
well-established models for the friction factor, likethe Colebrook model. From this we know that thefriction factor is also a function of the relative piperoughnesssomething that is supported by other experiments.
The pipes from the Oregon and Princeton experiments have different relative pipe roughnesses;
however, the Oregon data does not contain data
for Reynolds numbers in the region where thewall roughness becomes important (the hydraulic rough region). If we had a more extensive dataset, our model should have been (λ) =f((Re) , ϵrel ).
This is a reminder that for nonlinear problems theimportance of a feature may be strongly dependent on the operational conditions, and it may not
be revealed by the available data.

WHY COGNITE DATA FUSION® →The single-phase pipe flow example above shows
the power of feature engineering, and it illustrates
two important techniques.
The first is transformation of features using dimensional analysis. A commonly used starting point
for dimensional analysis is Buckingham’s Pi theorem, which states that the number of dimensionless parameters is equal to the number of relevant
variables minus the number of independent dimensions. Imagine an example with five variables (U, ρ,
μ, D, ϵ) and three independent dimensions (time,
length, and mass). According to Buckingham’s Pi
theorem, that gives us 5-3=2 dimensionless parameters, which is the same as the number of input
parameters to the Colebrook friction factor model.
A challenge is that there are endless possibilities
for creating dimensionless parameters. It takes
experience and sometimes a lot of trial and error
to find the best set of dimensionless parameters.
A very attractive method in machine learning istransfer learning, where knowledge from solving one problem can be transferred to a different but related problem. One example is to train
a facial recognition model by training on images
from ImageNet to learn how to recognize a face
and then train on a specific person to be able torecognize that individual. This is highly attractive
for problems with scarce data but numerous similar
problems. An example would be to train a model ondata from a set of wells instead of each well individ-

BENEFITS FOR YOUR TEAMS →CONTACT SALES →ually. For this to be possible a given combination of
input features from two different wells has to havethe same output value. For the single-phase pressure drop example, the data from the two different
labs was comparable when looking at the Reynolds
number and the friction factor instead of the pressure gradient and the original input variables.
The second technique that was applied in theexample in the previous section was the inclusion of physics models. In the experiments thefluid composition was known and the pressure
and temperature were measured; however, themodel needed the fluid properties density andviscosity. In some situations the fluid properties
can be measured separately, but they can also becomputed using equations of state, the composition of the fluid, and the pressure and temperature. By converting the fluid composition, thepressure, and the temperature to fluid properties,
we relieved the machine learning method of theburden of learning this complex behavior from ascarce data set. Another way of interpreting thisis that we used our physics knowledge and some
sensor values to create virtual sensors of the fluid
properties that are used as input features insteadof the originally measured pressure and temperature.
Most sensors are already feature-engineered. A
temperature sensor can be of the thermocouple
type, where the electrical voltage between two
dissimilar metals is measured. The temperature
is calculated based on the voltage measurement

8

Note that it is possible to fit a model to the entire setof data. As an example, a three-layer feedforward
neural network gave good predictions. However,
the extrapolation property for lower Reynolds
numbers was poor. The linear model has excellent extrapolation properties, since it captures thecorrect physics in the transformed space.

Feature engineering©COGNITE 2023 — COGNITE.COM

impose regularization in the model, making it lesssensitive to noise in the data.

WHY COGNITE DATA FUSION® →When optimizing a process we do not only need toknow the current state but also how changes inoperational conditions will influence the outcome
we are trying to optimize. This usually requires
numerous calls to our model f. If f is a computationally expensive model, for example a physics simulator, it may be impossible to compute the optimal
operational conditions fast enough for the operator to act on the advice. An added challenge isthat a simulator may produce no results for certain
input conditions (crash), or it may have a nonsmooth behavior as a function of some of the control
parameters. This creates additional challenges forthe optimizer.
A well-known technique from optimization is theuse of proxy models. Instead of optimizing on thefull model f, we optimize on an approximation modelf. One technique is to create f by fitting a machinelearning method to presimulated results froma physics simulator. For a sufficiently large data
set the proxy model will inherit the accuracy andpredictive capabilities of the simulator while having
the evaluation speed and robustness of a machinelearning model, provided the model is not usedoutside the range of the training data. A remedy
for evaluations outside the available data set of f is
to automatically run the simulator for those evaluations, extending the training set and retraining
the machine learning model f.

BENEFITS FOR YOUR TEAMS →CONTACT SALES →Customizing the loss function using
physics knowledge
Most out-of-the-box machine learning models use
unweighted least squares as the default loss function. However, in reality, the consequence of errors
is dependent on the operational conditions. When
predicting surge volumes arriving at the receiving
facility, large relative errors for small surges havelittle or no consequence, but medium errors forlarger surges may lead to trips, emergency flaring,or in the worst case accidents. This is particularly
important if the data set is biased to the less problematic area, which is very common due to operational practicalities; most historical operations
have occurred safely, so there is little if any data for
irregular conditions.
There are numerous ways to include this knowledge into the loss function, and it is an important
technique to ensure that during training we prioritize the accuracy of the model in the region whereaccuracy is important. A simple approach is toincrease the weight in the loss function for datain the region where errors are critical.
This needs to be combined with rebalancing thedata set. For a classification problem the groups
are explicitly given, making it easy to detect imbalance. For our regression problem the groups are
not explicitly given, but our understanding of physics will help us determine how to classify the data
into groups so that we can evaluate if we have an
unbalanced data set and hence compensate for it.

9

Feature-engineered variables do not have tobe perfect in order to be useful. They only needto capture the main features of the behavior. The discrepancy will be compensated for by
the machine learning model. Most mathematicalmodeling techniques have less flexibility in thissense. When a functional form is chosen, theunknowns in the model are determined by matching data. If the functional form is correct, it results
in a robust model that can extrapolate with low
uncertainty. However, if the functional form does
not capture the true physics, it has no way ofcompensating for it. A simple example would be
to fit a linear model to a quadratic function. The
mathematical model will never be correct, while amachine learning model that takes the linear model
as an input feature will be able to correct for the
missing physics, at least in the range of the data.

Proxy models©COGNITE 2023 — COGNITE.COM

and knowledge of the proportionality constant.
Another slightly more sophisticated example is a
Venturi single-phase flow meter, which measures
the pressure drop across a throat and computes
the volumetric flow rate based on Bernoulli’s equation, the continuity equation, and the fluid properties. The fluid properties can be computed basedon the fluid composition, the measured pressure,and the temperature. Consequently, the majority
of sensors already incorporate important physics
knowledge. Feature engineering is just a continuation of this approach.

The same weighted loss function technique canbe used for weighting data based on other importance factors such as the age of the data, assuming that the field is changing and older data is lessrelevant than newer.

©COGNITE 2023 — COGNITE.COM

10

It is equally important to report the error from thetest data not only as a single number but as a function of the parameters that characterize the criticality of an error. This information is crucial to beable to understand the uncertainty and correctly
determine safety margins for the model.

WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →CONTACT SALES →Physics-guided machine learning solutions

Physics-driven modelingand virtual simulations

Hybrid AI

Significant production losses are associated withsituations with high oil-in-water levels, because
safely discharging water to the sea requires slowing down production while troubleshooting for
worst actors on the facility.

Data-driven
machine learning

Oil-water separation
Solution: A smart monitoring system that visualizes all data relevant for troubleshooting watercontamination and a recommender system withan underlying machine learning model to identify
worst actors related to high oil-in-water concentrations.
Impact: In one example, the solution saved an oil
and gas operator an estimated $6 million a year.
READ MORE→
WHY COGNITE DATA FUSION® →Produced water disposal is one of many challenges at oil and gas facilities with high watercut wells. Keeping the oil contamination level inthe produced water below environmental limits
requires an efficient separation process. Obtaining
produced water that meets environmental regulations requires an efficient separation process,which is governed by a series of complex physicalinteractions.

To identify what could be causing high oil-in-water
concentration, operators often take spot sample
measurements at different parts of the production facility and then perform mitigating actions
once the bad actor is located. Operators rarely
have much information to determine where to start
the search, however, which can make finding thebad actor a time-consuming process. Each spot
sampling campaign can take up to two hours andoccur multiple times a week.
Separation of oil-water dispersions is a complex,
multistage process that involves gravity settling

BENEFITS FOR YOUR TEAMS →CONTACT SALES →(separators), centrifuging (hydrocyclones), floatation (degasser), and the use of chemicals. In
situations where the disposed water is highly
contaminated, it is extremely difficult to determine
which part of the plant is responsible for the problem. Possible causes range from excessive emulsification due to wellhead choke setting to inefficient
floatation in the degasser due to unfavorable pressure.
To make matters even more complicated, oil and gas
plants undergo continuous adjustments imposedby control room engineers in order to maximize
production and minimize the risk of hazards.
Furthermore, occasional modifications to the plantcomposition, such as the startup of a new well or
replacing equipment or injection chemicals, may
have a significant impact on the produced water
treatment.
It is practically impossible to accurately modeloil-in-water concentrations based on live operational conditions with a traditional (deterministic)
approach. Even the most sophisticated processsimulators would require tremendous computational resources and skilled engineers and still yieldundeterminable accuracy.
The only realistic approach to modeling oil in water
is by means of regression, using computing power
to find hidden patterns and relationships between

11

Cognite differentiates from pure AI companies
with a hybrid data science model unique to industrial reality.

Cognite’s approach©COGNITE 2023 — COGNITE.COM

Cognite takes a hybrid approach to artificial intelligence, combining the best of data-driven machinelearning and physics-based modeling.

Addressing obstructive events in historical data,
for example the replacement of equipment or achemical compound, requires a dynamic machinelearning approach. One such approach is to automatically retrain and reconfigure models until validation criteria are met.
The output from machine learning models needs
to undergo comprehensive processing in order torender it interpretable. Machine learning interpretability libraries such as SHAP and LIME let users
extract local importance of features with respect
to any given target prediction. This is an essential
aspect of the process, as the importance measure
will in turn be associated with a potential root causeof local oil-in-water observation.

WHY COGNITE DATA FUSION® →The choke dispersion model considers an energybalance between hydrodynamic kinetic (Eh) energy
and potential surface energy (ES ). The former isa function of the pressure-drop ΔPchoke, which inturn depends on the flow rate Qm across the choke,
the kinematic mixture viscosity vm, and k-factor.
Whereas the latter depends on the droplet diameter ddrop and surface tension σ, where the droplet diameter is modeled using Hinze’s model andthe surface tension is interpolated from a lookup
table generated using offline thermodynamics
simulations. The ratio Eh / ES provides an indication of the dispersion level that arises from shear
forces induced by the choke settings. The ratio isexpressed as

BENEFITS FOR YOUR TEAMS →CONTACT SALES →where dpipe is the pipe’s inner diameter.
The ratio also enables us to compress the input
variable space significantly and reduce the numberof dependent features to train on. Although theabsolute value of the dispersion levels can beinaccurate as a result of the leading order approximation and lack of tuning, when used as an input
parameter to machine learning, it showed significant improvement of the model predictions as wellas the importance allocation.
The separator efficiency model was formulated bymeans of a time-scale balance approach. Here thebuoyancy time scale that arises from the Stokes
drag and buoyancy force is compared to the separator residence time scale of the water body. Thismodel results in a dimensionless parameter thatcomprises multiple independent variables, including flow rates, temperature, separator geometry,water level, and fluid properties. Instead of introducing each parameter as an input to the machinelearning model, this single nondimensional parameter represents the entire separator. When importance is allocated to this parameter, the user of thetool will understand that this particular equipment
is behaving abnormally.

12

The technical toolkit required to solve this sortof problem exists within the machine learning
domain. It includes ensemble algorithms suchas gradient boosted trees (GBT) and recurrent
neural networks (RNN). One important difference
between these algorithms is the way temporal
coherency is embedded in their respective architectures. GBTs consider each row of the data set asa system snapshot, while RNNs take into accountthe sequential nature of time series data.

Physics and domain knowledge are included in themodel through an extensive data engineering pipeline. First-principle physics modeling of key physicalprocesses, such as choke dispersion and separator
efficiency, provides a way to compress the variable
space and reduce the number of dependent variables in the data set. Multiphase flow and processsimulators Digital Oil Field and Unisim, respectively,
enrich the data set with key data such as fluid properties and well-specific flow rates. The flow rates
can be used to calculate the time delay between
wellhead and point of discharge. This time shift must
be taken into account, as some wells are locatedmore than 30 km from the processing facility.

©COGNITE 2023 — COGNITE.COM

operational conditions (X) and the oil-in-water
concentration (Y). Furthermore, since the problem is both multivariate and nonlinear in nature, wehave to solve a nonlinear multivariate regression
problem.

Fig. 5: Schematics of the major components in theseparation trains. The first plot shows the featureimportance of the different well templates andseparation stages. The second plot shows thepredicted and measured oil-in-water concentration.

BENEFITS FOR YOUR TEAMS →©COGNITE 2023 — COGNITE.COM

Figure 5 ► shows the information available tothe operator in the control room. The upper partof the dashboard shows the feature importancefor the different components. The schematics tothe left show the influence of the different well
templates and the main separation components,
while the table to the right shows the number foreach component in the separation train. The lower
graph shows the predicted oil-in-water concentration in blue and the measured concentration ingreen. The predictions match the measured values
well except for a few short time-scale incidents.
WHY COGNITE DATA FUSION® →Fig. 4: Separator efficiency model.

13

Fig. 3: An illustration of the choke dispersion model.

CONTACT SALES →Impact: In one example, the solution saved an oil
and gas operator an estimated $5-10 million a year
by giving petroleum engineers and field operators 24-hour access to granular insights for better,
faster decision-making.
READ MORE→

Cognite’s approach
Flow rates of gas, hydrocarbon liquid, and water
are key inputs to most optimization solutions.
Upstream of separation, the flow is a mixture ofgas, oil, and water, making measurement a difficult
task. Multiphase flow meters (MPFM) can measure
two- or three-phase flow using different techniques, but these meters are expensive and needfrequent calibration in order to produce reliablemeasurements.

A virtual flow meter is a virtual sensor that uses theexisting sensors (as shown in Figure 6 ►) combinedwith a mathematical model of the multiphase flow.
Many commercial vendors offer VFMs. What these
VFMs have in common is that they are based on
rigorous models for conservation of mass, momentum, energy, and volume. These are sophisticatedsolutions that require little to no data, can predictoutside the available data, and can be used forlook-ahead and planning applications. A virtual flow
meter based on physics-guided machine learning,in comparison, uses simpler and more approximative physics models.

To understand a multiphase virtual flow meter(VFM), it is useful to understand how a typical MPFM
works. Designs may differ, but the operational principle of most meters is as follows: The fluids are

WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →Fig. 6: An illustration of a well and thecommonly available sensors used in a virtual
flow meter.

14

Solution: A combination of physical modeling of
fluid flow with data analytics on sensor data, creating a virtual window into the production systemthat continuously supplies gas, oil, and water flow
rates.

mixed and pass through a throat where the pressure drop is measured, similar to most single phaseflow meters. The average density is measured
using a gamma densitometer or an x-ray sensor,
and the water fraction is measured using a capacitance or conductance sensor. The fluid propertiesare computed based on the fluid composition andthe measured pressure and temperature, and therates of the different phases are then computed
based on a mathematical model for the pressure
drop across the throat.

©COGNITE 2023 — COGNITE.COM

Virtual flow meters

CONTACT SALES →The production choke can be viewed as a singlephase flow meter with an adjustable throttling.
From Bernoulli’s equation we can derive a simple
valve equation which relates the measured pressure drop across the valve dPchoke=PWH– PDC to the
mixture’s volumetric flow rate, the flow area in the
choke, and fluid properties. The valve opening is
usually reported as the fraction of the stem travel,
and we convert it to the flow area using the choke
CV curve.

WHY COGNITE DATA FUSION® →where ρM is the mixture density, g is the acceleration due to gravity, H is the difference in height
between the bottomhole and wellhead pressure
sensors, L is the length of the wellbore between
the bottomhole and wellhead pressure sensors, D
is the wellbore inner diameter, ReM is the mixture’s
Reynolds number, ϵrel is the relative wellbore roughness, and U is the average velocity of the fluid
mixture.
From our single-phase flow experiment example,
we already know how to estimate the frictionalpressure drop, assuming homogeneous mixing of
the phases. The densities for the different phases
and the height difference between the pressure
sensors gives the hydrostatic pressure drop.
Note that both the frictional and hydrostatic pressure drop estimations require an estimate of thecross-sectional fraction of each phase.
Assuming low velocity, the pressure drop will bedominated by the hydrostatic pressure drop, andhence we have a good estimate of the gas-liquidratio by making an assumption of the water cut.
Since the density difference between oil and water

BENEFITS FOR YOUR TEAMS →CONTACT SALES →is low, it is a relatively robust estimation. This is anindication that the well pressure drop dPwell has
a strong influence on determining the gas-liquid
fraction. From this we understand how error anddrift in these sensors affect the model.
The heat balance in the well is another important engineered feature. Again, this is related tothe mass flow F, the specific heat capacity of thephases Cp, the heat transfer coefficient Ω, and an
estimation of the surrounding temperature Tr.

FCp(TBH–TWH)=ΩπDL(Tf–Tr)
The difference in heat capacity between oil andwater is usually significantly larger than the difference in density, indicating that the heat balanceengineered feature strongly influences the estimation of the water cut. From our experience, thewellhead temperature sensor is often the mostunreliable sensor. If it is poorly insulated, it isstrongly affected by weather conditions, causing
an increased uncertainty in the water-cut predic
tions. However, if weather information exists, amachine learning-based model will to a certain
extent be able to compensate for this. Unknown
or uncertain parameters, such as the heat transfer
coefficient Ω and the rock temperature Tr are effectively estimated by the machine learning algorithm.
Note that several of the parameters may change
along the wellbore. In this simple approach, this15

An initial observation is that the well tests arecommonly reported at standard conditions, but
the physics is governed by the in-situ conditions.
The conversion from standard conditions to in-situ
conditions requires information about the fluid
densities as a function of pressure and temperature, as well as flashing between liquid and gas.
If the correct information is not available, it canbe approximated using ideal gas law for gas andassuming incompressibility for the liquids.

The pressure drop in the well is the sum of thehydrostatic pressure drop in the well and the frictional pressure drop

©COGNITE 2023 — COGNITE.COM

We have derived a list of different engineeredfeatures where some of the features require
additional information, such as a CV curve for thechoke, fluid properties, and information about the
wellbore. If any part of this information does notexist, it can either be approximated or a different
engineered feature can be selected. Rememberthat the engineered feature does not have to be
exact, but it should approximate the correct trend.
The purpose of the machine learning model is tocompensate for the imperfections in the physics.

is handled by using a single representative value.
More sophisticated approaches would integratealong the wellbore.

100
Qw (Sm3/day)Figure 7 ► shows comparisons of the volumetricoil (Qo) and water (Qw) rate between well test data
(black line) and virtual flow meter predictions (redline), using the approach detailed above. Note thatthe well test data in the comparison was not partof the training data set for the virtual flow metermodel.

125

75

50

25

Qo (Sm3/day)

800

600

400

200

Prediction

Fig. 7: Comparison of well test data and virtual flow meter results (the x-axis
corresponds to the data points time stamp). The first plot shows the volumetric oil rate Qo, while the second plot shows the volumetric water flow rate Qw.

WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →CONTACT SALES →©COGNITE 2023 — COGNITE.COM

16

Data

Conclusion
AI and machine learning should not be considered
a goal in digitalization, but rather seen as another
tool in the toolbox available to heavy-asset industries. Using machine learning to replace an existing
solution is not disruption; however, when machinelearning is used to solve previously unsolvableproblems, or when it significantly outperforms
existing solutions, then it becomes a disruptive
tool. Combining our understanding of physics
with data is the key to unlocking the potential ofmachine learning in industrial settings.

The building blocks are there: the data, the tools,
and the domain knowledge. It is up to the industry to put them all together to unleash the value
potential that lies ahead.

Some consider the addition of physics a sign ofdefeat, since the appeal of machine learning is thatmodels are supposed to find relations themselves
based on nothing but data. This couldn’t be further
from the truth. The combination of physics anddata science represents an opportunity to gain
a competitive advantage. Machine learning finds
patterns from information, and by adding physics,
we provide more information — and more importantly, more accurate information.

WHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →©COGNITE 2023 — COGNITE.COM

17

The oil and gas industry already has the subject-matter experts needed to take advantage of physics-guided machine learning. Now the challenge
is to set up cross-disciplinary teams with bothsubject-matter experts and data scientists, andto create a common working language that both
camps can speak as they collaborate.

CONTACT SALES →Want to know more about our product?

Explore more insights from Cognite

ANALYST REPORT

BLOG

Discover how Cognite Data Fusion®
makes data more accessible andmeaningful, driving insights that
unlock opportunities in real-time,
reduce costs, and improve theintegrity and sustainability of youroperations.

Customer interviews and financial
analysis reveal an ROI of 400% andtotal benefits of $21.56M over three
years for the Cognite Data Fusion®
platform.

Discover our rich catalog of industry insights and technology deep
dives.

WATCH NOW →GO TO STORIES →READ THE REPORT →READ OUR NEWEST BLOGS →©COGNITE 2023 — COGNITE.COM

Learn from Cognite customers andproduct managers how Cognite
Data Fusion® simplifies and streamlines the data experience of a
subject matter expert.

18

CUSTOMER STORIESPRODUCT TOURWHY COGNITE DATA FUSION® →BENEFITS FOR YOUR TEAMS →CONTACT SALES →COGNITE.COM →