Preprint
Article

ESP Lifted Oil Field: Basic Model for Control, and Comparison of Simulation Tools

Altmetrics

Downloads

68

Views

14

Comments

0

A peer-reviewed article of this preprint also exists.

This version is not peer-reviewed

Submitted:

15 December 2023

Posted:

19 December 2023

You are already at the latest version

Alerts
Abstract
Optimal operation of petroleum production is important in a transition from energy systems based on fossil fuel to sustainable systems. One sub-process in petroleum production deals with transport from the (subsea) well-bore to a topside separator. A simple model in [] of Electric Submersible Pump [ESP] lifted production was previously streamlined into a dynamic model suitable for illustration of the dynamics of oil transport, as well for control studies, with some comparison of two popular modeling languages: Modelica, and ModelingToolkit for Julia, []. Here, the discussion on dimensionless equipment models goes into more detail, and the comparison between Modelica and ModelingToolkit is significantly expanded upon with code comparison, numerical performance, and more experiments. Some added possibilities with ModelingToolkit and Julia wrt. sensitivity analysis and control design is included.
Keywords: 
Subject: Engineering  -   Control and Systems Engineering

1. Introduction

1.1. Background

Petroleum products have been key energy carriers for more than a century. Current focus on climate1 implies a change towards sustainable energy carriers. To succeed in this change, a transition period from the use of fossil fuel is necessary. In the transition, improved operation of petroleum production through model based optimal operation will be necessary. Petroleum production entails slow (reservoir; months) and fast (reservoir-to-separator; seconds) subsystems; this is a focus of on-going research project “DigiWell”2. Vertical transport of petroleum from oil well to surface requires sufficient pressure to counteract gravitational and friction forces. If the oil-well heel pressure is insufficient for such transport, either (i) gas is injected in the vertical pipe to “blow” the petroleum fluids to the surface [“gas lifted”], or (ii) an Electric Submersible Pump [ESP] is installed in the vertical pipe to increase the pressure [“ESP lifted”] sufficiently. Here, the focus is on the dynamics of transport from the reservoir formation to a surface manifold via an ESP, and further horizontal transport from the manifold to a separator.
Industrial simulation tools typically put main emphasis on the dynamics of the reservoir (time constant: months) and use steady state models for the reservoir-to-surface transport. This emphasis is inadequate for daily operation and control. Here, a simplified, yet complete, dynamic model for oil transport from reservoir to separator is discussed. The model provides an understanding of the dynamic behavior of such systems, and is suitable for industrial control design, as well as for control and petroleum production studies. Emphasis is put on a simple, yet stringent model development, while avoiding variable unit complexities.

1.2. Previous work

Sharma and Glemmestad [1] (see also Sharma [3]) provide a dynamic model of oil transport from reservoir to separator suitable for control design. Binder et al. [4] discuss an older model; other models typically are CFD models, which are too complex for control design.
Sharma’s model considers a case with 4 vertical pipes from oil reservoirs to a single manifold, with 2 horizontal pipes from the manifold to a single separator. Each vertical pipe has an ESP and a choke valve at a common manifold entrance; the pump speeds can be manipulated individually. The horizontal pipes have booster pumps to counteract friction effects. The original ESP model includes induction motors, but the dynamics of the pump actuator is fast, and is neglected in later work. Sharma and Glemmestad [1] provide a novel ESP model, a simple model for a booster pump, and use a valve model based on on the ANSI/ISA S75.01 standard3. The model in Sharma and Glemmestad [1] was re-structured and simplified in Lie [2], emphasizing dimensionless equipment models, and thereby eliminating some level of complexity in common industry models.
The model with ESP in Sharma and Glemmestad [1] is mainly relevant for the production of heavy oil. Several papers use this model in advanced industrial control studies, Krishnamoorthy et al. [5], Delou et al. [6], Santana et al. [7].
Mixtures of liquid oil and water form an emulsion when stirred (e.g., in a multi-stage ESP); for such emulsions, the viscosity — and hence the friction — varies dramatically with water content, Justiniano and Romero [8]. Sharma and Glemmestad [1] assume an unrealistic linear viscosity dependence on water fraction.

1.3. Structure of paper

Section 2 gives an overview of the transport system from oil reservoir via manifold to a separator, and key equipment models. Section 3 develops a simple mechanistic model of the system. Section 4 contrasts two modeling languages for simulation: Modelica and Julia’s ModelingToolkit. Section 5 illustrates model behavior and the use of modeling/simulation tools for analysis and control. Finally, Section 6 provides some conclusions.

2. System description

Production of a mixture of water and crude oil in liquid phase is considered, where evaporation of liquids is assumed negligible.

2.1. System topology

Oil production systems merge several boreholes from the same or different reservoirs through vertical pipes into a manifold. Normally, more than one horizontal transport pipe is needed from the manifold to a separator for sufficient transport capacity. Water is commonly injected into the manifold to reduce friction loss in the horizontal pipes; the added water is typically recycled from the separator, and is at close to production temperature. Figure 1 shows a system with n w wells/vertical pipes via a common manifold to n t transportation/horizontal pipes leading to the separator.
In Figure  Figure 1 , p f j is formation pressure for well j, p h j is bore-hole heel pressure, V ˙ h j is volumetric heel flow rate, A v , j is vertical cross sectional area below the ESP pump, v , j is the length of the vertical pipe below the ESP pump, p p i , j is inlet pressure to the (ESP) pump, p p e , j is effluent pressure after the (ESP) pump, A v + , j is vertical cross sectional area above the ESP pump, v + , j is the length of the vertical pipe above the ESP pump, V ˙ c i , j is volumetric flow rate at the inlet to the choke valve, p c i , j is pressure at the inlet to the choke valve, p c e , j is pressure at the effluent from the choke valve. Next, p m is manifold pressure, while V ˙ w is water added to the manifold to reduce viscosity. At the outlet from the manifold, p bp i , j is the influent pressure to the booster pump (BP), p bp e , j is effluent pressure after the booster pump, V ˙ t j is volumetric flow rate in a transport pipe from manifold to separator, p s i , j is pressure at the inlet to the valve into the separator, and p s e , j = p s is the separator pressure.
For simplicity, it is assumed that A v , j = A v + , j = A v . All vertical pipes are assumed connected to the same manifold pressure p m ; hence effluent choke pressure satisfies p c e , j = p c e = p m for all j. The influent pressure to the booster pumps, p bp i , j are all assumed to be equal to the outlet pressure from the manifold, and have the same value, p bp i , j = p bp i = p m . Likewise, all transport pipes end up in the same separator: p s e , j = p s for all j.

2.2. Fluid properties

The petroleum fluid properties are important. Density ρ varies with pressure p and temperature T, ρ p , T . Neglecting temperature dependence, and assuming constant isothermal compressibility  β T ,4  ρ p is given as
ρ = ρ 0 exp β T p p 0
where ρ 0 , p 0 is some reference state.
Defining water cut χ w as χ w V ˙ w / V ˙ : volumetric flow rate of water divided by total flow rate of the fluid, total density ρ can be expressed as
ρ = χ w ρ w + 1 χ w ρ o ;
here, ρ w and ρ o are constant densities of pure water and crude oil, respectively.
In reality, water and crude oil have different isothermal compressibilities. Here, we simplify and assume an overall value for β T . Using data in Appendix A1, density ρ varies ca. 10 kg / m 3 with pressure variation in the range 25– 225 bar , Figure 2.
We thus assume constant density in pipes, but a pressure-dependent density will be assumed in the manifold.
Sharma and Glemmestad [1] propose a simple linear mixing rule for kinematicviscosity ν :
ν = χ w ν w + 1 χ w ν o .
With ν known, dynamic viscosity μ can be computed (if needed) as
μ = ν ρ .
The linear interpolation model of Eq. 3 is used here to ease comparison with results in Sharma and Glemmestad [1], even though it is not physically realistic [8].

