Optimal Control of Polymer Flooding Based on Maximum Principle

Polymer ﬂooding is one of the most important technologies for enhanced oil recovery (cid:2) EOR (cid:3) . In this paper, an optimal control model of distributed parameter systems (cid:2) DPSs (cid:3) for polymer injection strategies is established, which involves the performance index as maximum of the proﬁt, the governing equations as the ﬂuid ﬂow equations of polymer ﬂooding, and the inequality constraint as the polymer concentration limitation. To cope with the optimal control problem (cid:2) OCP (cid:3) of this DPS, the necessary conditions for optimality are obtained through application of the calculus of variations and Pontryagin’s weak maximum principle. A gradient method is proposed for the computation of optimal injection strategies. The numerical results of an example illustrate the e ﬀ ectiveness of the proposed method.


Introduction
It is of increasing necessity to produce oil fields more efficiently and economically because of the ever-increasing demand for petroleum worldwide. Since most of the significant oil fields are mature fields and the number of new discoveries per year is decreasing, the use of EOR processes is becoming more and more imperative. At present, polymer flooding technology is the best method for chemically EOR 1 . It could reduce the water-oil mobility ratio and improve sweep efficiency 2-5 . Because of the high cost of chemicals, it is essential to optimize polymer injection strategies to provide the greatest oil recovery at the lowest cost. The optimization procedure involves maximizing the objective function cumulative oil production or profit from a polymer flooding reservoir by adjusting the injection concentration. One way of solving this problem is direct optimization with the reservoir simulator. Numerical models are used to evaluate the complex interactions of variables affecting development decisions, such as reservoir and fluid properties and economic factors. Even with these models, the current practice is still the conventional trial and error approach. In each trial, the polymer concentration of an injection well is selected based on the intuition of the reservoir engineer. This one-well-at-a-time approach may lead to suboptimal decisions because engineering and geologic variables affecting reservoir performance are often nonlinearly correlated. And the problem definitely compounds when multiple producers and injectors are involved in a field development case. The use of the optimal control method offers a way out.
The optimal control method has been researched in EOR techniques in recent years. Ramirez et al. 6 firstly applied the theory of optimal control to determine the best possible injection strategies for EOR processes. Their study was motivated by the high operation costs associated with EOR projects. The objective of their study was to develop an optimization method to minimize injection costs while maximizing the amount of oil recovered. The performance of their algorithm was subsequently examined for surfactant injection as an EOR process in a one-dimensional core flooding problem 7 . The control for the process was the surfactant concentration of the injected fluid. They observed a significant improvement in the ratio of the value of the oil recovered to the cost of the surfactant injected from 1.5 to about 3.4. Optimal control was also applied to steam flooding by Liu et al. 8 . They developed an approach using optimal control theory to determine operating strategies to maximize the economic attractiveness of steam flooding process. Their objective was to maximize a performance index which is defined as the difference between oil revenue and the cost of injected steam. Their optimization method also obtained significant improvement under optimal operation. Ye et al. 9 were involved in the study of optimal control of gas-cycling in condensate reservoirs. It was shown that both the oil recovery and the total profit of a condensate reservoir can be enhanced obviously through optimization of gas production rate, gas injection rate, and the mole fractions of each component in injection gas. Daripa et al. 10-15 researched the basic physical mechanisms that contribute to poor oil recovery by EOR technologies and how to individually control each of these physical mechanisms. Brouwer and Jansen 16 and Sarma et al. 17 used the optimal control theory as an optimization algorithm for adjusting the valve setting in smart wells of water flooding. The water flooding scheme that maximized the profit was numerically obtained by combining reservoir simulation with control theory practices of implicit differentiation. They were able to achieve improved sweep efficiency and delayed water breakthrough by dynamic control of the valve setting.
For the previous work on optimal control of polymer flooding, Guo et al. 18 applied the iterative dynamic programming algorithm to solve the OCP of a one-dimensional core polymer flooding. However, the optimal control model used in their study is so simple that it is not adapted for practical oilfield development. As a result of the complicated nature of reservoir models with nonlinear constraints, it is very tedious and troublesome to cope with a large number of grid points for the state variables and control variables. To avoid these difficulties, Li et al. 19 and Lei et al. 20 used the genetic algorithms to determine the optimal injection strategies of polymer flooding and the reservoir model equations were treated as a "black box." The genetic algorithms are capable of finding the global optimum on theoretical sense, but, as Sarma et al. 17 point out, they require tens or hundreds of thousand reservoir simulation runs of very large model and are not able to guarantee monotonic maximization of the objective function.
In this paper, an optimal control model of DPS for polymer flooding is established which maximizes the profit by adjusting the injection concentration. Then the determination Journal of Applied Mathematics 3 of polymer injection strategies turns to solve this OCP of DPS. Necessary conditions for optimality are obtained by Pontryagin's weak maximum principle. A gradient numerical method is presented for solving the OCP. Finally, an example of polymer flooding project involving a heterogeneous reservoir case is investigated and the results show the efficiency of the proposed method.

