You are on page 1of 18

SPE 135304

A two-stage well placement optimization method based on adjoint gradient


Fahim Forouzanfar, SPE, Gaoming Li, SPE, and A. C. Reynolds, SPE, U. of Tulsa
Copyright 2010, Society of Petroleum Engineers
This paper was prepared for presentation at the 2010 SPE Annual Technical Conference and Exhibition held in Florence, Tuscany,
Italy, 20-22 September 2010.

This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents
of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect any
position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written
consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may not
be copied. The abstract must contain conspicuous acknowledgment of SPE copyright.

Abstract
As well locations are represented as integer well gridblock indices in reservoir simulators, determining optimal well
locations is most naturally treated as a discrete optimization problem. A few recent papers in the literature have attempted
to convert this discrete optimization problem into a continuous optimization problem, but most of these papers require that
one specify a priori both the number of wells to be drilled and the operating rates (or bottomhole pressures) for the specified
operational life of the reservoir. Therefore, the final optimal well locations may not be optimal when different well rates (or
bottomhole pressure) and/or reservoir production life are specified. The methodology in this paper attempts to mitigate
the effects of an ad hoc specification of both operating well rates (or pressures) and operational reservoir life by using an
initialization step to determine an appropriate total reservoir water injection rate and/or total reservoir production rate for
the specified operational life. After the initialization stage a second stage is performed in which we estimate (i) the optimal
number of water injection wells and/or producing wells; (ii) the optimal location of these wells and (iii) the optimal rates at
these wells. Both stages use a gradient based optimization algorithm with the relevant gradient computed by a combination
of the adjoint method and analytical methods for linear constraints which are imposed using a gradient projection method.
A practical method is proposed for imposing nonlinear bound constraints on the bottomhole pressure of each well.

Introduction
Determining the optimum number and locations of production and injection wells is a critical step in preparing the initial
development plan for a reservoir when the objective is to maximize total hydrocarbon recovery or net present value (NPV) for
the estimated operational life of the reservoir. In commercial reservoir simulators, the location of a well is commonly defined
by the well grid block indices ((i, j) or (i, j, k)) thus, the problem is naturally formulated as discrete optimization problem
where one wishes to determine the optimal well grid block indices for wells. When considering the determination of well
locations as a discrete optimization problem, researchers have focused on using non-gradient-based optimization algorithms to
solve the optimal well placement problem. The genetic algorithm (Bittencourt and Horne, 1997; Yeten et al., 2002; Ozdogan
and Horne, 2006; Bangerth et al., 2006; Emerick et al., 2009), neural-networks (Centilmen et al., 1999; Yeten et al., 2002) and
simulated annealing (Beckner and Song, 1995; Norrena and Deutsch, 2002) have been tried. Of the derivative free methods
that have been proposed, the genetic algorithm methodology of Emerick et al. (2009) may be the most robust for practical
field application as the authors have successfully applied it in the field to optimize well trajectory, length and location as well
as the number of injectors or producers. As is typical of derivative free optimization algorithms, the method of Emerick et al.
(2009) is computationally demanding and requires on the order of 5,000 or more reservoir simulation runs to estimate the
optimal well positions. Because of the computational inefficiency of the non-gradient-based optimization algorithms, Handels
et al. (2007); Sarma and Chen (2008); Wang et al. (2007); Zhang et al. (2010) reformulated the optimal well placement
problem so that it can be treated as an optimization problem on continuous variables and be solved with more efficient
gradient-based methods.
The method of Handels et al. (2007) is the first attempt to use a gradient-based optimization algorithm for optimal
well placement where optimal well locations are defined as those that maximize NPV over a specific total production time
specified a priori. Although this method still seeks to find the discrete (i, j) indices of optimal well location for two-dimensional
problems, wells are moved from simulator gridblock to simulator gridblock based on a gradient calculation. Specifically, eight
“pseudo-wells” with very small injection or production rates are placed around each actual well. Although the pseudo-wells
have a negligible impact on the NPV, the gradient of the NPV with respect to all the pseudo-well rates can be obtained with
one backward adjoint run. Based on this gradient calculation, a well is moved to the location of the pseudo-well that has the
largest gradient regardless of whether this movement actually increases or decreases NPV. Thus, NPV may oscillate (increase
2 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

and then decrease) from iteration to iteration of the optimization algorithm and it is not possible to use standard convergence
criterion. In our application of this method, we terminate iteration when repeat a well configuration from a previous iteration
or when the number of iterations exceeds a specified value (e.g. 100). We choose the well locations corresponding to the
iteration with the highest NPV value as the optimal well locations. The well controls are predetermined and fixed for the
specified reservoir production life; hence, the final well locations depend on the specified well controls (Zandvliet et al., 2008).
Similar to Handels et al. (2007); Zandvliet et al. (2008), Sarma and Chen (2008) put pseudo-wells in gridblocks around
each actual well. Instead of using a very small rate for the pseudo-wells, Sarma and Chen (2008) distributed the well rate
among the actual well and its associated pseudo-wells according to the distance from each pseudo-well to the actual well
location (xw , yw ). It is important to note that, in this approach, the actual well location (xw , yw ) is not necessarily at the
center of a gridblock. During optimization, the actual well locations (xw , yw )’s are treated as the parameters to be estimated
and the rate at each actual well and its pseudo-wells are explicit functions of the areal coordinates, xw and yw , of its location.
The adjoint method can be applied to calculate the gradient of the NPV with respect to xw and yw . Unlike the method
of Handels et al. (2007) and Zandvliet et al. (2008), the parameters xw and yw are continuous, therefore, the method is a
true gradient-based well placement optimization algorithm. The two potential advantages of the Sarma and Chen (2008)
method over the Handels et al. (2007) method are (i) the search direction is not limited to the eight directions defined by the
eight line segments connecting the gridblock center of the actual well gridblock to the centers of the gridblocks containing
pseudo-wells and (ii) the step size in the gradient direction is not arbitrarily bounded by the dimensions of a gridblock so it
is possible that the well can be moved from its currect gridblock to a gridblock far from its current location.
Wang et al. (2007) introduced a different gradient-based procedure to optimize locations of water injection wells. Their
main idea was initialize the optimization procedure by placing an injection well in every gridblock not containing a producing
well. In addition they added a term to the conventional NPV function to account for the cost of drilling each well. Then well
rates are adjusted to maximize NPV over a specified reservoir lifetime. If the rate of one of the initial wells becomes zero,
the well is eliminated from the system and the cost of drilling that well is removed from the modified NPV function. As the
problem requires the rates of some wells go to zero, Wang et al. (2007) applied the steepest ascent algorithm with limited
step size so that at most one well is eliminated at each iteration which is computationally inefficient when the initial number
of wells is large. Zhang et al. (2010) significantly improved the computational efficiency of the optimization procedure using a
gradient projection method. With gradient projection, at early iterations, it is often possible to remove several wells during a
single iteration. The techniques used in Handels et al. (2007) and Zandvliet et al. (2008) will occasionally reduce the number
of wells by moving two or more wells into the same gridblock, in which case all wells are combined and treated as a single
well, and the method of Emerick et al. (2009) can sometimes make a small decrease in the number of wells. Most of the
other methods in the literature require that the number of wells are specified a priori. One advantage of the procedure of
Wang et al. (2007) and Zhang et al. (2010), as well as the basic algorithm presented here is that they allows one to attempt
to optimize (a) the number of wells, (b) the location of wells, and (c) the well rates, simultaneously.
This paper improves the basic methodology introduced in Wang et al. (2007) and Zhang et al. (2010) so that it can be
applied to more realistic problems, i.e., three-dimensional three-phase flow problems where the objective is to optimize not
simply the location of water injection wells, but the location of both producers and injectors. In addition, unlike the work of
Wang et al. (2007) and Zhang et al. (2010), we put bound constraints on wellbore pressures because in reality a water injection
well is always constrained to maximum bottomhole pressure and producing wells always have a minimum bottomhole pressure
constraint. As upper and lower bottomhole pressure constraints represent nonlinear constraints when our parameters or well
controls are flow rates, adding bound constraints on bottomhole pressures adds a significant complication to the optimization
problem. As the commercial simulator used (Eclipse 300) does not provide the gradient of these nonlinear constraints on
pressure, we have devised a novel method to ensure the satisfaction of these nonlinear bottomhole pressure constraints for
rate controlled wells. Our final contribution to the optimal well placement problem is the introduction of an initial stage
where we determine optimal total injection and production rates for the specified expected life of the reservoir. In most of
the optimal well placement algorithms presented in the literature, the well controls and the expected reservoir life are both
specified a priori and fixed during optimization, which results in an sub-optimal solution. To overcome this problem, we
use an initialization step to find appropriate total reservoir injection/production rates for a specified reservoir life. Then, in
the second stage, we use these total rate constraints as equality constraints when applying a gradient projection method to
reduce the wells to an optimal number at optimal locations as well as optimizing the well controls of the remaining wells.
Computational experiments, including results shown here, indicate that the two-stage procedure provides a more robust
algorithm although optimization without the initialization stage sometimes yields a slightly higher NPV than optimization
after the initial step.We compare our well placement results (TUPREP method) with the results from Handels et al. (2007).