2.3. Well-bore production

Total production from the reservoir (formation pressure p f ) relates volumetric petroleum fluid rate V ˙ h at the well-bore heel as V ˙ h p f p h , where p h is heel pressure and the proportionality constant C pi is the productivity index,
V ˙ h = C pi · p f p h ;
C pi is unit-dependent. Here, we instead propose a dimensionless form,
V ˙ h = V ˙ pi c p f p h p pi ς
where V ˙ pi c is the productivity index capacity in the same unit as V ˙ h , and p pi ς is scaling pressure with the same unit as p f , p h .

2.4. Pump models

Electric Submersible Pump 

Pump models are often given as
Δ p p = ρ g h p ;
here, h p = h p V ˙ , f p is pump head with volumetric flow rate V ˙ and control input f p — rotational pump frequency Hz .
Sharma and Glemmestad [1] provide values for minimal, maximal, and best-efficiency-point flow rates,
V ˙ min V ˙ min , 0 = f p f p , 0
V ˙ max V ˙ max , 0 = f p f p , 0
V ˙ η V ˙ η , 0 = f p f p , 0 .
In Sharma and Glemmestad [1], a comprehensive model for the pump head of a multi-stage ESP is developed. To ease change of units, their model is here rewritten in dimensionless form
h p V ˙ , f p h p , 0 = f p f p , 0 2 + j = 1 3 a j f p f p , 0 2 j V ˙ V ˙ ς j .
In Eq. 9, h p , 0 is a nominal scaling head, f p is the pump rotational frequency in the same unit as that of the nominal rotational frequency f p , 0 , V ˙ is the actual volumetric flow rate out of the pump, V ˙ ς a scaling flow rate, and a 1 , , a 3 are dimensionless model parameters5. Sharma and Glemmestad [1] include a head curve plot; the result in Figure 3 based on a dimensionless model is identical to their plot.
In addition, Sharma and Glemmestad [1] provide a model for the mechanical power requirement W ˙ p m = W ˙ p m V ˙ , f p for operating the pump6, again rewritten in dimensionless form,
W ˙ p m W ˙ p , 0 m = f p f p , 0 3 + j = 1 4 b j f p f p , 0 3 j V ˙ V ˙ ς j .
In Eq. 10, W ˙ p , 0 m is a nominal scaling power consumption to operate the pump, b 1 , , b 4 are dimensionless model parameters, while f p and V ˙ are as above.
The actual power added to the fluid is
W ˙ p = Δ p p V ˙ ,
which gives the efficiency as
η = W ˙ p W ˙ p m = Δ p p V ˙ W ˙ p m
where it is assumed that W ˙ p and W ˙ p m have the same units. Sharma and Glemmestad [1] include an efficiency curve plot; the result in Figure 4 based on a dimensionless model is identical to their plot.

Booster pump 

For the booster pump in horizontal pipes, a simpler model is suggested in Sharma and Glemmestad [1], rewritten in dimensionless form as
Δ p bp f bp Δ p bp , 0 = f bp f bp , 0 2
Here, Δ p bp f bp is the pressure increase at the given pump frequency/speed f bp , in the same unit as Δ p bp , 0 — which is the pressure increase at the nominal pump frequency f bp , 0 .

Pump control input 

In reality, the pump speed ( f p , f bp ) is not a control input. Instead, a motor is used to control the torque applied to the aggregate of motor and pump.
In Sharma [3], a model of the induction motor driving the ESP is developed. The experience [3] is that the motor dynamics is much faster than that of the mechanical system; hence in most of his work, Sharma [3] neglects the motor dynamics. However, it is not clear whether Sharma [3] considers the mechanical dynamics of accelerating the pump itself. This dynamics would be described by the kinetic energy balance in rotational form (the “swing equation”), which can be written as
d K d t = P i W ˙ p m
with kinetic energy K
K = 1 2 J t ω p 2 ,
J t is the total moment of inertia for the pump, the motor, and a possible flywheel, while P i is the input power from the motor (control input), and W ˙ p m is as in Eq. 10.
In Sharma [3], the moment of inertia is approximately given as J 71 kg m 2 . It is not clear whether this is the motor moment of inertia or the total moment of inertia. However, using such a moment of inertia leads to a pump time constant which is still much faster than the dynamics of the flow V ˙ v , etc., hence the pump/motor dynamics is neglected here, and for simplicity, it is assumed that f p is a control input.

2.5. Valve models

Sharma and Glemmestad [1] base their valve models on the ANSI/ISA S75.01 standard7. Here, instead a dimensionless description is proposed with extension to a control input,
m ˙ = m ˙ v c · f u v ρ i ρ e p i p e / p ς ρ i / ρ ς
where m ˙ v c is the valve mass flow rate capacity, u v 0 , 1 is the valve control signal, f : 0 , 1 0 , 1 is the valve characteristics, ρ i , ρ e are influent and effluent densities, respectively, p i , p e are influent and effluent pressures, respectively, while ρ ς , p ς are scaling density and pressure, respectively.

2.6. Friction loss

The friction drop along the pipe can be given by the Darcy-Weisbach model8 as
Δ p f = f D ρ 2 v 2 D
where f D is Darcy’s friction factor given by Colebrook’s9 implicit expression. One explicit approximation to Colebrook’s expression is due to Swamee and Jain [9],
1 f D = 2 · log 10 5.74 N Re 0.9 + ϵ / D 3.7 ,
where N Re is the Reynolds number,
N Re = ρ v D μ = v D ν ,
μ is dynamic viscosity, ν is kinematicviscosity, and ϵ is the “roughness height” of the pipe internal surface. Linear velocity v is related to volumetric flow rate V ˙ by
V ˙ = v A
where A is the cross-sectional area of the pipe.

2.7. Why dimensionless models?

Example: ESP pump model 

As a first example, consider the ESP model in Eq. 9. In the original formulation in Sharma and Glemmestad [1],10
h p = a ¯ 0 f p f p , 0 + a ¯ 1 f p f p , 0 V ˙ + a ¯ 2 V ˙ 2 + a ¯ 3 f p , 0 f p V ˙ 3 ,
where parameters a ¯ j have rather complicated units and the equation is hard-coded to assume11  V ˙ = gal / min , while h p = ft . In practice, either the rest of the model has to be posed using these units, or one has to operate with several copies of variables, e.g., V ˙ g / m and V ˙ , and remember to correctly convert between these versions of the flow rate. Both of these approaches are error-prone, and also require several versions of variables.
A much better solution is to write the model in dimensionless form. The simplest way to do this for the model in Eq. 19, is as
h p h p , 0 = a ˜ 0 f p f p , 0 + a ˜ 1 f p f p , 0 V ˙ V ˙ ς + a ˜ 2 V ˙ V ˙ ς 2 + a ˜ 3 f p , 0 f p V ˙ V ˙ ς 3 .
If we choose h p , 0 1 ft and V ˙ ς 1 gal / min , then a ˜ j a ¯ j . Suppose we want to generate the plot in Figure 3. Because that figure plots h p in ft (the “native” unit), while the flow rate V ˙ is given in bbl / d (“native” unit is gal / min ), this result is produced by choosing V ˙ ς = 1 gal / min = 34.29 bbl l / d , which can easily be found using the WolframAlpha app12, Figure 5.
In practice, it may be better to choose a more natural scaling unit, e.g., SI units. In that case, it is necessary to change parameters a ¯ j ; for the parameters in Eq. 9, the scaling parameters are in SI units, where a ¯ j a j and a j is given in Table A2. To find a j , choose h p , 0 = 1 ft = 0.3048 m , V ˙ ς = 1 gal / min = 6.309 · 10 5 m 3 / s , and write Eq. 20 as
h p h p , 0 a ˜ 0 h p , 0 = f p f p , 0 + a ˜ 1 a ˜ 0 V ˙ ς a 1 f p f p , 0 V ˙ + a ˜ 2 a ˜ 0 V ˙ ς 2 a 2 V ˙ 2 + a ˜ 3 a ˜ 0 V ˙ ς 3 a 3 f p , 0 f p V ˙ 3 ,
where the new h p , 0 is given in unit m , a 1 , a 2 , a 3 are the new, dimensionless parameters in Eq. 9, while new scaling flow rate V ˙ ς = 1 m 3 / s . With this modified correlation ( a 1 , , a 3 ) for h p using SI units, the dimensionless form is as in Eq. 9.

