Optimal Control Strategies with Nonlinear Optimization for an Electric Submersible Pump Lifted Oil Field

In an Electric Submersible Pump (ESP) lifted oil field, the ESP of each oil well should be operated inside its operating window. The total power consumed by the ESPs in the oil field should be minimized. The speed of the ESPs and the production choke valve opening should be optimally chosen for maximizing the total oil produced from the oil field. At the same time, the capacity of the separator should not be exceeded. In this paper, nonlinear steady state optimization based on Sequential Quadratic Programming (SQP) is developed. Two optimal control structures are proposed in this paper. In the first case, the optimal pump speed is controlled by a PI controller by varying the electrical excitation signal to the motors. The optimal fluid flow rate through each oil well is controlled by another PI controller by varying the production choke valve opening. The paper shows that the production choke valve for each oil well has to be always 100% open to maintain the optimal fluid flow rate. In the second case, the production choke valves are considered to be always 100% open as hard constraints. The optimal fluid flow rate through each oil well is controlled by a PI controller by varying the pump speed. It is shown that when the optimal fluid flow rate is tracked by the controller, the speed of each of the pumps is equal to the optimal pump speed calculated by the optimizer. This basically means that we can achieve the optimization objective with the same optimal results as in the first case by using only a single PI controller. The limitations of these two optimal control structures for very low values and for very high values of the separator capacity are discussed. For the feasible range of separator capacities, the optimal locus of the fluid flow rate and the pump speed are shown in this paper.


Introduction
An electric submersible pump lifted oil well is an artificial lifting system where a submersible multistage centrifugal pump is installed at the bottom of the well bore.This down hole pump is used to increase the pressure in the oil well to overcome the sum of flowing pressure losses and hence to enhance oil production from the reservoir.It utilizes a submerged electrical motor to drive all the stages of the pump.Electrical power is supplied to the motor by electric cables running from the surface (Takacs, 2009).
Fig. 1 shows an oil field with four oil wells.Each of the oil wells is equipped with a bottom hole ESP unit and a production choke valve.The oil produced from each oil well is collected together in a common pro- duction manifold.To ease the transportation of the high viscous fluid produced from the reservoir over a long distance, the viscosity of the fluid should be reduced.This is achieved by adding water to the production manifold from one end by using a water injection valve.The amount of water to be added is calculated such that the water cut of the fluid in the production manifold is at least 0.5.Two parallel transportation lines are used to transport the fluid from the gathering manifold to a separator located on the topside facility.Each transportation line is fitted with a booster pump which is used to increase the pressure to overcome the sum of flowing pressure losses in the transportation line.The amount of fluid produced from each oil well can be varied by changing the speed of the pump.The speed of the pump is changed by changing the electrical frequency driving the motor.The production choke valve in addition to the ESP can also be used to regulate the amount of fluid produced from the reservoir by changing its valve opening.
Normally, each ESP is run at its nominal operating frequency which usually is 60 Hz.However, operating the oil field in such a manner might not always be optimal.For example, it is not optimal to run the pump at 60 Hz for a lower separator capacity because the pumps are consuming higher power for lower flow rate.The main objective is to produce maximum oil from the oil field by using the least power consumed by the ESPs.In addition, each ESP has its own operating window.The speed of the ESP should be within a minimum of 45 Hz to a maximum of 80 Hz.The flow rate through the ESP for a given frequency should be within its lower and upper flow rate limits.Operating an ESP pump outside the window reduces the life of the pump due to excess upthrust or downthrust acting on the pump.At the same time, the separator capacity should be fully utilized and must not be exceeded.So the main challenge is to find out the optimal speed of the pump and the optimal flow rate through each oil well that will satisfy all the optimal working conditions.The main operational expense in an ESP lifted oil field considered in this paper is the cost of electricity used by the pumps.So from an economic point of view, the optimal operating condition would be to produce maximum oil by using least power and also to enhance the life of the pumps by running the pumps well inside the operating window.
Numerous literature on optimization and control of multi-pump systems can be found as in Westerlund et al. (1994), Pettersson and Westerlund (1996), Pedersen and Yang (2008) and Yang et al. (2012).However, none of the literature deal with the optimal operation of an ESP lifted oil field.A brief description of the model of the oil field is given in Section 2. Two optimal control strategies utilizing a steady state optimizer and PI controllers have been developed in this paper.In the first optimal control structure, the speed of the pump is controlled by changing electrical frequency and the well flow rate is controlled by changing the production choke valve openings.Two separate PI controllers are used as described in Section 3. Detailed discussion on the simulation results for this optimal control strategy is done in Section 4. The limitations of the first control structure for very low as well as very high separator capacity is discussed in Section 4.2.In the second optimal control strategy, the optimal well flow rate is controlled by varying the pump speed while always keeping the production choke valve fully opened.Only one PI controller is used for control as described in Section 5. Discussion on the simulation results for the second control structure and comparison with the first case has been done in Section 6.The limitations of the second control structure is discussed in Section 6.1.The increase in the profit obtained from the oil field due to optimization is discussed in Section 7. Finally the conclusion of the findings of this paper is summarized in Section 8.

