Research on Three-dimensional Modeling and Visualization for Well Trajectory of Drilling

This study aims to realize 3D visualization of well trajectory more efficiently by use of a new method. In view of the shortcomings of traditional three-dimensional (3D) modeling methods for well trajectory, a new method of slice-based 3D modeling for the tubular well trajectory was put forward, by which a 3D well trajectory model was established. The method can realize the 3D tubular well trajectory seamless connection efficiently and conveniently without interpolation smoothing treatment of the well trajectory’s crook. In order to provide a convenience to observe and analyze intuitively as well as control the well trajectory effectively in drilling for the drilling staff, realized 3D visualization of the well trajectory based on virtual reality technology and provided flexible humancomputer interaction functions with which the drilling staff can make interactive operation such as zooming, translating and rotating, etc., for the 3D well trajectory. Consequently, the well trajectory can be observed from multi-azimuth and multi-angle, improving the oil reservoir encountering rate. Finally, an application example of 3D visualization for well trajectory in Dagang Oilfield was given.


INTRODUCTION
During the oil drilling operations, due to the complexity and variety of geology conditions, a certain degree of partial difference between actual drilling and designed well trajectories is inevitably generated.Therefore, in order to drill accurately into the oil-gas reservoir, the well trajectory has to be adjusted in realtime while drilling (Li and Xu, 2007).It is very essential to build the 3D model of a well trajectory and visualize it so as to effectively control the well trajectory.But existing modeling methods for well trajectories are usually to connect cylinders end to end and then to process generating gaps smoothly by interpolation (Sampaio and Jorge, 2006).This method has the limitations of huge computation amount, low drawing efficiency etc., and at the same time, the interactivity of the visualized graphs by use of traditional visualization technology is weak.To this end, this study provides the research on threedimensional modeling and visualization for well Trajectory of drilling, which aims to adopt a new solution of slice-based modeling (Wang et al., 2011) to establish 3D models for a well trajectory and use the virtual reality technology (Taverna and Michael, 2004) to realize 3D visualization of the well trajectory in order to enhance the drawing efficiency and visualization effect of well trajectories.The research result enables drilling technicians to observe more intuitively the well trajectory at all times and to know drilling depths as well as the situation of the well trajectory in crossing the stratum.So it can prevent drilling wellbores from colliding, thus improving the oil reservoir encountering rate and saving drilling cost.

3D MODELING OF WELL TRAJECTORY
3D Modeling method: In a virtual environment, to create a 3D object, according to the geometric topology characteristic of the object, geometric modeling should be made by corresponding modeling method.For the 3D visualization of well trajectories, most of traditional modeling methods are simply to connect up the 3D coordinate points composing a well trajectory, which cannot intuitively observe the real 3D structure of a well trajectory.
According to the well-type, oil drilling wells can be divided into straight well, directional well and horizontal well.Even the straight well, due to the effect of various stratum stresses in actual drilling process, the bit will often offset in different degree.Therefore, most well trajectories are tubular structures with various curvatures.However, existing modeling methods for tubular well trajectories are usually to connect cylinders end to end.It will generate gaps in the crooks of a well trajectory (Fig. 1), so we need to use interpolation smoothing treatment and other special methods on gaps (Liu and Samuel, 2008).These methods will bring in numerous data transforming calculation, thus seriously affect drawing efficiency and lead also to inflexibility interactive operation of the built graphic.Therefore, this study puts forward a new solution of slice-based 3D modeling for a tubular well trajectory.
The basic thought of the solution is as follows: firstly, some cross-sections (namely slices) perpendicular to the borehole axis are constructed by taking the coordinate points which compose the borehole axis as the center of a circle.Then, because the axis is curved and the normal vectors of adjacent cross-sections are different, the side face between the adjacent slice circumferences is established by a series of triangle graphic elements, constructing some Triangulated Irregular Networks (TIN).These TIN are finally laid end to end, consequently fitted to a smooth and seamless tubular well trajectory (Fig. 2).