Example: control valve 

The ANSI/ISA S75.01 standard13 for compressible (i.e., m ˙ i = m ˙ e = m ˙ , ρ i ρ e ), non-choked fluids without fitting is
C = m ˙ N 6 ρ i ρ e p i p e ρ i .
Here, C is the valve coefficient, m ˙ is the mass flow rate through the valve, ρ i is the influent density, ρ e is the effluent density, p i is the influent pressure, p e is the effluent pressure, N 6 is used to handle unit conversion. Typically, tabular values for N 6 are given which are valid for different combinations of units for m ˙ , ρ , and p. This makes change of units rather complicated. A dimensionless formulation as in Eq. 14 greatly simplifies the use of the valve model in different units, and also includes a control valve characteristic.

3. Dynamic model

3.1. Balance laws

The model is based on the total mass balance (manifold) and the linear momentum balance (pipes). The total mass balance is expressed as
d m d t = m ˙ i m ˙ e
where m is accumulated mass in the system, t is time, m ˙ is mass flow rate, and indices i , e denote influent and effluent, respectively.
The linear momentum balance is
d m d t = m ˙ i m ˙ e + F ,
where m is linear momentum given as m = m v with linear velocity v, m ˙ is momentum flow rate given as m ˙ = m ˙ v , and F is total force. With constant fluid density, m ˙ i = m ˙ e , and the momentum balance reduces to Newton’s law, d m d t = F .

3.2. Vertical pipes with ESP

We assume constant density in the pipes, causing volumetric vertical flow rate V ˙ v to be the same everywhere: V ˙ h = V ˙ c i = V ˙ v . Furthermore, Eq. 23 reduces to Newton’s law. Momentum is given as m = m ˙ v with m ˙ = ρ V ˙ v , and v related to V ˙ v by Eq. 18. The total force is F = F p + F b F f F g , with
  • Pressure forces at inlet and outlet of the pipe,
    F p = p h A p c i A
  • Possible pressure boost due to a pump,
    F b = Δ p p A ,
    with Δ p p given by Eqs. 5, 9,
  • Friction loss,
    F f = Δ p f A ,
    with Δ p f given by Eqs. 15, 16, 17, 18,
  • Flow against gravity, with a vertical height h,
    F g = Δ p g A ,
    with
    Δ p g = ρ v g h .
In addition, we need information about how flow rate V ˙ v relates to the bottom hole pressure via the productivity index, Eq. 4, and how the flow rate V ˙ v relates to the choke valve flow, Eq. 14.
The most structured formulation would be to pose the momentum balance (here: Newton’s law) as the differential equation, and add all necessary algebraic equations. However, the OpenModelica DAE solver struggles with such a formulation: the valve equation Eq. 14 is implicit in pressure difference; in the iteration to find Δ p v = p i p e , if Δ p v becomes negative, the square root gives a complex number, and the simulation crashes.14 Instead, the differential variable has been changed to V ˙ v ; then the valve equation can be inverted and expressed as Δ p v V ˙ v 2 .
The following formulation is used in OpenModelica and ModelingToolkit:
d V ˙ v d t = p h p i c + Δ p p Δ p f Δ p g ρ v / A
ρ β 0 = χ w ρ w + 1 χ w ρ o
ν = χ w ν w + 1 χ w ν o
μ = ρ β 0 ν
ρ v = ρ β 0 exp β T p c i p β 0
p h = p f p pi ς V ˙ v V ˙ pi c
m ˙ v = ρ v V ˙ v
p i c = p m + p v ς ρ v ρ v ς m ˙ v m ˙ v c 2 1 f c 2 u v
h p = h p , 0 f p f p , 0 2 + a 1 f p f p , 0 V ˙ v V ˙ ς + a 2 V ˙ v V ˙ ς 2 + a 3 f p , 0 f p V ˙ v V ˙ ς 3
Δ p p = ρ v g h p
v v = V ˙ v A
N Re = v v d v ν v
f D v = 1 4 log 10 5.74 N Re 0.9 + ϵ v / d v 3.7 2
Δ p f = · f D v ρ v 2 v v 2 d v
Δ p g = ρ v g h .
If we only consider the model of a single vertical pipe, we need to specify (i) initial state (e.g., V ˙ v ), (ii) all “input” variables, i.e., p f , f p , p m , and possibly water cut χ w , and (iii) all parameters, i.e., ρ w , ρ o , ν w , ν o , p β 0 , , A, p pi ς , V ˙ pi c , p v ς , ρ v ς , m ˙ v c , h p , 0 , f p , 0 , V ˙ ς , a 1 , a 2 , a 3 , g, d v , ν v , ϵ v , h.

3.3. Manifold

We assume a perfectly mixed manifold. Assuming constant manifold volume V m , and adding water at flow rate V ˙ w to dilute the fluid to a specified manifold water cut χ w m , thus reducing friction loss in the pipe towards separator, V ˙ w must be approximately
V ˙ w = χ w m χ w 1 χ w m V ˙ v .
Total mass balance for the manifold can then be expressed as
d p m d t = 1 ρ m V m β T ρ v V ˙ v + ρ w V ˙ w ρ m V ˙ t
ρ β 0 = χ w m ρ w + 1 χ w m ρ o
ρ m = ρ β 0 exp β T p m p β 0
V ˙ w = χ w m χ w 1 χ w m V ˙ c i
In practice, the water cut χ w and flow rate V ˙ c i are not known perfectly, and it is necessary to use a feedback control system to manipulate V ˙ w instead of using Eq. 44.
For the manifold model, we must know (i) the initial manifold pressure, (ii) the vertical inflow V ˙ v and the horizontal transport flow V ˙ t from manifold to separator, as well as manifold water cut χ w m , and (iii) parameters.

3.4. Transport pipe