MODEL OF THE OIL FIELD
A detailed model of the oil field including the model of the pump and the oil wells can be found at Sharma and Glemmestad (2013).In this paper, only the final equations of the oil field model have been rewritten.The superscript i and j denote the i th oil well and the j th transportation pipeline.

ESP Model
The height at which a pump can raise the fluid it is pumping is called the head of the pump.A curve of pump flow rate versus pump head called the head characteristic (H i esp (Q, f )) of the i th multi-stage ESP for pumping viscous fluid for any given frequency f is written as a third order polynomial, (1) Here, āi 0 , āi 1 , ..., āi 3 are the polynomial coefficients for the base frequency f 0 = 60 Hz and Q(f ) is the fluid flow rate through the ESP.The Brake Horse Power (BHP) characteristic (BHP i esp (Q, f )) of the i th ESP for pumping viscous fluid for any given frequency f is written as a fourth order polynomial, Here, âi 0 , âi 1 , ..., âi 4 are the polynomial coefficients for the base frequency f 0 = 60 Hz.The minimum (Q i min (f )) and the maximum (Q i max (f )) viscous fluid flow rate through the ESP for any given frequency f can be calculated as, Here, Q i f0,min and Q i f0,max are the minimum and maximum flow rates through ESP pumping viscous fluid at f 0 .The differential equations representing the dynamics of each i th oil wells are, A j tr ρ j tr L j tr P man − P s + ρ j tr gH j bp (q j tr , f j bp ) − P tr,j f (7) Here, q l , q r , q c , q tr are the average fluid flow rates through a well, from reservoir into tubing, through production choke valve and through transportation pipeline respectively.A t , L t , A r , L r are the cross sectional areas and lengths of tubing in section I and II respectively.A tr , L tr , A m , L m are the cross sectional areas and lengths of transportation pipeline and gathering manifold respectively.P wf , P wh , P man , P s are the bottom hole, well head, gathering manifold and separator pressures.H esp , H bp are the head produced by the ESP and booster pumps.ρ l , ρ tr are the densities of fluid flowing through the well and transportation line.P r f , P t f , P tr f are the pressure losses due to friction in Section I and II of the tubing and in transportation pipeline.f i r is the speed of the pump, β is the bulk modulus of reservoir fluid and q in man is the total fluid (including injected water) flowing into the gathering manifold.
q i r can be expressed using the Productivity Index (P I) model (Takacs, 2009;Sharma et al., 2011) and reservoir pressure P r as, q i c can be expressed using the standard flow equation ANSI/ISA S75.01 developed by Instrument Society of America (ANSI/ISA S75.01, 1989) as, Here, N6 = N 6 /(3600 √ 10 5 ) with N 6 = 27.3.The valve characteristic as a function of its opening (C v (u i )) is modeled by three linear equations by fitting the data supplied by the choke supplier as, The pressure loss due to friction is calculated using Darcy-Weisbach formula (Brown and Beggs, 1977) as, Here, ρ is the density of fluid flowing through the pipeline, D h is the hydraulic diameter of the pipe and v is the velocity of the fluid.The Darcy friction factor f D can be evaluated using Serghide's explicit approximation to Coolebrook-white equation (Serghide, 1984).