Performance Index
Let Ω ∈ R 2 denote the domain of reservoir with boundary ∂Ω, n be the unit outward normal on ∂Ω, and x, y ∈ Ω be the coordinate of a point in the reservoir. Given a fixed final time t f , we set Ψ Ω × 0, t f , Γ ∂Ω × 0, t f , and suppose that there exist N w injection wells and N o production wells in the oilfield. The injection and production wells are located at L w { x wi , y wi | i 1, 2, . . . , N w } and L o { x oj , y oj | j 1, 2, . . . , N o }, respectively. This descriptive statement of the cost functional must be translated into a mathematical form to use quantitative optimization techniques. The oil value can be formulated as where ξ o is the cost of oil per unit mass 10 4 $/m 3 , f w x, y, t is the fractional flow of water, and q out x, y, t is the flow velocity of production fluid m/day . We define q out x, y, t ≥ 0 at x, y ∈ L o and q out x, y, t ≡ 0 at x, y / ∈ L o . The polymer cost is expressed mathematically as where ξ p is the cost of oil per unit volume 10 4 $/m 3 , c pin x, y, t is the polymer concentration of the injection fluid g/L , and q in x, y, t is the flow velocity of injection fluid m/day . We define q in x, y, t ≥ 0 at x, y ∈ L w and q in x, y, t ≡ 0 at x, y / ∈ L w . The objective functional is, therefore,

Governing Equations
The maximization of the cost functional J given by 2.3 is not totally free but is constrained by the system process dynamics. The governing equations of the polymer flooding process must therefore be developed to describe the flow of both the aqueous and oil phases through the porous media of a reservoir formation. The equations used in this paper allow for the adsorption of polymer onto the solid matrix in addition to the convective and dispersive mechanisms of mass transfer. Let p x, y, t , S w x, y, t and c p x, y, t denote the pressure, water saturation, and polymer concentration of the oil reservoir, respectively, at a point 4

Journal of Applied Mathematics
x, y ∈ Ω and a time t ∈ 0, t f , then p x, y, t , S w x, y, t , and c p x, y, t satisfy the following partial differential equations PDEs .
i The flow equation for oil phase ii The flow equation for water phase iii The flow equation for polymer component

2.6
iv The boundary conditions and initial conditions where the corresponding parameters are defined as The constant coefficient K x, y is the absolute permeability μm 2 , h is the thickness of the reservoir bed m , D is the diffusion coefficient of polymer m 2 /s , ρ r kg/m 3 is the rock density, and μ o mPa·s is the oil viscosity.
Journal of Applied Mathematics 5 The oil volume factor B o , the water volume factor B w , the rock porosity φ, and the effective porosity to polymer φ p are expressed as functions of the reservoir pressure p:

2.12
where p r is the reference pressure MPa , φ r , B or , and B wr denote the porosity, the oil, and water volume factor under the condition of the reference pressure, respectively, f a is the effective pore volume coefficient, C o , C w , and C R denote the compressibility factors of oil, water, and rock, respectively.
Functions relating values of the oil and water relative permeabilities k ro and k rw to the water saturation S w are where k rwro is the oil relative permeability at the irreducible water saturation S wc , k rwcw is the water relative permeability at the residual oil saturation and S or , n w , and n o are constant coefficients. The polymer solution viscosity μ p mPa·s , the permeability reduction factor R k , and the amount adsorbed per unit mass of the rock C rp mg/g which depend on the polymer concentration c p are given by where μ w is the viscosity of the aqueous phase with no polymer mPa·s , ap 1 , ap 2 , ap 3 , R k max , b rk , and a cm 3 /g and b g/L are constant coefficients. The fractional flow of water f w is given by,

Constraint
Since the negative and overhigh injection polymer concentrations are not allowed, the constraint in polymer flooding is expressed mathematically as where c max is the maximum injection polymer concentration.

Optimal Control Formulation
The reservoir pressure p, the water saturation S w and the polymer concentration c p are the three state variables for the problem as formulated. The system state vector is denoted by The control for the process is the polymer concentration of injected fluid v x, y, t c pin , x, y ∈ L w .

