A NEW OPTIMIZATION MODEL FOR 3-D WELL DESIGN

severity, which in turn reduce the operational problems. The optimized design was compared to the conventional design (based on a trial and error method) and the WELLDES program (based on sequential unconstrained minimization technique) for two wells. The optimized design reduced the total drilling length of the two wells, while all other operational parameters were kept within the limiting constraints. The conventional design and WELLDES program have some variables out of their constraint limits.


INTRODUCTION
Minimizing the cost of drilling a directional or horizontal well is a major concern for drilling engineers.Cost is traditionally optimized by improving elements of the operations such as bit selection, weight on bit and rotary speed, drilling time, casing length… etc. Optimizing well trajectory in case of 3D deviated wells directly impacts on well cost which include casing length, cemented parts, mud volumes, drilling time…etc.Review of the published literature in the last two decades shows that well design depends strongly on the designers, experience and judgment; and, the results obtained are not necessarily the best because of lack of strict mathematical models and corresponding optimization theories.Furthermore, the repeatedly selecting and adjusting of the design parameters is time consuming and inefficient (Miska, S., 1981; Amara, M.H., and Martin, B., 1990; Rampersad, P., et al., 1993).Helmy, H.W. et al., (1997) proposed the first practical welldesign model based on nonlinear optimization theory, in which the constraints such as kickoff point, build up rate, drop-off rate, inclination, casing-setting depth were included.This model was in 2D and was solved using a sequential unconstrained minimization technique.This work was followed by another work to optimizing the well trajectory in 3D, but did not consider the constraint of casing setting depth (Ahmed, K. A., 2000).Traditional optimization methods failed to solve many problems for the following reasons (Mostafa, M. E., 2001): 1.Higher order techniques such as the gradient and Newton's methods need the objective function to be differentiable, 2. Direct search methods like the random search fail to converge to the optimum in large search space, 3. Some methods are restricted to specific objective functions, 4. Most of methods fail to reach the global optimum unless the objective function is convex, 5.All methods deal only with continuous variables.
The objective of this work is to develop a software package using a genetic algorithm to optimize the directional and horizontal wells design parameters.This would also minimize the total measured depth by increasing the probability of finding the global optimum, instead of moving from a point to point in the search space (traditional methods).The drilling cost, effort and time is therefore reduced.This program includes the constraints; such as kickoff point, build up rate, drop-off rate, inclination, casingsetting depth and having all other parameters constant (e.g.mud properties, hydraulics, bits types).The genetic optimization design is compared to the conventional design, "application A", and the WELLDES program (Ahmed, K. A., 2000), "application B".

GENETIC ALGORITHMS
Genetic Algorithms (GAs) were invented to mimic some of the processes observed in natural evolution (Davis, L, 1991).GAs are a family of computational methods inspired by evolution.These algorithms encode a potential solution to a specific problem on a simple chromosome-like data structure and apply recombination operators to this structure so as to preserve critical information.Genetic Algorithms are often viewed as function optimizers, although the range of problems to which genetic algorithms have been applied is not quite broad (Abourayya, 2001).
An implementation of a genetic algorithm begins with a population of typically random chromosomes.One then creates a set of solutions, testing them against a given problem, and then "breeding" a new set of solutions based on some measure of success.In the case of a genetic algorithm, we "evolve" a solution to some specific problem, such as minimizing a traveling salesman's route, by emulating nature.Fortunately, the software universe is far less complex than the biological world and no piece of software can-or needs-to incorporate all of life's techniques.Whereas living things need to seek flexible roles in variable environments, computer algorithms need only to find a specific answer to a fixed question (Ladd, S.R., 1998).
This particular description of a genetic algorithm is intentionally abstract because in some sense, the term Genetic Algorithm has two meanings.In a strict interpretation, the Genetic Algorithm refers to a model introduced and investigated by John Holland, (1975) and by Goldberg, (1989).It is still the case that most of the existing theory of genetic algorithms applies either solely or primarily to the model introduced by Holland.
In a broader usage of the term, a genetic algorithm is any population-based model that uses selection and recombination operators to generate new sample points in a search space.Researchers largely working from an experimental perspective have introduced many genetic algorithm models.Many of these researchers applications are oriented and typically interested in genetic algorithms as optimization tools.
The steps in executing the genetic algorithm operating on fixed length are as following: I. Randomly, create an initial population of individual chromosomes.
II. Iteratively perform the following sub-steps on the population of chromosomes until the termination criterion has been satisfied: A. Assign a fitness value to each individual in the population using the fitness measure.
B. Create a new population of chromosomes by applying the following operation: 1. Selection: select two chromosomes, according to their fitness.The two selected chromosomes are called parents.2. Crossover: take a copy of the selected parents and apply a crossover operation on them, with a certain probability, to produce two new children.3. Mutation: the two children, produced after the crossover operation, are then mutated, with a certain probability, to produce two new children.4. Deletion: the resulting children after mutation are compared with their parents, the best two of the four chromosomes replaces the two parents.
III.The best chromosome in the population (i.e., has the largest fitness) is designated as the result of the genetic algorithm for the run.This result may represent a solution (or an approximate solution) to the problem