STEADY STATE OPTIMIZATION AND CONTROL: CASE I
In case I, a Steady State Optimizer (SSO) calculates the optimal fluid flow rate and optimal pump speed.

Optimization problem formulation
The main objective is to maximize profit from the oil field.This can be achieved by maximizing the income from total oil production, minimizing the expenses of total electric power consumed by the pumps and minimizing the cost occurring in the operation of the separator.Let N = 5 be the number of oil wells, N b = 2 be the number of transportation lines, C o be the unit price of crude oil, C e be unit price of the electrical power, C s be unit price for running the separator and W C i w be the water cut for each well.Then the optimization problem in terms of minimization can be written as, minimize subject to nonlinear equality constraints given by, 1.The steady state process model ( 1) -( 12) by setting the first order derivatives to zero.
2. The flow handling capacity of the separator(q max cap ) should be fully utilized.
nonlinear inequality constraints given by, 1.The ESP intake pressure (P in,i esp ) should be greater than the bubble point pressure (P i bub ) to avoid cavitation.
− P in,i esp 2. The fluid flow rate through the pump should be within the operating window.
3. The speed of the pump should be within 45 Hz to 80 Hz.
4. The production choke valve openings should be within 0 to 100.

SIMULATION RESULTS AND DISCUSSION FOR CASE I
The optimization problem of ( 13) -( 18) was solved using MATLAB optimization toolbox and Sequential Quadratic Programming (SQP) method.To obtain the optimal solution as close as possible to the global solution, multi-start search engine of the optimization toolbox was used.The PI controllers were tuned by trial and error procedure.The production choke valves cannot be opened by more than 1% per second and the speed of the ESPs cannot be changed by more than 1 Hz per second.
For illustration, separator with 10000 m 3 /day fluid handling capacity has been considered at first.Initially, the oil field is running at its steady state however in an non-optimal manner.Until t = 90 seconds, the production choke valve openings of each well are kept at 60% open (Fig. 3(a)) and the ESP is running at 75 Hz, 65 Hz, 60 Hz and 70 Hz for well 1 to well 4 respectively (Fig. 3(b)).The non-optimal total power consumed by all the ESPs is 2259.5 HP (Fig. 3(c)).The non-optimal total oil produced from the field is  At t = 90 seconds, the SSO was executed once.
The optimal pump speed [59.95, 59.89, 60.01, 59.91] T Hz and the optimal fluid flow rate [1900.81, 2088.93, 1734.14, 1968.43]T m 3 /hr calculated by the SSO were provided as the set points to the two PI controllers.The controllers track the optimal set points and at the steady state after t ≥ 90 seconds, the separator is fully utilized (Fig. 3(f)).The total power consumed by the pumps are lowered to 1634.7 HP (Fig. 3(c)) and the total oil produced from the field is increased to 5000 m 3 /day (Fig. 3(d)).All the wells are operating well within their operating window as shown in Fig. 3(e).The most important thing that can be observed is that the production choke valves i.e. the control signal provided by flow controller are exactly 100% opened (Fig. 3(a)).This means that the wells will produce optimally when the valves are fully opened.The SSO can be used to calculate the optimal pump speed and the optimal fluid flow rate for each oil well for a wide range of separator capacities.Table 1 lists the optimal pump speed, optimal fluid flow rate, optimal total BHP and optimal total oil production for a separator capacity ranging from 7500 m 3 /day to 13500 m 3 /day.
For different separator capacity, the optimal control structure will operate the ESP for each oil well inside its operating window.The locus or path of the optimal pump head against the pump flow rate for different separator capacity is shown in Fig. 4. Similar to the case for q cap sep = 10000 m 3 /day, for each separator capacity, it can shown that the production choke valve has to be always 100% open in order track the optimal fluid flow rate calculated by the SSO.By common sense, this is correct since operating the pump at a higher speed while closing the choke valve at the same time is only