3D Modeling process of slice-based tubular well trajectory:
Getting the global coordinates of equal division points on the circumference of slices (namely crosssections): In order to establish the model of a tubular well trajectory, we need to extract some equal division points from the circumferences of cross-sections and get their global coordinates.Suppose R as the radius of a well bore, p 1 as a cross-section, p 1 (x 1 , y 1 , z 1 ) as its circle center global coordinate and p 0 as a cross-section adjacent to the cross-section p 1 (Fig. 3).and its z'axis and global coordinate z-axis are in the same plane YOZ, which become an acute angle.Thus, the local coordinate x-axis is determined by the right-hand screw rule.Taking the local coordinate x'-axis as the starting point, the cross-section p 1 is divided into n equal parts in counterclockwise direction, then each equal division angle is θ, θ = 2*π/n.
• Calculating the global coordinate value of a certain equal division point on the circumference of crosssection p1.Suppose the equal division point on the circumference of cross-section p 1 as Q and its local coordinate as Q'(x', y', z'), then the coordinate value of Q' is: In which, j∈ (0, 2, …, n-1) • Calculating the global coordinate of Q by the local coordinate of Q: Taking the origin point O in the global coordinate system as the center of a circle, in which its radius is equal to the well bore radius R, draw the circle O in XOZ plane.Then Taking the global coordinate x-axis as the starting point, the circle O is divided into n equal parts along counterclockwise.Thus, the value of each equal division angle is θ and the equal division point of the circle O which corresponds to point Q will be got, which is supposed as point Q 0 .So the value of global coordinate point Q 0 is equal to the value of local coordinate point Q'.At last calculate the global coordinate value of point Q by use of the coordinate value of point Q 0 .The process of derivation is as follows: Step 1: Translating circle O along with the global coordinate system so that point O can coincide with point p 1 .
Step 2: Separately Rotating circle O with x axis and z axis of global coordinate system in clockwise direction with some angle(α, β)until the normal vector of circle O passing the point O has the same direction with 0 1 p p and point Q O coincides with point Q.As what has been discussed above, with the 3D translation and rotation transformation formula, the global coordinate of point Q is derived as follows: In which, (x 1 , y 1 , z 1 ) is the global coordinate of point p 1 .
Suppose c 1 , c 2 , c 3 as the cosine values of the angle between 0 1 p p and x-axis, y-axis, z-axis of global coordinate system respectively, 0 1 p p lies in the plane ABHE and plane ADHG, with the space geometry and the positions of lines or planes, we can get the conclusion that the angle between plane ABHE and FEHG is α and the angle between plane ADHG and FEHG is β.So the formula (2) can be represented as follows: • when c 1 ≠1 and c 3 ≠1

