Chapter 4. VISIM - Direct and Gaussian sequential simulation

Table of Contents

VISIM
Running VISIM from Matlab
Plotting VISIM realizations
VISIM examples
visim_init
Direct Sequential Simulation
Correlated data errors
Simulation of linear inverse problems
Cross borehole tomography example

This chapter discuss how to run VISIM from within Matlab.

VISIM

VISIM is a sequential simulation code based on GSLIB ('Geostatistical Software LIBrary', Stanford Center for Reservoir Forecasting, Stanford University) for sequential Gaussian and direct sequential simulation with histogram reproduction. In addition to classical simulation based on noise-free hard data of point support, VISIM also handles noisy data of mixed support, enabling linear stochastic inversion using the sequential simulation approach.

VISIM can be used to generate samples of the a posteriori distribution of a linear inverse problem.

For detailed information the usage of VISIM visit the VISIM homepage at IMGP. [user manual pdf].

References to the use of VISIM should be made to :

Hansen, T. M., and Mosegaard, K., 2008. VISIM : Sequential simulation for linear inverse problems. Computers andGeosciences, 34(1), pp 53-76. [doi:10.1016/j.cageo.2007.02.003].

Running VISIM from Matlab

The three main files to control VISIM from Matlab are the section called “read_visim” the section called “write_visim” the section called “visim”

Check path to VISIM

When running the section called “visim” an attempt is made to look for a VISIM binary. First the 'bin' sub folder where mGstat is installed is searched, then the system path is searched for 'visim' binary file. By running the section called “visim” with no arguments the path to the use binary (if located) is listed:

visim;
Using VISIM binary : ~/bin/visim

If the binary for VISIM is not found you have to edit the 'visim.m' m-file and manually give set the path in the top of the file.

Running VISIM from Matlab

the section called “visim” is used to run VISIM from within Matlab. The input is either a VISIM parameter file (as a string) or a VISIM Matlab structure, as obtained using the section called “read_visim”.

Therefore the following two approached will run VISIM on the visim_sgsim.par:

V = visim('visim_sgsim.par');

V = visim('visim_sgsim.par');
V = visim(V);

which will result in the following out to the screen :


 VISIM Version: 1.000

 filename is sgsim_uncond.par
 sgsim_uncond.par
 Initializing data2vol covar lookup table
 Initializing vol2vol covar lookup table
 Working on realization number  1
 Working on realization number  2
 Working on realization number  3
...
 Working on realization number  100

V =

                parfile: 'sgsim_uncond.par'
               cond_sim: 0
              fconddata: [1x1 struct]
                   cols: [6x1 double]
               fvolgeom: [1x1 struct]
                fvolsum: [1x1 struct]
             trimlimits: [2x1 double]
             debuglevel: -11
                    out: [1x1 struct]
                   nsim: 100
                   ccdf: 0
                refhist: [1x1 struct]
                     nx: 21
                    xmn: 0.1250
                   xsiz: 0.2500
                     ny: 49
                    ymn: 0.1250
                   ysiz: 0.2500
                     nz: 1
                    zmn: 0.1250
                   zsiz: 0.2500
                      x: [1x21 double]
                      y: [1x49 double]
                      z: 0.1250
                  rseed: 69068
                minorig: 0
                maxorig: 1
               nsimdata: 28
                  volnh: [1x1 struct]
              densitypr: 0
        assign_to_nodes: 1
    max_data_per_octant: 0
          search_radius: [1x1 struct]
           search_angle: [1x1 struct]
                  gmean: 0.1304
                   gvar: 2.0000e-04
                     Va: [1x1 struct]
                   tail: [1x1 struct]
                      D: [21x49x7 double]
                  etype: [1x1 struct]

The output of running visim is the Matlab structure listed above, that contains all parameters of the VISIM used parameter file, as well as the simulated/estimated data V.D, and the E-type mean and variance as V.etype.mean and V.etype.var

An example of running 9 runs of VISIM while changing the primary anisotropy direction from 0 to 90 is the following

Vorig = read_visim('visim_sgsim.par');
for i=1:4
  V{i}=Vorig;
  V{i}.Va.ang1=i*10
  V{i}=visim(V{i}));
end

Each of the Matlab structures V{1},V{2},..,V{9} now contain the simulation result.

Plotting VISIM realizations

To plot a number of generated realizations use the section called “visim”.

The simplest use of the section called “visim” is simple to specify a number of realizations to plot.

V=read_visim('sgsim_cond_1.par');
visim_plot_sim(V,2)

An example of using all the options available for the section called “visim”

nsim=7;     % number of realizations to plot
cax=[.1 .16]; % scaling for colorbar axis
FS = 10;    % FontSize
nxsub=7;    % Number of subplots in the X-direction
nzsub=7;    % Number of subplots in the z-direction
visim_plot_sim(V,nsim,cax,FS,nxsub,nzsub);

Visim E-type example 1

Plotting VISIM E-type

In case VISIM is run in simulation mode, visim_plot_etype plots the E-type (the point wise mean and/or variance) of all generated simulations.

cax=[.1 .16]; % scaling for colorbar axis
visim_plot_etype('sgsim_cond_1.par');

Visim E-type example 1

The following will plot both the E-type mean and variance.

V=read_visim('sgsim_cond_1.par');
plotAll=1;
visim_plot_etype(V,plotAll);

Visim E-type example 1

The following will plot both the E-type mean and variance with the specified colorscales.

V=read_visim('sgsim_cond_1.par');
cax=[.1 .16]; % scaling for colorbar axis E-type Mean
cax_var=[0  1e-4]; % scaling for colorbar axis E-type variance
plotAll=1;
visim_plot_etype(V,plotAll,cax,cax_var);

Visim E-type example 1

See more info at the section called “visim_plot_etype”

Plotting VISIM histogram

To plot the histogram for all realizations, compared to the a priori chosen one use visim_plot_hist :

V=read_visim('sgsim_uncond.par');
visim_plot_hist(V);

Visim E-type example 1

and to plot just the histogram of one simulation use

V=read_visim('sgsim_uncond.par');
visim_plot_hist(V,10);

Visim E-type example 1

See more info at the section called “visim_plot_hist”

Plotting VISIM semivariogram

To plot the experimental semivariograms compared to the a priori chosen semivariogram, use visim_plot_semivar_real :

V=read_visim('sgsim_uncond.par');
visim_plot_semivar_real(V);

Visim E-type example 1

See more info at the section called “visim_plot_semivar_real”

To compatre the mean experiemntal computed for a number of realizatoins to the a priori chosen semivariogram, use

V=read_visim('sgsim_uncond.par');
visim_plot_semivar(V,1:V.nsim);

Visim E-type example 1

See more info at the section called “visim_plot_semivar”

Plotting the sensitivity kernel

The sensitivity kernel for all or a specific selection of volume average data can be plotted using :

subplot(1,3,1)
visim_plot_kernel('sgsim_cond_3.par');
subplot(1,3,2)
visim_plot_kernel('sgsim_cond_3.par',11);
subplot(1,3,3)
visim_plot_kernel('sgsim_cond_3.par',11:25);
colormap(1-gray)

This will result in the following :

Examples of plotting the kernel

See more info at the section called “visim_plot_kernel”

Plotting VISIM conditional lookup table

See more info at the section called “visim_plot_condtab”

Plotting the distribution of the prediction error of the used volume average data

To plot the distribution of the volume average estimates as calculated form the realization and the observed volume average values use:

V=read_visim('sgsim_cond_1.par');
visim_plot_volfit(V);

Visim E-type example 1

See more info at the section called “visim_plot_volfit”