STATEMENT OF THE PROBLEM
A general horizontal well trajectory is considered for the well design problem.Schematic vertical plan of the 3D general horizontal well trajectory is shown in The problem is stated as: given coordinates of surface and down hole target locations and the constraints of the well; determine the optimum directional well design parameters which are shown in Table 1.

MODEL FORMULATION
Three steps are required for the formulations of this optimization problem as following: Step (1) Identify the System • Collect Data to Describe the system Collect all related data to the well under consideration (e.g.geologic data, surface and target coordinate, the data collected from our experience, etc).
• Identify System Variables.
Constraints are all restrictions placed on the system.These constraints could take the form of either equalities or inequalities.

Step (2) Find a measure of system effectiveness
A criterion must be defined in order to judge the effectiveness of the system.That criterion is a scalar function called the objective function and is expressed in terms of the system variables and is represented by f(x).
The objective function, which gives a maximum or a minimum value, provides the means to compare different solutions in order to select the best one.

Step (3) Apply the optimization technique
Use the genetic algorithm to solve the system and to get the best solution.

System Variables
The system of horizontal well design is described by all the variables shown in Table 1.

System Objective function
The objective function of the system is the drilling measured depth is used to judge the effectiveness of the well design.The problem is to find mathematical expression which represents the drilling measured depth of the horizontal well as a function of the system variables in three dimensions and then develop the objective function.

Three Dimension (3D) Measured Depth Function
In contrast to many references, (Wilson, G.J., 1968; Callas, N.P., 1976; and Taylor, H, 1972) many methods used in planning the directional and horixontal wells, William H., 1981, described the radius of curvature calculation of the three-dimension (3D) path of the directionally drilled well from kick off point as a function of inclination as well as direction.The constant curvature equation between two points in space as shown in Fig. 2 is: From these equations the well path between two point in 3D can be calculated as a function of radii of curvature as well as the change of inclination and direction.
From Fig. 1 a general equation to calculate the well path of a horizontal well is developed.This equation composed of seven segments, kick-off segment D kop , three segment for build and drop D 1 , D 2 , D 3 , two hold segment D 4 , D 5 , and final lateral section in the target layer HD.

The Objective Function
The measured depth objective function is expressed in the system variables, Fig. 1 as following: Assuming inclination angle at kick-off point = 0 Where, R 1 , R 3 , and R 5 can be calculated as: Where, φ i = inclination angle at kick-off point, which was assumed to equal zero (Adam,N.J, 1985) Well surveys were calculated based on the minimum curvature method (Adam, N. J., 1985) which is the most accurate method.This method gives the north south (NS i ), the east west (EW i ), and the true vertical depth (TVD i ) at any point.

System Constraints
To locate the minimum measured depth; constraints are set to control the selection of the optimum set of the designed variables.Two different types of constraints are defined for the designed problem.

Operational Constraints
The operational constraints are those constraints that are imposed on the well design due to different types of formation to be drilled, casing setting depths, limitations of variable equipment or technology, and other operation related limitations as shown in Table 2.

Non-negativity Constraints
The non-negativity constraints are those constraints that imposed on the well design model to ensure that certain components of the model are always positive.
The following are the non-negativity constraints used in this study:

Deletion
After producing the offspring, two chromosomes of the two parents and the two children chromosomes must be inserted into the population.This occur in the software by determining the best two chromosomes (the two chromosomes that have the maximum two fitness) from the two parents and the two children chromosomes, and inserting them into the population to improve the population (group of solutions).These two chromosomes, which inserted into the population may be the two children or may be the two parents or may be one parent and one child according to their fitness values.

Stopping Criterion
If the best fitness (the maximum fitness) in the population is equal the average fitness of the whole population, then the software stops and the chromosome, that has best fitness, is the solution of the problem and its variables (genes) are the optimum values of the problem variables.Otherwise, if the best fitness not equal the average fitness of the population, then the cycle will be continued to select two parents and produce two children until the stopping criterion is achieved.Figure 3 presents the flow chart of genetic algorithm software.

APPLICATIONS OF GA SOFTWARE IN DIRECTIONAL DRILLING DESIGN
Table 3 contains the input data for the two Applications.The optimum design results of GA software for the first application are shown in Table 4. Also, the comparison between GA design, WELLDES program (Ahmed, K. A., 2000) (based on Sequential Unconstraint minimization Technique), and conventional method (based on trial and error method) are outlined in Table 4. It's obvious that GA reduced the true measured depth than conventional design by about 70 ft, and reduced this depth than WELLDES design by about 2 ft (nearly the same).But all variables of GA design are in their constraint limits, in contrarily of conventional design and WELLDES design where some variables in them are out of their constraint limits.In addition, GA take the casing setting depths into consideration, in contrarily of other designs which does not take them into consideration in their designs.Figures 4 and 5 show the comparisons between GA, conventional, WELLDES designs in horizontal and vertical plan.Table 5 displayed the optimum design results of GA software for the second application and the comparison with the conventional design.It is obvious that GA reduced the true measured depth than conventional design by about 110 ft.In addition, GA takes the casing setting depths into consideration, in contrarily of the conventional design which doesn't take them into consideration in its design.Figures 6  and 7 show the comparison between GA and conventional design in horizontal and vertical plan.

CONCLUSIONS
1. Genetic algorithm proved to be a strong optimization technique.2. Comparison between GA software, conventional method, and WELLDES program confirmed the validity of the GA software.3. The GA software is easy to use and can be used for any optimization problems by changing the chromosome encoding and evaluation function to suit the required problem.

Fig 1 .
Solutions of special cases, (e.g.build and hold & build, hold, and build trajectory) are derived from the general solution of the problem.

Figure 1 .
Figure 1.Vertical plan of a general 3D horizontal well trajectory.

Figure 3 .
Figure 3. Flow chart of genetic algorithm software.
chromosomes (Roulette Wheel parent selection) Produce new offspring chromosomes (Crossover (One-Piont Crossover, P c = 1) & Mutation P m = 1) Evaluate each offspring (Evaluation Function) Fit i = 10000/(10000+TMD) Return the two chromosomes which have the maximum fitness of the two parents and the two children chromosomes to the population Stopping Criterion The best chromosome in the population is the solution Yes No

Figure 4 .
Figure 4. Plan view of application A shows the comparison between optimized GA design, WELLDES program, and conventional Design.

Figure 5 .
Figure 5. Vertical view of application A shows the comparison between optimized GA design, WELLDES program, and conventional Design.

Figure 6 .
Figure 6.Plan view of application B shows the comparison between optimized GA design and conventional design.

Figure 7 .
Figure 7. Vertical view of application B shows the comparison between the optimized GA design and conventional design.

Table 1 .
Outlines the system variables VariableDescription Remarks φ 1 , φ 2 , φ 3 first, second, and third hold angles, degrees.θ 1 azimuth angle at kick off point, degrees.TVD true vertical depth of the well, feet.D KOP true vertical depth of kick off point, feet.D B true vertical depth at the end of drop section, feet.HD Lateral length (horizontal length), feet.

Table 2 .
Listing of the operational constraints

Table 2 .
Listing of the operational constraints (Continued)

Table 2 .
Listing of the operational constraints (Continued)

Table 2 .
Listing of the operational constraints (Continued)

Table 2 .
Listing of the operational constraints (Continued)

Table 3 .
Shows the input data for the two applications.

Table 4 .
A comparison between the optimized GA design, conventional design, and WELLDES program design for application A.
*md = measured depth.** The variables in bold are out of their constraints limits.

Table 5 .
A comparison between the optimized GA design and the conventional design for application B.