2.18
Then the OCP of DPS for polymer flooding has the general form,

Maximum Principle of DPS
We desire to find a set of necessary conditions for the state vector, u, and the control, v, to be extremals of the functional J 2. 19  of distributed adjoint variables. The first step is to form an augmented functional by adjoining the governing equations to the performance index J. We define the Hamiltonian as where λ x, y, t is the adjoint vector. Then the argument functional is given by,

3.2
Following the standard procedure of the calculus of variables, the increment of J A , denoted by ΔJ A , is formed by introducing variations δu, δu x , δu y , δu xx , δu yy , δu, and δv giving This formulation assumes that the final time, t f , is fixed.

3.9
When the state and control regions are not bounded, the variation of the functional must vanish at an extremal the fundamental theorem of the calculus of variations . When the control region is constrained by a boundary, then the necessary condition for optimality is to maximize the performance index J A with respect to the control v. This means that the variation δJ A is where v * denotes the optimal control. Equation 3.10 is the weak minimum principle of Pontryagin. The necessary conditions for these two cases are the same except for the term involving the variation of the control, δv. For polymer flooding problem there are higher and lower bounds on the control variable v given as 2.16 .
The following necessary conditions for optimality are obtained when we apply Pontryagin's maximum principle.

(1) Adjoint Equations
Since the variation δu is free and not zero, the coefficient terms involving the δu variation in the first term of 3.9 are set to zero. This results in the adjoint equations as given by

(3) Transversality Terminal Conditions
Since the initial state is specified, the variation δu| t 0 of 3.9 is zero. However, the final state is not specified; therefore, the variation δu| t t f is free and nonzero. This means that the following relation must be zero:

(4) Optimal Control
With all the previous terms vanishing, the variation of the functional δJ A becomes This equation expresses the direct influence of variation δv on δJ A . A necessary condition for the optimality of v * is that δJ A ≥ 0 for all possible small variations, δv. Since there are lower Journal of Applied Mathematics and higher bounds on the control v 2.9 , we use the weak maximum principle to assert the following necessary conditions for optimality: when the control vector is unconstrained. Because the variation δv can only be negative along the lower bound, we have And because the variation δv can only be positive along the higher bound, we have

Necessary Conditions of OCP for Polymer Flooding
Let λ x, y, t λ 1 , λ 2 , λ 3 T denote the adjoint vector of OCP for polymer flooding. Applying the theory developed in Section 3.1 and substituting the governing equations 2.4 -2.6 into 3.12 , the adjoint equations, given by 3.12 , reduce for the polymer flooding problem under consideration as given in,

3.19
The boundary conditions 2.7 of the DPS result in ∂u/∂l | ∂Ω 0 and δu l | ∂Ω 0, l x, y, in 3.13 . The coefficients of the arbitrary variation δu l | ∂Ω terms must be zero and yield the boundary conditions for the adjoint equations as given by By substituting the governing equations 2.4 -2.6 into 3.20 , the boundary conditions of adjoint equations for the polymer flooding OCP are expressed as The following transversality terminal conditions at t t f are obtained by substituting the governing equations 2.4 -2.6 into 3.14 :

3.22
Since the coefficient terms involving the adjoint variables in 3.22 are not zero, the terminal conditions of adjoint equations in the OCP of polymer flooding can be simplified to Equation 3.23 shows that the adjoint variables are known at the final time t f . Since the state variables are known at the initial time and the adjoint variables are known at the final time, the OCP is a split two-point boundary-value problem. The variation of the performance index, J, reduces to the following simplified functional of the control variation: From the results of 3.16 -3.18 , the necessary condition for optimality of polymer flooding problem is 3.25

Numerical Solution
We propose an iterative numerical technique for determining the optimal injection strategies of polymer flooding. The computational procedure is based on adjusting estimates of control function v to improve the value of the objective functional. For a control to be optimal, the necessary condition given by 3.25 must be satisfied. If the control v is not optimal, then a correction δv is determined so that the functional is made lager, that is, δJ A > 0. If δv is selected as where w is an arbitrary positive weighting factor, the functional variation becomes Thus, choosing δv in the gradient direction ensures a local improvement in the objective functional, J A . At the higher and lower bounds on v, we must make the appropriate weighting terms equal to zero to avoid leaving the allowable region. The computational algorithm of control iteration based on gradient direction is as follows.

(1) Initialization
Make an initial guess for the control function, v x, y, t , x, y ∈ L w , t ∈ 0, t f .