Comments on inverse response
From Fig. 3(d) and Fig. 3(f), it can be seen that the system shows inverse response for special combination of the direction of valve openings and the pump speeds.This inverse response is due to a special dynamics of the system when both the speed and the flow rate controllers are acting on the system at the same time after t = 90 seconds to track the respective set points.The controllers decrease the speed of the pumps (Fig. 3(b)) causing the fluid flow to decrease.At the same time the valve openings are increased towards 100% opening (Fig. 3(a)) causing the fluid flow to increase.These two actions which are opposite to each other when acted on the system simultaneously give rise to multi-variable inverse response.To illustrate this, the valve openings are frozen momentarily at t = 90 seconds and withheld to the values before the SSO was invoked.Only the pump speed controller is allowed to track the new optimal pump speed set points generated by the SSO.
As can be seen from Fig. 5, due to decreasing of the pump speeds, the total fluid flowing from the oil field first lowers down.After about t = 140 seconds when the optimal pump speeds have been tracked and are at their steady states, the production choke valves are allowed to be controlled by the flow rate PI controllers.The valve openings are then taken to their maximum opening of 100% and the total fluid production from the oil field increases to meet the separator capacity (see Fig. 5).

Limitation
There is a limitation of this optimal control structure to very low separator capacity.At t = 90 seconds, the separator capacity is reduced from 10000 m 3 /day to a very low value of 6000 m 3 /day.Until t = 90 seconds, the  However, after t = 90 seconds, for this very low value of separator capacity, the production choke valves of some of the wells have to be operated below 100% to track the optimal fluid flow rate calculated by the SSO for this lower separator capacity as shown in Fig. 6.The valves opening have to be decreased in order to increase the pressure drop across the valve when head generated by the pumps for lower pump speed is not sufficient.The valve openings of wells 4, 3 and 1 have to be opened to about 56%, 57% and 71% respectively.The ESPs of all the wells are running at their lower permissible speed of 45 Hz as can be seen from the window diagram shown in Fig. 7.The optimal fluid flow calculated by the SSO is [934.8, 1619.6, 1126.2, 934.8]T m 3 /day for each oil well.The total optimal power consumed by the ESPs is about 650 HP and the total optimal oil produced from the field is 3000 m 3 /day.Similarly, the limitation also arises for a very high separator capacity.At t = 90 seconds, the separator capacity is increased to a very high value of 16000 m 3 /day and the SSO is activated once.In this case, for t ≤ 90 seconds, the oil field is still operating nonoptimally with valves not fully opened as shown in Fig. 8.The optimal set points calculated by the SSO are provided as set points to the PI controllers.The optimal pump speed which is 80 Hz for all the wells for this very high value of separator capacity is tracked by the speed controllers as can be seen from the window diagram in Fig. 9.However, the optimal flow rate set points are not tracked by the controllers.All the valves are 100% open as shown in Fig. 8 but for the controllers to track the optimal fluid flow rates, the valves have to be opened by more than 100% which is not possible.So, the separator capacity is not fully utilized and the wells are producing less than what the separator can handle as shown in Fig. 10.

STEADY STATE OPTIMIZATION AND CONTROL: CASE II
In this case, a SSO calculates the optimal flow rate and optimal pump speed just like in Case I, however the constraints are defined in a slightly different way for this case.From the simulation results of Case I, for the separator capacity ranging from 6500 m 3 /day to 13500 m 3 /day, it was shown that the production choke valves have to be always 100% open for tracking the optimal flow rate set points.This behavior of the oil well for optimal operation has been utilized in this case.
The production choke valves are considered to be fully opened and are considered as hard equality constraints that have to be satisfied.The optimal flow rate value is provided as the set point to a PI controller.The controller tracks the set point by changing the speed of the pump as shown in Fig. 11.The resulting control structure is simpler than the first case since it utilizes only a single PI controller.

