Вы находитесь на странице: 1из 4

Corner Point Gridblock Surfaces

Peter J. Puchyr SpaceTime Simulation Corp 2012-06-10

Abstract
When corner point geometry is used to dene gridblocks in reservoir simulation, the gridblocks retain some features of the conventional bricklike gridblocks (eg, 6 faces, 8 corners, 12 edges) but not all. Most notably, the four points dening a face are frequently not coplanar, so that each face is in fact a three dimensional object. This has signicant ramications when attempting to determine which gridblocks are penetrated by a specied wellbore trajectory. This paper describes the mathematics of determining the intersection of straight wellbore segments with gridblock faces.

Introduction

In reservoir simulation (and other elds), the partial dierential equations describing uid ow are solved numerically by rst discretizing the reservoir. The reservoir is thus broken up into so-called gridblocks. In the early days of reservoir simulation, the gridblocks were regular hexahedrons, like bricks, with six plane faces all meeting at right angles at each of the eight corners. A signicant advance was made with the introduction of corner point geometry. This allowed the gridblocks to more accurately conform to the layered structure of most reservoirs, and the natural fractures which occur in many of them. There are several variants of corner point geometry. In the most common form, every column of gridblocks is bounded by four straight lines which are more or less vertical (the so-called coordlines). Adjacent columns share coordlines, so no gaps are possible between adjacent columns, although the columns may have shifted vertically. Gaps are possible within a column, since the top face of a gridblock is not necessarily the bottom face of the block above it. Although much of the mathematical description of surfaces in the following applies to general corner point geometry, the focus here is primarily on the coordline version. In coordline corner point geometry, if the reservoir is broken into nx by ny columns, then there must be (nx+1) by (ny+1) coordlines. Each coordline is dened by any two points on the line. The actual coordinates of any given corner can then be determined completely by specifying which coordline 1

the corner is on, and the depth of the corner. This is exactly the manner in which the corners are input in the Taurus reservoir simulators, and in Eclipse. For every gridblock, the coordinates of the corners of the gridblock are specied. The six faces of every gridblock are completely dened by the four corners associated with the face. Since any three points in space dene a plane, having four points in a face means that the face is a plane only under restrictive conditions. In other words, the face cannot be assumed a plane, and must be considered a three dimensional object, ie, a three dimensional surface. The process of discretization does not require that any specic surface be assumed. In theory, any three dimensional surface is conceivable and acceptable as long as the four corner points lie on the surface. But it is assumed that the edge between any two corners is a straight line segment, so it is reasonable to assume that the surface is generated by sliding the endpoints of a given edge along the two side edges until it meets the opposite edge. This by denition is a ruled surface, and it is described mathematically in the following section. The impetus for this work arose from the need to determine the gridblocks penetrated by the trajectory of a wellbore. The trajectory is described by a table, with the result that the trajectory is piecewise linear. The intersection of linear segments with ruled surfaces is described in the subsequent section.

Ruled Surfaces

First, a few words about notation are necessary. A point is denoted by a capital letter (eg, P ) which represents the three dimensional coordinates (x, y, z ), sometimes denoted P = (Px , Py , Pz ). Scalar values are represented by lower case variables. A straight line is dened by any two points which lie on the line. In particular, the equation of a straight line segment from P0 to P1 is
P = P0 + u(P1 P0 )

where u varies from 0 to 1. Consider now the four points P0 to P3 dening a face of the gridblock, as shown in gure 1. A parametric equation for the surface can be developed as follows. For any given point P on the surface, let u represent the fraction of the distance from P0 to P1 and from P3 to P2 of the straight line which passes through P . On the gure, this is the straight line segment dened by the points T0 = P0 + u(P1 P0) and T1 = P3 + u(P2 P3 ). Let v denote the fraction of the line from T0 to T1 at which the point P lies. Then
P = = = T0 + v (T1 T0 ) P0 + u(P1 P0 ) + v (P3 + u(P2 P3 ) P0 u(P1 P0 )) P0 + u(P1 P0 ) + v (P3 P0 ) + uv (P2 P3 P1 + P0 )

covers the entire surface as a function of u and v , where each varies from 0 to 1. 2

The surface dened by the above equation is non-linear, except when the coecient of the uv term is zero. The coecient is zero whenever the points P0 to P3 form a regular rectangle, regardless of orientation. The non-linearity is of the hyperbolic type, and the surface created by the above formula is known as a hyperbolic paraboloid, also called a doubly ruled surface. Examples of such ruled surfaces, plotted using the above equation, are shown in gures a to b. The non-linearity in these examples is not extreme; examples of such surfaces in reservoir simulation with corner point grids are not rare.

Intersection

Consider a line segment from Q0 to Q1 . To determine the intersection point of this line segment with the above surface, the parameter t is used to represent the point on the line, and parameters u and v to represent the point on the surface. If these objects intersect, then it must be the same point, so the intersection point is the solution of
Q0 + t(Q1 Q0 ) = P0 + u(P1 P0 ) + v (P3 P0 ) + uv (P2 P3 P1 + P0 ).

Since this equation must hold for each of the x, y and z components independently, this forms a well posed system of three equations in three unknowns. Letting
A B C D E = P2 P3 P1 + P0 = = = = P1 P0 P3 P0 Q0 Q1 P0 Q0

then the above equation can be written


Auv + Bu + Cv + Dt + E = 0

where it is understood that this is three equations, one for each component. To solve this set of non-linear equations, rst eliminate the t variable by subtracting the component equation with the largest magnitude component of D from the other two equations. The result is two non-linear equations in two unknowns. Use one of those equations to solve for one of the unknowns in terms of the other, and substitute this result into the other equation. The result is a quadratic equation in one unknown, which of course is easily solved. Back substitution then solves the entire set. While this solution procedure is simple enough, it is complicated by the various cases in which coecients turn out to be zero. Care must be taken that the substitutions do not involve a division by zero. 3

Conclusion

An algorithm has been developed which solves explicitly and with certainty for the intersection of straight line segments with corner point gridblock faces. The former algorithm was also successful in doing this, for the most part. However, it was a heuristic algorithm, and it was never certain that all situations were being handled. The new algorithm removes the uncertainty and is robust. Unfortunately, the original coding of the new algorithm did not recognize all the possible situations where coecients in the non-linear equation became zero, and the algorithm failed. With continued usage, these coding shortcomings have been exposed and corrected.