Documentation for Espresso
version 27/11/1998
Adrian Sheppard, November 1998
Contents
This web page tries to document the network modelling program and
percolation simulator called Espresso. It is guaranteed to be
neither 100% accurate nor particularly complete, and may in fact be
of very little use to anyone. Comments are welcome
and should be sent to the author,
Down the left hand side of the espresso screen at any one time is
the command menu that enables you to interactively control the
execution of the network model.
Parameter Windows...
pops up a menu that enables the user to switch between the different
parameter screens. There are four different screens: Global
Options, Pore Space Details, Data Logging, and Miscellaneous.
Stopping conditions, invasion rules and trapping rules are set in
the miscellaneous screen.
Save Configuration
All the parameter settings that are displayed in the espresso GUI
have corresponding entries in the input parameters file (see
Root file name for details).
Pressing the Save Configuration button updates this file so that the
next session will start with the parameters that are currently
displayed. Note that many of the other action buttons will first
save the configuraton before performing their actions, so this
button is redundant for most applications.
Single Oil Flood, Single Water Flood and Single Gas Flood
These buttons take the current configuration that is displayed on
the screen, and flood the system with the specified fluid.
Note that if no pore space has yet been created then espresso
creates a pore space and fills it with oil if the invader is to be
water, and water if the invader is to be oil. Note that the rock is
considered to be water wet everywhere, with a contact angle of 0
degrees.
Drainage is the process simulated for oil floods. The capillary
pressures are positive and the throat sizes are used to determine
the capillary pressure thresholds. The displacement is therefore
modelled by a bond based invasion percolation.
If water is the displacing fluid then the flood is simulated via
imbibition. This is a spontaneous process so the capillary
pressures are negative. The wetting invading phase finds it most
difficult to displace the oil from the large pore bodies, thus this
is modelled by a site based invasion percolation. The details of
the imbibition are discussed under the section \
Cooperative pore filling .
Do Multi-Run
A multi-run is a specified sequence of up to four floods of any
fluid, each from either the inlet or the outlet face, that can be
performed any number of times automatically, with a new pore space
created before each new realisation is begun.
Pressing this button throws up a dialog box in which a set of
parameters can be set. This box is largely taken up by a table that
allows the user to set the invading phase and the inlet face for
each of the four stages of each realisation. If the user selects
"empty" for any of these stages, then nothing is done. The four
stages are there for mixed wettability studies where there is an
"ageing" stage between the primary drainage and the secondary flood.
The "quaternary flood" is normally anticipated to be a gas flood.
there are also a couple of other parameters that can be set here:
No. of realisations
Espresso will perform this number of
realisations using identical input parameters, and each realisation
will be listed separately in the output file
rootname_rsdls.xls Since the same random number sequence is
used throughout, each realisation should be genuinely statistically
independent.
Plot invasion dynamics
if this button is not checked, then no plot of the invasion is shown
on the screen. This will often allow the program to run much
faster, particularly for 2D runs.
Make new porespace
Generates a new pore space based on the parameters currently
displayed in the GUI, and fills it with oil.
Fill with Oil, Fill with Water
These are like reset buttons. Filling flushes the entire porespace
and then fills it completely with the specified fluid.
Root file name
Espresso interacts with numerous text and data files, to find out
all the input parameters, and to record the initial state, the final
state and the dynamics of the invasion. All these files start with
the same thing, called the root file name. For example, if the root
file name is Run1 (the default) then the output file that lists the
input parameters is called Run1_params.xls, and the output file
listing the residuals is called Run1_rsdls.xls, and all the other
filenames are of the form Run1_suffix.
Note that the input files are in the directory init_files and the
output files are in the directory out_files.
Random Seed
the sequence of random numbers needs to be
initialised via a random seed. If this value is set to any value
other than -10, then the sequence is repeatable, and repeated runs
with the same seed allow experimentation on the same pore space.
When seed is -10, then a pseudo random number is chosen for the seed
based on the number of milliseconds that have elapsed since the
first of January 1970.
Positive spreading films
If the spreading coefficient, measured as the difference between the
gas-water interfacial tension and the sum of the gas-oil and
oil-water IFTs, is positive, then the formation of an oil film at
all gas-water boundaries is energetically favoured. If spreading
films are enabled, the flow throught this film is allowed (but only
for systems with a positive spreading coefficient, see Interfacial tensions), which means that all the oil
clusters that touch the invading gas cluster are considered
connected and can drain through the spreading film.
Periodic side boundaries
If this is true, then topologically speaking, the network is a torus,
and the right hand neighbours of the points on the right hand side of
the grid are points on the left hand edge, and vice versa. There is no
longitudinal periodicity. This option probably slows the program down.
When this is false, the sides are considered sealed and clusters can
be trapped against them.
Simulate porosimetry
In porosimetry experiments, the
invading fluid (often mercury) invades from all sides at once.
Clearly there can be no trapping in this case. Since this option is
there for the simulation of porosimetry work, it is also not
possible to follow it with a gas flood.
Swap entry,exit face
This just means that the system
is turned around for the gas flood, so that the extrance and the
exit faces are swapped. Juggling this parameter is one way to
appreciate the significance of wend effects.
Percolation oriented study
For most network modelling studies, the simulation is stopped when
the pressure threshold required to force invading fluid out of the
exit is exceeded. However for percolation oriented studies, it is
desirable to know the fluid saturations at the various topological
criteria: breakthrough, at defender disconnected and when the
defender is completely trapped. When this is enabled, the system
will stop at the topological condition, or when the exit barrier
pressure threshold is exceeded, whichever comes first.
Grid Dimensions
The number of sites along each side of
the network and the dimensionality of the netowk can be set here.
The flooding proceeds along the longitudinal axis, labelled the x
axis. In 3D, independent control of the grid size in the two
transverse directions is not possible.
Plotting Details
the dynamics of the simulation are
plotted on a window that shows slices through the network. On these
slices, oil is shown in yellow, water in blue and gas in pink. The
underlying pore structure is shown by the shading -- dark squares
represent smaller pore bodies while light ones show larger pores.
Note that this shading scale is fixed -- the pores of radius 0 are
always the darkest and pores of radius 24 are always the lightest.
A grid with mean 3 and with 2 will look very dark, and one of mean
20 and width 3 will look uniformly very pale.
Update every n events
The plotting can seriously slow the
program down, particularly in 2D, so by setting the plotter to only
update every (say) 500 events, the code can still run at almost full
speed, and you still get to see the invasion dynamics. This also
affects the updating of the capillary pressure plot, which can have
a crippling effect in 3D.
Zoom factor
Each pore in the network is represented by a
block of pixels on the image, and the number of pixels on a side of
the block is given by the zoom factor. A 512x512 realisation with a
zoom factor of 12 will try to draw a window 5000 pixels square,
which will probably cause the program to crash. In general, smaller
zooms run faster. If zoom is zero, no plotting is performed.
No of slices
rather than trying to visualise the grid in
three dimensions, we simply take a certain number of slices. The
first and the last slice are always plotted, then the other slices
are chosen at intervals as evenly as possible.
Correlations
We allow two choices here -- the pore sizes
can be chosen at random, so that each pore radius is completely
uncorrelated from all the others, or the pore sizes can be fractally
distributed according to fractional Brownian motion, so that the
variance between pore sizes increases as a power law with the
distance between them.
Details for fBm Generator
the fractional fractional
brownian motion generator is based on the midpoint displacement
method and can be varied in several ways.
Hurst exponent
the Hurst exponent is the exponent of the
power law that determines the correlations on fBm grids.
Stretching factors
the stretching factors enable us to
incorporate a form of anisotropy into the fBm. Essentially,
stretched fBm means that the length scales are anisotropic.
fBm cutoff
Fractional brownian motion normally assumes
that the correlations are of infinite extent, i.e. that the
difference between the sampled values at two points continues to
indefinitely increase as a power law of the distance between those
points. Pure fBm therefore has no length scale. However real
materials frequently display fBm-like behaviour up to certain length
scales, but appear uncorrelated to a large scale analysis. For
cutoff fBm, the points are uncorrelated beyond the length scale
chosen. If the cutoff distance is 1, then the model is
uncorrelated.
Pore size distribution, Throat size distribution
The pore and the throat sizes are distributed according to cutoff
weibull distributions that are controlled through the parameters
available here. The maximum and the minimum values set the points
at which the distribution is cut off, while the standard deviation
sets the standard deviation that the distribution would have if it
were not cut off. Choosing tight cutoff bounds will result in a
distribution with a width much narrower than was asked for.
The mean also sets the mean that the weibull distribution would have
were it no cut off. Note that for a specified standard deviation it
is not possible to yield the full range of means without having some
negative radii. If the user asks for a mean value that cannot be
accomodated, then the system will produce a "pure" weibull
distribution. This means that the minimum value is zero (before the
effects of cutoff) and the mean will be different to what was asked
for.
The weibull B parameter controls the shape of the distribution. The
Weibull distribution is given by the derivative of the super
Gaussian exp(-x^B). The usual value chosen for this parameter is 2,
but higher values are sometimes considered.
Pore-Throat Correlations
This very important parameter
decides whether the pores and the throats are correlated to each
other or not. Espresso first chooses unscaled pore sizes, either
through the process of fBm, or by the uncorrelated generation of
Gaussian random deviates. Either way the unscaled pore radii are
normally distributed with unity variance. The unscaled radius of
a given throat is then calculated as the weighted mean of a
gaussian random deviate and the average radius of the pores that
it connects. If the pore-throat correlation is zero, then zero
weighting is given to the average pore radius, while if the
correlation is unity, then a zero weighting is given to the random
deviate. Note that this is very similar to the midpoint
displacement method for the generation of fBm.
After the pore and throat sizes have been selected with this
process, they are each scaled according to the parameter values
selected for the pore and throat distributions.
Each realisation can be used to produce lots of different output
data, most of which are useful only on rare occasions. The output
of much of this data will only slow the program down. The data
logging screen enables the user to choose exactly what information
will be logged before, during and after each realisation.
Initial system data
Pore radii to run_name_psd.xls, Throat radii to run_name_tsd.xls
After the pore and throat distributions have been calculated, they
can be printed out to a data file. The format of this file is
either unformatted binary (unix systems), or simple ascii (NT).
Note that the data contained in these files is a partial reflection
of the way that the data is stored in the program, which is that
there is a boundary layer around the grid to prevent unnecessary
testing for boundaries.
data measured during invasion
during the invasion it is possible to keep track of certain
quantities that change during the flood. It is very slow to try and
print these quantities out after every single invasion event, so it
is possible to record them only after a specified interval. update
every n events means that the data is recorded to the data
file once for every n sites. This affects the following
three quantities.
Capillary pressure to run_name_Pc.xls
Prints out
an ascii table of the capillary pressure data. For two phase flow,
there are three columns. The first lists the invader volume
saturation, the second lists the capillary pressure (in kN/m^2) and
the third gives the type of the invasion event in two letters,
e.g. WO represents a water displacing oil event. For three phase
flow there are an additional three columns, which mirror the first
three for the possible double displacement.
Accessible fraction to run_name_af.xls
Writes the
accessible fraction, which is the fraction of the remaining
defendefr-filled pores (or remaining pore volume) that are
susceptible to being displaced by the invader at the next invasion
step.
Invasion dynamics to run_name_update.xls
This
produces a file which contains a list of all the pores from which
the defender has been displaced, in the order that they were filled.
run_name_sats.xls: Log oil saturation each n
% of gas saturation
To produce 3 phase saturation curves
it is necessary to have regular updates of the saturations of each
of the phases in the network. This is output to Run1_sats.xls, that
contains a list of the saturation at each phase, at the specified
interval. if, for example, 1% is chosen, then the file will contain
a value for the oil saturation for gas saturations of 1%, 2%, 3%,
etc.
note that this feature is only useful for 3 phase floods.
Final State Data
Log only from centre portion
In order to remove the end barrier and entrance face effects it is
common in network modelling and percolation studies to measure data
only on the central 50% of the network. By this we mean that if the
network was LxWxH 40x20x20, then the data logging would only take
place over the 20x20x20 block that took the transverse slices from
x=10 to x=29. It is possible that the use of this feature breaks
some of the data logging precesses and it should be used with
caution.
Calculate various backbones for run_name_rsdls.xls
Write final cluster and backbones to run_name_clstr.xls
The transport properties on the network depend on the fractal
dimension of the various backbones of the invader cluster at
percolation and at other end points. The elastic backbone is all
the points that lie on the shortest path between the inlet and the
exit point. The backbone is all the nodes that carry flow between
the inlet and the outlet, i.e. those points that do not lie on dead
ends. The loopless backbone is a single width path from inlet to
exit that results from bond percolation when there is bond trapping,
so that the final cluster is in fact a tree structure with no loops.
The number of sites that are contained in each of these backbones
are outputted to the run_name_rsdls.xls file. the actual
form of the backbones and of the final cluster can be found in
run_name_clstr.xls, in a hybrid ascii/binary form. One
character is assigned to each site on the lattice, and all the sites
are written in a contiguous block. '0' means that the site is not
part of the invader cluster '1' means that it is part of the elastic
backbone. '2' means that it is part of the backbone but not the
elastic nor the loopless backbone, '3' means that it is part of the
cluster but not of any backbone, while '4' means that it is part of
the loopless backbone but not the elastic backbone. the idl program
readit.pro has been written to display the data in this file.
Write trapped cluster size list to run_name_csl.xls
As each portion of the defending phase is severed and trapped behind
the invading phase front, it's size, and the invading phase
saturation (expressed as a number rather than a volume fraction) are
printed out. This file is formatted with 2 columns. The first one
contains the trapped cluster size, the second the invader saturation
at the point of trapping.
Trapping
If fluid X traps fluid Y, then a node filled with fluid X presents
an impermeable blockage to the flow of fluid Y. A region of fluid Y
that has no path to the exit barrier except through pores filled
with fluid X is therefore said to be trapped. If fluid X does not
trap fluid Y, then we assume that fluid Y is wetting the pore walls
and forming a film through which it can flow, and regions of fluid Y
separated by pores filled with fluid X are still considered
connected to one another.
Stopping criteria
For percolation oriented studies the
stopping criterion can be set not only by the
exit barriers but also by topological stopping criteria.
Whether the invader be oil, water, or gas, the stopping condition
can be set to one of three conditions. invader spans
means that the flood stops as soon as the invading phase touches the
outlet face. defender disconnected means that when
there is no longer a single defender phase that connects the inlet
and the outlet, the flood stops. For exit face covered by
x% invader , the flood stops when the specified
percentage of pores on the outlet face are filled with the invading
phase. This set to 0% equates to the spanning criterion; set to
100% it means that the system does not stop until all the defender
is trapped and there are no more available sites to fill.
Exit Barriers
When a flood is performed on a core in a laboratory, some sort of
capillary barrier is placed at the outlet. This barrier is normally
water wet but may be oil or mixed wet. The size of the
constrictions in this barrier dictate at what point the invasion
will terminate, and also dictate the relative likelihood of double
displacement events for three phase flow. Essentially, espresso
uses the barrier size that is set to calculate a pressure threshold
required for the invading phase to pass through the barrier. once
the invader has spanned, and that threshold is exceeded, then the
flood terminates. Separate barriers may specified for oil, water
and gas floods, with the oil barrier also relevant during three
phase gas floods for the calculation of double displacements.
Interfacial tensions
The amount of energy stored per unit length of the interfaces
between the three fluids in the system is of critical importance for
three phase studies. This window allows each of these to be set.
Cooperative pore filling
During imbibition, the radius of the interface that must be attained
to fill a given pore changes depending on the number of the throats
that surround that pore that have already been filled with invader.
The effective radius of the pore is then said to change. we use the
following equation to calculate the effective pore size of a pore
with N neighbours and real pore radius r (in LaTeX notation )
r_eff = r_o (1 + fac* \sum_{i=1}^{n} [ ( 1 - ranfac*u_{i} ) ( rr_{i} - rr_{i-1} ) ]
here \sum refers to the standard summation of each of the terms, fac is the
I1->I5 factor, u_{i} are uniform random deviates on [0,1], ranfac is
the random reduction factor, and rr_{i} is the relative radius for an
I_{i} event.
the selection of the relative radii is an important and difficult problem.
Adrian Sheppard
Last modified: Thu Dec 3 17:56:37 EST 1998