Optimization problem formulation
The objective of the oil field process optimization is exactly the same as in case I.It is to maximize the profit from the oil field.The objective function of the optimization problem is the same as given by ( 13) and is simply re-written here as, minimize subject to nonlinear equality constraints given by, 1.The steady state process model ( 1) -( 12) by setting the first order derivatives to zero.
2. The flow handling capacity of the separator(q max cap ) should be fully utilized.
3. The production choke valves are considered to be always fully opened.
nonlinear inequality constraints given by, 1.The ESP intake pressure (P in,i esp ) should be greater than the bubble point pressure (P i bub ) to avoid cavitation.
− P in,i esp + P i bub ≤ 0 (22) 2. The fluid flow rate through the pump should be within the operating window.
3. The speed of the pump should be within 45 Hz to 80 Hz.

SIMULATION RESULTS AND DISCUSSION FOR CASE II
The optimization problem of ( 19) -( 24) was solved using MATLAB optimization toolbox and SQP method.Like in the first case, a multi-start search engine of the toolbox is used for this case also.The maximum rate of change of the control signal i.e. the maximum rate of change of the pump speed is 1 Hz/sec.
The same separator capacity of 10000 m 3 /day as in Case I is considered at first for easy comparison between the two control structures.Initially, for t ≤ 90 seconds, the oil field is running in a non-optimal manner at its steady state.Although the production choke valves are always kept at 100% open, the ESPs of each oil wells are running with non-optimal speed and hence producing non-optimal fluid production of [2229.4, 1945, 1317.2, 2061.9]T from each of the wells respectively as shown in Fig. 12(a).In other words, the total fluid produced from the reservoir is less than what the separator can handle (Fig. 12(b)).Thus the power consumed will also be less but it is non-optimal power consumption (Fig. 12(c)).The total non-optimal oil produced from the oil field is about 4850 m 3 /day (Fig. 12(d)).
At t = 90 seconds, the optimizer was executed once.
The optimal fluid flow rate of [1902.3, 2089.1, 1729, 1971.9]T m 3 /day for well 1 to well 4 respectively were provided as the set points to the flow rate controller.The controllers track the set points and at the steady state after t ≥ 90 seconds, the separator is fully utilized (Fig. 12(b)).The optimal fluid flow rates calculated by the SSO in this case are very similar to the ones calculated in the first case.The total power consumed by the ESPs at their optimal steady state is exactly equal to the first case of 1634.68 HP (Fig. 12(c)).Similarly, the total optimal oil produced from the oil field with this control structure is exactly equal to the first case of 5000 m 3 /day (Fig. 12(d)).This means that profit from the oil field for the given separator capacity is exactly the same for both control structures.
Moreover, when the oil field reaches its steady state after the optimizer was activated once, the control signal generated by the controllers i.e. the speed of the pumps required to maintain the optimal flow rates are found out to be [59.98, 59.90, 59.91, 59.98] T (Fig 12(f)).Comparing it to the optimal pump speed values of Table 1 for case I for a separator capacity of 10000 m 3 /day, it can be seen that these two values are very similar to each other.This means that, with the production choke valves fully opened, the ESPs must run at optimal speed to maintain the optimal flow rate calculated by the SSO.Similarly, with this control structure with only a single PI controller for each oil well, the ESPs are operating well within their operating window as seen in Fig. 12(e).A careful observation of the operating window diagram reveals that the optimal working point for each oil well for both the control structures is exactly the same (see the red dots in the window diagrams for both cases i.e.Fig. 3(e) and Fig.
12(e)).Table 2 lists the optimal pump speed, optimal fluid flow rate, optimal total BHP and optimal total oil  For different separator capacities, the optimal control structure will operate the ESP for each oil well inside its operating window.The locus or path of the optimal pump head against the pump flow rate for different separator capacity is shown in Fig. 13.Comparing Fig. 4 and Fig. 13, it can be seen that the optimal locus followed by the pumps of each oil well for both the control structures are exactly the same.
Similar to the case for q cap sep = 10000 m 3 /day, for each separator capacity, it can be shown that the value of the optimal pump speed (controller output) required to maintain the optimal fluid flows is very similar to the values listed in Table 1.Comparison of the data from Table 1 and Table 2 for both control structures shows that both strategies produce exactly the same amount of crude oil from the oil field for different separator capacities.The optimal fluid flow rates and the optimal pump speeds for different separator capacities are almost the same for both cases.Similarly the BHP required by the pumps for producing the optimal fluid from each oil well are almost the same for both control strategies.In other words, utilizing the same power consumption and for the same separator capacity, both the control system strategies yield the same profit from the oil field.However, control structure I uses two separator PI controllers for each oil well.The optimal control structure II utilizes only a single PI controller for each oil well and produces the same optimal results as case I.In this respect, it makes control structure II simpler and better than control structure I.

