Abstract
Polymer flooding is one of the most important technologies for enhanced oil recovery (EOR). In this paper, an optimal control model of distributed parameter systems (DPSs) for polymer injection strategies is established, which involves the performance index as maximum of the profit, the governing equations as the fluid flow equations of polymer flooding, and some inequality constraints as polymer concentration and injection amount limitation. The optimal control model is discretized by full implicit finite-difference method. To cope with the discrete optimal control problem (OCP), the necessary conditions for optimality are obtained through application of the calculus of variations and Pontryagin’s discrete maximum principle. A modified gradient method with new adjoint construction is proposed for the computation of optimal injection strategies. The numerical results of an example illustrate the effectiveness of the proposed method.
1. 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].
Due to 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. Brouwer and Jansen [10], Sarma et al. [11], Zhang et al. [12], and Jansen [13] 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. [14] and Lei et al. [15] applied the iterative dynamic programming algorithm to solve the OCP of polymer flooding. However, the optimal control model used in their study is so simple that it is not adapt 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. [16] and Lei et al. [17, 18] 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. [11] point out, they require a 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 of polymer injection strategies turns to solve this OCP of DPS. The model is discretized by the full implicit finite difference method. Necessary conditions for optimality are obtained by Pontryagin's discrete maximum principle. A new gradient-based numerical algorithm which makes it relatively easy to create adjoint equations 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.
2. Mathematical Formulation of Optimal Control
2.1. Performance Index
Let denote the domain of reservoir with boundary , let be the unit outward normal on , and let be the coordinate of a point in the reservoir. Given a fixed final time , we set , , and suppose that there exist injection wells and production wells in the oilfield. The injection and production wells are located at and , 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 is the cost of oil per unit mass (), is the fractional flow of water, and is the flow velocity of production fluid (). We define at and at .
The polymer cost is expressed mathematically as where is the cost of oil per unit volume (), is the polymer concentration of the injection fluid (), and is the flow velocity of injection fluid (). We define at and at .
The objective functional is, therefore,
2.2. Governing Equations
The maximization of the cost functional 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 ,, and denote the pressure, water saturation, and polymer concentration of the oil reservoir, respectively, at a point and a time , then ,, and satisfy the following partial differential equations (PDEs).(1)The flow equation for oil phase: (2)The flow equation for water phase: (3)The flow equation for polymer component: (4)The boundary conditions and initial conditions: where the corresponding parameters are defined as The constant coefficient is the absolute permeability (), is the diffusion coefficient of polymer (), is the thickness of the reservoir bed (), is the rock density (kg/m3), andis the oil viscosity (mPa · s).
The oil volume factor , the water volume factor , the rock porosity , and the effective porosity to polymer are expressed as functions of the reservoir pressure : whereis the reference pressure (), , , and denote the porosity, the oil and water volume factor under the condition of the reference pressure, respectively, is the effective pore volume coefficient, , , and denote the compressibility factors of oil, water, and rock, respectively.
Functions relating values of the oil and water relative permeabilities and to the water saturation are where is the oil relative permeability at the irreducible water saturation , is the water relative permeability at the residual oil saturation , , and are constant coefficients.
The polymer solution viscosity (), the permeability reduction factor , and the amount adsorbed per unit mass of the rock () which depend on the polymer concentration are given by where is the viscosity of the aqueous phase with no polymer (mPa · s), , , , , , (), and () are constant coefficients.
The fractional flow of water is given by
2.3. Constraints
Since the polymer injection amount is limited, and the negative and overhigh injection concentrations are not allowed, the constraints in polymer flooding are expressed mathematically as follows.(1)The polymer injection amount constraint: (2)The injection polymer concentration constraint: where is the maximum polymer injection amount and is the maximum injection polymer concentration.
3. Full Implicit Finite Difference Method
The governing equations given by (2.4)–(2.8) are nonlinear PDEs. Several finite difference approximations for the numerical simulation of such DPS are possible. We adopt a full-implicit finite-difference scheme for the calculation of the governing equations. The scheme is described below.
For two space variables, we now consider the grid system with which we divide up the reservoir region in the - plane. The integer () is used as the index in the -direction, and the integer () for the index in the -direction. Thus, is the th value of , and is the th value of . Double indexing is used to identify functions within the two-dimensional region. Let denote the system state vector. The discrete state vector in grid point is described by
The reservoir domain is divided into blocks, and the point is considered to be at the center of block . There are blocks in the -direction and blocks in the -direction. Further details concerning this grid are given in Figure 1. We identify the coordinate with the left side of the block , and with the right side of the block. Similarly, is identified with the bottom of the block, and with the top.
Using the predefined grid system, the derivatives in (2.4)–(2.6) are replaced by finite differences. Three formulas are useful in this context: where is the index of reservoir simulation time step, is the number of simulation time steps, represents the size of the th time step in days, represents the state vector at time , is the total simulation time in days at the end of the th time step (), and and () denote the space step lengths in the -direction and -direction, respectively.
Apply the formulas (3.2) to discretize the governing equations (2.4)–(2.6), and multiply the grid area () to the two sides of the equations. For the full implicit finite difference method, the second spatial derivative items in (2.4)–(2.6) are evaluated at time instead of at . Then, the full-implicit finite-difference equations of the polymer flooding model has the general form: where is the discrete governing equations of polymer flooding model, is the discrete state vector, is the control vector, is the set of grid coordinates where injection wells located, refers to the flux terms, refers to the source terms, and refers to the accumulation terms.
The discrete governing equations for the grid point at time are given by Equations (3.4) are discrete flow equations for oil phase, water phase, and polymer component, respectively. The full-implicit finite-difference schemes for the flux terms are given by The discrete source terms are expressed as where is the fluid production rate (, , at , and at ), is the set of grid coordinates where production wells located, is the fluid injection rate (, , at , and at ). The full-implicit finite-difference schemes for the accumulation terms are where is the grid volume (, ).
The boundary condition (2.7) is equivalent to Therefore, by using finite difference and (3.8), we have
The initial condition (2.8) is discretized as
In solving the governing equations (2.4)–(2.8) by the full-implicit finite-difference methods, a problem that was originally described by PDEs defined over continuous time and spatial domains is transformed to problem that is described by a set of nonlinear discrete algebraic equations that are implicit form.
4. Necessary Conditions of OCP for Polymer Flooding
By using the full-implicit finite-difference method, the optimal control model of polymer flooding is discretized as the general form: where (4.1) is the discrete performance index and (4.4) is the discrete constraint of polymer injection amount.
We desire to find a set of necessary conditions for the state vector, , and the control, , to be extremals of the functional (4.1) subject to the governing (4.2)-(4.3) and the constraints (4.4)-(4.5). A convenient way to cope with such a discrete OCP is through the use of Pontryagin's maximum principle. The first step is to form an augmented functional by adjoining the governing equations to the performance index : where is the adjoint vector and .
We can simplify the augmented performance function of (4.6) by introducing the Hamiltonian, , as Therefore, the augmented performance function can be written as
Following the standard procedure of the calculus of variations, the increment of , denoted by , is formed by introducing variations,,, and giving This formulation assumes that the final time, , is fixed.
Expanding (4.9) in a Taylor series and retaining only the linear terms gives the variation of the functional, , The variations and are not independent but can be related by a discrete version of the integration by parts as
By substituting (4.11) into (4.10), the first variation becomes
The following necessary conditions for optimality are obtained when we apply Pontryagin's discrete maximum principle.
4.1. Adjoint Equations
Since the variation is free and not zero, the coefficient terms involving the variation in (4.12) are set to zero. This results in the following adjoint equations: Substituting the Hamiltonian (4.7) into (4.13), the adjoint equations reduce for the polymer flooding problem under consideration as given by
4.2. Governing Equations
Since the variation is free, we have
4.3. Transversality Conditions
Since the initial state is specified, the variation of (4.12) is zero. However, the final state is not specified; therefore, the variation is free and nonzero. This means the following relation must be zero: By substituting the Hamiltonian (4.7) into (4.16), the transversality conditions of adjoint equations for the polymer flooding OCP are expressed as Equation (4.17) shows that the adjoint variables are known at the final time . Since the state variables are known at the initial time and the adjoint variables are known at the final time, the discrete OCP is a split two-point boundary-value problem.
4.4. Optimal Control
With all the previous terms vanishing, the variation of the functional becomes
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), therefore,
Since there are bounds and amount constraints on the control , we use the discrete maximum principle to assert the following necessary conditions for optimality: where denotes the optimal control vector.
5. Numerical Solution
A gradient-based iterative numerical technique is proposed to determine the optimal injection strategies of polymer flooding. The computational procedure is based on adjusting estimates of control vector to improve the value of the objective functional. For a control to be optimal, the necessary condition given by (4.20) must be satisfied. If the control is not optimal, then a correction is determined so that the functional is made lager, that is, . If is selected as where is an arbitrary positive weighting factor, the functional variation becomes Thus, choosing as the gradient direction ensures a local improvement in the objective functional, . At the higher and lower bounds on , we must make the appropriate weighting terms equal to zero to avoid leaving the allowable region.
By substituting the discrete governing equations (3.3) and the performance index (4.1) into (5.1), the required gradient for the OCP of polymer flooding is expressed as
The computational algorithm of control iteration based on gradient direction is as follows.
Step 1. Make an initial guess for the control vector, , .
Step 2. Using stored current value of , , integrate the governing equations forward in time with known initial state conditions. Store the discrete states , .
Step 3. Calculate the profit functional with the results of the forward integration.
Step 4. Solve the adjoint equations using the stored discrete states to calculate the adjoint variables ,, with (4.14) and (4.17). Compute and store as defined by (5.3).
Step 5. Using the evaluated , an improved function is computed as where . A single variable search strategy can be used to find the value of the positive weighting factor which maximizes the improvement in the performance functional using (5.4).
Step 6. The optimization algorithm is stopped when the variation is too small to effectively change the performance measure, that is, when
where is a small positive number.
A penalty function method is adopted to deal with the polymer injection amount constraint (4.4). For more information about that, we are able to use this method within gradient-based algorithm, see [19].
It is clear that one forward governing equations evaluation and one backward adjoint equations evaluation are required to calculate the gradients of the performance index, irrespective of the number of controls. The time required to solve the adjoint equations is of the same order of magnitude as the governing equations. Thus, with this process, a time equivalent to approximately two integrations is all that is required to calculate any number of gradients. This is why gradient-based algorithms can be very efficient and can potentially lead to huge time savings if the number of controls is large.
6. New Algorithm for Adjoint Construction
Despite the great efficiency of the gradient-based algorithm, a major drawback of the approach is that an adjoint code is required in order to apply the algorithm. The complexity of the adjoint equations is similar to that of the governing equations. A modified approach is proposed to construct the adjoint that makes it relatively easy to create the adjoint code. The approach is due to the properties of the full-implicit finite-difference code and the forms of the performance index used in the OCP model of polymer flooding.
The main coefficient terms of the adjoint equations given by (4.14) are the two Jacobians of the governing equations: The two terms are difficult to calculate because they are functions of the governing equations. During the forward integration of the governing equations, we solve (3.3) to determine at each time step. Since these equations are nonlinear with respect to , the usual method to solve them is through the Newton-Raphson algorithm [20]: where is the iteration index of the Newton-Raphson algorithm at a given time step, is the state vector of the th iteration and is the Jacobian of the th iteration which is calculated by Equation (6.2) is linear with respect to . At the convergence of the algorithm, the Jacobian used in (6.2) is the same as the second Jacobian of (6.1).
Considering the full-implicit governing equations (3.3), the first Jacobian of (6.1) is given as The governing equations of the previous time step is expressed as Then the second Jacobian for this time step is given by The last term of (6.7) is the same as the right side of (6.5). Thus, the first Jacobian of any given time step is calculated during the computation of the second Jacobian of the previous time step.
The rest terms of adjoint equations are the derivatives of the scalar performance index with respect to the state vector . Due to the discrete form of performance index (4.1), the terms are directly functions of the source terms derivatives with respective to states . This is also calculated within the forward integration as seen from (6.4) and is easy to extract.
Thus, all the terms required for solving the adjoint equations can be calculated during the forward governing equations evaluation itself. The computational algorithm of control iteration based on gradient direction is modified as follows.
Step 1. Make an initial guess for the control vector, , .
Step 2. Using stored current value of , , integrate the governing equations forward in time with known initial state conditions. Store the discrete states and the coefficients involved in the adjoint equations , , , .
Step 3. Calculate the profit functional with the results of the forward integration.
Step 4. Solve the adjoint equations using the stored Jacobians and source terms derivatives in Step 2 to calculate the adjoint variables , , with (4.14) and (4.17). Compute and store as defined by (5.3).
Step 5. Using the evaluated , an improved function is computed as (5.4).
Step 6. The optimization algorithm is stopped when the variation is too small to effectively change the performance measure.
It should be noted that mathematically there is no change in the algorithm, but the adjoint equations become much simpler to code. Furthermore, the adjoint equations code can be fully consistent with the governing equations if the polymer flooding model is changed. For example, some terms reflecting new physical characteristics are added to (3.3). This is because the coefficient terms in adjoint equations are taken directly from the governing equations in the proposed method.
7. Case Study
In this section, we present a numerical example of optimal control for polymer flooding done with the proposed implicit discrete maximum principle 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 m2 and has a thickness of 5 m and is discretized into 90 grid blocks. The production model is a five-spot pattern, with one production well P1 located at the center of the reservoir () and four injection wells W1–W4 placed at the four corners (1, 10), (), (1, 1), and () as shown in the permeability distribution map of Figure 2. 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 (days). Figures 3 and 4 show the contour maps of the initial water saturation and the initial reservoir pressure , respectively. The initial polymer concentration is . In the performance index calculation, we use the price of oil [], and the cost of polymer . The fluid rate of the production well is m3/day, and the fluid rate of every injection well is m3/day. The PDEs are solved by full-implicit finite-difference method with step size 10 days. For the constraint (2.15), the maximum injection polymer concentration is . 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 for all injection wells. The performance index is with oil production m3 and polymer injection 155520 kg. For comparison, the results obtained by engineering judgment method are considered as the initial control strategies of the proposed implicit discrete maximum principle method. The maximum polymer injection amount in constraint (2.14) is (kg). A backtracking search strategy [19] is used to find the appropriate weighting term and the stopping criterion is chosen as . By using the proposed algorithm, we obtain a cumulative oil of m3 and a cumulative polymer of kg yielding the profit of over the polymer flooding project life of the reservoir. The results show an increase in performance index of . Figures 5, 6, 7, and 8 show the optimal control policies of the injection wells W1–W4. As a result, the optimal injection polymer concentration profiles of W1, 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. Figures 9 and 10 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 implicit discrete maximum principle method is lower than that by engineering judgment. Therefore, with the same cumulative polymer injection, the proposed method gets more oil production and higher recovery ratio.
8. 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 discrete maximum principle. A gradient-based iterative computational algorithm with new adjoint construction is proposed for the determination of optimal injection strategies. It is shown that the modified approach makes it relatively easy to code the adjoint equations as compared to the standard approach. 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 the 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 implicit discrete maximum principle. The approach used is a powerful tool that can aid significantly in the development of operational strategies for EOR processes.
Acknowledgments
This work was supported by the Natural Science Foundation of China (60974039), the Natural Science Foundation of Shandong Province of China (ZR2011FM002), the Fundamental Research Funds for the Central Universities (27R1105018A), and the Postgraduate Innovation Funds of China University of Petroleum (CX-1245). The authors would like to express their great appreciation to the editors and anonymous referees for their helpful and constructive comments and suggestions, which have helped to improve this paper.