Well Placement Problem Definition


Following the basic ideas of Wang et al. (2007) and Zhang et al. (2010), the problem of determining the optimal location
of new wells (injectors and producers) is equated to the problem of maximizing a modified net present value (NPV) cost
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 3

function J[u] where u denotes the vector of well controls (flow rates) and J[u] is defined by
Ninj Nprd
X X
J(u) = NPV − [finj,i (u) Cinj ] − [fprd,j (u) Cprd ] , (1)
i=1 j=1

where N P V denotes the standard net present value function defined below, Cinj represents the cost of drilling one injection
well and Cprd represents the cost of drilling one producing well. Ninj and Nprd , respectively, denote the initial number
of injection wells and the maximum number of production wells that are placed in the reservoir at the initial step of the
optimization procedure developed in this paper. In this optimization algorithm, we use large values of Ninj and Nprd but at
convergence, the optimal number of injectors and optimal number of producers, respectively, are typically far smaller than
Ninj and Nprd . In order to economically justify drilling each well, the resulting increase in the standard NPV function must
be greater than the cost of drilling that well. Note that the two sums on the right side of Eq. 1 represent the costs of drilling
wells. If the optimum value of the kth injection well’s rate is zero, then finj,k (u) = 0, the corresponding kth cost term in
the first sum of Eq. 1 will be zero and the kth injection well will not be drilled. On the other hand, if the optimal solution
includes drilling well k, we wish to have finj,k (u) to be equal to, or very close to 1 so that the cost of drilling this well
will be fully accounted for in the modified NPV function, J[u]. While these two limiting values of 0 and 1 are desirable, at
the same time, we need to define finj,i (u) so that it is continuously differentiable and its derivatives take on values during
optimization that are non-negligible compared to the corresponding values of the derivatives of NPV. It is not possible to
satisfy the conditions on the gradient of finj,i (u) and also have finj,i (u) = 1 for qinj,i 6= 0 and finj,i (u) = 1 for qinj,i = 0.
Similar comments apply to the fprd,j (u) terms which account for the cost of drilling producing wells. Thus, we must make
some ad hoc choices to obtain an efficient algorithm.
Here only two-phase flow of oil and water is considered. At each potential injection well, the injection rate is the control
whereas at the jth producing well, the total liquid rate, qprd,j , is the control. Thus, the vector of all controls is given by

u = [qinj,1 , qinj,2 , · · · , qinj,Ninj , qprd,1 , qprd,2 , · · · , qprd,Nprd ]T . (2)

NPV in Eq. 1, represents the standard net present value including the oil revenue and the injection and production water
cost and is defined as
Nt  PNprd n n
 PNinj n

j=1 ro qo,j − rw qw,j − i=1 rwinj qinj,i
X
NPV = tn /365
∆tn , (3)
n=1
(1 + b)

where Nt is the number of reservoir simulation time steps, ∆tn represents the size of the nth timestep in days, tn represents
n n
the total simulation time in days at the end of the nth timestep, qo,j and qw,j , respectively, represent the average oil and
n
water production rates of the jth producer over the nth simulation timestep and qinj,i is the average injection rate of the ith
injection well over the nth simulation timestep, ro in $/STB is the oil revenue per unit volume, rw in $/STB is the water
disposal cost per unit volume, rwinj in $/STB is the water injection cost per unit volume, and b is the annual discount rate.
The functional J[u] is maximized subject to constraints on the controls (well rates) using a gradient projection method
(Nocedal and Wright, 1999). The gradient of NPV with respect to the control vector u is computed with the adjoint method
for multiphase flow (Wu et al., 1999; Li et al., 2003; Brouwer and Jansen, 2004; Sarma et al., 2005; Kraaijevanger et al., 2007)
with the gradient of the terms in the summations of Eq. 1 computed analytically. In this work, we use the “Eclipse Reservoir
Optimization” option in Eclipse 300 for the gradient calculation. This option gives the derivative of NPV with respect to
each control variable at each control step, i.e., ∂NPV
∂un , where uni is the ith control variable at the nth control step. For the well
i
placement problem, however, we specify each well control (the total rate at each well) as constant throughout the reservoir
life, i.e., uni = ui for all n. The gradient of the NPV for the whole reservoir life with respect to ui can be computed as
Nt  Nt
∂NPV ∂uni
 X
∂NPV X ∂NPV
= n = . (4)
∂ui n=1
∂ui ∂u i j=1
∂uni

In Eq. 1, we want the term finj,i (u)Cinj to represent an accurate approximation of the cost of drilling injection well i.
If finj,i (u) = 0 the well is deleted from the system, i.e., is not drilled and the associated drilling cost does not contribute
to the total cost of drilling all injection wells which is given by the first sum on the right side of Eq. 1. Similar comments
apply to fprd,j (u)Cprd which we introduce to accurately represent the cost of drilling the jth production well. The functions
finj,i (u) and fprd,j (u) must have significant sensitivity to the control vector u so that the terms involving the cost of the
number of wells and their gradients are sensitive to u during optimization; moreover, these functions should be continuously
differentiable with respect to the control vector and theoretically should have a value close to 1.0 if the well exists (rate not
zero) and equal to zero if the well is deleted by setting its flow rate equal to zero. Wang et al. (2007) and Zhang et al. (2010),
4 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

who considered only the optimal placement of water injection wells, used the following function:
qinj,i
finj,i (u) = , (5)
qinj,i + β
where β is a constant. (The function fprd,j (u) for each production well could be defined in a similar way.) Although we have
always been able to obtain via experimentation a β that works well for a given problem, the basic form of Eq. 5 makes it
difficult to choose β so the function has the desirable attributes specified earlier. In order to have finj,i (u) ≈ 1 whenever
qinj,i 6= 0, we wish to use a small value for β, but if β is small,
∂finj,i β β
= 2
≈ 2 . (6)
∂qinj,i (qinj,i + β) qinj,i
is small and this tends to make the gradient of the two sums representing drilling costs in Eq. 1 very insensitive to the change
of the well controls (injection or production rates) which is not desirable.
To overcome this difficulty, we have experimented with a variety of forms for the functions finj,i (u) and fprd,i (u). Via
extensive experimentation, we have arrived at a form that results in a fairly robust optimization algorithm. Specifically, we
define these functions at the ` iteration of the optimization algorithm by:
!1/4
`
` `
 qinj,i
finj,i qinj,i = `−1
, (7)
qinj,i
for i = 1, 2, · · · Ninj and
!1/4
`
` `
 qprd,j
fprd,j qprd,j = `−1
, (8)
qprd,j
` `−1
for j = 1, 2, · · · Nprd . Note that qinj,i and qinj,i , respectively, represent the injection rate of well i at the current (`th) and
` `−1
previous iterations of the optimization algorithm. A similar comment apply to qprd,j and qprd,j . Differentiating Eq. 7 gives
 !1/4 !
