You are on page 1of 7

Proceedings of the 2nd IFAC Workshop on Automatic Control in

Proceedings
Offshore of
Oil and
Proceedings of the
Gas2nd IFAC Workshop on
Production Automatic Control in
Proceedings
Offshore Oil of the
andthe
Gas
2nd
2nd IFAC
IFAC Workshop
Workshop on
Production on Automatic
Automatic Control
Control in
in
May 27-29,
Offshore 2015.
Oil and Florianópolis,
Gas ProductionBrazilAvailable online at www.sciencedirect.com
Offshore Oil
May 27-29, and Gas Production
27-29, 2015. Florianópolis,
Florianópolis, Brazil
May
May 27-29, 2015.
2015. Florianópolis, Brazil
Brazil
ScienceDirect
IFAC-PapersOnLine 48-6 (2015) 140–146
Estimation of Flow Rate and Viscosity in a
Estimation
Estimation of
of Flow
Flow Rate
Rate and
and Viscosity
Viscosity in
in aa
Well with an Electric Submersible Pump
Well
Well with an Electric
withMoving
an Electric Submersible
Submersible Pump

Pump
using Horizon Estimation 
using Moving
using Moving Horizon
Horizon Estimation
Estimation
∗ ∗∗ ∗∗∗
Benjamin J.T. Binder ∗ Alexey Pavlov ∗∗ Tor A. Johansen ∗∗∗
Benjamin
Benjamin J.T. Binder ∗ Alexey Pavlov ∗∗ Tor A. Johansen ∗∗∗
Benjamin J.T. J.T. Binder
Binder ∗ Alexey Alexey PavlovPavlov ∗∗ Tor Tor A. A. Johansen
Johansen ∗∗∗