(2) Resolution of the State Equations
Using stored current value of v x, y, t , x, y ∈ L w , integrate the governing equations forward in time with known initial state conditions. We use the finite difference method of a full implicit scheme for the PDEs as discussed in 21, 22 . The profit functional is evaluated, and the coefficients involved in the adjoint equations which are function of the state solution are computed and stored.

(3) Resolution of the Adjoint Equations
Using the stored coefficients, integrate the adjoint equations numerically backward in time with known final time adjoint conditions by 3.23 . Compute and store δv as defined by 4.1 .    where 0 ≤ v new ≤ v max . A single variable search strategy can be used to find the value of the positive weighting factor w which maximizes the improvement in the performance functional using 4.3 .

(5) Termination
The optimization algorithm is stopped when the variation δv is too small to effectively change the performance measure, that is, when where ε is a small positive number.

Case Study
In this section we present a numerical example of optimal control for polymer flooding done with the proposed iterative gradient method. The two-phase flow of oil and water in a heterogeneous two-dimensional reservoir is considered. The reservoir covers an area of 421.02 × 443.8 m 2 and has a thickness of 5 m and is discretized into 90 9 × 10 × 1 grid blocks. The production model is a five-spot pattern, with one production well P1 located at the center of the reservoir 5, 6 and four injection wells W1∼W4 placed at the four corners 1, 10 , 9, 10 , 1, 1 , and 9, 1 as shown in the permeability distribution map of Figure 1. Polymer is injected when the fractional flow of water for the production well comes to 97% after water flooding. The time domain of polymer injection is 0∼1440 days and the polymer flooding project life is t f 5500 days . Figures 2  and 3 show the contour maps of the initial water saturation S 0 w and the initial reservoir pressure p 0 , respectively. The initial polymer concentration is c 0 p 0 g/L . In the performance index calculation, we use the price of oil ξ o 0.0503 10 4 $/m 3 80 $/bbl , and the cost of polymer ξ p 2.5 × 10 −4 10 4 $/kg . The fluid velocity of production well is q out 7.225 × 10 −3 m/day , and the fluid velocity of every injection well is q in 2.89 × 10 −2 m/day . The PDEs are solved by full implicit finite difference method with step size 10 days. For the constraint 29 , the maximum injection polymer concentration is c max 2.2 g/L . The parameters of the reservoir description and the fluid data are shown in Tables 1 and 2, respectively.
The polymer injection strategies obtained by the conventional engineering judgment method trial and error are the same 1.8 g/L for all injection wells. The performance index is J $1.592 × 10 7 with oil production 32429 m 3 and polymer injection 155520 kg. For comparison, the results obtained by engineering judgment method are considered as the initial control strategies of the proposed iterative gradient method. A backtracking search strategy 23 is used to find the appropriate weighting term w and the stopping criterion is chosen as ε 1 × 10 −5 . By using the proposed algorithm, we obtain a cumulative oil of 33045 m 3 Figures 8 and 9 show the fractional flow of water in production well and the cumulative oil production curves of the two methods, respectively. It is obvious that the fractional flow of water obtained by iterative gradient method is lower than that by engineering judgment. Therefore, with the less cumulative polymer injection, the proposed method gets more oil production and higher recovery ratio. Figure 4 to Figure 7 show the optimal control policies of the injection wells W1∼W4. As a result, the optimal injection polymer concentration profiles of W1 and W2 are significantly different from those of W3, W4. It is mainly due to the differences of the well positions and the distance to the production well, as well as the reservoir heterogeneity and the uniform initial water saturation distribution.

Conclusion
In this work, a new optimal control model of DPS is established for the dynamic injection strategies making of polymer flooding. Necessary conditions of this OCP are obtained by  using the calculus of variations and Pontryagin's weak maximum principle. An iterative computational algorithm is proposed for the determination of optimal injection strategies. The optimal control model of polymer flooding and the proposed method are used for a reservoir example and the optimum injection concentration profiles for each well are offered.
The results show that the profit is enhanced by the proposed method. Meanwhile, more oil production and higher recovery ratio are obtained. And the injection strategies chosen by engineering judgment are same for all the wells, whereas the optimal control policies by the proposed method are different from each other as a result of the reservoir heterogeneity and the uniform initial conditions. In conclusion, given the properties of an oil reservoir and the properties of a polymer solution, optimal polymer flooding injection strategies to maximize profit can be designed by using distributed-parameter control theory. The approach used is a powerful tool that can aid significantly in the development of operational strategies for EOR processes.