∂f ` qinj,i
`
1 `
qinj,i 1
`
= `−1 `
, (9)
∂qinj,i 4 qinj,i qinj,i
` `
which is strongly dependent on qinj,i particularly for small values of qinj,i which is useful for driving rates to zero (eliminating
wells) during the optimization process. However, as the well rate can decrease or increase significantly from iteration to
`
iteration, the function in Eq. 7 can take values significantly different than 1.0 for qinj,i 6= 0. (Using the 1/4 root in Eqs. 7
and 8 moderates this deviation from unity.) To avoid this potential difficulty, we simply use the definitions of Eqs. 7 and 8
when computing gradients but when evaluating J[u], we set finj,i = 1.0 if qinj,i > 0 and set fprd,j = 1.0 whenever qprd,j > 0.
The examples presented here were all done with this procedure. For well placement optimization, we wish to maximize
the modified NPV functional J[u] subject to bound constraints and possibly equality and inequality constraints. Bound
constraints would naturally include minimum and maximum values of flowing bottomhole pressures and well flow rates. As
we have defined the controls as well rates, a constraint on bottomhole pressure is a nonlinear function of the control vector
and the calculation of its gradient could not be done analytically. In the well placement optimization procedures presented
here, a method is introduced to avoid violation of bounds on wellbore pressure by adjusting the upper bound on the rate
so the well can always operate under a specified rate control and does not switch to bottomhole pressure control during an
iteration of the optimization algorithm. This obviates the need to compute gradients of nonlinear constraints and bound
constraints are explicitly imposed only on the components of the rate control vector during an iteration of the optimization
algorithm.
In addition, equality constraints are imposed on the total injection rate and the total production rate. This is done not
because it is required for the definition of the well optimization problem but because it improves the robustness and efficiency
of the algorithm we use here which starts with a large number of potential wells and tries to eliminate a large number of
them during iterations of the optimization algorithm. By using an equality constraint on the total injection rate and the total
production rate, if J[u] is increased by increasing the rates at some wells, the rates at some other wells must be decreased.
As the only way to eliminate a well is to decrease its rate to zero, the equality constraints on total rates tend to promote our
objective of eliminating some wells. On the other hand, specifying the total injection (or production) rate a priori is difficult
as if it is too large, we may not be able to reset a well’s rate to avoid violation of specified bounds on flowing bottomhole
pressure. To avoid this problem, a two-stage optimization procedure is introduced where in the first initialization stage,
we try to find appropriate values to use for the total injection rate and total production rate when specifying the equality
constraints.
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 5

Gradient Projection for Linear Constraints


In the basic algorithm,we maximize the functional J(u), subject to the following constraints,
Ninj
X
qinj,i = qt,inj , (10)
i=1

Nprd
X
qprd,i = qt,prd , (11)
i=1

0 ≤ qinj,i ≤ qt,inj , (12)


0 ≤ qprd,j ≤ qt,prd . (13)
In the initialization stage where we determine approximate total rates, we use only the bound constraints.
The total rate constraints (Eqs. 10 and 11) and all active bound constraints can be written in the matrix form,

Au = b, (14)

where A is an M × (Ninj + Nprd ) matrix, b is an M -dimensional column vector and M is the number of active constraints
which in the basic algorithm include the linear total rate constraints and the active bound constraints. For example, in the
case where there are two active bound constraints (the rates of the first injector is at its lower bound and second producer
is at its lower bound), A and b, respectively, are given by,
 
1 1 ···1 0 0 ··· 0
0 0 · · · 0 1 1 · · · 1
A= 1 0 · · · 0 0 0 · · · 0 ,
 (15)
0 0 ···0 0 1 ··· 0

and  
qt,inj
qt,prd 
 0 .
b=  (16)
0
During maximization, the control vector is updated as

u`+1 = u` + α`+1 d`+1 , (17)

where ` is the iteration index, d`+1 is the search direction obtained by projecting the gradient g` = ∇J[u` ] onto the hyperplane
of the active constraints, i.e.,
d`+1 = (I − AT (AAT )−1 A)g` . (18)
It is shown in Luenberger (1984) that the projected gradient d`+1 is uphill (g`T d`+1 > 0) and the active constraints are
satisfied at the (` + 1)st iteration as long as they are satisfied at the `th iteration, i.e., Ad`+1 = 0.

Basic Optimization Algorithm


In order to achieve the goal of eliminating more than one well per iteration by setting its rate to zero, we attempt to
project the gradient onto L bounds at the same time where L is a positive integer which represents the maximum number of
wells we try to eliminate at one iteration of the optimization algorithm. In the discussion of this procedure, we use general
notation and let ulow
i and uup
i , respectively, represent the lower and upper bound for the ith control variable, ui . Given the
search direction d , at least one component of u would reach either its lower or upper bound if the step size α`+1 were set
`+1
`+1
equal to αmax defined as
`+1 `+1
αmax = min (αmax,i ), (19)
where  ulow −u`
i
 d`+1
 i
if d`+1
i < 0,
 i
`+1
αmax,i = (20)
 uup `
i −ui

d`+1

d`+1
if i > 0.
i
6 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

The step size α`+1 = αmax `+1


decreases the rate of at least one well to zero. Note that if this step size gives uk = qinj,k equal
to its upper bound, then Eq. 10 implies that the injection rate of all other wells must be equal to zero so we are left with a
single injection well. If the step size results uk = qinj,k equal to its lower bound, then the kth injection well is eliminated from
the system. As similar comments apply to the case where the rate at a producing well is equal to one of its bounds, using
the step size defined by Eq. 19 eliminates at least one well (either a producer or an injector) by setting its rate to zero. This
discussion illustrates the advantages of using the total rates as upper bounds (Eqs. 12 and 13) in combination with equality
constraints based on total rates (Eqs. 10 and 11). One additional comment is needed before discussing the basic algorithm.
If the step size defined by Eq. 19 does not give J[u`+1 ] > J[u` ], then we need to cut the step size until we obtain an increase
in the objective function. Here, we use a very simple procedure; we simply cut the step size by a factor of 1/2.
The procedure for calculating u`+1 given u` follows:

1. Specify L, the number of wells we attempt to eliminate at each iteration. Set the iteration index to ` = 1.

2. Compute the gradient g` = ∇J[u` ] and apply Eq. 18 to project the gradient to the equality constraints of Eqs. 10 and
11 and the active bound constraints to obtain the search direction d`+1 (Eq. 18), which is now denoted by d1,`+1 .

3. Set α1,`+1 = αmax where αmax is computed from Eqs. 19 and 20. Set u1,`+1 = u` + α1,`+1 d1,`+1 . By our previous
discussion the number of components (well rates) of u1,`+1 that are equal to zero is strictly greater than the number of
zero components of u` .

4. Add all new active bound constraints from step 3 to update the matrix A and vector b in Eq. 14 and then project the
gradient g` to the updated set of active of linear constraints, i.e., apply Eq. 18 to obtain a new search direction which
we denote by d2,`+1 .

5. Repeat steps 3 and 4 for k = 2, 3, · · · L to obtain uk,`+1 . From our previous discussion, the number of zero components
of uL,`+1 is greater than or equal to L plus the number of zero components u` . Thus setting u`+1 = uL,`+1 effectively
removes at least L wells from the system.

6. Set k = L.

7. In steps 4 and 5, no reservoir simulation runs are required. In the current step, we run the simulator with the controls
specified by uk,`+1 and calculate J[uk,`+1 ].

8. If J[uk,`+1 ] > J[u` ], set u`+1 = uk,`+1 , and check for convergence. If the algorithm meets the convergence criteria
defined later, we terminate the algorithm. If not, we increase the iteration index ` by one, and proceed to the next
iteration, i.e., go to step 2. Otherwise, go to step 9.

9. If k > 1, decrease k by one and go to step 7. If k = 1, set α`+1 = 0.5αmax `+1 `+1
where αmax is calculated from Eq. 19 and
`+1 ` `+1 `+1 ` `+1 `+1
set uc = u + α g` . If J[uc ] > J[u ], set u = uc , add one to ` and go to step 2. Otherwise, we decrease the
current step size α`+1 by a factor of 2 again and repeat the process. Cutting the step size by a factor of two is repeated
at most five times. If this fails to give a u`+1 that increases the functional J, then we terminate the algorithm with u`
as our approximation of the optimal controls. Note if we reach the point where we cut the step size in half, then no
well rates are set to zero during the iteration, i.e., no wells are eliminated; instead, we are simply changing some of the
rates to attempt to increase the NPV.

The procedure described in this section is for the most general case of optimizing both producers and injectors simul-
taneously. A similar procedure can be applied for finding the optimal locations of only injection wells or only producing
wells.
In the examples presented here, we actually did not use a standard convergence test. Instead, we always terminated
iteration when we reached the point in step 9 where the step size was cut in half five times without finding new control
settings that increased the modified NPV value function. We however have the option of terminating the algorithm if

|J[u`+1 ] − J[u` ]| n |u`+1 − u` | o


< J i  i
 and max < u , (21)