For simplicity, we will neglect the separator inlet valve, and assume that p s i , j p s . It is straightforward to reverse this assumption.
The model of the horizontal pipe from manifold to separator is almost identical to the vertical pipe from reservoir to manifold. The essential differences are (i) no gravity pressure drop, (ii) simpler booster pump model, (iii) neglecting pressure drop from pipe into separator, (iv) no need for a production index model. The complete model is
d V ˙ t d t = p m p s + Δ p bp Δ p f t ρ t t / A t
ρ β 0 , t = χ w m ρ w + 1 χ w m ρ o
ν t = χ w m ν w + 1 χ w m ν o
μ t = ρ β 0 , t ν t
ρ t = ρ β 0 exp β T p m p β 0
Δ p bp = Δ p bp , 0 f bp f bp , 0 2
v t = V ˙ t A t
N Re , t = v t d t ν t
f D t = 1 4 log 10 5.74 N Re , t 0.9 + ϵ t / d t 3.7 2
Δ p f t = t · f D t ρ t 2 v t 2 d t .
Again, we need to know the initial condition of the differential variable ( V ˙ t ), the inputs ( χ w m , f bp , p m , p s ), and the parameters.

3.5. Combined model

For illustration, we use two vertical pipes, one manifold, and one horizontal transport pipe from manifold to separator; Sharma and Glemmestad [1] use 4 vertical pipes, one manifold, and two horizontal transport pipes. Both Modelica and Julia’s ModelingToolkit have support for building classes/reusable models. Because of the similarity between the models for vertical and horizontal pipes, it would be possible to collect these in the same class/constructor and just differentiate between them with a function argument. The manifold model should be a separate class, though.
With re-usability of such classes/constructors, modeling of the combined system simply consists of (i) instantiating one model per unit (2 vertical pipes, one horizontal transport pipe, and the manifold), and (ii) connecting the various instances. Specifically, the vertical pipes should see the same manifold pressure p m , the vertical transport pipe should have the same inlet pressure as the manifold pressure p m , the influent volumetric flows to the manifold should be the sum of the flows from the vertical pipes and the viscosity diluting water feed V ˙ w now being
V ˙ w = i = 1 2 χ w m χ w i V ˙ v i 1 χ w m ;
the effluent volumetric flow from the manifold is still V ˙ t .
For a proper re-usable implementation, connections should be done using connectors (supported by both Modelica and ModelingToolkit). Connectors are not implemented here.

4. Simulation tools

Modelica is a mature language dating back to the 1990s; ModelingToolkit [MTK] is some 4–5 years old and is still evolving rapidly. MTK is more general than Modelica, and is also integrated in the larger eco-system of Julia. Currently, MTK does not support a graphical flow-sheeting tool, and it is unclear whether MTK allows for as large models as OpenModelica. Both tools have extensive support for building libraries.
The combined model has been solved using the free languages/tools OpenModelica [10,11] and ModelingToolkit [12] for Julia. To illustrate the similarity between OpenModelica code and a current formulation using ModelingToolkit, the following listing shows parts of the Modelica code for the reservoir heel–to–manifold; to save space, description of quantities is only included for constant π to illustrate how it is done:
Preprints 93461 i001
Next, the following listing shows similar parts of the ModelingToolkit code for the reservoir heel–to–manifold:
Preprints 93461 i002
Preprints 93461 i003
These listings show that Modelica code and ModelingToolkit code have a high degree of similarity. A few things to note:
  • In Modelica, the independent temporal variable has a fixed name (time), and the time differentiation operator has a fixed name (der). In ModelingToolkit, both of these can be freely named by the user. In order to make unit models work together (e.g., in a standard library), it is, however, necessary to standardize on a name for time (commonly t); differentiation can be given a name as, e.g., Dt = Differential(t) or similar.
  • In Modelica, quantities need to be specified with a type (e.g., Real), and are prepended with a qualifier (e.g., constant, parameter) — except for variables. For Julia and ModelingToolkit, the data type is inferred, unless explicitly stated. In the code above, quantities in MTK are grouped within begin...end blocks in macros (identifiers prepended by @, e.g., @parameters).
  • Modelica has a simple way to handle implicit algebraic equations, and in many cases an initial guess of the algebraic variable is not required (see variable p_c_ _i in the Modelica code). In ModelingToolkit, initial values for unknowns after structural simplification (“states”) must be provided with numeric values (see variable p_c_ _i in the MTK code).
  • In ModelingToolkit, initial values of differential variables can be changed outside of the code, hence default values can be written as Vd_v(t)=23.15e-3. In Modelica, only parameters can be changed outside of the code (after compilation), hence a parameter has been defined to hold the default initial value Vd_v(start = Vd_v0, fixed = true.
  • Modelica uses symbol = for mathematical equality; MTK uses symbol ~ since Julia already uses symbol = for assignment.
The default solver in OpenModelica is excellent, although here it struggled if the model is posed as a DAE formulation with momentum as differential variable. ModelingToolkit can use solvers from the large, high quality DifferentialEquations.jl package [13]. With ModelingToolkit, more thought is currently required when choosing solver, accuracies, etc., compared to OpenModelica. Also, OpenModelica handles step-changes in inputs well, while for the DifferentialEquations.jl solvers, it is often necessary to specify the time points where step changes occur. On the other hand, the solutions from ModelingToolkit include interpolation functions, which yields smooth solutions with considerably fewer data points than for Modelica.
Results presented in Section 5 compare numerical solutions for the Reservoir heel–to–Manifold system for ModelingToolkit vs. OpenModelica.
OpenModelica’s support for linearization and plotting can be accessed from Julia via the OMJulia API [14]. ModelingToolkit is integrated in the Julia eco-system, with support for linearization, plotting, control systems analysis, random variables, etc., and has overall more possibilities that OpenModelica if further analysis is required.
OpenModelica is currently reported to handle models up to approximately 10 6 variables/equations; various conference presentations indicate that ModelingToolkit currently can solve models of up to approximately 10 5 variables/equations.15 The model above (Reservoir_2_Manifold) is reported by OpenModelica to have 15 variables (differential+algebraic) and 15 equations. In ModelingToolkit, linear equations with “observed” variables are stripped off from the model (function structural_simplify()) before solving the model. The above Reservoir_2_Manifold model in the listing is reported to have 2 “states” and 2 equations by ModelingToolkit. It is not clear whether the ModelingToolkit claim of 10 5 variables/equations is before or after the “observed” variables are stripped off.
Other commonly used languages for scientific computing are MATLAB (commercial) and Python (free). Compared to both of these languages, Julia (free) has a more extensive set of differential equation solvers16. Neither MATLAB nor Python offer equation based modeling languages with library/re-use support such as Modelica or ModelingToolkit; MathWorks do offer Simscape17 (commercial) with MATLAB integration for such use, though.

5. Results

5.1. Reservoir heel to manifold

Parameters, initial conditions, and system inputs are given in Appendix A. Figure 6 shows the input variation for the Reservoir heel–to–manifold (R2M) case.
A step change in the formation pressure (red curve) as in Figure 6 is not very realistic; such changes are normally slow. The manifold pressure (blue curve) is not normally an input function, but rather a dependent variable in the overall system as in Section 5.2, and thus also normally varies slowly. The pump speed (green curve) is, however, a control variable, and can change fast. Still, the inputs in Figure 6 will help provide useful information about time constants in the system.
Figure 7 shows the response in (vertical) volumetric flow rate V ˙ v , with comparison between Julia (red, solid) and OpenModelica (blue, dash-dot).
An important observation is that the volumetric flow rate is continuous under the step changes in Figure 6. This makes sense, in that the momentum of the fluid (oil-water) is substantial. Time constants are in the range of 0.2 0.5 s .
Figure 8 shows the response in the choke valve inlet pressure, p c i .
Observe that the choke valve inlet pressure normally is continuous under step changes, but that it changes discontinuously upon a step change in manifold pressure at t = 1.5 s . Again, this makes sense: when the manifold pressure drops, Figure 6, the choke valve inlet pressure must also drop in proportion so that the flow through the valve changes continuously, see Eq. 14.
Figure 9 shows the response in the reservoir pressure heel, p h .
As noted, the formation pressure can not change in a step, but if it does, the well heel pressure must also change in proportion (i.e., discontinuously) to maintain continuity in the flow rate.
Figure 10 shows the response in the ESP pump pressure head, Δ p p .
Again, the discontinuous change in pump pressure head is due to the step change in the manifold pressure, and the result makes sense.
So far, ModelingToolkit/Julia and OpenModelica have given (seemingly) identical simulation results, Figure 7, Figure 8, Figure 9 and Figure 10. Figure 11 shows the pipe friction loss, Δ p f .
It is interesting to contrast the magnitude of the friction loss in Figure 11 and how much smaller it is than the pressure boost in the ESP, Figure 10. Obviously, if a more realistic viscosity model had been used, and in particular if emulsification occurs [8], the friction pressure drop might increase considerable with an unfortunate mixing fraction of oil and water.
Apart from this, it is interesting to observe a slight discrepancy between the result from ModelingToolkit/Julia and OpenModelica in this case. This discrepancy is maintained during a multitude of tests with different solvers and accuracy for the DifferentialEquation.jl solvers [13] and the solvers supported by OpenModelica. It seems like there is a minor discrepancy at t = 0 for Δ p f , which propagates throughout the solution. Because the codes and initial conditions are the same for both implementations, a natural suspicion is that the difference is due to different handling of the implicit algebraic equation at initial time, and that Δ p f is rather sensitive to such an inaccuracy.

5.2. Reservoir heel to separator

Parameters, initial conditions, and system inputs are given in Appendix A. For vertical pipe #2, scaling pump head h p , 0 is set to 80% of the value suggested in Appendix A. For this more complete system (2 vertical pipes, one horizontal transport pipe), there is no observed difference between the solution from ModelingToolkit/Julia and OpenModelica.
Figure 12 shows the input variation for the Reservoir heel–to–separator (R2S) case; because of slower dynamics for this larger system, the locations of the step changes have been changed, and the step change in the manifold pressure (Figure 6) has been replaced by a step change in the separator pressure (Figure 12).
For comments on formation pressure and pump speed inputs, see Section 5.1. Although the separator pressure is not normally an input function, there may be action applied to the separator that may create relatively quick changes in the separator pressure.
Figure 13 shows the pressures in front of the choke valves for the vertical pipes, as well as the manifold pressure.
Figure 13 demonstrates the positive pressure drop over the choke valves, and that they are different for the two valves ( Δ p c j = p c i , j p m ). Therefore, one should expect different flows through the two valves. Because the manifold pressure is a dependent (dynamic) variable in this case, there is no discontinuity in the pressures of Figure 13.
Figure 14 displays the pressure increase over the ESP pumps in the two vertical pipes.
In this figure, the sudden drop in Δ p p is due to a sudden change in the pump speed f p , and is thus realistic.
Figure 15 shows the friction pressure drops in the two vertical pipes and in the horizontal pipe.
Here, the interesting thing is that there is no visible difference between OpenModelica and Julia solution of Δ p f for the three pipes; confer Figure 11. Of course, this could be due to the zoomed-out view, but also on close inspection of Δ p f for the initial few seconds for vertical pipe 1, there is virtually no difference.
The resulting time constants and overall behavior in Figure 13, Figure 14 and Figure 15 are similar to those in Sharma [3]. Particularly in Figure 13 and Figure 14, some oscillatory behavior/overshoot is noticeable. This is to be expected due to the elasticity of the oil/water mixture with the given non-zero value of isothermal compressibility β T .
Figure 16 shows vertical flow rates from reservoir to manifold in the two pipes, as well as the flow from manifold to separator (thick, solid lines), and the effect of uncertain productivity indices in Well 1, V ˙ pi c , 1 N 7 · 10 4 , 10 4 , and uncertain isothermal compressibility in the petroleum fluid, β T U 0.3 / 1.5 · 10 9 , 3 / 1.5 · 10 9 ) .
ModelingToolkit has support for efficient Monte Carlo studies; this is comparatively more complicated using Modelica + OMJulia.

