You are on page 1of 58

Builder Tutorial

Geostatistical and Scripting Tools


Gilles Bourgault
Calgary
September 2006

Aims and Goals


Build maps and a simulation grid.
Populate the simulation grid with spatial
properties.
Familiarize yourself with Geostatistical and
Scripting tools available in Builder.

Pre-Requisites
Familiar with Builder.
Concepts of spatial interpolation and mapping.
Concepts of geostatistics (variogram, kriging).
Concepts of conditional simulation.
Suggested Geostatistical Text Books:
An Introduction to Applied Geostatistics, Isaaks and Srivastava, Oxford
Applied Geostatistics for Reservoir Characterization, Kelkar and Perez, SPE
Geostatistics and Petroleum Geology, Hohn, Kluwer
Geostatistical Reservoir Modeling, Deutsch, Oxford

Deterministic or Probabilistic?

Oil reservoir (Mineral deposit) are physical systems that


are perfectly deterministic.
Geological systems are created by many processes at
different scales.
We have few measurements. We still lack a great deal of
information to fully determine those systems.
We cannot write the deterministic equations that will
calculate the property value we observe at any given
location in the system (e.g. porosity in the reservoir).

We do not know the behavior of the system


in terms of mathematical equations.
Based on sampling, we can still describe its
behavior in terms of statistics and probabilities.

Probabilities for Deterministic Objects


Spatial Random Functions

Probability space

Physical domain

A spatial random function Z(u,) can be defined as a collection


of regionalized random variables Z(u) over a spatial domain D.

Z(u , ) {Z (u )}, u D

Space
u: ( x, y, z )
Coordinate

Z(u) denotes a random variable at the location u


is the set of all possible realizations (outcomes) of the random function

Values at each location u are described by a random variable.


The set of all values in D represents 1 realization of the random
function. Z(u , ) {z (u )}, u D, Probability Space