max J[u` ], 1 i max u`i , 1

or if the gradient is very small; see the discussion in Oliver et al. (2008) on convergence criteria for optimization algorithms.
With the definition of the optimal well location problem described in this paper, the well controls are well rates which are
held constant for the whole reservoir life. However, for application to real fields, we would wish impose some lower limit on
the bottomhole pressure at a producing well and an upper limit on the wellbore pressure at each injection well, for example
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 7

to keep the pressure below parting pressure to avoid fracturing the formation. These pressure constraints for injection well
and producing wells, respectively are written as
pwf,inj,i < pwf,max , (22)
for i = 1, 2, · · · Ninj and
pwf,prd,j > pwf,min , (23)
for j = 1, 2, · · · Nprd . As each bottomhole pressure is a nonlinear function of the well rates, the constraints in Eqs. 22 and 23
are nonlinear state-control constraints and if these pressure constraints are added to the constrained optimization problem,
the gradients of these constraints with respect to the controls (well rates) must be calculated during each iteration of the
optimization algorithm. Although this gradient calculation can be done with the adjoint method, our objective is to couple
our well placement algorithms with commercial simulators. Since Eclipse 300, which is used in the examples presented here,
and other commercial simulators do not provide the adjoint gradient of bottomhole pressure with respect to well rates, we
impose a practical way to ensure that these bottomhole pressure constraints are satisfied during well placement optimization
without explicitly adding the constraints to the optimization problem definition.
In the proposed method, we explicitly include the bottomhole pressure constraints in the input file of the reservoir
simulator during each iteration of the well placement optimization. If all wells can meet the rate target and no bottomhole
pressure constraints are invoked, the well placement optimization is exactly as described above. If a well cannot meet the
constant rate target specified in the current control vector without violating a wellbore pressure constraint, we will cut the
rate before doing the optimization step in a way that ensures the well can produce (or inject) at the specified rate without
violating its pressure constraint. Because the total production rate and total injection rate are fixed by the two equality
constraints, if the producing (or injection) rate is cut at one well, the rate at one or more other wells must be increased to
satisfy the relevant equality constraint on total rate. During the course of this research, significant experimentation was done
to attempt to find a good way to make these rate changes. Of the methods we tried, the one described below worked best.
Effectively, we replace step 8 and 9 of the basic algorithm described earlier by the follow procedure:
(i) If (a) k ≥ 1, (b) J[uk,`+1 ] > J[u` ], and (c) no bottomhole pressure constraints are violated, set u`+1 = uk,`+1 , and check
for convergence. If the algorithm meets the convergence criteria defined later, we terminate the algorithm. If not, we increase
the iteration index ` by one, and proceed to the next iteration, i.e., go to step 2 of the basic procedure described previously.
Otherwise, go to step (ii).
(ii) If k > 1, decrease k by one and go to step 7 of the basic procedure described previously. Otherwise, we must have k = 1
and we go to step (iii).
(iii) If we arrive at this step, there are only two possibilities. (a) If J[u1,`+1 ] ≤ J[u` ], then exactly as in step 9 of the original
algorithm, we cut the step by a factor of two until we generate a u`+1 which results in an increase J but if we fail to increase
J after five cuts of the step size, we terminate the algorithm. (b) If J[u1,`+1 ] ≥ J[u` ] and a pressure constraint is violated at
one or more wells, then we redistribute rates and modify the gradient projection algorithm according to steps (iv) through
(v).
(iv) Recall that the first Ninj components of the control vector u correspond to controls (rates) at the Ninj potential injection
wells and the last Nprd entries of u correspond to controls (rates) at the Nprd potential producing wells. If the jth producer
opt
is switched from the rate control qprd,j ≡ u1,`+1
j+Ninj to production at the minimum bottomhole pressure during the simulation
run using the controls specified by u1,`+1 , then we simply set u1,`+1
j+Ninj equal to the minimum producing rate, qprd, min,j ,
obtained at any time step of the reservoir simulation run and modify the upper bound on ui to uup i = qprd, min,j in order
to try to prevent a violation of the bottomhole pressure constraint at future iterations of the gradient projection algorithm.
We apply the preceding rate control modification at each producing well where the well producing condition was switched
to minimum bottomhole pressure control during the reservoir simulation run. Because some well flow rates are decreased
by this modification, the sum of the producing rates is no longer equal to the total production rate, qt,prd specified in the
equality constraint of Eq. 11. To satisfy this equality constraint, we must increase the production rates at some wells where
the bottomhole pressure constraint was not violated. Assuming that the components of u1,`+1 that were set equal to the
corresponding minimum rate by this procedure are given by uk1,`+1j
, j = 1, 2, · · · mp , the sum of the last Nprd components of
1,`+1
u is equal to the qt,prd − qprd,redis where
mp  
X opt
qprd,redis = qprd,kj − qprd,min,kj , (24)
j=1

To satisfy the equality constraint of Eq. 11, we must increase the rates at some wells where the bottomhole pressure constraint
was not violated and the sum of these rates increases must sum to qprd,redis . Although there are many ways to distribute this
total rate qprd,redis , we want to do so in a way that does not tend to introduce new violations of the minimum bottomhole
pressure constraint. The best procedure we have found to minimize the number of new violations of the minimum bottomhole
8 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

pressure constraint is to distribute qprd,redis inversely proportional to the well rates. Specifically, if u1,`+1 opt
Ninj +ni = qprd,ni ,
i = 1, 2, · · · mq , denotes the set of producing liquid rate controls that were honored throughout the reservoir simulation run,
the rate controls at these wells are changed to
1 1
u1,`+1
Ninj +ni = opt opt qprd,redis opt
+ qprd,ni
, (25)
qprd,inv qprd,ni

opt
where qprd,inv is defined by
mq
opt
X 1
qprd,inv = . (26)
q opt
i=1 prd,ni
Exactly the same procedure is used to modify rate controls at injection wells if the upper bound on the injection pressure
cannot be honored with the injection rate specified by the injection rate components of u1,`+1 .
(v) With the rate control modification from step (iv), the reservoir simulator is rerun. In the uncommon event that one or
more wells is converted to bottomhole pressure control during this simulation run, return to step (iv) and perform another
rate modification and redistribution step. If the simulator runs without converting any rate control to bottomhole pressure
control, then we return to step (i).
Finally there is one additional modification that needs to be made in step 2 of the original algorithm whenever a change
in a well’s rate was required (step (iv)) to avoid violating a bottomhole pressure bound at the previous iteration of the
optimization algorithm. For clarity in the description, we first consider the case where the rate control for injector i was
changed to u`+1
i = qinj, min,i and the upper bound constraint was changed to ui ≤ uup i ≡ qinj, min,i . The question is whether
this upper bound should be incorporated as an active constraint at the next iteration of the gradient projection method. To
make this decision, we first assume that the well constraint for this well is inactive and compute the projected gradient for the
specified value of L, step 2 of the basic algorithm. If the component of the search direction corresponding to the rate control
for injection well i is positive, a step in the search direction would increase ui to a value greater than uup i = qinj, min,i which
would be likely to result in a violation of the maximum bottomhole pressure constraint. To avoid this possibility, we simply
make ui = qinj, min,i an active constraint and recompute the projected gradient with this active constraint. If the component
of the search direction corresponding to the rate control for injection well i is negative, a step in the search direction would
decrease ui to a value smaller than uup i which would not cause a violation of the maximum bottomhole pressure constraint so
the constraint ui ≤ qinj, min,i is inactive. We apply this procedure at all injection and producing wells where an upper bound
constraint of the form ui ≤ uup up
i ≡ qinj, min,i or uNinj +i ≤ uNinj +i ≡ qprd, min,i was introduced at a previous iteration in order
to define the set of constraints active at the beginning of the next iteration.

Initialization Step for the Basic Algorithm


The “optimal well locations” determined by methods presented in the literature depend on the specified well rates (or
pressures) and the specified operational life of the reservoir. For example, suppose we wish to drill a single additional water
injection well in a reservoir that is under production but currently has a single producing well. If a small water injection rate
and a short reservoir life time are specified, an optimal location of the injector will be closer to the producer than for the
case where a high water injection rate and a much longer reservoir life time are specified. The basic optimization algorithm
we developed has the advantage that only the total reservoir injection and production rates need to be specified and optimal
rates for individual wells are determined simultaneously with location during the optimization process. Nevertheless, our
method is still sensitive to the total rates specified and the operational time specified. By invoking the initialization algorithm
described in this section to determine the total injection and production rates to be used in the equality constraints of Eqs. 10
and 11, we have found that the robustness and efficiency of our basic algorithm is improved.
In this initialization stage, we determine the appropriate total injection rate and/or total production rate at the first
stage by maximizing the conventional NPV functional of Eq. 3 and then use the total injection/production rates obtained
from this step in the equality constraints of Eqs. 10 and 11 and apply the basic optimization algorithm defined in the previous
section to maximize the functional J defined in Eq. 1 subject to the total rate constraints and the bound constraints. In
the initialization stage where appropriate total rates are determined for a specified reservoir life time, no equality constraints
are imposed; however, an upper bound for each well rate is specified and this bound may change from iteration to iteration.
We still attempt to drive the rate control for some wells to a lower bound (zero) or an upper bound by taking a step size as
defined by Eq. 19, i.e., we still use a projection gradient type algorithm. We stop the optimization procedure when the step
size of Eq. 19 cannot result in an increasing NPV. In this initialization step, optimization of producing well rates alternates
with optimization of injection well rates from one iteration to the next.
The specific steps of the total rate initialization algorithm in the most general case (initializing both the production and
injection total rates) follows:
1. Define the production time, tp , corresponding to the presumed operational life of the reservoir.
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 9

2. Distribute a large number of producers and injectors in the reservoir with the total production rate in RB/D approxi-
mately equal to total injection rate in RB/D. A reasonable choice for the initial total production rate, qt,prd , is choose
this rate so that qt,prd × tp is equal to 1/2 of the number of stock tank barrels of oil initially in place. These total rates
are distributed uniformly among the injection wells and producing wells. With this set of rates (well controls) run the
simulator to ensure that no bottomhole pressure constraint is violated. If it is, we increase the production time, tp ,
and define lower total production and injection rates and try again. As noted below, this total production rate can be
increased during the iteration. After distributing the rates, Set the outer iteration index to k = 0.
3. If k is an even number go to step 4; otherwise go to step 5.
4. Set the controls of active producers (those with non-zero production rate from the previous production well optimization
in step 5 below or if k = 0, the initial set of producers) at constant bottomhole pressure with the value of producing
bottomhole pressure specified such that the drawdown pressure is 75% of the maximum possible drawdown, i.e., operate
producing well j at the bottomhole pressure specified by
pwf,prd,j = pinitial − 0.75 ∗ (pinitial − pwf,min ), (27)
where pinitial is the initial datum reservoir pressure. Next we apply the basic projection gradient algorithm derived
earlier to maximize the standard NPV by modifying only injection rates but with three changes: (a) no equality
constraints on total rates are used; (b) no cutting of the step size is done in step (iii) of the modification of the basic
algorithm, i.e., if no uk,`+1 , k = L, L − 1, · · · 1 increases the NPV while satisfying the upper bound on injection well
bottomhole pressure, this step of the algorithm is terminated; and (c) at the ` + 1st iteration of the basic optimization
algorithm, we redefine the upper bound on the injection rate of injection well i as

uup,`+1 up,`+1  up ` up,BHP


i = qinj,i = min qinj,i , 2qinj,i , qinj,i . (28)
up up,BHP
where qinj,i is the initially specified upper bound for the rate of injection well i and qinj,i is the approximation of the
up,BHP
maximum rate that can be used without violating the upper bound on the injection well pressure. The value of qinj,i
would be explicitly determined only if injection well i was unable to inject at the optimal rate determined without
violating the bottomhole pressure constraint; see step (iv) of the modification introduced to eliminate violations of the
up,BHP up
bottomhole pressure constraint. If this modification did not occur, we would simply set qinj,i = qinj,i . We terminate
this step of the optimization when the step size of Eq. 19 cannot result in an increasing NPV and move on to the next
step. (During this optimization step, we will typically eliminate some injectors by taking the injection rates to the
lower bound of zero.)
5. In this step, we fix the flowing wellbore pressure at injection wells that were not eliminated in step 4 to
pwf,inj,j = pinitial + 0.75 ∗ (pwf,max − pinitial ). (29)
and then optimize on the production rates using the same approach as in step 4 but with the upper bound on the
production rate changed at each iteration according to
uup,`+1 up,`+1  up ` up,BHP
Ninj +j = qprd,j = min qprd,j , 2qprd,j , qprd,j , (30)
where the notation in Eq. 30 is the obvious extension to producing wells of the notation used in Eq. 28.
Note during this step, we may eliminate some production wells by driving their liquid production rates to zero. As in
step 4, this gradient projection iterative process terminates when the step size of Eq. 19 cannot result in an increasing
NPV.
6. If we were unable to increase NPV in both steps 4 and 5, the initialization algorithm is terminated. Otherwise, we add
one to the outer iteration index k and return to step 3.
A similar but simpler procedure which is explained in above is applied for the initialization step when placing only the
injectors or the producers. We still apply the gradient projection method without any total rate constraint to optimize
NPV while we modify the upper bound constraints as the same way as in the preceding initialization algorithm. For these
specific cases, steps 1 and 2 remains the same, but instead of doing the optimization on injectors and producers sequentially,
we just do optimization on the desired well group. For example if we want to do the initialization step for producers, the
production well rates are the only variables and the objective of the initialization step is to find an appropriate total rate for
the producers to use in the equality constraint when applying the basic optimization algorithm. In this case, step 4 of the
initialization algorithm is deleted and in step 5 we do not need to change the controls of injection wells to the BHP values
specified by Eq. 30. The user is free to specify appropriate wellbore pressures or injection rates.
10 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

Example 1: 2D Heterogenous Reservoir


Example 1 is a 2D, two phase (oil-water), heterogeneous reservoir. The reservoir size is 3000 × 2000 ft with a 15 × 10
grid system. Porosity is constant and equal to 0.25 throughout the reservoir. The log-permeability field of the reservoir is
shown in Fig. 1. The total and hydrocarbon pore volumes of this reservoir are 13.6 and 10.6 MMrb, respectively.

1 0 In j- 3 3 In j- 3 4 In j- 3 5 In j- 3 6 In j- 3 7 In j- 3 8 In j- 3 9 In j- 4 0

9 P rd -3 3 P rd -3 4 P rd -3 5 P rd -3 6 P rd -3 7 P rd -3 8 P rd -3 9 P rd -4 0

8 P rd -2 5 P rd -2 6 P rd -2 7 P rd -2 8 P rd -2 9 P rd -3 0 P rd -3 1 P rd -3 2 5 .4 7 0
5 .0 4 7
7 In j- 2 5 In j- 2 6 In j- 2 7 In j- 2 8 In j- 2 9 In j- 3 0 In j- 3 1 In j- 3 2
4 .6 2 5
6 P rd -1 7 P rd -1 8 P rd -1 9 P rd -2 0 P rd -2 1 P rd -2 2 P rd -2 3 P rd -2 4 4 .2 0 2
3 .7 8 0
5 In j- 1 7 In j- 1 8 In j- 1 9 In j- 2 0 In j- 2 1 In j- 2 2 In j- 2 3 In j- 2 4
3 .3 5 7

4 P rd -9 P rd -1 0 P rd -1 1 P rd -1 2 P rd -1 3 P rd -1 4 P rd -1 5 P rd -1 6 2 .9 3 5
2 .5 1 2
3 In j- 9 In j- 1 0 In j- 1 1 In j- 1 2 In j- 1 3 In j- 1 4 In j- 1 5 In j- 1 6 2 .0 9 0

2 P rd -1 P rd -2 P rd -3 P rd -4 P rd -5 P rd -6 P rd -7 P rd -8

1 In j- 1 In j- 2 In j- 3 In j- 4 In j- 5 In j- 6 In j- 7 In j- 8

1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5

Figure 1: Log permeability field, heterogeneous reservoir, Example 1.

Case 1: Simultaneous Optimization of Injector and Producer Locations Under Total Injection and Production
Rate Constraints. In this case, we test the applicability of optimizing on the injector and producer locations simultaneously
under the total injection and liquid production rate constraints. We also apply the BHP constraint for each well. We start
with 40 injection and 40 production wells. Initial injection and production well locations are shown in Fig. 1. Initially the
total injection and total liquid production rates are equally distributed between all injectors and producers, respectively. The
reservoir life time is 4 years and the drilling cost for each injection and production well is $2, 000, 000. The maximum and
minimum bottomhole pressure constraints for injection and production wells are 9, 000 and 1, 500 psi, respectively.
Both total injection and production rates are equal to 5, 000 STB/Day (qt,inj = qt,prd = 5, 000 STB/Day). In case 1, we
do not apply the initialization procedure to determine appropriate values of total rates to use in the equality constraints of
Eqs. 10 and 11. Fig. 2(a) shows the optimum production and injection well locations for the case with constant total rate
constraints. Convergence is reached after 59 simulation runs. Optimum injection and production rate allocation and the
estimated value of the maximum modified NPV functional J are summarized in Table 1. From Fig. 2(a), it seems that the
final water flooding pattern tends to be five-spot with 4 injectors at the four corners. However, due to the BHP constraint,
it is not possible to have only one producer at the center, instead the production was divided among three producers.
Fig. 2(b) shows the final well locations obtained from the Handels et al. (2007) method starting from the TUPREP final
well locations and rates as the initial guess. The final value of J is $5.58 × 107 , which is lower than that of TUPREP results
($5.98 × 107 ). However, in Handels et al. (2007) method, all the producers are moved to the same gridblock, and hence
combined into one well. Because of this, the production control at the resulting single producing well is changed to BHP
control which results in less oil production, therefore the final value of J is less than that obtained with TUPREP method.

Table 1: Optimal injection and production rate allocation and J value, with constant total rate constraints, Case 1 Example
1.

Inj-1 Inj-8 Inj-33 Inj-40 Prd-11 Prd-12 Prd-19 J ($)


623.2 1776.4 645.9 1954.5 1692.5 1035.9 2271.6 5.98 × 107

Case 2: Simultaneous Optimization of Injector and Producer Locations with Initialization of Total Rates.
In this case, we apply the initialization method to find appropriate total rates to use in the equality constraints of Eqs. 10
and 11 before applying the basic algorithm to find the optimal well locations of both injectors and producers. To test the
reliability, we tried two different initial injection and production rates in the initialization process, namely 5, 000 STB/D and
400 STB/D. Recall that doing the initialization stage, no equality constraint is used on the total rates so the total rates may
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 11

1 0 In j- 3 3 In j- 4 0 1 0 In j- 3 3
9 9 In j- 4 0
8 8
5 .4 7 0 5 .4 7 0
7
5 .0 4 7 7
5 .0 4 7
4 .6 2 5 4 .6 2 5
P rd -1 9
6 4 .2 0 2 6 4 .2 0 2
3 .7 8 0 3 .7 8 0
5 3 .3 5 7 5 -P - r d - 1 1 , P r d - 1 2 , P r d - 1 9 3 .3 5 7
P rd -1 1 P rd -1 2 2 .9 3 5 2 .9 3 5
4 4
2 .5 1 2 2 .5 1 2
3 2 .0 9 0 3 2 .0 9 0

2 2 In j- 1
1 In j- 1 In j- 8 1 In j- 8
1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5

(a) TUPREP method (b) Handels et al. (2007) method

Figure 2: Injection and production well locations, with constant total rate constraints, Case 1 Example 1, no initialization
of total rates.
change from iteration to iteration of the initialization algorithm. As in case 1, we start with 40 injectors and 40 producers.
The initial injection and production rates are uniformly distributed among the wells.
Figs. 3(a) and 3(b) show the final optimum production and injection well locations obtained for the initial total injection
and production rates of 5, 000 and 400 STB/Day, respectively. The algorithm converged with 122 simulation runs for the
high initial total rate case and 277 simulation runs for the low initial total rate case.
The final optimal total injection and production rates determined in the initialization stage are also listed in Tables 2
and 3. Although the final well locations are quite different in Figs. 3(a) and 3(b), estimated optimal J values are similar and
the total rates determined from the initialization stage are quite close. Thus these results attest to the robustness of our
algorithm but suggest the problem may have multiple local maxima.

1 0 In j- 4 0 1 0

P rd -3 3
9 9

P rd -3 2
8 8
5 .4 7 0 5 .4 7 0
5 .0 4 7 5 .0 4 7
7 7
4 .6 2 5 4 .6 2 5
6 4 .2 0 2 6 4 .2 0 2
3 .7 8 0 3 .7 8 0
5 3 .3 5 7 5 3 .3 5 7
2 .9 3 5 2 .9 3 5
4 4
2 .5 1 2 2 .5 1 2
3 2 .0 9 0 3 2 .0 9 0
P rd -2
2 2

1 1 In j- 3
1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5

(a) Initial total rates of 5, 000 STB/Day (b) Initial total rates of 400 STB/Day

Figure 3: Final injection and production well locations, Case 2 Example 1.

Compared to case 1, applying the initialization process to estimate the total injection and production rates yields a much
higher value of J: $1.45 × 108 for case 2 as opposed to $5.98 × 107 for case 1. The two-stage well placement resulted in
smaller total rates and fewer number of injection and production wells compared to the single-stage well placement where
total injection and production rates are specified without the initialization step.
Figs. 4(a) and 4(b) shows the initial and final injection and production well locations obtained using the Handels et al.
(2007) method. In both figures, the stars represent the initial well locations and the circles are the optimal well locations
obtained by the Handels et al. (2007) method. To obtain the results of Fig. 4(a), we started Handels et al. (2007) method
12 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

Table 2: Optimal injection and production rate allocation and estimated optimal J value with initial total rates of 5, 000
STB/Day, Case 2 Example 1.

Inj-40 Prd-2 qt,inj qt,prd J ($)


1838.6 1880.6 1838.6 1880.6 1.45 ∗ 108

Table 3: Optimal injection and production rate allocation and estimated optimal J value with initial total rates of 400
STB/Day, Case 2 Example 1.

Inj-3 Prd-32 Prd-33 qt,inj qt,prd J ($)


1868.1 1425.2 442.9 1868.1 1868.1 1.41 ∗ 108

with the TUPREP final well locations and rates obtained for the case where we used the initialization step, Fig. 3(a) and
Table 2. To obtain the results of Fig. 4(b) we applied the Handels et al. (2007) method with a different initial well locations
but the rate of the wells are still the same as final rates obtained from the TUPREP algorithm. Note that the number of
injector and producer is the same as that from the TUPREP results. The Handels et al. (2007) method final J value starting
with both initial locations (TUPREP location and a different location) is $1.41 × 108 , slightly less than TUPREP result of
Table 2 even though we initialized the Handels et al. (2007) method with good locations and rates.

P rd -2
1 0 In j- 4 0 1 0

9 In j- 4 0 9

8
5 .4 7 0
8 P rd -2 5 .4 7 0
5 .0 4 7 5 .0 4 7
7 7
4 .6 2 5 4 .6 2 5
6 4 .2 0 2 6 4 .2 0 2
3 .7 8 0 3 .7 8 0
5 3 .3 5 7 5 3 .3 5 7
2 .9 3 5 2 .9 3 5
4 4
2 .5 1 2 2 .5 1 2
3 2 .0 9 0 3 2 .0 9 0
P rd -2
2 P rd -2 2

1 1 In j- 4 0 In j- 4 0
1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5

(b) Start with TUPREP rates and arbitrary well loca-


(a) Start with TUPREP final rates and well locations
tions

Figure 4: Injection and production well locations from Handels et al. (2007) method, Case 2 Example 1.

Example 2: 3D, 3-Phase PUNQ Reservoir


PUNQ is a three-phase, three-dimensional reservoir simulation model. The reservoir has five simulation layers and it
is bounded to the east and south by a fault. A small gas cap is located in the center of the dome shaped structure. The
reservoir is in communication with fairly strong aquifer to the north and west. The aquifer is a numerical aquifer which is
introduced by converting some of the inactive cells in the original model to active cells containing only water and adding a row
of gridblocks with high pore volume along the north and south edges and one column of gridblocks of high pore volume along
the west edge. The porosity of aquifer gridblocks is 0.95. For the case where we consider an inactive aquifer, the porosity
of the aquifer gridblocks are changed to 0.0001. The drilling cost of a well, for both injectors or producers, is $10, 000, 000.
The oil price is set at 80 $/STB, water injection costs at 10 $/STB, and water production costs at 30 $/STB. The maximum
bottomhole pressure constraint for injectors is 6, 000 psi and the minimum bottomhole pressure constraint for producers
is 1, 500 psi. The initial datum pressure is 3, 400 psi. The production life of the reservoir is 25 years. The permeability
distribution and initial fluid distribution are shown in Figs. 5 and 6, respectively. For the well placement problems considered
here, the wells are perforated in all 5 layers. For both cases considered, the optimal well locations are shown in the plots of
layer-1 horizontal log permeability field.
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 13

5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0

8 .0 0 0 5 .6 0 0 8 .0 0 0 7 .6 0 0 8 .0 0 0

5 5 5 5 5
6 .4 0 0 4 .4 8 0 6 .4 0 0 6 .0 8 0 6 .4 0 0

1 0 4 .8 0 0 1 0 3 .3 6 0 1 0 4 .8 0 0 1 0 4 .5 6 0 1 0 4 .8 0 0

3 .2 0 0 2 .2 4 0 3 .2 0 0 3 .0 4 0 3 .2 0 0
1 5 1 5 1 5 1 5 1 5
1 .6 0 0 1 .1 2 0 1 .6 0 0 1 .5 2 0 1 .6 0 0

2 0 0 2 0 0 2 0 0 2 0 0 2 0 0

2 5 2 5 2 5 2 5 2 5

3 0 3 0 3 0 3 0 3 0

Figure 5: The horizontal log permeability field of PUNQ reservoir.

5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0

0 .8 0 0 0 0 .8 0 0 0 0 .8 0 0 0 0 .8 0 0 0 0 .8 0 0 0

5 5 5 5 5
0 .6 4 0 0 0 .6 4 0 0 0 .6 4 0 0 0 .6 4 0 0 0 .6 4 0 0

1 0 0 .4 8 0 0 1 0 0 .4 8 0 0 1 0 0 .4 8 0 0 1 0 0 .4 8 0 0 1 0 0 .4 8 0 0

0 .3 2 0 0 0 .3 2 0 0 0 .3 2 0 0 0 .3 2 0 0 0 .3 2 0 0
1 5 1 5 1 5 1 5 1 5
0 .1 6 0 0 0 .1 6 0 0 0 .1 6 0 0 0 .1 6 0 0 0 .1 6 0 0

2 0 0 2 0 0 2 0 0 2 0 0 2 0 0

2 5 2 5 2 5 2 5 2 5

3 0 3 0 3 0 3 0 3 0

Figure 6: The initial oil saturation distribution of PUNQ reservoir.

Case 1: Optimal Production Well Placement for the PUNQ Reservoir with Aquifer. In this case, we consider
the optimization of production well locations only with the numerical aquifer in the PUNQ reservoir. No injection wells
are needed. We consider the initial total liquid production rate to be 5, 600 STB/Day, which will result in total production
approximately equivalent to 40% of the initial reservoir oil in place within the 25 years of production life. We start with 67
producers where each producer has the initial liquid rate rate of 83.58 STB/Day. The initial production well locations are
shown in Fig. 7.

5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0

8 .0 0 0 5 .6 0 0 8 .0 0 0 7 .6 0 0 8 .0 0 0

5 5 5 5 5
6 .4 0 0 4 .4 8 0 6 .4 0 0 6 .0 8 0 6 .4 0 0

1 0 4 .8 0 0 1 0 3 .3 6 0 1 0 4 .8 0 0 1 0 4 .5 6 0 1 0 4 .8 0 0

3 .2 0 0 2 .2 4 0 3 .2 0 0 3 .0 4 0 3 .2 0 0
1 5 1 5 1 5 1 5 1 5
1 .6 0 0 1 .1 2 0 1 .6 0 0 1 .5 2 0 1 .6 0 0

2 0 0 2 0 0 2 0 0 2 0 0 2 0 0

2 5 2 5 2 5 2 5 2 5

3 0 3 0 3 0 3 0 3 0

Figure 7: The initial production well locations, PUNQ reservoir with aquifer.

Fig. 8 shows the final optimal production well locations (10 producers remain) obtained using the basic optimization
algorithm with the constant total liquid production rate specified as qt,prd = 5, 600 STB/Day without using the initialization
algorithm to determine an appropriate total liquid production rate. The optimization algorithm required 72 reservoir simu-
lation runs. Fig. 9 shows the final optimal production well locations (9 producers remain) obtained using the initialization
procedure to determine an appropriate production rate to use in the equality constraint of Eq. 11. When using the two-stage
procedure, 75 simulation runs were required to obtain convergence. Optimum production rate allocation and estimate of
the maximum J value are summarized in Tables 4 and 5 for the two different optimization procedures. In the total rate
14 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

initialization step, the initial total liquid production rate is 5, 600 STB/Day and after optimization is 8, 459.5 STB/Day. The
optimum J values for the cases with and without the total production rate initialization are $3.07 × 109 and $3.32 × 109 ,
respectively.

5 1 0 1 5 2 0 5 1 0 1 5 2 0

8 .0 0 0 8 .0 0 0

5 6 .4 0 0
5 6 .4 0 0

4 .8 0 0 4 .8 0 0
1 0 1 0
P -6 4 P -6 4
3 .2 0 0 P -5 6 3 .2 0 0

P -2 3 P -2 3
1 5 1 .6 0 0 1 5 1 .6 0 0
P -3 3 P -3 3
P -5 9 0 0
2 0 P -4 1 P -5 0 P -6 0 2 0 P -4 1 P -5 0 P -6 0
P -1 8 P -6 2 P -3 4 P -1 8
P -6 5
2 5 2 5

3 0 3 0

Figure 8: Final production well locations with no initial- Figure 9: Final production well locations with total pro-
ization used to determine the total production duction rate determined from the initialization
rate constraint, PUNQ reservoir with aquifer. algorithm, PUNQ reservoir with aquifer.

Table 4: Optimal production rate allocation and J value, without total rate initialization, Case 1 Example 2.

Prd-18 Prd-23 Prd-33 Prd-34 Prd-41 Prd-50 Prd-59 Prd-60 Prd-62 Prd-64 J ($)
274.0 187.1 1088.2 158.0 445.1 1185.7 247.0 315.5 247.5 1451.8 3.07 × 109

Table 5: Optimal production rate allocation and J value, production rate determined from the initialization algorithm, Case
1 Example 2.

Prd-18 Prd-23 Prd-33 Prd-41 Prd-50 Prd-56 Prd-60 Prd-64 Prd-65 qt,prd J ($)
408.2 293.1 903.5 1166.0 1877.3 1543.8 979.3 897.8 390.6 8459.5 3.32 × 109

We applied the Handels et al. (2007) method starting with the final production well locations and rates obtained both
with and without total production rate initialization. The J values in both cases decreases as a function of iteration as shown
in Fig. 10 which indicates that the Handels et al. (2007) method failed to improve the TUPREP results. In the final result
of TUPREP, all the wells satisfy the BHP constraint. However, when Handels et al. (2007) method moves the wells, some of
the BHP controls cannot be honored with the specified production rates.
The original PUNQ reservoir has 6 production wells. In the following, we apply the Handels et al. (2007) method starting
with 6 production wells with a total liquid production rate of 5,600 STB/Day. This total production rate is uniformly
distributed among the 6 producers. The initial well locations are the ones from the original PUNQ reservoir example shown
in Fig. 11. The final optimum well locations obtained with Handels et al. (2007) method are shown in Fig. 12. The initial
J value is $2.36 × 109 considering the drilling cost of each well of $10, 000, 000 and the final optimum J value increased to
$2.66 × 109 , which is significantly lower than the optimum values of J obtained by the TUPREP method with (Table 4)
and without (Table 5) total production rate initialization. Note that the Handels et al. (2007) method assumes a uniform
production rate from all wells and a well may be converted to BHP control when the BHP constraint is violated.
Case 2: Optimal Injection and Production Well Placement for the PUNQ Reservoir without Aquifer. The
porosity of the aquifer gridblocks is reduced form 0.95 to 0.0001 to make the effect of the aquifer negligible. We start with
59 injectors and 67 producers. The initial configuration of the injection and production well locations is shown in Fig. 13.
The injectors are shown as solid black circles and the producers are shown as solid white circles.
Fig. 14 shows the final optimized injector and producer locations when we arbitrarily set the total injection and liquid
production rate constraints to 5,600 STB/Day. The final number of injectors and producers are 12 and 14. The final J value
for this case is $2.44 × 109 . To obtain this result required 214 reservoir simulation runs.
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 15

S in g le - S ta g e
T w o - S ta g e
3 .4 0 E + 0 0 9

3 .3 0 E + 0 0 9

3 .2 0 E + 0 0 9

3 .1 0 E + 0 0 9

3 .0 0 E + 0 0 9

J, $ 2 .9 0 E + 0 0 9

2 .8 0 E + 0 0 9

2 .7 0 E + 0 0 9

2 .6 0 E + 0 0 9
0 2 4 6 8 1 0 1 2 1 4 1 6 1 8 2 0 2 2
Ite r a tio n N o .

Figure 10: Plot of J vs, iteration from Handels et al. (2007) method starting with TUPREP final producer’s locations and
rates, PUNQ reservoir with aquifer.

5 1 0 1 5 2 0 5 1 0 1 5 2 0

8 .0 0 0 8 .0 0 0

5 6 .4 0 0
5 6 .4 0 0

4 .8 0 0 4 .8 0 0
1 0 1 0
P -5
P -1 2 3 .2 0 0 P -5 3 .2 0 0

1 5 1 .6 0 0 1 5 1 .6 0 0

P -4 P -1 2
0 P -1 5 0
2 0 2 0
P -4
P -1 P -1 5 P -1 1
P -1
P -1 1
2 5 2 5

3 0 3 0

Figure 11: Original production well locations, PUNQ Figure 12: Optimal production well locations by Han-
reservoir with aquifer. dels et al. (2007) method.

5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0 5 1 0 1 5 2 0

8 .0 0 0 5 .6 0 0 8 .0 0 0 7 .6 0 0 8 .0 0 0

5 5 5 5 5
6 .4 0 0 4 .4 8 0 6 .4 0 0 6 .0 8 0 6 .4 0 0

1 0 4 .8 0 0 1 0 3 .3 6 0 1 0 4 .8 0 0 1 0 4 .5 6 0 1 0 4 .8 0 0

3 .2 0 0 2 .2 4 0 3 .2 0 0 3 .0 4 0 3 .2 0 0
1 5 1 5 1 5 1 5 1 5
1 .6 0 0 1 .1 2 0 1 .6 0 0 1 .5 2 0 1 .6 0 0

2 0 0 2 0 0 2 0 0 2 0 0 2 0 0

2 5 2 5 2 5 2 5 2 5

3 0 3 0 3 0 3 0 3 0

Figure 13: The initial well locations for simultaneous injector and producer optimization, PUNQ reservoir without aquifer.

Fig. 15 shows the final optimized injector and producer locations obtained when the total rate initialization algorithm
is used to determine the total rates to be used in the equality constraints of Eqs. 10 and 11 when the basic optimization
algorithm is applied. The estimated optimal number of injectors and producers are 11 and 13, respectively with a final
estimated optimal total injection rate of 4,106 STB/D and a final optimal total production rate of 5,152 STB/D. The final
J value of this case is $2.40 × 109 . Convergence of the two-stage algorithm required 170 reservoir simulation runs Optimum
production and injection rate allocation values are summarized in Tables 6 and 7 for the single-stage and two-stage well
16 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

placement algorithms.

5 1 0 1 5 2 0 5 1 0 1 5 2 0

I-4 9 8 .0 0 0 8 .0 0 0
I-4 8
5 I-3 7 I-4 2 6 .4 0 0
5 6 .4 0 0
P -4 5
I-3 6 I-5 6
P -5 4 4 .8 0 0 P -5 4 4 .8 0 0
I-4 5 I-5 2 I-5 5
1 0 P -4 7 1 0
I-5 9 I-3 4 I-5 9
P -4 8 3 .2 0 0 P -4 8 3 .2 0 0

P -1 4 P -2 3 P -4 0 P -4 9 P -1 4 P -2 3 P -4 9
1 5 1 .6 0 0 1 5 1 .6 0 0
P -5 8 P -3 3
I-1 4 I-2 4 I-1 4 I-2 4
P -5 9 0 P -5 9 0
2 0 P -8 P -2 6 P -5 0 2 0 P -2 6 P -5 0
P -9 P -1 8 P -9
I-4 4 I-3 2
P -1 9 P -6 5
2 5 I-4 3 I-5 0 2 5

I-3 8 I-1 9 I-3 0

3 0 3 0

Figure 14: Final well locations for simultaneous injec- Figure 15: Final well locations for simultaneous injec-
tor and producer optimization with total rate tor and producer optimizations, total pro-
constraints, no initialization step used to de- duction and injection rate constraints are de-
termine the total rate constraints, PUNQ termined form the initialization algorithm,
reservoir without aquifer. PUNQ reservoir without aquifer.

We applied the Handels et al. (2007) method starting with the final injection and production well locations and rates
obtained both with and without the total injection and production rates initialization. The J value in both cases decreases
as a function of iteration as shown in Fig. 16, i.e., the Handels et al. (2007) method fails to improve the TUPREP results.

S in g le - S ta g e
T w o - S ta g e
3 .4 0 E + 0 0 9

3 .3 0 E + 0 0 9

3 .2 0 E + 0 0 9

3 .1 0 E + 0 0 9

3 .0 0 E + 0 0 9
J, $

2 .9 0 E + 0 0 9

2 .8 0 E + 0 0 9

2 .7 0 E + 0 0 9

2 .6 0 E + 0 0 9
0 2 4 6 8 1 0 1 2 1 4 1 6 1 8 2 0 2 2
Ite r a tio n N o .

Figure 16: Plot of J vs, iteration from Handels et al. (2007) method starting with TUPREP final well locations and rates,
PUNQ reservoir with aquifer.

Discussion and Conclusions


1. The specification of well rates (or pressures) and total time of the operational life of the reservoir affects the solution of
the optimal well placement problem. Specifying a short life time will result in higher rates and more wells in the optimal
solution. Our recommendation is to specify a realistic time for the reservoir life. When this is done, the initialization
step introduced in this paper allows one to determine reasonable total production rates and total water injection rates.

2. Although using the initialization step to determine total injection and production rates to define equality constraints
in the basic TUPREP optimization algorithm sometimes results in a slightly lower value of the modified NPV function
(J) we wish to maximize than we obtain with the single stage procedure, which does not use the initialization step, the
two-stage procedure often yields a significantly higher value of J with less computational cost.
SPE 135304 A Two-stage Well Placement Optimization Method Based on Adjoint Gradient 17

Table 6: Optimal production and injection rate alloca- Table 7: Optimal production and injection rate alloca-
tion, with total rate constraints and no initial- tion, total production and injection rate con-
ization step used to determine the total rate straints are determined form the initialization
constraints, Case 2 Example 2. algorithm, Case 2 Example 2.

Producers Rate Injectors Rate Producers Rate Injectors Rate


P-8 97.4 I-14 434.6 P-9 607.2 I-14 544.7
P-9 376.5 I-24 662.7 P-14 154.6 I-19 358.2
P-14 192.7 I-36 229.5 P-19 90.2 I-24 887.0
P-18 718.3 I-37 324.4 P-23 399.1 I-30 404.9
P-23 827.6 I-38 429.3 P-26 91.5 I-32 380.2
P-26 184.0 I-42 350.7 P-33 420.7 I-34 567.8
P-40 223.6 I-43 852.8 P-45 633.8 I-45 210.5
P-47 823.7 I-44 242.7 P-48 257.6 I-52 216.5
P-48 95.5 I-48 569.9 P-49 650.6 I-55 250.1
P-49 229.4 I-49 497.3 P-50 971.8 I-56 68.7
P-50 634.6 I-50 450.4 P-54 288.1 I-59 217.5
P-54 744.7 I-59 555.8 P-59 452.4 qt,inj 4106.0
P-58 227.0 - - P-65 134.7 - -
P-59 225.2 - - qt,prd 5152.5 - -

3. While it may not be the optimal procedure from the viewpoint of optimization theory, the method we have used
to ensure that nonlinear constraints represented by bounds on bottomhole pressures are satisfied results in a robust
optimization procedure and avoids the need to implement an adjoint method to compute the gradient of these nonlinear
constraints, thus enabling the use of Eclipse 300 in our algorithm for the solution of the optimal well placement problem.
4. Tests with several well placement problems in addition to those considered here indicate that the TUPREP optimal
well placement algorithms result in higher values of the modified NPV function, i.e., a more optimal solution, than
other gradient-based algorithms presented previously in the literature. Moreover the TUPREP methods do not require
that the number of wells or the operating rates and pressures of each individual well be specified a priori.

Acknowledgements
The work presented here was funded by the member companies of TUPREP.

References
Bangerth, W., H. Klie, M. Wheeler, P. Stoffa, and M. Sen, On optimization algorithm for the reservoir oil well placement
problem, Computational Geosciences, 10, 303–319, 2006.
Beckner, B. and X. Song, Field development planning using simulated annealing - optimal economic well scheduling and
placement, in Proceedings of the 1995 SPE Annual Technical Conference and Exhibition, 22-25 October 1995, Dallas,
Texas, 1995.
Bittencourt, A. and R. Horne, Reservoir development and design optimization, in Proceedings of the 1997 SPE Annual
Technical Conference and Exhibition, 5-8 October 1997, San Antonio, Texas, 1997.
Brouwer, D. and J. Jansen, Dynamic optimization of water flooding with smart wells using optimial control theory, SPE
Journal, 9(4), 391–402, 2004.
Centilmen, A., T. Ertekin, and A. Grader, Applications of neural networks in multiwell field development, in Proceedings of
the 1999 SPE Annual Technical Conference and Exhibition, 3-6 October 1999, Houston, Texas, 1999.
Emerick, A., E. Silva, B. Messer, L. Almeida, D. Szwarcman, M.Pacheco, and M.Vellasco, Well placement optimization using
a genetic algorithm with nonlinear constraints (SPE-118808), in SPE Reservoir Simulation Symposium, 2009.
Handels, M., M. J. Zandvliet, D. R. Brouwer, and J. D. Jansen, Adjoint-based well-placement optimization under production
constraints, SPE–105797, in SPE Reservoir Simulation Symposium, 2007.
Kraaijevanger, J. F. B. M., P. J. P. Egberts, J. R. Valstar, and H. W. Buurman, Optimal waterflood design using the adjoint
method (SPE-105764), in SPE Reservoir Simulation Symposium, p. 15, 2007.
18 F. FOROUZANFAR, G. LI AND A.C. REYNOLDS SPE 135304

Li, R., A. C. Reynolds, and D. S. Oliver, History matching of three-phase flow production data, SPE J., 8(4), 328–340, 2003.

Luenberger, D. G., Linear and Nonlinear Programming, Addison-Wesley Publishing Company, 1984.
Nocedal, J. and S. J. Wright, Numerical Optimization, Springer, New York, 1999.
Norrena, K. P. and C. V. Deutsch, Automatic determination of well placement subject to geostatistical and economic
constraints, in Proceedings of the 2002 SPE International Thermal Operations and Heavy Oil Symposium and International
Horizontal Well Technology Conference, 4-7 November 2002, Calgary, Alberta, Canada, 2002.
Oliver, D. S., A. C. Reynolds, and N. Liu, Inverse Theory for Petroleum Reservoir Characterization and History Matching,
Cambridge University Press, Cambridge, UK, 2008.
Ozdogan, U. and R. N. Horne, Optimization of well placement under time-dependent uncertainty, SPE Reservoir Evaluation
& Engineering, 9(2), 135–145, 2006.
Sarma, P. and W. H. Chen, Efficient well placement optimization with gradient-based algorithm and adjoint models, SPE,
112257, in Proceedings of the 2008 SPE Intelligent Energy Conference and Exhibition, 2008.
Sarma, P., L. Durlofsky, and K. Aziz, Implementation of adjoint solution for optimal control of smart wells, SPE 92864, 2005.

Wang, C., G. Li, and A. C. Reynolds, Optimal well placement for production optimization, (SPE-111154), in Proceedings of
the 2007 SPE Eastern Reginal Meeting, 2007.
Wu, Z., A. C. Reynolds, and D. S. Oliver, Conditioning geostatistical models to two-phase production data, Soc. Petrol. Eng.
J., 3(2), 142–155, 1999.
Yeten, B., L. J. Durlofsky, , and K. Aziz, Optimization of nonconventional well type, location and trajectory, in Proceedings
of the 2002 SPE Annual Technical Conference and Exhibition, 29 September-2 October 2002, San Antonio, Texas, 2002.
Zandvliet, M., M. Handels, G. van Essen, D. Brouwer, and J. Jansen, Adjoint-based well-placement optimization under
production constraints, SPE Journal, 13(14), 392–399, 2008.
Zhang, K., G. Li, A. C. Reynolds, J. Yao, and L. Zhang, Optimal well placement using an adjoint gradient, Accepted by
Journal of Petroleum Science and Engineering, 2010.

You might also like