5.3. Linearized model

ModelingToolkit.jl has good support for linearization of models. To linearize a system, it is necessary to provide a model where the inputs have not been defined (sys_p in Figure 17), a vector of input variables (sys_in), a vector of output variables (sys_in), and an operating point (keyword op, value op_0). If the ModelingToolkitStandardLibrary.jl (similar to Modelica’s Standard Library) is used, alternatively, some “virtual” inputs/outputs can be added in the form of Analysis Points which simplifies linearization; this is not discussed further here.
In Figure 17, linearization is performed using the named_ss function in ControlSystemsMTK.jl, which has similar arguments as function linearize in ModelingToolkit.jl.
Figure 17 suggests 6 poles/states in the system, and 3 transmission zeros. Obviously, the system has 4 states/differential variables (flow rates V ˙ v for each of the vertical pipes, pressure p m for the manifold, and flow rate V ˙ t for the horizontal transport pipe). Comparing poles and zeros, one might suspect that two spurious/“infinitesimal” poles have been added together with two spurious/“infinitesimal” zeros, and that canceling out the tiny poles and zeros should give the correct transfer function. Observe also that there is a finite zero at 7.27 that cancels out one of the 4 true eigenvalues.
It is possible to write one’s own linearization code using a (symbolic) Jacobian function applicable to ModelingToolkit.jl models. If one assumes that the original model is a DAE of index 0 or 1, this will indeed give the correct transfer function with 4 states (and one zero that cancels out one of the eigenvalues). Why does ModelingToolkit.jl produce spurious additional poles/zeros? Possibly because the linearization algorithm in ModelingToolkit.jl makes no assumption of the index of the DAE, thus producing the two spurious “infinitesimal” poles/zeros.
Figure 18 shows the Bode plot of the transfer function from ESP rotational speed ( f p )18 to flow rate into the separator ( V ˙ t ), as found using Julia + ModelingToolkit.jl based on the transfer function provided by the system in Figure 17. Package ControlSystems.jl also has a function balance_statespace() which in combination with minimal realization provides a transfer function with 3 poles or 1 time constant and one damped resonator,
P s 1.094 · 10 3 1 + 0.15 s 1 + 2 · 0.489 s 1.06 + s 1.06 2 ;
see pale curves in Figure 18.
It is possible to instead use Modelica+OMJulia for linearization, and then use ControlSystems.jl for Julia [similar capabilities as MATLAB’s Control Toolbox] for plotting and analysis/design. However, control analysis and design is simpler to do if a Julia set-up is used also for modeling and simulation.

5.4. Single-loop controller tuning

Figure 19 shows a unit step response for the linearized model using convenience function step() in package ControlSystems.jl.
A crude approximation of the system is read off Figure 19 as the plant transfer function P s
P s = K exp τ s s
with
K 6.27 · 10 3 τ 0.5 .
A PI controller
C s = K p 1 + T i s T i s
based on Skogestad’s method [15,16,17] is used with
T = 1.3 · τ
κ = 4
K p = 1 K τ + T
T i = κ τ + T ;
where tuning parameters are: T , closed loop time constant; κ , integral time modifier.
Figure 20 shows a unit reference step response for the closed loop system [blue line]; here, utility function feedback(P*C) has been used to construct the closed-loop system. Observe that the closed loop time constant T is not achieved, and that the resulting system is rather oscillatoric.
The reason for the oscillatoric behavior is that single-loop tuning methods are not designed for oscillatoric systems as the one in Eq. 60.