£¨3£©
(3) Constructing the side between slices (namely crosssections): According to the data of deviational survey points (Let m be the number of points) obtained from logging while drilling, taking each deviational survey point as the center of a circle and supposing R as radius, we can construct m well bore cross-sections and then divide the circumference of each cross-section into n equal parts.So the coordinate values of m*n points can be calculated by Eq. ( 1  In which, point p ij represents the jth equal division point of the ith cross-section (i = 1, 2… n; j = 1, 2… m).The concrete construction process is as follows: Firstly beginning with point p 00 , then joining the point p 10 and p 01 successively, the first triangle unit is constituted.Secondly, joining the point p 11 , then we get the second triangle unit.That is to say, whenever joining a new point, by which and two points of former triangle unit, a new triangle unit is constructed.In this way, from left to right, the first TIN 1 is constructed for the lateral surface between cross-section p 0 and p 1 .Conversely, the second TIN 2 will be constructed and so on.Thus we can get the 3D grid of the whole wellbore from top to bottom.

Calculating the normal vector of the well wall:
In order to determine the 3D direction of a well wall (namely the outside surface of well trajectory), we need to calculate its normal vector.In this study, the normal vector of a well wall is made up of these normal vectors which pass each triangle vertexes of the 3D grid mentioned above, therefore, we need to calculate all the vectors.Take point p 00 for example, set the normal vector, which passes the point p 00 , of the well wall as ) , , ( 00 00 00 00 , its calculating process is as follows: Step 1: Calculating the cross product vector , the coordinate value of the normal vector l00' is:

3D VISUALIZATION IMPLEMENTATION OF A WELL TRAJECTORY
Take Microsoft.NET as the software development platform, based on virtual reality technology, make use of language C# and call the library function of OpenGL (Liu, 2006; Xue et al., 2012) and implement 3D visualization of the well trajectory.The process is as follows: • Conversion of the 3D coordinate data in OpenGL library from well-log data: The data for 3D visualization of a well trajectory derive from the deviational survey data which are obtained from logging while drilling.For example, the data in Table 1 is the partial deviational survey data of the directional well "QI 24-16" of DaGang Oilfield.During the 3D well trajectory being drawn, due to the inconsistency between the user coordinate system and the one in OpenGL, it is necessary to transform the well-log data in the user coordinate system.
The transformation method is as follows: Step 1: The value of vertical depths, north-south coordinates and west-east coordinates of the well-log data should be normalized to make the well trajectory limited within a given scene and assume that array EZB[i], array TVD[i] and array NZB[i] correspond to the normalized data respectively.
Step 2: Assuming that these arrays corresponding to the logging data above are respectively X In which, TVDmin is the coordinate value of starting point on the vertical depth.
• Drawing a well trajectory: Assuming that there are m deviational survey points for a well, each cross-section (m in all), which was constructed by taking every deviational survey point as the circle center and some set value as the radius, can be divided into n equal parts.At first, calculate the global coordinates of all equal division points on the circumference of every cross-section by formulas (1)~( 5), then use formulas ( 6)~( 8) to calculate the well wall normal vector passing every equal division point so as to determine the received light of the well wall.Finally, draw the 3D well trajectory.
The core code realizing the drawing process above is as follows: For example, the 3D tubular well trajectory drawn by use of the data in Table 1 is shown in Fig. 5.
Here there are 8 equal division points on every cross-section, that is, every tubular wellbore between adjacent cross-sections is made up of 16 triangle units, in which the red line shows the axis of the well trajectory.In order to reveal the realized result more intuitively, a part of the well trajectory is enlarged, as is shown in the right figure.
• Rendering of light and material, etc: Light is the most important way to enhance the photorealistic of an object (Guo et al., 2008).For a well trajectory, there is a distinct 3D effect only after added by light.The display effect of a well trajectory has a great relationship with the position of light source, the setting of the light color and material.In addition, in order to observe the axis of a well trajectory, the clearing technique should also be used.

• Implementing of human-computer interaction:
The human-computer interaction is mainly reflected in Cao et al. (2010): some real-time operations for 3D virtual objects can be done by a mouse or keyboard, which mainly include rotation, translation, zooming etc.The morphology of a well trajectory is expressed by a dynamic threedimensional image.Thereby drilling technical personnel can observe and operate the well trajectory from different angles, heights and locations.The three operations above can be realized in following methods.
Rotation: Rotation of the 3D well trajectory can be realized through mouse operations, which need to call Translation: That is the movement in the plane of the 3D trajectory with any distance and any direction.It is realized by changing the X and Y coordinates in the process of moving and then calling the function glTranslatef().

Zooming:
The realization of zooming is as follows: according to the stretch of a mouse, scale the component X and Y respectively and keep the component Z constant in the zooming, then call the glScalef() function.This will facilitate the drilling technicians to understand the well trajectory in detail.

APPLICATION EXAMPLE
The method for 3D visualization of a well trajectory discussed in this study has been tested and applied in DaGang Oilfield and get a well result.The applications mainly include: • 3D Visualization of the old well trajectory: It is more convenient to compare the difference in locations between an old well trajectory and a new one for achieving the purpose of anti-collision in drilling.• 3D Visualization of the designed trajectory: The aim is that drilling technicians can intuitively observe and analyze the deviation between the actual drilling trajectory and the designed trajectory so as to adjust the drilling technique.• 3D Visualization of the actual drilling trajectory: According to the obtained real-time data from logging while drilling, the actual drilling trajectory is displayed in real-time three dimensional solid, so that drilling technicians can intuitively observe the well trajectory trend, drilling depth as well as the track situation when passing through the stratum at any time.The actual drilling well trajectory of the directional well "QI 24-16" in DaGang Oilfield is as shown in Fig. 6.

CONCLUSION
This study achieved 3D visualization of a well trajectory and provided flexible operations for 3D virtual objects, which include an object rotation, translation, zooming, etc.Consequently, drilling technicians can intuitively observe and analyze the well trajectory from any angle and any location and then control it effectively, thus improving oil reservoir encountering rate.

Fig. 2 :
Fig. 1: Well trajectory model composed of cylinders Fig. 3: Circle O and cross-section p1 in the global coordinate system Suppose

Fig. 4 :
Fig. 4: Lateral surface unfolding schematic diagram of a well trajectory formed by m groups of cross-sections is connected end to end, thereby fitted to the tubular well trajectory in which the lateral surface unfolding schematic diagram is as shown in Fig. 4.In which, point p ij represents the jth equal division point of the ith cross-section (i = 1, 2… n; j = 1, 2… m).The concrete construction process is as follows:Firstly beginning with point p 00 , then joining the point p 10 and p 01 successively, the first triangle unit is constituted.Secondly, joining the point p 11 , then we get the second triangle unit.That is to say, whenever joining a new point, by which and two points of former triangle unit, a new triangle unit is constructed.In this way, from left to right, the first TIN 1 is constructed for the lateral surface between cross-section p 0 and p 1 .Conversely, the second TIN 2 will be constructed and so on.Thus we can get the 3D grid of the whole wellbore from top to bottom.

Fig. 6 :
Fig. 6: The well trajectory of directional well "QI 24-16" these mouse controlling events such as glOn Mouse Move(), glOn Right Mouse Down(), glOn Left Mouse Down(), glOn Left Mouse Up(), glOn Right Mouse Up(), glOn Middle Mouse Down() and glOn Middle Mouse Up().And through calling mouse dragging functions like start Drag (Point Mouse Pt) and drag (Point Mouse Pt), the 3D well trajectory information can be observed in real time from different angles.