Department of Engineering Cybernetics, Norwegian University of
∗ Department of Engineering Cybernetics, Norwegian University of
∗ Department
Science and of Engineering
Technology, Cybernetics,
O.S. BragstadsNorwegian
plass 2D, UniversityNO-7491 of
Department
Science and of Engineering
and Norway
Technology, Cybernetics, Norwegian
O.S.benjamin.binder@itk.ntnu.no).
Bragstads plass plass 2D, University
NO-7491 of
2D, NO-7491
Science
Trondheim,
Science and Technology,
Technology, (e-mail:O.S.
O.S. Bragstads
Bragstads plass 2D, NO-7491
∗∗ Trondheim,
Trondheim,
Statoil ASA Research Norway
Norway and(e-mail:
(e-mail: benjamin.binder@itk.ntnu.no).
benjamin.binder@itk.ntnu.no).
Development Center, P.b. 1004, NO-3905
∗∗ Trondheim, Norway (e-mail: benjamin.binder@itk.ntnu.no).
∗∗ Statoil ASA Research and Development Center, P.b. 1004, NO-3905
∗∗ Statoil ASA Research and
∗∗∗
Statoil ASA Porsgrunn,
ResearchNorway
Porsgrunn, and Development
Norway Development
(e-mail:
Center,
Center, P.b.
(e-mail: alepav@statoil.com)
alepav@statoil.com) P.b. 1004,
1004, NO-3905
NO-3905
∗∗∗
Center Porsgrunn,
for Autonomous
Porsgrunn, Norway
Norway Marine(e-mail: alepav@statoil.com)
Operations
(e-mail: and
alepav@statoil.com) Systems (AMOS),
∗∗∗ Center for
Center for Autonomous Marine Operations and Systems
Systems (AMOS),
Center for Autonomous
∗∗∗Department
Department
of Engineering
Autonomous
of Engineering
Marine
Marine Operations
Cybernetics,
Operations
Cybernetics,
and
Norwegian
and Systems
Norwegian
(AMOS),
University
(AMOS),
University
of
of
Department
Science
Department of
and Engineering
Technology,
of Engineering Cybernetics,
O.S. Bragstads
Cybernetics, Norwegian
plass
Norwegian 2D, University
NO-7491
University of
of
Science
Science
Trondheim, and
and Technology,
Technology,
Norway (e-mail: O.S.
O.S. Bragstads
Bragstads plass
plass
tor.arne.johansen@itk.ntnu.no).2D,
2D, NO-7491
NO-7491
Science and
Trondheim, Norway Technology, O.S. Bragstads
Norway (e-mail: tor.arne.johansen@itk.ntnu.no). plass
tor.arne.johansen@itk.ntnu.no).2D, NO-7491
Trondheim,
Trondheim, Norway (e-mail: (e-mail: tor.arne.johansen@itk.ntnu.no).
Abstract: A Moving Horizon Estimator (MHE) is designed for a petroleum production well
Abstract:
Abstract: A
A Moving Horizon Estimator
(ESP) (MHE) installedis designed for aa petroleum production well
with an Electric
Abstract:
with A Moving
an Electric
Electric
Horizon
Submersible
Moving Horizon
Submersible
Pump
Pump
Estimator
Estimator
(ESP)
(MHE)
(MHE)
installed
is designed
for
isfor artificial
designed
artificial
for
forlift.a petroleum
lift. The focus is
petroleum
The focus is
production
on estimating
production
is onindex
estimating
well
well
with
the
with an
flow
an rate from
Electric Submersible
the well,
Submersible the Pump
Pump (ESP)
viscosity
(ESP) of installed
the for
produced
installed for artificial
fluid,
artificial and lift.
the
lift. The
The focus
productivity
focus is on
on estimating
of
estimating the
the
the
well. flow
flow
The rate
rate from
from
software the
the well,
well,
package the
the
ACADO viscosity
viscosity is of
of
used the
the
to produced
produced
implement fluid,
fluid,
a and
and
Moving the
the productivity
productivity
Horizon Estimator index
index of
of
using the
the a
the
well. flow
The rate from the
software well, the
package ACADO viscosity is of the
used to produced
implement fluid, and the
aa Moving productivity
Horizon Estimator indexusingof the aa
well.
well. The
third-order software
nonlinear
The software package
model.
package ACADO
Simulation is used to
results implement
show that the Moving
implementedHorizon Estimator
estimator is using
able to
third-order
third-order nonlinear
estimate thenonlinear model.ACADO
model.
desired variable Simulation
Simulation
and
is used
parameters.
to implement
results
results Theshow
show that the
that
resulting
a Moving
the
C-code implemented
implemented
Horizonestimator
Estimator
estimator
solver is very is using
is able to
able
fast, admitting to a
third-order
estimate the nonlinear model.
desired variable Simulation
variable and parameters. results show
parameters. The resulting that the
resulting C-code solverimplemented estimator
solver is very is
very fast, admitting able
admitting to
estimate
real-time the
estimate desired
desired variable and
implementation.
the and parameters. The The resulting C-code C-code solver is is very fast,
fast, admitting
real-time
real-time implementation.
implementation.
real-time
© 2015, IFAC implementation.
(International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved.
Keywords: Petroleum Production, Electric Submersible Pumps, Estimators, Moving Horizon
Keywords:
Keywords: Petroleum
Flow RateProduction,
Petroleum
Estimation,Petroleum Allocation, Electric
Production, Electric
Production Submersible
Submersible
Optimization Pumps,
Pumps, Estimators,
Estimators, Moving Moving HorizonHorizon
Keywords:
Estimation, Flow Rate Production,
Allocation, Electric
Production Submersible
Optimization Pumps, Estimators, Moving Horizon
Estimation, Flow Rate Allocation, Production
Estimation, Flow Rate Allocation, Production Optimization Optimization
1. INTRODUCTION As a lot of instrumentation is usually included in ESP
1.
1. INTRODUCTION
INTRODUCTION As
As aa lot of instrumentation is usually included in ESP
1. INTRODUCTION As a lot
lot of
installations,
installations, of instrumentation
using the ESP as
instrumentation
using the ESP
is
is aausually
as
flow meter
usually
flow
included
included
meter has
in
in ESP
has recentlyESP
recently
Information about the flow rate and phase fractions from installations, been investigated.
installations, using
using the ESP
Extensive
the ESP as aa flow
testing
as flow ofmeter
both has
meter flowrecently
has meters
recently
Information
Information
individual wells
Information
about
about
about in the
the
the
flow rate
rateisand
flowfield
an oil
flow rate and phase
phase fractions
important
and phase for flow from
fractions
fractions rate been
from
from
been
and
been
investigated.
for flow Extensive
investigated.
ESPs
investigated. allocation testing
Extensive
Extensive testing
purposes
testing
of
of both
both
of was
flow
flow
bothperformed
meters
flow meters
meters in
individual
individual
allocation wells
wells
and in
in an
an
production oil
oil field
field is
is important
important
optimization. for
for
Measurements flow
flow rate
rateof and
and
Beall ESPs
ESPs
et al. for
for flow
flow
(2011). allocation
allocation
It was purposes
purposes
shown that was
was
flow performed
performed
meter accu-in
in
individual wellsproduction
in an oil field is important for flow rate and
Beall ESPs
et al. for flow
(2011). allocation
It was purposes
shown that was
flow performed
meter accu-in
allocation
allocation
these haveand and
and productionbeen
traditionally optimization.
optimization. Measurements
Measurements
performedMeasurements
with specialized of Beall
racy iset al.
highly (2011).
dependent It wason shown
correct
of Beall et al. (2011). It was shown that flow meter accu- that
fluid flow meter
characterization, accu-
allocation production optimization. of
these
these
these
have traditionally
traditionally been
have instrumentation.
and costly
have traditionally been
been
performed
performedflow
Multi-phase
performed
with specialized
withmetering
with specialized
specialized has racy racy
racy
is
is highly
is highly
specifically highly
dependent
dependent
viscosity
dependent andonon correct
correct
onphase
correct
fluid
fluid
fractions characterization,
fluid characterization,
are important
characterization,
and
and
been costly
costly
a instrumentation.
instrumentation.
challenge for offshore Multi-phase
Multi-phase
applications, flow
flow
bothmetering
metering
due to has
has
the specifically
specifically
parameters. viscosity
viscosity
In Olsen and
and
et al.phase
phase
(2012) fractions
fractions
the ESP are
testsimportant
are important
and flow
and costly instrumentation. Multi-phase flow metering has specifically
parameters. viscosity
In Olsen andal.phase
et (2012) fractions
the ESP are
tests important
and fromflow
been
been a
a
complexitychallenge
challenge
of for
for
such offshore
offshore
fields, andapplications,
applications,
space both
both
requirements, due
due to
to the
the
costs parameters.
rate allocation
parameters. In
In Olsen
was
Olsen et
further
et al.
al. (2012)
discussed,
(2012) the
the ESP
and
ESP tests
the
tests and
results
and fromflow
flow
been a challenge
complexity of for fields,
such offshoreand applications,
space both due tocosts
requirements, the rate allocation was further discussed, and the results
complexity
and uncertaintiesof such
suchassociated
fields, and
andwith spacesuch requirements,
instrumentation rate
the allocation
ESP tests was
were further
used discussed,
to develop
costs rate allocation was further discussed, and the results from and
an the results
algorithm from
that
complexity of fields, space requirements, costs
and
and
(Varón
and
uncertainties
et al., 2013).associated
uncertainties
uncertainties Moreover, with
associated
associated with such instrumentation
suchproducing
for fields
with such instrumentation
instrumentationoil with the the ESP
ESP
ESP tests
estimates
the
tests
flow rates
tests
were
were
werebased
used
used
used on
to
to develop
develop
develop an
to measurements
an algorithm
an algorithm
from the ESP
algorithm
that
that
that
(Varón
(Varón
a high et
et al.,
al.,
viscosity,2013).
2013). Moreover,
Moreover,
multi-phase for
for
flow fields
fields
meters producing
producing
may not oil
oil
be with
with
very estimates
estimates
system and flow
flow
fluid rates
rates based
based
properties, on
on measurements
measurements
combined with from
from
models the
the ofESP
ESPthe
(Varón et al., 2013). Moreover, for fields producing oil with estimates
system flow
and fluid
fluid rates based
properties, on measurements
combined with from
models ofthe ESP
of the
the
aareliable.
high
high viscosity,
viscosity, multi-phase
multi-phase flow
flow meters
meters may
may not
not be
be very
very system
ESP and
system components.properties, The combined
flow rate with models
measurements de-
a high viscosity, multi-phase flow meters may not be very ESP system components. The flow rate measurements the
reliable.
system and fluid properties, combined with models of de-
reliable. ESP
pend system
on the components.
pump speed, The
ESP flow
head rate
or measurements
brake horsepower, de-
The Electric Submersible Pump (ESP) is one of the most ESP
reliable. pend
pend
and
system
on
on
the the
the
components.
pump
pump
viscosity ofspeed,
speed,
the
The
ESP
ESP
fluid.
flow
head
head
rate
Promising or
or
measurements
brake
brake
results horsepower,
horsepower,
with
de-
this
The
The
widelyElectric
Electric Submersible
Submersible
used methods Pump
Pump (ESP)
for artificial (ESP)
(ESP) is one
is the
lift inis of
one oil the
of the
the most
most and
industry pend on
the the pump
viscosity ofspeed, ESP
the fluid. head
Promising or brake
results horsepower,
with this
The Electric Submersible Pump one of most and
approachthe
the viscosity
were reported. of
of the
the fluid. Promising
Uncertainties
Promising in results with
the flow
with rate this
widely
(Takacs,used
widely
widely used
2009;
used
methods
methods
Varón et
methods
for
for
artificial
foral.,
artificial
artificial
lift
lift in
2013). There
lift in
the
the aoil
in are
the oil
industry
oilnumber
industry
industry of andapproach
approach
measurements
viscosity
were by
were reported.
reported.
using
fluid.
Uncertainties
Uncertainties
the ESP as a
results
in
in
flow themeter
the flow
flow
this
rate
rate
were
(Takacs,
(Takacs, 2009;
2009;
variables 2009; Varón
Varónthe
that affect et al., 2013).
et life-time
al., 2013).
2013). There are a
Thereinstallations,
of ESP number
are aa number
number such of approach
of measurements were reported.
by using Uncertainties in the flow rate
(Takacs,
variables that Varón
affect et
the al.,
life-time of There
ESP are
installations, such of measurements
investigated
measurements by
by using
in Varón et al.the
using the ESP
ESP
(2013),
the ESPwhere
as
as a flow
as aa it wasmeter
flow
flow shown were
meter
meter were
that
were
variables
as power
variables that
that affect
consumption,
affect the
the life-time
flow rate,
life-time of
of ESP
pressure,
ESP installations,
temperature,
installations, such
such investigated
investigated
this depends in
in onVarón
Varón
the et
et
pump al.
al. (2013),
(2013),
speed where
where
and it
it
fluid was
was shown
shown
viscosity. that
that
This
as
as power
power
thrust consumption,
consumption,
forces and flow
flow
vibration. rate,
rate,
Operationpressure,
pressure,outsidetemperature,
temperature,
of certain investigated
this depends inonVarón
the et al. (2013),
pump speed where
and it was
fluid shown This
viscosity. that
as
thrustpower consumption,
forces and flow
vibration. rate,
Operationpressure,outsidetemperature,
of certain this
reveals
this depends
that
depends a on
on the
main
the pump
pump speed
limitations
speed and
in
and thisfluid viscosity.
approach
fluid viscosity. is This
that
This
thrust
limits
thrust forces
on these
forces and vibration.
variables
andvariables
vibration. may Operation
lead
Operation to outside
failure orof
outsideorofreduced certain
reduced reveals
certain reveals
it depends thatheavily
that aaa main
mainonlimitations
limitations in this
in
correct information this approach
approach is that
is
about certain that
limits
limits
life-timeon these
onofthese
these variables
the ESP, which may
may lead
lead
hasleada hugeto failure
to failure
failure
economic or reduced
reduced
impact, it reveals
depends that heavily main onlimitations
correct in this
information approach
about is that
certain
limits
life-time on of the variables
ESP, which may has a to
huge economic or impact, it
it depends
parameters,
depends heavily
such
heavily as on
the
on correct
viscosity
correct information
of the
information about
produced
about certain
fluid.
certain
life-time
both due of of the
tothe ESP,
the ESP, which
costs which has aa huge
of replacing huge
the pump,economic and the impact,loss parameters,
parameters, such
such as the viscosity of the produced fluid.
life-time
both due to the costs of has
replacing the economic
pump, and impact,
the loss such as
parameters, (observers) as the viscosity
the are
viscosity of
of the
the produced
produced fluid. fluid.
both
of
both
of due to the costs of replacing the pump, and the loss Estimators (observers) are usually implemented to
due to
production.
production.
the costs of replacing the pump, and the loss Estimators usually implemented
to
esti-
esti-
of production. Estimators
mate unmeasured (observers) states arein usually
a system implemented
model that to
is esti-
used
ofReliable measurements are difficult to obtain for many Estimators
production. mate
mate
for unmeasured
unmeasured
control
(observers)
and states
states
monitoring
arein
in
usually
a
a system
system
purposes.
implemented
model
model
The that
that
Kalman
to
is
is
esti-
used
used
Filter
Reliable
Reliable measurements
measurements
importantmeasurements
variables andare are
are difficult
difficult to
parameters to
to obtain
obtain
in obtain
ESP-lifted for many
for many
many
wells. for mate
for unmeasured
control and states
monitoring in a system
purposes. model
The that
Kalman is used
Filter
Reliable difficult for is ancontrol
efficient and monitoring
solution to thepurposes.
estimationThe Kalman
problem Filter
for linear
important
important variables
important variables and
variables and parameters
and parameters in
parameters in ESP-lifted
in ESP-lifted wells.
ESP-lifted wells. for
wells. is
is an
an
control
systems, efficient
efficient
but
and monitoring
solution
solution
the to
to
estimation the
the
purposes.
estimation
estimation
of nonlinear
The Kalman
problem
problem
systems for
for
is
Filter
linear
linear
still a
 This work is funded by the Research Council of Norway and is an
systems, efficient
but solution
the to
estimation the estimation
of nonlinear problem
systems for
is linear
still a

 This through
work is is the
funded by the
the Research
Research Council of Norway
Norway and systems,
challenging
systems, but the
problem.
butproblem. estimation
the estimation Various of nonlinear
nonlinear
ofnonlinear systems
extensions
nonlinear extensions
systems is of is still
of
still a
the
a
Statoil
 This work fundedPETROMAKS
by project No. 215684:
Council of Enablingand challenging Various the
This
Statoil work
through
High-Performance
Statoil through
is funded
the
the
by
PETROMAKSthe
Safety-Critical
PETROMAKS
Research
project
Offshore
project
Council
No.
and
No.
of Norway
215684:
Subsea
215684: Enabling
Automatic
Enabling
and challenging
linear
challengingKalman problem.
filter
problem. hasVarious
been
Various nonlinear
developed,
nonlinear extensions
including
extensions of
the
of the
Ex-
the
Statoil through theSafety-Critical
High-Performance PETROMAKS projectand
Offshore No. Subsea
215684:Automatic
Enabling linear Kalman
linear
tended Kalman
Kalmanfilter filter
Filter has(EKF)
has been developed,
been developed,
and the Unscented including Kalman
including the Ex-
the Ex-
Control Systems Using
High-Performance
High-Performance
Embedded Offshore
Safety-Critical
Safety-Critical
Optimization
Offshore and (emOpt)
Subsea
Subsea Automatic
and (emOpt) Automatic linear
tended Kalman
Kalman filter
Filter has(EKF)
been developed,
and the including Kalman
Unscented the Ex-
Control
Control Systems Using Embedded Optimization tended Kalman Filter (EKF)
tended Kalman Filter (EKF) and the Unscented Kalman and the Unscented Kalman
Control Systems
Systems Using
Using Embedded
Embedded Optimization
Optimization (emOpt)(emOpt)
Copyright
2405-8963 © © 2015,
2015 IFAC
IFAC (International Federation of Automatic Control)140Hosting by Elsevier Ltd. All rights reserved.
Copyright
Copyright
Peer review ©
© 2015
2015
under IFAC
IFAC
responsibility of International Federation of 140
140
Automatic
Copyright © 2015 IFAC 140Control.
10.1016/j.ifacol.2015.08.022
IFAC Oilfield 2015
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146 141

Table 1. Model variables


Inputs Unit Meas
f ESP frequency Hz yes
z Production choke valve opening - yes
Pressures Unit Meas
pm Manifold pressure Pa yes
pwh Wellhead pressure Pa yes
pp,out ESP outlet pressure Pa yes
pp,in ESP inlet pressure Pa yes
∆pp Pressure difference across ESP Pa yes
pbh Bottomhole pressure in well Pa no
∆pf Frictional pressure drop in the well Pa no
F1 Frictional pressure drop below ESP Pa no
F2 Frictional pressure drop above ESP Pa no
Flow rates Unit Meas
q Average flow rate in well m3 /s no
qc Flow rate through production choke m3 /s no
qr Inflow from reservoir into well m3 /s no
ESP Unit Meas
I Electric current in ESP motor A yes
H Head developed by ESP m no
Fig. 1. ESP-lifted well P ESP brake horsepower (BHP) W no

Filter (UKF), the EKF probably being the most commonly 2. SYSTEM MODEL
implemented estimator for nonlinear systems (Julier and
Uhlmann, 2004). The Moving Horizon Estimator (MHE) The estimation in this paper is based on a dynamic model
(Rao et al., 2003) is an optimization-based method for of the well and the ESP. The estimation also depends on
nonlinear estimation that works on a limited number of available system information, such as measured variables,
past measurements (a ’window’ or ’horizon’). The main known model parameters and empirical test data. In
advantages of MHE is the explicit consideration of state this section, the model that is used in the estimator is
and parameter constraints, optimality of the estimates (in presented, and the information assumed to be available is
a least-squares sense), and the stability properties (Kühl outlined.
et al., 2011).
In the recent years, several researchers have investigated 2.1 Model Variables
estimation in petroleum wells based on dynamic models of
the wells. Estimation in gas-lifted wells was investigated The considered well is shown in Fig. 1. (A vertical well
e.g. in Bloemen et al. (2004); Eikrem et al. (2004); Aamo is depicted, but the model also describes deviated wells.)
et al. (2005), and for drilling applications in e.g. Siahaan These are the main variables in the system:
and Nygaard (2008); Paasche et al. (2011); Kaasa et al. • The control inputs to the system are the rotational
(2012); Nikoofard et al. (2014); Hasan and Imsland (2014). frequency f of the ESP, and the production choke
In this paper, MHE is implemented for a well with an valve opening denoted z.
ESP and a production choke valve, as shown in Fig. 1. • pm denotes the manifold pressure, which is treated as
The focus is on estimating the flow q from the well, the a disturbance in the model.
viscosity µ of the produced fluid, and the productivity • The wellhead pressure is denoted pwh , and the bot-
index PI of the well, based on measurements that typically tomhole pressure is denoted pbh .
are available in such systems. Both flow rate of the • pp,in and pp,out denote the pressures at the inlet and
produced fluid and the well productivity index (PI) are outlet of the ESP, and ∆pp = pp,out − pp,in the
very important parameters for flow rate allocation and pressure increase provided by the ESP.
production optimization, and both flow rate and viscosity • I denotes the electric current supplied to the ESP
of the produced fluid are needed to determine whether the motor.
ESP has safe operating conditions. • q denotes the average flow rate in the well, qc the flow
rate through the production choke valve, and qr the
A main feature of the approach presented in this paper is inflow from the reservoir.
that not only a model of the ESP, but a dynamic model
of the entire well is used to get better estimates of the A complete list of variables that are used in the model
unknown parameters. This includes models of the pressure is given in table 1. Model parameters are described in
drop in the well between the ESP and the production sections 2.4 and 2.5.
choke, the pressure drop over the production choke, and
the inflow from the reservoir. Moreover, the estimations 2.2 Measurements
are based on measurements from a certain time window
(estimation horizon), which adds up to reliability and The following assumptions are made regarding available
accuracy of the estimates. measurements in the system:

141
IFAC Oilfield 2015
142
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146

• Pressure sensors are installed at the production man- Table 2. Model parameters
ifold, so that the manifold pressure pm and the well-
head pressure pwh are measured. Well dimensions and other known constants
• The ESP is equipped with pressure sensors so that g Gravitational acceleration constant 9.81 m/s2
pp,in , pp,out and thus ∆pp are measured. Cc Choke valve constant 2·10−5 *
• The Variable Speed Drive (VSD) provides measure- A1 Cross-section area of pipe below ESP 0.008107 m2
ments of the electric current I supplied to the ESP A2 Cross-section area of pipe above ESP 0.008107 m2
motor, and the rotational frequency f of the ESP. 1 D1 Pipe diameter below ESP 0.1016 m
• The choke opening z is known or measured. D2 Pipe diameter above ESP 0.1016 m
h1 Height from reservoir to ESP 200 m
The variables that are assumed to be measured are also hw Total vertical distance in well 1 000 m
indicated in table 1. L1 Length from reservoir to ESP 500 m
L2 Length from ESP to choke 1 200 m
2.3 Model V1 Pipe volume below ESP 4.054 m3
V2 Pipe volume above ESP 9.729 m3
The model used in the estimator is based on a simple ESP data
model of an ESP-lifted well developed by Statoil (Pavlov
f0 ESP characteristics reference freq. 60 Hz
and Alstad, 2010; Pavlov et al., 2014), and is modified to
Inp ESP motor nameplate current 65 A
include Viscosity Correction Factors (VCFs) in the model
Pnp ESP motor nameplate power 1.625·105 W
of the ESP. The resulting model is a nonlinear third-order
model, given by the following differential equations: Parameters from fluid analysis and well tests
β1 Bulk modulus below ESP 1.5·109 Pa
β1
ṗbh = (qr − q) (1a) β2 Bulk modulus above ESP 1.5·109 Pa
V1 M Fluid inertia parameter 1.992·108 kg/m4
β2 ρ Density of produced fluid 950 kg/m3
ṗwh = (q − qc ) (1b)
V2 pr Reservoir pressure 1.26·107 Pa
1 Unknown parameters
q̇ = (pbh − pwh − ρghw − ∆pf + ∆pp ) (1c)
M PI Well productivity index 2.32·10−9 m3 /s/P a
and the following algebraic equations: µ Viscosity of produced fluid Varying Pa · s
Flow: qr = PI (pr − pbh ) (2a) * Appropriate SI units

qc = Cc pwh − pm z (2b) 2.4 Model Parameters
Friction: ∆pf = F1 + F2 (2c)
2
  14 An overview of the parameters used in the model is given in
ρLi q µ table 2. This includes fixed parameters (such as physical
Fi = 0.158 · (2d)
Di A2i ρDi q dimensions of the well and the ESP motor ratings) and
ESP: ∆pp = ρgH (2e) parameters assumed to be obtained from analysis of fluid
 2 samples (such as density ρ, bulk moduli βi , and the fluid
f
H = CH (µ)H0 (q0 ) (2f) inertia parameter M ). The reservoir pressure pr is also
f0 assumed to be known from dedicated well tests. The
 
q f0 well productivity index PI and the fluid viscosity µ are
q0 = (2g) unknown parameters (to be estimated).
Cq (µ) f
Additional measurements are given by the following equa-
tions: 2.5 ESP Characteristics and Viscosity Correction Factors
Inp
I= P (3a) ESP characteristics for Head H0 (q) and Brake Horsepower
Pnp
 3 P0 (q), as well as Viscosity Correction Factors (VCFs)
f Cq (µ), CH (µ) and CP (µ) for flow, head and BHP, respec-
P = CP (µ)P0 (q0 ) (3b)
f0 tively, are also assumed to be known for the particular
pp,in = pbh − ρgh1 − F1 (3c) ESP used in the well. The ESP characteristics are given
for water at a given reference frequency, and are provided
Depending on the fluid properties and pressure/temper- by the pump vendor, while VCFs are usually obtained
ature conditions in the well, density and viscosity may be from published sources (HI, 1969), or through dedicated
different in different parts of the well. In this paper we lab tests. The characteristics that are used in the model
consider a well where changes in these properties through- are stated in table 3.
out the well are not significant. This corresponds to a well The ESP characteristics and VCFs used in this paper are
producing with a low gas-to-oil ratio and primarily with given by polynomials on the form:
oil continuous flow.
4
1 In most cases an ESP is driven by an asynchronous motor. This P (x) = c i xi (4)
means that the rotational frequency f of the ESP shaft will be
i=0
different from the frequency of the AC current supplied to the motor.
Many modern VSDs for ESPs can provide accurate estimates of the with the corresponding coefficients ci for each variable
shaft speed, and the assumption that f is measured will be valid for given in table 4. The VCFs are also shown in Fig. 2, and
such VSDs. are valid for viscosities up to 500 centipoise.

142
IFAC Oilfield 2015
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146 143

Table 3. ESP characteristics and Viscosity Cor- 3.2 MHE Formulation for ACADO Code Generation Tool
rection Factors (VCFs)
The ACADO Code Generation tool can be used to solve
Var. Description Unit an MHE problem formulated as follows:
H0 ESP head characteristics m
N
 −1
P0 ESP BHP characteristics W 2 2
q0 Theoretical flow rate at reference freq. m3 /s
min x0 − xAC SAC + h(xk , uk ) − ȳk Wk
x,u
CH VCF for head - k=0
2
CP VCF for brake horsepower of the ESP - + hN (xN ) − ȳN WN (5a)
Cq VCF for ESP flow rate - Subject to:
xk+1 = F (xk , uk , dk ), k = 0, ..., N − 1 (5b)
Table 4. Polynomial coefficients
xlow
k ≤ xk ≤ xhigh
k , k = 0, ..., N (5c)
c4 c3 c2 c1 c0 high
ulow
k ≤ uk ≤ uk , k = 0, ..., N − 1 (5d)
H0 0 0 -1.2454e6 7.4959e3 9.5970e2
P0 0 -2.3599e9 -1.8082e7 4.3346e6 9.4355e4
N is the length of the estimation window (number of
Cq 2.7944 -6.8104 6.0032 -2.6266 1
CH 0 0 0 -0.03 1
intervals/samples), the subscript k refers to the time
CP -4.4376 11.091 -9.9306 3.9042 1
samples in the estimation window, xk and uk denote the
estimated states and inputs at these samples, xN is the
estimate of the current state, and x0 is the estimate at the
beginning of the estimation window, i.e. N samples in the
past. ȳk and ȳN denote actual measurements, h and hN
are measurement models. SAC , Wk and WN are weighting
matrices. The constraint (5b) is the (nonlinear) system
model, 3 the constraints (5c) and (5d) place bounds (box
constraints) on the states and inputs.
xAC is the best available estimate of x0 before the current
sample, e.g. the estimate of x1 from the previous sample.
The first term in the objective function (5a) penalizes
any deviation in the estimated x0 from xAC , as xAC and
SAC contain all information obtained before the estimation
horizon. This is commonly referred to as the arrival
Fig. 2. Viscosity correction factors cost (AC). The weighting matrices may change between
each sample, and indeed, SAC is commonly updated by
3. MOVING HORIZON ESTIMATION Kalman Filter-based updates after each new measurement
(Rao et al., 2003). The other two terms in the objective
function penalize deviation between actual measurements
A Moving Horizon Estimator (MHE) is implemented to
and estimated measurements modeled by h and hN , thus
estimate the flow rate q and the unknown parameters µ
the estimator will seek to find estimates such that the
and PI. The implementation of the estimator is outlined
behavior of the model corresponds to the actual dynamics
in this section.
observed.
Even though the inputs typically are known (measured)
3.1 ACADO Code Generation Tool variables, they are also decision variables in the MHE for-
mulation. This means that the estimator is not restricted
The estimator is implemented using the Code Generation to use the exact measurements of the inputs when fitting
tool included in the ACADO toolkit (Automatic Control the model to the measurements, and a noise filtering effect
And Dynamic Optimization toolkit) (Houska et al., 2011). is thus introduced. On the other hand, deviations in the
This tool exports highly efficient C-code for solving nonlin- estimates from the measurements are penalized by the
ear MPC and MHE problems by means of the real-time it- weights in Wk , and reliable measurements should have
eration scheme with Gauss-Newton Hessian approximation large weights.
(Houska et al., 2009–2013). The solver method is based
on results presented in Diehl et al. (2002), and is further Further details regarding ACADO Code Generation and
described in Kühl et al. (2011). The scheme uses only the MHE problem formulation can be found in Houska
one iteration per measurement sample, and divides the et al. (2009–2013).
problem into a preparation phase and a feedback phase.
The generated ACADO solver calls an embedded variant 3.3 MHE Formulation for the ESP-lifted Well
of the active-set online QP solver qpOASES, implemented
in basic C++. 2 (Houska et al., 2009–2013; Ferreau et al., A MHE problem for the considered system is implemented
2014) in C++ as an Optimal Control Problem (OCP) using
3 (5b) describes a discrete-time system model. However, the current
2 ACADO has an interface that allows for implementation of other version of ACADO Code Generation tool only supports a continuous-
QP solvers, but qpOASES is the default solver and was used in this time formulation of the system model; discretization is automatically
paper. performed by ACADO.

143
IFAC Oilfield 2015
144
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146

Table 5. MHE settings Table 6. Standard deviation of measurement


noise
N 15
Ni 5 Measurement I pp,in ∆pp f z pm pwh
Ts 1 second Std. dev. (σ) 0.02 0.02 0.02 0.005 0.001 0.01 0.01
Integrator type Explicit Runge-Kutta 4
These are mainly derived from the inverse of the standard
Discretization type Multiple shooting
deviation of the measurement noise for each measurement,
ACADO syntax (cf. Houska et al. (2009–2013)), formu- given in table 6, and the inputs are weighted more than
lated as (5). The model given by (1)-(2) is also written in the modeled measurements. The weights are also scaled
this syntax and given as constraint (5b) in the OCP. according to the typical range of each variable.
The parameters µ and PI are added as states with differ- While ACADO includes functionality for Kalman Filter-
ential equations: based updates of the arrival cost weighting matrix SAC
µ̇ = 0 (6a) (see section 3.1), a constant SAC is used in the simulations.
This introduces more degrees of freedom when tuning the
ṖI = 0 (6b) estimator. The (original) model states are weighted quite
The measured disturbance pm is treated as an input. The evenly in SAC , but the parameters µ and especially PI have
state and input vectors are thus given by: large weights. PI is assumed to be constant, and a large
x = [pbh , pwh , q, µ, PI]
T
(7a) arrival cost ensures that this parameter does not change
too fast in the estimation. The arrival cost used is given
T
u = [f, z, pm ] (7b) by
The estimated measurement function h is given by: SAC = diag(1 e −10, 2 e −10, 5 e 7, 1 e 2, 5 e 23) (11)
T The state vector (7a) is given in SI units, and the arrival
h = [I, pp,in , ∆pp , f, z, pm , pwh ] (8)
cost is scaled accordingly.
4
and is implemented using the model (1)-(2) and (3). As
hN may not depend on any inputs in ACADO, it is not 4. SIMULATION RESULTS
used.
The constraints (5c) and (5d) on the states and inputs, Simulation results of the implemented MHE are presented
respectively, are derived from physical considerations and in this section.
system knowledge, and are given by:
4.1 Test Scenario
35 ≤ f ≤ 65 [Hz] (9a)
Data from a simulation scenario presented in Binder et al.
0 ≤ z ≤ 100 [%] (9b)
(2014), where an MPC was implemented for the system,
1 ≤ pm ≤ 50 [bar] (9c) is used as a test scenario for the MHE. 5 The scenario is
1 ≤ pwh ≤ 60 [bar] (9d) modified to include a varying viscosity of the produced
fluid. The viscosity can change relatively fast due to
1 ≤ pbh ≤ pr [bar] (9e) phenomena like phase inversion, where the flow transitions
0≤ q [m3 /s] (9f) from oil being present as droplets in a water continuous
flow, to water being present in an oil continuous flow, or
0.1 ≤ µ ≤ 500 [cP] (9g) vice versa (Piela et al., 2008). In the model used in the
Constraints on the inputs are included to provide better simulations, a change in the viscosity of the produced fluid
estimates, e.g. the choke will never be estimated to be more affects the whole well instantaneously, while in a real well,
than 100 % open. a change in the viscosity would only propagate with the
speed of the flow in the well. The well dynamics would
3.4 Settings and Weighting thus be a lot slower as e.g. the friction in the well would
change slowly. In the simulations, we have tested the MHE
There are a lot of settings that may affect the performance in an extreme (although somewhat unrealistic) scenario to
of the MHE, including the length N of the estimation challenge the estimator and evaluate its performance in
horizon, number of integrator steps per sampling interval extreme conditions.
Ni , integrator type and discretization type. The settings
used in the simulations are given in table 5. 4.2 Measurement Noise
The weighting matrix Wk is the main tuning parameter
in the estimator. In general, the weights should be chosen The MHE is tested with measurement noise. Each mea-
based on how much the measurements and the measure- surement is generated using
ment models can be trusted. A noisier measurement or y = (1 + n) · yreal (12)
a less accurate model should have a smaller weight. The where n is a noise signal with normal distribution. The
weights Wk used in this paper are given by standard deviation of the measurement noise for each
Wk = diag(1, 1, 0.67, 33.3, 10, 4, 3.33), ∀ k (10) measurement is given in table 6.
4 While SI units are used in the model and simulations, the pressures 5 The model used to generate the simulation data is identical to

in the measurement function are given in [bar], and the choke opening the model used in the MHE, except that the MHE model assumes a
in [%], for a better relative scaling of the variables. constant density ρ, and that they are discretized differently.

144
IFAC Oilfield 2015
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146 145

Fig. 3. Estimation results Fig. 4. Estimation results with increased density


Table 8. Mean estimation error with increased
Table 7. Mean estimation error [%] density [%]
Time 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9 Time 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9
q 3.5 -3.9 -0.8 3.8 0.3 -2.1 0.2 -0.1 q 7.2 -0.8 0.9 7.0 4.7 0.6 1.0 1.2
µ -24.5 43.7 9.5 -24.2 -1.7 29.9 -3.3 0.4 µ -34.3 18.4 -9.7 -33.7 -15.3 22.2 11.0 -1.0
PI 0.1 0.0 -0.3 -0.1 0.0 0.0 0.0 -0.0 PI -0.7 -0.9 -1.9 -2.2 -1.8 -1.5 -1.6 -2.1
pbh -1.7 2.6 0.4 -2.2 -0.1 1.0 -0.1 0.1 pbh -4.1 -0.3 -2.4 -5.0 -2.9 -1.3 -1.7 -2.2

4.4 Parameter Sensitivity


4.3 Estimation Results
Although many parameters in the model are assumed to be
MHE estimation results are presented in Fig. 3. The real known and constant, some parameters may be inaccurate
data is shown as solid blue lines, the estimates are shown or varying. E.g. the fluid density ρ may change in the
as dash-dotted red lines. As can be seen, all estimates period between the times fluid samples are taken, and thus
are quite accurate, without any steady-state offset, though may be inaccurate. To investigate how such model inac-
there is a small lag in the estimates. The estimator does not curacies may affect the estimations, a simulation with an
have any information about the dynamics of the parameter increased fluid density is performed. ρ is set to 1000 kg/m3
µ, which changes very fast in this scenario, while µ̇ = 0 in the simulator, while it is kept at 950 kg/m3 in the
is assumed in the estimator model. This means that the estimator model. The results are shown in Fig. 4 and
estimator needs to use feedback from the measurements table 8. The estimates are still quite good, though the
to make correction for this, and this needs some time in highest viscosity levels are not estimated very accurately,
order not to amplify measurement noise too much. This and the estimates of the flow rate are thus a bit too high,
error propagates to the other states, as the parameter µ is e.g. in the interval between 5 and 6 minutes. The estimates
an essential parameter in the system model. of P I are also less accurate. Nevertheless, this shows that
In table 7, the average estimation error (in percent) is the estimator is quite robust to unknown errors in the
calculated for each minute of the simulation. Due to the model parameters.
lag in the estimates, there are large relative errors during
the transients, especially for the estimates of viscosity µ. 4.5 Computation Time
The estimates at steady-state are quite accurate, see e.g.
the last time interval in the table, from 8 to 9 minutes in As mentioned in section 3.1, the nonlinear MHE problem
the simulation. is solved in two phases. A feedback phase is run for each

145
IFAC Oilfield 2015
146
May 27-29, 2015. Florianópolis, Brazil Benjamin J.T. Binder et al. / IFAC-PapersOnLine 48-6 (2015) 140–146

Table 9. MHE computation time in [µs] HI (1969). Determination of Pump Performance when
Handling Viscous Liquid. Hydraulic Institute Stan-
Mode Preparation Feedback Total dards, 20th edition.
Avg. Worst Avg. Worst Avg. Worst Houska, B., Ferreau, H., and Diehl, M. (2011). ACADO
Original 300 430 496 833 796 1 263 Toolkit – An Open Source Framework for Automatic
Increased ρ 300 479 490 1 079 790 1 467 Control and Dynamic Optimization. Optimal Control
Applications and Methods, 32(3), 298–312.
new measurement, and a preparation phase is run after the
Houska, B., Ferreau, H., Vukov, M., and Quirynen,
estimate is ready, to prepare for the next measurement.
R. (2009–2013). ACADO Toolkit User’s Manual.
The computation times of the MHE solver on a computer
http://www.acadotoolkit.org.
running OS X 10.9, with a 2.6 GHz Intel Core i7 processor
Julier, S.J. and Uhlmann, J.K. (2004). Unscented filtering
and 16 BG of RAM, are presented in table 9. As can be
and nonlinear estimation. Proceedings of the IEEE,
seen in the table, the solver is very fast, and the MHE
92(3), 401–422.
problem is solved in less than a millisecond on average. The
Kaasa, G.O., Stamnes, Ø.N., Aamo, O.M., and Imsland,
worst-case computation time is less than 1.5 milliseconds.
L.S. (2012). Simplified hydraulics model used for intel-
ligent estimation of downhole pressure for a managed-
5. CONCLUSIONS pressure-drilling control system. SPE Drilling and Com-
pletion, 27(1), 127–138.
In this paper, a Moving Horizon Estimator was success- Kühl, P., Diehl, M., Kraus, T., Schlöder, J.P., and Bock,
fully implemented for a well with an Electric Submersible H.G. (2011). A real-time algorithm for moving horizon
Pump. The implemented estimator was able to estimate state and parameter estimation. Computers & Chemical
the flow rate and the productivity index of the well, and Engineering, 35(1), 71–83.
the viscosity of the produced fluid. ACADO was used to Nikoofard, A., Johansen, T.A., and Kaasa, G.O. (2014).
implement the estimator, and proved to be a capable soft- Design and comparison of adaptive estimators for under-
ware package, providing a fast and efficient solver for the balanced drilling. In Proc. 2014 American Control
MHE problem. As the solver was very fast, the estimator Conference (ACC). Portland, OR, USA.
may also be feasible to implement on industrial embedded Olsen, H., Sheth, K., Pessoa, R., Rutter, R., and Crossley,
hardware, though this was not investigated in this paper. A. (2012). Successful production allocation through esp
performance in peregrino field. In SPE Latin Ameri-
REFERENCES can and Caribbean Petroleum Engineering Conference.
Mexico City, Mexico.
Aamo, O.M., Eikrem, G.O., Siahaan, H.B., and Foss, B.A. Paasche, M., Johansen, T.A., and Imsland, L.S. (2011).
(2005). Observer design for multiphase flow in vertical Regularized and adaptive nonlinear moving horizon es-
pipes with gas-lift—-theory and experiments. Journal timation of bottomhole pressure during oil well drilling.
of Process Control, 247–257. In Proc. 2011 IFAC World Congress. Milan, Italy.
Beall, R.Q., Sheth, K.K., and Olsen, H. (2011). An Pavlov, A. and Alstad, V. (2010). Modelling, simulation
integrated solution enabling allocation of heavy oil in and automatic control of ESP lifted wells. Statoil
the peregrino field. In Offshore Technology Conference. internal report.
Houston, TX, USA. Pavlov, A., Krishnamoorthy, D., Fjalestad, K., Aske, E.,
Binder, B.J.T., Kufoalor, D.K.M., Pavlov, A., and Jo- and Fredriksen, M. (2014). Modelling and model predic-
hansen, T.A. (2014). Embedded Model Predictive tive control of oil wells with electric submersible pumps.
Control for an Electric Submersible Pump on a Pro- In Proc. 2014 IEEE Conference on Control Applications
grammable Logic Controller. In Proc. 2014 IEEE Con- (CCA).
ference on Control Applications (CCA). Piela, K., Delfos, R., Ooms, G., Westerweel, J., and
Bloemen, H., Belfroid, S., Sturm, W., and Verhelst, F. Oliemans, R. (2008). On the phase inversion process
(2004). Soft sensing for gas-lift wells. In SPE Annu. in an oil–water pipe flow. Int. J. Multiphase Flow.
Tech. Conf. and Exhibition. Houston, TX, USA. Rao, C.V., Rawlings, J.B., and Mayne, D.Q. (2003). Con-
Diehl, M., Bock, H.G., Schlöder, J.P., Findeisen, R., Nagy, strained state estimation for nonlinear discrete-time
Z., and Allgöwer, F. (2002). Real-time optimization and systems: Stability and moving horizon approximations.
nonlinear model predictive control of processes governed IEEE Trans. Autom. Control.
by differential-algebraic equations. Journal of Process Siahaan, H.B. and Nygaard, G. (2008). On modeling and
Control, 12(4), 577–585. observer design of fluid flow dynamics for petroleum
Eikrem, G.O., Imsland, L.S., and Foss, B. (2004). Stabi- drilling operations. In Proc. 47th IEEE Conf. Decision
lization of gas lifted wells based on state estimation. and Control (CDC08). Cancun, Mexico.
In International Symposium on Advanced Control of Takacs, G. (2009). Electrical Submersible Pumps Manual:
Chemical Processes. Design, Operations, and Maintenance. Gulf Equipment
Ferreau, H., Kirches, C., Potschka, A., Bock, H., and Diehl, Guides. Gulf Professional Publishing, 1 edition.
M. (2014). qpOASES: A parametric active-set algorithm Varón, M.P., Biazussi, J.L., Bannwart, A.C., Verde, W.M.,
for quadratic programming. Mathematical Programming and Sassim, N. (2013). Study of an electrical sub-
Computation. (in print). mersible pump (esp) as flow meter. In SPE Artificial
Hasan, A. and Imsland, L. (2014). Moving horizon esti- Lift Conference - Americas. Cartagena, Colombia.
mation in managed pressure drilling using distributed
models. In Proc. 2014 IEEE Conference on Control
Applications (CCA), 605–610.

146

You might also like