5.5. Double-loop controller tuning

In order to better handle the oscillatoric behavior of the system, which has generic form
P ζ s = K 1 + T 1 s 1 + 2 ζ s ω 0 + s ω 0 2 ,
an idea of Nandong [18] is pursued, where the control signal is split into an “inner” control signal
u i = C i s y
and an “outer” control signal u o ,
u = u i + u o
where first C i is designed to reduce the oscillations in the system.
Consider the following proper inner controller
C i s = K c i 1 + T 1 s 1 + α T 1 s ;
Inserting controller Eq. 68 into y = P ζ s u with u as in Eq. 69 and P ζ s as in Eq. 67 leads to,
y = P ζ s u = P ζ s C i s y + u o 1 + P ζ s C s y = P s u o
which after some re-arrangement gives:
1 + K K c i 1 + α T 1 s + 2 ζ s ω 0 + s ω 0 2 y = K 1 + T 1 s u o .
For small values of α , α 0 :
1 + K K c i + 2 ζ s ω 0 + s ω 0 2 = 1 + K K c i × × 1 + 2 ζ i s ω i + s ω i 2
where closed loop damping ζ i given by
ζ i = ζ / 1 + K K c i K c i = ζ / ζ i 2 1 K .
A design procedure could thus be:
  • Specify inner loop damping, ζ i 1 to provide (over-) damping.
  • Compute inner gain K c i from Eq. 71.
  • Choose a “small” value for α to make the above design valid.
We choose ζ i = 1 , and compute K c i from Eq. 71. Next, closing the loop from u o to y where we allow for α > 0 to have a realizable controller, the step response is as in Figure 21.
Based on closed inner loop with α = 0.1 as in the lower plot of Figure 21, we find model parameters in the model of Eq. 61 to be:
K 0.762 · 10 3 τ 0.5 .
Tuning an outer loop PI controller with Skogestad’s method with an integrator + delay approximation, this time with T = 2 · τ , the result is as in Figure 20, red curve. Although the result is considerable faster than what is achieved with the single-loop controller (same figure, blue curve), the result is surprisingly oscillatoric.
It is interesting to observe that with the same value for T = 2 · τ , and changing α from α = 0.1 to α = 5 , this gives a considerably better response, Figure 20, green curve.

5.6. Controller implementation with nonlinear model

The inner loop controller of Eq. 68 with C i s as in Eq. 70 admits the following state space realization
d z i d t = 1 α T 1 z i + y u i = K c i α 2 T 1 1 α z i K c i α y ,
where we must require α > 0 . The PI controller for the outer loop as in Eq. 62 admits the following state space realization:
e = r y d z o d t = 1 T i o e u o = K p o e + z o .
With y V ˙ t as input to the controller together with a reference value r V ˙ t ref , the controller produces output u = u i + u o f p and is straightforward to implement in ModelingToolkit (or Modelica) and connect with the reservoir-to-separator model. Using the inner-outer model with α = 5 , starting in steady state and injecting a step change in V ˙ t ref gives the response as in Figure 22.
The response in Figure 22 [red curve] is similar to the corresponding response [green curve] in Figure 20.
The response in Figure 22 is achieved with an ESP pump speed as in Figure 23.
In reality, it is not possible to “require” more production than the reservoir can produce. To handle this correctly, a more complex interaction with the reservoir than the productivity index model is required.

6. Conclusions

Sharma and Glemmestad [1], Sharma [3] provided a novel model of an ESP-lifted oil production system from reservoir to separator. In Lie [2], the model of Sharma and Glemmestad [1] was provided with a more structured model development, and with dimensionless equipment models. Also, some information that is difficult to find in the original publications (e.g., ESP model parameters) was included. A basic comparison of equation based modeling languages Modelica and ModelingToolkit for Julia was given.
Here, the work in Lie [2] is extended in several directions: (i) a couple of model typos in [2] are corrected, (ii) some more fluid details are given, (iii) more details of the ESP model is provided for reference (max/min flow rates, power consumption, efficiency), (iv) an extended discussion of pump control inputs is included, (v) a more thorough discussion is given of advantages with dimensionless models, (vi) a more detailed comparison of model implementation in Modelica vs. ModelingToolkit is provided, (vii) with a comparison of simulation results using OpenModelica vs. ModelingToolkit with Julia, (viii) more simulation results are included for reference, (ix) model linearization using ModelingToolkit with ControlSystems.jl for Julia is discussed, (x) controller tuning for the linearized model is illustrated using Skogestad’s method applied to a simple integrator+time delay approximation, as well as a double-loop design to dampen oscillations, (xi) the double-loop controller is applied to the nonlinear ModelingToolkit model to confirm the controller tuning. Model parameters, inputs, and initial states are provided in Appendix A.
A key difference between the model description here and the original one [1] is the focus on dimensionless models, which greatly reduces the chance of errors. The inclusion of the ESP power consumption model and flow rate constraints/best-efficiency-point for reference, makes it possible with realistic studies of constraints in controller design. Although not implemented here, an extension of more realistic pump control inputs by inclusion of the pump-motor aggregate moment of inertia is discussed. For some systems, such an extension may be of interest.
Both Modelica and ModelingToolkit are suitable and free languages for structured model development. Modelica is a mature language and a good choice, while ModelingToolkit is a more general language with an extensive eco-system. Model implementation is very similar for the two languages; ModelingToolkit does support more general model classes such as distributed models, stochastic models, etc., and has an extensive tool-set for control design, optimization, model fitting, etc. The numeric solutions are virtually identical for the two implementations; a minor discrepancy in friction pressure loss in one case is most likely due to a difference in handling implicit algebraic equations.
Model linearization is provided by both OpenModelica and ModelingToolkit for Julia; in the case of ModelingToolkit, the eco-system of Julia for further analysis and design can directly be used, while for OpenModelica, the linearization can be carried out via a script language API (e.g., from Julia, Python, or MATLAB) and analyzed in the host language.
For illustration purpose, linearization of the system from ESP pump speed to volumetric separator flow using ModelingToolkit/ControlSystems.jl is carried out in Julia. Then, several linear controllers are developed based on Skogestad’s method for an integrator+time delay model approximation, as well for a double-loop controller to dampen oscillations in the system caused by the compressible fluid in the manifold. A re-tuning of the double-loop controller with Skogestad’s method in the outer loop gives best performance. Implementation of the best controller in ModelingToolkit confirms that the linear controller works well with the nonlinear reservoir-to-separator system under the simulated experimental conditions.
The model development and discussion indicates a number of possible extensions such as (a) more realistic properties (density, viscosity), (b) allowing for distributed density along pipes19, (c) adding a more realistic system for water dilution in the manifold, (d) inclusion of valves in manifold–separator pipes, (e) integration with reservoir models, (f) use for advanced control design with constraints, (g) use for optimization, (h) integration with a reservoir model to study how to handle stiffness, and more Such extensions will give more insight into the industrial usefulness of the model.

Funding

The economic support from The Research Council of Norway and Equinor ASA through Research Council project “308817 —Digital wells for optimal production and drainage” (DigiWell) is gratefully acknowledged.

Acknowledgments

Information/data for the original paper [1] provided by dr. Roshan Sharma and Ph.D. student Kushila Jayamanne, both at University of South-Eastern Norway, is gratefully acknowledged.

Conflicts of Interest

The author declares no conflict of interest. The background information for the study predates the funded project, and is openly available. Although the study is relevant to the funded project [DigiWell], the funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
CFD Computational Fluid Dynamics
ESP Electric Submersible Pump
MTK ModelingToolkit
R2M Reservoir heel-to-Manifold
R2S Reservoir heel-to-Separator