Z(u

Z(u)

D Physical Space Z Attributes


u

z (u )

Mineral Deposit
Oil Reservoir

Gold
Porosity
Permeability

Realization of Random Functions Z(u , ) {z (u )}


z(u) denotes an outcome value or realization at the location u
Probability space is filled with multiple realizations

Z(u ,1)

Z(u) z1(u)

Z(u , 2)

Z(u)

z2(u)

Z(u ,3)

Z(u) z3(u)

Probability
Density
Function at
location u

f Z (u )

u
is defined
over multiple
realizations

Prob{ 1} Prob{ 2} Prob{ 3}L

All realizations are equivalent

The actual reservoir is one such realization

Random Functions Z(u , ) {Z (u )}, u D


Discretization of the Spatial Domain D
Univariate

Trivariate

Bivariate

D
D

N-variate
N = NX*NY*NZ

Random Function on a Grid => N-variate Distribution

Probabilities for Deterministic Objects

Z(u ,1)

Example of 1 realization of a Random Function in 1D

z1(u)

z1(u)
u

1D line is discretized in 50 locations => 50-variate Random Function

Probabilities for Deterministic Objects


Example of multiple realizations of a Random Function in 1D
R.F.

Z(u , )

1, ,100

100 realizations

Z(u ) (for short)


Local pdf at location u

f Z (u )

Distribution of 100 outcomes at location u

f Z (u )

n=100

z(u)
1, ,100

R.V. at u is characterized by a mean m and a standard deviation

Probabilities for Deterministic Objects


Stationary Random Function
All random variables have same expected value and same variance

m E{Z (u )} E{( Z (u ) m) }
2

n=100

m
3
(100 realizations)

m and do not depend on the location u


local pdf is everywhere the same

Stationary distribution (pdf)

Stationarity => region with homogeneous


statistics

=> No Trend

Probabilities for Deterministic Objects


Stationary Random Function

Stationary LogNormal distribution (pdf)

m and do not depend on the location u


local pdf is everywhere the same

Stationarity => region with homogeneous


statistics

=> No Trend

Probabilities for Deterministic Objects

Characterizing the Random Function with Correlations


(100 realizations)
h=49
h=1
closer random variables
have higher correlation
This is often observed
in nature
1

n 2

(( z (u ) m)( z (u ) m))
i

Coefficient
of correlation

Z (u50 )

Z (u40 )

0.0

0.9

Pairing
locations

n=100
n=100

lag distance h=49

Z (u1 )

Z (u39 )

lag distance h=1

Probabilities for Deterministic Objects


Characterizing the Random Function with Moments of Inertia
(100 realizations)

h=49

h=1

closer random variables


have a smaller moment
of inertia in their x-plot
1
1 n 1
2
d ( zi (u ) zi (u )) 2
n
n i 2
Moment of
inertia about
first bisector

Z (u50 )

Z (u40 )

0.0

0.9

1.0
2
d

2
1
z

z

2

lag distance h=49

0.1

n=100

Z (u1 )

n=100
Z (u39 )

lag distance h=1

Characterizing Random Functions


(100 realizations)

Correlogram = correlation as a function of lag distance


Variogram = moment of inertia as a function of lag distance
Correlation length

(0) 2 (h)

(h) (0) (h)

Correlation vanishes
f(h ) when moment of
inertia reach the
maximum value

f(h )

(0) 0

h
h=lag distance between any two random variables

not to scale

Maximum correlation at h=0 corresponds to the variance of Z(u)

Probabilities for Deterministic Objects


Ergodicity: Each realization reproduces the variogram and correlogram if
observed over a Domain of infinite dimension (large enough)
outcomes (actual values)
random variables

1
1
2
(h ) E{( Z (u ) Z (u h )) } E{( z (u ) z (u h )) 2 }
2
2
Example of a realization of Random Function in 1D
h
Lag size

z(u)
z(u)

D
u

random variables

outcomes (actual values)

(h ) E{( Z (u ) m)( Z (u h ) m)} E{( z (u ) m)( z (u h ) m)}

Probabilities for Deterministic Objects


Fluctuations in the Variograms when computed for each realization
over a finite Domain
100 realizations
[1, N 100]

100 variograms
(h ) , [1,100]
The averaged variogram
identifies the variogram
of the random function.
1
(h )
N

(h )
1

Ergodic fluctuations

not to scale

Ergodic fluctuations increases with the lag distance

Probabilities for Deterministic Objects


Few observations (measurements) of a realization
of a Random Function in 1D

The practice of computing variograms


The actual reservoir (or deposit) is locally known at few data locations

Stationary Histogram (pdf) = Data Histogram


Multiple realizations

Stationary distribution (pdf)

The actual reservoir (1 realization) is locally known at few data locations


Assuming ERGODICITY => Stationary Histogram = Data Histogram

Data histogram

Computing Variograms = Data Pairing


r
(hi )

uu
r

ur 2
1 N ( hi )
ur [ z (u ) z (u hi )]k , u
2 N (hi ) k 1

20 data locations, regular sampling

h=1

(h 1) =>

N(h=1) = 19

( h 2) => N(h=2) = 18

h=2

( h 3) => N(h=3) = 17

h=3

( h 19) => N(h=19) = 1

h=19
regular sampling => regular lag distances

Computing Variograms = Data Pairing


11 data locations, irregular sampling
Lag tolerance

r
(hi )

Lag size

1
ur
2 N ( hi )

uu
r
N ( hi )

ur 2
[
z
(
u
)

z
(
u

i )]k , u
k 1

Lag1: N(h1)=7 pairs

Lag2: N(h2)=5 pairs

1
1

1
1

2
0

1
0

Computing Variograms = Data Pairing


r
(hi )

42

43 42

39 39 41 40 38

37 37 37 35

38 37 37 33 34

35 38

37 36 36 35

35

36 35 36 35

34 33 32 29 28

38 37 35

30

29 30 32

hi
hi = lag distance vector

er
an
ce

40 39 37 36

to
l

40 42

Angular and distance tolerances


are used to get enough pairs of
values in any given direction.

4 pairs

dth
wi
nd
Ba

44

k 1

L
ag

Attribute Z

ur 2
[ z (u ) z(u hi )]k , u

si
ze

Example of 2D sampling geometry

1
ur
2 N (hi )

L
ag

2D sampling

uu
r
N ( hi )

hi
Angle
tolerance

(3D: vertical variogram is along wells or across grid layers)

Direction
angle

Fitting Variograms
Experimental

1
ur
2 N (hi )

ur 2
[ z(u ) z(u hi )]k , u
k 1

Variogram

(hi )

Semi-Variance

(h)

r
(hi )

uu
r
N ( hi )

Each experimental point


may involve a different
number of data pairs N(h).
Rule of thumb >=30 pairs
Lag distance h

(direction

Theoretical

hi

1
(h) E{( Z (u ) Z (u h)) 2 }
2

Fitting Variogram Anisotropy


Fitting anisotropies => finding directions of major and minor axis
Major axis = direction of maximum range

Anisotropy
Ellipse

Minor axis = direction of minimum range

Variogram Map
(h)

N
h
h

Sill at 10

Top View.
Vertical Cross-section
along x-axis.

(h)

Variogram is
symmetric in h

( h) ( h)

Would be a variogram
cube in 3D

Variogram and Spatial Heterogeneity


.

N(0,1)

Nugget Model

1
0
-1 0

20

40

60

80

100

120

(h)

-2
-3
-4
.

Spherical Model

N(0,1)

2
1

(h)

0
-1 0

20

40

60

80

100

120

-2
-3

Gaussian Model
.

3
2

N(0,1)

(h)

0
-1 0

20

40

60

80

100

120

-2
-3

Isotropic-Anisotropic
(h)

All Directions

Direction 120 degrees


Direction 30 degrees

(h)

N(0,1)

N(0,1)

Isotropic

Anisotropic

Variogram and Trend


Variogram does not reach a sill, instead
it keeps increasing above the data variance level

Northing

East-West Direction

Sill = Data Variance


North-South Direction

Easting

If possible, remove Trend before computing variogram.


Compute variogram in a direction where Trend is not present.
Use only the beginning of the variogram curve. (Search radius <=5)

Reconciling Data and Random Function


Stationary versus conditional distributions (pdf)

f Z (u39 ) f Z (u40 ) f Z
Z (u40 )

0.9

u39

u40

Stationary

Conditional probability density


function at location u40

Conditional
Stationary

f Z (u40 | Z (u39 ) z )
Considering only realizations with z(u39) = 1
Stationary

Z (u39 )

(1)
z(u39) = 1

Conditional Random Function

Z (u40 )

Considering only realizations with z(u39) = 1


u39 u40

(1)

Z (u39 )

f Z (u40 ) f Z

f Z (u40 | Z (u39 ) z )
m 0.0

1.0
2

m 0.9

0.3
2

(1)

Conditional
Stationary
Z (u40 )

Stationary or Unconditional

Z (u40 )

Conditional
Local pdf at u40 is a conditional pdf

Stationary and Conditional Random Function


Stationary Random Function before Observing Data

f Z (u ) f Z (u ) f Z

3
m

E{Z (u )} m

pdf does not


depend on the
location

Stationarity is lost when Random Function is Conditioned to Data

f Z (u | (n)) f Z (u | (n))

3
m

E{Z (u ) | (n )} m(u )

3
Away from the data, Stationarity remains

pdf does depend


on the location
=> conditional pdf
(n) Set of conditioning data, in this example n=1

Data and Random Function


Unconditional Stationary Random Function

Z(u , ) {z (u )}

m
3
Conditional Stationary Random Function

3
m
3

Z(u, ) {Z (u )}
Unconditional
Random Variables

Z(u , | ( n)) {Z (u | (n))}

Z(u , | (n)) {z (u | (n))}

(n )

(n)

Conditional
Random Variables
Conditioned by
(n) Data
Uncertainty is reduced in the vicinity of the data

Kriging in a nutshell
Kriging is a linear estimator

searching neighborhood

Linear combination of data

Z (u )

n(u)

z(u ) z (u )

?
u

Random Function Model

Spatial location u = (x,y)


Z(u) = property value at location u

Linear combination of random variables


n(u)

Z (u ) Z (u )

n(u) = # of data around location u

Estimation Error: (u ) Z (u ) Z (u ) is also a R.V.


As a R.V., the mean and variance of (u) can be computed
E{ (u )} E{ Z (u ) Z (u )} E{Z (u )} E{Z (u )} m( 1)

None-bias condition E{ (u )} 0

Kriging in a nutshell
Computing variance of estimation error
Linear estimator

Z (uo )

n ( uo )

Z (u )

n ( uo )

Constraint

Variance of estimation error

Estimation error

Var { (u0 )} 2 (h 0 )

(uo ) Z (uo ) Z (uo )

(h )
n

Find weights at min error variance G ( , ) Var { (u )} 2 (1 )

under constraint
G ( , )
0 ,

n equations

G ( , )
0

1 equation

r
r
(h ) (h 0 )
n

Lagrange Multiplier

n+1 equations
n+1 unknowns

Ordinary Kriging
n

Minimum Variance

Var { (u0 )} (h 0 )

Kriging with 2 Random Variables


Error Variance

Estimator

Z (uo ) 1Z (u1 ) 2 Z (u2 ) Var { (u0 )} 21 (h10 ) 22 (h20 ) 212 (h12 )


at the minimum error variance

1 * (0) 2 * (h12 ) (h10 )


1 * (h21 ) 2 * (0) (h20 )
1 2 1

Var { (u0 )}

1 2 1

Error Variance at u

Ordinary Kriging with 2 Random Variables

searching neighborhood
Z (u )
?
u

(h)

Variogram

Semi-Variance

Kriging in a nutshell

(h)

1
E{( Z (u ) Z (u h)) 2 }
2

Lag distance h

Kriging is a linear estimator


n (u )

Kriging=>Minimizing Error Variance


e(u ) Z (u ) Z (u )

' s E{e(u )} 0 Min[Var {e(u )}] K2


Solve a linear system of equations
written in terms of weights and variograms

Z (u ) Z (u )

n(u )

Kriged Map

Kriging in a nutshell
Z (u )

Kriged Map

Kriging and Anisotropy


Kriging Omni-directional

Kriging Anisotropy 90 Degree

Azimuth 90

Inverse distance

Kriging Anisotropy 0 Degree

Azimuth 0

Kriging

Inverse distance

Azimuth 90
Kriging Anisotropy 90 Degree

Azimuth 0
Kriging Anisotropy 0 Degree

Kriging Variance

2 1

range = 10

K2 0.151

0.5
0

0.5

u
-4

0.01
1

0.332
u
0

Not to scale

0.668

?
1

K2 0.875

0.5

K2 0.203

Screening effect

0.99

0.5

K2 0.299
?

Variance = 1

Kriging Variance
1
2

Not to scale

0.5
0

0.5
-4

range = 10

K2 0.151

K2 0.0003

K2 0.875

K2 0.126

0.5

10

Gaussian

0.5

0.5
-9

1
2

range = 10

0.5

Spherical

10

11

K2 1.5 2 1.0

K2 0.77

Less uncertainty with a slow ramping variogram

Estimation-Simulation
Use the minimized error variance to characterize
uncertainty around kriged value
This uncertainty is often assumed to follow
Linear combination of
a Gaussian distribution=>Multi-Gaussian Dataset Gaussian distributions
69

is also Gaussian
+ Z (u) Z (u )
79
n (u )

n (u )

n (u )

47

Z (u ) Z (u )

u_0

[ Z (u ) 3 K , Z (u ) 3 K ]

60

27

+
64

Z (u )

n (u )

78

(h )
2
K

Simulation =>
Draw a Z(u) value
at random

K2

Z (u )

= Kriging variance = Error variance

Lagrange Multiplier

Multi-Gaussian Distributions
Univariate Gaussian
(bell shape)

Bivariate Gaussian
(ellipse)

Trivariate Gaussian
(ellipsoid)

N-variate Gaussian
N = NX*NY*NZ
(hyper-ellipsoid in N dimensions)
Gaussian Random Function on a Grid => N-variate Gaussian Distribution
=> Gaussian Stationary Histogram

Making a distribution Gaussian


Associating kriging mean and kriging variance with Gaussian distribution:
=>Multi-Gaussiannity => Data histogram should be Gaussian

F=>Datacdf

G=>StandardGaussiancdf
1

cumulative histogram
cdf

Probability

G ( y1)

FZ (z1)

0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1

2.5

0
1.5

NormalScoresY

Transform

0.5

0.5

y1

1.5

2.5

p G ( y1) FZ ( z1)

y1 G 1 ( FZ ( z1))

3.5

z1

4.5

DataZ

Back-Transform

z1 FZ1 (G ( y1))

Simulation of Gaussian Values


Simulation at 1 location
Probability values can be generated with a random number generator
1

Monte Carlo simulation calibrated by Kriging

( p )
0

StandardGaussiancdf:p=G(y)

Probability

0.9
0.8
0.7

m and from kriging

0.6
0.5

y( m , ) G 1 ( p ) * m G(m1, ) ( p )

0.4
0.3
0.2
0.1

2.5

0
1.5

0.5

NormalScores

0.5
y(0,1)

( y )

1.5

2.5

3.5

4.5

y( m, ) y( 0,1) * m
Rescaling according to kriging

Sequential Gaussian Simulation


Multi-Gaussian Distribution as Multiplications of Univariate Gaussian Distributions

Bivariate Gaussian

Univariate Gaussian

Z2

Pr{Z1}

Pr{Z2|Z1}
Z1

Z1
Z1 = z

Pr{Z1}

Z1 = z Z2 = z
z and z are correlated
values ( )

Pr{Z1,Z2} = Pr{Z1}*Pr{Z2|Z1}

Sequential Gaussian Simulation


Multi-Gaussian Distribution as Multiplications of Univariate Gaussian Distributions

Trivariate Gaussian

Pr{Z1,Z2,Z3} = Pr{Z1}*Pr{Z2|Z1}*Pr{Z3|Z2,Z1}
Z1 = z

Pr{Z1} Z1

Z2 = z

Z3 = z

Pr{Z2,Z3|Z1}
3
Z2

Z3

Z3

Pr{Z3 |Z2,Z1}

Z2

Z2
z, z, and z are correlated values

Z1

Pr{Z2|Z1}

Sequential Gaussian Simulation


1 datum, 2 blank grid nodes
z?sim1 z?sim2
z0
0

1. Do SK on u1 using datum at u0.


2
Z (u1 ) and SK
(u1 )
2. Monte-Carlo simulation of standard
Gaussian value.
z G 1 ( p x )

px

N(0,1)

2
(u1 )
3. Rescale z using Z (u1 ) and SK

Z (u1 ) 0 z (u0 )

(u1 )
2
SK

Z sim (u1 )

Z sim (u1 ) z * SK (u1 ) Z (u1 )

4. Do SK on u2 using data at u0 and u1.


Z (u2 ) 0 z (u0 ) 1 z sim (u1 )

(u2 )
2
SK

Z sim (u2 )

2
Z (u2 ) and SK
(u 2 )

5. Repeat steps 2, 3, and 4.

Estimation-Simulation
Multiple Geostatistical Realizations

3
m

Kriged curve

3
Kriged standard
deviation

Data

Kriged curve = Average of all simulated curves

Geostatistical Simulation
Data

Kriging Estimation

Kriged map = Average of all simulated maps

Kriging Simulation

Geostatistical Simulation
Variogram Reproduction

Simulations
Data

estimation

Geostatistical Simulation
Data

Histogram Reproduction

2 25540

Simulation

Kriging

2 11793

2 25438

Geostatistical Simulation
One answer

Kriging Estimation

Multiple answers

Kriging Simulation

Flow Simulator

Flow Simulator
Uncertainty Analysis
Flow on Kriged map

Averaged Flow of Simulated Maps

Co-Kriging in a nutshell
Z (u )

Primary-Hard
?
u

Y (u )

Secondary-Soft
u

Z (u )

These weights depend on variogram

n (u )

Z (u ) Z (u ) Y (u )
1

n (u )

Z (u ) Z (u )

?
u

This weight depends on


correlation hard-soft

Kriging
Co-Kriging

Colocated-Kriging cc=0.7

Soft

Colocated-Kriging cc=0.9

Tutorial Main Steps: 1. Building Grid

Load Well Trajectories


Load Top Data
Interpolating Top with Kriging
Importing Thickness Data
Interpolating Thickness with Kriging
Combining Top and Thickness
Define the Grid Layers

Tutorial Main Steps: 2. Populating Grid

Import Well Logs for Porosity


Simulate Porosity Data with Geostatistics
Import and Calibrate Well Test Data
Simulate Permeability with Geostatistics

Tutorial Final Steps: Automatic


Workflow
Create a Script that will generate multiple
versions (cases) and save the datasets
Run and Save the Script

Getting Started

Start Launcher

Set the data directory

Click and Drag the data file tutorial_start.dat on the


Builder Icon

Open WORD document GeostatisticsTutorial.doc


GeostatisticsTutorial.doc and
follow the instructions

Please, ask questions whenever needed.

You might also like