Limitation
The control structure for case II also has the same limitations as the first control structure i.e. for a very low and for a very high separator capacities, the con- trol structure fails to provide optimal results.In the second control structure, the hard equality constraint of u = 100% has to be satisfied.From case I, it was shown that for very low separator capacities (≤ 6500 m 3 /day), the valves have to be closed below 100% to maintain the optimal flow rate calculated by the SSO.In case 2, the same applies and the equality constraint of (21) will not be satisfied.The SSO will not be able to converge to a solution.Similarly for very high separator capacities (≥ 13500 m 3 /day), from case I, it was shown that the valves have to be opened above 100% to maintain the optimal flow rate calculated by the SSO.In case 2, the equality constraint of (21) will not be satisfied again and hence the SSO will not be able to converge to a solution.

PROFIT DUE TO OPTIMIZATION
The objective criterion of ( 13) and ( 19) is the profit obtained from the oil field.The profit is calculated by subtracting the cost of the electricity consumed by the pumps and the operating cost of the separator from the income made by selling crude oil.Assuming C o = 110 $/barrel, C e = 9.1 cents/KW hr and C s = 1 $/barrel, it is shown that the result of optimization is the increase in the profit from the oil field as shown in Fig. 14.Until t = 90 seconds, the oil field is operating in two different non-optimal manners with a profit of about $2.9×10 6 and $3.3×10 6 per day for the control structures of case I and case II respectively.After the steady state optimization is performed at t = 90 seconds, both the control structures operate the oil field in an optimal manner.At the steady state, the profit curves are increased to about $3.4×10 6 per day for both the cases as shown in Fig. 14.This also shows that the control structures for cases I and II are equivalent.Thus optimal operation of the oil field increases the profit.As an example, for the oil field with control structure of case I, the increase in the profit is about $50×10 4 per day.

CONCLUSION
SSO providing optimal set points to local PI controllers can be used to optimally operate the ESP lifted oil field.Non-optimal pump speed as well as non-optimal production choke valve openings can cause the process to consume unnecessary power and also to produce less oil.Among the two optimal control strategies, the control strategy of case II uses only one PI controller for each oil and thus is simpler and better than the control structure of case I.For both cases, the SSO has to be activated only once when the process reaches the steady state.However, each time a process disturbance occurs, the SSO has to be invoked again.Considering that the separator capacity is the only disturbance present in the system, the optimal fluid flow rate and the optimal pump speed for each well can be computed and the optimal locus of the pump head can be traced out in advance.The control strategies will always operate the ESPs well within their operating window and hence enhance their lifespan.The energy consumed by the booster pumps has not been taken into account in this paper, but it can be easily added in the optimization problem formulation.In conclusion, the profit from the oil field is increased when the field is operated optimally.

Figure 1 :
Figure 1: Schematic of ESP lifted oil field

Figure 2 :
Figure 2: Optimal control structure with two PI controllers

Figure 3 :Figure 4 :
Figure 3: Optimal control of ESP oil field using two PI controllers.

Figure 5 :
Figure 5: Total fluid flow illustrating that the system exhibits inverse response characteristics

Figure 6 :
Figure 6: Production choke valve openings for very lower separator capacity

Figure 7 :
Figure 7: Operating window of ESPs for very lower separator capacity

Figure 11 :
Figure 8: Production choke valve opening for a very high separator capacity

Figure 12 :Figure 13 :
Figure 12: Optimal control of ESP oil field using one PI controllers.

Figure 14 :
Figure 14: Profit from the oil field due to optimization

Table 1 :
Optimal operation of ESP oil field for different separator capacities for case I

Table 2 :
Optimal operation of ESP oil field for different separator capacities for case II