Appendix A. Parameters and Operating Conditions

Parameters for petroleum fluid, nominal vertical pipes, and nominal manifold+horizontal pipe are given in Table A1, Table A2 and Table A3. Initial states are given in Table A4, while input functions are given in Table A5.
Table A1. Parameters: petroleum liquid.
Table A1. Parameters: petroleum liquid.
Parameter
β T = 1 1.5 · 10 9 6.67 · 10 10 P a 1
p 0 = 1 bar
ρ o = 900 kg / m 3
ρ w = 1000 kg / m 3
χ w = 0.35
ρ 0 = χ w ρ w + 1 χ w ρ o
χ w m = 0.5
ρ 0 m = χ w m ρ w + 1 χ w m ρ o
ν o = 100 cst = 100 · 10 6 m 2 / s
ν w = 1 cst = 10 6 m 2 / s
Table A2. Parameters: vertical pipe.
Table A2. Parameters: vertical pipe.
Parameter
= 100 m
+ = 2000 m
d = 0.1569 m
ϵ = 0.0018 inch = 45.7 - m = 45.7 · 10 6 m
V ˙ min , 0 = 14.43 · 10 3 m 3 / s
V ˙ η , 0 = 19.83 · 10 3 m 3 / s
V ˙ max , 0 = 25.24 · 10 3 m 3 / s
h p , 0 = 1210.6 m
f p , 0 = 60 Hz
V ˙ ς = 1 m 3 / s
a 1 = 37.57
a 2 = 2.864 · 10 3
a 3 = 8.668 · 10 4
W ˙ p , 0 m = 167.733 kW
b 1 = 52.12
b 2 = 768.7
b 3 = 38.544 · 10 3
b 4 = 1.534 · 10 6
m ˙ v c = 25.9 · 10 3 kg / h
f u v = 0 , u v 0.05 11.1 u v 0.556 30 , 0.05 < u v 0.5 50 u v 20 30 , 0.5 < u v 1
p ς = 1 bar
ρ ς = 1000 kg / m 3
V ˙ pi c = 7 · 10 4 m 3 / s
Table A3. Parameters: manifold+horizontal pipe.
Table A3. Parameters: manifold+horizontal pipe.
Parameter
m = 500
d m = 0.1569
t = 4000 m
d t = 0.1569 m
ϵ = 0.0018 inch = 45.7 - m = 45.7 · 10 6 m
Δ p bp , 0 = 10 bar
f bp , 0 = 60 Hz
Table A4. Nominal initial states.
Table A4. Nominal initial states.
Variable
V ˙ v t = 0 = 2000 m 3 / d 0.02315 m 3 / s
p m t = 0 = 50 bar = 50 · 10 5 Pa
V ˙ t t = 0 = 2000 m 3 / d 0.02315 m 3 / s
Table A5. Nominal inputs.
Table A5. Nominal inputs.
Variable
p f t = 220 bar , t < 0.5 s 0.95 · 220 bar , t 0.5 s
p s t = 30 bar , t < 3 s 0.97 · 30 bar , t 3 s
f p t = 60 Hz , t < 5 s 0.95 · 60 Hz , t 5 s
u v t = 1.0
f bp = 60 Hz

References

  1. Sharma, R.; Glemmestad, B. Modeling and Simulation of an Electric Submersible Pump Lifted Oil Field. International Journal of Petroleum Science and Technology 2014, 8, 39–68. [Google Scholar]
  2. Lie, B. ESP Lifted Oil Field: Core Model, and Comparison of Simulation Tools. Scandinavian Simulation Society 2023, pp. 159–166. [CrossRef]
  3. Sharma, R.Optimal Operation of Gas Lifted and ESP Lifted Oil Fields: An Approach Based on Modeling, Simulation, Optimization and Control. PhD thesis, University of South-Eastern Norway, Kjølnes Ring 56, N-3918 Porsgrunn, Norway, 2014.
  4. Binder, B.J.T.; Pavlov, A.; Johansen, T.A. Estimation of Flow Rate and Viscosity in a Well with an Electric Submersible Pump Using Moving Horizon Estimation. IFAC-PapersOnLine 2015, 48–6, 140–146. [Google Scholar] [CrossRef]
  5. Krishnamoorthy, D.; Bergheim, E.M.; Pavlov, A.; Fredriksen, M.; Fjalestad, K. Modelling and Robustness Analysis of Model Predictive Control for Electrical Submersible Pump Lifted Heavy Oil Wells. IFAC-PapersOnLine 2016, 49–7, 544–549. [Google Scholar] [CrossRef]
  6. Delou, P.d.A.; de Azevedo, J.P.A.; Krishnamoorthy, D.; Jr, M.B.d.S.; Secchi, A.R. Model Predictive Control with Adaptive Strategy Applied to an Electrical Submersible Pump in a Subsea Environment. IFAC PapersOnLine 2019, 52–1, 784–789. [Google Scholar] [CrossRef]
  7. Santana, B.A.; Fontes, R.M.; Schnitman, L.; Martins, M.A.F. An Adaptive Infinite Horizon Model Predictive Control Strategy Applied to an ESP-lifted Oil Well System. IFAC PapersOnLine 2021, 54–3, 176–181. [Google Scholar] [CrossRef]
  8. Justiniano, M.; Romero, O.J. Inversion Point of Emulsions as a Mechanism of Head Loss Reduction in Onshore Pipeline Heavy Oil Flow. Brazilian Journal of Petroleum and Gas 2021, 15, 13–24. [Google Scholar] [CrossRef]
  9. Brkić, D. Review of Explicit Approximations to the Colebrook Relation for Flow Friction. Journal of Petroleum Science and Engineering 2011, 77, 34–48. [Google Scholar] [CrossRef]
  10. Fritzson, P. Principles of Object-Oriented Modeling and Simulation with Modelica 3.3: A Cyber-Physical Approach, second ed.; Wiley-IEEE Press: Piscataway, NJ, 2015.
  11. Fritzson, P.; Pop, A.; Asghar, A.; Bachmann, B.; Braun, W.; Braun, R.; Buffoni, L.; Casella, F.; Castro, R.; Danós, A.; Franke, R.; Gebremedhin, M.; Lie, B.; Mengist, A.; Moudgalya, K.; Ochel, L.; Palanisamy, A.; Schamai, W.; Sjölund, M.; Thiele, B.; Waurich, V.; Östlund, P. The OpenModelica Integrated Modeling, Simulation and Optimization Environment. Proceedings of the 1st American Modelica Conference; LIU Electronic Press, www.ep.liu.se: Cambridge, MA, USA, 2018.
  12. Ma, Y.; Gowda, S.; Anantharaman, R.; Laughman, C.; Shah, V.; Rackauckas, C. ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling. arXiv 2021. [Google Scholar] [CrossRef]
  13. Rackauckas, C.; Nie, Q. DifferentialEquations.Jl — A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia. Journal of Open Research Software 2017, 5. [Google Scholar] [CrossRef]
  14. Lie, B.; Palanisamy, A.; Mengist, A.; Buffoni, L.; Sjölund, M.; Asghar, A.; Pop, A.; Fritzson, P. OMJulia: An OpenModelica API for Julia-Modelica Interaction. Proceedings of the 13th International Modelica Conference, 2019, pp. 699–708. [CrossRef]
  15. Skogestad, S. Simple Analytic Rules for Model Reduction and PID Controller Tuning. Journal of Process Control 2003, 13, 291–309. [CrossRef]
  16. Skogestad, S. Simple Analytic Rules for Model Reduction and PID Controller Tuning. Modeling, Identification and Control: A Norwegian Research Bulletin 2004, 25, 85–120. [Google Scholar] [CrossRef]
  17. Haugen, F. Comparing PI Tuning Methods in a Real Benchmark Temperature Control System. Modeling, Identification and Control 2010, 31, 79–91. [Google Scholar] [CrossRef]
  18. Nandong, J. Double-Loop Control Structure for Oscillatory Systems: Improved PID Tuning via Multi-Scale Control Scheme. 2015 10th Asian Control Conference (ASCC). IEEE, 2015. [CrossRef]
1
2
DigiWell: see Funding.
3
4
Isothermal compressibility is the inverse of bulk modulus.
5
Here, a j is dimensionless, while in Sharma [3] his parameters a j have dimensions. This implies that the values of a j here are different from those of a j in Sharma and Glemmestad [1].
6
“Brake Horse Power”, BHP, in the original publication.
7
8
E.g., https://en.wikipedia.org/wiki/ Darcy%E2%80%93Weisbach_equation
9
The Colebrook equation, or sometimes known as the Colebrook-White equation.
10
Slight change in notation.
11
With quantity x, x is the unit of the quantity.
12
E.g., Microsoft Store
13
14
It was not tested whether ModelingToolkit can handle this implicit algebraic equation.
15
On-going work on a JuliaSimCompiler.jl for a commercial extension of Julia will increase the possible system size.
16
Julia’s DifferentialEquations.jl package can be accessed from Python and R.
17
18
It is assumed that the same speed is used for both ESP:s in the vertical pipes.
19
ModelingToolkit for Julia has support for automatic discretization of PDEs.
Figure 1. Multiple well system with n w wells — possibly coming from different reservoirs, and n t transport pipes to the separator; from Lie [2] and based on Sharma and Glemmestad [1].
Figure 1. Multiple well system with n w wells — possibly coming from different reservoirs, and n t transport pipes to the separator; from Lie [2] and based on Sharma and Glemmestad [1].
Preprints 93461 g001
Figure 2. Typical variation in density for production fluid in the pressure range of interest.
Figure 2. Typical variation in density for production fluid in the pressure range of interest.
Preprints 93461 g002
Figure 3. ESP Pump head in ft as a function of volumetric flow rate in bbl / d for selected pump speeds. Lower, best-efficiency-point, and maximum flow rates are indicated.
Figure 3. ESP Pump head in ft as a function of volumetric flow rate in bbl / d for selected pump speeds. Lower, best-efficiency-point, and maximum flow rates are indicated.
Preprints 93461 g003
Figure 4. ESP Pump efficiency curve as a function of volumetric flow rate in bbl / d for selected pump speeds. Best-efficiency-point flow rates are indicated, and they match the peaks in the η V ˙ ; f p plots.
Figure 4. ESP Pump efficiency curve as a function of volumetric flow rate in bbl / d for selected pump speeds. Best-efficiency-point flow rates are indicated, and they match the peaks in the η V ˙ ; f p plots.
Preprints 93461 g004
Figure 5. Converting scaling flow rate V ˙ ς from 1 gal / min to bbl / d .
Figure 5. Converting scaling flow rate V ˙ ς from 1 gal / min to bbl / d .
Preprints 93461 g005
Figure 6. Input variation in experiment.
Figure 6. Input variation in experiment.
Preprints 93461 g006
Figure 7. Response in volumetric flow rate to step inputs.
Figure 7. Response in volumetric flow rate to step inputs.
Preprints 93461 g007
Figure 8. Response in choke valve inlet pressure to step inputs.
Figure 8. Response in choke valve inlet pressure to step inputs.
Preprints 93461 g008
Figure 9. Response in well heel pressure to step inputs.
Figure 9. Response in well heel pressure to step inputs.
Preprints 93461 g009
Figure 10. Response in ESP pressure increase to step inputs.
Figure 10. Response in ESP pressure increase to step inputs.
Preprints 93461 g010
Figure 11. Response in pipe friction pressure drop.
Figure 11. Response in pipe friction pressure drop.
Preprints 93461 g011
Figure 12. Input variation in experiment.
Figure 12. Input variation in experiment.
Preprints 93461 g012
Figure 13. Pressures in front of choke valve into manifold for vertical pipes (red, blue) and manifold pressure (green).
Figure 13. Pressures in front of choke valve into manifold for vertical pipes (red, blue) and manifold pressure (green).
Preprints 93461 g013
Figure 14. Electric Submersible Pump pressure heads in vertical pipes (red, blue) to compensate for gravity and friction loss.
Figure 14. Electric Submersible Pump pressure heads in vertical pipes (red, blue) to compensate for gravity and friction loss.
Preprints 93461 g014
Figure 15. Friction pressure drops in vertical pipes (red, blue) from bore-well to manifold, and in horizontal pipe (green) from manifold to separator.
Figure 15. Friction pressure drops in vertical pipes (red, blue) from bore-well to manifold, and in horizontal pipe (green) from manifold to separator.
Preprints 93461 g015
Figure 16. Vertical flow rates (red, blue) from bore-well into manifold, and horizontal flow rate (green) from manifold to separator, with uncertainty productivity capacity and isothermal compressibility.
Figure 16. Vertical flow rates (red, blue) from bore-well into manifold, and horizontal flow rate (green) from manifold to separator, with uncertainty productivity capacity and isothermal compressibility.
Preprints 93461 g016
Figure 17. Use of ControlSystemsMTK.jl and ControlSystems.jl for linearization and analysis.
Figure 17. Use of ControlSystemsMTK.jl and ControlSystems.jl for linearization and analysis.
Preprints 93461 g017
Figure 18. Bode plot of linearized model from ESP speed f p δ to volumetric flow V ˙ t δ from manifold to separator.
Figure 18. Bode plot of linearized model from ESP speed f p δ to volumetric flow V ˙ t δ from manifold to separator.
Preprints 93461 g018
Figure 19. Response in V ˙ t δ after a unit step in f p δ .
Figure 19. Response in V ˙ t δ after a unit step in f p δ .
Preprints 93461 g019
Figure 20. Response in V ˙ t δ after a unit reference step assuming delay + integrator process model, using Skogestad’s method: single_loop [blue], double-loop with α = 0.1 [red], and double-loop with α = 5 [green].
Figure 20. Response in V ˙ t δ after a unit reference step assuming delay + integrator process model, using Skogestad’s method: single_loop [blue], double-loop with α = 0.1 [red], and double-loop with α = 5 [green].
Preprints 93461 g020
Figure 21. Response in V ˙ t δ after a unit step in u o . Upper plot: effect of varying α . Lower plot: indicating steady state and 63% rule for time constant with α = 0.1 .
Figure 21. Response in V ˙ t δ after a unit step in u o . Upper plot: effect of varying α . Lower plot: indicating steady state and 63% rule for time constant with α = 0.1 .
Preprints 93461 g021
Figure 22. Response in V ˙ t after a unit step in V ˙ t ref , with α = 5 in Eq. 70.
Figure 22. Response in V ˙ t after a unit step in V ˙ t ref , with α = 5 in Eq. 70.
Preprints 93461 g022
Figure 23. ESP pump speed f p , with α = 5 in Eq. 70.
Figure 23. ESP pump speed f p , with α = 5 in Eq. 70.
Preprints 93461 g023
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2024 MDPI (Basel, Switzerland) unless otherwise stated