Geosx Geosx Readthedocs Hosted Com en Latest
Geosx Geosx Readthedocs Hosted Com en Latest
GEOS/GEOSX Developers
1 Table of Contents 3
1.1 Quick Start Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Basic Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.4 Advanced Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
1.5 User Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
1.6 Developer Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
1.7 Doxygen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
1.8 Build Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
1.9 Datastructure Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
1.10 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 976
1.11 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
1.12 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
Index 989
i
ii
GEOS Documentation
GEOS is a code framework focused on enabling streamlined development of physics simulations on high performance
computing platforms. Our documentation is organized into several separate guides, given that different users will have
different needs.
We recommend all users begin with the Quick Start guide, which will walk you through downloading and compiling
the code. Application focused users may then want to explore our Tutorials, which provide an introduction to the basic
capabilities of the code. More detailed descriptions of these capabilities can then be found in the User Guide.
For those interested in developing new capabilities in GEOS, we provide a Developer Guide. The code itself is also
documented inline using doxygen. The Build Guide contains more detailed information about third-party dependencies,
the build system, and the continuous integration system. Finally, GEOS has a self-documenting data structure. The
Datastructure Index is an automatically generated list of all available input parameters and data structures in the code.
This is a comprehensive resource, but probably not the place to start.
High quality documentation is a critical component of a successful code. If you have suggestions for improving the
guides below, please post an issue on our issue tracker.
Quick Start Guide
New to GEOS? We will walk you through downloading the source, compiling the code, and testing the installation.
To the Quick Start
Tutorials
Working tutorials that show how to run some common problems. After going through these examples, you should have
a good understanding of how to set up and solve your own models.
To the Tutorials
Basic Examples
Example problems that are organized around physical processes (fluid flow, mechanics, etc.).
To the Basic Examples
Advanced Examples
Example problems that demonstrate additional physical models, constitutive models, advanced features, etc.
To the Advanced Examples
User Guide
Detailed instructions on how to construct input files, configure problems, manage outputs, etc.
To the User Guide
Python Tools
Documentation for the python packages distributed alongside GEOS used to manage xml files, condition numerical
meshes, read outputs, etc.
To the Python Tools Documentation
Feature Requests, Reporting Bugs, and Support
To make feature requests, report bugs, or get support (after reviewing the user guide) please submit an issue on Github.
To the “New issue” page on the GEOS Github repository
CONTENTS 1
GEOS Documentation
2 CONTENTS
CHAPTER
ONE
TABLE OF CONTENTS
3
GEOS Documentation
ò Note
If you are working on an HPC platform with several other GEOS users, we often compile the TPLs in a shared
location so individual users don’t have to waste their storage quota. Inquire with your institution’s point-of-contact
whether this option already exists. For all LLNL systems, the answer is yes.
Finally, there are also several private repositories only accessible to the core development team, which we use for
behind-the-scene testing and maintenance of the code.
1.1.4 Download
It is possible to directly download the source code as a zip file. We strongly suggest, however, that users don’t rely on
this option. Instead, most users should use Git to either clone or fork the repository. This makes it much easier to stay
up to date with the latest releases and bug fixes. If you are not familiar with the basics of Git, here is a helpful resource
to get you started.
The tutorial here assumes you will use a https clone with no specific credentials. Using an ssh connection pattern
requires a very slight modification. See the Additional Notes at the end of this section for details.
If you do not already have Git installed on your system, you will need to install it. We recommend using a relatively
recent version of Git, as there have been some notable improvements over the past few years. You can check if Git is
already available by opening a terminal and typing
git --version
codes/
GEOS/
thirdPartyLibs/
where the toplevel codes directory can be re-named and located wherever you like. It is possible to customize the
build system to expect a different structure, but for now let us assume you take the simplest approach.
First, using a terminal, create the codes directory wherever you like.
cd /insert/your/desired/path/
mkdir codes
cd codes
Inside this directory, we can clone the GEOS repository. We will also use some Git commands to initialize and down-
load the submodules (e.g. LvArray).
If all goes well, you should have a complete copy of the GEOS source at this point. The most common errors people
encounter here have to do with Github not recognizing their authentication settings and/or repository permissions. See
the previous section for tips on ensuring your SSH is working properly.
Note: Previous versions of GEOS also imported the integratedTests submodule, which is not publicly available (access
is limited to the core development team). This may cause the git submodule update command to fail. In that case,
run git submodule deinit integratedTests before git submodule update. This submodule is not required
for building GEOS.
cd GEOS
git submodule update --init src/cmake/blt
git submodule update --init src/coreComponents/LvArray
git submodule update --init src/coreComponents/fileIO/coupling/hdf5_interface
git submodule update --init src/coreComponents/constitutive/PVTPackage
cd ..
Once we have grabbed GEOS, we do the same for the thirdPartyLibs repository. From the codes directory, type
Again, if all goes well you should now have a copy of all necessary TPL packages.
Additional Notes:
#. git-lfs may not function properly (or may be very slow) if your version of git and git-lfs are not current. If you
are using an older version, you may need to add git lfs pull after git pull in the above procedures.
#. You can adapt the commands if you use an ssh connection instead. The clone https://github.com/GEOS-DEV/
GEOS.git becomes git clone [email protected]:GEOS-DEV/GEOS.git. You may also be willing to insert your
credentials in the command line (less secure) git clone https://${USER}:${TOKEN}@github.com/GEOS-DEV/
GEOS.git.
1.1.5 Configuration
Before proceeding, make sure to have installed all the minimal prerequisites as described in System prerequisites Note
that GEOS supports a variety of parallel computing models, depending on the hardware and software environment.
Advanced users are referred to the Build Guide for a discussion of the available configuration options.
Before beginning, it is a good idea to have a clear idea of the flavor and version of the build tools you are using. If
something goes wrong, the first thing the support team will ask you for is this information.
cpp --version
mpic++ --version
cmake --version
Here, you may need to replace cpp with the full path to the C++ compiler you would like to use, depending on how
your path and any aliases are configured.
# TPLs
set( ENABLE_TRILINOS OFF CACHE PATH "" FORCE )
set( ENABLE_CALIPER OFF CACHE PATH "" FORCE )
set( ENABLE_DOXYGEN OFF CACHE BOOL "" FORCE)
set( ENABLE_MATHPRESSO OFF CACHE BOOL "" FORCE )
endif()
include(${CMAKE_CURRENT_LIST_DIR}/tpls.cmake)
The various set() commands are used to set variables that control the build. To begin, make a copy of the template
file and modify the paths according to the installation locations on your system.
We have created a number of default host-config files for common systems. You should browse them to see if any are
close to your needs: We maintain host configuration files (ending in .cmake) for HPC systems at various institutions,
as well as for common personal systems. If you cannot find one that matches your needs, we suggest starting with one
of the shorter ones and modifying it as needed.
ò Note
If you develop a new host-config for a particular platform that may be useful for other users, please consider
sharing it with the developer team.
1.1.6 Compilation
The configuration process for both the third-party libraries (TPLs) and GEOS is managed through a Python script called
config-build.py. This script simplifies and automates the setup by configuring the build and install directories and
by running CMake based on the options set in the host-config file which is passed as a command-lne argument. The
config-build.py script has several command-line options. Here, we will only use some basic options and rely
on default values for many others. During this build process there wil be automatically generated build and install
directories for both the TPLs and the main code, with names consistent with the name specified in the host-config by
the variable CONFIG_NAME, i.e. build-your-platform-release and install-your-platform-release.
All options can be visualized by running
cd thirdPartyLibs
python scripts/config-build.py -h
ò Note
It is strongly recommended that GEOS and TPLs be configured using the same host configuration file. Below,
we assume that you keep this file in, for example, GEOS/host-configs/your-platform.cmake, but the exact
location is up to you.
ò Note
If you are working on an HPC system with other GEOS developers, check with them to see if the TPLs have already
been compiled in a shared directory. If this is the case, you can skip ahead to just compiling the main code. If you
are working on your own machine, you will need to configure and compile both the TPLs and the main code.
We begin by configuring the third-party libraries (TPLs) using the config-build.py script. This script sets up the
build directory and runs CMake to generate the necessary build files.
cd thirdPartyLibs
python scripts/config-build.py -hc ../GEOS/host-configs/your-platform.cmake -bt Release
The TPLs will be configured in a build directory named consistently with your host configuration file, i.e.,
build-your-platform-release.
cd build-your-platform-release
make
ò Note
Building all of the TPLs can take quite a while, so you may want to go get a cup of coffee at this point. Also note
that you should not use a parallel make -j N command to try and speed up the build time.
Compiling GEOS
Once the TPLs have been compiler, the next step is to compile the main code. The config-build.py script is used
to configure the build directory. Before running the configuration script, ensure that the path to the TPLs is correctly
set in the host configuration file by setting
If you have followed these instructions, the TPLs are installed at the default location, i.e. /path/to/your/TPL/
thirdPartyLibs/install-your-platform-release.
cd ../../GEOS
python scripts/config-build.py -hc host-configs/your-platform.cmake -bt Release
An alternative is to set the path GEOS_TPL_DIR via a cmake command line option, e.g.
ò Note
We highly recommend using full paths, rather than relative paths, whenever possible.
Once the configuration process is completed, we proceed with the compilation of the main code and the instalation of
geos.
cd build-your-platform-release
make -j4
make install
The parallel make -j 4 will use four processes for compilation, which can substantially speed up the build if you have
a multi-processor machine. You can adjust this value to match the number of processors available on your machine.
The make install command then installs GEOS to a default location unless otherwise specified.
If all goes well, a geosx executable should now be available
GEOS/install-your-platform-release/bin/geosx
1.1.7 Running
We can do a quick check that the geosx executable is working properly by calling the executable with our help flag
./bin/geosx --help
This should print out a brief summary of the available command line arguments:
Options:
-?, --help
-i, --input, Input xml filename (required)
-r, --restart, Target restart filename
-x, --x-partitions, Number of partitions in the x-direction
-y, --y-partitions, Number of partitions in the y-direction
(continues on next page)
Obviously this doesn’t do much interesting, but it will at least confirm that the executable runs. In typical usage, an
input XML must be provided describing the problem to be run, e.g.
./bin/geosx -i your-problem.xml
Note that we provide a series of Tutorials to walk you through the actual usage of the code, with several input examples.
Once you are comfortable the build is working properly, we suggest new users start working through these tutorials.
1.1.8 Testing
It is wise to run our unit test suite as an additional check that everything is working properly. You can run them in the
build folder you just created.
cd GEOS/build-your-platform-release
ctest -V
This will run a large suite of simple tests that check various components of the code. If you have access, you may also
consider running the integrated tests. Please refer to Integrated Tests for further information.
ò Note
If all of the unit tests fail, there is likely something wrong with your installation. Refer to the FAQs above for how
best to proceed in this situation. If only a few tests fail, it is possible that your platform configuration has exposed
some issue that our existing platform tests do not catch. If you suspect this is the case, please consider posting an
issue to our issue tracker (after first checking whether other users have encountered a similar issue).
1.2 Tutorials
The easiest way to learn to use GEOS is through worked examples. Here, we have included tutorials showing how to
run some common problems. After working through these examples, you should have a good understanding of how to
set up and solve your own models.
Note that these tutorials are intended to be followed in sequence, as each step introduces a few new skills. Most of the
tutorial models are also quite small, so that large computational resources are not required.
Objectives
At the end of this tutorial you will know:
• the basic structure of XML input files used by GEOS,
• how to run GEOS on a simple case requiring no external input files,
• the basic syntax of a solver block for single-phase problems,
• how to control output and visualize results.
Input file
GEOS runs by reading user input information from one or more XML files. For this tutorial, we only need a single
GEOS input file located at:
inputFiles/singlePhaseFlow/3D_10x10x10_compressible_smoke.xml
Running GEOS
If our XML input file is called my_input.xml, GEOS runs this file by executing:
/path/to/geosx -i /path/to/my_input.xml
The -i flag indicates the path to the XML input file. To get help on what other command line input flags GEOS
supports, run geosx --help.
Input file structure
1.2. Tutorials 11
GEOS Documentation
XML files store information in a tree-like structure using nested blocks of information called elements. In GEOS, the
root of this tree structure is the element called Problem. All elements in an XML file are defined by an opening tag
(<ElementName>) and end by a corresponding closing tag (</ElementName>). Elements can have properties defined
as attributes with key="value" pairs. A typical GEOS input file contains the following tags:
1. Solver
2. Mesh
3. Geometry
4. Events
5. NumericalMethods
6. ElementRegions
7. Constitutive
8. FieldSpecifications
9. Outputs
XML validation tools
If you have not already done so, please use or enable an XML validation tool (see User Guide/Input Files/Input
Validation). Such tools will help you identify common issues that may occur when working with XML files.
ò Note
Common errors come from the fact that XML is case-sensitive, and all opened tags must be properly closed.
Single-phase solver
GEOS is a multiphysics simulator. To find the solution to different physical problems such as diffusion or mechanical
deformation, GEOS uses one or more physics solvers. The Solvers tag is used to define and parameterize these
solvers. Different combinations of solvers can be applied in different regions of the domain at different moments of the
simulation.
In this first example, we use one type of solver in the entire domain and for the entire du-
ration of the simulation. The input file for this tutorial can be found in the repository at
inputFiles/singlePhaseFlow/3D_10x10x10_compressible_smoke.xml, which also includes input-
Files/singlePhaseFlow/3D_10x10x10_compressible_base.xml. The solver we are specifying here is a single-phase
flow solver. In GEOS, such a solver is created using a SinglePhaseFVM element. This type of solver is one among
several cell-centered single-phase finite volume methods.
The XML block used to define this single-phase finite volume solver is shown here:
<Solvers>
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ mainRegion }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="8"/>
<LinearSolverParameters
solverType="gmres"
(continues on next page)
Each type of solver has a specific set of parameters that are required and some parameters that are optional. Optional
values are usually set with sensible default values.
name
First, we register a solver of type SinglePhaseFVM with a user-chosen name, here SinglePhaseFlow. This unique
user-defined name can be almost anything. However, some symbols are known to cause issues in names : avoid
commas, slashes, curly braces. GEOS is case-sensitive: it makes a distinction between two SinglePhaseFVM solvers
called mySolver and MySolver. Giving elements a name is a common practice in GEOS: users need to give unique
identifiers to objects they define. That name is the handle to this instance of a solver class.
logLevel
Then, we set a solver-specific level of console logging (logLevel set to 1 here). Notice that the value (1) is between
double-quotes. This is a general convention for all attributes: we write key="value" regardless of the value type
(integers, strings, lists, etc.).
For logLevel, higher values lead to more console output or intermediate results saved to files. When debugging,
higher logLevel values is often convenient. In production runs, you may want to suppress most console output.
discretization
For solvers of the SinglePhaseFVM family, one required attribute is a discretization scheme. Here, we use a Two-
Point Flux Approximation (TPFA) finite volume discretization scheme called singlePhaseTPFA. To know the list of
admissible values of an attribute, please see GEOS’s XML schema. This discretization type must know how to find
permeability values that it uses internally to compute transmissibilities. The permeabilityNames attribute tells the
solver the user-defined name (the handle) of the permeability values that will be defined elsewhere in the input file.
Note that the order of attributes inside an element is not important.
fluidNames, solidNames, targetRegions
Here, we specify a collection of fluids, rocks, and target regions of the mesh on which the solver will apply. Curly
brackets are used in GEOS inputs to indicate collections of values (sets or lists). The curly brackets used here are
necessary, even if the collection contains a single value. Commas are used to separate members of a set.
Nested elements
Finally, note that other XML elements can be nested inside the Solvers element. Here, we use specific XML ele-
ments to set values for numerical tolerances. The solver stops when numerical residuals are smaller than the specified
tolerances (convergence is achieved) or when the maximum number of iterations allowed is exceeded (convergence not
achieved).
Mesh
To solve this problem, we need to define a mesh for our numerical calculations. This is the role of the Mesh element.
There are two approaches to specifying meshes in GEOS: internal or external.
• The external approach allows to import mesh files created outside GEOS, such as a corner-point grid or an
unstructured grid representing complex shapes and structures.
• The internal approach uses GEOS’s built-in capability to create simple meshes from a small number of param-
eters. It does not require any external file information. The geometric complexity of internal meshes is limited,
but many practical problems can be solved on such simple grids.
1.2. Tutorials 13
GEOS Documentation
In this tutorial, to keep things self-contained, we use the internal mesh generator. We parameterize it with the Inter-
nalMesh element.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 10 }"
yCoords="{ 0, 10 }"
zCoords="{ 0, 10 }"
nx="{ 10 }"
ny="{ 10 }"
nz="{ 10 }"
cellBlockNames="{ cellBlock }"/>
</Mesh>
name
Just like for solvers, we register the InternalMesh element using a unique name attribute. Here the InternalMesh
object is instantiated with the name mesh.
elementTypes
We specify the collection of elements types that this mesh contains. Tetrahedra, hexahedra, and wedges are examples
of element types. If a mesh contains different types of elements (a hybrid mesh), we should indicate this here by listing
all unique types of elements in curly brackets. Keeping things simple, our element collection has only one type of
element: a C3D8 type representing a hexahedral element (linear 8-node brick).
A mesh can contain several geometrical types of elements. For numerical convenience, elements are aggregated by
types into cellBlocks. Here, we only have linear 8-node brick elements, so the entire domain is one object called
cellBlock.
xCoords, yCoords, zCoords, nx, ny, nz
This specifies the spatial arrangement of the mesh elements. The mesh defined here goes from coordinate x=0 to
x=10 in the x-direction, with nx=10 subdivisions along this segment. The same is true for the y-dimension and the
z-dimension. Our mesh is a cube of 10x10x10=1,000 elements with a bounding box defined by corner coordinates
(0,0,0) and (10,10,10).
Geometry
The Geometry tag allows users to capture subregions of a mesh and assign them a unique name. Here, we name two
Box elements, one for the location of the source and one for the sink. Pressure values are assigned to these named
regions elsewhere in the input file.
The pressure source is the element in the (0,0,0) corner of the domain, and the sink is the element in the (10,10,10)
corner.
For an element to be inside a geometric region, it must have all its vertices strictly inside that region. Consequently, we
need to extend the geometry limits a small amount beyond the actual coordinates of the elements to catch all vertices.
Here, we use a safety padding of 0.01.
<Geometry>
<Box
name="source"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 1.01, 1.01, 1.01 }"/>
<Box
name="sink"
(continues on next page)
1.2. Tutorials 15
GEOS Documentation
There are several methods to achieve similar conditions (Dirichlet boundary condition on faces, etc.). The Box defined
here is one of the simplest approaches.
Events
In GEOS, we call Events anything that happens at a set time or frequency. Events are a central element for time-
stepping in GEOS, and a dedicated section just for events is necessary to give them the treatment they deserve.
For now, we focus on three simple events: the time at which we wish the simulation to end (maxTime), the times at
which we want the solver to perform updates, and the times we wish to have simulation output values reported.
In GEOS, all times are specified in seconds, so here maxTime=5000.0 means that the simulation will run from time 0
to time 5,000 seconds.
If we focus on the PeriodicEvent elements, we see :
1. A periodic solver application: this event is named solverApplications. With the attribute forceDt=20, it
tells the solver to compute results at 20-second time intervals. We know what this event does by looking at its
target attribute: here, from time 0 to maxTime and with a forced time step of 20 seconds, we instruct GEOS to
call the solver registered as SinglePhaseFlow. Note the hierarchical structure of the target formulation, using
‘/’ to indicate a specific named instance (SinglePhaseFlow) of an element (Solvers). If the solver needs to
take smaller time steps, it is allowed to do so, but it will have to compute results for every 20-second increment
between time zero and maxTime regardless of possible intermediate time steps.
2. An output event: this event is used for reporting purposes and instructs GEOS to write out results at specific
frequencies. Here, we need to see results at every 100-second increment. This event triggers a full application
of solvers, even if solvers were not summoned by the previous event. In other words, an output event will force
an application of solvers, possibly in addition to the periodic events requested directly.
<Events maxTime="5000.0">
<PeriodicEvent
name="solverApplications"
forceDt="20.0"
target="/Solvers/SinglePhaseFlow"/>
<PeriodicEvent
name="outputs"
timeFrequency="100.0"
target="/Outputs/siloOutput"/>
</Events>
Numerical methods
GEOS comes with several useful numerical methods. In the Solvers elements, for instance, we had specified to use
a two-point flux approximation as discretization scheme for the finite volume single-phase solver. Now to use this
scheme, we need to supply more details in the NumericalMethods element.
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"
/>
</FiniteVolume>
</NumericalMethods>
Note that in GEOS, there is a difference between physics solvers and numerical methods. Their parameterizations are
thus independent. We can have multiple solvers using the same numerical scheme but with different tolerances, for
instance.
The available numerical methods and their options are listed in the GEOS XML schema documentation which may be
found by using the search function in the documentation.
Regions
In GEOS, ElementsRegions are used to attach material properties to regions of elements. Here, we use only one Cel-
lElementRegion to represent the entire domain (user name: mainRegion). It contains all the blocks called cellBlock
defined in the mesh section. We specify the materials contained in that region using a materialList. Several mate-
rials coexist in cellBlock, and we list them using their user-defined names: water and rock in this exemple. Each
material is a definition of physical properties.
<ElementRegions>
<CellElementRegion
name="mainRegion"
(continues on next page)
1.2. Tutorials 17
GEOS Documentation
Constitutive models
The Constitutive element attaches physical properties to all materials contained in the domain.
The physical properties of the materials defined as water, rockPorosity, and rockPerm are provided here,
each material being derived from a different material type: CompressibleSinglePhaseFluid for the water,
PressurePorosity for the rock porosity, and ConstantPermeability for rock permeability. The list of attributes
differs between these constitutive materials.
<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.0"
compressibility="5e-10"
viscosibility="0.0"/>
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.05"
referencePressure="0.0"
compressibility="1.0e-9"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-12, 1.0e-12, 1.0e-15 }"/>
</Constitutive>
The names water, rockPorosity and rockPerm are defined by the user as handles to specific instances of physical
materials. GEOS uses S.I. units throughout, not field units. Pressures, for instance, are in Pascal, not psia. The x- and
y-permeability are set to 1.0e-12 m2 corresponding to approximately to 1 Darcy.
We have used the handles water, rockPorosity and rockPerm in the input file in the ElementRegions section of
the XML file, before the registration of these materials took place here, in Constitutive element.
ò Note
This highlights an important aspect of using XML in GEOS: the order in which objects are registered and used in
the XML file is not important.
Defining properties
In the FieldSpecifications section, properties such as source and sink pressures are set. GEOS offers a lot of
flexibility to specify field values through space and time.
Spatially, in GEOS, all field specifications are associated to a target object on which the field values are mounted. This
allows for a lot of freedom in defining fields: for instance, one can have volume property values attached to a subset of
volume elements of the mesh, or surface properties attached to faces of a subset of elements.
For each FieldSpecification, we specify a name, a fieldName (this name is used by solvers or numerical meth-
ods), an objectPath, setNames and a scale. The ObjectPath is important and it reflects the internal class hier-
archy of the code. Here, for the fieldName pressure, we assign the value defined by scale (5e6 Pascal) to one of
the ElementRegions (class) called mainRegions (instance). More specifically, we target the elementSubRegions
called cellBlock (this contains all the C3D8 elements, effectively all the domain). The setNames allows to use the
elements defined in Geometry, or use everything in the object path (using the all).
<FieldSpecifications>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/mainRegion/cellBlock"
fieldName="pressure"
scale="5e6"/>
<FieldSpecification
name="sourceTerm"
objectPath="ElementRegions/mainRegion/cellBlock"
fieldName="pressure"
scale="1e7"
setNames="{ source }"/>
<FieldSpecification
name="sinkTerm"
objectPath="ElementRegions/mainRegion/cellBlock"
fieldName="pressure"
scale="0.0"
setNames="{ sink }"/>
</FieldSpecifications>
The image below shows the pressures after the very first time step, with the domain initialized at 5 MPa, the sink at 0
MPa on the top right, and the source in the lower left corner at 10 MPa.
1.2. Tutorials 19
GEOS Documentation
Output
In order to retrieve results from a simulation, we need to instantiate one or multiple Outputs.
Here, we define a single object of type Silo. Silo is a library and a format for reading and writing a wide variety of
scientific data. Data in Silo format can be read by VisIt.
This Silo output object is called siloOutput. We had referred to this object already in the Events section: it was
the target of a periodic event named outputs. You can verify that the Events section is using this object as a target. It
does so by pointing to /Outputs/siloOutput.
<Outputs>
<Silo
name="siloOutput"/>
</Outputs>
GEOS currently supports outputs that are readable by VisIt and Kitware’s Paraview, as well as other visualization tools.
In this example, we only request a Silo format compatible with VisIt.
All elements are now in place to run GEOS.
Running GEOS
The command to run GEOS is
path/to/geosx -i path/to/this/xml_file.xml
Note that all paths for files included in the XML file are relative to this XML file.
While running GEOS, it logs status information on the console output with a verbosity that is controlled at the object
level, and that can be changed using the logLevel flag.
The first few lines appearing to the console are indicating that the XML elements are read and registered correctly:
Each time iteration at every 20s interval is logged to console, until the end of the simulation at maxTime=5000:
Cleaning up events
Umpire HOST sum across ranks: 14.8 MB
Umpire HOST rank max: 14.8 MB
total time 5.658s
initialization time 0.147s
run time 3.289s
All newton iterations are logged along with corresponding nonlinear residuals for each time iteration. In turn, for each
1.2. Tutorials 21
GEOS Documentation
newton iteration, LinSolve provides the number of linear iterations and the final residual reached by the linear solver.
Information on run times, initialization times, and maximum amounts of memory (high water mark) are given at the
end of the simulation, if successful.
Congratulations on completing this first run!
Visualization
Here, we have requested results to be written in Silo, a format compatible with VisIt. To visualize results, open VisIt
and directly load the database of simulation output files.
After a few time step, pressure between the source and sink are in equilibrium, as shown on the representation below.
To go further
Feedback on this tutorial
This concludes the single-phase internal mesh tutorial. For any feedback on this tutorial, please submit a GitHub issue
on the project’s GitHub page.
For more details
• More on single-phase flow solvers, please see Singlephase Flow Solver.
inputFiles/singlePhaseFlow/vtk/3D_10x10x10_compressible_hex_gravity_smoke.xml
The mesh file format used in this tutorial is vtk. This format is a standard scientific meshing format not specific to
GEOS. vtk is a multi-purpose mesh format (structured, unstructured, serial, parallel, multi-block. . . ) and contains a
compact and complete representation of the mesh geometry and of its properties. The mesh file used here is human-
readable ASCII, and there is a binary storage as well. It contains a list of nodes with their (x,y,z) coordinates, and a list
of elements that are constructed from these nodes.
Hexahedral elements
In the first part of the tutorial, we will run flow simulations on a mesh made of hexahedral elements. These types of
elements are used in classical cartesian grids (sugar cubes) or corner-point grids or pillar grids.
Although closely related, the hexahedral grids that GEOS can process are slightly different than either structured grid
or corner-point grids. The differences are worth pointing out here. In GEOS:
• Hexahedra can have irregular shapes: no pillars are needed and vertices can be anywhere in space. This is
useful for grids that turn, fold, or are heavily bent. Hexahedral blocks should nevertheless have 8 distinct vertices
that are not coalesced. Some tolerance exists for degeneration to wedges in some solvers (finite element solvers),
but it is best to avoid such situations and label elements according to their actual shape. Butterfly cells, flat cells,
negative or zero volume cells will cause problems.
• The mesh needs to be conformal: in 3D, this means that neighboring grid blocks have to share exactly a
complete face. Note that corner-point grids do not have this requirement and neighboring blocks can be offset.
When importing grids from commonly-used geomodeling packages, this is an important consideration. This
problem is solved by splitting shifted grid blocks to restore conformity. While it may seem convenient to be able
to have offset grid blocks at first, the advantages of conformal grids used in GEOS are worth the extra meshing
1.2. Tutorials 23
GEOS Documentation
effort: by using conformal grids, GEOS can run finite element and finite volume simulations on the same mesh
without problems, going seamlessly from one numerical method to the other. This is key to enabling multiphysics
simulation.
• There is no assumption of overall structure: GEOS does not need to know a number of block in the X, Y,
Z direction (no NX, NY, NZ) and does not assume that the mesh is a full cartesian domain that the interesting
parts of the reservoir must be carved out from. Blocks are numbered by indices that assume nothing about spatial
positioning and there is no concept of (i,j,k). This approach also implies that no “masks” are needed to remove
inactive or dead cells, as often done in cartesian grids to get the actual reservoir contours from a bounding box,
and here we only need to specify grid blocks that are active. For performance and flexibility, this lean approach
to meshes is important.
In this first part of the tutorial, we use an hexahedral mesh provided to GEOS. This hexahedral mesh is strictly identical
to the grid used in the first tutorial (Tutorial 1: First Steps), but instead of using the internal grid generator GEOS, we
specify it with spatial node coordinates in vtk format. To import external grid into GEOS, we did develop a component
directly using the vtk library.
So here, our mesh consists of a simple sugar-cube stack of size 10x10x10. We inject fluid from one vertical face of a
cube (the face corresponding to x=0), and we let the pressure equilibrate in the closed domain. The displacement is
a single-phase, compressible fluid subject to gravity forces, so we expect the pressure to be constant on the injection
face, and to be close to hydrostatic on the opposite plane (x=10). We use GEOS to compute the pressure inside each
grid block over a period of time of 100 seconds.
To see how to import such a mesh, we inspect the following XML file:
inputFiles/singlePhaseFlow/vtk/3D_10x10x10_compressible_hex_gravity_smoke.xml
In the XML Mesh tag, instead of an InternalMesh tag, we have a VTKMesh tag. We see that a file called
cube_10x10x10_hex.vtk is imported using vtk, and this object is instantiated with a user-defined name value. The
file here contains geometric information in vtk format (it can also contain properties, as we will see in the next tutorial).
<Mesh>
<VTKMesh
name="CubeHex"
file="cube_10x10x10_hex.vtk"/>
</Mesh>
GEOS can run different physical solvers on different regions of the mesh at different times. Here, to keep things simple,
we run one solver (single-phase flow) on the entire domain throughout the simulation. To do so, we need to define a
region encompassing the entire domain. We will name it Domain, as refered to in the single-phase flow solver (in its
targetRegions), and list its constitutive models in the materialList, which are water and rock. Since we have
imported a mesh with only one region, we can set cellBlocks to { * } (we have could also set cellBlocks to {
hexahedra } as the mesh has only hexahedral cells).
<ElementRegions>
<CellElementRegion
name="Domain"
cellBlocks="{ hexahedra }"
materialList="{ water, rock }"/>
</ElementRegions>
ò Note
If you use a name that is not hexahedra or all for this attribute, or if the mesh is changed and have not-hexahedral
cells, GEOS will throw an error at the beginning of the simulation. See Meshes for more information.
Running GEOS
Note that all paths for files included in the XML file are relative to this XML file, not to the GEOS executable. When
running GEOS, console messages will provide indications regarding the status of the simulation.
In our case, the first lines are:
Adding Mesh: VTKMesh, CubeHex
Adding Event: PeriodicEvent, solverApplications
Adding Event: PeriodicEvent, outputs
Adding Event: PeriodicEvent, restarts
(continues on next page)
1.2. Tutorials 25
GEOS Documentation
This indicates initialization of GEOS. The mesh preprocessing tool VTKMesh is launched next, with console messages
as follows.
Notice the specification of the number of nodes (1331), and hexahedra (1000). After the adjacency calculations, GEOS
starts the simulation itself. with the time-step increments specified in the XML file.
At the end of your simulation, you should see something like:
Once this is done, GEOS is finished and we can inspect the outcome.
All results are written in a format compatible with VisIt. To load the results, point VisIt to the database file written
in the Silo output folder.
We see that the face x=0 shown here in the back of the illustration applies a constant pressure boundary condition (col-
ored in red), whereas the face across from it displays a pressure field under gravity effect, equilibrated and hydrostatic.
These results are consistent with what we expect.
Let us now see if a tetrahedral mesh, under the same exact physical conditions, can reproduce these results.
inputFiles/singlePhaseFlow/vtk/3D_10x10x10_compressible_tetra_gravity_smoke.xml
The only difference, is that now, the Mesh tag points GEOS to a different mesh file called cube_10x10x10_tet.vtk.
This file contains nodes and tetrahedral elements in vtk format, representing a different discretization of the exact same
10x10x10 cubic domain.
<Mesh>
<VTKMesh
(continues on next page)
1.2. Tutorials 27
GEOS Documentation
And the vtk file starts as follows (notice the tetrahedral point coordinates as real numbers):
Again, the entire field is one region called Domain which contains water and rock. Since we have imported a mesh
with only one region, we can again set cellBlocks to { * } (we have could also set cellBlocks to { tetrahedra
} as the mesh has only tetrahedric cells).
<ElementRegions>
<CellElementRegion
name="Domain"
cellBlocks="{ tetrahedra }"
materialList="{ water, rock }"/>
</ElementRegions>
Running GEOS
path/to/geosx -i ../../../../../inputFiles/singlePhaseFlow/vtk/3D_10x10x10_compressible_
˓→tetra_gravity_smoke.xml
Again, all paths for files included in the XML file are relative to this XML file, not to the GEOS executable. When
running GEOS, console messages will provide indications regarding the status of the simulation. In our case, the first
lines are:
Followed by:
We see that we have now 366 nodes and 1153 tetrahedral elements. And finally, when the simulation is successfully
done we see:
1.2. Tutorials 29
GEOS Documentation
All results are written in a format compatible with VisIt by default. If we load into VisIt the .database file found in the
Silo folder, we observe the following results:
Here, we can see that despite the different mesh sizes and shapes, we are able to recover our pressure profile without
any problems, or degradation in runtime performance.
To go further
Feedback on this tutorial
This concludes the single-phase external mesh tutorial. For any feedback on this tutorial, please submit a GitHub issue
on the project’s GitHub page.
For more details
• A complete description of the Internal Mesh generator is found here Meshes.
• vtk is extensively documented. You can start browsing here.
• GEOS can handle tetrahedra, hexahedra, pyramids, wedges, prisms, and any combination thereof in one mesh.
inputFiles/singlePhaseFlow/FieldCaseTutorial3_base.xml
inputFiles/singlePhaseFlow/FieldCaseTutorial3_smoke.xml
We consider the following mesh as a numerical support to the simulations in this tutorial:
1.2. Tutorials 31
GEOS Documentation
The mesh is defined using the VTK file format (see Meshes for more information on the supported mesh file format).
Each tetrahedron is associated to a unique tag.
The XML file considered here follows the typical structure of the GEOS input files:
1. Solver
2. Mesh
3. Geometry
4. Events
5. NumericalMethods
6. ElementRegions
7. Constitutive
8. FieldSpecifications
9. Outputs
10. Functions
Single-phase solver
Let us inspect the Solver XML tags.
<Solvers>
<SinglePhaseFVM
name="SinglePhaseFlow"
discretization="singlePhaseTPFA"
targetRegions="{ Reservoir }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="8"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="amg"
amgSmootherType="l1jacobi"
krylovTol="1.0e-10"/>
</SinglePhaseFVM>
</Solvers>
This node gathers all the information previously defined. We use a classical SinglePhaseFVM Finite Volume Method,
with the two-point flux approximation as will be defined in the NumericalMethods tag. The targetRegions refers
only to the Reservoir region because we only solve for flow in this region.
The NonlinearSolverParameters and LinearSolverParameters are used to set usual numerical solver parame-
ters such as the linear and nonlinear tolerances, the preconditioner and solver types or the maximum number of nonlinear
iterations.
Mesh
Here, we use the VTKMesh to load the mesh (see Importing the Mesh). The syntax to import external meshes is simple
: in the XML file, the mesh file is included with its relative or absolute path to the location of the GEOS XML file
and a user-specified name label for the mesh object.
<Mesh>
<VTKMesh name="SyntheticMesh"
file="synthetic.vtu" />
</Mesh>
1.2. Tutorials 33
GEOS Documentation
Geometry
Here, we are using definition of source and sink boxes in addition to the all box in order to flag sets of
nodes or cells which will act as injection or production.
<Geometry>
<Box
name="all"
xMin="{ -1e9, -1e9, -1e9 }"
xMax="{ 1e9, 1e9, 1e9 }"/>
<Box
name="source"
xMin="{ 15500, 7000, -5000 }"
xMax="{ 16000, 7500, 0 }"/>
<Box
name="sink"
xMin="{ 6500, 1500, -5000 }"
xMax="{ 7000, 2000, 0 }"/>
</Geometry>
In order to define a box, the user defines xMax and xMin, two diagonally opposite nodes of the box.
Events
The events are used here to guide the simulation through time, and specify when outputs must be triggered.
<Events maxTime="100.0e6">
<PeriodicEvent name="solverApplications"
forceDt="10.0e6"
target="/Solvers/SinglePhaseFlow" />
The Events tag is associated with the maxTime keyword defining the maximum time. If this time is ever reached or
exceeded, the simulation ends.
Two PeriodicEvent are defined. - The first one, solverApplications, is associated with the solver. The forceDt
keyword means that there will always be time-steps of 10e6 seconds. - The second, outputs, is associated with the
output. The timeFrequency keyword means that it will be executed every 10e6 seconds.
Numerical methods
Defining the numerical method used in the solver, we will provide information on how to discretize our equations. Here
a classical two-point flux approximation (TPFA) scheme is used to discretize water fluxes over faces.
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"
/>
</FiniteVolume>
</NumericalMethods>
Regions
Assuming that the overburden and the underburden are impermeable, and flow only takes place in the reservoir, we
need to define regions.
We need to define all the CellElementRegions according to the attribute values of the VTK file (which are
respectively 1, 2 and 3 for each region). As mentioned above, the solvers is only applied on the reservoir layer, (on
region 2). In this case, the ElementRegions tag is :
<ElementRegions>
<CellElementRegion
name="Reservoir"
cellBlocks="{ 2 }"
materialList="{ water, rock }"/>
<CellElementRegion
name="Burden"
cellBlocks="{ 1, 3 }"
materialList="{ water, rock }"/>
</ElementRegions>
ò Note
This material list here is subject to change if the problem is not a single-phase flow problem.
1.2. Tutorials 35
GEOS Documentation
Constitutive models
We simulate a single-phase flow in the reservoir layer, hence with multiple types of materials, a fluid (water) and solid
(rock permeability and porosity).
<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.0"
compressibility="1e-9"
viscosibility="0.0"/>
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.05"
referencePressure="10e7"
compressibility="1.0e-9"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-13, 1.0e-13, 1.0e-16 }"/>
</Constitutive>
The constitutive parameters such as the density, the viscosity, and the compressibility are specified in the International
System of Units.
ò Note
ò Note
Currently GEOS handles permeability as a diagonal matrix, so the three values of the permeability tensor are set
individually using the component field. The ability for a full tensor permeability is planned for future releases.
Defining properties
The next step is to specify fields, including:
• The initial value (here, the pressure has to be initialized)
• The static properties (here, we have to define the permeability tensor and the porosity)
• The boundary conditions (here, the injection and production pressure have to be set)
<FieldSpecifications>
<FieldSpecification
name="permx"
initialCondition="1"
component="0"
setNames="{ all }"
objectPath="ElementRegions/Reservoir"
fieldName="rockPerm_permeability"
scale="1e-15"
functionName="permxFunc"/>
<FieldSpecification
name="permy"
initialCondition="1"
component="1"
setNames="{ all }"
objectPath="ElementRegions/Reservoir"
fieldName="rockPerm_permeability"
scale="1e-15"
functionName="permyFunc"/>
<FieldSpecification
name="permz"
initialCondition="1"
component="2"
setNames="{ all }"
objectPath="ElementRegions/Reservoir"
fieldName="rockPerm_permeability"
scale="3e-15"
functionName="permzFunc"/>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Reservoir/2_tetrahedra"
fieldName="pressure"
scale="1e7"
/>
<FieldSpecification
name="sourceTerm"
objectPath="ElementRegions/Reservoir/2_tetrahedra"
fieldName="pressure"
scale="15e7"
setNames="{ source }"
/>
<FieldSpecification
name="sinkTerm"
(continues on next page)
1.2. Tutorials 37
GEOS Documentation
Output
The Outputs XML tag is used to trigger the writing of visualization files. Here, we write files in a format natively
readable by Paraview under the tag VTK:
<Outputs>
<VTK
name="reservoir_with_properties"/>
</Outputs>
ò Note
<Functions>
<TableFunction
name="timeInj"
inputVarNames="{ time }"
coordinates="{ 1e6, 10e6, 50e6 }"
values="{ 1, 0.01, 0.00001 }"/>
<TableFunction
name="initialPressureFunc"
inputVarNames="{ elementCenter }"
coordinateFiles="{ tables_FieldCaseTuto/xlin.geos, tables_FieldCaseTuto/ylin.geos,␣
˓→tables_FieldCaseTuto/zlin.geos }"
voxelFile="tables_FieldCaseTuto/pressure.geos"/>
<TableFunction
name="permxFunc"
inputVarNames="{ elementCenter }"
(continues on next page)
voxelFile="tables_FieldCaseTuto/permx.geos"
interpolation="nearest"/>
<TableFunction
name="permyFunc"
inputVarNames="{ elementCenter }"
coordinateFiles="{ tables_FieldCaseTuto/xlin.geos, tables_FieldCaseTuto/ylin.geos,␣
˓→tables_FieldCaseTuto/zlin.geos }"
voxelFile="tables_FieldCaseTuto/permy.geos"
interpolation="nearest"/>
<TableFunction
name="permzFunc"
inputVarNames="{ elementCenter }"
coordinateFiles="{ tables_FieldCaseTuto/xlin.geos, tables_FieldCaseTuto/ylin.geos,␣
˓→tables_FieldCaseTuto/zlin.geos }"
voxelFile="tables_FieldCaseTuto/permz.geos"
interpolation="nearest"/>
</Functions>
Here, the injection pressure is set to vary with time. Attentive reader might have noticed that sourceTerm was bound
to a TableFunction named timeInj under FieldSpecifications tag definition. The initial pressure is set based on the
values contained in the table formed by the files which are specified. In particular, the files xlin.geos, ylin.geos and
zlin.geos define a regular meshing of the bounding box containing the reservoir. The pressure.geos file then defines the
values of the pressure at those points.
We proceed in a similar manner as for pressure.geos to map a heterogeneous permeability field (here the 5th layer of
the SPE 10 test case) onto our unstructured grid. This mapping will use a nearest point interpolation rule.
1.2. Tutorials 39
GEOS Documentation
ò Note
The varying values imposed in values or passed through voxelFile are premultiplied by the scale attribute from
FieldSpecifications.
Running GEOS
The simulation can be launched with:
geosx -i FieldCaseTutorial3_smoke.xml
One can notice the correct load of the field function among the starting output messages
Visualization of results
We can open the file syntheticReservoirVizFile.pvd with Paraview to visualize the simulation results. In the event block,
we have asked for the output to be generated at regular intervals throughout the simulation, we can thus visualize the
pressure distribution at different simulation times, showing the variation in the injection control.
To go further
Feedback on this tutorial
This concludes this tutorial. For any feedback, please submit a GitHub issue on the project’s GitHub page.
For more details
• More on meshes, please see Meshes.
• More on events, please see Event Management.
1.2. Tutorials 41
GEOS Documentation
inputFiles/solidMechanics/beamBending_base.xml
inputFiles/solidMechanics/beamBending_benchmark.xml
This mesh contains 80 x 8 x 4 eight-node brick elements in the x, y and z directions, respectively. Here, the
InternalMesh is used to generate a structured three-dimensional mesh with C3D8 as the elementTypes. This mesh
is defined as a cell block with the name cb1.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 80 }"
yCoords="{ 0, 8 }"
zCoords="{ 0, 4 }"
nx="{ 160 }"
ny="{ 16 }"
nz="{ 8 }"
(continues on next page)
Gravity
The gravity is turned off explicitly at the beginning of the input file:
<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Region2 }"
logLevel="1">
<NumericalMethods>
<FiniteElements>
<FiniteElementSpace
name="FE1"
order="1"/>
</FiniteElements>
</NumericalMethods>
Constitutive model
Recall that in the SolidMechanicsLagrangianSSLE block, shale is designated as the material in the computational
domain. Here, the material is defined as linear isotropic.
<ElasticIsotropic
name="shale"
defaultDensity="2700"
defaultBulkModulus="5.5556e9"
defaultShearModulus="4.16667e9"/>
1.2. Tutorials 43
GEOS Documentation
Boundary conditions
As aforementioned, the beam is fixed on one end, and subjects to surface traction on the other end. These bound-
ary conditions are set up through the FieldSpecifications block. Here, nodeManager and faceManager in the
objectPath indicate that the boundary conditions are applied to the element nodes and faces, respectively. Compo-
nent 0, 1, and 2 refer to the x, y, and z direction, respectively. And the non-zero values given by Scale indicate the
magnitude of the loading. Some shorthands, such as xneg and xpos, are used as the locations where the boundary
conditions are applied in the computational domain. For instance, xneg means the portion of the computational do-
main located at the left-most in the x-axis, while xpos refers to the portion located at the right-most area in the x-axis.
Similar shorthands include ypos, yneg, zpos, and zneg. Particularly, the time-dependent loading applied at the beam
tip is defined through a function with the name timeFunction.
<FieldSpecifications>
<FieldSpecification
name="xnegconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ xneg }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<Traction
name="xposconstraint"
objectPath="faceManager"
scale="1.0e6"
direction="{ 0, 1, 0 }"
functionName="timeFunction"
setNames="{ xpos }"/>
</FieldSpecifications>
Table function
A table function is used to define the time-dependent loading at the beam tip. The coordinates and values form
a time-magnitude pair for the loading time history. In this case, the loading magnitude increases linearly as the time
evolves.
<Functions>
<TableFunction
(continues on next page)
Execution
Finally, the execution of the simulation is set up in the Events block, where target points to the solid mechanics
solver defined in the Solvers block, and the time increment forceDt is set as 1.0s.
<PeriodicEvent
name="solverApplications"
forceDt="1.0"
target="/Solvers/lagsolve"/>
Result
The deformed beam is shown as following (notice that the displacement is visually magnified):
To go further
Feedback on this tutorial
This concludes the solid mechanics for small-strain linear elasticity tutorial. For any feedback on this tutorial, please
submit a GitHub issue on the project’s GitHub page.
For more details
• More on meshes, please see Meshes.
• More on events, please see Event Management.
1.2. Tutorials 45
GEOS Documentation
inputFiles/compositionalMultiphaseFlow/benchmarks/SPE10/deadOilSpe10Layers84_85_base_
˓→iterative.xml
The XML file considered here follows the typical structure of the GEOS input files:
1. Solver
2. Mesh
3. Geometry
4. Events
5. NumericalMethods
6. ElementRegions
7. Constitutive
8. FieldSpecifications
9. Outputs
type of preconditioner, if any. For large multiphase flow problems, we recommend using an iterative linear solver
(solverType="gmres" or solverType="fgmres") combined with the multigrid reduction (MGR) preconditioner
(preconditionerType="mgr"). More information about the MGR preconditioner can be found in Linear Solvers.
ò Note
For non-trivial simulations, we recommend setting the initialDt attribute to a small value (relative to the time
scale of the problem) in seconds. If the simulation appears to be slow, use logLevel="1" in Compositional-
MultiphaseFVM to detect potential Newton convergence problems. If the Newton solver struggles, please set
lineSearchAction="Attempt" in NonlinearSolverParameters. If the Newton convergence is good, please add
logLevel="1" in the LinearSolverParameters block to detect linear solver problems, especially if an iterative
linear solver is used.
ò Note
To use the linear solver options of this example, you need to ensure that GEOS is configured to use the Hypre linear
solver package.
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
discretization="fluidTPFA"
targetRegions="{ reservoir }"
temperature="300"
useMass="1"
initialDt="1e3"
maxCompFractionChange="0.1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="40"
maxTimeStepCuts="10"
lineSearchAction="None"/>
<LinearSolverParameters
solverType="fgmres"
preconditionerType="mgr"
krylovTol="1.0e-5"/>
</CompositionalMultiphaseFVM>
</Solvers>
Mesh
In this simulation, we define a simple mesh generated internally using the InternalMesh generator, as illustrated in
the first tutorial (Tutorial 1: First Steps). The mesh dimensions and cell sizes are chosen to be those specified in the
SPE10 test case, but are limited to the two bottom layers. The mesh description must be done in meters.
<Mesh>
<InternalMesh
name="mesh"
(continues on next page)
Geometry
As in the previous examples, the Geometry XML block is used to select the cells in which the boundary conditions
are applied. To mimic the setup of the original SPE10 test case, we place a source term in the middle of the domain,
and a sink term in each corner. The specification of the boundary conditions applied to the selected mesh cells is done
in the FieldSpecifications block of the XML file using the names of the boxes defined here.
<Geometry>
<Box
name="source"
xMin="{ 182.85, 335.25, -0.01 }"
xMax="{ 189.00, 338.35, 2.00 }"/>
<Box
name="sink1"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 6.126, 3.078, 2.00 }"/>
<Box
name="sink2"
xMin="{ -0.01, 667.482, -0.01 }"
xMax="{ 6.126, 670.60, 2.00 }"/>
<Box
name="sink3"
xMin="{ 359.634, -0.01, -0.01 }"
xMax="{ 365.8, 3.048, 2.00 }"/>
<Box
name="sink4"
xMin="{ 359.634, 667.482, -0.01 }"
xMax="{ 365.8, 670.60, 2.00 }"/>
</Geometry>
Events
In the Events XML block of this example, we specify two types of PeriodicEvents serving different purposes, namely
solver application and result output.
The periodic event named solverApplications triggers the application of the solver on its target region. This event
must point to the solver by name. In this example, the name of the solver is compflow and was defined in the Solvers
block. The time step is initialized using the initialDt attribute of the flow solver. Then, if the solver converges in
less than a certain number of nonlinear iterations (by default, 40% of the maximum number of nonlinear iterations),
the time step will be increased until it reaches the maximum time step size specified with maxEventDt. If the time step
fails, the time step will be cut. The parameters defining the time stepping strategy can be finely tuned by the user in the
<Events
maxTime="2e6">
<PeriodicEvent
name="outputs"
timeFrequency="5e5"
targetExactTimestep="1"
target="/Outputs/vtkOutput"/>
<PeriodicEvent
name="solverApplications"
maxEventDt="5e5"
target="/Solvers/compflow"/>
<PeriodicEvent
name="restarts"
timeFrequency="1e6"
targetExactTimestep="0"
target="/Outputs/restartOutput"/>
</Events>
Numerical methods
In the NumericalMethods XML block, we select a two-point flux approximation (TPFA) finite-volume scheme to
discretize the governing equations on the reservoir mesh. TPFA is currently the only numerical scheme that can be
used with a flow solver of type CompositionalMultiphaseFVM.
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA"/>
</FiniteVolume>
</NumericalMethods>
Reservoir region
In the ElementRegions XML block, we define a CellElementRegion named reservoir corresponding to the reser-
voir mesh. cellBlocks is set to { * } to automatically target every cells of the mesh.
The CellElementRegion must also point to the constitutive models that are used to update the dynamic rock and fluid
properties in the cells of the reservoir mesh. The names fluid, rock, and relperm used for this in the materialList
correspond to the Constitutive blocks with the coresponding names.
<ElementRegions>
<CellElementRegion
name="reservoir"
cellBlocks="{ * }"
materialList="{ fluid, rock, relperm }"/>
</ElementRegions>
Constitutive models
For a simulation performed with the CompositionalMultiphaseFVM physics solver, at least four types of constitutive
models must be specified in the Constitutive XML block:
• a fluid model describing the thermodynamics behavior of the fluid mixture,
• a relative permeability model,
• a rock permeability model,
• a rock porosity model.
All these models use SI units exclusively. A capillary pressure model can also be specified in this block but is omitted
here for simplicity.
Here, we introduce a fluid model describing a simplified mixture thermodynamic behavior. Specifically, we use an
immiscible two-phase (Dead Oil) model by placing the XML tag DeadOilFluid. Other fluid models can be used with
the CompositionalMultiphaseFVM solver, as explained in Fluid Models.
With the tag BrooksCoreyRelativePermeability, we define a relative permeability model. A list of available relative
permeability models can be found at Relative Permeability Models.
The properties are chosen to match those of the original SPE10 test case.
ò Note
The names and order of the phases listed for the attribute phaseNames must be identical in the fluid model (here,
DeadOilFluid) and the relative permeability model (here, BrooksCoreyRelativePermeability). Otherwise, GEOS
will throw an error and terminate.
We also introduce models to define rock compressibility and permeability. This step is similar to what is described in
the previous examples (see for instance Tutorial 1: First Steps).
We remind the reader that the attribute name of the constitutive models defined here must be used in the ElementRe-
gions and Solvers XML blocks to point the element regions and the physics solvers to their respective constitutive
models.
<Constitutive>
<DeadOilFluid
name="fluid"
phaseNames="{ oil, water }"
surfaceDensities="{ 800.0, 1022.0 }"
componentMolarWeight="{ 114e-3, 18e-3 }"
hydrocarbonFormationVolFactorTableNames="{ B_o_table }"
hydrocarbonViscosityTableNames="{ visc_o_table }"
waterReferencePressure="30600000.1"
waterFormationVolumeFactor="1.03"
(continues on next page)
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.1"
referencePressure="1.0e7"
compressibility="1e-10"/>
<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ oil, water }"
phaseMinVolumeFraction="{ 0.0, 0.0 }"
phaseRelPermExponent="{ 2.0, 2.0 }"
phaseRelPermMaxValue="{ 1.0, 1.0 }"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-14, 1.0e-14, 1.0e-18 }"/>
</Constitutive>
<FieldSpecifications>
<FieldSpecification
name="permx"
(continues on next page)
<FieldSpecification
name="referencePorosity"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="rockPorosity_referencePorosity"
functionName="poroFunc"
scale="1.0"/>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="pressure"
scale="4.1369e+7"/>
<FieldSpecification
name="initialComposition_oil"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/block"
fieldName="globalCompFraction"
component="0"
scale="0.9995"/>
<FieldSpecification
name="initialComposition_water"
(continues on next page)
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/reservoir/block"
scale="-0.07279"
component="1"
setNames="{ source }"/>
<FieldSpecification
name="sinkPressure"
setNames="{ sink1, sink2, sink3, sink4 }"
objectPath="ElementRegions/reservoir/block"
fieldName="pressure"
scale="2.7579e+7"/>
<FieldSpecification
name="sinkComposition_oil"
setNames="{ sink1, sink2, sink3, sink4 }"
objectPath="ElementRegions/reservoir/block"
fieldName="globalCompFraction"
component="0"
scale="0.9995"/>
<FieldSpecification
name="sinkComposition_water"
setNames="{ sink1, sink2, sink3, sink4 }"
objectPath="ElementRegions/reservoir/block"
fieldName="globalCompFraction"
component="1"
scale="0.0005"/>
</FieldSpecifications>
Output
In this section, we request an output of the results in VTK format. Note that the name defined here must match the
names used in the Events XML block to define the output frequency.
<Outputs>
<VTK
name="vtkOutput"/>
<Restart
name="restartOutput"/>
</Outputs>
Running GEOS
The first few lines appearing to the console are indicating that the XML elements are read and registered correctly:
At this point, we are done with the case set-up and the code steps into the execution of the simulation itself:
Attempt: 0, NewtonIter: 0
( Rfluid ) = (2.28e+00) ; ( R ) = ( 2.28e+00 ) ;
Attempt: 0, NewtonIter: 1
( Rfluid ) = (8.83e-03) ; ( R ) = ( 8.83e-03 ) ;
Last LinSolve(iter,res) = ( 2, 2.74e-03 ) ;
Attempt: 0, NewtonIter: 2
( Rfluid ) = (8.86e-05) ; ( R ) = ( 8.86e-05 ) ;
Last LinSolve(iter,res) = ( 2, 8.92e-03 ) ;
Visualization
A file compatible with Paraview is produced in this example. It is found in the output folder, and usually has the
extension .pvd. More details about this file format can be found here. We can load this file into Paraview directly and
visualize results:
To go further
Feedback on this example
This concludes the example on setting up an immiscible two-phase flow simulation in a channelized permeability field.
For any feedback on this example, please submit a GitHub issue on the project’s GitHub page.
For more details
• A complete description of the reservoir flow solver is found here: Compositional Multiphase Flow Solver.
• The available constitutive models are listed at Constitutive Models.
../../../../../inputFiles/compositionalMultiphaseWell/benchmarks/Egg/deadOilEgg_
˓→benchmark.xml
The mesh file corresponding to the Egg model is stored in the GEOSDATA repository. Therefore, you must first
download the GEOSDATA repository in the same folder as the GEOS repository to run this test case.
ò Note
GEOSDATA is a separate repository in which we store large mesh files in order to keep the main GEOS repository
lightweight.
The XML file considered here follows the typical structure of the GEOS input files:
1. Solver
2. Mesh
3. Events
4. NumericalMethods
5. ElementRegions
6. Constitutive
7. FieldSpecifications
8. Outputs
9. Tasks
ò Note
It is worth repeating the logLevel="1" parameter at the level of the well solver to make sure that a notification is
issued when the well control is switched (from rate control to BHP control, for instance).
Here, we instruct GEOS to perform at most newtonMaxIter = "10" Newton iterations. GEOS will adjust the time
step size as follows:
• if the Newton solver converges in timeStepIncreaseIterLimit x newtonMaxIter = 5 iterations or fewer,
GEOS will double the time step size for the next time step,
• if the Newton solver converges in timeStepDecreaseIterLimit x newtonMaxIter = 8 iterations or more,
GEOS will reduce the time step size for the next time step by a factor timestepCutFactor = 0.1,
• if the Newton solver fails to converge in newtonMaxIter = 10, GEOS will cut the time step size by a factor
timestepCutFactor = 0.1 and restart from the previous converged time step.
The maximum number of time step cuts is specified by the attribute maxTimeStepCuts. Note that a backtracking line
search can be activated by setting the attribute lineSearchAction to Attempt or Require. If lineSearchAction
= "Attempt", we accept the nonlinear iteration even if the line search does not reduce the residual norm. If
lineSearchAction = "Require", we cut the time step if the line search does not reduce the residual norm.
ò Note
To use the linear solver options of this example, you need to ensure that GEOS is configured to use the Hypre linear
solver package.
<Solvers>
<CompositionalMultiphaseReservoir
name="coupledFlowAndWells"
flowSolverName="compositionalMultiphaseFlow"
wellSolverName="compositionalMultiphaseWell"
logLevel="1"
initialDt="1e4"
targetRegions="{ reservoir, wellRegion1, wellRegion2, wellRegion3, wellRegion4,␣
˓→wellRegion5, wellRegion6, wellRegion7, wellRegion8, wellRegion9, wellRegion10,␣
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="25"
timeStepDecreaseIterLimit="0.9"
timeStepIncreaseIterLimit="0.6"
timeStepCutFactor="0.1"
maxTimeStepCuts="10"
lineSearchAction="None"/>
<LinearSolverParameters
solverType="fgmres"
preconditionerType="mgr"
krylovTol="1e-4"
krylovAdaptiveTol="1"
krylovWeakestTol="1e-2"
logLevel="1"/>
</CompositionalMultiphaseReservoir>
<CompositionalMultiphaseFVM
name="compositionalMultiphaseFlow"
targetRegions="{ reservoir }"
discretization="fluidTPFA"
temperature="297.15"
maxCompFractionChange="0.3"
logLevel="1"
useMass="1"/>
<CompositionalMultiphaseWell
name="compositionalMultiphaseWell"
targetRegions="{ wellRegion1, wellRegion2, wellRegion3, wellRegion4, wellRegion5,␣
˓→wellRegion6, wellRegion7, wellRegion8, wellRegion9, wellRegion10, wellRegion11,␣
˓→wellRegion12 }"
maxCompFractionChange="0.5"
logLevel="1"
useMass="1">
<WellControls
name="wellControls1"
type="producer"
control="BHP"
referenceElevation="28"
(continues on next page)
<Mesh>
<VTKMesh
name="mesh"
file="../../../../../GEOSDATA/DataSets/Egg/egg.vtu"
fieldsToImport="{ PERM }"
fieldNamesInGEOS="{ rockPerm_permeability }">
<InternalWell
name="wellProducer1"
wellRegionName="wellRegion1"
(continues on next page)
<InternalWell
name="wellProducer2"
wellRegionName="wellRegion2"
wellControlsName="wellControls2"
polylineNodeCoords="{ { 276, 316, 28 },
{ 276, 316, 0 } }"
polylineSegmentConn="{ { 0, 1 } }"
radius="0.1"
numElementsPerSegment="7">
<Perforation
name="producer2_perf1"
distanceFromHead="2"/>
<Perforation
name="producer2_perf2"
distanceFromHead="6"/>
<Perforation
name="producer2_perf3"
distanceFromHead="10"/>
<Perforation
name="producer2_perf4"
distanceFromHead="14"/>
<Perforation
name="producer2_perf5"
(continues on next page)
InternalWell sub-blocks
Each well is defined internally (i.e., not imported from a file) in a separate InternalWell XML sub-block. An Inter-
nalWell sub-block must point to the region corresponding to this well using the attribute wellRegionName, and to the
control of this well using the attribute wellControl.
Each well is defined using a vertical polyline going through the seven layers of the mesh with a perforation in each
layer. The well placement implemented here follows the pattern of the original test case. The well geometry must be
specified in meters.
The location of the perforations is found internally using the linear distance along the wellbore from the top of the
well specified by the attribute distanceFromHead. It is the responsibility of the user to make sure that there is a
perforation in the bottom cell of the well mesh otherwise an error will be thrown and the simulation will terminate. For
each perforation, the well transmissibility factors employed to compute the perforation rates are calculated internally
using the Peaceman formulation.
VTKWell sub-blocks
Each well is loaded from a file in a separate VTKWell XML sub-block. A VTKWell sub-block must point to the
region corresponding to this well using the attribute wellRegionName, and to the control of this well using the attribute
wellControl.
Each well is defined using a vertical VTK polyline going through the seven layers of the mesh with a perforation in
each layer. The well placement implemented here follows the pattern of the original test case. The well geometry must
be specified in meters.
The location of perforations is found internally using the linear distance along the wellbore from the top of the well
specified by the attribute distanceFromHead. It is the responsibility of the user to make sure that there is a perforation
in the bottom cell of the well mesh otherwise an error will be thrown and the simulation will terminate. For each
perforation, the well transmissibility factors employed to compute the perforation rates are calculated internally using
the Peaceman formulation.
<Mesh>
<VTKMesh
name="mesh"
file="../../../../../GEOSDATA/DataSets/Egg/egg.vtu"
fieldsToImport="{ PERM }"
fieldNamesInGEOS="{ rockPerm_permeability }">
<VTKWell
name="wellProducer1"
wellRegionName="wellRegion1"
wellControlsName="wellControls1"
file="../../../../../GEOSDATA/DataSets/Egg/wellProducer1.vtk"
radius="0.1"
(continues on next page)
<VTKWell
name="wellProducer2"
wellRegionName="wellRegion2"
wellControlsName="wellControls2"
file="../../../../../GEOSDATA/DataSets/Egg/wellProducer2.vtk"
radius="0.1"
numElementsPerSegment="7">
<Perforation
name="producer2_perf1"
distanceFromHead="2"/>
<Perforation
name="producer2_perf2"
distanceFromHead="6"/>
<Perforation
name="producer2_perf3"
distanceFromHead="10"/>
<Perforation
name="producer2_perf4"
distanceFromHead="14"/>
<Perforation
name="producer2_perf5"
distanceFromHead="18"/>
<Perforation
name="producer2_perf6"
distanceFromHead="22"/>
<Perforation
name="producer2_perf7"
distanceFromHead="26"/>
(continues on next page)
Events
In the Events XML block, we specify four types of PeriodicEvents.
The periodic event named solverApplications notifies GEOS that the coupled solver coupledFlowAndWells
has to be applied to its target regions (here, reservoir and wells) at every time step. The time stepping strategy has
been fully defined in the CompositionalMultiphaseReservoir coupling block using the initialDt attribute and the
NonlinearSolverParameters nested block.
We also define an output event instructing GEOS to write out .vtk files at the time frequency specified by the attribute
timeFrequency. Here, we choose to output the results using the VTK format (see Tutorial 2: External Meshes for a
example that uses the Silo output file format). The target attribute must point to the VTK sub-block of the Outputs
block defined at the end of the XML file by its user-specified name (here, vtkOutput).
We define the events involved in the collection and output of well production rates following the procedure defined in
Tasks Manager. The time-history collection events trigger the collection of well rates at the desired frequency, while
the time-history output events trigger the output of HDF5 files containing the time series. These events point by name
to the corresponding blocks of the Tasks and Outputs XML blocks. Here, these names are wellRateCollection1
and timeHistoryOutput1.
<Events
maxTime="1.5e7">
<PeriodicEvent
name="vtk"
timeFrequency="2e6"
target="/Outputs/vtkOutput"/>
<PeriodicEvent
name="timeHistoryOutput1"
timeFrequency="1.5e7"
target="/Outputs/timeHistoryOutput1"/>
<PeriodicEvent
name="timeHistoryOutput2"
timeFrequency="1.5e7"
target="/Outputs/timeHistoryOutput2"/>
<PeriodicEvent
name="timeHistoryOutput3"
timeFrequency="1.5e7"
target="/Outputs/timeHistoryOutput3"/>
<PeriodicEvent
name="timeHistoryOutput4"
timeFrequency="1.5e7"
target="/Outputs/timeHistoryOutput4"/>
<PeriodicEvent
name="solverApplications"
maxEventDt="5e5"
target="/Solvers/coupledFlowAndWells"/>
(continues on next page)
<PeriodicEvent
name="timeHistoryCollection1"
timeFrequency="1e6"
target="/Tasks/wellRateCollection1"/>
<PeriodicEvent
name="timeHistoryCollection2"
timeFrequency="1e6"
target="/Tasks/wellRateCollection2"/>
<PeriodicEvent
name="timeHistoryCollection3"
timeFrequency="1e6"
target="/Tasks/wellRateCollection3"/>
<PeriodicEvent
name="timeHistoryCollection4"
timeFrequency="1e6"
target="/Tasks/wellRateCollection4"/>
<PeriodicEvent
name="restarts"
timeFrequency="7.5e6"
targetExactTimestep="0"
target="/Outputs/restartOutput"/>
</Events>
Numerical methods
In the NumericalMethods XML block, we instruct GEOS to use a TPFA (Two-Point Flux Approximation) finite-
volume numerical scheme. This part is similar to the corresponding section of Multiphase Flow, and has been adapted
to match the specifications of the Egg model.
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA"/>
</FiniteVolume>
</NumericalMethods>
<ElementRegions>
<CellElementRegion
name="reservoir"
cellBlocks="{ * }"
materialList="{ fluid, rock, relperm }"/>
<WellElementRegion
name="wellRegion1"
materialList="{ fluid, relperm }"/>
<WellElementRegion
name="wellRegion2"
materialList="{ fluid, relperm }"/>
Constitutive models
The CompositionalMultiphaseFVM physics solver relies on at least four types of constitutive models listed in the
Constitutive XML block:
• a fluid model describing the thermodynamics behavior of the fluid mixture,
• a relative permeability model,
• a rock permeability model,
• a rock porosity model.
All the parameters must be provided using the SI unit system.
This part is identical to that of Multiphase Flow.
<Constitutive>
<DeadOilFluid
name="fluid"
phaseNames="{ oil, water }"
surfaceDensities="{ 848.9, 1025.2 }"
componentMolarWeight="{ 114e-3, 18e-3 }"
tableFiles="{ pvdo.txt, pvtw.txt }"/>
<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ oil, water }"
phaseMinVolumeFraction="{ 0.1, 0.2 }"
phaseRelPermExponent="{ 4.0, 3.0 }"
phaseRelPermMaxValue="{ 0.8, 0.75 }"/>
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
(continues on next page)
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-12, 1.0e-12, 1.0e-12 }"/>
</Constitutive>
Initial conditions
We are ready to specify the reservoir initial conditions of the problem in the FieldSpecifications XML block. The well
variables do not have to be initialized here since they will be defined internally.
The formulation of the CompositionalMultiphaseFVM physics solver (documented at Compositional Multiphase
Flow Solver) requires the definition of the initial pressure field and initial global component fractions. We define here
a uniform pressure field that does not satisfy the hydrostatic equilibrium, but a hydrostatic initialization of the pressure
field is possible using Functions:. For the initialization of the global component fractions, we remind the user that their
component attribute (here, 0 or 1) is used to point to a specific entry of the phaseNames attribute in the DeadOilFluid
block.
Note that we also define the uniform porosity field here since it is not included in the mesh file imported by the
VTKMesh.
<FieldSpecifications>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/hexahedra"
fieldName="pressure"
scale="4e7"/>
<FieldSpecification
name="initialComposition_oil"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/hexahedra"
fieldName="globalCompFraction"
component="0"
scale="0.9"/>
<FieldSpecification
name="initialComposition_water"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir/hexahedra"
fieldName="globalCompFraction"
component="1"
scale="0.1"/>
</FieldSpecifications>
Outputs
In this section, we request an output of the results in VTK format and an output of the rates for each producing well.
Note that the name defined here must match the name used in the Events XML block to define the output frequency.
<Outputs>
<VTK
name="vtkOutput"/>
<TimeHistory
name="timeHistoryOutput1"
sources="{ /Tasks/wellRateCollection1 }"
filename="wellRateHistory1"/>
<TimeHistory
name="timeHistoryOutput2"
sources="{ /Tasks/wellRateCollection2 }"
filename="wellRateHistory2"/>
<TimeHistory
name="timeHistoryOutput3"
sources="{ /Tasks/wellRateCollection3 }"
filename="wellRateHistory3"/>
<TimeHistory
name="timeHistoryOutput4"
sources="{ /Tasks/wellRateCollection4 }"
filename="wellRateHistory4"/>
<Restart
name="restartOutput"/>
</Outputs>
Tasks
In the Events block, we have defined four events requesting that a task periodically collects the rate for each producing
well. This task is defined here, in the PackCollection XML sub-block of the Tasks block. The task contains the path
to the object on which the field to collect is registered (here, a WellElementSubRegion) and the name of the field
(here, wellElementMixtureConnectionRate). The details of the history collection mechanism can be found in
Tasks Manager.
<Tasks>
<PackCollection
name="wellRateCollection1"
objectPath="ElementRegions/wellRegion1/wellRegion1UniqueSubRegion"
fieldName="wellElementMixtureConnectionRate"/>
<PackCollection
name="wellRateCollection2"
objectPath="ElementRegions/wellRegion2/wellRegion2UniqueSubRegion"
fieldName="wellElementMixtureConnectionRate"/>
<PackCollection
(continues on next page)
<PackCollection
name="wellRateCollection4"
objectPath="ElementRegions/wellRegion4/wellRegion4UniqueSubRegion"
fieldName="wellElementMixtureConnectionRate"/>
</Tasks>
Running GEOS
The first few lines appearing to the console are indicating that the XML elements are read and registered correctly:
This is followed by the creation of the 18553 hexahedral cells of the imported mesh. At this point, we are done with
the case set-up and the code steps into the execution of the simulation itself:
Visualization
A file compatible with Paraview is produced in this example. It is found in the output folder, and usually has the
extension .pvd. More details about this file format can be found here. We can load this file into Paraview directly and
visualize results:
We have instructed GEOS to output the time series of rates for each producer. The data contained in the corresponding
HDF5 files can be extracted and plotted as shown below.
To go further
Feedback on this example
This concludes the example on setting up a Dead-Oil simulation in the Egg model. For any feedback on this example,
please submit a GitHub issue on the project’s GitHub page.
For more details
• A complete description of the reservoir flow solver is found here: Compositional Multiphase Flow Solver.
3500 Producer #1
Producer #2
Producer #3
3000 Producer #4
total rate [cubic meters per day]
2500
2000
1500
1000
500
0
0 20 40 60 80 100 120 140 160
time [days]
1.3.3 CO 2 Injection
Context
In this example, we show how to set up a multiphase simulation of CO 2 injection.
Objectives
At the end of this example you will know:
• how to set up a CO 2 injection scenario with a well,
• how to run a case using MPI-parallelism.
Input file
The XML file for this test case is located at :
inputFiles/compositionalMultiphaseWell/simpleCo2InjTutorial_base.xml
inputFiles/compositionalMultiphaseWell/simpleCo2InjTutorial_smoke.xml
This mesh is a simple internally generated regular grid (50 x 1 x 150). A single CO 2 injection well is at the center of
the reservoir.
The XML file considered here follows the typical structure of the GEOS input files:
1. Solver
2. Mesh
3. Events
4. NumericalMethods
5. ElementRegions
6. Constitutive
7. FieldSpecifications
8. Outputs
9. Tasks
<Solvers>
<CompositionalMultiphaseReservoir
name="coupledFlowAndWells"
flowSolverName="compositionalMultiphaseFlow"
wellSolverName="compositionalMultiphaseWell"
logLevel="1"
initialDt="1e2"
targetRegions="{ reservoir, wellRegion }">
(continues on next page)
<CompositionalMultiphaseFVM
name="compositionalMultiphaseFlow"
targetRegions="{ reservoir }"
discretization="fluidTPFA"
temperature="368.15"
maxCompFractionChange="0.2"
logLevel="1"
useMass="1"/>
<CompositionalMultiphaseWell
name="compositionalMultiphaseWell"
targetRegions="{ wellRegion }"
maxCompFractionChange="0.2"
logLevel="1"
useMass="1">
<WellControls
name="wellControls"
type="injector"
control="totalVolRate"
enableCrossflow="0"
referenceElevation="6650"
useSurfaceConditions="1"
surfacePressure="101325"
surfaceTemperature="288.71"
targetBHP="5e7"
targetTotalRate="1.5"
injectionTemperature="368.15"
injectionStream="{ 1, 0 }"/>
</CompositionalMultiphaseWell>
</Solvers>
described blocks through flowSolverName and wellSolverName sub-tags, it contains the initialDt starting time-
step size value and defines the NonlinearSolverParameters and LinearSolverParameters that are used to control
Newton-loop and linear solver behaviors (see Linear Solvers for a detailed description of linear solver attributes).
ò Note
To use the linear solver options of this example, you need to ensure that GEOS is configured to use the Hypre linear
solver package.
<Mesh>
<InternalMesh
name="cartesianMesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 1000 }"
yCoords="{ 450, 550 }"
zCoords="{ 6500, 7700 }"
nx="{ 50 }"
ny="{ 1 }"
nz="{ 150 }"
cellBlockNames="{ cellBlock }">
<InternalWell
name="wellInjector1"
wellRegionName="wellRegion"
wellControlsName="wellControls"
polylineNodeCoords="{ { 525.0, 525.0, 6650.00 },
{ 525.0, 525.0, 6600.00 } }"
polylineSegmentConn="{ { 0, 1 } }"
radius="0.1"
numElementsPerSegment="2">
<Perforation
name="injector1_perf1"
distanceFromHead="45"/>
</InternalWell>
</InternalMesh>
</Mesh>
ò Note
It is the responsibility of the user to make sure that there is a perforation in the bottom cell of the well mesh,
otherwise an error will be thrown and the simulation will terminate.
Events
The solver is applied as a periodic event whose target is referred to as coupledFlowAndWells nametag. Using the
maxEventDt attribute, we specify a max time step size of 5 x 106 seconds.
The output event triggers a VTK output every 107 seconds, constraining the solver schedule to match exactly these
dates. The output path to data is specified as a target of this PeriodicEvent.
Another periodic event is defined under the name restarts. It consists of saved checkpoints every 5 x 107 seconds,
whose physical output folder name is defined under the Output tag.
Finally, the time history collection and output events are used to trigger the mechanisms involved in the generation of
a time series of well pressure (see the procedure outlined in Tasks Manager, and the example in Multiphase Flow with
Wells).
<Events
maxTime="5e8">
<PeriodicEvent
name="outputs"
timeFrequency="1e7"
targetExactTimestep="1"
target="/Outputs/simpleReservoirViz"/>
<PeriodicEvent
name="restarts"
timeFrequency="5e7"
targetExactTimestep="1"
target="/Outputs/restartOutput"/>
<PeriodicEvent
name="timeHistoryCollection"
timeFrequency="1e7"
targetExactTimestep="1"
target="/Tasks/wellPressureCollection" />
<PeriodicEvent
name="timeHistoryOutput"
timeFrequency="2e8"
targetExactTimestep="1"
target="/Outputs/timeHistoryOutput" />
<PeriodicEvent
name="solverApplications"
maxEventDt="5e5"
target="/Solvers/coupledFlowAndWells"/>
</Events>
Numerical methods
The TwoPointFluxApproximation is chosen for the fluid equation discretization. The tag specifies:
• A primary field to solve for as fieldName. For a flow problem, this field is pressure.
• A set of target regions in targetRegions.
<NumericalMethods>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA"/>
</FiniteVolume>
</NumericalMethods>
Element regions
We define a CellElementRegion pointing to all reservoir mesh cells, and a WellElementRegion for the well. The two
regions contain a list of constitutive model names. The keyword “all” is used here to automatically select all cells of
the mesh.
<ElementRegions>
<CellElementRegion
name="reservoir"
cellBlocks="{ * }"
materialList="{ fluid, rock, relperm }"/>
<WellElementRegion
name="wellRegion"
materialList="{ fluid, relperm, rockPerm }"/>
</ElementRegions>
Constitutive laws
Under the Constitutive tag, four items can be found:
• CO2BrinePhillipsFluid : this tag defines phase names, component molar weights, and fluid behaviors such as
CO 2 solubility in brine and viscosity/density dependencies on pressure and temperature.
• PressurePorosity : this tag contains all the data needed to model rock compressibility.
• BrooksCoreyRelativePermeability : this tag defines the relative permeability model for each phase, its end-
point values, residual volume fractions (saturations), and the Corey exponents.
• ConstantPermeability : this tag defines the permeability model that is set to a simple constant diagonal ten-
sor, whose values are defined in permeabilityComponent. Note that these values will be overwritten by the
permeability field imported in FieldSpecifications.
<Constitutive>
<CO2BrinePhillipsFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
flashModelParaFile="co2flash.txt"/>
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
(continues on next page)
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.1"
referencePressure="1.0e7"
compressibility="4.5e-10"/>
<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ gas, water }"
phaseMinVolumeFraction="{ 0.05, 0.30 }"
phaseRelPermExponent="{ 2.0, 2.0 }"
phaseRelPermMaxValue="{ 1.0, 1.0 }"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-17, 1.0e-17, 3.0e-17 }"/>
</Constitutive>
The PVT data specified by CO2BrinePhillipsFluid is set to model the behavior of the CO 2 -brine system as a function
of pressure, temperature, and salinity. We currently rely on a two-phase, two-component (CO 2 and H 2 O) model in
which salinity is a constant parameter in space and in time. The model is described in detail in CO2-brine model. The
model definition requires three text files:
In co2flash.txt, we define the CO 2 solubility model used to compute the amount of CO 2 dissolved in the brine phase
as a function of pressure (in Pascal), temperature (in Kelvin), and salinity (in units of molality):
The first keyword is an identifier for the model type (here, a flash model). It is followed by the model name. Then,
the lower, upper, and step increment values for pressure and temperature ranges are specified. The trailing 0 defines a
zero-salinity in the model. Note that the water component is not allowed to evaporate into the CO 2 -rich phase.
The pvtgas.txt and pvtliquid.txt files define the models used to compute the density and viscosity of the two phases, as
follows:
In these files, the first keyword of each line is an identifier for the model type (either a density or a viscosity model). It
is followed by the model name. Then, the lower, upper, and step increment values for pressure and temperature ranges
are specified. The trailing 0 for PhillipsBrineDensity and PhillipsBrineViscosity entry is the salinity of the
brine, set to zero.
ò Note
It is the responsibility of the user to make sure that the pressure and temperature values encountered in the simulation
(in the reservoir and in the well) are within the bounds specified in the PVT files. GEOS will not throw an error if
a value outside these bounds is encountered, but the (nonlinear) behavior of the simulation and the quality of the
results will likely be negatively impacted.
Property specification
The FieldSpecifications tag is used to declare fields such as directional permeability, reference porosity, initial pressure,
and compositions. Here, these fields are homogeneous, except for the permeability field that is taken as an heteroge-
neous log-normally distributed field and specified in Functions as in Tutorial 3: Regions and Property Specifications.
<FieldSpecifications>
<FieldSpecification
name="permx"
initialCondition="1"
component="0"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rockPerm_permeability"
scale="1e-15"
functionName="permxFunc"/>
<FieldSpecification
name="permy"
initialCondition="1"
component="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rockPerm_permeability"
scale="1e-15"
functionName="permyFunc"/>
<FieldSpecification
name="permz"
initialCondition="1"
component="2"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rockPerm_permeability"
scale="3e-15"
functionName="permzFunc"/>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir"
fieldName="pressure"
scale="1.25e7"/>
<FieldSpecification
(continues on next page)
<FieldSpecification
name="initialComposition_water"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/reservoir"
fieldName="globalCompFraction"
component="1"
scale="1.0"/>
</FieldSpecifications>
ò Note
In this case, we are using the same permeability field (perm.geos) for all the directions. Note also that the
fieldName values are set to rockPerm_permeability to access the permeability field handled as a Constitutive
law. These permeability values will overwrite the values already set in the Constitutive block.
. Warning
This XML file example does not take into account elevation when imposing the intial pressure with
initialPressure. Consider using a “HydrostraticEquilibrium” for a closer answer to modeled physical pro-
cesses.
Output
The Outputs XML tag is used to write visualization, restart, and time history files.
Here, we write visualization files in a format natively readable by Paraview under the tag VTK. A Restart tag is also be
specified. In conjunction with a PeriodicEvent, a restart file allows to resume computations from a set of checkpoints
in time. Finally, we require an output of the well pressure history using the TimeHistory tag.
<Outputs>
<VTK
name="simpleReservoirViz"/>
<Restart
name="restartOutput"/>
<TimeHistory
name="timeHistoryOutput"
sources="{/Tasks/wellPressureCollection}"
filename="wellPressureHistory" />
Tasks
In the Events block, we have defined an event requesting that a task periodically collects the pressure at the well. This
task is defined here, in the PackCollection XML sub-block of the Tasks block. The task contains the path to the
object on which the field to collect is registered (here, a WellElementSubRegion) and the name of the field (here,
pressure). The details of the history collection mechanism can be found in Tasks Manager.
<Tasks>
<PackCollection
name="wellPressureCollection"
objectPath="ElementRegions/wellRegion/wellRegionUniqueSubRegion"
fieldName="pressure" />
</Tasks>
Running GEOS
The simulation can be launched with 4 cores using MPI-parallelism:
A restart from a checkpoint file simpleCo2InjTutorial_restart_000000024.root is always available thanks to the follow-
ing command line :
The output then shows the loading of HDF5 restart files by each core.
Visualization
Using Paraview, we can observe the CO 2 plume moving upward under buoyancy effects and forming a gas cap at the
top of the domain,
The heterogeneous values of the log permeability field can also be visualized in Paraview as shown below:
To go further
Feedback on this example
This concludes the CO 2 injection field case example. For any feedback on this example, please submit a GitHub issue
on the project’s GitHub page.
For more details
• A complete description of the reservoir flow solver is found here: Compositional Multiphase Flow Solver.
• The well solver is described at Compositional Multiphase Well Solver.
• The available fluid constitutive models are listed at Fluid Models.
1.3.4 Poromechanics
Context
In this example, we use a coupled solver to solve a poroelastic Terzaghi-type problem, a classic benchmark in poroe-
lasticity. We do so by coupling a single phase flow solver with a small-strain Lagrangian mechanics solver.
Objectives
At the end of this example you will know:
• how to use multiple solvers for poromechanical problems,
• how to define finite elements and finite volume numerical methods.
Input file
This example uses no external input files and everything required is contained within two GEOS input files located at:
inputFiles/poromechanics/PoroElastic_Terzaghi_base_direct.xml
inputFiles/poromechanics/PoroElastic_Terzaghi_smoke.xml
GEOS will calculate displacement and pressure fields along the column as a function of time. We will use the analytical
solution for pressure to check the accuracy of the solution obtained with GEOS, namely
∞
(2𝑚 + 1)2 𝜋 2 𝑐𝑐 𝑡
[︂ ]︂ [︂ ]︂
4 ∑︁ 1 (2𝑚 + 1)𝜋𝑥
𝑝(𝑥, 𝑡) = 𝑝0 exp − sin ,
𝜋 𝑚=0 2𝑚 + 1 4𝐿2 2𝐿
where 𝑝0 = 𝐾𝑣 𝑆𝑏𝜖 +𝑏2 |𝑤| is the initial pressure, constant throughout the column, and 𝑐𝑐 = 𝜅 𝐾𝑣
𝜇 𝐾𝑣 𝑆𝜖 +𝑏2 is the consolida-
tion coefficient (or diffusion coefficient), with
• 𝑏 Biot’s coefficient
𝐸(1−𝜈)
• 𝐾𝑣 = (1+𝜈)(1−2𝜈) the uniaxial bulk modulus, 𝐸 Young’s modulus, and 𝜈 Poisson’s ratio
• 𝑆𝜖 = (𝑏−𝜑)(1−𝑏)
𝐾 + 𝜑𝑐𝑓 the constrained specific storage coefficient, 𝜑 porosity, 𝐾 = 𝐸
3(1−2𝜈) the bulk modulus,
and 𝑐𝑓 the fluid compressibility
• 𝜅 the isotropic permeability
• 𝜇 the fluid viscosity
𝐿2
The characteristic consolidation time of the system is defined as 𝑡𝑐 = 𝑐𝑐 . Knowledge of 𝑡𝑐 is useful for choosing
appropriately the timestep sizes that are used in the discrete model.
Coupled solvers
GEOS is a multi-physics tool. Different combinations of physics solvers available in the code can be applied in different
regions of the mesh at different moments of the simulation. The XML Solvers tag is used to list and parameterize
these solvers.
We define and characterize each single-physics solver separately. Then, we define a coupling solver between these
single-physics solvers as another, separate, solver. This approach allows for generality and flexibility in our multi-
physics resolutions. The order in which these solver specifications is done is not important. It is important, though, to
instantiate each single-physics solver with meaningful names. The names given to these single-physics solver instances
will be used to recognize them and create the coupling.
To define a poromechanical coupling, we will effectively define three solvers:
• the single-physics flow solver, a solver of type SinglePhaseFVM called here SinglePhaseFlowSolver (more
information on these solvers at Singlephase Flow Solver),
• the small-stress Lagrangian mechanics solver, a solver of type SolidMechanicsLagrangianSSLE called here
LinearElasticitySolver (more information here: Solid Mechanics Solver),
• the coupling solver that will bind the two single-physics solvers above, an object of type
SinglePhasePoromechanics called here PoroelasticitySolver (more information at Poromechan-
ics Solver).
Note that the name attribute of these solvers is chosen by the user and is not imposed by GEOS.
The two single-physics solvers are parameterized as explained in their respective documentation.
Let us focus our attention on the coupling solver. This solver (PoroelasticitySolver) uses a set of attributes that
specifically describe the coupling for a poromechanical framework. For instance, we must point this solver to the correct
fluid solver (here: SinglePhaseFlowSolver), the correct solid solver (here: LinearElasticitySolver). Now that
these two solvers are tied together inside the coupling solver, we have a coupled multiphysics problem defined. More
parameters are required to characterize a coupling. Here, we specify the discretization method (FE1, defined further in
the input file), and the target regions (here, we only have one, Domain).
<SinglePhasePoromechanics
name="PoroelasticitySolver"
solidSolverName="LinearElasticitySolver"
flowSolverName="SinglePhaseFlowSolver"
logLevel="1"
targetRegions="{ Domain }">
<LinearSolverParameters
directParallel="0"/>
</SinglePhasePoromechanics>
<SolidMechanicsLagrangianSSLE
name="LinearElasticitySolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain }"/>
<SinglePhaseFVM
name="SinglePhaseFlowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Domain }"/>
</Solvers>
<NumericalMethods>
<FiniteElements>
<FiniteElementSpace
(continues on next page)
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"/>
</FiniteVolume>
</NumericalMethods>
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 10 }"
yCoords="{ 0, 1 }"
zCoords="{ 0, 1 }"
nx="{ 400 }"
ny="{ 16 }"
nz="{ 16 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
The parameters used in the simulation are summarized in the following table.
Material properties and boundary conditions are specified in the Constitutive and FieldSpecifications sections.
For such set of parameters we have 𝑝0 = 1.0 Pa, 𝑐𝑐 = 1.111 m2 s-1 , and 𝑡𝑐 = 90 s. Therefore, as shown in the Events
section, we run this simulation for 90 seconds.
Running GEOS
To run the case, use the following command:
path/to/geosx -i inputFiles/poromechanics/PoroElastic_Terzaghi_smoke.xml
Here, we see for instance the RSolid and RFluid at a representative timestep (residual values for solid and fluid
mechanics solvers, respectively)
Attempt: 0, NewtonIter: 0
( RSolid ) = (5.00e-01) ; ( Rsolid, Rfluid ) = ( 5.00e-01, 0.00e+00 )
( R ) = ( 5.00e-01 ) ;
Attempt: 0, NewtonIter: 1
( RSolid ) = (4.26e-16) ; ( Rsolid, Rfluid ) = ( 4.26e-16, 4.22e-17 )
( R ) = ( 4.28e-16 ) ;
As expected, since we are dealing with a linear problem, the fully implicit solver converges in a single iteration.
Inspecting results
This plot compares the analytical pressure solution (continuous lines) at selected times with the numerical solution
(markers).
1.0
t = 0.0 s
0.8 t = 20.0 s
t = 40.0 s
t = 60.0 s
0.6 t = 80.0 s
pressure [Pa]
0.4
0.2
0.0
0 2 4 6 8 10
x [m]
To go further
Feedback on this example
This concludes the poroelastic example. For any feedback on this example, please submit a GitHub issue on the project’s
GitHub page.
For more details
• More on poroelastic multiphysics solvers, please see Poromechanics Solver.
• More on numerical methods, please see Numerical Methods.
• More on functions, please see Functions.
inputFiles/hydraulicFracturing
Because the input files use the advanced xml features, they must be preprocessed using the geosx_xml_tools package.
If you have not already done so, setup these features by following the instructions here: Advanced XML Features .
The inputs for this case are contained inside a case-specific (heterogeneousInSitu_benchmark.xml) and base
(heterogeneousInSitu_base.xml) XML files. The tables directory contains the pre-constructed geologic model.
This example will first focus on the case-specific input file, which contains the key parameter definitions, then consider
the base xml file.
<Included>
<File
name="./heterogeneousInSitu_base.xml"/>
</Included>
and is dependent upon two other parameters. During pre-processing, geosx_xml_tools will substitute the parameter
definitions, and evaluate the symbolic expression using a python-derived syntax.
A number of the input parameters include optional unit definitions, which are denoted by the square brackets following
a value. For example, the parameter t_max is used to set the maximum time for the simulation to 20 minutes.
<Parameters>
<!-- Use the swarm upscaling law -->
<Parameter
name="Nperf"
value="5"/>
<Parameter
name="Nswarm"
value="5"/>
<Parameter
name="mu_init"
value="0.001"/>
<Parameter
name="K_init"
value="1e6"/>
<Parameter
name="mu_upscaled"
value="`$mu_init$*($Nswarm$**2)`"/>
<Parameter
name="K_upscaled"
value="`$K_init$*($Nswarm$**0.5)`"/>
<Parameter
name="ContactStiffness"
value="1e10"/>
<Parameter
name="pump_ramp"
value="5 [s]"/>
<Parameter
name="pump_ramp_dt_limit"
value="0.2 [s]"/>
<Parameter
name="dt_max"
value="30 [s]"/>
<Parameter
(continues on next page)
<Parameter
name="t_allocation"
value="28 [min]"/>
</Parameters>
<Mesh>
<InternalMesh
name="mesh1"
xCoords="{ 0, 200, 250 }"
yCoords="{ -100, 0, 100 }"
zCoords="{ -150, -100, 0, 100, 150 }"
nx="{ 50, 5 }"
ny="{ 10, 10 }"
nz="{ 5, 25, 25, 5 }"
xBias="{ 0, -0.6 }"
yBias="{ 0.6, -0.6 }"
zBias="{ 0.6, 0, 0, -0.6 }"
cellBlockNames="{ cb1 }"
elementTypes="{ C3D8 }"/>
</Mesh>
<Geometry>
<Box
(continues on next page)
<Box
name="perf_a"
xMin="{ -4.1, -0.1, -4.1 }"
xMax="{ 4.1, 0.1, 4.1 }"/>
<ThickPlane
name="fracturable_a"
normal="{ 0, 1, 0 }"
origin="{ 0, 0, 0 }"
thickness="0.1"/>
</Geometry>
Boundary conditions
The boundary conditions for this problem are defined in the case-specific and the base xml files. The case specific
block includes four instructions:
• frac: this marks the initial perforation.
• separableFace: this marks the set of faces that are allowed to break during the simulation.
• waterDensity: this initializes the fluid in the perforation.
• sourceTerm: this instructs the code to inject fluid into the source_a nodeset. Note the usage of the symbolic
expression and parameters in the scale. This boundary condition is also driven by a function, which we will
define later.
<FieldSpecifications>
<!-- Fracture-related nodesets -->
<FieldSpecification
name="frac"
fieldName="ruptureState"
initialCondition="1"
objectPath="faceManager"
scale="1"
setNames="{ perf_a }"/>
<FieldSpecification
name="separableFace"
fieldName="isFaceSeparable"
initialCondition="1"
objectPath="faceManager"
scale="1"
setNames="{ fracturable_a }"/>
The base block includes instructions to set the initial in-situ properties and stresses. It is also used to specify the
external mechanical boundaries on the system. In this example, we are using roller-boundary conditions (zero normal-
displacement). Depending upon how close they are to the fracture, they can significantly affect its growth. Therefore,
it is important to test whether the size of the model is large enough to avoid this.
<FieldSpecifications>
<FieldSpecification
name="bulk_modulus"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_bulkModulus"
functionName="bulk_modulus"
scale="1.0"/>
<FieldSpecification
name="shear_modulus"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_shearModulus"
functionName="shear_modulus"
scale="1.0"/>
<FieldSpecification
name="sigma_xx"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="0"
functionName="sigma_xx"
scale="1.0"/>
<FieldSpecification
name="sigma_yy"
initialCondition="1"
setNames="{ all }"
(continues on next page)
<FieldSpecification
name="sigma_zz"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="2"
functionName="sigma_zz"
scale="1.0"/>
<FieldSpecification
name="y_constraint"
component="1"
fieldName="totalDisplacement"
objectPath="nodeManager"
scale="0.0"
setNames="{ yneg, ypos }"/>
<FieldSpecification
name="z_constraint"
component="2"
fieldName="totalDisplacement"
objectPath="nodeManager"
scale="0.0"
setNames="{ zneg, zpos }"/>
</FieldSpecifications>
The final solver present in this example is the SurfaceGenerator, which manages how faces in the model break.
<Solvers
gravityVector="{ 0.0, 0.0, -9.81 }">
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="2">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="40"
lineSearchMaxCuts="3"/>
<LinearSolverParameters
logLevel="1"
solverType="gmres"
preconditionerType="mgr"/>
</Hydrofracture>
<SolidMechanicsLagrangianSSLE
name="lagsolve"
logLevel="1"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1e12">
<NonlinearSolverParameters
newtonTol="1.0e-6"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-10"/>
</SolidMechanicsLagrangianSSLE>
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="10"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-12"/>
</SinglePhaseFVM>
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
(continues on next page)
Events
Rather than explicitly specify the desired timestep behavior, this example uses a flexible approach for timestepping.
The hydrofracture solver is applied in the solverApplications event, which request a maxEventDt = 30 s. To
maintain stability during the critical early phase of the model, we delay turning on the pump by pump_start. We then
use the pumpStart event to limit the further limit the timestep to pump_ramp_dt_limit as the fracture experiences
rapid development (pump_start to pump_start + pump_ramp). Note that while this event does not have a target,
it can still influence the time step behavior. After this period, the hydraulic fracture solver will attempt to increase /
decrease the requested timestep to maintain stability.
Other key events in this problem include:
• preFracture: this calls the surface generator at the beginning of the problem and helps to initialize the fracture.
• outputs_vtk and outputs_silo: these produces output vtk and silo files.
• restarts (inactive): this is a HaltEvent, which tracks the external clock. When the runtime exceeds the specified
value (here $t_allocation$=28 minutes), the code will call the target (which writes a restart file) and instruct the
code to exit.
<Events
maxTime="$t_max$"
logLevel="1">
<!-- Generate the initial fractures -->
<SoloEvent
name="preFracture"
target="/Solvers/SurfaceGen"/>
<PeriodicEvent
name="outputs_silo"
timeFrequency="1 [min]"
targetExactTimestep="0"
target="/Outputs/siloOutput"/>
<!-- Watch the wall-clock, write a restart, and exit gracefully if necessary -->
<!-- <HaltEvent
name="restarts"
maxRuntime="$t_allocation$"
target="/Outputs/restartOutput"/> -->
</Events>
0.00000e+00
6.00000e+01
1.20000e+02
3.72000e+03
3.78000e+03
1.00000e+09
0.00000e+00
0.00000e+00
5.00000e-02
5.00000e-02
0.00000e+00
0.00000e+00
Given the specified linear interpolation method, these values define a simple trapezoidal function. Note: since this is a
1D table, these values could alternately be given within the xml file using the coordinates and values attributes.
The sigma_xx TableFunction is an example of a 3D function. It uses elementCenter as its input, which is a vector. It
is specified using a set of three coordinate files (one for each axis), and a single voxel file. The geologic model in this
example is a layer-cake, which was randomly generated, so the size of the x and y axes are 1. The interpolation method
used here is upper, so the values in the table indicate those at the top of each layer.
<Functions>
<!-- Pumping Schedule -->
<TableFunction
name="flow_rate"
inputVarNames="{ time }"
coordinateFiles="{ $table_root$/flowRate_time.csv }"
voxelFile="$table_root$/flowRate.csv"/>
<TableFunction
name="sigma_yy"
inputVarNames="{ elementCenter }"
coordinateFiles="{ $table_root$/x.csv, $table_root$/y.csv, $table_root$/z.csv }"
voxelFile="$table_root$/sigma_yy.csv"
interpolation="upper"/>
<TableFunction
name="sigma_zz"
inputVarNames="{ elementCenter }"
coordinateFiles="{ $table_root$/x.csv, $table_root$/y.csv, $table_root$/z.csv }"
voxelFile="$table_root$/sigma_zz.csv"
interpolation="upper"/>
<TableFunction
name="init_pressure"
inputVarNames="{ elementCenter }"
coordinateFiles="{ $table_root$/x.csv, $table_root$/y.csv, $table_root$/z.csv }"
voxelFile="$table_root$/porePressure.csv"
interpolation="upper"/>
<TableFunction
name="bulk_modulus"
inputVarNames="{ elementCenter }"
coordinateFiles="{ $table_root$/x.csv, $table_root$/y.csv, $table_root$/z.csv }"
voxelFile="$table_root$/bulkModulus.csv"
interpolation="upper"/>
<TableFunction
name="shear_modulus"
inputVarNames="{ elementCenter }"
coordinateFiles="{ $table_root$/x.csv, $table_root$/y.csv, $table_root$/z.csv }"
voxelFile="$table_root$/shearModulus.csv"
interpolation="upper"/>
<TableFunction
name="apertureTable"
coordinates="{ -1.0e-3, 0.0 }"
values="{ 1.0e-6, 1.0e-4 }"/>
</Functions>
Running GEOS
Assuming that the preprocessing tools have been correctly installed (see Advanced XML Features ), there will be a
script in the GEOS build/bin directory called geosx_preprocessed. Replacing geosx with geosx_preprocessed in an
input command will automatically apply the preprocessor and send the results to GEOS.
Before beginning, we reccomend that you make a local copy of the example and its tables. Because we are using
advanced xml features in this example, the input file must be pre-processed before running. For example, this will run
the code on a debug partition using a total of 36 cores.
cp -r examples/hydraulicFracturing ./hf_example
cd hf_example
srun -n 36 -ppdebug geosx_preprocessed -i heterogeneousInSitu_benchmark.xml -x 6 -y 2 -z␣
˓→3 -o hf_results
Note that as part of the automatic preprocessing step a compiled xml file is written to the disk (by default ‘[in-
put_name].preprocessed’). When developing an xml with advanced features, we reccomend that you check this file
to ensure its accuracy.
Inspecting results
In the above example, we requested vtk- and silo-format output files every minute. We can therefore import these into
VisIt, Paraview, or python and visualize the outcome. The following figure shows the extents of the generated fracture
over time:
1) In Visit, we currently recommend that you look at the silo-format files (due to a compatibility issue with vtk)
2) In Paraview, you may need to use the Multi-block Inspector (on the right-hand side of the screen by default) to
limit the visualization to the fracture. In addition, the Properties inspector (on the left-hand side of the sceen by
default) may not include some of the parameters present on the fracture. Instead, we recommend that you use
the property dropdown box at the top of the screen.
Because we did not explicitly specify any fracture barriers in this example, the fracture dimensions are controlled by
the in-situ stresses. During the first couple of minutes of growth, the fracture quickly reaches its maximum/minimum
height, which corresponds to a region of low in-situ minimum stress.
The following figures show the aperture and pressure of the hydraulic fracture (near the source) over time:
To go further
Feedback on this example
This concludes the hydraulic fracturing example. For any feedback on this example, please submit a GitHub issue on
the project’s GitHub page.
For more details
• More on advanced xml features, please see Advanced XML Features.
• More on functions, please see Functions.
• More on biased meshes, please see Mesh Bias.
inputFiles/triaxialDriver/triaxialDriver_ExtendedDruckerPrager_basicExample.xml
inputFiles/triaxialDriver/tables/
src/docs/sphinx/basicExamples/triaxialDriver/triaxialDriverFigure.py
Task
In GEOS, the TriaxialDriver is defined with a dedicated XML structure. The TriaxialDriver is added to a
standard XML input deck as a solo task to the Tasks queue and added as a SoloEvent to the event queue.
For this example, we simulate the elastoplastic deformation of a confined specimen caused by external load. A ho-
mogeneous domain with one solid material is assumed. The material is named ExtendedDruckerPrager, and its
mechanical properties are specified in the Constitutive section.
Different testing modes are available in the TriaxialDriver to mimic different laboratory loading conditions:
A triaxial test is usually conducted on a confined rock sample to determine material properties. As shown, a conven-
tional triaxial test is described using the mode="mixedControl" testing mode in the TriaxialDriver.
In a triaxial test, the testing sample is under confining pressure (radial stresses) and subject to increased axial load.
Therefore, a stress control radialControl="stressFunction" is defined in the radial direction to impose confining
pressure. A strain control axialControl="strainFunction" is applied in the axial direction to represent axial
compression.
The initial stress is specified by initialStress="-10.e6". To ensure static equilibrium at the first timestep, its value
should be consistent with the initial set of applied stresses defined in axial or radial loading functions. This stress has
a negative value due to the negative sign convention for compressive stress in GEOS.
Then, steps="200" defines the number of load steps and output="simulationResults.txt" specifies an output
file to which the simulation results will be written.
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ExtendedDruckerPrager"
mode="mixedControl"
axialControl="strainFunction"
radialControl="stressFunction"
initialStress="-10.e6"
steps="200"
output="simulationResults.txt" />
</Tasks>
In addition to triaxial tests, volumetric and oedometer tests can be simulated by changing the strainControl mode,
and by defining loading controls in axial and radial direction accordingly. A volumetric test can be modelled by setting
the axial and radial control functions to the same strain function, whereas an oedometer test runs by setting the radial
strain to zero (see Triaxial Driver).
Constitutive laws
Any solid material model implemented in GEOS can be called by the TriaxialDriver.
For this problem, Extended Drucker Prager model ExtendedDruckerPrager is used to describe the mechan-
ical behavior of an isotropic material, when subject to external loading. As for the material parameters,
defaultInitialFrictionAngle, defaultResidualFrictionAngle and defaultCohesion denote the ini-
tial friction angle, the residual friction angle, and cohesion, respectively, as defined by the Mohr-Coulomb
failure envelope. As the residual friction angle defaultResidualFrictionAngle is larger than the initial
one defaultInitialFrictionAngle, a strain hardening model is adopted, whose hardening rate is given as
defaultHardening="0.0001". If the residual friction angle is set to be less than the initial one, strain weakening
will take place. Setting defaultDilationRatio="1.0" corresponds to an associated flow rule.
<Constitutive>
<ExtendedDruckerPrager
name="ExtendedDruckerPrager"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="6.0e6"
defaultInitialFrictionAngle="16.0"
defaultResidualFrictionAngle="20.0"
defaultDilationRatio="1.0"
defaultHardening="0.0001"
/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
Functions
The TriaxialDriver uses a simple form of time-stepping to advance through the loading steps, allowing for simu-
lating both rate-dependent and rate-independent models.
In this case, users should define two different time history functions (strainFunction and stressFunction) to
describe loading conditions in axial and radial direction respectively. More specifically, the table functions in this
example include the temporal variations of radial stress and axial strain, which rely upon the external files in the table
directory (see Functions). Note that for standard tests with simple loading history, functions can be embedded directly
in the XML file without using external tables.
<Functions>
<TableFunction
name="strainFunction"
inputVarNames="{ time }"
coordinateFiles="{ tables/time.geos }"
voxelFile="tables/axialStrain.geos"/>
<TableFunction
name="stressFunction"
inputVarNames="{ time }"
coordinateFiles="{ tables/time.geos }"
voxelFile="tables/radialStress.geos"/>
</Functions>
The strainFunction TableFunction is an example of a 1D interpolated function, which describes the strain as a
function of time inputVarNames="{ time }". This table is defined using a single coordinate file:
0
1
2
3
4
5
0.0
-0.004
-0.002
-0.005
-0.003
-0.006
Similarly, the correlation between the confining stress and time is given through the stressFunction defined using
the same coordinate file:
0
1
2
3
4
5
-10.0e6
-10.0e6
-10.0e6
-10.0e6
-10.0e6
-10.0e6
For this specific test, the confining stress is kept constant and equal to the initialStress. Instead of monotonic
changing the axial load, two loading/unloading cycles are specified in the strainFunction. This way, both plastic
loading and elastic unloading can be modeled.
Note that by convention in GEOS, stressFunction and strainFunction have negative values for a compressive
test.
Mesh
Even if discretization is not required for the TriaxialDriver, a dummy mesh should be defined to pass all the nec-
essary checks when initializing GEOS and running the module. A dummy mesh should be created in the Mesh section
and assigned to the cellBlocks in the ElementRegions section.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 1 }"
yCoords="{ 0, 1 }"
zCoords="{ 0, 1 }"
nx="{ 1 }"
ny="{ 1 }"
nz="{ 1 }"
cellBlockNames="{ cellBlock01 }"/>
</Mesh>
<ElementRegions>
<CellElementRegion
(continues on next page)
Once calibrated, the testing constitutive models can be easily used in full field-scale simulation by adding solver, dis-
cretization, and boundary condition blocks to the xml file. Also, it is possible to run a full GEOS model and generate
identical results as those provided by the TriaxialDriver.
Running TriaxialDriver
The TriaxialDriver is launched like any other GEOS simulation by using the following command:
path/to/geosx -i triaxialDriver_ExtendedDruckerPrager_basicExample.xml
The running log appears to the console to indicate if the case can be successfully executed or not:
Max threads: 32
MKL max threads: 16
GEOS version 0.2.0 (HEAD, sha1: bb16d72)
Adding Event: SoloEvent, triaxialDriver
TableFunction: strainFunction
TableFunction: stressFunction
Adding Mesh: InternalMesh, mesh1
Adding Object CellElementRegion named dummy from ObjectManager::Catalog.
Total number of nodes:8
Total number of elems:1
Rank 0: Total number of nodes:8
dummy/cellBlock01 does not have a discretization associated with it.
Time: 0s, dt:1s, Cycle: 0
Cleaning up events
Umpire HOST sum across ranks: 23.2 KB
Umpire HOST rank max: 23.2 KB
total time 0.435s
initialization time 0.053s
run time 0.004s
Inspecting results
The simulation results are saved in a text file, named simulationResults.txt. This output file has a brief header
explaining the meaning of each column. Each row corresponds to one timestep of the driver, starting from initial
conditions in the first row.
# column 1 = time
# column 2 = axial_strain
# column 3 = radial_strain_1
# column 4 = radial_strain_2
# column 5 = axial_stress
# column 6 = radial_stress_1
# column 7 = radial_stress_2
# column 8 = newton_iter
# column 9 = residual_norm
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -1.0000e+07 -1.0000e+07 -1.0000e+07 0.
(continues on next page)
Note that the file contains two columns for radial strains (radial_strain_1 and radial_strain_2) and two columns
for radial stresses (radial_stress_1 and radial_stress_2). For isotropic materials, the stresses and strains along
the two radial axes would be the same. However, the stresses and strains in the radial directions can differ for cases
with anisotropic materials and true-triaxial loading conditions.
This output file can be processed and visualized using any tool. As an example here, with the provided python script,
the simulated stress-strain curve, p-q diagram and relationship between volumetric strain and axial strain are plotted,
and used to validate results against experimental observations:
To go further
Feedback on this example
For any feedback on this example, please submit a GitHub issue on the project’s GitHub page.
Context
In this example, we simulate a CO2 core flood experiment representing immiscible transport of two-phase flow (CO2
and water) through porous media (Ekechukwu et al., 2022). This problem is solved using the multiphase flow solver in
GEOS to obtain the temporal evolution of saturation along the flow direction, and verified against the Buckley-Leverett
analytical solutions (Buckley and Leverett, 1942; Arabzai and Honma, 2013).
Input file
The xml input files for the test case are located at:
inputFiles/compositionalMultiphaseFlow/benchmarks/buckleyLeverettProblem/buckleyLeverett_
˓→base.xml
inputFiles/compositionalMultiphaseFlow/benchmarks/buckleyLeverettProblem/buckleyLeverett_
˓→benchmark.xml
Table files and a Python script for post-processing the simulation results are provided:
inputFiles/compositionalMultiphaseFlow/benchmarks/buckleyLeverettProblem/buckleyLeverett_
˓→table
20
10
Triaxial Driver
0
0.4 0.2 0.0 0.2 0.4 0.6
Strain (%)
40
q (MPa)
20 Triaxial Driver
Initial Yield Surface
Residual Yield Surface
0
0 10 20 30 40 50
p (MPa)
0.1
Volumetric Strain (%)
0.0
0.1
0.2
Triaxial Driver
0.3
0.0 0.1 0.2 0.3 0.4 0.5 0.6
Axial Strain (%)
src/docs/sphinx/advancedExamples/validationStudies/carbonStorage/buckleyLeverett/
˓→buckleyLeverettFigure.py
We model the immiscible displacement of brine by CO2 in a quasi one-dimensional domain that mimics a CO2 core
flood experiment, as shown below. The domain is horizontal, homogeneous, isotropic and isothermal. Prior to injection,
the domain is fully saturated with brine. To match the analytical example configuration, supercritical CO2 is injected
from the inlet and a constant flow rate is imposed. To meet the requirements of immiscible transport in one-dimensional
domain, we assume linear and horizontal flow, incompressible and immiscible phases, negligible capillary pressure
and gravitational forces, and no poromechanical effects. Upon injection, the saturation front of the injected phase
(supercritical CO2) forms a sharp leading edge and advances with time.
We set up and solve a multiphase flow model to obtain the spatial and temporal solutions of phase saturations and pore
pressures across the domain upon injection. Saturation profiles along the flow direction are evaluated and compared
with their corresponding analytical solutions (Arabzai and Honma, 2013).
A power-law Brooks-Corey relation is used here to describe gas 𝑘𝑟𝑔 and water 𝑘𝑟𝑤 relative permeabilities:
𝑛𝑔
𝑘𝑟𝑔 = 𝑘𝑟𝑔 0 (𝑆𝑔 ⋆ )
𝑛𝑤
𝑘𝑟𝑤 = 𝑘𝑟𝑤 0 (𝑆𝑤 ⋆ )
where 𝑘𝑟𝑔 0 and 𝑘𝑟𝑤 0 are the maximum relative permeability of gas and water phase respectively; 𝑛𝑔 and 𝑛𝑤 are the
Corey exponents; dimensionless volume fraction (saturation) of gas phase 𝑆𝑔 ⋆ and water phase 𝑆𝑤 ⋆ are given as:
𝑆𝑔 − 𝑆𝑔𝑟
𝑆𝑔 ⋆ =
1 − 𝑆𝑔𝑟 − 𝑆𝑤𝑟
𝑆𝑤 − 𝑆𝑤𝑟
𝑆𝑤 ⋆ =
1 − 𝑆𝑔𝑟 − 𝑆𝑤𝑟
where 𝑆𝑔𝑟 and 𝑆𝑤𝑟 are the residual gas and water saturation;
According to the Buckley–Leverett theory with constant fluid viscosity, the fractional flow of gas phase 𝑓𝑔 can be
expressed as:
𝑘𝑟𝑔
𝜇𝑔
𝑓𝑔 = 𝑘𝑟𝑔 𝑘𝑟𝑤
𝜇𝑔 + 𝜇𝑤
where 𝜇𝑔 and 𝜇𝑤 represent the viscosity of gas and water phase respectively, assumed to be constant in this study.
𝑑𝑓𝑔
The position of a particular saturation is given as a function of the injection time 𝑡 and the value of the derivative 𝑑𝑆𝑔
at that saturation:
(︂ )︂
𝑄𝑇 𝑡 𝑑𝑓𝑔
𝑥𝑆𝑔 =
𝐴𝜑 𝑑𝑆𝑔
where 𝑄𝑇 is the total flow rate, 𝐴 is the area of the cross-section in the core sample, 𝜑 is the rock porosity. In addition,
the abrupt saturation front is determined based on the tangent point on the fractional flow curve.
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
The mesh was created with the internal mesh generator and parametrized in the InternalMesh XML tag. It contains
1000x1x1 eight-node brick elements in the x, y, and z directions respectively. Such eight-node hexahedral elements are
defined as C3D8 elementTypes, and their collection forms a mesh with one group of cell blocks named here cellBlock.
The width of the domain should be large enough to ensure the formation of a one-dimension flow.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 0.1 }"
yCoords="{ 0, 0.00202683 }"
zCoords="{ 0, 1 }"
nx="{ 1000 }"
ny="{ 1 }"
nz="{ 1 }"
cellBlockNames="{ cellBlock }"/>
</Mesh>
Flow solver
The isothermal immiscible simulation is performed using the GEOS general-purpose multiphase flow solver. The
multiphase flow solver, a solver of type CompositionalMultiphaseFVM called here compflow (more information on
these solvers at Compositional Multiphase Flow Solver) is defined in the XML block CompositionalMultiphaseFVM:
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
discretization="fluidTPFA"
temperature="300"
initialDt="0.001"
useMass="1"
targetRegions="{ region }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="50"
maxTimeStepCuts="2"
lineSearchMaxCuts="2"/>
<LinearSolverParameters
solverType="direct"
directParallel="0"
(continues on next page)
We use the targetRegions attribute to define the regions where the flow solver is applied. Here, we only simu-
late fluid flow in one region named as region. We specify the discretization method (fluidTPFA, defined in the
NumericalMethods section), and the initial reservoir temperature (temperature="300").
Constitutive laws
This benchmark example involves an immiscible, incompressible, two-phase model, whose fluid rheology and perme-
ability are specified in the Constitutive section. The best approach to represent this fluid behavior in GEOS is to
use the DeadOilFluid model in GEOS.
<Constitutive>
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.2"
referencePressure="1e7"
compressibility="1.0e-15"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 9.0e-13, 9.0e-13, 9.0e-13}"/>
<BrooksCoreyRelativePermeability
name="relperm"
phaseNames="{ gas, water }"
phaseMinVolumeFraction="{ 0.0, 0.0 }"
phaseRelPermExponent="{ 3.5, 3.5 }"
phaseRelPermMaxValue="{ 1.0, 1.0 }"/>
<DeadOilFluid
name="fluid"
phaseNames="{ gas, water }"
surfaceDensities="{ 280.0, 992.0 }"
componentMolarWeight="{ 44e-3, 18e-3 }"
tableFiles="{ buckleyLeverett_table/pvdg.txt, buckleyLeverett_table/pvtw.txt }"/>
</Constitutive>
Constant fluid densities and viscosities are given in the external tables for both phases. The formation volume factors are
set to 1 for incompressible fluids. The relative permeability for both phases are modeled with the power-law correlations
BrooksCoreyRelativePermeability (more information at Brooks-Corey relative permeability model), as shown
below. Capillary pressure is assumed to be negligible.
All constitutive parameters such as density, viscosity, and permeability are specified in the International System of
Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields.
Either the entire field or specified named sets of indices in the field can be collected. In this ex-
ample, phaseVolumeFractionCollection is specified to output the time history of phase saturations
fieldName="phaseVolumeFraction" across the computational domain.
<Tasks>
<PackCollection
name="phaseVolumeFractionCollection"
objectPath="ElementRegions/region/cellBlock"
fieldName="phaseVolumeFraction"/>
</Tasks>
This task is triggered using the Event manager with a PeriodicEvent defined for the recurring tasks. GEOS writes
one file named after the string defined in the filename keyword, formatted as a HDF5 file (saturationHistory.hdf5).
The TimeHistory file contains the collected time history information from the specified time history collector. This file
includes datasets for the simulation time, element center, and the time history information for both phases. A Python
script is prepared to read and plot any specified subset of the time history data for verification and visualization.
is used to initialize the water global component fraction, because we previously set phaseNames="{gas, water}"
in the DeadOilFluid XML block.
A mass injection rate SourceFlux (scale="-0.00007") of pure CO2 (component="0") is applied at the fluid inlet,
named source. The value given for scale is 𝑄𝑇 𝜌𝑔 . Pressure and composition controls at the fluid outlet (sink) are
also specified. The setNames="{ source } and setNames="{ sink }" are defined using the Box XML tags of
the Geometry section.
These boundary conditions are set up through the FieldSpecifications section.
<FieldSpecifications>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="pressure"
scale="1e7"/>
<FieldSpecification
name="initialComposition_gas"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="globalCompFraction"
component="0"
scale="0.001"/>
<FieldSpecification
name="initialComposition_water"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="globalCompFraction"
component="1"
scale="0.999"/>
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions"
scale="-0.00007"
component="0"
setNames="{ source }"/>
<FieldSpecification
name="sinkTermPressure"
objectPath="faceManager"
fieldName="pressure"
scale="1e7"
setNames="{ sink }"/>
<FieldSpecification
name="sinkTermTemperature"
objectPath="faceManager"
(continues on next page)
<FieldSpecification
name="sinkTermComposition_gas"
setNames="{ sink }"
objectPath="faceManager"
fieldName="globalCompFraction"
component="0"
scale="0.001"/>
<FieldSpecification
name="sinkTermComposition_water"
setNames="{ sink }"
objectPath="faceManager"
fieldName="globalCompFraction"
component="1"
scale="0.999"/>
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table, and specified in the Constitutive and
FieldSpecifications sections.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of phase saturations and pore pressures in the computational domain at 𝑡 = 70𝑠.
Two following dimensionless terms are defined when comparing the numerical solution with the analytical solutions:
𝑄𝑇 𝑡
𝑡⋆ =
𝐴𝐷𝐿 𝜑
𝑥𝑆𝑔
𝑥𝑑 =
𝐷𝐿
The figure below compares the results from GEOS (dashed curves) and the corresponding analytical solution (solid
curves) for the change of gas saturation (𝑆𝑔 ) and water saturation (𝑆𝑤 ) along the flow direction.
GEOS reliably captures the immiscible transport of two phase flow (CO2 and water). GEOS matches the analytical
solutions in the formation and the progress of abrupt fronts in the saturation profiles.
1.0 Analytical_t*=0.062
1.0
Numerical_t*=0.062
Analytical_t*=0.123
Numerical_t*=0.123
0.8 Analytical_t*=0.185
Numerical_t*=0.185 0.8
Analytical_t*=0.247
Numerical_t*=0.247
Analytical_t*=0.308
0.6 Numerical_t*=0.308
Analytical_t*=0.37 0.6
Numerical_t*=0.37 Analytical_t*=0.062
Numerical_t*=0.062
Sw
Analytical_t*=0.432
Sg
Numerical_t*=0.432 Analytical_t*=0.123
0.4 0.4 Numerical_t*=0.123
Analytical_t*=0.185
Numerical_t*=0.185
Analytical_t*=0.247
Numerical_t*=0.247
Analytical_t*=0.308
0.2 0.2 Numerical_t*=0.308
Analytical_t*=0.37
Numerical_t*=0.37
Analytical_t*=0.432
Numerical_t*=0.432
0.00.0 0.2 0.4 0.6 0.8 1.0 0.00.0 0.2 0.4 0.6 0.8 1.0
xd xd
To go further
Context
We consider a benchmark problem used in (Class et al., 2009) to compare a number of numerical models applied to
CO2 storage in geological formations. Using a simplified isothermal and immiscible two-phase setup, this test case
addresses the simulation of the advective spreading of CO2 injected into an aquifer and the leakage of CO2 from the
aquifer through an abandoned, leaky well.
Our goal is to review the different sections of the XML file reproducing the benchmark configuration and to demonstrate
that the GEOS results (i.e., arrival time of the CO2 plume at the leaky well and leakage rate through the abandoned
well) are in agreement with the reference results published in (Class et al., 2009).
The GEOS results obtained for the non-isothermal version of this test case (referred to as Problem 1.2 in (Class et al.,
2009)) are presented in a separate documentation page.
Input file
This benchmark test is based on the XML file located below:
inputFiles/compositionalMultiphaseFlow/benchmarks/isothermalLeakyWell/
˓→isothermalLeakyWell_benchmark.xml
Problem description
The following text is adapted from the detailed description of the benchmark test case presented in (Ebigbo, Class,
Helmig, 2007) and (Class et al., 2009).
The leakage scenario considered here involves one CO2 injection well, one leaky well, two aquifers and an aquitard.
The setup is illustrated in the figure below. The leaky well connects the two aquifers. CO2 is injected into in the lower
aquifer, comes in contact with the leaky well and rises to the higher aquifer. The advective flow (including the buoyancy
effects) of CO2 in the initially brine-saturated aquifers and through the leaky well is the most important process in this
problem.
The model domain is located 2840 to 3000 m below the surface and has the following dimensions: 1000 x 1000 x 160
m. The distance between the injection and the leaky well is 100 m, and the injection rate of CO2 into the lower aquifer
is constant (equal to 8.87 kg/s). The wells are described as cylinders with a 0.15 m radius and are treated as a porous
medium with a higher permeability than the aquifers (i.e., this problem does not require a well model).
Fig. 1.5: Leakage scenario (image taken from (Ebigbo, Class, Helmig, 2007)).
The structured mesh is generated using the internal mesh generator as parameterized in the InternalMesh block of the
XML file. The mesh contains 112 x 101 x 60 hexahedral elements (C3D8 element type) in the x, y, and z directions
respectively.
The attributes nx, ny, nz, and cellBlockNames are used to define 5 x 3 x 3 = 45 cell blocks. Note that the cell block
names listed in cellBlockNames are mapped to their corresponding cell block using an k-j-i logic in which the k index
is the fastest index, and the i index is the slowest index.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ -500, -0.1329, 0.1329, 99.8671, 100.1329, 500 }"
yCoords="{ -500, -0.1329, 0.1329, 500 }"
zCoords="{ -3000, -2970, -2870, -2840 }"
nx="{ 50, 1, 20, 1, 40 }"
ny="{ 50, 1, 50 }"
nz="{ 20, 30, 10 }"
cellBlockNames="{ aquiferBottom00, aquiferBottom10, aquiferBottom20,␣
˓→aquiferBottom30, aquiferBottom40,
ò Note
In the GEOS input file, the two wells are defined as columns of hexahedral elements of individual size 0.2658 x
0.2658 x 1 m. The coefficient 0.2858 is chosen to ensure that the cross-section of the wells is equal to the one
defined in the benchmark, in which wells are defined as cylinders with a radius of 0.15 m.
The cell block names are used in the ElementRegions block to define element regions in the aquifers and in the wells.
In the benchmark definition, the wells are treated as a porous medium with a higher permeability and therefore the
rock models are not the same in the aquifers (rock) and in the wells (rockWell). These names are defined in the
Constitutive block.
<ElementRegions>
<CellElementRegion
(continues on next page)
aquiferBottom01, aquiferBottom21, ␣
˓→aquiferBottom41,
Defining these element regions allows the flow solver to be applied only to the top and bottom aquifers (and wells),
since we follow the approach of (Class et al., 2009) and do not simulate flow in the aquitard, as we will see in the next
section.
ò Note
Since the two aquifer regions share the same material properties, they could have been defined as a single
CellElementRegion for a more concise XML file producing the same results. The same is true for the two
well regions.
Flow solver
The isothermal immiscible simulation is performed by the GEOS general-purpose multiphase flow solver based on a
TPFA discretization defined in the XML block CompositionalMultiphaseFVM:
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
(continues on next page)
We use the targetRegions attribute to define the regions where the flow solver is applied. Here, we follow the
approach described in (Class et al., 2009) and do not simulate flow in the aquitard, considered as impermeable to flow.
We only simulate flow in the two aquifers (aquiferTop and aquiferBottom), in the bottom part of the injection well
(injectionWell), and in the leaky well connecting the two aquifers (leakyWell).
Constitutive laws
This benchmark test involves an immiscible, incompressible, two-phase model. The best approach to represent this fluid
behavior in GEOS is to use the DeadOilFluid model, although this model was initially developed for simple isothermal
oil-water or oil-gas systems (note that this is also the approach used for the Eclipse simulator, as documented in (Class
et al., 2009)).
<DeadOilFluid
name="fluid"
phaseNames="{ oil, water }"
surfaceDensities="{ 479.0, 1045.0 }"
componentMolarWeight="{ 114e-3, 18e-3 }"
hydrocarbonFormationVolFactorTableNames="{ B_o_table }"
hydrocarbonViscosityTableNames="{ visc_o_table }"
waterReferencePressure="1e7"
waterFormationVolumeFactor="1.0"
waterCompressibility="1e-15"
waterViscosity="2.535e-4"/>
The fluid properties (constant densities and constant viscosities) are those given in the article documenting the bench-
mark. To define an incompressible fluid, we set all the formation volume factors to 1.
The rock model defines an incompressible porous medium with a porosity equal to 0.15. The relative permeability
model is linear. Capillary pressure is neglected.
The domain is initially saturated with brine with a hydrostatic pressure field. This is specified using the Hydrostat-
icEquilibrium XML tag in the FieldSpecifications block. The datum pressure and elevation used below are defined
in (Class et al., 2009)).
<HydrostaticEquilibrium
name="equil"
objectPath="ElementRegions"
datumElevation="-3000"
datumPressure="3.086e7"
initialPhaseName="water"
componentNames="{ oil, water }"
componentFractionVsElevationTableNames="{ initOilCompFracTable,
initWaterCompFracTable }"
temperatureVsElevationTableName="initTempTable"/>
In the Functions block, the TableFunction s named initOilCompFracTable and initWaterCompFracTable de-
fine the brine-saturated initial state, while the TableFunction named initTempTable defines the homogeneous tem-
perature field (temperature is not used in this benchmark).
Since the fluid densities are constant for this simple incompressible fluid model, the same result could have been
achieved using a simpler table in a FieldSpecification tag, as explained in Hydrostatic Equilibrium Initial Condition.
To impose the Dirichlet boundary conditions on the four sides of the aquifers, we use this simple table-based approach
as shown below:
<FieldSpecification
name="bcPressureAquiferBottom"
objectPath="ElementRegions/aquiferBottom"
setNames="{ east, west, south, north }"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
<FieldSpecification
name="bcPressureAquiferTop"
objectPath="ElementRegions/aquiferTop"
setNames="{ east, west, south, north }"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
<FieldSpecification
name="bcCompositionOilAquiferBottom"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/aquiferBottom"
fieldName="globalCompFraction"
component="0"
scale="0.000001"/>
<FieldSpecification
name="bcCompositionOilAquiferTop"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/aquiferTop"
fieldName="globalCompFraction"
component="0"
scale="0.000001"/>
<FieldSpecification
name="bcCompositionWaterAquiferBottom"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/aquiferBottom"
fieldName="globalCompFraction"
(continues on next page)
where the setNames = "{ east, west, south, north }" are defined using the Box XML tags of the Geometry
section, and where the tables are defined as TableFunction in the Functions section.
To reproduce the behavior of a rate-controlled well, we use the SourceFlux tag on the source set (located in the
injectionWell cell element region), with the injection rate specified in the benchmark description (8.87 kg/s):
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/injectionWell"
component="0"
scale="-8.87"
setNames="{ source }"/>
ò Note
If the setNames attribute of SourceFlux contains multiple cells (which is the case here), then the amount injected
in each cell is equal to the total injection rate (specified with scale) divided by the number of cells.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of CO2 saturation and pressure along the slice defined by x = 0 at t = 200 days.
To validate the GEOS results, we consider the metrics used in (Class et al., 2009).
First, we consider the arrival time of the CO2 plume at the leaky well. As in (Class et al., 2009), we use the leakage rate
threshold of 0.005% to detect the arrival time. Although the arrival time is highly dependent on the degree of spatial
refinement in the vicinity of the wells (not documented in (Class et al., 2009)), the next table shows that the GEOS
arrival time at the leaky well (9.6 days) is in agreement with the values published in (Class et al., 2009).
ò Note
The time-stepping strategy used by the codes considered in (Class et al., 2009), as well as the meshes that have
been used, are not documented in the benchmark description. Therefore, even on this simple test case, we cannot
expect to obtain an exact match with the published results.
Next, we measure the CO2 leakage rate through the leaky well, defined by the authors as the CO2 mass flow at midway
between top and bottom aquifers divided by the injection rate (8.87 kg/s), in percent. The GEOS leakage rate is shown
in the figure below:
The leakage rates computed by the codes considered in (Class et al., 2009) are shown in the figure below.
The comparison between the previous two figures shows that GEOS can successfully reproduce the trend in leakage
rate observed in the published benchmark results. To further validate the GEOS results, we reproduce below Table 8
of (Class et al., 2009) to compare the maximum leakage rate, the time at which this maximum leakage rate is attained,
and the leakage rate at 1000 days.
Code Max leakage [%] Time at max leakage [day] Leakage at 1000 days [%]
GEOSX 0.219 50.6 0.1172
COORES 0.219 50 0.146
DuMux 0.220 61 0.128
ECLIPSE 0.225 48 0.118
FEHM 0.216 53 0.119
IPARS-CO2 0.242 80 0.120
MUFTE 0.222 58 0.126
RockFlow 0.220 74 0.132
ELSA 0.231 63 0.109
TOUGH2/ECO2N 0.226 93 0.110
TOUGH2/ECO2N (2) 0.212 46 0.115
TOUGH2 (3) 0.227 89 0.112
VESA 0.227 41 0.120
This table confirms the agreement between GEOS and the results of (Class et al., 2009). A particularly good match is
obtained with Eclipse, FEHM, and TOUGH2/ECO2N (2).
0.25
ECLIPSE
TOUGH2
GEOSX
0.20
Leakage value [%]
0.15
0.10
0.05
0.00
0 200 400 600 800 1000
Time [days]
Fig. 1.8: Leakage rates [%] obtained with the simulators considered in (Class et al., 2009).
To go further
The more complex, non-isothermal version of this test is in Non-isothermal CO2 Plume Evolution and Leakage Through
an Abandoned Well.
Feedback on this example
For any feedback on this example, please submit a GitHub issue on the project’s GitHub page.
Context
This validation case is a more complex version of the benchmark problem presented in CO2 Plume Evolution and
Leakage Through an Abandoned Well. While the latter is based on simple isothermal and immiscible fluid properties,
the present validation case relies on a more realistic fluid behavior accounting for thermal effects and mass exchange
between phases. This non-isothermal benchmark test has been used in (Class et al., 2009) to compare different imple-
mentations of CO2-brine fluid properties in the context of CO2 injection and storage in saline aquifers.
Our goal is to review the sections of the XML file that are used to parameterize the CO2-brine fluid behavior, and to
demonstrate that GEOS produces similar results as those presented in (Class et al., 2009).
Input file
This benchmark test is based on the XML file located below:
inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_
˓→benchmark.xml
Problem description
Some of the text below is adapted from (Ebigbo, Class, Helmig, 2007).
The benchmark scenario remains the same as in CO2 Plume Evolution and Leakage Through an Abandoned Well. CO2
is injected into an aquifer, spreads within the aquifer, and, upon reaching a leaky well, rises up to a shallower aquifer.
The model domain still has the dimensions: 1000 x 1000 x 160 m, but it is now assumed to be shallower, between 640
m and 800 m of depth.
The figure below shows the pressure and temperature in the formation at the mentioned depths (assuming a geothermal
gradient of 0.03 K/m). The conditions in the aquifer at the considered depths range from supercritical to liquid to
gaseous. The figure also shows the CO2 density at the conditions of the formation. There is a large change in density at
a certain depth. This depth corresponds to the point where the line depicting the formation conditions crosses the CO2
saturation vapor curve, that is, the boundary between liquid and gaseous CO2. Other fluid properties such as viscosity
also change abruptly at that depth.
Therefore, as explained later, we use a more sophisticated fluid model in which the CO2 and brine fluid properties are
now a function of the aquifer conditions, such as pressure, temperature, and salinity. Specifically:
• The CO2 component is present in the CO2-rich phase but can also dissolve in the brine phase. The amount of
dissolved CO2 depends on pressure, temperature, and salinity. For now, in GEOS, the water component cannot
be present in the CO2-rich phase.
• Densities and viscosities depend nonlinearly on pressure, temperature, and salinity.
• The hydrostatic initial condition accounts for the geothermal gradient of 0.03 K/m specified in the benchmark
description.
We plan to use two types of physical models in this benchmark:
• A model simulating flow and mass transfer, but not heat transfer (i.e., no energy balance is used). The geothermal
gradient is constant in time, and is taken into account in the calculation of temperature-dependent properties.
Fig. 1.9: Aquifer conditions (image taken from (Ebigbo, Class, Helmig, 2007)).
• A fully thermal model simulating flow as well as mass and heat transfer. The results obtained with this more
complex model are not available yet and will be added to this page later.
As illustrated by the ECLIPSE results in (Class et al., 2009), the leakage rate exhibits a high dependence on the degree
of spatial refinement (particularly between the two wells in our observations). Therefore, we consider two meshes in
this test case:
• A “coarse” mesh with 206070 cells, whose spatial resolution is similar to that used by most codes based on the
information provided by Table 13 of (Class et al., 2009).
• A “fine” mesh with 339390 cells, whose spatial resolution is finer between the two wells.
These structured meshes are defined as in CO2 Plume Evolution and Leakage Through an Abandoned Well, as shown
next for the “fine” mesh.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ -500, -0.1329, 0.1329, 99.8671, 100.1329, 500 }"
yCoords="{ -500, -0.1329, 0.1329, 500 }"
zCoords="{ -800, -770, -670, -640 }"
nx="{ 50, 1, 20, 1, 40 }"
ny="{ 50, 1, 50 }"
nz="{ 20, 30, 10 }"
cellBlockNames="{ aquiferBottom00, aquiferBottom10, aquiferBottom20,␣
˓→aquiferBottom30, aquiferBottom40,
As in the previous benchmark, we define four element regions whose material list now includes the name of the cap-
illary pressure constitutive model (cappres). We refer the reader to CO2 Plume Evolution and Leakage Through an
Abandoned Well for an example of this procedure.
Flow solver
Although the fluid behavior is significantly different from that of the previous benchmark, we still use the GEOS
general-purpose multiphase flow solver defined in the XML block CompositionalMultiphaseFVM:
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
discretization="fluidTPFA"
temperature="307.15"
initialDt="1"
useMass="1"
targetRegions="{ aquiferTop, aquiferBottom, injectionWell, leakyWell }">
<NonlinearSolverParameters
newtonTol="1.0e-3"
newtonMaxIter="20"
timeStepIncreaseIterLimit="0.5"
timeStepDecreaseIterLimit="0.9"
maxTimeStepCuts="5"
lineSearchAction="Attempt"/>
<LinearSolverParameters
solverType="fgmres"
preconditionerType="mgr"
krylovTol="1e-4"/>
</CompositionalMultiphaseFVM>
</Solvers>
ò Note
The attribute temperature listed above is mandatory, but are overridden by GEOS to impose a non-uniform
geothermal gradient along the z-axis, as we will see later.
Constitutive models
The Brooks-Corey relative permeabilities and capillary pressure are described using tables constructed from the pa-
rameters values provided in the benchmark description, with a wetting-phase saturation range between 0.2 and 0.95,
an entry pressure of 10000 Pa, and a Brooks-Corey parameter of 2. We refer the reader to the files used in the Table-
Function listed below for the exact values that we have used:
<TableRelativePermeability
name="relperm"
phaseNames="{ gas, water }"
wettingNonWettingRelPermTableNames="{ waterRelativePermeabilityTable,
gasRelativePermeabilityTable }"/>
<TableCapillaryPressure
name="cappres"
phaseNames="{ gas, water }"
wettingNonWettingCapPressureTableName="waterCapillaryPressureTable"/>
The two-phase, two-component CO2-brine model implemented in GEOS is parameterized in the CO2BrinePhillips
XML block:
<CO2BrinePhillipsFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
flashModelParaFile="co2flash.txt"/>
The components of this fluid model are described in detail in the CO2-brine model and are briefly summarized below.
They are parameterized using three parameter files that must be written carefully to obtain the desired behavior, as
explained next.
These properties are obtained using the models proposed by Span and Wagner (1996) and Fenghour and Wakeham
(1998) for density and viscosity, respectively. The density and viscosity values are internally tabulated by GEOS at the
beginning of the simulation by solving the Helmholtz energy equation for each pair (𝑝, 𝑇 ).
The tables size and spacing are specified in the file pvtgas.txt. Here, for both quantities, the values are tabulated between
6.6e6 Pa and 4e7 Pa, with a pressure spacing of 1e6 Pa, and between 302 K and 312 K, with a temperature increment
of 5 K. These values have been chosen using the initial condition and an upper bound on the expected pressure increase
during the simulation.
ò Note
If pressure or temperature go outside the values specified in this parameter file, constant extrapolation is used to
obtain the density and viscosity values. Note that for now, no warning is issued by GEOS when this happens. We
plan to add a warning message to document this behavior in the near future.
These properties depend on pressure, temperature, composition, and salinity via the models proposed by Phillips et
al. (1981). The brine density is modified to account for the presence of dissolved CO2 using the method proposed by
Garcia (2001). The values of (pure) brine density are also tabulated at a function of pressure and temperature, and we
use the same range as for the CO2 properties to construct this table:
Importantly, the last value on each line in the file pvtliquid.txt defines the salinity in the domain. In our model, salinity
is constant in space and in time (i.e., unlike water and CO2, it is not tracked as a component in GEOS). In our model,
salinity is specified as a molal concentration in mole of NaCl per kg of solvent (brine). The value used here (1000 x 10
/ ( 58.44 x ( 100 - 10 ) ) = 1.901285269 moles/kg) is chosen to match the value specified in the benchmark (weight%
of 10%).
As explained in CO2-brine model, we use the highly nonlinear model proposed by Duan and Sun (2004) to compute
the CO2 solubility as a function of pressure, temperature, composition, and salinity. In co2flash.txt, we use the same
parameters as above to construct the pressure-temperature tables of precomputed CO2 solubility in brine.
The domain is initially saturated with brine with a hydrostatic pressure field and a geothermal gradient of 0.03 K/m.
This is specified using the HydrostaticEquilibrium XML tag in the FieldSpecifications block:
<HydrostaticEquilibrium
name="equil"
objectPath="ElementRegions"
datumElevation="-800"
datumPressure="8.499e6"
initialPhaseName="water"
componentNames="{ co2, water }"
componentFractionVsElevationTableNames="{ initCO2CompFracTable,
initWaterCompFracTable }"
temperatureVsElevationTableName="initTempTable"/>
Although this is the same block as in CO2 Plume Evolution and Leakage Through an Abandoned Well, GEOS is now
enforcing the geothermal gradient specified in the TableFunction named initTempTable, and is also accounting for
the nonlinear temperature dependence of brine density to equilibrate the pressure field.
We use the simple table-based approach shown below to impose the Dirichlet boundary conditions on the four sides of
the domain.
<FieldSpecification
name="bcPressureAquiferBottom"
objectPath="ElementRegions/aquiferBottom"
setNames="{ east, west, south, north }"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
(continues on next page)
<FieldSpecification
name="bcPressureAquiferTop"
objectPath="ElementRegions/aquiferTop"
setNames="{ east, west, south, north }"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
<FieldSpecification
name="bcTemperatureAquiferTop"
objectPath="ElementRegions/aquiferTop"
setNames="{ east, west, south, north }"
fieldName="temperature"
functionName="initTempTable"
scale="1"/>
<FieldSpecification
name="bcCompositionCO2AquiferTop"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/aquiferTop"
fieldName="globalCompFraction"
component="0"
scale="0.000001"/>
<FieldSpecification
name="bcCompositionWaterAquiferTop"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/aquiferTop"
fieldName="globalCompFraction"
component="1"
scale="0.999999"/>
<FieldSpecification
(continues on next page)
<FieldSpecification
name="bcPressureInjectionWell"
objectPath="ElementRegions/injectionWell"
setNames="{ east, west, south, north }"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
<FieldSpecification
name="bcTemperatureInjectionWell"
objectPath="ElementRegions/injectionWell"
setNames="{ east, west, south, north }"
fieldName="temperature"
functionName="initTempTable"
scale="1"/>
<FieldSpecification
name="bcCompositionCO2InjectionWell"
setNames="{ east, west, south, north }"
objectPath="ElementRegions/injectionWell"
fieldName="globalCompFraction"
component="0"
scale="0.000001"/>
<FieldSpecification
name="bcCompositionWaterInjectionWell"
setNames="{ east, west, south, north }"
(continues on next page)
where the setNames = "{ east, west, south, north }" are defined using the Box XML tags of the Geometry
section, and where the tables are defined as TableFunction in the Functions section.
ò Note
Due to the nonlinear dependence of brine density on temperature, this block does not exactly impose a Dirichlet
pressure equal to the initial condition. Instead, here, we impose a linear pressure gradient along the z-axis, whose
minimum and maximum values are the same as in the initial state. We could have imposed Dirichlet boundary
conditions preserving the initial condition using as many points in zlin.geos as there are cells along the z-axis
(instead of just two points).
The SourceFlux is the same as in the previous benchmark case (see CO2 Plume Evolution and Leakage Through an
Abandoned Well).
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figures show the distribu-
tion of CO2 saturation and pressure along the slice defined by x = 0 at t = 1,000 days.
To validate the GEOS results, we consider the metrics used in (Class et al., 2009) as previously done in CO2 Plume
Evolution and Leakage Through an Abandoned Well.
First, we consider the arrival time of the CO2 plume at the leaky well. As in (Class et al., 2009), we use the leakage rate
threshold of 0.005% to detect the arrival time. In our numerical tests, the arrival time is highly dependent on the degree
of spatial refinement in the vicinity of the wells and on the time step size, but these parameters are not documented in
(Class et al., 2009). The next table reports the GEOS arrival time at the leaky well and compares it with the values
published in (Class et al., 2009).
ò Note
In the table above, we only included the values obtained with the codes that do not solve an energy balance equation.
The values obtained with the fully thermal codes (FEHM, MUFTE, and RTAFF2) are omitted for now.
Next, we measure the CO2 leakage rate through the leaky well, defined by the authors as the CO2 mass flow at midway
between top and bottom aquifers divided by the injection rate (8.87 kg/s), in percent. The GEOS leakage rate is shown
in the figure below:
We see that GEOS produces a reasonable match with the numerical codes considered in the study. Although it is not
possible to exactly match the published results (due to the lack of information on the problem, such as mesh refinement
and time step size), GEOS reproduces well the trend exhibited by the other codes.
For reference, we include below the original figure from (Class et al., 2009) containing all the results, including those
obtained with the codes solving an energy equation.
To further validate the GEOS results, we reproduce below Table 9 of (Class et al., 2009) (only considering codes that
do not solve an energy equation) to compare the maximum leakage rate, the time at which this maximum leakage rate is
attained, and the leakage rate at 2000 days. We observe that the GEOS values are in the same range as those considered
in the benchmark.
0.14
0.12
0.10
Leakage value [%]
0.08
0.06
ROCKFLOW
ECLIPSE (FINE)
0.04 ECLIPSE (COARSE)
COORES
0.02 TOUGH2
GEOSX (FINE)
GEOSX (COARSE)
0.00
0 250 500 750 1000 1250 1500 1750 2000
Time [days]
Fig. 1.12: Leakage rates [%] obtained with the simulators considered in (Class et al., 2009).
This table confirms the agreement between GEOS and the results of (Class et al., 2009).
To go further
Context
We consider a benchmark problem used in (Class et al., 2009) to compare a number of numerical models applied to CO2
storage in geological formations. Using a simplified miscible two-phase setup, this test case illustrates the modeling of
solubility trapping (with CO2 dissolution in brine) and residual trapping (with gas relative permeability hysteresis) in
CO2-brine systems.
Our goal is to review the different sections of the XML file reproducing the benchmark configuration and to demonstrate
that the GEOS results (i.e., mass of CO2 dissolved and mobile for both hysteretic and non-hysteretic configurations)
are in agreement with the reference results published in (Class et al., 2009) Problems 3.1 and 3.2.
Input file
This benchmark test is based on the XML file located below:
../../../../../../../inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/
˓→class09_pb3_smoke_3d.xml
../../../../../../../inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/
˓→class09_pb3_drainageOnly_iterative_base.xml
Problem description
The following text is adapted from the detailed description of the benchmark test case presented in (Class et al., 2009).
The setup is illustrated in the figure below. The mesh can be found in GEOSDATA and was provided for the benchmark.
It discretizes the widely-used Johansen reservoir, which consists in a tilted reservoir with a main fault. The model
domain has the following dimensions: 9600 x 8900 x [90-140] m. Both porosity and permeability are heterogeneous
and given at vertices. A single CO2 injection well is located at (x,y) = (5440,3300) m with perforations only in the
bottom 50 m of the reservoir. The injection takes place during the first 25 years of the 50-year simulation at the constant
rate of 15 kg/s. A hydrostatic pressure gradient is imposed on the boundary faces as well as a constant geothermal
gradient of 0.03 K/m.
The proposed conforming discretization is fully hexahedral. A VTK filter PointToCell is used to map properties from
vertices to cells, which by default builds a uniform average of values over the cell. The structured mesh is generated
using some helpers python scripts from the formatted Point/Cells list provided. It is then imported using meshImport
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 5240, 5640 }"
yCoords="{ 3100, 3500 }"
zCoords="{ -3000, -2950 }"
nx="{ 5 }"
ny="{ 5 }"
nz="{ 5 }"
cellBlockNames="{ 1_hexahedra }">
<InternalWell
name="wellInjector1"
wellRegionName="wellRegion"
wellControlsName="wellControls"
logLevel="1"
polylineNodeCoords="{ { 5440.0, 3300.0, -2950.0 },
{ 5440.0, 3300.0, -3000.00 } }"
polylineSegmentConn="{ { 0, 1 } }"
radius="0.1"
numElementsPerSegment="5">
<Perforation
name="injector1_perf1"
distanceFromHead="45"/>
<Perforation
name="injector1_perf2"
distanceFromHead="35"/>
<Perforation
name="injector1_perf3"
distanceFromHead="25"/>
<Perforation
name="injector1_perf4"
distanceFromHead="15"/>
<Perforation
name="injector1_perf5"
distanceFromHead="5"/>
</InternalWell>
</InternalMesh>
</Mesh>
The central wellbore is discretized internally by GEOS (see CO 2 Injection). It includes five segments with a perfo-
ration in each segment. It has its own region wellRegion and control labeled wellControls defined and detailed
respectively in ElementRegions and Solvers (see below). In the ElementRegions block,
<ElementRegions>
<CellElementRegion
name="reservoir"
cellBlocks="{ * }"
materialList="{ fluid, rock, relperm, cappres }"/>
<WellElementRegion
name="wellRegion"
materialList="{ fluid, relperm, cappres }"/>
</ElementRegions>
one single reservoir region labeled reservoir. A second region wellRegion is associated with the well. All those
regions define materials to be specified inside the Constitutive block.
Coupled solver
The simulation is performed by the GEOS coupled solver for multiphase flow and well defined in the XML block
CompositionalMultiphaseReservoir:
<CompositionalMultiphaseFVM
name="compositionalMultiphaseFlow"
targetRegions="{ reservoir }"
discretization="fluidTPFA"
temperature="363"
maxCompFractionChange="0.2"
logLevel="1"
useMass="1"/>
It references the two coupled solvers under the tags flowSolverName and wellSolverName. These are defined inside
the same Solvers block following this coupled solver. It also defined non-linear, NonlinearSolverParameters and and
linear, LinearSolverParameters, strategies.
The next two blocks are used to define our two coupled physics solvers compositionalMultiphaseFlow (of type
CompositionalMultiphaseFVM) and compositionalMultiphaseWell (of type CompositionalMultiphaseWell).
Flow solver
We use the targetRegions attribute to define the regions where the flow solver is applied.
<CompositionalMultiphaseReservoir
name="coupledFlowAndWells"
flowSolverName="compositionalMultiphaseFlow"
wellSolverName="compositionalMultiphaseWell"
logLevel="1"
initialDt="1e2"
targetRegions="{ reservoir, wellRegion }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="40"/>
<LinearSolverParameters
solverType="fgmres"
(continues on next page)
The FV scheme discretization used is TPFA (which definition can be found nested in NumericalMeth-
ods/FiniteVolume) and some parameter values.
Well solver
The well solver is applied on its own region wellRegion which consists of the five discretized segments. It is also
the place where the WellControls are set thanks to type, control, injectionStream , injectionTemperature,
targetTotalRateTableName and, targetBHP for instance if we consider an injection well.
For more details on the wellbore modeling please refer to Compositional Multiphase Well Solver.
<CompositionalMultiphaseWell
name="compositionalMultiphaseWell"
targetRegions="{ wellRegion }"
logLevel="1"
useMass="1">
<WellControls
name="wellControls"
logLevel="1"
type="injector"
control="totalVolRate"
referenceElevation="-3000"
targetBHP="1e8"
enableCrossflow="0"
useSurfaceConditions="1"
surfacePressure="101325"
surfaceTemperature="288.71"
targetTotalRateTableName="totalRateTable"
injectionTemperature="353.15"
injectionStream="{ 1.0, 0.0 }"/>
<WellControls
name="MAX_MASS_INJ"
logLevel="1"
type="injector"
control="massRate"
referenceElevation="-3000"
targetBHP="1e8"
enableCrossflow="0"
useSurfaceConditions="1"
surfacePressure="101325"
surfaceTemperature="288.71"
targetMassRate="15"
injectionTemperature="353.15"
injectionStream="{ 1.0, 0.0 }"/>
<WellControls
name="MAX_MASS_INJ_TABLE"
logLevel="1"
type="injector"
(continues on next page)
Constitutive laws
This benchmark test involves a compositional mixture that defines two phases (CO2-rich and aqueous) labeled as gas
and water which contain two components co2 and water. The miscibility of CO2 results in the presence of CO2 in
the aqueous phase. The vaporization of H2O in the CO2-rich phase is not considered here.
<CO2BrineEzrokhiFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ tables/pvtgas.txt, tables/pvtliquid_ez.txt }"
flashModelParaFile="tables/co2flash.txt"/>
The brine properties are modeled using Ezrokhi correlation, hence the block name CO2BrineEzrokhiFluid. The
external PVT files tables/pvtgas.txt and tables/pvtliquid_ex.txt give access to the models considered respectively for
the computation of gas density and viscosity and the brine density and viscosity, along with pressure, temperature,
salinity discretization of the parameter space. The external file tables/co2flash.txt gives the same type of information
for the CO2Solubility model (see CO2-brine model for details).
The rock model defines a slightly compressible porous medium with a reference porosity equal to 0.1.
<CompressibleSolidConstantPermeability
name="rock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="rockPorosity"
defaultReferencePorosity="0.1"
referencePressure="1.0e7"
compressibility="4.5e-10"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-12, 1.0e-12, 1.0e-12 }"/>
The relative permeability model is input through tables thanks to TableRelativePermeability block.
<TableRelativePermeability
name="relperm"
phaseNames="{ gas, water }"
wettingNonWettingRelPermTableNames="{ waterRelativePermeabilityTable,
gasRelativePermeabilityTable }"/>
As this benchmark is testing the sensitivity of the plume dynamics to the relative permeability hysteresis model-
ing, in commented block the TableRelativePermeabilityHysteresis block sets up bounding curves for imbibition
and drainage under imbibitionNonWettingRelPermTableName, imbibitionWettingRelPermTableName and,
drainageWettingNonWettingRelPermTableNames compared to the wettingNonWettingRelPermTableNames
label of the drainage only TableRelativePermeability blocks. Those link to TableFunction blocks in Functions,
which define sample points for piecewise linear interpolation. This feature is used and explained in more details in the
following section dedicated to Initial and Boundary conditions.
See,
../../../../../../../inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/
˓→class09_pb3_hystRelperm_iterative_base.xml
<TableRelativePermeabilityHysteresis
name="relperm"
phaseNames="{ gas, water }"
drainageWettingNonWettingRelPermTableNames="{␣
˓→drainageWaterRelativePermeabilityTable,
drainageGasRelativePermeabilityTable }"
imbibitionNonWettingRelPermTableName="imbibitionGasRelativePermeabilityTable"
imbibitionWettingRelPermTableName="imbibitionWaterRelativePermeabilityTable"/>
ò Note
Capillary pressure is also tabulated and defined in TableCapillaryPressure. No hysteresis is modeled yet on the
capillary pressure.
<TableCapillaryPressure
name="cappres"
phaseNames="{ gas, water }"
wettingNonWettingCapPressureTableName="waterCapillaryPressureTable"/>
The domain is initially saturated with brine with a hydrostatic pressure field. This is specified using the Hydrostat-
icEquilibrium XML tag in the FieldSpecifications block. The datum pressure and elevation used below are defined
in (Class et al., 2009)).
<HydrostaticEquilibrium
name="equil"
(continues on next page)
In the Functions block, the TableFunction s named initCO2CompFracTable and initWaterCompFracTable de-
fine the brine-saturated initial state, while the TableFunction named initTempTable defines the temperature field as
a function of depth to impose the geothermal gradient.
The boundaries are set to have a constant 0.03 K/m temperature gradient as well as the hydrostatic pressure gradient.
We supplement that with water dominant content. Each block is linking a fieldName to a TableFunction tagged
as the value of functionName. In order to have those imposed on the boundary faces, we provide faceManager as
objectPath.
<FieldSpecification
name="bcPressure"
objectPath="faceManager"
setNames="{3}"
fieldName="pressure"
functionName="pressureFunction"
scale="1"/>
<FieldSpecification
name="bcTemperature"
objectPath="faceManager"
setNames="{3}"
fieldName="temperature"
functionName="temperatureFunction"
scale="1"/>
<FieldSpecification
name="bcCompositionCO2"
objectPath="faceManager"
setNames="{3}"
fieldName="globalCompFraction"
component="0"
scale="0.000001"/>
<FieldSpecification
name="bcCompositionWater"
objectPath="faceManager"
setNames="{3}"
fieldName="globalCompFraction"
component="1"
scale="0.999999"/>
In order to output partitioning of CO2 mass, we use reservoir statistics implemented in GEOS. This is done by defining
a Task, with flowSolverName pointing to the dedicated solver and computeRegionStatistics set to 1 to compute
statistics by regions. The setNames field is set to 3 as it is its attribute tag in the input vtu mesh.
<CompositionalMultiphaseStatistics
name="compflowStatistics"
flowSolverName="compositionalMultiphaseFlow"
logLevel="1"
computeCFLNumbers="1"
computeRegionStatistics="1"/>
and an Event for this to occur recursively with a forceDt argument for the period over which statistics are output and
target pointing towards the aforementioned Task.
<PeriodicEvent
name="statistics"
timeFrequency="1e5"
target="/Tasks/compflowStatistics"/>
ò Note
The log file mentioned above could be an explicit printout of the stdio from MPI launch or the autogenerated output
from a SLURM job slurm.out or similar
Inspecting results
We request VTK-format output files and use Paraview to visualize the results under the Outputs block.
The following figure shows the distribution of CO2 saturation thresholded above a significant value (here 0.001). The
displayed cells are colored with respect to the CO2 mass they contain. If the relative permeability for the gas phase
drops below 10e-7, the cell is displayed in black.
Fig. 1.13: Plume of CO2 saturation for significant value where immobile CO2 is colored in black.
We observe the importance of hysteresis modeling in CO2 plume migration. Indeed, during the migration phase, the
cells at the tail of the plume are switching from drainage to imbibition and the residual CO2 is trapped. This results in
a slower migration and expansion of the plume.
To validate the GEOS results, we consider the metrics used in (Class et al., 2009). The reporting values are the dis-
solved and gaseous CO2 with respect to time using only the drainage relative permeability and using hysteretic relative
permeabilities.
Fig. 1.14: CO2 mass in aqueous and CO2-rich phases as a function of without relative permeability hysteresis
We can see that at the end of the injection period the mass of CO2 in the gaseous phase stops increasing and starts
decreasing due to dissolution of CO2 in the brine phase. These curves confirm the agreement between GEOS and the
results of (Class et al., 2009).
To go further
Objectives
At the end of this example you will know:
• how to define fractures in a porous medium,
Fig. 1.15: CO2 mass in aqueous and CO2-rich phases as a function of time with relative permeability hysteresis
• how to use various solvers (EmbeddedFractures, LagrangianContact and HydroFracture) to solve the mechanics
problems with fractures.
Input file
This example uses no external input files and everything required is contained within GEOS input files.
The xml input files for the case with EmbeddedFractures solver are located at:
inputFiles/efemFractureMechanics/Sneddon_embeddedFrac_base.xml
inputFiles/efemFractureMechanics/Sneddon_embeddedFrac_verification.xml
The xml input files for the case with LagrangianContact solver are located at:
inputFiles/lagrangianContactMechanics/Sneddon_base.xml
inputFiles/lagrangianContactMechanics/Sneddon_benchmark.xml
inputFiles/lagrangianContactMechanics/ContactMechanics_Sneddon_benchmark.xml
The xml input files for the case with HydroFracture solver are located at:
inputFiles/hydraulicFracturing/Sneddon_hydroFrac_base.xml
inputFiles/hydraulicFracturing/Sneddon_hydroFrac_benchmark.xml
We compute the displacement field induced by the presence of a pressurized fracture, of length 𝐿𝑓 , in a porous medium.
GEOS will calculate the displacement field in the porous matrix and the displacement jump at the fracture surface. We
will use the analytical solution for the fracture aperture, 𝑤𝑛 (normal component of the jump), to verify the numerical
results
√︃
2
4(1 − 𝜈 )𝑝𝑓 𝐿2𝑓
𝑤𝑛 (𝑠) = − 𝑠2
𝐸 4
where - 𝐸 is the Young’s modulus - 𝜈 is the Poisson’s ratio - 𝑝𝑓 is the fracture pressure - 𝑠 is the local fracture coordinate
𝐿 𝐿
in [− 2𝑓 , 2𝑓 ]
In this example, we focus our attention on the Solvers, the ElementRegions, and the Geometry tags.
Mechanics solver
To define a mechanics solver capable of including embedded fractures, we will define two solvers:
• a SolidMechanicsEmbeddedFractures solver, called mechSolve
• a small-strain Lagrangian mechanics solver, of type SolidMechanicsLagrangianSSLE called here
matrixSolver (see: Solid Mechanics Solver)
Note that the name attribute of these solvers is chosen by the user and is not imposed by GEOS. It is important to make
sure that the solidSolverName specified in the embedded fractures solver corresponds to the small-strain Lagrangian
solver used in the matrix.
The two single-physics solvers are parameterized as explained in their respective documentation, each with their own
tolerances, verbosity levels, target regions, and other solver-specific attributes.
Additionally, we need to specify another solver of type, EmbeddedSurfaceGenerator, which is used to discretize the
fracture planes.
<SolidMechanicsEmbeddedFractures
name="mechSolve"
targetRegions="{ Domain, Fracture }"
initialDt="10"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="1"
contactPenaltyStiffness="0.0e8">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="2"
maxTimeStepCuts="1"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="mgr"
logLevel="0"/>
</SolidMechanicsEmbeddedFractures>
<EmbeddedSurfaceGenerator
name="SurfaceGenerator"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
fractureRegion="Fracture"
targetObjects="{ FracturePlane }"
logLevel="1"
mpiCommOrder="1"/>
</Solvers>
To setup a coupling between rock and fracture deformations in LagrangianContact solver, we define three different
solvers:
• For solving the frictional contact, we define a Lagrangian contact solver, called here lagrangiancontact. In
this solver, we specify targetRegions that include both the continuum region Region and the discontinuum
region Fracture where the solver is applied to couple rock and fracture deformations. The contact constitutive
law used for the fracture elements is named fractureMaterial, and is defined later in the Constitutive
section.
• Rock deformations are handled by a solid mechanics solver SolidMechanicsLagrangianSSLE. The problem
runs in QuasiStatic mode without inertial effects. The computational domain is discretized by FE1, which is
defined in the NumericalMethods section. The solid material is named rock and its mechanical properties are
specified later in the Constitutive section.
• The solver SurfaceGenerator defines the fracture region and rock toughness.
<SolidMechanicsLagrangeContact
name="lagrangiancontact"
timeIntegrationOption="QuasiStatic"
stabilizationName="TPFAstabilization"
logLevel="1"
discretization="FE1"
targetRegions="{ Region, Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
logLevel="2"
(continues on next page)
Three elementary solvers are combined in the solver Hydrofracture to model the coupling between fluid flow within
the fracture, rock deformation, fracture opening/closure and propagation:
• Rock and fracture deformation are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE.
In this solver, we define targetRegions that includes both the continuum region and the fracture region. The
name of the contact constitutive behavior is also specified in this solver by the contactRelationName, besides
the solidMaterialNames.
• The single phase fluid flow inside the fracture is solved by the finite volume method in the solver
SinglePhaseFVM.
• The solver SurfaceGenerator defines the fracture region and rock toughness.
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="2">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="20"
lineSearchMaxCuts="3"/>
<LinearSolverParameters
directParallel="0"/>
</Hydrofracture>
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1.0e0"/>
<SinglePhaseFVM
name="SinglePhaseFlow"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }"/>
Events
For the case with EmbeddedFractures solver, we add multiple events defining solver applications:
• an event specifying the execution of the EmbeddedSurfaceGenerator to generate the fracture elements.
• a periodic event specifying the execution of the embedded fractures solver.
• three periodic events specifying the output of simulations results.
<Events
maxTime="1.0">
<SoloEvent
name="preFracture"
target="/Solvers/SurfaceGenerator"/>
<PeriodicEvent
name="solverApplications"
beginTime="0.0"
endTime="1.0"
forceDt="1.0"
target="/Solvers/mechSolve"/>
<PeriodicEvent
name="outputs"
targetExactTimestep="0"
target="/Outputs/vtkOutput"/>
<PeriodicEvent
name="timeHistoryCollection"
timeFrequency="1.0"
targetExactTimestep="0"
target="/Tasks/displacementJumpCollection" />
<PeriodicEvent
name="timeHistoryOutput"
timeFrequency="1.0"
targetExactTimestep="0"
target="/Outputs/timeHistoryOutput"/>
</Events>
Last, let us take a closer look at the geometry of this simple problem, if using EmbeddedFractures solver. We use the
internal mesh generator to create a large domain (40 𝑚 × 40 𝑚 × 1 𝑚), with one single element along the Z axes, 121
elements along the X axis and 921 elements along the Y axis.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ -20, -4, 4, 20 }"
yCoords="{ -20, -4, 4, 20 }"
zCoords="{ 0, 1 }"
nx="{ 10, 101, 10 }"
ny="{ 10, 901, 10 }"
nz="{ 1 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
The mesh for the case with LagrangianContact solver was also created using the internal mesh generator, as
parametrized in the InternalMesh XML tag. The mesh discretizes the same compational domain (40 𝑚 ×40 𝑚 ×1 𝑚)
with 300 x 300 x 2 eight-node brick elements in the x, y, and z directions respectively.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ -20, -2, 2, 20 }"
yCoords="{ -20, -2, 2, 20 }"
zCoords="{ 0, 1 }"
nx="{ 40, 220, 40 }"
ny="{ 40, 220, 40 }"
nz="{ 2 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
Similarly, the internal mesh generator was used to discretize the same domain (40 𝑚 × 40 𝑚 × 1 𝑚) and generate the
mesh for the case with Hydrofracture solver, which contains 280 x 280 x 1 eight-node brick elements in the x, y, and z
directions.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ -20, -2, 2, 20 }"
yCoords="{ -20, -2, 2, 20 }"
zCoords="{ 0, 1 }"
nx="{ 40, 200, 40 }"
ny="{ 40, 200, 40 }"
nz="{ 1 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
In all the three cases, eight-node hexahedral elements are defined as C3D8 elementTypes, and their collection forms a
mesh with one group of cell blocks named here cb1. Refinement is necessary to conform with the fracture geometry
Note that the internal fracture pressure has a negative value, due to the negative sign convention for compressive stresses
in GEOS.
Material properties and boundary conditions are specified in the Constitutive and FieldSpecifications sections.
Adding a fracture
The static fracture is defined by a nodeset occupying a small region within the computation domain, where the fracture
tends to open upon internal pressurization:
• The test case with EmbeddedFractures solver:
<Geometry>
<Rectangle
name="FracturePlane"
normal="{1.0, 0.0, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.0, 1.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 2, 10 }"/>
</Geometry>
<Geometry>
<Rectangle
name="fracture"
normal="{1.0, 0.0, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.0, 1.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 2, 10 }"/>
<Rectangle
name="core"
normal="{1.0, 0.0, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.0, 1.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 2, 10 }"/>
</Geometry>
<Geometry>
<Box
name="fracture"
xMin="{ -0.01, -1.01, -0.01 }"
xMax="{ 0.01, 1.01, 1.01 }"/>
<Box
name="source"
xMin="{ -0.01, -0.11, -0.01 }"
xMax="{ 0.01, 0.11, 1.01 }"/>
<Box
name="core"
xMin="{ -0.01, -10.01, -0.01 }"
xMax="{ 0.01, 10.01, 1.01 }"/>
</Geometry>
To make these cases identical to the analytical example, fracture propagation is not allowed in this example.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, a task is specified to output
fracture aperture (normal opening); however, for different solvers, different fieldName and objectPath should be
called:
• The test case with EmbeddedFractures solver:
<Tasks>
<PackCollection
name="displacementJumpCollection"
objectPath="ElementRegions/Fracture/embeddedSurfaceSubRegion"
fieldName="displacementJump"
setNames="{all}"/>
</Tasks>
<Tasks>
<PackCollection
name="displacementJumpCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="displacementJump"/>
</Tasks>
<Tasks>
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="elementAperture"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for these recurring tasks. GEOS
writes output files named after the string defined in the filename keyword and formatted as HDF5 files. The
TimeHistory file contains the collected time history information from each specified time history collector. This
information includes datasets for the simulation time, element center defined in the local coordinate system, and the
time history information. A Python script is used to read and plot any specified subset of the time history data for
verification and visualization.
Running GEOS
Inspecting results
This plot compares the analytical solution (continuous lines) with the numerical solutions (markers) for the normal
opening of the pressurized fracture. As shown below, consistently, numerical solutions with different solvers correlate
very well with the analytical solution.
0.30
0.25
Fracture Aperture [mm]
0.20
0.15
0.10
Analytical Solution
Embedded Fracture
0.05 Lagrange Contact
HydroFrac Solver
0.00
1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00
Fracture Length [m]
To go further
Context
In this example, a single fracture is simulated using a Lagrange contact model in a 2D infinite domain and subjected to
a constant uniaxial compressive remote stress (Franceschini et al., 2020). An analytical solution (Phan et al., 2003) is
available for verifying the accuracy of the numerical results, providing an analytical form for the normal traction and
slip on the fracture surface due to frictional contact. In this example, the TimeHistory function and a Python script
are used to output and postprocess multi-dimensional data (traction and displacement on the fracture surface).
Input file
Everything required is contained within these GEOS input files and one mesh file located at:
inputFiles/lagrangianContactMechanics/SingleFracCompression_base.xml
inputFiles/lagrangianContactMechanics/SingleFracCompression_benchmark.xml
inputFiles/lagrangianContactMechanics/ContactMechanics_SingleFracCompression_benchmark.
˓→xml
inputFiles/lagrangianContactMechanics/crackInPlane_benchmark.vtu
We simulate an inclined fracture under a compressive horizontal stress (𝜎), as shown below. This fracture is placed in
an infinite, homogeneous, isotropic, and elastic medium. Uniaxial compression and frictional contact on the fracture
surface cause mechanical deformation to the surrounding rock and sliding along the fracture plane. For verification
purposes, plane strain deformation and Coulomb failure criterion are considered in this numerical model.
To simulate this phenomenon, we use a Lagrange contact model. Displacement and stress fields on the fracture plane
are calculated numerically. Predictions of the normal traction (𝑡𝑁 ) and slip (𝑔𝑇 ) on the fracture surface are compared
with the corresponding analytical solution (Phan et al., 2003).
2
𝑡𝑁 = −𝜎(sin (𝜓))
4(1 − 𝜈 2 )
√︁
2
𝑔𝑇 = (𝜎sin (𝜓) (cos (𝜓) − sin (𝜓) tan (𝜃))) 𝑏2 − (𝑏 − 𝜉)
𝐸
where 𝜓 is the inclination angle, 𝜈 is Poisson’s ratio, 𝐸 is Young’s modulus, 𝜃 is the friction angle, 𝑏 is the fracture
half-length, 𝜉 is a local coordinate on the fracture varying in the range [0, 2𝑏].
In this example, we focus our attention on the Mesh tags, the Constitutive tags, and the FieldSpecifications
tags.
Mesh
location of the GEOS XML file and a user-specified label (here CubeHex) is given to the mesh object. This unstructured
mesh contains quadrilaterals elements and interface elements. Refinement is performed to conform with the fracture
geometry specified in the Geometry section.
<Mesh>
<VTKMesh
name="CubeHex"
file="crackInPlane_benchmark.vtu"/>
</Mesh>
<Geometry>
<Rectangle
name="fracture"
normal="{-0.342020143325669, 0.939692620785908, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.939692620785908, 0.342020143325669, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 2, 10 }"/>
<Rectangle
name="core"
normal="{-0.342020143325669, 0.939692620785908, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.939692620785908, 0.342020143325669, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 2, 10 }"/>
<Box
(continues on next page)
<Box
name="leftPoint"
xMin="{-40.1, -40.1, -0.001}"
xMax="{-39.9, 40.1, 0.051}"/>
<Box
name="topPoint"
xMin="{-40.1, 39.9, -0.001}"
xMax="{ 40.1, 40.1, 0.051}"/>
<Box
name="bottomPoint"
xMin="{-40.1, -40.1, -0.001}"
xMax="{ 40.1, -39.9, 0.051}"/>
<Box
name="front"
xMin="{-40.1, -40.1, -0.001}"
xMax="{ 40.1, 40.1, 0.001}"/>
<Box
name="rear"
xMin="{-40.1, -40.1, 0.049}"
xMax="{ 40.1, 40.1, 0.051}"/>
<Box
name="xmin"
xMin="{-40.1, -40.1, -0.001}"
xMax="{-39.9, 40.1, 0.051}"/>
<Box
name="xmax"
xMin="{39.9, -40.1, -0.001}"
xMax="{40.1, 40.1, 0.051}"/>
</Geometry>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multi-physics solvers. Each single-physics solver should be given
a meaningful and distinct name because GEOS recognizes these single-physics solvers based on their given names to
create the coupling.
To setup a coupling between rock and fracture deformations, we define three different solvers:
• For solving the frictional contact, we define a Lagrangian contact solver, called here lagrangiancontact. In
this solver, we specify targetRegions that includes both the continuum region Region and the discontinuum
region Fracture where the solver is applied to couple rock and fracture deformation. The contact constitutive
law used for the fracture elements is named fractureMaterial, and defined later in the Constitutive section.
• Rock deformations are handled by a solid mechanics solver SolidMechanics_LagrangianFEM. This solid
mechanics solver (see Solid Mechanics Solver) is based on the Lagrangian finite element formulation. The
problem is run as QuasiStatic without considering inertial effects. The computational domain is discretized by
FE1, which is defined in the NumericalMethods section. The solid material is named rock, and its mechanical
properties are specified later in the Constitutive section.
• The solver SurfaceGenerator defines the fracture region and rock toughness.
<Solvers
gravityVector="{0.0, 0.0, 0.0}">
<SolidMechanicsLagrangeContact
name="lagrangiancontact"
timeIntegrationOption="QuasiStatic"
stabilizationName="TPFAstabilization"
logLevel="1"
discretization="FE1"
targetRegions="{ Region, Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
logLevel="2"
newtonMaxIter="10"
maxNumConfigurationAttempts="10"
lineSearchAction="Require"
lineSearchMaxCuts="2"
maxTimeStepCuts="2"/>
<LinearSolverParameters
solverType="direct"
directParallel="0"
logLevel="0"/>
</SolidMechanicsLagrangeContact>
</Solvers>
Constitutive laws
For this specific problem, we simulate the elastic deformation and fracture slippage caused by uniaxial compression.
A homogeneous and isotropic domain with one solid material is assumed, with mechanical properties specified in the
Constitutive section.
Fracture surface slippage is assumed to be governed by the Coulomb failure criterion. The contact constitutive behav-
ior is named fractureMaterial in the Coulomb block, where cohesion cohesion="0.0" and friction coefficient
frictionCoefficient="0.577350269" are specified.
<Constitutive>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="16.66666666666666e9"
defaultShearModulus="1.0e10"/>
<Coulomb
(continues on next page)
Recall that in the SolidMechanics_LagrangianFEM section, rock is the material of the computational domain. Here,
the isotropic elastic model ElasticIsotropic is used to simulate the mechanical behavior of rock.
All constitutive parameters such as density, bulk modulus, and shear modulus are specified in the International System
of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, tractionCollection
and displacementJumpCollection tasks are specified to output the local traction fieldName="traction" and
relative displacement fieldName="displacementJump" on the fracture surface.
<Tasks>
<PackCollection
name="tractionCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="traction"/>
<PackCollection
name="displacementJumpCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="displacementJump"/>
</Tasks>
These two tasks are triggered using the Event management, with PeriodicEvent defined for these recurring tasks.
GEOS writes two files named after the string defined in the filename keyword and formatted as HDF5 files (displace-
mentJump_history.hdf5 and traction_history.hdf5). The TimeHistory file contains the collected time history informa-
tion from each specified time history collector. This information includes datasets for the simulation time, element
center defined in the local coordinate system, and the time history information. Then, a Python script is used to access
and plot any specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
(continues on next page)
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ leftPoint, rightPoint }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ bottomPoint, topPoint }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ front, rear }"/>
<FieldSpecification
name="Sigmax"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Region"
fieldName="rock_stress"
component="0"
scale="-1.0e8"/>
</FieldSpecifications>
Note that the remote stress has a negative value, due to the negative sign convention for compressive stresses in GEOS.
The parameters used in the simulation are summarized in the following table.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of 𝑢𝑦 in the computational domain.
The next figure shows the distribution of relative shear displacement values on the fracture surface.
The figure below shows a comparison between the numerical predictions (marks) and the corresponding analytical
solutions (solid curves) for the normal traction (𝑡𝑁 ) and slip (𝑔𝑇 ) distributions on the fracture surface. One can observe
that the numerical results obtained by GEOS and the analytical solutions are nearly identical.
To go further
Context
In this example, two fractures intersecting at a right angle are simulated using a Lagrange contact model in a 2D
infinite domain and subjected to a constant uniaxial compressive remote stress. Numerical solutions based on the
symmetric-Galerkin boundary element method (Phan et al., 2003) is used to verify the accuracy of the GEOS results
for the normal traction, normal opening, and shear slippage on the fracture surfaces, considering frictional contact and
fracture-fracture interaction. In this example, the TimeHistory function and a Python script are used to output and
post-process multi-dimensional data (traction and displacement on the fracture surfaces).
Input file
Everything required is contained within these xml files located at:
inputFiles/lagrangianContactMechanics/TFrac_base.xml
inputFiles/lagrangianContactMechanics/TFrac_benchmark.xml
inputFiles/lagrangianContactMechanics/ContactMechanics_TFrac_benchmark.xml
We simulate two intersecting fractures under a remote compressive stress constraint, as shown below. The two fractures
sit in an infinite, homogeneous, isotropic, and elastic medium. The vertical fracture is internally pressurized and
perpendicularly intersects the middle of the horizontal fracture. A combination of uniaxial compression, frictional
contact, and opening of the vertical fracture causes mechanical deformations of the surrounding rock, thus leads to
sliding of the horizontal fracture. For verification purposes, a plane strain deformation and Coulomb failure criterion
are considered in this numerical model.
4.0
0.0
Relative Shear Displacement [mm]
3.5
2.5 3.0
Normal Traction [MPa]
5.0 2.5
7.5 2.0
10.0 1.5
12.5 1.0
Analytical Solution Analytical Solution
15.0 Numerical Solution Numerical Solution
0.5
17.5 0.01.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00
1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00
Length [m] Length [m]
To simulate this problem, we use a Lagrange contact model. Displacement and stress fields on the fracture plane are
calculated numerically. Predictions of the normal traction and slip along the sliding fracture and mechanical aperture
of the pressurized fracture are compared with the corresponding literature work (Phan et al., 2003).
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
This mesh was created using the internal mesh generator as parametrized in the InternalMesh XML tag. The mesh
contains 300 x 300 x 2 eight-node brick elements in the x, y, and z directions respectively. Such eight-node hexahedral
elements are defined as C3D8 elementTypes, and their collection forms a mesh with one group of cell blocks named
here cb1.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ -1000, -100, 100, 1000 }"
(continues on next page)
Refinement is necessary to conform with the fracture geometry specified in the Geometry section.
<Geometry>
<Rectangle
name="fracture1"
normal="{1.0, 0.0, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.0, 1.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 100, 200 }"/>
<Rectangle
name="core1"
normal="{1.0, 0.0, 0.0}"
origin="{0.0, 0.0, 0.0}"
lengthVector="{0.0, 1.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 100, 200 }"/>
<Rectangle
name="fracture2"
normal="{0.0, 1.0, 0.0}"
origin="{0.0, 50.0, 0.0}"
lengthVector="{1.0, 0.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 50, 200 }"/>
<Rectangle
name="core2"
normal="{0.0, 1.0, 0.0}"
origin="{0.0, 50.0, 0.0}"
lengthVector="{1.0, 0.0, 0.0}"
widthVector="{0.0, 0.0, 1.0}"
dimensions="{ 50, 200 }"/>
</Geometry>
GEOS is a multiphysics simulation platform. Different combinations of physics solvers can be applied in different
regions of the domain at different stages of the simulation. The Solvers tag in the XML file is used to list and
parameterize these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multiphysics solvers. Each single-physics solver should be given a
meaningful and distinct name, because GEOS recognizes these single-physics solvers by their given names to create
the coupling.
To setup a coupling between rock and fracture deformations, we define three different solvers:
• For solving the frictional contact, we define a Lagrangian contact solver, called here lagrangiancontact. In
this solver, we specify targetRegions that include both the continuum region Region and the discontinuum
region Fracture where the solver is applied to couple rock and fracture deformations. The contact constitutive
law used for the fracture elements is named fractureMaterial, and is defined later in the Constitutive
section.
• Rock deformations are handled by a solid mechanics solver SolidMechanics_LagrangianFEM. This solid
mechanics solver (see SolidMechanicsLagrangianFEM) is based on the Lagrangian finite element formulation.
The problem runs in QuasiStatic mode without inertial effects. The computational domain is discretized by
FE1, which is defined in the NumericalMethods section. The solid material is named rock and its mechanical
properties are specified later in the Constitutive section.
• The solver SurfaceGenerator defines the fracture region and rock toughness.
<SolidMechanicsLagrangeContact
name="lagrangiancontact"
timeIntegrationOption="QuasiStatic"
stabilizationName="TPFAstabilization"
logLevel="1"
discretization="FE1"
targetRegions="{ Region, Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
logLevel="2"
maxNumConfigurationAttempts="10"
newtonMaxIter="10"
lineSearchAction="Require"
lineSearchMaxCuts="2"
maxTimeStepCuts="2"/>
<LinearSolverParameters
solverType="direct"
directParallel="0"
logLevel="0"/>
</SolidMechanicsLagrangeContact>
Constitutive laws
For this problem, we simulate the elastic deformation and fracture slippage caused by the uniaxial compression. A
homogeneous and isotropic domain with one solid material is assumed, and its mechanical properties are specified in
the Constitutive section.
Fracture surface slippage is assumed to be governed by the Coulomb failure criterion. The contact constitutive behav-
ior is named fractureMaterial in the Coulomb block, where cohesion cohesion="0.0" and friction coefficient
frictionCoefficient="0.577350269" are specified.
<Constitutive>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="38.89e9"
defaultShearModulus="29.17e9"/>
(continues on next page)
<Coulomb
name="frictionLaw"
cohesion="0.0"
frictionCoefficient="0.577350269"/>
</Constitutive>
Recall that in the SolidMechanics_LagrangianFEM section, rock is the material of the computational domain. Here,
the isotropic elastic model ElasticIsotropic is used to simulate the mechanical behavior of rock.
All constitutive parameters such as density, bulk modulus, and shear modulus are specified in the International System
of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, tractionCollection
and displacementJumpCollection tasks are specified to output the local traction fieldName="traction" and
relative displacement fieldName="displacementJump" on the fracture surface.
<Tasks>
<PackCollection
name="tractionCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="traction"/>
<PackCollection
name="displacementJumpCollection"
objectPath="ElementRegions/Fracture/faceElementSubRegion"
fieldName="displacementJump"/>
</Tasks>
These two tasks are triggered using the Event manager with a PeriodicEvent defined for these recurring tasks. GEOS
writes two files named after the string defined in the filename keyword and formatted as HDF5 files (displacemen-
tJump_history.hdf5 and traction_history.hdf5). The TimeHistory file contains the collected time history information
from each specified time history collector. This information includes datasets for the simulation time, element center
defined in the local coordinate system, and the time history information. A Python script is used to read and plot any
specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture1, fracture2 }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core1, core2 }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xpos, xneg }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ ypos, yneg }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zpos, zneg }"/>
<Traction
name="NormalTraction"
objectPath="faceManager"
tractionType="normal"
scale="-1.0e8"
functionName="ForceTimeFunction"
setNames="{ core1 }"/>
<FieldSpecification
name="SigmaY"
initialCondition="1"
setNames="{ all }"
(continues on next page)
Note that the remote stress and internal fracture pressure has a negative value, due to the negative sign convention for
compressive stresses in GEOS.
The parameters used in the simulation are summarized in the following table.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of 𝜎𝑥𝑥 in the computational domain.
The next figure shows the distribution of relative shear displacement values along the surface of two intersected frac-
tures.
The figure below compares the results from GEOS (marks) and the corresponding literature reference solution (solid
curves) for the normal traction and slip distributions along the horizontal fracture and opening of the vertical fracture.
GEOS reliably captures the mechanical interactions between two intersected fractures and shows excellent agreement
with the reference solution. Due to sliding of the horizontal fracture, GEOS prediction as well as the reference solution
on the normal opening of pressurized vertical fracture deviates away from Sneddon’s analytical solution, especially
near the intersection point.
To go further
Context
In this example, we evaluate the induced stresses in a pressurized reservoir displaced by a normal fault (permeable or
impermeable). This problem is solved using the poroelastic solver in GEOS to obtain the stress perturbations along the
fault plane, which are verified against the corresponding analytical solution (Wu et al., 2020).
Input file
The xml input files for the test case with impermeable fault are located at:
120
Normal Traction [MPa]
100 50
80 25
Slip [mm]
60 0
40 25
20 Phan et al.(2003) 50 Phan et al.(2003)
0 GEOSX Results GEOSX Results
20 10 0 10 20 20 10 0 10 20
Horizontal Frac Length [m] Horizontal Frac Length [m]
250
Aperture [mm]
200
150
100
50 Phan et al.(2003)
GEOSX Results
0 Sneddon Solution
40 20 0 20 40
Vertical Frac Length [m]
inputFiles/poromechanics/faultPoroelastic_base.xml
inputFiles/poromechanics/impermeableFault_benchmark.xml
The xml input files for the test case with permeable fault are located at:
inputFiles/poromechanics/faultPoroelastic_base.xml
inputFiles/poromechanics/permeableFault_benchmark.xml
A mesh file and a python script for post-processing the simulation results are also provided:
inputFiles/poromechanics/faultMesh.vtu
src/docs/sphinx/advancedExamples/validationStudies/faultMechanics/faultVerification/
˓→faultVerificationFigure.py
We simulate induced stresses along a normal fault in a pressurized reservoir and compare our results against an analyti-
cal solution. In conformity to the analytical set-up, the reservoir is divided into two parts by an inclined fault. The fault
crosses the entire domain, extending into the overburden and the underburden. The domain is horizontal, infinite, ho-
mogeneous, isotropic, and elastic. The reservoir is pressurized uniformely upon injection, and we neglect the transient
effect of fluid flow. A pressure buildup is applied to: (i) the whole reservoir in the case of a permeable fault; (ii) the
left compartment in the case of an impermeable fault. The overburden and underburden are impermeable (no pressure
changes). Due to poromechanical effects, pore pressure changes in the reservoir cause a mechanical deformation of the
entire domain. This deformation leads to a stress perturbation on the fault plane that could potentially trigger sliding
of the fault. Here, the fault serves only as a flow boundary, and the mechanical separation of the fault plane (either by
shear slippage or normal opening) is prohibited, like in the analytical example. For verification purposes, a plane strain
deformation is considered in the numerical model.
In this example, we set up and solve a poroelastic model to obtain the spatial solutions of displacement and stress fields
across the domain upon pressurization. Changes of total stresses along the fault plane are evaluated and compared with
the corresponding published work (Wu et al., 2020).
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
Here, we load the mesh with VTKMesh. The syntax to import external meshes is simple: in the XML file, the mesh file
faultMesh.vtu is included with its relative or absolute path to the location of the GEOS XML file and a user-specified
label (here FaultModel) is given to the mesh object. This mesh contains quadrilateral elements and local refinement
to conform with the fault geometry, and two reservoir compartments displaced by the fault. The size of the reservoir
<Mesh>
<VTKMesh
name="FaultModel"
file="faultMesh.vtu"
regionAttribute="CellEntityIds"/>
</Mesh>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multi-physics solvers. The order in which solvers are specified is
not important in GEOS. Note that end-users should give each single-physics solver a meaningful and distinct name, as
GEOS will recognize these single-physics solvers based on their customized names to create the expected couplings.
As demonstrated in this example, to setup a poromechanical coupling, we need to define three different solvers in the
XML file:
• the mechanics solver, a solver of type SolidMechanics_LagrangianFEM called here mechanicsSolver (more
information here: Solid Mechanics Solver),
<SolidMechanics_LagrangianFEM
name="mechanicsSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonTol = "1.0e-5"
newtonMaxIter = "15"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-10"/>
</SolidMechanics_LagrangianFEM>
• the single-phase flow solver, a solver of type SinglePhaseFVM called here singlePhaseFlowSolver (more
information on these solvers at Singlephase Flow Solver),
<SinglePhaseFVM
name="singlePhaseFlowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonTol = "1.0e-6"
newtonMaxIter = "8"
/>
<LinearSolverParameters
solverType="gmres"
(continues on next page)
• the coupling solver (SinglePhasePoromechanics) that will bind the two single-physics solvers above, named
poromechanicsSolver (more information at Poromechanics Solver).
The two single-physics solvers are parameterized as explained in their corresponding documents.
In this example, let us focus on the coupling solver. This solver (poromechanicsSolver) uses a set of attributes that
specifically describe the coupling process within a poromechanical framework. For instance, we must point this solver
to the designated fluid solver (here: singlePhaseFlowSolver) and solid solver (here: mechanicsSolver). These
solvers are forced to interact with all the constitutive models in the target regions (here, we only have one, Domain).
More parameters are required to characterize a coupling procedure (more information at Poromechanics Solver). This
way, the two single-physics solvers will be simultaneously called and executed for solving the problem.
Numerical methods in multiphysics settings are similar to single physics numerical methods. In this problem, we use
finite volume for flow and finite elements for solid mechanics. All necessary parameters for these methods are defined
in the NumericalMethods section.
As mentioned before, the coupling solver and the solid mechanics solver require the specification of a discretization
method called FE1. In GEOS, this discretization method represents a finite element method using linear basis functions
and Gaussian quadrature rules. For more information on defining finite elements numerical schemes, please see the
dedicated Finite Element Discretization section.
The finite volume method requires the specification of a discretization scheme. Here, we use a two-point flux ap-
proximation scheme (singlePhaseTPFA), as described in the dedicated documentation (found here: Finite Volume
Discretization).
<NumericalMethods>
<FiniteElements>
<FiniteElementSpace
name="FE1"
order="1"/>
(continues on next page)
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"
/>
</FiniteVolume>
</NumericalMethods>
Constitutive laws
For this problem, a homogeneous and isotropic domain with one solid material is assumed for both the reservoir
and its surroundings. The solid and fluid materials are named as rock and water respectively, and their mechan-
ical properties are specified in the Constitutive section. PorousElasticIsotropic model is used to describe
the linear elastic isotropic response of rock when subjected to fluid injection. And the single-phase fluid model
CompressibleSinglePhaseFluid is selected to simulate the flow of water.
<Constitutive>
<PorousElasticIsotropic
name="porousRock"
solidModelName="rock"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"
/>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultYoungModulus="14.95e9"
defaultPoissonRatio="0.15"
/>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0e6"
referenceDensity="1000"
compressibility="2.09028227021e-10"
referenceViscosity="0.001"
viscosibility="0.0"
/>
<BiotPorosity
name="rockPorosity"
defaultGrainBulkModulus="7.12e10"
defaultReferencePorosity="0.3"
/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{1.0e-18, 1.0e-18, 1.0e-18}"
(continues on next page)
All constitutive parameters such as density, viscosity, and Young’s modulus are specified in the International System
of Units.
<FieldSpecification
name="stressXX"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Domain"
fieldName="rock_stress"
component="0"
scale="-28.499545e6"
/>
<FieldSpecification
name="stressYY"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Domain"
fieldName="rock_stress"
component="1"
scale="-38.499545e6"
/>
<FieldSpecification
name="stressZZ"
initialCondition="1"
(continues on next page)
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ 89, 88 }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ 90 }"/>
<FieldSpecification
name="zconstraintFront"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ 92, 93 }"/>
<Traction
name="NormalTraction"
objectPath="faceManager"
tractionType="normal"
scale="-70.0e6"
setNames="{ 91 }"/>
</FieldSpecifications>
In this example, the only difference between the impermeable fault and permeable fault cases is how to apply pressure
buildup. For the impermeable fault case, a constant pressure buildup is imposed to the left compartment of the reservoir
(objectPath="ElementRegions/Domain/97_hexahedra"):
<FieldSpecifications>
<FieldSpecification
name="injection"
initialCondition="0"
setNames="{all}"
objectPath="ElementRegions/Domain/97_hexahedra"
fieldName="pressure"
scale="55.0e6"/>
</FieldSpecifications>
For the permeable fault case, a constant pressure buildup is imposed to both compartments of the reser-
voir: (objectPath="ElementRegions/Domain/97_hexahedra" and objectPath="ElementRegions/Domain/
96_hexahedra"):
<FieldSpecifications>
<FieldSpecification
name="injection"
initialCondition="0"
setNames="{all}"
objectPath="ElementRegions/Domain/97_hexahedra"
fieldName="pressure"
scale="55.0e6"/>
<FieldSpecification
name="injection2"
initialCondition="0"
setNames="{all}"
objectPath="ElementRegions/Domain/96_hexahedra"
fieldName="pressure"
scale="55.0e6"/>
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table, which are specified in the Constitutive
and FieldSpecifications sections. Note that stresses and traction have negative values, due to the negative sign
convention for compressive stresses in GEOS.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of resulting shear stress (𝜎𝑥𝑦 ) in the computational domain for two different cases (a permeable vs. an impermeable
fault). Numerical solutions for both cases are also compared with the corresponding analytical solutions.
The figure below compares the results from GEOS (marks) and the corresponding analytical solution (solid curves)
for the change of total stresses (𝜎𝑥𝑥 , 𝜎𝑦𝑦 and 𝜎𝑥𝑦 ) along the fault plane. As shown, GEOS reliably captures the
mechanical deformation of the faulted reservoir and shows excellent agreement with the analytical solutions for two
different scenarios. Differences in the stress perturbations between the cases with permeable and impermeable fault
are also noticeable, which suggests that fault permeability plays a crucial role in governing reservoir deformation for
the problems with reservoir pressurization or depletion.
To go further
Hydraulic Fracture
Toughness dominated KGD hydraulic fracture
In this example, we consider a plane-strain hydraulic fracture propagating in an infinite, homogeneous and elastic
medium, due to fluid injection at a rate 𝑄0 during a period from 0 to 𝑡𝑚𝑎𝑥 . Two dimensional KGD fracture is charac-
terized as a vertical fracture with a rectangle-shaped cross section. For verification purpose, the presented numerical
model is restricted to the assumptions used to analytically solve this problem (Bunger et al., 2005). Vertical and im-
permeable fracture surface is assumed, which eliminate the effect of fracture plane inclination and fluid leakoff. The
injected fluid flows within the fracture, which is assumed to be governed by the lubrication equation resulting from
the mass conservation and the Poiseuille law. Fracture profile is related to fluid pressure distribution, which is mainly
dictated by fluid viscosity 𝜇. In addition, fluid pressure contributes to the fracture development through the mechanical
deformation of the solid matrix, which is characterized by rock elastic properties, including the Young modulus 𝐸, and
the Poisson ratio 𝜈.
300 Analytical_imp
300 300
GEOSX_imp
Analytical_per
GEOSX_per
200 200 200
y (m)
y (m)
0 0 0
For toughness-dominated fractures, more work is spent to split the intact rock than that applied to move the fracturing
fluid. To make the case identical to the toughness dominated asymptotic solution, incompressible fluid with an ultra-
low viscosity of 0.001 cp and medium rock toughness should be defined. Fracture is propagating with the creation of
new surface if the stress intensity factor exceeds rock toughness 𝐾𝐼𝑐 .
In toughness-storage dominated regime, asymptotic solutions of the fracture length ℓ, the net pressure 𝑝0 and the
fracture aperture 𝑤0 at the injection point for the KGD fracture are provided by (Bunger et al., 2005):
𝐸
𝐸𝑝 =
1 − 𝜈2
and the term 𝑋 is given as:
4
256 𝐾𝐼𝑐
𝑋=
3𝜋 2 𝜇𝑄0 𝐸𝑝 3
Input file
The input xml files for this test case are located at:
inputFiles/hydraulicFracturing/kgdToughnessDominated_base.xml
and
inputFiles/hydraulicFracturing/kgdToughnessDominated_benchmark.xml
The corresponding integrated test with coarser mesh and smaller injection duration is also prepared:
inputFiles/hydraulicFracturing/kgdToughnessDominated_Smoke.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
inputFiles/hydraulicFracturing/scripts/hydrofractureQueries.py
inputFiles/hydraulicFracturing/scripts/hydrofractureFigure.py
Mechanics solvers
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
nodeBasedSIF="1"
rockToughness="1e6"
mpiCommOrder="1"/>
Rock and fracture deformation are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE. In
this solver, we define targetRegions that includes both the continuum region and the fracture region. The name
of the contact constitutive behavior is also specified in this solver by the contactRelationName, besides the
solidMaterialNames.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1.0"/>
The single phase fluid flow inside the fracture is solved by the finite volume method in the solver SinglePhaseFVM as:
<SinglePhaseFVM
name="SinglePhaseFlow"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }"/>
All these elementary solvers are combined in the solver Hydrofracture to model the coupling between fluid flow
within the fracture, rock deformation, fracture opening/closure and propagation. A fully coupled scheme is defined by
setting a flag FIM for couplingTypeOption.
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="2"
useQuasiNewton="1">
The constitutive law CompressibleSinglePhaseFluid defines the default and reference fluid viscosity, compress-
ibility and density. For this toughness dominated example, ultra low fluid viscosity is used:
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="1.0e-6"
referencePressure="0.0"
compressibility="5e-10"
referenceViscosity="1.0e-6"
viscosibility="0.0"/>
The isotropic elastic Young modulus and Poisson ratio are defined in the ElasticIsotropic block. The density of
rock defined in this block is useless, as gravity effect is ignored in this example.
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultYoungModulus="30.0e9"
defaultPoissonRatio="0.25"/>
Mesh
Internal mesh generator is used to generate the geometry of this example. The domain size is large enough comparing
to the final size of the fracture. A sensitivity analysis has shown that the domain size in the direction perpendicular
to the fracture plane, i.e. x-axis, must be at least ten times of the final fracture half-length to minimize the boundary
effect. However, smaller size along the fracture plane, i.e. y-axis, of only two times the fracture half-length is good
enough. It is also important to note that at least two layers are required in z-axis to ensure a good match between the
numerical results and analytical solutions, due to the node based fracture propagation criterion. Also in x-axis, bias
parameter xBias is added for optimizing the mesh by refining the elements near the fracture plane.
<InternalMesh
name="mesh1"
elementTypes="{C3D8}"
xCoords="{ -100, 0, 100 }"
yCoords="{ 0, 50 }"
zCoords="{ 0, 1 }"
nx="{ 30, 30 }"
ny="{ 100 }"
nz="{ 2 }"
xBias="{ 0.5, -0.5 }"
cellBlockNames="{cb1}"/>
The initial fracture is defined by a nodeset occupying a small area where the KGD fracture starts to propagate:
<Box
name="fracture"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 0.01, 1.01, 1.01 }"/>
This initial ruptureState condition must be specified for this area in the following FieldSpecification block:
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
The plane within which the KGD fracture propagates is predefined to reduce the computational cost. The fracture plane
is outlined by a separable nodeset by the following initial FieldSpecification condition:
<Box
name="core"
xMin="{ -0.01, -0.01, -0.01 }"
xMax="{ 0.01, 50.01, 1.01 }"/>
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
Fluid is injected into a sub-area of the initial fracture. Only half of the injection rate is defined in this boundary
condition because only half-wing of the KGD fracture is modeled regarding its symmetry. Hereby, the mass injection
rate is actually defined, instead of the volume injection rate. More precisely, the value given for scale is 𝑄0 𝜌𝑓 /2 (not
𝑄0 /2).
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/Fracture"
scale="-5e-2"
setNames="{ source }"/>
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection,
apertureCollection, hydraulicApertureCollection and areaCollection are specified to output the time
history of fracture characterisctics (pressure, width and area). objectPath="ElementRegions/Fracture/
FractureSubRegion" indicates that these PackCollection tasks are applied to the fracure element subregion.
<Tasks>
<PackCollection
name="pressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"/>
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementAperture"/>
<PackCollection
name="hydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"/>
<PackCollection
name="areaCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementArea"/>
<!-- Collect aperture, pressure at the source for curve checks -->
<PackCollection
name="sourcePressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"
setNames="{ source }"/>
<PackCollection
name="sourceHydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"
setNames="{ source }"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for the recurring tasks.
GEOS writes one file named after the string defined in the filename keyword and formatted as a HDF5 file
(kgdToughnessDominated_output.hdf5). This TimeHistory file contains the collected time history information
from specified time history collector. This file includes datasets for the simulation time, fluid pressure, element aper-
ture, hydraulic aperture and element area for the propagating hydraulic fracture. A Python script is prepared to read
and query any specified subset of the time history data for verification and visualization.
The parameters used in the simulation are summarized in the following table.
Inspecting results
Fracture propagation during the fluid injection period is shown in the figure below.
the HDF5 output is postprocessed and temporal evolution of fracture characterisctics (fluid pressure and fracture width
at fluid inlet and fracure half length) are saved into a txt file model-results.txt, which can be used for verification
and visualization:
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
A good agreement between GEOS results and analytical solutions is shown in the comparison below, which is generated
using the visualization script:
python ./kgdToughnessDominatedFigure.py
To go further
The KGD problem addresses a single plane strain fracture growing in an infinite elastic domain. Basic assumptions and
characteristic shape for this example is similar to those of another case (Viscosity dominated KGD hydraulic fracture)
except that the viscosity dominated regime is now considered. In this regime, more work is spent to move the fracturing
fluid than to split the intact rock. In this test, slickwater with a constant viscosity of 1 cp is chosen as fracturing fluid,
whose compressibility is neglected. To make the case identical to the viscosity dominated asymptotic solution, an ultra-
low rock toughness 𝐾𝐼𝑐 is defined and fracture is assumed to be always propagating following fluid front. Asymptotic
2.0
1.5
15
10 1.0
5 0.5
Asymptotic ( => 0, CL => 0 )
GEOSX ( => 0, CL => 0 )
0 20 40 60 80 100 0.0 20 40 60 80 100
Time (s) Time (s)
1.50
Net Pressure at Well (MPa)
1.25
1.00
0.75
0.50
0.25
0.00 20 40 60 80 100
Time (s)
solutions of the fracture length ℓ, the net pressure 𝑝0 and the fracture aperture 𝑤0 at the injection point for the KGD
fracture with a viscosity dominated regime are provided by (Adachi and Detournay, 2002):
𝐸𝑝 𝑄30 1/6 2/3
ℓ = 0.6152( ) 𝑡
12𝜇
12𝜇𝑄0 1/2
𝑤02 = 2.1( ) ℓ
𝐸𝑝
𝑤0 𝑝0 = 0.62(12𝜇𝑄0 𝐸𝑝 )1/2
where the plane modulus 𝐸𝑝 is defined by
𝐸
𝐸𝑝 =
1 − 𝜈2
and the term 𝑋 is given as:
4
256 𝐾𝐼𝑐
𝑋=
3𝜋 𝜇𝑄0 𝐸𝑝 3
2
Input file
The input xml files for this test case are located at:
inputFiles/hydraulicFracturing/kgdViscosityDominated_base.xml
and
inputFiles/hydraulicFracturing/kgdViscosityDominated_benchmark.xml
The corresponding integrated test with coarser mesh and smaller injection duration is also prepared:
inputFiles/hydraulicFracturing/kgdViscosityDominated_smoke.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
inputFiles/hydraulicFracturing/scripts/hydrofractureQueries.py
inputFiles/hydraulicFracturing/scripts/hydrofractureFigure.py
Fluid rheology and rock toughness are defined in the xml blocks below. Please note that setting an absolute zero value
for the rock toughness could lead to instability issue. Therefore, a low value of 𝐾𝐼𝑐 is used in this example.
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
nodeBasedSIF="1"
rockToughness="1e4"
mpiCommOrder="1"/>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="1.0e-3"
referencePressure="0.0"
compressibility="5e-10"
referenceViscosity="1.0e-3"
viscosibility="0.0"/>
the HDF5 output is postprocessed and temporal evolution of fracture characterisctics (fluid pressure and fracture width
at fluid inlet and fracure half length) are saved into a txt file model-results.txt, which can be used for verification
and visualization:
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
A good agreement between GEOS results and analytical solutions is shown in the comparison below, which is generated
using the visualization script:
python ./kgdViscosityDominatedFigure.py
2.0
Fracture Mouth Opening (mm)
15.0
Fracture Half Length (m)
12.5 1.5
10.0
7.5 1.0
5.0 0.5
2.5 Asymptotic ( KIC => 0, CL => 0 )
GEOSX ( KIC => 0, CL => 0 )
0.0 20 40 60 80 100 0.0 20 40 60 80 100
Time (s) Time (s)
1.50
Net Pressure at Well (MPa)
1.25
1.00
0.75
0.50
0.25
0.00 20 40 60 80 100
Time (s)
To go further
Context
In this example, we use GEOS to model a planar hydraulic fracture propagating in a finite domain subject to traction-
free external boundaries. Contrary to the classic KGD problems, we do not assume an infinite rock domain. Existing
analytical solutions cannot model fracture behavior in this scenario, so this problem is solved using the hydrofracture
solver in GEOS. We validate the simulation results against a benchmark experiment (Rubin, 1983).
Input file
This example uses no external input files. Everything we need is contained within two GEOS input files:
inputFiles/hydraulicFracturing/kgdValidation_base.xml
inputFiles/hydraulicFracturing/kgdValidation_benchmark.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
src/docs/sphinx/advancedExamples/validationStudies/hydraulicFracture/kgdValidation/
˓→kgdValidationQueries.py
src/docs/sphinx/advancedExamples/validationStudies/hydraulicFracture/kgdValidation/
˓→kgdValidationFigure.py
We simulate a hydraulic fracturing experiment within a finite domain made of three layers of polymethylmethacrylate
(PMMA). As shown below, we inject viscous fluid to create a single planar fracture in the middle layer. The target layer
is bonded weakly to the adjacent layers, so a vertical fracture develops inside the middle layer. Four pressure gages are
placed to monitor wellbore pressure (gage 56) and fluid pressure along the fracture length (gage 57, 58, and 59). A linear
variable differential transducer (LVDT) measures the fracture aperture at 28.5 mm away from the wellbore. Images are
taken at regular time intervals to show the temporal evolution of the fracture extent. All experimental measurements
for the time history of pressure, aperture, and length are reported in Rubin (1983). We use GEOS to reproduce the
conditions of this test, including material properties and pumping parameters. In the experiment, the upper and lower
layers are used only to restrict the fracture height growth, they are therefore not simulated in GEOS but are present as
boundary conditions. Given the vertical plane of symmetry, only half of the middle layer is modeled. For verification
purposes, a plane strain deformation and zero fluid leak-off are considered in the numerical model.
In this example, we solve the hydraulic fracturing problem with the hydrofrac solver to obtain the temporal solution
of the fracture characteristics (length, aperture and pressure). These modeling predictions are compared with the
corresponding experimental results (Rubin, 1983).
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
We use the internal mesh generator to create a computational domain (0.1525 𝑚 ×0.096 𝑚 ×0.055 𝑚), as parametrized
in the InternalMesh XML tag. The structured mesh contains 80 x 18 x 10 eight-node brick elements in the x, y, and
z directions respectively. Such eight-node hexahedral elements are defined as C3D8 elementTypes, and their collection
forms a mesh with one group of cell blocks named here cb1. Along the y-axis, refinement is performed for the elements
in the vicinity of the fracture plane.
<InternalMesh
(continues on next page)
The fracture plane is defined by a nodeset occupying a small region within the computation domain, where the fracture
tends to open and propagate upon fluid injection:
<Box
name="core"
xMin="{ -0.1, -0.001, 0.036 }"
xMax="{ 0.2, 0.001, 0.093 }"/>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
Three elementary solvers are combined in the solver Hydrofracture to model the coupling between fluid flow within
the fracture, rock deformation, fracture deformation and propagation:
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="2">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="20"
lineSearchMaxCuts="3"/>
<LinearSolverParameters
directParallel="0"/>
</Hydrofracture>
• Rock and fracture deformation are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE.
In this solver, we define targetRegions that includes both the continuum region and the fracture region. The
name of the contact constitutive behavior is specified in this solver by the contactRelationName.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
(continues on next page)
• The single-phase fluid flow inside the fracture is solved by the finite volume method in the solver
SinglePhaseFVM.
<SinglePhaseFVM
name="SinglePhaseFlow"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }"/>
• The solver SurfaceGenerator defines the fracture region and rock toughness. With nodeBasedSIF="0",
edge-based Stress Intensity Factor (SIF) calculation is chosen for the fracture propagation criterion.
<SurfaceGenerator
name="SurfaceGen"
logLevel="1"
targetRegions="{ Domain }"
nodeBasedSIF="0"
rockToughness="1.2e6"
mpiCommOrder="1"/>
Constitutive laws
For this problem, a homogeneous and isotropic domain with one solid material is assumed, and its mechanical
properties and associated fluid rheology are specified in the Constitutive section. ElasticIsotropic model is
used to describe the mechanical behavior of rock, when subjected to fluid injection. The single-phase fluid model
CompressibleSinglePhaseFluid is selected to simulate the response of water upon fracture propagation.
<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="97.7"
referencePressure="0.0"
compressibility="5e-12"
referenceViscosity="97.7"
viscosibility="0.0"/>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="4.110276e9"
defaultShearModulus="1.19971e9"/>
<CompressibleSolidParallelPlatesPermeability
name="fractureFilling"
solidModelName="nullSolid"
porosityModelName="fracturePorosity"
permeabilityModelName="fracturePerm"/>
<NullModel
(continues on next page)
<PressurePorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
referencePressure="0.0"
compressibility="0.0"/>
<ParallelPlatesPermeability
name="fracturePerm"/>
<FrictionlessContact
name="fractureContact"/>
<HydraulicApertureTable
name="hApertureModel"
apertureTableName="apertureTable"/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection,
apertureCollection, hydraulicApertureCollection and areaCollection are specified to output the time
history of fracture characterisctics (pressure, width and area). objectPath="ElementRegions/Fracture/
FractureSubRegion" indicates that these PackCollection tasks are applied to the fracure element subregion.
<Tasks>
<PackCollection
name="pressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"/>
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementAperture"/>
<PackCollection
name="hydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"/>
<PackCollection
name="areaCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementArea"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for the recurring tasks.
GEOS writes one file named after the string defined in the filename keyword and formatted as a HDF5 file
(KGD_validation_output.hdf5). This TimeHistory file contains the collected time history information from speci-
fied time history collector. This file includes datasets for the simulation time, fluid pressure, element aperture, hydraulic
aperture and element area for the propagating hydraulic fracture. A Python script is prepared to read and query any
specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="waterDensity"
initialCondition="1"
setNames="{ fracture }"
objectPath="ElementRegions"
fieldName="water_density"
scale="1000"/>
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<FieldSpecification
(continues on next page)
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/Fracture"
scale="-0.0000366"
setNames="{ source }"/>
</FieldSpecifications>
Note that the applied traction has a negative value, due to the negative sign convention for compressive stresses in
GEOS.
The parameters used in the simulation are summarized in the following table.
Inspecting results
The following figure shows the distribution of 𝜎𝑦𝑦 at 𝑡 = 100𝑠 within the computational domain..
By running the query script kgdValidationQueries.py, the HDF5 output is postprocessed and temporal evolution
of fracture characterisctics (fluid pressure and fracture width at fluid inlet and fracure half length) are saved into a txt
file model-results.txt, which can be used for verification and visualization:
[[' time', ' wpressure', '58pressure', '57pressure', ' Laperture', ' area']]
0 0 0 0 0 0.0001048
0.1 1.515e+07 0 0 0 0.0003145
0.2 1.451e+07 0 0 0 0.0003774
0.3 1.349e+07 0 0 0 0.0004194
0.4 1.183e+07 0 0 0 0.0005662
0.5 1.125e+07 0 0 0 0.0005662
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
The figure below shows simulation results of the fracture extent at the end of the injection, which is generated using
the visualization script kgdValidationFigure.py. The temporal evolution of the fracture characteristics (length,
aperture and pressure) from the GEOS simulation are extracted and compared with the experimental data gathered at
specific locations. As observed, the time history plots of the modelling predictions (green curves) for the pressure at
three gage locations, the fracture length, and the fracture aperture at LVDT location correlate well with the experimental
data (blue circles).
10
Experiment (Rubin, 1983)
Pressure @ Well (MPa)
8 GEOSX
6
4
2
00 20 40 60 80 100
Time (s)
5 150
Pressure @ Gage 58 (MPa)
4 125
100
3
75
2
50
1 25
00 20 40 60 80 100 00 20 40 60 80 100
Time (s) Time (s)
5 800
Pressure @ Gage 57 (MPa)
4 600
3
400
2
1 200
00 20 40 60 80 100 00 20 40 60 80 100
Time (s) Time (s)
To go further
Context
In this example, we simulate the growth of a radial hydraulic fracture in toughness-storage-dominated regime, a classic
benchmark in hydraulic fracturing (Settgast et al., 2016). The developed fracture is characterized as a planar fracture
with an elliptical cross-section perpendicular to the fracture plane and a circular fracture tip. This problem is solved
using the hydrofracture solver in GEOS. The modeling predictions on the temporal evolutions of the fracture charac-
teristics (length, aperture, and pressure) are verified against the analytical solutions (Savitski and Detournay, 2002).
Input file
This example uses no external input files. Everything we need is contained within two GEOS input files:
inputFiles/hydraulicFracturing/pennyShapedToughnessDominated_base.xml
inputFiles/hydraulicFracturing/pennyShapedToughnessDominated_benchmark.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
inputFiles/hydraulicFracturing/scripts/hydrofractureQueries.py
inputFiles/hydraulicFracturing/scripts/hydrofractureFigure.py
We model a radial fracture emerging from a point source and forming a perfect circular shape in an infinite, isotropic,
and homogenous elastic domain. As with the KGD problem, we simplify the model to a radial fracture in a toughness-
storage-dominated propagation regime. For toughness-dominated fractures, more work is spent on splitting the intact
rock than on moving the fracturing fluid. Storage-dominated propagation occurs if most of the fracturing fluid is
contained within the propagating fracture.
√ In this analysis, incompressible fluid with ultra-low viscosity (0.001𝑐𝑝)
and medium rock toughness (3.0𝑀 𝑃 𝑎 𝑚) are specified. In addition, an impermeable fracture surface is assumed to
eliminate the effect of fluid leak-off. This way, the GEOS simulations represent cases within the valid range of the
toughness-storage-dominated assumptions.
In this model, the injected fluid within the fracture follows the lubrication equation resulting from mass conservation
and Poiseuille’s law. The fracture propagates by creating new surfaces if the stress intensity factor exceeds the local rock
toughness 𝐾𝐼𝐶 . By symmetry, the simulation is reduced to a quarter-scale to save computational cost. For verification
purposes, a plane strain deformation is considered in the numerical model.
In this example, we set up and solve a hydraulic fracture model to obtain the temporal solutions of the fracture radius
𝑅, the net pressure 𝑝0 and the fracture aperture 𝑤0 at the injection point for the penny-shaped fracture developed in
this toughness-storage-dominated regime. The numerical predictions from GEOS are then compared with the corre-
sponding asymptotic solutions (Savitski and Detournay, 2002):
𝐾𝑝4 𝑄0 𝑡 1/5
𝑤0 (𝑡) = 0.6537( )
𝐸𝑝4
𝐾𝑝6 1/5
𝑝0 (𝑡) = 0.3004( )
𝐸𝑝 𝑄0 𝑡
where the plane modulus 𝐸𝑝 is related to Young’s modulus 𝐸 and Poisson’s ratio 𝜈:
𝐸
𝐸𝑝 =
1 − 𝜈2
The term 𝐾𝑝 is proportional to the rock toughness 𝐾𝐼𝐶 :
8
𝐾𝑝 = √ 𝐾𝐼𝐶
2𝜋
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
We use the internal mesh generator to create a computational domain (400 𝑚 × 400 𝑚 × 800 𝑚), as parametrized in
the InternalMesh XML tag. The structured mesh contains 80 x 80 x 60 eight-node brick elements in the x, y, and z
directions respectively. Such eight-node hexahedral elements are defined as C3D8 elementTypes, and their collection
forms a mesh with one group of cell blocks named here cb1. Local refinement is performed for the elements in the
vicinity of the fracture plane.
Note that the domain size in the direction perpendicular to the fracture plane, i.e. z-axis, must be at least ten times of
the final fracture radius to minimize possible boundary effects.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 100, 200, 400 }"
yCoords="{ 0, 100, 200, 400 }"
zCoords="{ -400, -100, -20, 20, 100, 400 }"
nx="{ 50, 10, 20 }"
ny="{ 50, 10, 20 }"
nz="{ 10, 10, 20, 10, 10 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
The fracture plane is defined by a nodeset occupying a small region within the computation domain, where the fracture
tends to open and propagate upon fluid injection:
<Box
name="core"
xMin="{ -500.1, -500.1, -0.1 }"
xMax="{ 500.1, 500.1, 0.1 }"/>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
Three elementary solvers are combined in the solver Hydrofracture to model the coupling between fluid flow within
the fracture, rock deformation, fracture deformation and propagation:
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="5"
initialDt="0.1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="50"
logLevel="1"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="mgr"
logLevel="1"
krylovAdaptiveTol="1"/>
</Hydrofracture>
• Rock and fracture deformation are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE.
In this solver, we define targetRegions that includes both the continuum region and the fracture region. The
name of the contact constitutive behavior is specified in this solver by the contactRelationName.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1.0e0">
<NonlinearSolverParameters
newtonTol="1.0e-6"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-10"/>
</SolidMechanicsLagrangianSSLE>
• The single-phase fluid flow inside the fracture is solved by the finite volume method in the solver
SinglePhaseFVM.
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="10"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-12"/>
</SinglePhaseFVM>
• The solver SurfaceGenerator defines the fracture region and rock toughness rockToughness="3.0e6".
With nodeBasedSIF="1", a node-based Stress Intensity Factor (SIF) calculation is chosen for the fracture prop-
agation criterion.
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
nodeBasedSIF="1"
rockToughness="3.0e6"
mpiCommOrder="1"/>
Constitutive laws
For this problem, a homogeneous and isotropic domain with one solid material is assumed. Its mechanical prop-
erties and associated fluid rheology are specified in the Constitutive section. ElasticIsotropic model is
used to describe the mechanical behavior of rock when subjected to fluid injection. The single-phase fluid model
CompressibleSinglePhaseFluid is selected to simulate the response of water upon fracture propagation.
<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
(continues on next page)
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="20.0e9"
defaultShearModulus="12.0e9"/>
<CompressibleSolidParallelPlatesPermeability
name="fractureFilling"
solidModelName="nullSolid"
porosityModelName="fracturePorosity"
permeabilityModelName="fracturePerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
referencePressure="0.0"
compressibility="0.0"/>
<ParallelPlatesPermeability
name="fracturePerm"/>
<FrictionlessContact
name="fractureContact"/>
<HydraulicApertureTable
name="hApertureModel"
apertureTableName="apertureTable"/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection,
apertureCollection, hydraulicApertureCollection and areaCollection are specified to output the time
history of fracture characterisctics (pressure, width and area). objectPath="ElementRegions/Fracture/
FractureSubRegion" indicates that these PackCollection tasks are applied to the fracure element subregion.
<Tasks>
<PackCollection
(continues on next page)
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementAperture"/>
<PackCollection
name="hydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"/>
<PackCollection
name="areaCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementArea"/>
<!-- Collect aperture, pressure at the source for curve checks -->
<PackCollection
name="sourcePressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"
setNames="{ source }"/>
<PackCollection
name="sourceHydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"
setNames="{ source }"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for the recurring tasks.
GEOS writes one file named after the string defined in the filename keyword and formatted as a HDF5 file
(pennyShapedToughnessDominated_output.hdf5). This TimeHistory file contains the collected time history in-
formation from specified time history collector. This file includes datasets for the simulation time, fluid pressure, ele-
ment aperture, hydraulic aperture and element area for the propagating hydraulic fracture. A Python script is prepared
to read and query any specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="waterDensity"
initialCondition="1"
setNames="{ fracture }"
objectPath="ElementRegions"
fieldName="water_density"
scale="1000"/>
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/Fracture"
scale="-6.625"
(continues on next page)
The parameters used in the simulation are summarized in the following table.
Inspecting results
The following figure shows the distribution of 𝜎𝑧𝑧 at 𝑡 = 400𝑠 within the computational domain..
the HDF5 output is postprocessed and temporal evolution of fracture characterisctics (fluid pressure and fracture width
at fluid inlet and fracure radius) are saved into a txt file model-results.txt, which can be used for verification and
visualization:
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
Next, the figure below compares the asymptotic solutions (curves) and the GEOS simulation results (markers) for this
analysis, which is generated using the visualization script:
python ./pennyShapedToughnessDominatedFigure.py
The time history plots of fracture radius, fracture aperture and fluid pressure at the point source match the asymptotic
solutions, confirming the accuracy of GEOS simulations.
2.0
Fracture Mouth Opening (mm)
60
Fracture Half Length (m)
50 1.5
40
1.0
30
20 0.5
Asymptotic ( => 0, CL => 0 )
10 GEOSX ( => 0, CL => 0 )
100 200 300 400 0.0 100 200 300 400
Time (s) Time (s)
1.50
Net Pressure at Well (MPa)
1.25
1.00
0.75
0.50
0.25
0.00 100 200 300 400
Time (s)
To go further
Context
In this example, we simulate the propagation of a radial hydraulic fracture in viscosity-storage-dominated regime,
another classic benchmark in hydraulic fracturing (Settgast et al., 2016). The fracture develops as a planar fracture
with an elliptical cross-section perpendicular to the fracture plane and a circular fracture tip. Unlike the toughness-
storage-dominated fractures, fluid frictional loss during the transport of viscous fracturing fluids governs the growth
of viscosity-storage-dominated fractures. We solve this problem using the hydrofracture solver in GEOS. We simulate
the change in length, aperture, and pressure of the fracture, and compare them against the corresponding analytical
solutions (Savitski and Detournay, 2002).
Input file
This example uses no external input files. Everything we need is contained within two GEOS input files:
inputFiles/hydraulicFracturing/pennyShapedViscosityDominated_base.xml
inputFiles/hydraulicFracturing/pennyShapedViscosityDominated_benchmark.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
inputFiles/hydraulicFracturing/scripts/hydrofractureQueries.py
inputFiles/hydraulicFracturing/scripts/hydrofractureFigure.py
We model a radial fracture emerging from a point source and forming a perfect circular shape in an infinite, isotropic,
and homogenous elastic domain. As with the viscosity-dominated KGD problem, we restrict the model to a radial frac-
ture developed in a viscosity-storage-dominated propagation regime. For viscosity-dominated fractures, more energy
is applied to move the fracturing fluid than to split the intact rock. If we neglect fluid leak-off, the storage-dominated
propagation
√ occurs from most of the injected fluid confined within the opened surfaces. We use a low rock toughness
(0.3𝑀 𝑃 𝑎 𝑚), and the slickwater we inject has a constant viscosity value (1.0𝑐𝑝) and zero compressibility. In addi-
tion, we assume that the fracture surfaces are impermeable, thus eliminating fluid leak-off. With this configuration, our
GEOS simulations meet the requirements of the viscosity-storage-dominated assumptions.
The fluid injected in the fracture follows the lubrication equation resulting from mass conservation and Poiseuille’s
law. The fracture propagates by creating new surfaces if the stress intensity factor exceeds the local rock toughness
𝐾𝐼𝐶 . By symmetry, the simulation is reduced to a quarter-scale to save computational cost. For verification purposes,
a plane strain deformation is considered in the numerical model.
We set up and solve a hydraulic fracture model to obtain the evolution with time of the fracture radius 𝑅, the net
pressure 𝑝0 and the fracture aperture 𝑤0 at the injection point for the penny-shaped fracture developed in viscosity-
storage-dominated regime. Savitski and Detournay (2002) presented the corresponding asymptotic solutions, used here
to validate the results of our GEOS simulations:
𝐸𝑝 𝑄30 𝑡4 1/9
𝑅(𝑡) = 0.6955( )
𝑀𝑝
𝑀𝑝2 𝑄30 𝑡 1/9
𝑤0 (𝑡) = 1.1977( )
𝐸𝑝2
𝐸𝑝2 𝑀𝑝 1/3
𝑝0 (Π, 𝑡) = Π𝑚𝑜 (𝜉)( )
𝑡
where the plane modulus 𝐸𝑝 is related to Young’s modulus 𝐸 and Poisson’s ratio 𝜈:
𝐸
𝐸𝑝 =
1 − 𝜈2
The term 𝑀𝑝 is proportional to the fluid viscosity 𝜇:
𝑀𝑝 = 12𝜇
Mesh
We use the internal mesh generator to create a computational domain (400 𝑚 × 400 𝑚 × 800 𝑚), as parametrized in
the InternalMesh XML tag. The structured mesh contains 80 x 80 x 60 eight-node brick elements in the x, y, and z
directions respectively. Such eight-node hexahedral elements are defined as C3D8 elementTypes, and their collection
forms a mesh with one group of cell blocks named here cb1. Local refinement is performed for the elements in the
vicinity of the fracture plane.
Note that the domain size in the direction perpendicular to the fracture plane, i.e. z-axis, must be at least ten times of
the final fracture radius to minimize possible boundary effects.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 100, 200, 400 }"
yCoords="{ 0, 100, 200, 400 }"
zCoords="{ -400, -100, -20, 20, 100, 400 }"
nx="{ 50, 10, 20 }"
ny="{ 50, 10, 20 }"
nz="{ 10, 10, 20, 10, 10 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
The fracture plane is defined by a nodeset occupying a small region within the computation domain, where the fracture
tends to open and propagate upon fluid injection:
<Box
name="core"
xMin="{ -500.1, -500.1, -0.1 }"
xMax="{ 500.1, 500.1, 0.1 }"/>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
Three elementary solvers are combined in the solver Hydrofracture to model the coupling between fluid flow within
the fracture, rock deformation, fracture deformation and propagation:
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="1"
initialDt="0.1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="10"
maxTimeStepCuts="5"
logLevel="1"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="mgr"
logLevel="1"
krylovAdaptiveTol="1"/>
</Hydrofracture>
• Rock and fracture deformation are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE.
In this solver, we define targetRegions that includes both the continuum region and the fracture region. The
name of the contact constitutive behavior is specified in this solver by the contactRelationName.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1.0e0">
<NonlinearSolverParameters
newtonTol="1.0e-6"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-10"/>
</SolidMechanicsLagrangianSSLE>
• The single-phase fluid flow inside the fracture is solved by the finite volume method in the solver
SinglePhaseFVM.
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="10"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-12"/>
</SinglePhaseFVM>
• The solver SurfaceGenerator defines the fracture region and rock toughness rockToughness="0.3e6".
With nodeBasedSIF="1", a node-based Stress Intensity Factor (SIF) calculation is chosen for the fracture prop-
agation criterion.
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
nodeBasedSIF="1"
rockToughness="0.3e6"
mpiCommOrder="1"/>
Constitutive laws
For this problem, a homogeneous and isotropic domain with one solid material is assumed. Its mechanical proper-
ties and associated fluid rheology are specified in the Constitutive section. The ElasticIsotropic model is
used to describe the mechanical behavior of rock when subjected to fluid injection. The single-phase fluid model
CompressibleSinglePhaseFluid is selected to simulate the response of water upon fracture propagation.
<Constitutive>
<CompressibleSinglePhaseFluid
(continues on next page)
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="20.0e9"
defaultShearModulus="12.0e9"/>
<CompressibleSolidParallelPlatesPermeability
name="fractureFilling"
solidModelName="nullSolid"
porosityModelName="fracturePorosity"
permeabilityModelName="fracturePerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
referencePressure="0.0"
compressibility="0.0"/>
<ParallelPlatesPermeability
name="fracturePerm"/>
<FrictionlessContact
name="fractureContact"/>
<HydraulicApertureTable
name="hApertureModel"
apertureTableName="apertureTable"/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection,
apertureCollection, hydraulicApertureCollection and areaCollection are specified to output the time
history of fracture characterisctics (pressure, width and area). objectPath="ElementRegions/Fracture/
FractureSubRegion" indicates that these PackCollection tasks are applied to the fracure element subregion.
<Tasks>
<PackCollection
name="pressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"/>
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementAperture"/>
<PackCollection
name="hydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"/>
<PackCollection
name="areaCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementArea"/>
<!-- Collect aperture, pressure at the source for curve checks -->
<PackCollection
name="sourcePressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"
setNames="{ source }"/>
<PackCollection
name="sourceHydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"
setNames="{ source }"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for the recurring tasks.
GEOS writes one file named after the string defined in the filename keyword and formatted as a HDF5 file
(pennyShapedViscosityDominated_output.hdf5). This TimeHistory file contains the collected time history in-
formation from specified time history collector. This file includes datasets for the simulation time, fluid pressure, ele-
ment aperture, hydraulic aperture and element area for the propagating hydraulic fracture. A Python script is prepared
to read and query any specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="waterDensity"
initialCondition="1"
setNames="{ fracture }"
objectPath="ElementRegions"
fieldName="water_density"
scale="1000"/>
<FieldSpecification
name="separableFace"
initialCondition="1"
setNames="{ core }"
objectPath="faceManager"
fieldName="isFaceSeparable"
scale="1"/>
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/Fracture"
scale="-6.625"
(continues on next page)
The parameters used in the simulation are summarized in the following table.
Inspecting results
The following figure shows the distribution of 𝜎𝑧𝑧 at 𝑡 = 400𝑠 within the computational domain..
the HDF5 output is postprocessed and temporal evolution of fracture characterisctics (fluid pressure and fracture width
at fluid inlet and fracure radius) are saved into a txt file model-results.txt, which can be used for verification and
visualization:
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
Next, GEOS simulation results (markers) and asymptotic solutions (curves) for the case with viscosity-storage domi-
nated assumptions are plotted together in the following figure, which is generated using the visualization script:
python ./pennyShapedViscosityDominatedFigure.py
As seen, GEOS predictions of the temporal evolution of fracture radius, wellbore aperture and pressure at fluid inlet
are nearly identical to the asymptotic solutions.
2.0
Fracture Mouth Opening (mm)
Fracture Half Length (m)
60 1.5
40 1.0
20 0.5
Asymptotic ( KIC => 0, CL => 0 )
GEOSX ( KIC => 0, CL => 0 )
100 200 300 400 0.0 100 200 300 400
Time (s) Time (s)
1.50
Net Pressure at Well (MPa)
1.25
1.00
0.75
0.50
0.25
0.00 100 200 300 400
Time (s)
To go further
Context
In this example, we simulate the propagation of a Perkins–Kern–Nordgren (PKN) fracture in a viscosity-storage-
dominated regime, a classic benchmark in hydraulic fracturing. The developed planar fracture displays an elliptical
vertical cross-section. Unlike KGD and penny-shaped fractures, the growth height of a PKN fracture is constrained
by mechanical barriers (such as bedding layers, sedimentary laminations, or weak interfaces), thus promoting lateral
propagation. This problem is solved using the hydrofracture solver in GEOS to obtain the temporal evolutions of the
fracture characteristics (length, aperture, and pressure). We validate these simulated values against existing analytical
solutions (Kovalyshen and Detournay, 2010; Economides and Nolte, 2000).
Input file
This example uses no external input files. Everything we need is contained within two GEOS input files:
inputFiles/hydraulicFracturing/pknViscosityDominated_base.xml
inputFiles/hydraulicFracturing/pknViscosityDominated_benchmark.xml
Python scripts for post-processing and visualizing the simulation results are also prepared:
inputFiles/hydraulicFracturing/scripts/hydrofractureQueries.py
inputFiles/hydraulicFracturing/scripts/hydrofractureFigure.py
In this example, a hydraulic fracture initiates and propagates from the center of a 20m-thick layer. This layer is ho-
mogeneous and bounded by neighboring upper and lower layers. For viscosity-dominated fractures, more energy is
necessary to move the fracturing fluid than to split the intact rock. If fluid leak-off is neglected, storage-dominated
propagation occurs with most of the injected fluid confined within the open surfaces. To meet the requirements of the
viscosity-storage-dominated assumptions, impermeable domain √ (no fluid leak-off), incompressible fluid with constant
viscosity (1.0𝑐𝑝) and ultra-low rock toughness (0.1𝑀 𝑃 𝑎 𝑚) are chosen in the GEOS simulation. With these param-
eters, the fracture stays within the target layer; it extends horizontally and meets the conditions of the PKN fracture in
a viscosity-storage-dominated regime.
We assume that the fluid injected in the fracture follows the lubrication equation resulting from mass conservation and
Poiseuille’s law. The fracture propagates by creating new surfaces if the stress intensity factor exceeds the local rock
toughness 𝐾𝐼𝐶 . As the geometry of the PKN fracture exhibits symmetry, the simulation is reduced to a quarter-scale.
For verification purposes, a plane strain deformation is considered in the numerical model.
We set up and solve a hydraulic fracture model to obtain the temporal solutions of the fracture half length 𝑙, the net pres-
sure 𝑝0 and the fracture aperture 𝑤0 at the fluid inlet for the PKN fracture propagating in viscosity-storage-dominated
regime. Kovalyshen and Detournay (2010) and Economides and Nolte (2000) derived the analytical solutions for this
classic hydraulic fracture problem, used here to verify the results of the GEOS simulations:
𝐸𝑝 𝑄30 𝑡4 1/5
𝑙(𝑡) = 0.3817( )
𝜇ℎ4
𝜇𝑄0 𝑙 1/4
𝑤0 (𝑡) = 3( )
𝐸𝑝
Mesh
We use the internal mesh generator to create a computational domain (400 𝑚 × 400 𝑚 × 800 𝑚), as parametrized in
the InternalMesh XML tag. The structured mesh contains 105 x 105 x 60 eight-node brick elements in the x, y, and
z directions respectively. Such eight-node hexahedral elements are defined as C3D8 elementTypes, and their collection
forms a mesh with one group of cell blocks named here cb1. Local refinement is performed for the elements in the
vicinity of the fracture plane.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 150, 200, 400 }"
yCoords="{ 0, 150, 200, 400 }"
zCoords="{ -400, -100, -20, 20, 100, 400 }"
nx="{ 75, 10, 20 }"
ny="{ 75, 10, 20 }"
nz="{ 10, 10, 20, 10, 10 }"
(continues on next page)
The fracture plane is defined by a nodeset occupying a small region within the computational domain, where the fracture
tends to open and propagate upon fluid injection:
<Box
name="core"
xMin="{ -500.1, -500.1, -0.1 }"
xMax="{ 500.1, 10.1, 0.1 }"/>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
Three elementary solvers are combined in the solver hydrofracture to model the coupling between fluid flow within
the fracture, rock deformation, fracture deformation and propagation:
<Hydrofracture
name="hydrofracture"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
surfaceGeneratorName="SurfaceGen"
logLevel="1"
targetRegions="{ Fracture }"
maxNumResolves="5"
initialDt="0.1">
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="10"
maxTimeStepCuts="5"
maxAllowedResidualNorm="1e+15"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="mgr"
logLevel="1"
krylovAdaptiveTol="1"/>
</Hydrofracture>
• Rock and fracture deformations are modeled by the solid mechanics solver SolidMechanicsLagrangianSSLE.
In this solver, we define targetRegions that includes both the continuum region and the fracture region. The
name of the contact constitutive behavior is specified in this solver by the contactRelationName.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
contactRelationName="fractureContact"
contactPenaltyStiffness="1.0e0">
<NonlinearSolverParameters
(continues on next page)
• The single-phase fluid flow inside the fracture is solved by the finite volume method in the solver
SinglePhaseFVM.
<SinglePhaseFVM
name="SinglePhaseFlow"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="10"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-12"/>
</SinglePhaseFVM>
• The solver SurfaceGenerator defines the fracture region and rock toughness rockToughness="0.1e6".
With nodeBasedSIF="1", a node-based Stress Intensity Factor (SIF) calculation is chosen for the fracture prop-
agation criterion.
<SurfaceGenerator
name="SurfaceGen"
targetRegions="{ Domain }"
nodeBasedSIF="1"
rockToughness="0.1e6"
mpiCommOrder="1"/>
Constitutive laws
For this problem, a homogeneous and isotropic domain with one solid material is assumed. Its mechanical prop-
erties and associated fluid rheology are specified in the Constitutive section. ElasticIsotropic model is
used to describe the mechanical behavior of rock when subjected to fluid injection. The single-phase fluid model
CompressibleSinglePhaseFluid is selected to simulate the response of water upon fracture propagation.
<Constitutive>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.0"
compressibility="5e-12"
referenceViscosity="1.0e-3"
viscosibility="0.0"/>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
(continues on next page)
<CompressibleSolidParallelPlatesPermeability
name="fractureFilling"
solidModelName="nullSolid"
porosityModelName="fracturePorosity"
permeabilityModelName="fracturePerm"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
referencePressure="0.0"
compressibility="0.0"/>
<ParallelPlatesPermeability
name="fracturePerm"/>
<FrictionlessContact
name="fractureContact"/>
<HydraulicApertureTable
name="hApertureModel"
apertureTableName="apertureTable"/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection,
apertureCollection, hydraulicApertureCollection and areaCollection are specified to output the time
history of fracture characterisctics (pressure, width and area). objectPath="ElementRegions/Fracture/
FractureSubRegion" indicates that these PackCollection tasks are applied to the fracure element subregion.
<Tasks>
<PackCollection
name="pressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"/>
<PackCollection
name="apertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementAperture"/>
<PackCollection
name="areaCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="elementArea"/>
<!-- Collect aperture, pressure at the source for curve checks -->
<PackCollection
name="sourcePressureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="pressure"
setNames="{ source }"/>
<PackCollection
name="sourceHydraulicApertureCollection"
objectPath="ElementRegions/Fracture/FractureSubRegion"
fieldName="hydraulicAperture"
setNames="{ source }"/>
</Tasks>
These tasks are triggered using the Event manager with a PeriodicEvent defined for the recurring tasks.
GEOS writes one file named after the string defined in the filename keyword and formatted as a HDF5 file
(pknViscosityDominated_output.hdf5). This TimeHistory file contains the collected time history information
from specified time history collector. This file includes datasets for the simulation time, fluid pressure, element aper-
ture, hydraulic aperture and element area for the propagating hydraulic fracture. A Python script is prepared to read
and query any specified subset of the time history data for verification and visualization.
<FieldSpecification
name="frac"
initialCondition="1"
setNames="{ fracture }"
objectPath="faceManager"
fieldName="ruptureState"
scale="1"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<SourceFlux
name="sourceTerm"
objectPath="ElementRegions/Fracture"
scale="-6.625"
setNames="{ source }"/>
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table.
Inspecting results
The following figure shows the distribution of 𝜎𝑧𝑧 at 𝑡 = 200𝑠 within the computational domain..
the HDF5 output is postprocessed and temporal evolution of fracture characterisctics (fluid pressure and fracture width
at fluid inlet and fracure half length) are saved into a txt file model-results.txt, which can be used for verification
and visualization:
Note: GEOS python tools geosx_xml_tools should be installed to run the query script (See Python Tools Setup for
details).
Next, figure below shows the comparisons between the results from GEOS simulations (markers) and the corresponding
analytical solutions (curves) for the example with viscosity-storage dominated assumptions, which is generated using
the visualization script:
python ./pknViscosityDominatedFigure.py
The evolution in time of the fracture half-length, the near-wellbore fracture aperture, and the fluid pressure all correlate
well with the analytical solutions.
2.0
Fracture Mouth Opening (mm)
Fracture Half Length (m)
125
100 1.5
75 1.0
50
0.5
25 Asymptotic ( KIC => 0, CL => 0 )
GEOSX ( KIC => 0, CL => 0 )
0
50 100 150 200 0.0 50 100 150 200
Time (s) Time (s)
1.50
Net Pressure at Well (MPa)
1.25
1.00
0.75
0.50
0.25
0.00 50 100 150 200
Time (s)
To go further
Context
In this example, a simulation is built up to model a proppant slot test. In this way, the implemented proppant model
is validated by comparing numerical results with the corresponding experimental data. Furthermore, this calibrated
proppant model can allow field engineers to customize stimulation design and optimize field operations in multiple
engineering aspects (Huang et al., 2021).
Input file
This example uses no external input files and everything is contained within a single xml file that is located at:
inputFiles/proppant/ProppantSlotTest_base.xml
inputFiles/proppant/ProppantSlotTest_benchmark.xml
Chun et al. (2020) conducted slot tests on proppant transport with slickwater. As shown below, a 4 ft X 1 ft slot with
0.3 in gap width was constructed. Three fluid inlets with 0.5 in inner diameter were placed at the right side of the slot,
which were three inches away from each other. One outlet was placed on the top side to allow pressure relief. The other
one was located on the left side acting as a fluid sink. In their tests, to resemble a slickwater fracturing treatment, the
proppant concentration was kept at 1.5 ppg and the viscosity of carrying fluid was approximately 1 cp. The slurry was
mixed well and then injected into the flow channel at a constant injection rate of 6 gpm. A simulation case with the
same settings is built up to mimic these slot tests. A vertical and impermeable fracture surface is assumed in this case,
which eliminates the effect of fracture plane inclination and fluid leak-off. A static fracture with an uniform aperture
of 0.3 in is defined and fracture propagation is not involved. 30/50 mesh proppant is injected via the three inlets and is
flowed through the slot for 30 seconds.
To simulate proppant transport phenomenon, a proppant solver based on the assumption of multi-component single
phase flow is used in this example. Proppant concentration and distribution within the slot are numerically calculated
by solving the equations of proppant transport in hydraulic fractures. These numerical predictions are then validated
against the corresponding testing results (Chun et al., 2020).
In this example, we focus our attention on the Solvers, Constitutive and FieldSpecifications tags.
Mesh
The following figure shows the mesh used for solving this problem.
We use the internal mesh generator InternalMesh to create a computational domain. This mesh contains 2 x 97 x
24 eight-node brick elements in the x, y and z directions, respectively. Here, a structured three-dimensional mesh is
generated with C3D8 as the elementTypes (eight-node hexahedral elements). This mesh is defined as a cell block with
the name cb1.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
(continues on next page)
Fig. 1.36: Configuration of the slot for proppant transport experiment (after Chun et al., 2020)
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to define these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multi-physics solvers. The order of specifying these solvers is not
restricted in GEOS. Note that end-users should give each single-physics solver a meaningful and distinct name, as
GEOS will recognize these single-physics solvers based on their customized names and create user-expected coupling.
As demonstrated in this example, to setup a coupled proppant transport solver, we need to define three different solvers
in the XML file:
• the proppant transport solver for the fracture region, a solver of type ProppantTransport called here
ProppantTransport (see Proppant Transport Solver for more information),
<ProppantTransport
name="ProppantTransport"
logLevel="1"
updateProppantPacking="1"
proppantDiameter="4.5e-4"
frictionCoefficient="0.04"
criticalShieldsNumber="0.0"
maxProppantConcentration="0.62"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="8"
lineSearchAction="None"
maxTimeStepCuts="5"/>
<LinearSolverParameters
solverType="gmres"
krylovTol="1.0e-7"/>
</ProppantTransport>
• the single-phase flow solver, a solver of type SinglePhaseProppantFVM called here SinglePhaseFVM,
<SinglePhaseProppantFVM
name="SinglePhaseFVM"
logLevel="1"
discretization="singlePhaseTPFA"
(continues on next page)
• the coupling solver (FlowProppantTransport) that binds the two single-physics solvers above, which is named
as FlowProppantTransport
<FlowProppantTransport
name="FlowProppantTransport"
proppantSolverName="ProppantTransport"
flowSolverName="SinglePhaseFVM"
targetRegions="{ Fracture }"
logLevel="1"/>
In this example, let us focus on the coupling solver. This solver (FlowProppantTransport) describes the coupling
process between proppant and flow transport within the Fracture region. In this way, the two single-physics solvers
(ProppantTransport and SinglePhaseFVM) are sequentially called to solve the sub-problems (proppant transport
and pressure problem, respectively) involved in this test case.
Constitutive laws
For this slot test, 30/50 mesh proppant is injected via the three inlets and flowing through the slot for 30 seconds.
The viscosity of carrying fluid is 0.001 Pa.s to resemble slickwater fracturing. In this example, the solid and fluid
materials are named as sand and water respectively. Proppant characterization and fluid rheology are specified in the
Constitutive section:
<Constitutive>
<ProppantSlurryFluid
name="water"
referencePressure="1e5"
referenceDensity="1000"
compressibility="0.0"
maxProppantConcentration="0.62"
referenceViscosity="0.001"
referenceProppantDensity="2550.0"/>
<ParticleFluid
name="sand"
particleSettlingModel="Stokes"
hinderedSettlingCoefficient="4.5"
proppantDensity="2550.0"
proppantDiameter="4.5e-4"
maxProppantConcentration="0.62"/>
<NullModel
name="nullSolid"/>
<ProppantPorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
maxProppantConcentration="0.62"/>
<ProppantPermeability
name="fracturePerm"
proppantDiameter="4.5e-4"
maxProppantConcentration="0.62"/>
</Constitutive>
The constitutive parameters such as proppant density and proppant diameter are specified in the International System
of Units.
<FieldSpecification
name="fracAp"
initialCondition="1"
objectPath="ElementRegions/Fracture"
fieldName="elementAperture"
scale="7.62e-3"
setNames="{ fracture }"/>
<FieldSpecification
name="frac1"
(continues on next page)
<FieldSpecification
name="frac2"
initialCondition="1"
objectPath="ElementRegions/Fracture"
fieldName="proppantConcentration"
scale="0.0"
component="0"
setNames="{ fracture }"/>
<FieldSpecification
name="frac3"
initialCondition="1"
objectPath="ElementRegions/Fracture"
fieldName="isProppantBoundary"
component="0"
setNames="{ fracture }"/>
<FieldSpecification
name="frac4"
initialCondition="1"
objectPath="ElementRegions/Fracture"
fieldName="isProppantBoundary"
scale="1"
component="0"
setNames="{ left0 }"/>
<SourceFlux
name="left1a"
objectPath="ElementRegions/Fracture"
scale="-0.14"
component="0"
setNames="{ left1 }"/>
<FieldSpecification
name="left1b"
objectPath="ElementRegions/Fracture"
fieldName="proppantConcentration"
scale="0.07"
component="0"
setNames="{ left1 }"/>
<SourceFlux
name="left2a"
objectPath="ElementRegions/Fracture"
scale="-0.14"
(continues on next page)
<FieldSpecification
name="left2b"
objectPath="ElementRegions/Fracture"
fieldName="proppantConcentration"
scale="0.07"
component="0"
setNames="{ left2 }"/>
<SourceFlux
name="left3a"
objectPath="ElementRegions/Fracture"
scale="-0.14"
component="0"
setNames="{ left3 }"/>
<FieldSpecification
name="left3b"
objectPath="ElementRegions/Fracture"
fieldName="proppantConcentration"
scale="0.07"
component="0"
setNames="{ left3 }"/>
<FieldSpecification
name="right1"
objectPath="ElementRegions/Fracture"
fieldName="pressure"
scale="0.0"
component="0"
setNames="{ right }"/>
<FieldSpecification
name="right2"
objectPath="ElementRegions/Fracture"
fieldName="proppantConcentration"
scale="0.0"
component="0"
setNames="{ right }"/>
</FieldSpecifications>
Note: For static (non-propagating) fracture problems, the fields ruptureState and elementAperture should be
provided in the initial conditions. FieldName="pressure" here means that the source flux term is added to the mass
balance equation for pressure.
The parameters used in the simulation are summarized in the following table.
Inspecting results
The following figure shows the modelling prediction of proppant distribution at 10 s and 30 s, which are compared
with the experiments in (Chun et al., 2020). Due to proppant settling in low viscosity fluid, a heterogeneous proppant
distribution is obtained, which evolves with injection time. Three different zones (immobile proppant bed, suspended
proppant and clean fluid) are visually identified for both the presented experiment and simulation.
As shown below, consistently, the modelling predictions (green curve) on proppant transport and distribution show a
good agreement with the reported experimental data (red dot) at each time.
To go further
1.2 0.5
Normalized Bank Length (a) (b)
1.0
0.0 0.0
0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40
Time (s) Time (s)
Wellbore Problems
Kirsch Wellbore Problem
Context
In this example, we simulate a vertical elastic wellbore subjected to in-situ stress and the induced elastic deformation
of the reservoir rock. Kirsch’s solution to this problem provides the stress and displacement fields developing around
a circular cavity, which is hereby employed to verify the accuracy of the numerical results. For this example, the
TimeHistory function and python scripts are used to output and post-process multi-dimensional data (stress and
displacement).
Input file
Everything required is contained within two GEOS input files located at:
inputFiles/solidMechanics/KirschProblem_base.xml
inputFiles/solidMechanics/KirschProblem_benchmark.xml
We solve a drained wellbore problem subjected to anisotropic horizontal stress (𝜎𝑥𝑥 and 𝜎𝑦𝑦 ) as shown below. This
is a vertical wellbore drilled in an infinite, homogeneous, isotropic, and elastic medium. Far-field in-situ stresses and
internal supporting pressure acting at the circular cavity cause a mechanical deformation of the reservoir rock and
stress concentration in the near-wellbore region. For verification purpose, a plane strain condition is considered for the
numerical model.
In this example, stress (𝜎𝑟𝑟 , 𝜎𝜃𝜃 , and 𝜎𝑟𝜃 ) and displacement (𝑢𝑟 and 𝑢𝜃 ) fields around the wellbore are calculated
numerically. These numerical predictions are compared with the corresponding Kirsch solutions (Poulos and Davis,
1974).
𝜎𝑥𝑥 + 𝜎𝑦𝑦 𝑎0 𝜎𝑥𝑥 − 𝜎𝑦𝑦 𝑎0 𝑎0 𝑎0
𝜎𝑟𝑟 = [1 − ( )2 ] + [1 − 4( )2 + 3( )4 ]cos (2𝜃) + 𝑃𝑤 ( )2
2 𝑟 2 𝑟 𝑟 𝑟
𝜎𝑥𝑥 + 𝜎𝑦𝑦 𝑎0 2 𝜎𝑥𝑥 − 𝜎𝑦𝑦 𝑎0 4 𝑎0 2
𝜎𝜃𝜃 = [1 + ( ) ] − [1 + 3( ) ]cos (2𝜃) − 𝑃𝑤 ( )
2 𝑟 2 𝑟 𝑟
𝜎𝑥𝑥 − 𝜎𝑦𝑦 𝑎0 2 𝑎0 4
𝜎𝑟𝜃 = − [1 + 2( ) − 3( ) ]sin (2𝜃)
2 𝑟 𝑟
(𝑎0 )2 𝜎𝑥𝑥 + 𝜎𝑦𝑦 𝜎𝑥𝑥 − 𝜎𝑦𝑦 𝑎0
𝑢𝑟 = − [ + (4(1 − 𝜈) − ( )2 )cos (2𝜃) − 𝑃𝑤 ]
2𝐺𝑟 2 2 𝑟
(𝑎0 )2 𝜎𝑥𝑥 − 𝜎𝑦𝑦 𝑎0 2
𝑢𝜃 = [2(1 − 2𝜈) + ( ) ]sin (2𝜃)
2𝐺𝑟 2 𝑟
where 𝑎0 is the intiial wellbore radius, 𝑟 is the radial coordinate, 𝜈 is the Poisson’s ratio, 𝐺 is the shear modulus, 𝑃𝑤
is the normal traction acting on the wellbore wall, the angle 𝜃 is measured with respect to x-z plane and defined as
positive in counter-clockwise direction.
In this example, we focus our attention on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
Following figure shows the generated mesh that is used for solving this wellbore problem.
Let us take a closer look at the geometry of this wellbore problem. We use the internal wellbore mesh generator
InternalWellbore to create a rock domain (10 𝑚 × 5 𝑚 × 2 𝑚), with a wellbore of initial radius equal to 0.1
m. Only half of the domain is modeled by a theta angle from 0 to 180, assuming symmetry for the rest of the
domain. Coordinates of trajectory defines the wellbore trajectory, a vertical well in this example. By turning on
autoSpaceRadialElems="{ 1 }", the internal mesh generator automatically sets number and spacing of elements in
the radial direction, which overrides the values of nr. With useCartesianOuterBoundary="0", a Cartesian aligned
boundary condition is enforced on the outer blocks. This way, a structured three-dimensional mesh is created with 50 x
40 x 2 elements in the radial, tangential and z directions, respectively. All elements are eight-node hexahedral elements
(C3D8) and refinement is performed to conform with the wellbore geometry. This mesh is defined as a cell block with
the name cb1.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 5.0 }"
theta="{ 0, 180 }"
zCoords="{ -1, 1 }"
nr="{ 40 }"
nt="{ 40 }"
nz="{ 2 }"
trajectory="{ { 0.0, 0.0, -1.0 },
{ 0.0, 0.0, 1.0 } }"
autoSpaceRadialElems="{ 1 }"
useCartesianOuterBoundary="0"
cellBlockNames="{ cb1 }"/>
</Mesh>
For a drained wellbore problem, the pore pressure variation is omitted. Therefore, we just need to define a solid
mechanics solver, which is called mechanicsSolver. This solid mechanics solver (see Solid Mechanics Solver) is
based on the Lagrangian finite element formulation. The problem is run as QuasiStatic without considering inertial
effects. The computational domain is discretized by FE1, which is defined in the NumericalMethods section. The
material is named rock, whose mechanical properties are specified in the Constitutive section.
Constitutive laws
For this drained wellbore problem, we simulate a linear elastic deformation around the circular cavity. A homogeneous
and isotropic domain with one solid material is assumed, with mechanical properties specified in the Constitutive
section:
<Constitutive>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="5.0e8"
defaultShearModulus="3.0e8"
/>
</Constitutive>
Recall that in the SolidMechanics_LagrangianFEM section, rock is the material in the computational domain. Here,
the isotropic elastic model ElasticIsotropic simulates the mechanical behavior of rock.
The constitutive parameters such as the density, the bulk modulus, and the shear modulus are specified in the Interna-
tional System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, stressCollection and
displacementCollection tasks are specified to output the resultant stresses (tensor stored as an array with Voigt
notation) and total displacement field (stored as a 3-component vector) respectively.
<Tasks>
<PackCollection
name="stressCollection"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"/>
<PackCollection
name="displacementCollection"
objectPath="nodeManager"
fieldName="totalDisplacement"/>
</Tasks>
These two tasks are triggered using the Event management, where PeriodicEvent are defined for these recurring
tasks. GEOS writes two files named after the string defined in the filename keyword and formatted as HDF5 files
(displacement_history.hdf5 and stress_history.hdf5). The TimeHistory file contains the collected time history infor-
mation from each specified time history collector. This information includes datasets for the simulation time, element
center or nodal position, and the time history information. Then, a Python script is prepared to access and plot any
specified subset of the time history data for verification and visualization.
<FieldSpecifications>
<FieldSpecification
name="Sxx"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="0"
scale="-11.25e6"
/>
<FieldSpecification
name="Syy"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="1"
scale="-9.0e6"
/>
<FieldSpecification
name="Szz"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="2"
scale="-15.0e6"
/>
<Traction
name="WellLoad"
setNames="{ rneg }"
objectPath="faceManager"
scale="-2.0e6"
(continues on next page)
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{xneg, xpos}"
/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{tneg, tpos, ypos}"
/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{zneg, zpos}"
/>
</FieldSpecifications>
With tractionType="normal", traction is applied to the wellbore wall rneg as a pressure specified as the scalar
product of scale scale="-2.0e6" and the outward face normal vector. In this case, the loading magnitude of the
traction does not change with time.
You may note :
• All initial value fields must have initialCondition field set to 1;
• The setName field points to the previously defined set to apply the fields;
• nodeManager and faceManager in the objectPath indicate that the boundary conditions are applied to the
element nodes and faces, respectively;
• fieldName is the name of the field registered in GEOS;
• Component 0, 1, and 2 refer to the x, y, and z direction, respectively;
• And the non-zero values given by scale indicate the magnitude of the loading;
• Some shorthand, such as xneg and xpos, are used as the locations where the boundary conditions are applied
in the computational domain. For instance, xneg means the face of the computational domain located at the
left-most extent in the x-axis, while xpos refers to the face located at the right-most extent in the x-axis. Similar
shorthands include ypos, yneg, zpos, and zneg;
• The mud pressure loading and in situ stresses have negative values due to the negative sign convention for com-
pressive stress in GEOS.
The parameters used in the simulation are summarized in the following table.
Inspecting results
In the above examples, we request VTK output files that can be imported into Paraview to visualize the outcome. The
following figure shows the distribution of 𝜎𝑥𝑥 in the near wellbore region.
We use time history function to collect time history information and run a Python script to query and plot the results.
The figure below shows the comparisons between the numerical predictions (marks) and the corresponding analytical
solutions (solid curves) with respect to the distributions of stress components and displacement at 𝜃 = 45 degrees.
Predictions computed by GEOS match the analytical results.
0.0 0.25
2.5 0.00
Displacement (mm)
5.0 0.25
(MPa)
7.5
0.50
10.0
rr - Analytical 0.75
12.5 rr - GEOSX
15.0
- Analytical 1.00 ur - Analytical
- GEOSX ur - GEOSX
r - Analytical 1.25 u - Analytical
17.5 r - GEOSX u - GEOSX
10 1 100 10 1 100
r (m) r (m)
To go further
Problem description
This example uses the solid mechanics solver to handle a cased wellbore problem subjected to a pressure test. The com-
pleted wellbore is composed of a steel casing, a cement sheath and rock formation. Isotropic linear elastic behavior is
assumed for all the three materials. No separation is allowed for the casing-cement and cement-rock contact interfaces.
Analytical results of the radial and hoop stresses, 𝜎𝑟𝑟 and 𝜎𝜃𝜃 , in casing, cement sheath and rock are expressed as
(Hervé and Zaoui, 1995) :
2𝐺𝐵
𝜎𝑟𝑟 = (2𝜆 + 2𝐺)𝐴 −
𝑟2
2𝐺𝐵
𝜎𝜃𝜃 = (2𝜆 + 2𝐺)𝐴 +
𝑟2
where 𝜆 and 𝐺 are the Lamé moduli, 𝑟 is the radial coordinate, 𝐴 and 𝐵 are piecewise constants that are obtained by
solving the boundary and interface conditions, as detailed in the post-processing script.
Input file
This benchmark example uses no external input files and everything required is contained within two GEOS xml files
that are located at:
inputFiles/wellbore/CasedElasticWellbore_base.xml
and
inputFiles/wellbore/CasedElasticWellbore_benchmark.xml
inputFiles/wellbore/CasedElasticWellbore_smoke.xml
In this example, we would focus our attention on the Solvers, Mesh and Constitutive tags.
As fluid flow is not considered, only the solid mechanics SolidMechanicsLagrangianSSLE solver is required for
solving this linear elastic problem. In this solver, the three regions and three materials associated to casing, cement
sheath and rock are respectively defined by targetRegions and solidMaterialNames.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="0"
targetRegions="{ casing, cement, rock }">
The internal wellbore mesh generator InternalWellbore is employed to create the mesh of this wellbore problem.
The radii of the casing cylinder, the cement sheath cylinder and the far-field boundary of the surrounding rock formation
are defined by a vector radius. In the tangent direction, theta angle is specified from 0 to 360 degree for a full
geometry of the domain. Note that a half or a quarter of the domain can be defined by a theta angle from 0 to
180 or 90 degree, respectively. The trajectory of the well is defined by trajectory, which is vertical in this case.
The autoSpaceRadialElems parameters allow optimally increasing the element size from local zone around the
wellbore to the far-field zone. In this example, the auto spacing option is only applied for the rock formation. The
useCartesianOuterBoundary transforms the far-field boundary to a squared shape to enforce a Cartesian aligned
outer boundary, which eases the loading of the boundary conditions. The cellBlockNames and elementTypes define
the regions and related element types associated to casing, cement sheath and rock.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8, C3D8, C3D8 }"
radius="{ 0.1, 0.106, 0.133, 2.0 }"
theta="{ 0, 360 }"
zCoords="{ 0, 1 }"
nr="{ 10, 20, 10 }"
nt="{ 320 }"
nz="{ 1 }"
trajectory="{ { 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 1.0 } }"
autoSpaceRadialElems="{ 0, 0, 1 }"
useCartesianOuterBoundary="2"
cellBlockNames="{ casing, cement, rock }"
/>
</Mesh>
Isotropic linear elastic constitutive behavior is considered for all the three materials. Note that the default density is
useless for this case.
<ElasticIsotropic
name="casing"
defaultDensity="2700"
defaultBulkModulus="175e9"
(continues on next page)
<ElasticIsotropic
name="cement"
defaultDensity="2700"
defaultBulkModulus="10.3e9"
defaultShearModulus="6.45e9"/>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="5.5556e9"
defaultShearModulus="4.16667e9"/>
Boundary conditions
Far-field boundary are subjected to roller constraints. The normal traction on the inner face of the casing is defined
by Traction field specification. The nodeset generated by the internal wellbore generator for this face is named as
rneg. The traction type is normal to mimic a casing test pressure that is applied normal to the casing inner face . The
negative sign of the scale is attributed to the negative sign convention for compressive stress in GEOS.
<FieldSpecifications>
<FieldSpecification
name="xConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<FieldSpecification
name="yConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<Traction
name="innerPressure"
objectPath="faceManager"
tractionType="normal"
scale="-10.0e6"
(continues on next page)
A good agreement between the GEOS results and analytical results is shown in the figure below:
5.75
2.25 GEOSX result
Analytic
5.50
2.50
5.25
2.75
Radial stress (MPa)
To go further
Problem description
This example uses the solid mechanics solver to handle a deviated wellbore problem with open hole completion. This
wellbore is subjected to a mud pressure at wellbore wall and undrained condition is assumed (no fluid flow in the
rock formation). A segment of the wellbore with isotropic linear elastic deformation is simulated in this case. Far
field stresses and gravity effect are excluded. The main goal of this example is to validate the internal wellbore mesh
generator and mechanics solver for the case of an inclined wellbore.
Analytical results of the radial and hoop stresses, 𝜎𝑟𝑟 and 𝜎𝜃𝜃 , around the wellbore are expressed as (Detournay and
Cheng, 1988) :
𝑎2
𝜎𝑟𝑟 = 𝑝0
𝑟2
𝑎2
𝜎𝜃𝜃 = −𝑝0
𝑟2
where 𝑝0 is the applied mud pressure at wellbore wall, 𝑎 is the wellbore radius and 𝑟 is the radial coordinate.
Input file
This benchmark example uses no external input files and everything required is contained within two GEOS xml files
that are located at:
inputFiles/wellbore/DeviatedElasticWellbore_base.xml
and
inputFiles/wellbore/DeviatedElasticWellbore_benchmark.xml
inputFiles/wellbore/DeviatedElasticWellbore_smoke.xml
As fluid flow is not considered, only the solid mechanics solver SolidMechanicsLagrangianSSLE is required for
solving this wellbore problem.
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="0"
targetRegions="{ Omega }"
>
The internal wellbore mesh generator InternalWellbore is employed to create the mesh of this wellbore problem.
The radius of the wellbore and the size of the surrounding rock formation are defined by a vector radius. In the tangent
direction, theta angle is specified from 0 to 180 degree for a half of the domain regarding its symmetry. Note that the
whole domain could be specified with a theta angle from 0 to 360 degree, if modeling complicated scenarios. The
trajectory of the well is defined by trajectory. In this example, the wellbore is inclined in the x-z plane by an angle
of 45 degree. The autoSpaceRadialElems parameter allows optimally increasing the element size from local zone
around the wellbore to the far-field zone, which is set to 1 to activate this option. The useCartesianOuterBoundary
transforms the far-field boundary to a squared shape to enforce a Cartesian aligned outer boundary, which eases the
loading of the far-field boundary conditions. In this example, this value is set to 0 for the single region along the radial
direction.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 2 }"
theta="{ 0, 180 }"
zCoords="{ -0.5, 0.5 }"
nr="{ 30 }"
nt="{ 80 }"
nz="{ 100 }"
trajectory="{ { -0.5, 0.0, -0.5 },
{ 0.5, 0.0, 0.5 } }"
autoSpaceRadialElems="{ 1 }"
useCartesianOuterBoundary="0"
(continues on next page)
Constitutive law
Isotropic linear elastic constitutive behavior is considered for the rock around the wellbore. Note that the default density
is useless in this specific example, as gravity effect is neglected.
<ElasticIsotropic
name="shale"
defaultDensity="2700"
defaultBulkModulus="5.5556e9"
defaultShearModulus="4.16667e9"/>
Boundary conditions
Far-field boundaries are subjected to roller constraints and in-situ stresses are not considered. The mud pressure on
the wellbore wall is defined by Traction field specification. The nodeset generated by the internal wellbore generator
for this face is named as rneg. The traction type is normal to mimic a pressure that is applied normal to the wellbore
wall. The negative sign of the scale is attributed to the negative sign convention for compressive stresses in GEOS.
<FieldSpecifications>
<FieldSpecification
name="yConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg, tpos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg }"/>
<Traction
name="innerPressure"
objectPath="faceManager"
tractionType="normal"
scale="-10.e6"
setNames="{ rneg }"/>
</FieldSpecifications>
A good agreement between the GEOS results and the corresponding analytical solutions is shown in the figure below:
To go further
Context
The main goal of this example is to learn how to use the internal wellbore mesh generator and an elasto-plastic model
to handle wellbore problems in GEOS. The Extended Drucker-Prager model (see Model: Extended Drucker-Prager)
is applied to solve for elastoplastic deformation within the vicinity of a vertical wellbore. For the presented example,
an analytical solution is employed to verify the accuracy of the numerical results. The resulting model can be used as
a base for more complex analysis (e.g., wellbore drilling, fluid injection and storage scenarios).
Objectives
0 GEOSX result
10 Analytic
2 8
4 6
Radial stress (MPa)
6 4
8 2
10 0
0.100 0.125 0.150 0.175 0.200 0.225 0.250 0.275 0.300 0.100 0.125 0.150 0.175 0.200 0.225 0.250 0.275 0.300
r (m) r (m)
inputFiles/solidMechanics/ExtendedDruckerPragerWellbore_base.xml
inputFiles/solidMechanics/ExtendedDruckerPragerWellbore_benchmark.xml
The Python scripts for post-processing GEOS results, analytical restuls and validation plots are also provided in this
example.
We simulate a drained wellbore problem subjected to isotropic horizontal stress (𝜎ℎ ) and vertical stress (𝜎𝑣 ). By
lowering the wellbore supporting pressure (𝑃𝑤 ), the wellbore contracts, and the reservoir rock experiences elastoplastic
deformation. A plastic zone develops in the near wellbore region, as shown below.
Fig. 1.42: Sketch of the wellbore problem (Chen and Abousleiman, 2017)
To simulate this phenomenon, the strain hardening Extended Drucker-Prager model with an associated plastic flow rule
in GEOS is used in this example. Displacement and stress fields around the wellbore are numerically calculated. These
numerical predictions are then compared with the corresponding analytical solutions (Chen and Abousleiman, 2017)
from the literature.
All inputs for this case are contained inside a single XML file. In this example, we focus our attention on the Mesh
tags, the Constitutive tags, and the FieldSpecifications tags.
Mesh
Following figure shows the generated mesh that is used for solving this 3D wellbore problem
Let us take a closer look at the geometry of this wellbore problem. We use the internal mesh generator
InternalWellbore to create a rock domain (10 𝑚 × 10 𝑚 × 2 𝑚), with a wellbore of initial radius equal to 0.1
m. Coordinates of trajectory defines the wellbore trajectory, which represents a vertical well in this example. By
turning on autoSpaceRadialElems="{ 1 }", the internal mesh generator automatically sets number and spacing of
elements in the radial direction, which overrides the values of nr. In this way, a structured three-dimensional mesh is
created. All the elements are eight-node hexahedral elements (C3D8) and refinement is performed to conform with the
wellbore geometry. This mesh is defined as a cell block with the name cb1.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 10.0 }"
(continues on next page)
For the drained wellbore problem, the pore pressure variation is omitted and can be subtracted from the analysis.
Therefore, we just need to define a solid mechanics solver, which is called mechanicsSolver. This solid mechanics
solver (see Solid Mechanics Solver) is based on the Lagrangian finite element formulation. The problem is run as
QuasiStatic without considering inertial effects. The computational domain is discretized by FE1, which is defined
in the NumericalMethods section. The material is named as rock, whose mechanical properties are specified in the
Constitutive section.
<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">
<SolidMechanics_LagrangianFEM
name="mechanicsSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Omega }"
>
<LinearSolverParameters
directParallel="0"/>
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="15"/>
</SolidMechanics_LagrangianFEM>
</Solvers>
Constitutive laws
For this drained wellbore problem, we simulate the elastoplastic deformation caused by wellbore contraction. A homo-
geneous domain with one solid material is assumed, whose mechanical properties are specified in the Constitutive
section:
<Constitutive>
<ExtendedDruckerPrager
name="rock"
defaultDensity="2700"
defaultBulkModulus="0.5e9"
defaultShearModulus="0.3e9"
defaultCohesion="0.0"
defaultInitialFrictionAngle="15.27"
(continues on next page)
</Constitutive>
Recall that in the SolidMechanics_LagrangianFEM section, rock is designated as the material in the computational
domain. Here, Extended Drucker Prager model ExtendedDruckerPrager is used to simulate the elastoplastic behav-
ior of rock. As for the material parameters, defaultInitialFrictionAngle, defaultResidualFrictionAngle
and defaultCohesion denote the initial friction angle, the residual friction angle, and cohesion, respectively, as
defined by the Mohr-Coulomb failure envelope. In this example, zero cohesion is considered to consist with the ref-
erence analytical results. As the residual friction angle defaultResidualFrictionAngle is larger than the ini-
tial one defaultInitialFrictionAngle, a strain hardening model is adopted, whose hardening rate is given as
defaultHardening="0.01". If the residual friction angle is set to be less than the initial one, strain weakening
will take place. Setting defaultDilationRatio="1.0" corresponds to an associated flow rule. The constitutive
parameters such as the density, the bulk modulus, and the shear modulus are specified in the International System of
Units.
<FieldSpecification
name="stressYY"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="1"
scale="-11.25e6"/>
<FieldSpecification
(continues on next page)
<Traction
name="ExternalLoad"
setNames="{ rneg }"
objectPath="faceManager"
scale="1.0"
tractionType="normal"
functionName="timeFunction"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ tpos, rpos }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg, rpos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
</FieldSpecifications>
With tractionType="normal", traction is applied to the wellbore wall rneg as a pressure specified from the product
of scale scale="1.0" and the outward face normal. A table function timeFunction is used to define the time-
dependent traction ExternalLoad. The coordinates and values form a time-magnitude pair for the loading time
history. In this case, the loading magnitude decreases linearly as the time evolves.
<Functions>
<TableFunction
name="timeFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 1.0, 1e99 }"
values="{ -11.25e6, -2.0e6, -2.0e6 }"/>
(continues on next page)
Inspecting results
In the above example, we requested hdf5 output files. We can therefore use python scripts to visualize the outcome.
Below figure shows the comparisons between the numerical predictions (marks) and the corresponding analytical solu-
tions (solid curves) with respect to the distributions of principal stress components, stress path on the wellbore surface,
the supporting wellbore pressure and wellbore size. It is clear that the GEOS predictions are in excellent agreement
with the analytical results. On the top-right figure, we added also a comparison between GEOS results for elasto-
plastic material and the anlytical solutions of an elastic material. Note that the elastic solutions are differed from the
elasto-plastic results even in the elastic zone (r/a>2).
For the same wellbore problem, using different constitutive models (plastic vs. elastic), obviously, distinct differences
in rock deformation and distribution of resultant stresses is also observed and highlighted.
To go further
Context
This is an alternative to the example Extended Drucker-Prager Model for Wellbore Problems, and the Drucker-Prager
constitutive with cohesion hardening (see Model: Drucker-Prager) is hereby considered. Analytical solutions to this
problem are not provided from literature work, however they can be derived following (Chen and Abousleiman 2017).
Details of those solutions are given in Python scripts associated to this example.
Input file
This example uses no external input files and everything required is contained within two xml files that are located at:
inputFiles/solidMechanics/DruckerPragerWellbore_base.xml
inputFiles/solidMechanics/DruckerPragerWellbore_benchmark.xml
inputFiles/solidMechanics/DruckerPragerWellbore_smoke.xml
<Constitutive>
<DruckerPrager
name="rock"
defaultDensity="2700"
defaultBulkModulus="0.5e9"
defaultShearModulus="0.3e9"
defaultCohesion="0.1e6"
defaultFrictionAngle="15.27"
defaultDilationAngle="15.0"
defaultHardeningRate="10.0e6"/>
</Constitutive>
Here, rock is designated as the material in the computational domain. Drucker Prager model DruckerPrager
is used to simulate the elastoplastic behavior of rock. The material parameters, defaultFrictionAngle,
defaultDilationAngle and defaultCohesion denote the friction angle, the dilation angle, and the cohesion, re-
spectively. In this example, the hardening of the cohesion is described by a linear hardening law, which is governed by
the parameter defaultHardeningRate. The constitutive parameters such as the density, the bulk modulus, and the
shear modulus are specified in the International System of Units.
The parameters used in the simulation are summarized in the following table.
The validation of GEOS results against analytical results is shown in the figure below:
To go further
Context
In this benchmark example, the Modified Cam-Clay model (see Model: Modified Cam-Clay) is applied to solve for
elastoplastic deformation within the vicinity of a vertical wellbore. For the presented example, an analytical solution is
employed to verify the accuracy of the numerical results. The resulting model can be used as a base for more complex
analysis (e.g., wellbore drilling, fluid injection and storage scenarios).
Input file
Everything required is contained within two GEOS input files located at:
inputFiles/solidMechanics/ModifiedCamClayWellbore_base.xml
inputFiles/solidMechanics/ModifiedCamClayWellbore_benchmark.xml
We simulate a drained wellbore problem subjected to isotropic horizontal stress (𝜎ℎ ) and vertical stress (𝜎𝑣 ), as shown
below. By increasing the wellbore supporting pressure (𝑃𝑤 ), the wellbore expands, and the formation rock experiences
elastoplastic deformation. A plastic zone develops in the near wellbore region.
To simulate this phenomenon, the Modified Cam-Clay model is used in this example. Displacement and stress fields
around the wellbore are numerically calculated. These numerical predictions are then compared with the corresponding
analytical solutions (Chen and Abousleiman, 2013) from the literature.
In this example, we focus our attention on the Mesh tags, the Constitutive tags, and the FieldSpecifications
tags.
Mesh
Following figure shows the generated mesh that is used for solving this wellbore problem.
Let us take a closer look at the geometry of this wellbore problem. We use the internal wellbore mesh generator
InternalWellbore to create a rock domain (10 𝑚 × 5 𝑚 × 2 𝑚), with a wellbore of initial radius equal to 0.1
m. Coordinates of trajectory defines the wellbore trajectory, which represents a vertical well in this example. By
turning on autoSpaceRadialElems="{ 1 }", the internal mesh generator automatically sets number and spacing
of elements in the radial direction, which overrides the values of nr. With useCartesianOuterBoundary="0", a
Cartesian aligned outer boundary on the outer block is enforced. In this way, a structured three-dimensional mesh is
created with 50 x 40 x 2 elements in the radial, tangential and z directions, respectively. All the elements are eight-node
hexahedral elements (C3D8) and refinement is performed to conform with the wellbore geometry. This mesh is defined
as a cell block with the name cb1.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 5.0 }"
theta="{ 0, 180 }"
zCoords="{ -1, 1 }"
nr="{ 40 }"
nt="{ 40 }"
nz="{ 2 }"
trajectory="{ { 0.0, 0.0, -1.0 },
{ 0.0, 0.0, 1.0 } }"
autoSpaceRadialElems="{ 1 }"
useCartesianOuterBoundary="0"
cellBlockNames="{ cb1 }"/>
</Mesh>
For the drained wellbore problem, the pore pressure variation is omitted. Therefore, we just need to define a solid
mechanics solver, which is called mechanicsSolver. This solid mechanics solver (see Solid Mechanics Solver) is
based on the Lagrangian finite element formulation. The problem is run as QuasiStatic without considering inertial
effects. The computational domain is discretized by FE1, which is defined in the NumericalMethods section. The
material is named as rock, whose mechanical properties are specified in the Constitutive section.
<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">
<SolidMechanics_LagrangianFEM
name="mechanicsSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Omega }"
>
<LinearSolverParameters
directParallel="0"/>
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="15"/>
</SolidMechanics_LagrangianFEM>
</Solvers>
Constitutive laws
For this drained wellbore problem, we simulate the elastoplastic deformation caused by wellbore expansion. A homo-
geneous domain with one solid material is assumed, whose mechanical properties are specified in the Constitutive
section:
<Constitutive>
<ModifiedCamClay
name="rock"
defaultDensity="2700"
defaultRefPressure="-1.2e5"
defaultRefStrainVol="-0.0"
defaultShearModulus="4.302e6"
defaultPreConsolidationPressure="-1.69e5"
defaultCslSlope="1.2"
defaultVirginCompressionIndex="0.072676"
defaultRecompressionIndex="0.014535"
/>
</Constitutive>
Recall that in the SolidMechanics_LagrangianFEM section, rock is designated as the material in the computational
domain. Here, Modified Cam-Clay ModifiedCamClay is used to simulate the elastoplastic behavior of rock.
The following material parameters should be defined properly to reproduce the analytical example:
The constitutive parameters such as the density, the bulk modulus, and the shear modulus are specified in the Interna-
tional System of Units.
<FieldSpecifications>
<FieldSpecification
name="stressXX"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="0"
scale="-1.0e5"/>
<FieldSpecification
name="stressYY"
initialCondition="1"
setNames="{ all }"
(continues on next page)
<FieldSpecification
name="stressZZ"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="rock_stress"
component="2"
scale="-1.6e5"/>
<Traction
name="ExternalLoad"
setNames="{ rneg }"
objectPath="faceManager"
scale="-1.0e5"
tractionType="normal"
functionName="timeFunction"/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg, tpos, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
</FieldSpecifications>
With tractionType="normal", traction is applied to the wellbore wall rneg as a pressure specified from the product
of scale scale="-1.0e5" and the outward face normal. A table function timeFunction is used to define the time-
dependent traction ExternalLoad. The coordinates and values form a time-magnitude pair for the loading time
history. In this case, the loading magnitude increases linearly as the time evolves.
<Functions>
<TableFunction
name="timeFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 1.0 }"
values="{ 1.0, 3.0 }"/>
</Functions>
Inspecting results
In the above example, we requested silo-format output files. We can therefore import these into VisIt and use python
scripts to visualize the outcome. The following figure shows the distribution of 𝜎𝜃𝜃 in the near wellbore region.
The figure below shows the comparisons between the numerical predictions (marks) and the corresponding analyti-
cal solutions (solid curves) with respect to the distributions of normal stress components, stress path, the supporting
wellbore pressure and wellbore size. It is evident that the predictions well match the analytical results.
500 500
r-Analytical p_Analytical
r-GEOSX p_GEOSX
200 200
100 100
Pw (kPa)
q (kPa)
200
150 400
100
200
50
00 50 100 150 200 250 300 350 400 00.9 1.0 1.1 1.2 1.3 1.4 1.5
p (kPa) a/a0
To go further
Problem description
This example aims to solve a typical injection problem of a deviated wellbore subjected to a fluid pressure loaded at
wellbore wall. The problem geometry is generated with the internal wellbore mesh generator. Open hole completion
and poroelastic deformation are assumed. The coupled poroelastic solver, which combines the solid mechanics solver
and the single phase flow solver, is hereby employed to solve this specific problem. In-situ stresses and gravity effect
are excluded from this example. Please refer to the case Deviated Poro-Elastic Wellbore Subjected to In-situ Stresses
and Pore Pressure for in-situ stresses and pore pressure effects.
Analytical solutions of the pore pressure, the radial and hoop stresses in the near wellbore region are expressed in the
Laplace space as (Detournay and Cheng, 1988) :
√
𝑘0 (𝑅 𝑠)
𝑝 = 𝑝0 √
𝑠𝑘0 ( 𝑠)
√ √
1 − 2𝜈 −𝑅𝑘1 (𝑅 𝑠) + 𝑘1 ( 𝑠)
𝜎𝑟𝑟 = −𝑏 𝑝0 √ √
1−𝜈 𝑅2 𝑠3 𝑘0 ( 𝑠)
1 − 2𝜈
𝜎𝜃𝜃 = −𝑏 𝑝 − 𝜎𝑟𝑟
1−𝜈
where 𝑠 is the Laplace variable normalized by the fluid diffusion coefficient, 𝑘0 and 𝑘1 are respectively the modified
Bessel functions of second kind of order 0 and 1, 𝑅 is the dimensionless radial coordinate that is defined by the radial
coordinate normalized by the wellbore radius, 𝜈 is the Poisson ratio and 𝑏 is the Biot coefficient. Fluid pressure and
stresses in time space are obtained from these analytical expressions by the inverse Laplace transform (see the attached
Python script for more details).
Input file
Everything required is contained within two GEOS xml files that are located at:
inputFiles/wellbore/DeviatedPoroElasticWellbore_Injection_base.xml
inputFiles/wellbore/DeviatedPoroElasticWellbore_Injection_benchmark.xml
In this example, we would focus our attention on the Solvers and the Mesh tags.
Poroelastic solver
The coupled Poroelastic solver, that defines a coupling strategy between the solid mechanics solver
SolidMechanicsLagrangianSSLE and the single phase flow solver SinglePhaseFVM, is required for solving this
wellbore problem.
<SinglePhasePoromechanics
name="poroSolve"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
logLevel="1"
targetRegions="{ Omega }">
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="0"
targetRegions="{ Omega }"
>
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Omega }">
The internal wellbore mesh generator InternalWellbore is employed to create the mesh of this wellbore problem.
The radius of the wellbore and the size of the surrounding rock formation are defined by a vector radius. In the tangent
direction, theta angle is specified from 0 to 180 degree for a half of the domain regarding its symmetry. Note that the
whole domain could be specified with a theta angle from 0 to 360 degree, if modeling complicated scenarios. The
trajectory of the well is defined by trajectory. In this example, the wellbore is inclined in the x-z plane by an angle
of 45 degree. The autoSpaceRadialElems parameter allows optimally increasing the element size from local zone
around the wellbore to the far-field zone, which is set to 1 to activate this option. The useCartesianOuterBoundary
transforms the far-field boundary to a squared shape to enforce a Cartesian aligned outer boundary, which eases the
loading of the far-field boundary conditions. In this example, this value is set to 0 for the single region along the radial
direction.
<Mesh>
<InternalWellbore
name="mesh1"
(continues on next page)
Constitutive law
Isotropic elastic constitutive block ElasticIsotropic, with the specified bulk and shear elastic moduli, is considered
for the rock around the wellbore. Fluid properties, such as dynamic viscosity and compressibility, are given in the
CompressibleSinglePhaseFluid constitutive block. The grain bulk modulus, that is required for computing the
Biot coefficient, as well as the default porosity are located in the BiotPorosity block. The constant permeability is
given in the ConstantPermeability block.
<PorousElasticIsotropic
name="porousRock"
solidModelName="rock"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"/>
<ElasticIsotropic
name="rock"
defaultDensity="0"
defaultBulkModulus="11039657020.4"
defaultShearModulus="8662741799.83"/>
<!-- BiotCoefficient="0.771"
BiotModulus=15.8e9 -->
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0e6"
compressibility="1.78403329184e-10"
viscosibility="0.0"/>
<BiotPorosity
name="rockPorosity"
defaultGrainBulkModulus="48208109259"
defaultReferencePorosity="0.3"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-17, 1.0e-17, 1.0e-17 }"/>
Boundary conditions
Far-field boundaries are impermeable and subjected to roller constraints. The pressure on the wellbore wall is defined
by face pressure field specification. The nodeset generated by the internal wellbore generator for this face is named
as rneg. The negative sign of the scale denotes the fluid injection. Initial fluid pressure and the corresponding initial
porosity are also given for the computational domain. In this example, uniform isotropic permeability is assumed.
<FieldSpecifications>
<FieldSpecification
name="initialPorosity"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rockPorosity_porosity"
scale="0.3"/>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Omega/cb1"
fieldName="pressure"
scale="0e6"/>
<FieldSpecification
name="xConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }"/>
<FieldSpecification
name="yConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg, tpos, ypos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
<FieldSpecification
name="innerPorePressure"
objectPath="faceManager"
fieldName="pressure"
scale="10e6"
setNames="{ rneg }"/>
(continues on next page)
Result of the fluid pressure distribution after 78 s injection is shown in the figure below:
A good agreement between the GEOS results and the corresponding analytical solutions is shown in the figure below:
To go further
Problem description
This example deals with the problem of drilling a deviated poro-elastic wellbore. This is an extension of the poroelastic
wellbore example Deviated Poro-Elastic Wellbore Subjected to Fluid Injection with the consideration of in-situ stresses
and in-situ pore pressure. Both pore pressure and mud pressure are supposed to be nil at the borehole wall following
8
7
2.0
6
5 1.5
4
3 1.0
2
0.5
1
0
0.0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
r (m) r (m)
10 GEOSX result
Analytic
8
Pore pressure (MPa)
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
the consideration of (Abousleiman and Cui, 1998). Also, the in-situ horizontal stresses are anisotropic, i.e. 𝜎ℎ𝑚𝑎𝑥 >
𝜎ℎ𝑚𝑖𝑛 . The wellbore trajectory is deviated from the directions of the in-situ stresses. Analytical solutions of the pore
pressure, the radial and hoop stresses in the near wellbore region are given by (Abousleiman and Cui, 1998). They are
hereby used to verify the modeling predictions.
Input file
Everything required is contained within two GEOS xml files that are located at:
inputFiles/wellbore/DeviatedPoroElasticWellbore_Drilling_base.xml
inputFiles/wellbore/DeviatedPoroElasticWellbore_Drilling_benchmark.xml
This case is nearly identical to another example Deviated Poro-Elastic Wellbore Subjected to Fluid Injection, except for
the FieldSpecifications tag. For this specific case, we need to consider following additional field specifications to
define the in-situ stresses, in-situ pore pressure, as well as the zero pore pressure at the borehole wall.
<FieldSpecification
name="initialPorePressure"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="pressure"
scale="10e6"/>
<FieldSpecification
name="Sx"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="0"
scale="-21.9e6"/>
<FieldSpecification
name="Sy"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="1"
scale="-12.9e6"/>
<FieldSpecification
name="Sz"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="2"
scale="-17.9e6"/>
<FieldSpecification
name="innerPorePressure"
(continues on next page)
A good agreement between the GEOS results and the corresponding analytical solutions (Abousleiman and Cui, 1998)
is shown in the figure below:
To go further
0 GEOSX result 20
2
4 30
6 35
40
8
45
10
50
12 55
0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0
r (m) r (m)
10
8
Pore pressure (MPa)
6
4
2
0
0.2 0.4 0.6 0.8 1.0
r (m)
Context
The main objective of this example is to demonstrate how to use the internal wellbore mesh generator and poromechan-
ical solvers in GEOS to tackle wellbore problems in porous media. In this example, a poroplastic model is applied to
find the solution of rock deformation within the vicinity of a vertical wellbore, considering elastoplastic deformation,
fluid diffusion and poromechanical coupling effect. To do so, a single phase flow solver is fully coupled with a La-
grangian mechanics solver and the Extended Drucker-Prager model (see Model: Extended Drucker-Prager) is chosen
as the material model for the solid domain. We first solve this problem with a poroelastic model and verify the modeling
results with the corresponding analytical solutions. Then, the verified case is modified to test a poroplastic version,
whose results are compared with the ones obtained from the poroelastic case to highlight the impact of plasticity in this
specific problem.
Objectives
At the end of this example you will know:
• how to construct meshes for wellbore problems with the internal wellbore mesh generator,
• how to specify initial and boundary conditions, such as reservoir properties, in-situ stresses, mixed loading (me-
chanical and fluid) at wellbore wall and far-field constraints,
• how to use multiple solvers in GEOS for predicting poroplastic deformations in the near wellbore region.
Input file
This example uses no external input files and everything required is contained within a single GEOS input file.
The xml input files for the test case with poroelasticity are located at:
inputFiles/poromechanics/PoroElasticWellbore_base.xml
inputFiles/poromechanics/PoroElasticWellbore_benchmark.xml
The xml input files for the test case with poroplasticity are located at:
inputFiles/poromechanics/PoroDruckerPragerWellbore_base.xml
inputFiles/poromechanics/PoroDruckerPragerWellbore_benchmark.xml
We simulate the wellbore problem subjected to anisotropic horizontal stress (𝜎ℎ and 𝜎𝐻 ) and vertical stress (𝜎𝑣 ), as
shown below. This is a vertical wellbore, which is drilled in a porous medium. By changing the wellbore supporting
pressure, the mechanical deformation of the reservoir rock will be induced and evolve with time, due to fluid diffusion
and coupling effect. Considering inelastic constitutive behavior, the reservoir rock in the near wellbore region will
experience elastoplastic deformation and a plastic zone will be developed and expand with time. To setup the base
case, a poroelastic version is employed to find the poroelastic solutions of this wellbore problem, which are verified
with the analytical solution (Detournay and Cheng, 1993) from the literature. Following that, a poroplastic version is
built and used to obtain the temporal and spatial solutions of pore pressure, displacement and stress fields around the
wellbore, considering induced plastic deformation.
All inputs for this case are contained inside a single XML file. In this example, we focus our attention on the Mesh
tags, the Solver tags, the Constitutive tags, and the FieldSpecifications tags.
Mesh
The following figure shows the generated mesh that is used for solving this wellbore problem
Let us take a closer look at the geometry of this wellbore problem. We use the internal mesh generator
InternalWellbore to create a rock domain (10 𝑚 × 5 𝑚 × 2 𝑚), with a wellbore of initial radius equal to 0.1 m.
Coordinates of trajectory defines the wellbore trajectory, which represents a perfect vertical well in this example.
By turning on autoSpaceRadialElems="{ 1 }", the internal mesh generator automatically sets number and spacing
of elements in the radial direction, which overrides the values of nr. With useCartesianOuterBoundary="0", a
Cartesian aligned outer boundary on the outer block is enforced. In this way, a structured three-dimensional mesh is
created with 100 x 80 x 2 elements in the radial, tangential and z directions, respectively. All the elements are eight-
node hexahedral elements (C3D8) and refinement is performed to conform with the wellbore geometry. This mesh is
defined as a cell block with the name cb1.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 5.0 }"
theta="{ 0, 180 }"
zCoords="{ -1, 1 }"
nr="{ 40 }"
nt="{ 80 }"
nz="{ 2 }"
trajectory="{ { 0.0, 0.0, -1.0 },
{ 0.0, 0.0, 1.0 } }"
autoSpaceRadialElems="{ 1 }"
useCartesianOuterBoundary="0"
cellBlockNames="{ cb1 }"/>
</Mesh>
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multi-physics solvers. The order of specifying these solvers is not
restricted in GEOS. Note that end-users should give each single-physics solver a meaningful and distinct name, as
GEOS will recognize these single-physics solvers based on their customized names and create user-expected coupling.
As demonstrated in this example, to setup a poromechanical coupling, we need to define three different solvers in the
XML file:
• the mechanics solver, a solver of type SolidMechanics_LagrangianFEM called here mechanicsSolver (more
information here: Solid Mechanics Solver),
<SolidMechanics_LagrangianFEM
name="mechanicsSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Omega }"
>
<NonlinearSolverParameters
newtonTol = "1.0e-5"
newtonMaxIter = "15"
/>
</SolidMechanics_LagrangianFEM>
• the single-phase flow solver, a solver of type SinglePhaseFVM called here SinglePhaseFlowSolver (more
<SinglePhaseFVM
name="SinglePhaseFlowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{Omega}">
<NonlinearSolverParameters
newtonTol = "1.0e-6"
newtonMaxIter = "8"
/>
</SinglePhaseFVM>
</Solvers>
• the coupling solver (SinglePhasePoromechanics) that will bind the two single-physics solvers above, which
is named as PoromechanicsSolver (more information at Poromechanics Solver).
The two single-physics solvers are parameterized as explained in their corresponding documents.
In this example, let us focus on the coupling solver. This solver (PoromechanicsSolver) uses a set of attributes that
specifically describe the coupling process within a poromechanical framework. For instance, we must point this solver
to the designated fluid solver (here: SinglePhaseFlowSolver) and solid solver (here: mechanicsSolver). These
solvers are forced to interact through the porousMaterialNames="{porousRock}" with all the constitutive models.
We specify the discretization method (FE1, defined in the NumericalMethods section), and the target regions (here,
we only have one, Omega). More parameters are required to characterize a coupling procedure (more information at
Poromechanics Solver). In this way, the two single-physics solvers will be simultaneously called and executed for
solving the wellbore problem here.
Numerical methods in multiphysics settings are similar to single physics numerical methods. In this problem, we use
finite volume for flow and finite elements for solid mechanics. All necessary parameters for these methods are defined
in the NumericalMethods section.
As mentioned before, the coupling solver and the solid mechanics solver require the specification of a discretization
method called FE1. In GEOS, this discretization method represents a finite element method using linear basis functions
and Gaussian quadrature rules. For more information on defining finite elements numerical schemes, please see the
dedicated Finite Element Discretization section.
The finite volume method requires the specification of a discretization scheme. Here, we use a two-point flux ap-
proximation scheme (singlePhaseTPFA), as described in the dedicated documentation (found here: Finite Volume
Discretization).
<NumericalMethods>
<FiniteElements>
<FiniteElementSpace
name="FE1"
order="1"/>
</FiniteElements>
<FiniteVolume>
<TwoPointFluxApproximation
name="singlePhaseTPFA"
/>
</FiniteVolume>
</NumericalMethods>
Constitutive laws
For this test problem, the solid and fluid materials are named as rock and water respectively, whose mechanical
properties are specified in the Constitutive section. In this example, different material models, linear elastic isotropic
model (see Model: Elastic Isotropic) and Extended Drucker-Prager model (see Model: Extended Drucker-Prager), are
used to solve the mechanical deformation, which is the only difference between the poroelastic and poroplastic cases
in this example.
For the poroelastic case, PorousElasticIsotropic model is used to describe the linear elastic isotropic response
of rock to loading. And the single-phase fluid model CompressibleSinglePhaseFluid is selected to simulate the
flow of water upon injection:
<Constitutive>
<PorousElasticIsotropic
name="porousRock"
solidModelName="rock"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"
/>
<ElasticIsotropic
name="rock"
defaultDensity="2700"
defaultBulkModulus="1.1111e10"
defaultShearModulus="8.3333e9"
/>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0e6"
referenceDensity="1000"
compressibility="2.09028227021e-10"
referenceViscosity="0.001"
viscosibility="0.0"
/>
<BiotPorosity
name="rockPorosity"
(continues on next page)
For the poroplastic case, PorousExtendedDruckerPrager model is used to simulate the elastoplastic behavior of
rock. And the single-phase fluid model CompressibleSinglePhaseFluid is employed to handle the storage and
flow of water:
<Constitutive>
<PorousExtendedDruckerPrager
name="porousRock"
solidModelName="rock"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm"
/>
<ExtendedDruckerPrager
name="rock"
defaultDensity="2700"
defaultBulkModulus="1.1111e10"
defaultShearModulus="8.3333e9"
defaultCohesion="1.0e6"
defaultInitialFrictionAngle="15.27"
defaultResidualFrictionAngle="23.05"
defaultDilationRatio="1.0"
defaultHardening="0.01"
/>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0e6"
referenceDensity="1000"
compressibility="2.09028227021e-10"
referenceViscosity="0.001"
viscosibility="0.0"
/>
<BiotPorosity
name="rockPorosity"
defaultGrainBulkModulus="1.0e27"
defaultReferencePorosity="0.3"
/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{1.0e-20, 1.0e-20, 1.0e-20}"
/>
</Constitutive>
defaultCohesion denote the initial friction angle, the residual friction angle, and cohesion, respectively, as de-
fined by the Mohr-Coulomb failure envelope. As the residual friction angle defaultResidualFrictionAngle is
larger than the initial one defaultInitialFrictionAngle, a strain hardening model is automatically chosen, whose
hardening rate is given as defaultHardening="0.01". If the residual friction angle is set to be less than the initial
one, strain weakening will take place. defaultDilationRatio="1.0" corresponds to an associated flow rule. If
using an incompressible fluid, the user can lower the fluid compressibility compressibility to 0. The constitutive
parameters such as the density, the bulk modulus, and the shear modulus are specified in the International System of
Units. A stress-dependent porosity model rockPorosity and constant permeability rockPerm model are defined in
this section.
<FieldSpecifications>
<FieldSpecification
name="stressXX"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="0"
scale="-9.0e6"
/>
<FieldSpecification
name="stressYY"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="1"
scale="-11.0e6"
/>
<FieldSpecification
name="stressZZ"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="rock_stress"
component="2"
scale="-12.0e6"
/>
(continues on next page)
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Omega/cb1"
fieldName="pressure"
scale="0e6"
/>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{xneg, xpos}"
/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{tneg, tpos, ypos}"
/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{zneg, zpos}"
/>
<Traction
name="InnerMechanicalLoad"
setNames="{ rneg }"
objectPath="faceManager"
scale="-10.0e6"
tractionType="normal"
functionName="timeFunction"
/>
<FieldSpecification
name="InnerFluidLoad"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="pressure"
scale="10e6"
(continues on next page)
With tractionType="normal", traction is applied to the wellbore wall rneg as a pressure specified from the product
of scale scale="-10.0e6" and the outward face normal. A table function timeFunction is used to define the time-
dependent loading. The coordinates and values form a time-magnitude pair for the loading time history. In this
case, the loading magnitude is given as:
<Functions>
<TableFunction
name="timeFunction"
inputVarNames="{time}"
coordinates="{0.0, 0.1, 1e6}"
values="{0.0, 1.0, 1.0}"
/>
</Functions>
Inspecting results
As defined in the Events section, we run this simulation for 497640 seconds. In the above examples, we requested silo-
format output files. We can therefore import these into VisIt and use python scripts to visualize the outcome. Please
note that a non-dimensional time is used in the analytical solution, and the end time here leads to a non-dimensional
end time of t* = 4.62.
Using the poroelastic solver, below figure shows the prediction of pore pressure distribution upon fluid injection.
For the above poroelastic example, an analytical solution (Detournay and Cheng, 1993) is hereby employed to verify
the accuracy of the numerical results. Following figure shows the comparisons between the numerical predictions
(marks) and the corresponding analytical solutions (solid curves) with respect to the distributions of pore pressure,
radial displacement, effective radial and tangential stresses along the minimum horizontal stress direction (x-axis).
One can observe that GEOS results correlate very well with the analytical solutions for the poroelastic case.
For the same 3D wellbore problem, the poroplastic case is thereafter tested and compared with the poroelastic one.
The figure below shows the distribution of 𝜎𝑦𝑦 in the near wellbore region for both cases. As expected, a relaxation of
the tangential stress along the direction of minimum horizontal stress is detected, which can be attributed to the plastic
response of the rock.
By using python scripts, we can extract the simulation results along any direction and provide detailed comparisons
between different cases. Here, the pore pressure, radial displacement, radial and tangential effective stresses along
the direction of minimum horizontal stress are obtained at different time steps and plotted against the corresponding
ones of the poroelastic case. Because of fluid diffusion and coupling effect, following figure shows that these solutions
evolve with time for both cases. As mentioned above, a plastic zone is developed in the vicinity of the wellbore, due
to stress concentration. As for the far field region, these two cases become almost identical, with the rock deformation
governed by poroelasticity.
To go further
Fig. 1.54: Comparing the PoroPlastic case with the PoroElastic case at different times
Problem description
This example uses the thermal single-phase flow solver to model a pure thermal diffusion problem around a wellbore.
To mimic this specific problem, thermal convection and fluid flow are neglected by setting fluid pressure and fluid heat
capacity to zero. With a uniform temperature applied on the inner surface of the wellbore, temperature field would
radially diffuse as shown in the figure below:
Analytical results of the temperature profile along the radial direction is given by (Wang and Papamichos, 1994) :
√︂
𝑅𝑖𝑛 𝑟 − 𝑅𝑖𝑛
𝑇 (𝑟) = 𝑇𝑖𝑛 𝑒𝑟𝑓 𝑐( √ )
𝑟 2 𝑐𝑇 𝑡
where 𝑟 is the radial coordinate, 𝑇𝑖𝑛 is the temperature applied on the surface of the wellbore at 𝑟 = 𝑅𝑖𝑛 , 𝑐𝑇 is the
thermal diffusion coefficient of rock, which is defined as the ratio between the thermal conductivity and the volumetric
heat capacity of rock.
Input file
This benchmark example uses no external input file and everything required is contained within two GEOS xml files
that are located at:
inputFiles/singlePhaseFlow/thermalCompressible_2d_base.xml
and
inputFiles/singlePhaseFlow/thermalCompressible_2d_benchmark.xml
inputFiles/singlePhaseFlow/thermalCompressible_2d_smoke.xml
In this example, we would focus our attention on the Constitutive and FieldSpecifications tags.
Constitutive
The volumetric heat capacity of the medium around the wellbore is defined in the SolidInternalEnergy XML block
as
<SolidInternalEnergy
name="rockInternalEnergy_linear"
referenceVolumetricHeatCapacity="1.0e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
The thermal conductivity of the medium around the wellbore is defined in the
SinglePhaseConstantThermalConductivity XML block as
<SinglePhaseThermalConductivity
name="thermalCond_linear"
defaultThermalConductivityComponents="{ 1.66, 1.66, 1.66 }"
thermalConductivityGradientComponents="{ 0, 0, 0 }"
referenceTemperature="0"/>
The volumetric heat capacity of fluid is set to a negligible value to exclude thermal convection effect. It is defined in
the ThermalCompressibleSinglePhaseFluid XML block as
<ThermalCompressibleSinglePhaseFluid
name="fluid"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.0"
referenceTemperature="0"
compressibility="5e-10"
thermalExpansionCoeff="3e-4"
viscosibility="0.0"
specificHeatCapacity="1"
referenceInternalEnergy="0.99"/>
FieldSpecifications
The initial temperature, the imposed temperature at the curved wellbore surface as well as the far-field temperature are
defined as Dirichlet face boundary conditions using faceManager as
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
(continues on next page)
<FieldSpecification
name="sinkTemperature"
setNames="{ rpos }"
objectPath="faceManager"
fieldName="temperature"
scale="100"/>
<FieldSpecification
name="sourceTemperature"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="temperature"
scale="-20.0"/>
Although a pure thermal diffusion problem is considered, it is also required to define specifications for fluid pressure,
as thermal transfer is always coupled with fluid flow in GEOS. In this example, fluid pressure is set to zero everywhere
to mimic a pure thermal diffusion problem as
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/region/cb"
fieldName="pressure"
scale="0e6"/>
<FieldSpecification
name="sinkPressure"
setNames="{ rpos }"
objectPath="faceManager"
fieldName="pressure"
scale="0e6"/>
<FieldSpecification
name="sourcePressure"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="pressure"
scale="0e6"/>
A good agreement between the GEOS results and analytical results is shown in the figure below:
To go further
t = 10000(s) t = 20000(s)
100 100
Temperature (°C)
50 50
GEOSX
0 0 Analytic, infinite domain
Steady State
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
t = 50000(s) t = 100000.0(s)
100 100
Temperature (°C)
50 50
0 0
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
Radial distance from well center Radial distance from well center
Non-Linear Thermal Diffusion Around a Wellbore: The Case with Temperature Dependent Volumetric
Heat Capacity
Problem description
This example is an extension of the linear thermal diffusion problem presented in Pure Thermal Diffusion Around
a Wellbore. It uses the thermal single-phase flow solver to model a non-linear thermal diffusion problem around a
wellbore where the volumetric heat capacity of the solid rock depends linearly on the temperature.
Input file
This benchmark example uses no external input file and everything required is contained within two GEOS xml files
that are located at:
inputFiles/singlePhaseFlow/thermalCompressible_2d_base.xml
and
inputFiles/singlePhaseFlow/thermalCompressible_
˓→temperatureDependentVolumetricHeatCapacity_benchmark.xml
Constitutive
The reference value of the volumetric heat capacity of the medium around the wellbore and its derivative with respect
to temperature are defined in the SolidInternalEnergy XML block:
<SolidInternalEnergy
name="rockInternalEnergy_nonLinear"
referenceVolumetricHeatCapacity="4.56e6"
dVolumetricHeatCapacity_dTemperature="1e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
A good agreement between the results obtained using GEOS and the reference results that are obtained by the classical
finite difference method is shown in the figure below:
To go further
Non-Linear Thermal Diffusion Around a Wellbore: The Case with Temperature Dependent Single
Phase Thermal Conductivity
Problem description
This example is an extension of the linear thermal diffusion problem presented in Pure Thermal Diffusion Around a
Wellbore to model wellbore cooling upon CO2 injection. It uses the thermal single-phase flow solver to model a non-
t = 10000(s) t = 20000(s)
100 100
Temperature (°C)
50 50 GEOS
FDM Non-Linear
0 0 Analytic Linear
Steady State
0.0 0.1 0.2 0.3 0.4 0.5 0.0 0.1 0.2 0.3 0.4 0.5
t = 50000(s) t = 100000.0(s)
100 100
Temperature (°C)
50 50
0 0
0.0 0.1 0.2 0.3 0.4 0.5 0.0 0.1 0.2 0.3 0.4 0.5
Radial distance from well center Radial distance from well center
linear thermal diffusion problem around a wellbore where the single phase thermal conductivity of the porous rock
depends linearly on the temperature.
Input file
This benchmark example uses no external input file and everything required is contained within two GEOS xml files
that are located at:
inputFiles/singlePhaseFlow/thermalCompressible_2d_base.xml
and
inputFiles/singlePhaseFlow/thermalCompressible_
˓→temperatureDependentSinglePhaseThermalConductivity_benchmark.xml
Constitutive
The reference value of the single phase thermal conductivity of the porous medium around the wellbore and its deriva-
tive with respect to temperature are defined in the SinglePhaseThermalConductivity XML block:
<SinglePhaseThermalConductivity
name="thermalCond_nonLinear"
defaultThermalConductivityComponents="{ 1.5, 1.5, 1.5 }"
thermalConductivityGradientComponents="{ -12e-4, -12e-4, -12e-4 }"
referenceTemperature="20"/>
A good agreement between the results obtained using GEOS and the reference results that are obtained by the classical
finite difference method is shown in the figure below:
To go further
Problem description
This example uses the thermal option of the SinglePhasePoromechanics solver to handle a cased wellbore problem
subject to a uniform temperature change on the inner surface of the casing. The wellbore is composed of a steel
casing, a cement sheath and rock formation. Isotropic linear thermoelastic behavior is assumed for all three materials.
No separation or thermal barrier is allowed for the casing-cement and cement-rock contact interfaces. Plane strain
condition is assumed.
Solution to this axisymmetric problem can be obtained in the cylindrical coordinate system by using an implicit 1D
finite difference method (Jane and Lee 1999). Results of such analysis will be considered as reference solutions to
validate GEOS results.
Input file
t = 10000(s) t = 20000(s)
100 100 GEOS
Temperature (°C)
FDM Non-Linear
50 50 Analytic Linear
Steady State
0 0
0.10 0.15 0.20 0.25 0.30 0.10 0.15 0.20 0.25 0.30
t = 50000(s) t = 100000.0(s)
100 100
Temperature (°C)
50 50
0 0
0.10 0.15 0.20 0.25 0.30 0.10 0.15 0.20 0.25 0.30
Radial distance from well center Radial distance from well center
This benchmark example uses no external input files and everything required is contained within two GEOS XML files
located at:
inputFiles/wellbore/CasedThermoElasticWellbore_base.xml
and
inputFiles/wellbore/CasedThermoElasticWellbore_benchmark.xml
inputFiles/wellbore/CasedThermoElasticWellbore_smoke.xml
The internal wellbore mesh generator InternalWellbore is employed to create the mesh of this wellbore problem.
The radii of the casing cylinder, the cement sheath cylinder and the far-field boundary of the surrounding rock formation
are defined by a vector radius. In the tangent direction, theta angle is specified from 0 to 90 degrees to simulate
the problem on a quarter of the wellbore geometry. The problem is under plane strain condition and therefore we only
consider radial thermal diffusion on a single horizontal layer. The trajectory of the well is defined by trajectory,
which is vertical in this case. The autoSpaceRadialElems parameters allow for optimally increasing the element size
from the wellbore to the far-field zone. In this example, the auto spacing option is only applied to the rock formation.
The useCartesianOuterBoundary with a value 3 specified for the rock layer transforms the far-field boundary to a
circular shape. The cellBlockNames and elementTypes define the regions and related element types associated to
casing, cement sheath, and rock.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8, C3D8, C3D8 }"
radius="{ 0.15707, 0.17780, 0.21272, 1.5707 }"
theta="{ 0, 90 }"
zCoords="{ 0, 0.1 }"
nr="{ 5, 5, 5 }"
nt="{ 10 }"
nz="{ 1 }"
trajectory="{ { 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.1 } }"
autoSpaceRadialElems="{ 0, 0, 1 }"
cellBlockNames="{ casing, cement, rock }"
/>
</Mesh>
Material properties
The bulk and shear drained elastic moduli of the materials as well as its drained linear thermal expansion coefficient
relating stress change to temperature change are defined within the Constitutive tag as follows:
<ElasticIsotropic
name="casingSolid"
defaultDensity="7500"
defaultBulkModulus="159.4202899e9"
defaultShearModulus="86.61417323e9"
(continues on next page)
<ElasticIsotropic
name="cementSolid"
defaultDensity="2700"
defaultBulkModulus="2.298850575e9"
defaultShearModulus="1.652892562e9"
defaultDrainedLinearTEC="2.0e-5"/>
<ElasticIsotropic
name="rockSolid"
defaultDensity="2700"
defaultBulkModulus="5.535714286e9"
defaultShearModulus="3.81147541e9"
defaultDrainedLinearTEC="2.0e-5"/>
Here the solid density is also defined but it is not used because the gravitational effect is ignored in this example. To
mimic a thermoelastic coupling without fluid flow, a negligible porosity and a zero Biot coefficient are defined as:
<BiotPorosity
name="casingPorosity"
defaultReferencePorosity="1e-6"
defaultGrainBulkModulus="159.4202899e9"/>
<BiotPorosity
name="cementPorosity"
defaultReferencePorosity="1e-6"
defaultGrainBulkModulus="2.298850575e9"/>
<BiotPorosity
name="rockPorosity"
defaultReferencePorosity="1e-6"
defaultGrainBulkModulus="5.535714286e9"/>
In this XML block, the Biot coefficient is defined using the elastic bulk modulus 𝐾𝑠 of the solid skeleton as 𝑏𝐵𝑖𝑜𝑡 =
1 − 𝐾/𝐾𝑠 . In this example, we define a skeleton bulk modulus that is identical to the drained bulk modulus 𝐾 defined
above to enforce the Biot coefficient to zero.
The thermal conductivities and the volumetric heat capacities of casing, cement, and rock are defined by following
XML blocks:
<SinglePhaseThermalConductivity
name="casingThermalCond"
defaultThermalConductivityComponents="{ 15, 15, 15 }"/>
<SinglePhaseThermalConductivity
name="cementThermalCond"
defaultThermalConductivityComponents="{ 1.0, 1.0, 1.0 }"/>
<SinglePhaseThermalConductivity
name="rockThermalCond"
defaultThermalConductivityComponents="{ 1.66, 1.66, 1.66 }"/>
and
<SolidInternalEnergy
name="casingInternalEnergy"
referenceVolumetricHeatCapacity="1.375e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
<SolidInternalEnergy
name="cementInternalEnergy"
referenceVolumetricHeatCapacity="4.2e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
<SolidInternalEnergy
name="rockInternalEnergy"
referenceVolumetricHeatCapacity="4.56e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
An ultra-low permeability is defined for the three layers to simulate a thermoelastic problem without the impact of fluid
flow.
<ConstantPermeability
name="casingPerm"
permeabilityComponents="{ 1.0e-100, 1.0e-100, 1.0e-100 }"/>
<ConstantPermeability
name="cementPerm"
permeabilityComponents="{ 1.0e-100, 1.0e-100, 1.0e-100 }"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-100, 1.0e-100, 1.0e-100 }"/>
Also, a negligible volumetric heat capacity is defined for the fluid to completely ignore the thermal convection effect
such that only thermal transfers via the diffusion phenomenon are considered.
<ThermalCompressibleSinglePhaseFluid
name="fluid"
defaultDensity="1000"
defaultViscosity="1e-3"
referencePressure="0.0"
referenceTemperature="20.0"
compressibility="5e-10"
thermalExpansionCoeff="1e-10"
viscosibility="0.0"
specificHeatCapacity="1"
referenceInternalEnergy="1"/>
Other fluid properties such as viscosity, thermal expansion coefficient, etc. are not relevant to this example because
fluid flow is ignored and pore pressure is zero everywhere.
Boundary conditions
The mechanical boundary conditions are applied to ensure the axisymmetric plane strain conditions such as:
<FieldSpecification
name="tNegConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg }"/>
<FieldSpecification
name="tPosConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ tpos }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
Besides, the far-field boundary is assumed to be fixed because the local changes on the wellbore must have negligible
effect on the far-field boundary.
<FieldSpecification
name="rPosConstraint_x"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ rpos }"/>
<FieldSpecification
name="rPosConstraint_y"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ rpos }"/>
The traction-free condition on the inner surface of the casing is defined by:
<Traction
name="innerPressure"
objectPath="faceManager"
tractionType="normal"
scale="0.0e6"
(continues on next page)
The initial reservoir temperature (that is also the far-field boundary temperature) and the temperature of a cold fluid
applied on the inner surface of the casing are defined as
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="temperature"
scale="100"/>
<FieldSpecification
name="farfieldTemperature"
setNames="{ rpos }"
objectPath="faceManager"
fieldName="temperature"
scale="100"/>
<FieldSpecification
name="innerTemperature"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="temperature"
scale="-20.0"/>
It is important to remark that the initial effective stress of each layers must be set with accordance to the initial temper-
ature: 𝜎0 = 3𝐾𝛼𝛿𝑇0 where 𝜎0 is the initial effective principal stress, 𝛿𝑇0 is the initial temperature change, 𝐾 is the
drained bulk modulus and 𝛼 is the drained linear thermal expansion coefficient of the materials.
<FieldSpecification
name="initialSigma_x_casing"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/casing/casing"
fieldName="casingSolid_stress"
component="0"
scale="573913043.5"/>
<FieldSpecification
name="initialSigma_y_casing"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/casing/casing"
fieldName="casingSolid_stress"
component="1"
scale="573913043.5"/>
<FieldSpecification
name="initialSigma_z_casing"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/casing/casing"
(continues on next page)
Zero pore pressure is set everywhere to simulate a thermoelastic problem in which fluid flow is ignored:
<FieldSpecification
name="zeroPressure"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="pressure"
scale="0e6"/>
<FieldSpecification
name="sourcePressure"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="pressure"
scale="0"/>
<FieldSpecification
name="sinkPressure"
setNames="{ rpos }"
objectPath="faceManager"
fieldName="pressure"
scale="0"/>
It is convenient to collect data in hdf5 format that can be easily post-processed using Python. To collect the temperature
field in the three layers for all the time steps, the following XML blocks need to be defined:
<PackCollection
name="temperatureCollection_casing"
objectPath="ElementRegions/casing/casing"
fieldName="temperature"/>
<PackCollection
name="temperatureCollection_cement"
objectPath="ElementRegions/cement/cement"
fieldName="temperature"/>
<PackCollection
name="temperatureCollection_rock"
objectPath="ElementRegions/rock/rock"
fieldName="temperature"/>
<TimeHistory
name="temperatureHistoryOutput_casing"
sources="{ /Tasks/temperatureCollection_casing }"
filename="temperatureHistory_casing"/>
<TimeHistory
name="temperatureHistoryOutput_cement"
sources="{ /Tasks/temperatureCollection_cement }"
(continues on next page)
Similarly, the following blocks are needed to collect the solid stress:
<PackCollection
name="stressCollection_casing"
objectPath="ElementRegions/casing/casing"
fieldName="casingSolid_stress"/>
<PackCollection
name="stressCollection_cement"
objectPath="ElementRegions/cement/cement"
fieldName="cementSolid_stress"/>
<PackCollection
name="stressCollection_rock"
objectPath="ElementRegions/rock/rock"
fieldName="rockSolid_stress"/>
<TimeHistory
name="stressHistoryOutput_casing"
sources="{ /Tasks/stressCollection_casing }"
filename="stressHistory_casing"/>
<TimeHistory
name="stressHistoryOutput_cement"
sources="{ /Tasks/stressCollection_cement }"
filename="stressHistory_cement"/>
<TimeHistory
name="stressHistoryOutput_rock"
sources="{ /Tasks/stressCollection_rock }"
filename="stressHistory_rock"/>
The displacement field can be collected for the whole domain using nodeManager as follows
<PackCollection
name="displacementCollection"
objectPath="nodeManager"
fieldName="totalDisplacement"/>
<TimeHistory
name="displacementHistoryOutput"
sources="{ /Tasks/displacementCollection }"
filename="displacementHistory"/>
Also, periodic events are required to trigger the collection of this data on the mesh. For example, the periodic events
for collecting the displacement field are defined as:
<PeriodicEvent
name="displacementHistoryCollection"
endTime="1e5"
(continues on next page)
A good agreement between the GEOS results and analytical results for temperature distribution around the cased well-
bore is shown in the figures below:
and the validation for the radial displacement around the cased wellbore is shown below:
The validations of the total radial and hoop stress (tangent stress) components computed by GEOS against reference
results are shown in the figure below:
To go further
Problem description
This example uses the thermal option of the SinglePhasePoromechanics solver to handle an open wellbore prob-
lem subjected to a uniform temperature change on its inner surface. Isotropic linear thermoporoelastic behavior is
considered for the rock formation around the wellbore. Plane strain and axisymmetric conditions are assumed.
Analytical solutions to this problem were first derived by (Wang and Papamichos 1994) using a one-way coupling sim-
plification. They are also reformulated for the full coupling assumption in the book of (Cheng 2016). These solutions
will be considered to validate GEOS results.
Input file
This benchmark example uses no external input files and everything required is contained within two GEOS xml files
that are located at:
inputFiles/wellbore/ThermoPoroElasticWellbore_base.xml
and
inputFiles/wellbore/ThermoPoroElasticWellbore_benchmark.xml
inputFiles/wellbore/ThermoPoroElasticWellbore_smoke.xml
The internal wellbore mesh generator InternalWellbore is employed to create the mesh of this wellbore problem.
The radii of the open wellbore and the far-field boundary of the surrounding rock formation are defined by a vector
radius. In the tangent direction, theta angle is specified from 0 to 90 degrees to simulate the problem on a quarter of
the wellbore geometry. The problem is under plane strain condition and therefore we only consider thermal diffusion
along the radial direction within a single horizontal layer. The trajectory of the well is defined by trajectory, which
is vertical in this case. The autoSpaceRadialElems parameters allow for optimally increasing the element size from
the near wellbore zone to the far-field one.
<Mesh>
<InternalWellbore
name="mesh1"
elementTypes="{ C3D8 }"
radius="{ 0.1, 5.0 }"
theta="{ 0, 90 }"
zCoords="{ 0, 0.1 }"
nr="{ 100 }"
nt="{ 40 }"
nz="{ 1 }"
trajectory="{ { 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.1 } }"
autoSpaceRadialElems="{ 1 }"
cellBlockNames="{ rock }"
/>
</Mesh>
Material properties
The bulk and shear drained elastic moduli of rock as well as its drained linear thermal expansion coefficient relating
stress change to temperature variation are defined within the Constitutive tag as follows:
<ElasticIsotropic
name="rockSolid"
defaultDensity="2700"
defaultBulkModulus="20.7e9"
defaultShearModulus="12.4e9"
defaultDrainedLinearTEC="4e-5"/>
Here the solid density is also defined, but it is not used as the gravitational effect is ignored in this example. The
porosity and the elastic bulk modulus 𝐾𝑠 of the solid skeleton are defined as:
<BiotPorosity
name="rockPorosity"
defaultReferencePorosity="0.001"
defaultGrainBulkModulus="23.5e9"
defaultPorosityTEC="4e-5"/>
The thermal conductivities and the volumetric heat capacities of rock are defined by following XML blocks:
<SinglePhaseThermalConductivity
name="rockThermalCond"
defaultThermalConductivityComponents="{ 6.6, 6.6, 6.6 }"/>
and
<SolidInternalEnergy
name="rockInternalEnergy"
referenceVolumetricHeatCapacity="1.89e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-21, 1.0e-21, 1.0e-21 }"/>
Fluid properties such as viscosity, thermal expansion coefficient, etc. are defined by the XML block below. A negligible
volumetric heat capacity is defined for fluid to ignore the thermal convection effect. This way, only thermal transfer via
the diffusion phenomenon is considered.
<ThermalCompressibleSinglePhaseFluid
name="fluid"
defaultDensity="1000"
defaultViscosity="1e-3"
referencePressure="0.0"
referenceTemperature="20.0"
compressibility="5e-10"
thermalExpansionCoeff="3e-4"
viscosibility="0.0"
specificHeatCapacity="1"
referenceInternalEnergy="1"/>
Boundary conditions
The mechanical boundary conditions are applied to ensure the axisymmetric plane strain conditions such as:
<FieldSpecification
name="tNegConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ tneg }"/>
<FieldSpecification
name="tPosConstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
(continues on next page)
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg, zpos }"/>
Besides, the far-field boundary is assumed to be fixed because the local changes on the wellbore must have negligible
effect on the far-field boundary.
<FieldSpecification
name="rPosConstraint_x"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ rpos }"/>
<FieldSpecification
name="rPosConstraint_y"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ rpos }"/>
The traction-free condition on the inner surface of the wellbore is defined by:
<Traction
name="innerTraction"
objectPath="faceManager"
tractionType="normal"
scale="0.0e6"
setNames="{ rneg }"/>
The initial temperature (that is also the far-field boundary temperature) and the temperature applied on the inner surface
of the wellbore are defined as
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="temperature"
scale="0"/>
<FieldSpecification
name="farfieldTemperature"
setNames="{ rpos }"
objectPath="faceManager"
(continues on next page)
<FieldSpecification
name="innerTemperature"
setNames="{ rneg }"
objectPath="faceManager"
fieldName="temperature"
scale="100.0"/>
It is important to remark that the initial effective stress of rock must be set with accordance to the initial temperature
change: 𝜎0 = 3𝐾𝛼𝛿𝑇0 where 𝜎0 is the initial effective principal stress, 𝛿𝑇0 is the initial temperature change, 𝐾 is the
drained bulk modulus and 𝛼 is the drained linear thermal expansion coefficient of the materials. In this example, the
initial effective stresses are set to zero because the initial temperature change is set to zero.
<FieldSpecification
name="initialSigma_x_rock"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/rock/rock"
fieldName="rockSolid_stress"
component="0"
scale="0"/>
<FieldSpecification
name="initialSigma_y_rock"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/rock/rock"
fieldName="rockSolid_stress"
component="1"
scale="0"/>
<FieldSpecification
name="initialSigma_z_rock"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/rock/rock"
fieldName="rockSolid_stress"
component="2"
scale="0"/>
The initial and boundary conditions for pore pressure are defined in the block below:
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="pressure"
scale="0e6"/>
<FieldSpecification
name="innerPressure"
(continues on next page)
<FieldSpecification
name="farfieldPressure"
setNames="{ rpos }"
objectPath="faceManager"
fieldName="pressure"
scale="0"/>
It is convenient to collect data in hdf5 format that can be easily post-processed using Python. To collect the temperature
field for all the time steps, the following XML blocks need to be defined:
<PackCollection
name="temperatureCollection_rock"
objectPath="ElementRegions/rock/rock"
fieldName="temperature"/>
<TimeHistory
name="temperatureHistoryOutput_rock"
sources="{ /Tasks/temperatureCollection_rock }"
filename="temperatureHistory_rock"/>
Similarly, the following blocks are needed to collect the effective stress field across the domain:
<PackCollection
name="stressCollection_rock"
objectPath="ElementRegions/rock/rock"
fieldName="rockSolid_stress"/>
<TimeHistory
name="stressHistoryOutput_rock"
sources="{ /Tasks/stressCollection_rock }"
filename="stressHistory_rock"/>
<PackCollection
name="displacementCollection"
objectPath="nodeManager"
fieldName="totalDisplacement"/>
<TimeHistory
name="displacementHistoryOutput"
sources="{ /Tasks/displacementCollection }"
filename="displacementHistory"/>
Also, periodic events are required to trigger the collection of this data during the entire simulation. For example, the
periodic events for collecting the displacement field are defined as:
<PeriodicEvent
name="displacementHistoryCollection"
beginTime="0"
endTime="360"
forceDt="60"
target="/Tasks/displacementCollection"/>
<PeriodicEvent
name="displacementTimeHistoryOutput_1"
beginTime="0"
endTime="360"
forceDt="60"
target="/Outputs/displacementHistoryOutput"/>
<PeriodicEvent
name="displacementHistoryCollection_2"
beginTime="360"
endTime="3700"
forceDt="360"
target="/Tasks/displacementCollection"/>
<PeriodicEvent
name="displacementTimeHistoryOutput_2"
beginTime="360"
endTime="3700"
forceDt="360"
target="/Outputs/displacementHistoryOutput"/>
A good agreement between the GEOS results and analytical results for temperature and pore pressure distribution
around the wellbore is shown in the figures below:
and the validation for the radial displacement around the cased wellbore is shown below:
The validations of the total radial and hoop stress (tangent stress) components computed by GEOS against reference
results are shown in the figure below:
To go further
Problem description
This example uses the LagrangianContact solver to handle a cased wellbore problem with imperfect contact in-
terfaces. The completed wellbore is composed of a steel casing, a cement sheath, and rock formation. All the three
materials are assumed to exhibit isotropic linear elastic behavior. The contact surfaces between these materials are
simulated using a Lagrangian contact model.
Under a compressional loading in the radial direction, the imperfect contact interfaces behave like the perfect ones (see
Cased Elastic Wellbore Problem). When a radial tension acting on the inner face of the wellbore, the casing debonds
from the cement layer. Analytical results of the radial displacement 𝑢𝑟 in the casing is expressed as (Hervé and Zaoui,
1995) :
𝐵
𝑢𝑟 = 𝐴𝑟 −
𝑟
where 𝑟 is the radial coordinate, 𝐴 and 𝐵 are constants that are obtained by solving the boundary conditions, as detailed
in the post-processing script. The outer face of the casing as well as the inner face of the cement layer are free of stress
because of the debonding at the casing-cement interface. Therefore, the displacement jump at the cement-rock interface
is nil, and the displacement jump across the casing-cement interface is equal to 𝑢𝑟 (𝑟 = 𝑟𝑜𝑢𝑡𝑐 𝑎𝑠𝑖𝑛𝑔 ), where 𝑟𝑜𝑢𝑡𝑐 𝑎𝑠𝑖𝑛𝑔
is the outer radius of the casing.
Input file
This benchmark example does not use any external input files and everything required is contained within two GEOS
XML files located at:
inputFiles/wellbore/CasedElasticWellbore_ImperfectInterfaces_base.xml
and
inputFiles/wellbore/CasedElasticWellbore_ImperfectInterfaces_benchmark.xml
inputFiles/wellbore/CasedElasticWellbore_ImperfectInterfaces_smoke.xml
Fig. 1.66: A cased wellbore with imperfect casing-cement and cement-rock interfaces
Cylinder geometry
The nodesets that define the casing-cement and cement-rock interfaces are curved. In this example, we use the
Cylinder geometry to select these nodesets. This geometry is defined by the centers of the two plane faces,
firstFaceCenter and secondFaceCenter, and its inner and outer radii, innerRadius and outerRadius. Note
that the inner radius is optional as it is only needed for defining a hollow cylinder (i.e. an annulus). The inner radius is
required in this example to select only the nodes on the casing-cement and the cement-rock interfaces.
<Geometry>
<Cylinder
name="casingCementInterface"
firstFaceCenter="{ 0.0, 0.0, -0.001 }"
secondFaceCenter="{ 0.0, 0.0, 0.101 }"
outerRadius="0.1061"
innerRadius="0.1059"
/>
<Cylinder
name="cementRockInterface"
firstFaceCenter="{ 0.0, 0.0, -0.001 }"
secondFaceCenter="{ 0.0, 0.0, 0.101 }"
outerRadius="0.1331"
innerRadius="0.1329"
/>
</Geometry>
Events
In this example, we need to define a solo event for generating the imperfect contact surfaces as shown below:
<SoloEvent
name="preFracture"
target="/Solvers/SurfaceGen"/>
<SurfaceGenerator
name="SurfaceGen"
fractureRegion="Fracture"
targetRegions="{ casing, cement, rock }"
rockToughness="1.0e6"
mpiCommOrder="1"/>
Here, rockToughness is defined by default but has been omitted in this simulation.
To collect the displacement jump across the imperfect interfaces, we also define two periodic events as shown below:
<PeriodicEvent
name="displacementJumpHistoryCollection"
endTime="2.0"
forceDt="0.1"
target="/Tasks/displacementJumpCollection"/>
<PeriodicEvent
name="displacementJumpTimeHistoryOutput"
(continues on next page)
The corresponding Tasks and Outputs targets must be defined in conjunction with these events.
Numerical Methods
<FiniteVolume>
<TwoPointFluxApproximation
name="TPFAstabilization"/>
</FiniteVolume>
The imperfect contact surfaces between casing, cement, and rock layers are defined as Fracture as shown below:
<ElementRegions>
<SurfaceElementRegion
name="Fracture"
faceBlock="faceElementSubRegion"
defaultAperture="1e-6"
materialList="{ fractureContact }"/>
Here, the faceBlock name, faceElementSubRegion, is needed to define Tasks for collecting displacement jumps
across the contact surfaces. The defaultAperture defined in this block is the default hydraulic aperture that should
not be confused with the mechanical aperture. For this purely mechanical problem, the default hydraulic aperture
parameter is omitted. The fracture material given in the materialList is defined as follows:
<Coulomb
name="fractureContact"
cohesion="0"
frictionCoefficient="0.5"/>
For this purely mechanical problem, without fluid flow and shearing stress acting on the contact surface, all the param-
eters defined in this block are omitted.
The GEOS results of displacement jump across the casing-cement and cement-rock interfaces are shown in the figure
below:
As expected, we observe a zero-displacement jump at the cement-rock interface under a tension stress on the inner
surface of the casing. Indeed, the stress applied here does not cause any strain on the cement and rock layers after
debonding has occurred at the casing-cement interface. The displacement jump at the casing-cement interface is ho-
mogeneous and varies over time because the tension stress on the inner surface of the casing varies with time, as defined
in the XML file. A perfect comparison between GEOS results and theoretical results is shown in the figure below:
Fig. 1.67: Displacement jumps across the casing-cement and cement-rock interfaces
GEOS
70 Analytical
60
Normal displacement jump [ m]
50
40
30
20
10
0
0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00
Time [s]
To go further
Problem description
This example uses the coupled THM solver in GEOS to handle a cased wellbore problem subject to a temperature
reduction at the casing surface due to cold CO2 injection. The wellbore consists of a steel casing, a cement sheath, and
a rock formation. We assume an isotropic linear thermo-elastic behavior for all three materials.
In this example, we do not model any fluid flow. All heat transfers between the casing, cement layer, and rock formation
are due only to conduction, and no heat convection is not considered. While GEOS could also simulate convection, we
chose to simulate a simplified conduction-only case because semi-analytical solutions exist for this problem. Debonding
(separation) is allowed for the casing-cement and cement-rock contact interfaces.
This example is an extension of the pure mechanical debonding example:ref:AdvancedExampleCasedElasticWellbore
and the THM problem without debonding Cased ThermoElastic Wellbore Problem. A large portion of the XML files
are inherited from those two examples.
Analytical results for the temperature field, the radial displacement, and the radial and hoop stresses can be derived
for the axisymmetric plane strain problem with assumptions of debonding at casing-cement or cement-rock interfaces.
Note that solutions to this problem are not available in the literature for citation, as it is newly derived by the GEOS
team for verifying the numerical results.
Input file
This benchmark example uses no external input files and everything required is contained within two GEOS XML files
located at:
inputFiles/wellbore/CasedThermoElasticWellbore_ImperfectInterfaces_base.xml
and
inputFiles/wellbore/CasedThermoElasticWellbore_ImperfectInterfaces_benchmark.xml
inputFiles/wellbore/CasedThermoElasticWellbore_ImperfectInterfaces_smoke.xml
The geometry and mesh are defined similarly to the ones in the example Cased ThermoElastic Wellbore Problem. To
define the imperfect interfaces between the casing, cement and rock layers, we added the following blocks:
<Geometry>
<Cylinder
name="casingCementInterface"
firstFaceCenter="{ 0.0, 0.0, -0.001 }"
secondFaceCenter="{ 0.0, 0.0, 0.101 }"
outerRadius="0.17781"
innerRadius="0.17779"
/>
(continues on next page)
<Cylinder
name="cementRockInterface"
firstFaceCenter="{ 0.0, 0.0, -0.001 }"
secondFaceCenter="{ 0.0, 0.0, 0.101 }"
outerRadius="0.21273"
innerRadius="0.21271"
/>
</Geometry>
Here, we use the Cylinder geometry to select these nodesets. A detailed explanation of the inputs in this block is
given in the example Cased Elastic Wellbore Problem.
Material properties
Besides the THM properites of casing, cement and rock as defined in the example Cased ThermoElastic Wellbore
Problem, we define properties for the contact interfaces. The mechanical properties of the contact surfaces are defined
similarly to the example Cased Elastic Wellbore Problem. Additionally, following blocks define the thermal conduc-
tivity of the contact interface.
<SinglePhaseThermalConductivity
name="contactThermalCond"
defaultThermalConductivityComponents="{ 1.0, 1.0, 1.0 }"/>
These properties are used for defining the imperfect contact surfaces as follows:
<SurfaceElementRegion
name="Fracture"
faceBlock="faceElementSubRegion"
materialList="{ fluid, fractureFilling, frictionLaw, contactThermalCond,␣
˓→hApertureModel }"
defaultAperture="5.0e-4"/>
As we are using the fully coupled THM solver to solve the thermo-elastic coupled problem, it is also required to define
the flow properties for the contact surfaces as follows:
<CompressibleSolidParallelPlatesPermeability
name="fractureFilling"
solidModelName="nullSolid"
porosityModelName="fracturePorosity"
permeabilityModelName="fracturePerm"
solidInternalEnergyModelName="rockInternalEnergy"/>
<NullModel
name="nullSolid"/>
<PressurePorosity
name="fracturePorosity"
defaultReferencePorosity="1.00"
referencePressure="0.0"
compressibility="0.0"/>
The boundary condition at the casing inner surface and in the far-field are defined identically to the ones of the example
Cased ThermoElastic Wellbore Problem. The in-situ initial conditions are also defined in the same way as described in
that example. The additional specifications for the contact surfaces are defined identically to the example Cased Elastic
Wellbore Problem.
Solvers
The solver for simulating this THM problem with imperfect contact interfaces is defined as follows:
<SinglePhasePoromechanicsConformingFractures
name="fractureThermoPoroElasticSolver"
targetRegions="{ casing, cement, rock, Fracture }"
initialDt="1e-3"
flowSolverName="flowSolver"
solidSolverName="lagrangiancontact"
logLevel="1"
isThermal="1">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="10"
maxTimeStepCuts="4"/>
<LinearSolverParameters
directParallel="0"
solverType="direct"/>
</SinglePhasePoromechanicsConformingFractures>
where the Lagrangian contact solver is identical to the one used in the example Cased Elastic Wellbore Problem and
the THM coupled solver is the same as that of the example Cased ThermoElastic Wellbore Problem.
The GEOS results of displacement jump across the casing-cement and cement-rock interfaces at 1e5 seconds are shown
in the figure below:
The GEOS results and analytical results for temperature distribution around the cased wellbore are shown in the figures
below:
and the radial displacement around the wellbore is shown below:
The total radial and hoop stress (tangential stress) components computed by GEOS and the reference results are shown
in the figure below:
We can observe a good agreement between GEOS results and the analytical results.
To go further
Fig. 1.68: Displacement jumps across the casing-cement and cement-rock interfaces at 1e5 seconds.
Viscoplasticity
Drucker-Prager Model: Triaxial Driver versus Semi-Analytical Solution
Problem description
This example uses the Triaxial Driver to simulate an elasto-plastic triaxial compression test of a Drucker-Prager solid.
Constant lateral confining stress together with loading/unloading axial strain periods are imposed. Imposed axial strain
range are high enough for allowing plastic yield in both loading and unloading period. This complicated scenario is
used for verifying the numerical convergence and accuracy of the Drucker-Prager constitutive model implemented in
GEOS.
Semi-analytical results for axial stress variations ∆𝜎𝑉 and lateral strain variations ∆𝜀𝑉 can be established for the
imposed triaxial boundary conditions:
∆𝜎𝑉
∆𝜀𝐻 = ∆𝜀𝑉 − ′
𝐸𝑒𝑝
where 𝐸𝑒𝑝 and 𝐸𝑒𝑝 ′
are elasto-plastic Young moduli that can be obtained from the elastic Young and shear moduli (𝐸
and 𝜇), the frictional parameter 𝑏, the dilation parameter 𝑏′ and the hardening rate ℎ of the Drucker-Prager model by:
1 1 (𝑏′ − 3)(𝑏 − 3)
= +
𝐸𝑒𝑝 𝐸 9ℎ
1 1 𝑏−3
′
= −
𝐸𝑒𝑝 2𝜇 2ℎ
These solutions are applied only when the plastic yield condition is satisfied. The cohesion parameter defining the
plastic yield surface is updated with stress changes as
𝑏−3
∆𝑎 = ∆𝜎𝑉
3
These solutions were established for a positive shear stress 𝑞 = −(𝜎𝑉 − 𝜎𝐻 ) (negative sign convention for compres-
sional stress). For the case when the plastic yield occurs at a negative shear stress, we have:
1 1 (𝑏′ + 3)(𝑏 + 3)
= +
𝐸𝑒𝑝 𝐸 9ℎ
1 1 𝑏+3
′
= +
𝐸𝑒𝑝 2𝜇 2ℎ
and
𝑏+3
∆𝑎 = ∆𝜎𝑉
3
These solutions are implemented in a Python script associated to this example for verifying GEOS results.
Input files
This validation example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_DruckerPrager.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/DruckerPrager/
˓→TriaxialDriver_vs_SemiAnalytic_DruckerPrager.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the constant lateral confining stress, and the initial stress are defined
in the Task block as:
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="DruckerPrager"
mode="mixedControl"
axialControl="strainFunction"
radialControl="stressFunction"
initialStress="-10.e6"
steps="200"
output="DruckerPragerResults.txt" />
</Tasks>
Constitutive laws
<DruckerPrager
name="DruckerPrager"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="0.1e6"
defaultFrictionAngle="6.0"
defaultDilationAngle="3.0"
defaultHardeningRate="0.5e9"
/>
All constitutive parameters such as density, viscosity, and bulk and shear moduli are specified in the International
System of Units.
The simulation results are saved in a text file, named DruckerPragerResults.txt. A perfect comparison between
the results given by the TriaxialDriver solver in GEOS and the semi-analytical results presented above is shown below.
8 8
0.00
6 6
Deviatoric Stress (MPa)
To go further
Problem description
This example uses the Triaxial Driver to simulate a triaxial compression test of a Visco Drucker-Prager solid. Constant
lateral confining stress together with loading/unloading axial strain periods are imposed. Imposed axial strain range are
high enough for allowing visco-plastic yield in both loading and unloading period. This complicated scenario is used
for verifying the numerical convergence and accuracy of the Visco Drucker-Prager constitutive model implemented in
GEOS.
Semi analytical result for axial stress variation ∆𝜎𝑉 and lateral strain variation ∆𝜀𝑉 can be established for the im-
posed triaxial boundary conditions following the theoretical basis of the Perzyna time dependent approach presented
by (Runesson et al. 1999) as:
𝑏′ − 3
)𝐸∆𝜎𝑉 = (∆𝜀𝑉 − ∆𝜆
3
∆𝜎𝑉 3
∆𝜀𝐻 = ∆𝜀𝑉 − + ∆𝜆
2𝜇 2
where 𝐸 and 𝜇 are the elastic Young and shear moduli. The visco-plastic multiplier ∆𝜆 can be approximated by:
∆𝑡 𝐹
∆𝜆 =
𝑡* 3𝜇 + 𝐾𝑏𝑏′ + ℎ
in which ∆𝑡 is the time increment, 𝑡* is the relaxation time, 𝐹 is the stress function defining the visco-plastic yield
surface, 𝐾 is the elastic bulk modulus, 𝑏 is the frictional parameter defining the visco-plastic yield surface, 𝑏′ is the
dilation parameter defining the plastic potential and ℎ is the hardening rate. These solutions are applied only when
plastic yield condition is satisfied. The cohesion parameter defining the plastic yield surface is updated with stress
change as
∆𝑎 = ℎ∆𝜆
These solutions were established for a positive shear stress 𝑞 = −(𝜎𝑉 −𝜎𝐻 ) (negative sign convention for compression
stress). For the case when the plastic yield occurs at a negative shear stress, we have
𝑏′ + 3
∆𝜎𝑉 = (∆𝜀𝑉 − ∆𝜆 )𝐸
3
∆𝜎𝑉 3
∆𝜀𝐻 = ∆𝜀𝑉 − − ∆𝜆
2𝜇 2
These solutions are implemented in a Python script associated to this example for verifying GEOS results.
Input files
This benchmark example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_ViscoDruckerPrager.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/ViscoDruckerPrager/
˓→TriaxialDriver_vs_SemiAnalytic_ViscoDruckerPrager.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the constant lateral confining stress as well as the initial stress are
defined in the Task block as
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ViscoDruckerPrager"
mode="mixedControl"
axialControl="strainFunction"
radialControl="stressFunction"
initialStress="-10.e6"
steps="200"
output="ViscoDruckerPragerResults.txt" />
</Tasks>
Constitutive laws
<ViscoDruckerPrager
name="ViscoDruckerPrager"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="0.1e6"
defaultFrictionAngle="6.0"
defaultDilationAngle="3.0"
(continues on next page)
All constitutive parameters such as density, viscosity, and bulk and shear moduli are specified in the International
System of Units.
The simulation results are saved in a text file, named ViscoDruckerPragerResults.txt. A comparison between
the results given by the TriaxialDriver solver in GEOS and the approximated semi-analytical results presented above
is shown below. Interestingly we observed that the Duvaut-Lions approach implemented in GEOS can fit perfectly
with the Perzyna approach that was considered for deriving the analytical results. This consistency between these time
dependence approaches is because of the linear hardening law of the considered constitutive model as already discussed
by (Runesson et al. 1999) .
0.02
10 10
Deviatoric Stress (MPa)
5 0.02 5
0.04
0 0
0.06
5 0.08 5
Triaxial Driver
0.10 Semi-Analytical
0.25 0.00 0.25 0.50 0.0 0.2 0.4 0.6 8 10 12 14
Strain (%) Axial Strain (%) Mean stress (MPa)
To go further
Problem description
This example uses the Triaxial Driver to simulate an elasto-plastic triaxial compression test of an Extended Drucker-
Prager solid. Constant lateral confining stress together with loading/unloading axial strain periods are imposed. Im-
posed axial strain range are high enough for allowing plastic yield in both loading and unloading period. This compli-
cated scenario is used for verifying the numerical convergence and accuracy of the Extended Drucker-Prager constitu-
tive model implemented in GEOS.
Semi-analytical results for axial stress variations ∆𝜎𝑉 and lateral strain variations ∆𝜀𝑉 can be established for the
imposed triaxial boundary conditions:
∆𝜎𝑉 = ∆𝜀𝑉 𝐸𝑒𝑝
∆𝜎𝑉
∆𝜀𝐻 = ∆𝜀𝑉 − ′
𝐸𝑒𝑝
where 𝐸𝑒𝑝 and 𝐸𝑒𝑝 ′
are elasto-plastic Young moduli that can be obtained from the elastic Young and shear moduli (𝐸
and 𝜇), the frictional parameter 𝑏 and the dilation ratio 𝜃 of the Extended Drucker-Prager model by:
1 1 (𝜃𝑏 − 3)(𝑏 − 3)
= +
𝐸𝑒𝑝 𝐸 9ℎ
1 1 𝑏−3
′
= −
𝐸𝑒𝑝 2𝜇 2ℎ
The hardening rate ℎ is defined by
𝜕𝐹 𝜕𝑏
ℎ=
𝜕𝑏 𝜕𝜆
These solutions are applied only when the plastic yield condition is satisfied. The cohesion parameter defining the
plastic yield surface is updated with stress changes as:
𝑏−3
∆𝜆 = ∆𝜎𝑉
3ℎ
These solutions were established for a positive shear stress 𝑞 = −(𝜎𝑉 − 𝜎𝐻 ) (negative sign convention for compres-
sional stress). For the case when the plastic yield occurs at a negative shear stress, we have:
1 1 (𝜃𝑏 + 3)(𝑏 + 3)
= +
𝐸𝑒𝑝 𝐸 9ℎ
1 1 𝑏+3
′
= +
𝐸𝑒𝑝 2𝜇 2ℎ
and
𝑏+3
∆𝜆 = ∆𝜎𝑉
3ℎ
These solutions are implemented in a Python script associated to this example for verifying GEOS results.
Input files
This validation example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_ExtendedDruckerPrager.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/ExtendedDruckerPrager/
˓→TriaxialDriver_vs_SemiAnalytic_ExtendedDruckerPrager.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the constant lateral confining stress, and the initial stress are defined
in the Task block as:
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ExtendedDruckerPrager"
mode="mixedControl"
axialControl="strainFunction"
radialControl="stressFunction"
initialStress="-10.e6"
steps="200"
output="ExtendedDruckerPragerResults.txt" />
</Tasks>
Constitutive laws
<ExtendedDruckerPrager
name="ExtendedDruckerPrager"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="0.1e6"
defaultInitialFrictionAngle="6.0"
defaultResidualFrictionAngle="10.0"
defaultDilationRatio="0.5"
defaultHardening="0.0001"
/>
All constitutive parameters such as density, viscosity, and bulk and shear moduli are specified in the International
System of Units.
The simulation results are saved in a text file, named ExtendedDruckerPragerResults.txt. A perfect comparison
between the results given by the TriaxialDriver solver in GEOS and the semi-analytical results presented above is shown
below
4 0.00 4
Deviatoric Stress (MPa)
3 3
Volumetric Strain (%)
2 0.05 2
1 1
0 0.10 0
1 1
0.15
2 2
Triaxial Driver
3 3 Semi-Analytical
0.20
0.25 0.00 0.25 0.50 0.0 0.2 0.4 0.6 9 10 11
Strain (%) Axial Strain (%) Mean stress (MPa)
To go further
Problem description
This example uses the Triaxial Driver to simulate a triaxial compression test of a Visco Extended Drucker-Prager solid.
Constant lateral confining stress together with loading/unloading axial strain periods are imposed. Imposed axial strain
range are high enough for allowing plastic yield in both loading and unloading period. This complicated scenario is
used for verifying the numerical convergence and accuracy of the Visco Extended Drucker-Prager constitutive model
implemented in GEOS.
Semi analytical result for axial stress variation ∆𝜎𝑉 and lateral strain variation ∆𝜀𝑉 can be established for the im-
posed triaxial boundary conditions following the theoretical basis of the Perzyna time dependent approach presented
by (Runesson et al. 1999) as:
𝜃𝑏 − 3
∆𝜎𝑉 = (∆𝜀𝑉 − ∆𝜆 )𝐸
3
∆𝜎𝑉 3
∆𝜀𝐻 = ∆𝜀𝑉 − + ∆𝜆
2𝜇 2
where 𝐸 and 𝜇 are the elastic Young and shear moduli. The visco-plastic multiplier ∆𝜆 can be approximated by:
∆𝑡 𝐹
∆𝜆 =
𝑡* 3𝜇 + 𝐾𝜃𝑏2 + ℎ
in which ∆𝑡 is the time increment, 𝑡* is the relaxation time, 𝐹 is the stress function defining the visco-plastic yield
surface, 𝐾 is the elastic bulk modulus, 𝑏 is the frictional parameter defining the visco-plastic yield surface, 𝜃 is the
dilation ratio defining the plastic potential and ℎ is the hardening rate. The hardening rate ℎ is defined by
𝜕𝐹 𝜕𝑏
ℎ=
𝜕𝑏 𝜕𝜆
These solutions were established for a positive shear stress 𝑞 = −(𝜎𝑉 −𝜎𝐻 ) (negative sign convention for compression
stress). For the case when the plastic yield occurs at a negative shear stress, we have
𝜃𝑏 + 3
∆𝜎𝑉 = (∆𝜀𝑉 − ∆𝜆 )𝐸
3
∆𝜎𝑉 3
∆𝜀𝐻 = ∆𝜀𝑉 − − ∆𝜆
2𝜇 2
These solutions are implemented in a Python script associated to this example for verifying GEOS results.
Input files
This validation example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_ViscoExtendedDruckerPrager.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/
˓→ViscoExtendedDruckerPrager/TriaxialDriver_vs_SemiAnalytic_ViscoExtendedDruckerPrager.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the constant lateral confining stress as well as the initial stress are
defined in the Task block as
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ViscoExtendedDruckerPrager"
mode="mixedControl"
axialControl="strainFunction"
radialControl="stressFunction"
initialStress="-10.e6"
steps="200"
output="ViscoExtendedDruckerPragerResults.txt" />
</Tasks>
Constitutive laws
<ViscoExtendedDruckerPrager
name="ViscoExtendedDruckerPrager"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="0.1e6"
defaultInitialFrictionAngle="6.0"
defaultResidualFrictionAngle="10.0"
defaultDilationRatio="0.5"
defaultHardening="0.0001"
relaxationTime="0.1"
/>
All constitutive parameters such as density, viscosity, and bulk and shear moduli are specified in the International
System of Units.
The simulation results are saved in a text file, named ViscoExtendedDruckerPragerResults.txt. A comparison
between the results given by the TriaxialDriver solver in GEOS and the approximated semi-analytical results presented
above is shown below. Interestingly we observed that the Duvaut-Lions approach implemented in GEOS can fit perfectly
with the Perzyna approach that was considered for deriving the analytical results. This consistency between these time
dependence approaches is because of the linear hardening law of the considered constitutive model as already discussed
by (Runesson et al. 1999) .
To go further
Problem description
This example uses the Triaxial Driver to simulate an elasto-plastic oedometric compression test of a Modified CamClay
solid. Oedometric condition with zero lateral strain together with loading/unloading axial strain periods are imposed.
Semi-analytical results for the mean and shear stress variations ∆𝑝 and ∆𝑞 can be derived from the imposed vertical
strain variation by solving the following equation system:
1 1 𝜕𝐹 𝜕𝐺 1 𝜕𝐹 𝜕𝐺
∆𝜀𝑉 = ∆𝑝( + ) + ∆𝑞
𝐾 ℎ 𝜕𝑝 𝜕𝑝 ℎ 𝜕𝑞 𝜕𝑝
3 𝜕𝐹 𝜕𝐺 1 1 𝜕𝐹 𝜕𝐺
∆𝜀𝑉 = ∆𝑝 + ∆𝑞( + )
2ℎ 𝜕𝑝 𝜕𝑞 2𝜇 ℎ 𝜕𝑞 𝜕𝑞
where 𝐾 and 𝜇 are elastic bulk and shear moduli, 𝐹 and 𝐺 are the plastic yield surface and the plastic potential, and ℎ
the is hardening rate defined by:
𝜕𝐹 𝜕𝐺
ℎ=−
𝜕𝜀𝑣𝑝
𝑣𝑜𝑙 𝜕𝑝
in which 𝜀𝑣𝑝
𝑣𝑜𝑙 is the volumetric visco-plastic strain. These solutions are implemented in a Python script associated to
this example for verifying GEOS results.
Input files
This validation example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_ModifiedCamClay.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/ModifiedCamClay/
˓→TriaxialDriver_vs_SemiAnalytic_ModifiedCamClay.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the zero lateral strain as well as the initial stress are defined in the
Task block as
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ModifiedCamClay"
mode="strainControl"
axialControl="strainFunction"
radialControl="zeroStrain"
initialStress="-1e5"
steps="200"
output="ModifiedCamClayResults.txt" />
</Tasks>
Constitutive laws
<ModifiedCamClay
name="ModifiedCamClay"
defaultDensity="2700"
defaultRefPressure="-1e5"
defaultRefStrainVol="0.0"
defaultShearModulus="5e7"
defaultPreConsolidationPressure="-1.5e5"
defaultCslSlope="1.2"
defaultRecompressionIndex="0.002"
defaultVirginCompressionIndex="0.003"
/>
All constitutive parameters such as density, viscosity, bulk and shear moduli are specified in the International System
of Units.
The simulation results are saved in a text file, named ModifiedCamClayResults.txt. A perfect comparison between
the results given by the TriaxialDriver solver in GEOS and the semi-analytical results presented above is shown below:
700 350
1000
600 300
To go further
Problem description
This example uses the Triaxial Driver to simulate a visco-elasto-plastic oedometric compression test of a Visco Modified
CamClay solid. Oedometric condition with zero lateral strain together with loading/unloading axial strain periods are
imposed. Semi-analytical results for the mean and shear stress variations ∆𝑝 and ∆𝑞 can be established, considering
the Perzyna approach, for the imposed oedometric boundary conditions as (Runesson et al. 1999) :
𝜕𝐺
∆𝑝 = 𝐾(∆𝜀𝑉 − ∆𝜆 )
𝜕𝑝
3 𝜕𝐺
∆𝑞 = 2𝜇(∆𝜀𝑉 − ∆𝜆 )
2 𝜕𝑞
where 𝐾 and 𝜇 are elastic bulk and shear moduli, 𝐺 is the plastic potential and ∆𝜆 is the visco-plastic multiplier that
can be approximated by:
∆𝑡 𝐹
∆𝜆 =
𝑡* 3𝜇 𝜕𝐹
𝜕𝑞
𝜕𝐺
𝜕𝑞 + 𝐾 𝜕𝐹
𝜕𝑝
𝜕𝐺
𝜕𝑝 +ℎ
in which ∆𝑡 is the time increment, 𝑡* is the relaxation time, 𝐹 is the stress function defining the visco-plastic yield
surface and ℎ is the hardening rate defined by:
𝜕𝐹
ℎ=−
𝜕𝜆
These solutions are implemented in a Python script associated to this example for verifying GEOS results.
Input files
This validation example uses two GEOS xml files that are located at:
inputFiles/triaxialDriver/triaxialDriver_base.xml
and
inputFiles/triaxialDriver/triaxialDriver_ViscoModifiedCamClay.xml
inputFiles/triaxialDriver/tables/
A Python script for the semi-analytical solutions presented above as well as for post-processing the GEOS results is
provided at:
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/ViscoModifiedCamClay/
˓→TriaxialDriver_vs_SemiAnalytic_ViscoModifiedCamClay.py
For this example, we focus on the Task and the Constitutive tags.
Task
The imposed axial strain loading/unloading periods, the lateral zero strain, and the initial stress are defined in the Task
block as:
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="ViscoModifiedCamClay"
mode="strainControl"
axialControl="strainFunction"
radialControl="zeroStrain"
initialStress="-1e5"
steps="200"
output="ViscoModifiedCamClayResults.txt" />
</Tasks>
Constitutive laws
<ViscoModifiedCamClay
name="ViscoModifiedCamClay"
defaultDensity="2700"
defaultRefPressure="-1e5"
defaultRefStrainVol="0.0"
defaultShearModulus="5e7"
defaultPreConsolidationPressure="-1.5e5"
defaultCslSlope="1.2"
defaultRecompressionIndex="0.002"
defaultVirginCompressionIndex="0.003"
relaxationTime="0.1"
/>
All constitutive parameters such as density, viscosity, and the bulk and shear moduli are specified in the International
System of Units.
The simulation results are saved in a text file, named ViscoModifiedCamClayResults.txt. A comparison between
the results given by the TriaxialDriver solver in GEOS and the semi-analytical results presented above is shown below.
The discrepancy between these results may due to the difference between the Duvaut-Lions approach and the Perzyna
approach for time dependant behavior when applying for the Modified CamClay model as discussed by Runesson et al.
(1999).
800
700 350
1000
To go further
Context
In this example, we simulate a relaxation test with a Visco Extended Drucker-Prager solid. This problem is solved using
a viscoplastic solver (see Model: Viscoplasticity) in GEOS to predict the time-dependent deformation of the sample
when subject to loading conditions. We verify the numerical results obtained by GEOS against a semi-analytical
solution (see Visco Extended Drucker-Prager Model: Triaxial Driver versus Semi-Analytical Solution).
Input file
The xml input files for the test case are located at:
inputFiles/solidMechanics/viscoExtendedDruckerPrager_relaxation_base.xml
inputFiles/solidMechanics/viscoExtendedDruckerPrager_relaxation_benchmark.xml
src/docs/sphinx/advancedExamples/validationStudies/viscoplasticity/RelaxationTest/
˓→relaxationTestFigure.py
We model the mechanical response of a viscoplastic slab subject to a displacement-controlled uniaxial loading and a
constant confining stress, as shown below. The domain is homogeneous, isotropic, and isothermal. Before loading,
the domain is initialized with isotropic stresses. Longitudinal compression is induced and governed by the normal
displacement applied uniformly over the top surface. This compressive displacement is initially elevated to allow plastic
hardening and then kept as a constant to mimic stress relaxation tests. In this example, fluid flow is not considered.
We set up and solve a Visco Extended Drucker-Prager model to obtain the spatial and temporal solutions of stresses
and displacements across the domain upon loading. These numerical predictions are compared with the corresponding
semi-analytical solutions derived from Runesson et al. (1999) (see Visco Extended Drucker-Prager Model: Triaxial
Driver versus Semi-Analytical Solution).
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
The following figure shows the mesh used for solving this mechanical problem:
The mesh was created with the internal mesh generator and parametrized in the InternalMesh XML tag. It con-
tains 10x10x10 eight-node brick elements in the x, y, and z directions respectively. Such eight-node hexahedral ele-
ments are defined as C3D8 elementTypes, and their collection forms a mesh with one group of cell blocks named here
cellBlockNames.
<Mesh>
<InternalMesh
name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 0.9, 1.0 }"
yCoords="{ 0, 0.9, 1.0 }"
zCoords="{ 0, 0.9, 1.0 }"
nx="{ 9, 1 }"
ny="{ 9, 1 }"
nz="{ 9, 1 }"
cellBlockNames="{ cb-0_0_0, cb-1_0_0, cb-0_1_0, cb-1_1_0,
cb-0_0_1, cb-1_0_1, cb-0_1_1, cb-1_1_1 }"/>
(continues on next page)
For the relaxation tests, pore pressure variations are neglected and subtracted from the analysis. Therefore, we define
a solid mechanics solver, called here mechanicsSolver. This solid mechanics solver (see Solid Mechanics Solver)
is based on the Lagrangian finite element formulation. The problem is run as QuasiStatic without considering
inertial effects. The computational domain is discretized by FE1, defined in the NumericalMethods section. We
use the targetRegions attribute to define the regions where the solid mechanics solver is applied. Here, we only
simulate mechanical deformation in one region named as Domain, whose mechanical properties are specified in the
Constitutive section.
<Solvers
gravityVector="{ 0.0, 0.0, 0.0 }">
<SolidMechanics_LagrangianFEM
name="mechanicsSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonTol="1.0e-5"
newtonMaxIter="15"/>
<LinearSolverParameters
solverType="direct"/>
</SolidMechanics_LagrangianFEM>
</Solvers>
Constitutive laws
A homogeneous domain with one solid material is assumed, and its mechanical properties are specified in the
Constitutive section:
<Constitutive>
<ViscoExtendedDruckerPrager
name="rock"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultCohesion="0.1e6"
defaultInitialFrictionAngle="15.0"
defaultResidualFrictionAngle="20.0"
defaultDilationRatio="0.5"
defaultHardening="0.0005"
relaxationTime="5000.0"
/>
</Constitutive>
Recall that in the SolidMechanics_LagrangianFEM section, rock is designated as the material in the com-
putational domain. Here, Visco Extended Drucker Prager model ViscoExtendedDruckerPrager is used to
simulate the viscoplastic behavior of rock. As for the material parameters, defaultInitialFrictionAngle,
defaultResidualFrictionAngle and defaultCohesion denote the initial friction angle, the residual friction
angle, and cohesion, respectively, as defined by the Mohr-Coulomb failure envelope. As the residual friction angle
defaultResidualFrictionAngle is larger than the initial one defaultInitialFrictionAngle, a strain harden-
ing model is adopted, with a hardening rate given as defaultHardening="0.0005". Finally, relaxationTime is a
key parameter for characterizing the viscoplastic behavior of the solid called rock.
Constitutive parameters such as density, bulk modulus, and shear modulus are specified in the International System of
Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from several property
fields (time-series). We can collect either the entire collection of field properties or specified named sets. In this
example, stressCollection is specified to output the time history of stresses fieldName="rock_stress for the
selected subdomain objectPath="ElementRegions/Domain/cb8". And displacementCollection is defined to
output the time history of displacement fieldName="totalDisplacement" for the subset setNames="{ topPoint
}".
<Tasks>
<PackCollection
name="stressCollection"
objectPath="ElementRegions/Domain/cb-1_1_1"
fieldName="rock_stress"/>
<PackCollection
name="displacementCollection"
objectPath="nodeManager"
fieldName="totalDisplacement"
setNames="{ topPoint }"/>
</Tasks>
These two tasks are triggered using the Event management where PeriodicEvent are defined for these recurring
tasks. GEOS writes two files named after the string defined in the filename keyword and formatted as HDF5 files
(displacement_history.hdf5 and stress_history.hdf5). The TimeHistory file contains the collected time history infor-
mation from each specified time history collector. This information includes datasets for the simulation time, element
center or nodal position, and the time history information. We use a Python script to read and plot any specified subset
of the time history data for verification and visualization.
The lateral traction and compressive displacement have negative values due to the negative sign convention for com-
pressive stresses in GEOS.
<FieldSpecifications>
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg }"/>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg }"/>
<FieldSpecification
name="stressXX"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Domain"
fieldName="rock_stress"
component="0"
scale="-10.0e6"
/>
<FieldSpecification
name="stressYY"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Domain"
fieldName="rock_stress"
component="1"
scale="-10.0e6"
/>
<FieldSpecification
name="stressZZ"
initialCondition="1"
setNames="{all}"
objectPath="ElementRegions/Domain"
(continues on next page)
<Traction
name="xconfinement"
setNames="{ xpos }"
objectPath="faceManager"
scale="-10.0e6"
tractionType="normal"
/>
<Traction
name="yconfinement"
setNames="{ ypos }"
objectPath="faceManager"
scale="-10.0e6"
tractionType="normal"
/>
<FieldSpecification
name="axialload"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="-0.001"
functionName="timeFunction"
setNames="{ zpos }"/>
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table.
Inspecting results
In the example, we request hdf5 output files for time-series (time history). We use Python scripts to visualize the
outcome. The following figure shows the final distribution of vertical displacement upon loading.
The figure below shows the comparisons between the numerical predictions (marks) and the corresponding analytical
solutions (lines) with respect to stress–strain relationship, stress path on the top surface, the evolution of axial stress.
Predictions computed by GEOS match the semi-analytical results. The bottom figure highlights the change in axial
stress with time. Note that, if normal displacement remains constant, the axial stress decreases gradually to a residue
value. This behavior is typically reported in the relaxation tests in laboratory.
To go further
Poromechanics
Mandel’s Problem
Context
In this example, we use the coupled solvers in GEOS to solve Mandel’s 2D consolidation problem, a classic benchmark
in poroelasticity. The analytical solution (Cheng and Detournay, 1988) is employed to verify the accuracy of the
modeling predictions on induced pore pressure and the corresponding settlement. In this example, the TimeHistory
function and a Python script are used to output and post-process multi-dimensional data (pore pressure and displacement
field).
Input file
This example uses no external input files and everything required is contained within two GEOS input files located at:
inputFiles/poromechanics/PoroElastic_Mandel_base.xml
inputFiles/poromechanics/PoroElastic_Mandel_benchmark_fim.xml
We simulate the consolidation of a poroelastic slab between two rigid and impermeable plates subjected to a constant
normal force. The slab is assumed to be fully saturated, homogeneous, isotropic, and infinitely long in the y-direction.
We apply a uniform compressive load in the vertical direction. This force leads to a change of pore pressure and
mechanical deformations of the sample, evolving with time due to fluid diffusion and coupling effects. The numerical
model represents a plane strain deformation and lateral drainage without confinement, showing only a quarter of the
computational domain in the x-z plane (the rest follows by symmetry).
In this example, we set up and solve a poroelastic model to obtain the temporal and spatial solutions of pore pressure
(𝑝(𝑥, 𝑧, 𝑡)) and displacement field (𝑢𝑧 (𝑥, 𝑧, 𝑡)) for Mandel’s problem. These modeling predictions are validated against
corresponding analytical solution (Cheng and Detournay, 1988).
∞
sin𝛼𝑛 𝛼𝑛 2 𝑐𝑡
(︁ 𝛼 𝑥 )︁ (︂ )︂
𝑛
∑︁
𝑝(𝑥, 𝑧, 𝑡) = 2𝑝0 cos − cos𝛼𝑛 exp − 2
𝑛=1 𝑛
𝛼 − sin𝛼𝑛 cos𝛼𝑛 𝑎 𝑎
∞
[︃ )︂]︃
sin𝛼𝑛 cos𝛼𝑛 𝛼𝑛 2 𝑐𝑡
(︂
𝐹 (1 − 𝜈) 𝐹 (1 − 𝜈𝑢 ) ∑︁
𝑢𝑧 (𝑥, 𝑧, 𝑡) = − + exp − 2 𝑧
2𝐺𝑎 𝐺𝑎 𝑛=1 𝑛
𝛼 − sin𝛼𝑛 cos𝛼𝑛 𝑎
with 𝛼𝑛 denoting the positive roots of the following equation:
1−𝜈
tan𝛼𝑛 = 𝛼𝑛
𝜈𝑢 − 𝜈
Upon sudden application of the vertical load, the instantaneous overpressure (𝑝0 (𝑥, 𝑧)) and settlement (𝑢𝑧,0 (𝑥, 𝑧) and
𝑢𝑥,0 (𝑥, 𝑧)) across the sample are derived from the Skempton effect:
1
𝑝0 (𝑥, 𝑧) = 𝐵 (1 + 𝜈𝑢 ) 𝐹
3𝑎
12
15.0
GEOS
12.5 Analytical
10.0 Initial Yield Surface
Residual Yield Surface
q (MPa)
7.5
5.0
2.5
0.00 2 4 6 8 10 12 14
p (MPa)
0.20 25.0
Axial Strain_GEOS
Axial Strain_Analytical 22.5
0.15
Axial Strain (%)
Stress (MPa)
20.0
0.10 17.5
15.0
0.05 Axial Stress_GEOS 12.5
Axial Stress_Analytical
0.00 0.0 0.5 1.0 1.5 2.0 10.0
Time (D)
𝐹 (1 − 𝜈𝑢 ) 𝑧
𝑢𝑧,0 (𝑥, 𝑧) = −
2𝐺 𝑎
𝐹 𝜈𝑢 𝑥
𝑢𝑥,0 (𝑥, 𝑧) =
2𝐺 𝑎
where 𝜈 and 𝜈𝑢 are the drained and undrained Poisson’s ratio respectively, 𝑐 is the consolidation coefficient, 𝐵 is
Skempton’s coefficient, 𝐺 is the shear modulus, and 𝐹 is the applied force.
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0.0, 1.0 }"
yCoords="{ 0.0, 0.1 }"
zCoords="{ 0.0, 1.0 }"
nx="{ 20 }"
ny="{ 1 }"
nz="{ 20 }"
(continues on next page)
GEOS is a multi-physics platform. Different combinations of physics solvers available in the code can be applied in
different regions of the domain and be functional at different stages of the simulation. The Solvers tag in the XML
file is used to list and parameterize these solvers.
To specify a coupling between two different solvers, we define and characterize each single-physics solver separately.
Then, we customize a coupling solver between these single-physics solvers as an additional solver. This approach
allows for generality and flexibility in constructing multi-physics solvers. The order of specifying these solvers is not
restricted in GEOS. Note that end-users should give each single-physics solver a meaningful and distinct name, as
GEOS will recognize these single-physics solvers based on their customized names and create user-expected coupling.
As demonstrated in this example, to setup a poromechanical coupling, we need to define three different solvers in the
XML file:
• the mechanics solver, a solver of type SolidMechanicsLagrangianSSLE called here lagsolve (more infor-
mation here: Solid Mechanics Solver),
<SolidMechanicsLagrangianSSLE
name="lagsolve"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
(continues on next page)
• the single-phase flow solver, a solver of type SinglePhaseFVM called here SinglePhaseFlow (more informa-
tion on these solvers at Singlephase Flow Solver),
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonTol="1.0e-4"
newtonMaxIter="40"/>
<LinearSolverParameters
directParallel="0"/>
</SinglePhaseFVM>
• the coupling solver (SinglePhasePoromechanics) that will bind the two single-physics solvers above, which
is named as poroSolve (more information at Poromechanics Solver).
<SinglePhasePoromechanics
name="poroSolve"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
logLevel="1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonMaxIter="2"
newtonTol="1.0e-2"
couplingType="Sequential"
lineSearchAction="None"
subcycling="1"
maxTimeStepCuts="1"
lineSearchMaxCuts="0"/>
<LinearSolverParameters
directParallel="0"/>
</SinglePhasePoromechanics>
The two single-physics solvers are parameterized as explained in their corresponding documentation pages. We fo-
cus on the coupling solver in this example. The solver poroSolve uses a set of attributes that specifically describe
the coupling process within a poromechanical framework. For instance, we must point this solver to the desig-
nated fluid solver (here: SinglePhaseFlow) and solid solver (here: lagsolve). These solvers interact through the
porousMaterialNames="{ shale }" with all the constitutive models. We specify the discretization method (FE1,
defined in the NumericalMethods section), and the target regions (here, we only have one, Domain). More parameters
are required to characterize a coupling procedure (more information at Poromechanics Solver). In this way, the two
single-physics solvers will be simultaneously called and executed for solving Mandel’s problem here.
Constitutive laws
For this problem, we simulate the poroelastic deformation of a slab under uniaxial compression. A homogeneous and
isotropic domain with one solid material is assumed, and its mechanical properties and associated fluid rheology are
specified in the Constitutive section. PorousElasticIsotropic model is used to describe the mechanical behav-
ior of shaleSolid when subjected to loading. The single-phase fluid model CompressibleSinglePhaseFluid is
selected to simulate the response of water upon consolidation.
<Constitutive>
<PorousElasticIsotropic
name="shale"
solidModelName="shaleSolid"
porosityModelName="shalePorosity"
permeabilityModelName="shalePerm"/>
<ElasticIsotropic
name="shaleSolid"
defaultDensity="0"
defaultBulkModulus="6.6667e7"
defaultShearModulus="4.0e7"/>
<BiotPorosity
name="shalePorosity"
defaultGrainBulkModulus="1.0e27"
defaultReferencePorosity="0.375"/>
<ConstantPermeability
name="shalePerm"
permeabilityComponents="{ 1.0e-12, 0.0, 1.0e-12 }"/>
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.000"
referenceDensity="1"
compressibility="4.4e-10"
referenceViscosity="0.001"
viscosibility="0.0"/>
</Constitutive>
All constitutive parameters such as density, viscosity, bulk modulus, and shear modulus are specified in the International
System of Units.
In the Tasks section, PackCollection tasks are defined to collect time history information from fields. Either the
entire field or specified named sets of indices in the field can be collected. In this example, pressureCollection and
displacementCollection tasks are specified to output the time history of pore pressure fieldName="pressure"
and displacement field fieldName="totalDisplacement" across the computational domain.
<Tasks>
<PackCollection
name="pressureCollection"
(continues on next page)
<PackCollection
name="displacementCollection"
objectPath="nodeManager"
fieldName="totalDisplacement"/>
</Tasks>
These two tasks are triggered using the Event manager with a PeriodicEvent defined for these recurring tasks.
GEOS writes two files named after the string defined in the filename keyword and formatted as HDF5 files (displace-
ment_history.hdf5 and pressure_history.hdf5). The TimeHistory file contains the collected time history information
from each specified time history collector. This information includes datasets for the simulation time, element center,
and the time history information. A Python script is prepared to read and plot any specified subset of the time history
data for verification and visualization.
<FieldSpecification
name="initial_sigma_x"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="shaleSolid_stress"
component="0"
scale="4934.86"/>
<FieldSpecification
name="initial_sigma_y"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="shaleSolid_stress"
(continues on next page)
<FieldSpecification
name="xInitialDisplacement"
initialCondition="1"
setNames="{ all }"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="1.0"
functionName="initialUxFunc"/>
<FieldSpecification
name="yInitialDisplacement"
initialCondition="1"
setNames="{ all }"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"/>
<FieldSpecification
name="zInitialDisplacement"
initialCondition="1"
setNames="{ all }"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="1.0"
functionName="initialUzFunc"/>
<FieldSpecification
name="xnegconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg }"/>
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
(continues on next page)
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg }"/>
<FieldSpecification
name="NormalDisplacement"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="-1.0e-5"
setNames="{ zpos }"
functionName="loadFunction"/>
<FieldSpecification
name="boundaryPressure"
objectPath="faceManager"
fieldName="pressure"
scale="0.0"
setNames="{ xpos }"/>
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table. Note that traction has a negative value,
due to the negative sign convention for compressive stresses in GEOS.
Inspecting results
We request VTK-format output files and use Paraview to visualize the results. The following figure shows the distribu-
tion of pore pressure (𝑝(𝑥, 𝑧, 𝑡)) at 𝑡 = 10𝑠 within the computational domain.
The next figure shows the distribution of vertical displacement (𝑢𝑧 (𝑥, 𝑧, 𝑡)) at 𝑡 = 10𝑠.
The figure below compares the results from GEOS (marks) and the corresponding analytical solution (lines) for the pore
pressure along the x-direction and vertical displacement along the z-direction. GEOS reliably captures the short-term
Mandel-Cryer effect and shows excellent agreement with the analytical solution at various times.
ò Note
The python script included above is used to generate the figure shown here. If you want to run this script to
verify your results, you will need to run the script from your output directory, and modify the path to the variables
xmlFile1Path and xmlFile1Path in the script to point to the location of the input files on your system.
To go further
Thermoporomechanics
Thermoporoelastic Consolidation
Context
Thermoporoelastic consolidation is a typical fully coupled problem which involves solid deformation, fluid flow and
heat transfer in saturated porous media. In this example, we use the GEOS coupled solvers to solve a one-dimensional
thermoporoelastic consolidation problem with a non-isothermal boundary condition, and we verify the accuracy of the
results using the analytical solution provided in (Bai, 2005)
InputFile
This example uses no external input files and everything required is contained within two GEOS input files located at:
inputFiles/thermoPoromechanics/ThermoPoroElastic_consolidation_base.xml
inputFiles/thermoPoromechanics/ThermoPoroElastic_consolidation_benchmark_fim.xml
We simulate the consolidation of 1D thermoporoelastic column subjected to a surface traction stress of 1 Pa applied on
the top surface, with a surface temperature of 50 degrees Celsius and a pore pressure of 0 Pa. The initial temperature
of the saturated soil is 0 degrees Celsius. The soil column is insulated and sealed everywhere, except at the top surface.
The problem setup is illustrated below.
Fig. 1.79: Sketch of the problem (taken from (Gao and Ghassemi, 2019)).
The coupled dynamics experienced by the system are described in (Gao and Ghassemi, 2019) and summarized below.
The model first experiences continuous settlement (contraction). Initially, the settlement caused by the drainage of the
fluid (effective stress increase) and the compression of the solid matrix is larger than the expansion due to the increase
of temperature in the region close to the surface on which a higher temperature is applied. As the temperature diffuses
further into the domain, it gradually rebounds (expansion) and reaches a final status.
For this example, we focus on the Solvers, the Constitutive, and the FieldSpecifications tags of the GEOS
input file.
Solvers
As demonstrated in this example, to setup a thermoporomechanical coupling, we need to define three different solvers
in the Solvers part of the XML file:
• the mechanics solver, a solver of type SolidMechanicsLagrangianSSLE called here solidMechSolver (more
information here: Solid Mechanics Solver),
<SolidMechanicsLagrangianSSLE
name="solidMechSolver"
timeIntegrationOption="QuasiStatic"
logLevel="1"
discretization="FE1"
targetRegions="{ Domain }"/>
• the single-phase flow solver, a solver of type SinglePhaseFVM called here flowSolver (more information on
these solvers at Singlephase Flow Solver),
<SinglePhaseFVM
name="flowSolver"
logLevel="1"
discretization="tpfaFlow"
temperature="273.0"
isThermal="1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonMaxIter="100"
newtonMinIter="0"
newtonTol="1.0e-6"/>
<LinearSolverParameters
directParallel="0"/>
</SinglePhaseFVM>
• the coupling solver (SinglePhasePoromechanics) that will bind the two single-physics solvers above, which
is named as thermoPoroSolver (more information at Poromechanics Solver).
<SinglePhasePoromechanics
name="thermoPoroSolver"
solidSolverName="solidMechSolver"
flowSolverName="flowSolver"
isThermal="1"
logLevel="1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
couplingType="FullyImplicit"
newtonMaxIter="200"/>
<LinearSolverParameters
directParallel="0"/>
</SinglePhasePoromechanics>
To request the simulation of the temperature evolution, we set the isThermal flag of the coupling solver to 1. With
this choice, the degrees of freedom are the cell-centered pressure, the cell-centered temperature, and the mechanical
displacements at the mesh nodes. The governing equations consist of a mass conservation equation, an energy balance
equation, and a linear momentum balance equation. In the latter, the total stress includes both a pore pressure and a
temperature contribution. Note that in the coupling solver, we set the couplingType to FullyImplicit to require a
fully coupled, fully implicit solution strategy.
Constitutive laws
A homogeneous and isotropic domain with one solid material is assumed, and its mechanical properties and associated
fluid rheology are specified in the Constitutive section. We use the constitutive parameters specified in (Bai, 2005)
listed in the following table.
The bulk modulus, the Young’s modulus, and the thermal expansion coefficient are specified in the ElasticIsotropic
solid model. Note that for now the solid density is constant and does not depend on temperature. Given that the gravity
vector has been set to 0 in the XML file, the value of the solid density is not used in this simulation.
<ElasticIsotropic
name="rockSolid"
defaultDensity="2400"
defaultBulkModulus="1e4"
defaultShearModulus="2.143e3"
defaultDrainedLinearTEC="3e-7"/>
The porosity and Biot’s coefficient (computed from the grainBulkModulus) appear in the BiotPorosity model. In
this model, the porosity is updated as a function of the strain increment, the change in pore pressure, and the change in
temperature.
<BiotPorosity
name="rockPorosity"
defaultGrainBulkModulus="1.0e27"
defaultReferencePorosity="0.2"
defaultPorosityTEC="3e-7"/>
The heat capacity is provided in the SolidInternalEnergy model. In the computation of the internal energy, the
referenceTemperature is set to the initial temperature.
<SolidInternalEnergy
name="rockInternalEnergy"
referenceVolumetricHeatCapacity="1.672e5"
referenceTemperature="0.0"
referenceInternalEnergy="0.0"/>
The fluid density and viscosity are given in the ThermalCompressibleSinglePhaseFluid. Here, they are assumed
to be constant and do not depend on pressure and temperature.
<ThermalCompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
(continues on next page)
Finally, the permeability and thermal conductivity are specified in the ConstantPermeability and
SinglePhaseConstantThermalConductivity, respectively.
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 4.0e-9, 4.0e-9, 4.0e-9 }"/>
<SinglePhaseThermalConductivity
name="thermalCond"
defaultThermalConductivityComponents="{ 836, 836, 836 }"/>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Domain/cb1"
fieldName="pressure"
scale="0.0"/>
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Domain/cb1"
fieldName="temperature"
scale="273.0"/>
<FieldSpecification
name="initialSigma_x"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions/Domain/cb1"
(continues on next page)
For the zero-displacement boundary conditions, we use the pre-defined set names xneg and xpos, yneg, zneg and zpos
to select the boundary nodes. Note that here, we have considered a slab in the y-direction, which is why a displacement
boundary condition is applied on zpos and not applied on ypos.
<FieldSpecification
name="xconstraint"
fieldName="totalDisplacement"
component="0"
objectPath="nodeManager"
setNames="{ xneg, xpos }"/>
<FieldSpecification
name="yconstraint"
fieldName="totalDisplacement"
component="1"
objectPath="nodeManager"
setNames="{ yneg }"/>
<FieldSpecification
name="zconstraint"
fieldName="totalDisplacement"
component="2"
objectPath="nodeManager"
setNames="{ zneg, zpos }"/>
On the top surface, we impose the traction boundary condition and the non-isothermal boundary condition specified in
(Bai, 2005). We also fix the pore pressure to 0 Pa.
<Traction
name="traction"
objectPath="faceManager"
tractionType="normal"
(continues on next page)
<FieldSpecification
name="boundaryPressure"
objectPath="faceManager"
fieldName="pressure"
scale="0.0"
setNames="{ ypos }"/>
<FieldSpecification
name="boundaryTemperature"
objectPath="faceManager"
fieldName="temperature"
scale="323.0"
setNames="{ ypos }"/>
Inspecting results
We request an output of the displacements, pressure, and temperature using the TimeHistory feature of GEOS. The
figures below compare the results from GEOS (dashed line) and the corresponding analytical solution (solid line) as a
function of time at different locations of the slab. We obtain a very good match, confirming that GEOS can accurately
capture the thermo-poromechanical coupling on this example. The first figure illustrates this good agreement for the
pressure evolution.
The second figure confirms the good match with the analytical solution for the temperature.
The third figure shows that GEOS is also able to match the vertical displacement (settlement) analytical solution.
To go further
1.0
0.8
0.6
Pressure [Pa]
0.4
GEOSX: z = 0.0 m
GEOSX: z = 4.2 m
0.2 GEOSX: z = 5.6 m
Analytical: z = 0.0 m
Analytical: z = 4.2 m
0.0 Analytical: z = 5.6 m
10 2 10 1 100 101 102 103 104 105
Time [s]
300
290
280
GEOSX: z = 1.4 m
0.0004 GEOSX: z = 4.2 m
GEOSX: z = 5.6 m
Analytical: z = 1.4 m
Analytical: z = 4.2 m
0.0003 Analytical: z = 7 m
Displacement [m]
0.0002
0.0001
0.0000
10 2 10 1 100 101 102 103 104 105
Time [s]
Level nr nt nz nelem
1 33 64 391 825,792
2 33 64 3125 6,600,000
3 66 128 6250 52,800,000
4 132 256 12500 422,400,000
5 264 512 25000 3,379,200,000
6 528 1024 50000 27,033,600,000
Mechanics
Fig. 1.80: Weak scaling results for the mechanics model on Frontier.
To execute a performance study across different GPU configurations and problem levels for the wellbore problem on
the Frontier supercomputer, follow these steps:
Prerequisites
Ensure you have access to the Frontier system and that you have access to a valid job allocation account. For detailed
instructions on system access and environment setup, refer to the Frontier User Guide.
Fig. 1.81: Weak scaling results for the single phase flow model on Frontier.
Fig. 1.82: Weak scaling results for the compositional multiphase flow model on Frontier.
Directory Structure
The input files for different problem levels and configurations are organized under ${GEOS_DIR}/inputFiles/
wellboreECP/. Each physical problem (e.g., mechanics, compositionalMultiphaseFlow, singlePhaseFlow)
has its own directory containing multiple levels of problem refinement as described in the table above.
Dispatching Jobs
Use the dispatch.py script to automate the setup and submission of jobs for different levels of problem refinement
and physics models.
Usage:
This command launches jobs for levels 1, 2, and 3 under the mechanics problem configuration.
Analyzing Output
After job completion, utilize the postprocess.py script to extract and plot performance metrics from the output files.
Usage:
This command parses the latest output files in the mechanics directory, selected by the highest [jobID]. It matches
files with the pattern [machine_name]-[jobID]-[model_type]-geom[level].out, extracting average execution
times per non-linear step for the following phases: GEOS, matrix creation, Hypre setup, and Hypre solve.
Note
The job scripts designed for Frontier are likely compatible with other Slurm-based systems, making them reusable
across different high-performance computing environments with minimal adjustments.
GEOS/examples/pygeosxExamples/hydraulicFractureWithMonitor
This example is derived from this basic example: Hydraulic Fracturing, which solves for the propagation of a single
hydraulic fracture within a heterogeneous reservoir. The pygeosx interface is used to monitor the maximum hydraulic
aperture and fracture extents over time.
XML Configuration
The input xml file for this example requires some modification in order to work with pygeosx. First, we use the advanced
xml input features to include the base problem and override the table_root parameter that points to the table files. Note
that these paths will need to be updated if you run this problem outside of the example directory.
<Included>
<File
name="../../hydraulicFracturing/heterogeneousInSituProperties/heterogeneousInSitu_
˓→singleFracture.xml"/>
</Included>
<Parameters>
<Parameter
name="table_root"
value="../../hydraulicFracturing/heterogeneousInSituProperties/tables"/>
</Parameters>
Next, we add a new entry to the output block Python and an entry in the Events block. Whenever the python event is
triggered, GEOS will pause and return to the controlling python script (in this case, every 10 cycles).
<Outputs>
<Python
name="pythonOutput"/>
</Outputs>
<Events>
<PeriodicEvent
name="python"
cycleFrequency="10"
target="/Outputs/pythonOutput"/>
</Events>
Python Script
Problems that use the pygeosx interface are driven by a custom python script. To begin, we import a number of packages
and check whether this is a parallel run. The custom packages include pygeosx, which provides an interface to GEOS,
and pygeosx_tools, which provides a number of common tools for working with the datastructure and dealing with
parallel communication.
In the next step, we apply the xml preprocessor to resolve the advanced xml features. Note that this step will modify
the input arguments to reflect the location of the compiled xml file, which is processed directly by GEOS. The script
then initializes GEOS and receives the problem handle, which is the scripts view into the datastructure. There is an
opportunity to interact with the GEOS before the initial conditions are set, which we do not use in this example.
To extract information from the problem, you need to know the full path (or ‘key’) to the target object. These keys can
be quite long, and can change depending on the xml input. In the next step, we use a method from the pygeosx_tools
package to search for these keys using a list of keywords. If the keys are known beforehand, then this step could be
skipped. Note that these functions will throw an error if they do not find a matching key, or if they find multiple
matching keys.
Next, we setup a dictionary that will allow us to use pygeosx_tools to automatically query the problem. The root level
of this dictionary contains the target keys (fracture location and aperture) and the required time key. These each point to
a sub-dictionary that holds an axis label, a scale factor, and an empty list to hold the time history. The target dictionaries
also hold an entry fhandle, which contains a matplotlib figure handle that we can use to display the results.
After setting up the problem, we enter the main problem loop. Upon calling pygeosx.run(), the code will execute until
a Python event is triggered in the Event loop. At those points, we have the option to interact with the problem before
continuing processing. Here, we use pygeosx_tools to query the datastructure and occasionaly plot the results to the
screen.
Manual Query
To obtain and manually inspect an object in the problem, you can use the methods in pygeosx_tools.wrapper. These are
designed to handle any parallel communication that may be required in your analysis. For example, to get the fracture
aperture as a numpy array, you could call:
# Local copy (the write flag indicates that we do not plan to modify the result)
aperture_local = wrapper.get_wrapper(problem, fracture_aperture_key, write_flag=False)
To run the problem, you must use the specific version of python where pygeosx is installed. This is likeley located here:
GEOS/[build_dir]/lib/PYGEOSX/bin/python
Note that you may need to manually install the pygeosx_tools package (and its pre-requisites) into this python distribu-
tion. To do so, you can run the following:
cd GEOS/[build_dir]/lib/PYGEOSX/bin
pip install --upgrade ../../../../src/coreComponents/python/modules/pygeosx_tools_
˓→package/
To run the code, you will call the pygeosx run script with python, and supply the typical geosx command-line arguments
and any parallel arguments. For example:
To go further
GEOS/examples/pygeosxExamples/sedovWithStressFunction
XML Configuration
As before, the basic sedov input xml file for this example requires some modification in order to work with pygeosx.
First, we use the advanced xml input features to include the base problem (this path may need to be updated, depending
on where you run the problem).
<Included>
<File
name="../../../inputFiles/solidMechanics/sedov.xml"/>
</Included>
Next, we add a new entry to the output block Python and an entry in the Events block. Whenever the python event is
triggered, GEOS will pause and return to the controlling python script.
<Events>
<PeriodicEvent
name="python"
cycleFrequency="5"
target="/Outputs/pythonOutput"/>
</Events>
<Outputs>
<Python
name="pythonOutput"/>
</Outputs>
Python Script
Similar to the previous example, the python script begins by importing the required packages, applying the xml pre-
processor, GEOS initialization, and key search.
The next steps rely on a python function that we use to set stress. The argument to this function, x, is assumed to be a
numpy array of element centers:
def stress_fn(x):
"""
Function to set stress values
Args:
x (np.ndarray) the element centers
Returns:
np.ndarray: stress values
"""
R = x[:, 0]**2 + x[:, 1]**2 + x[:, 2]**2
return np.sin(2.0 * np.pi * R / np.amax(R))
In the following section, we zero out the initial stress and then set it based on stress_fn. While doing this, we use
wrapper.print_global_value_range to check on the process.
Finally, we run the simulation. As an optional step, we extract numpy arrays from the datastructure using different
parallel approaches:
# Gather/allgather tests
tmp = wrapper.gather_wrapper(problem, stress_key)
print(wrapper.rank, 'gather', np.shape(tmp), flush=True)
To run the problem, you must use the specific version of python where pygeosx is installed. This is likeley located here:
GEOS/[build_dir]/lib/PYGEOSX/bin/python
Note that you may need to manually install the pygeosx_tools package (and its pre-requisites) into this python distribu-
tion. To do so, you can run the following:
cd GEOS/[build_dir]/lib/PYGEOSX/bin
pip install --upgrade ../../../../src/coreComponents/python/modules/pygeosx_tools_
˓→package/
To run the code, you will call the pygeosx run script with python, and supply the typical geosx command-line arguments
and any parallel arguments. For example:
To go further
geosx -i input.xml
XML Components
The following illustrates some of the key features of a GEOS-format xml file:
<Problem>
<BlockA
someAttribute="1.234">
The two basic components of an xml file are blocks, which are specified using angle brackets (“<BlockA> </BlockA>”),
and attributes that are attached to blocks (attributeName=”attributeValue”). Block and attributes can use any ASCII
character aside from <, &, ‘, and “ (if necessary, use <, &, ', or "). Comments are indicated as
follows: <!– Some comment –>.
At the beginning of a GEOS input file, you will find an optional xml declaration (<?xml version=”1.0” ?>) that is used
to indicate the format to certain text editors. You will also find the root Problem block, where the GEOS configuration
is placed. Note that, aside from these elements and commented text, the xml format requires that no other objects exist
at the first level.
In the example above, there is a single element within the Problem block: BlockA. BlockA has an attribute someAttribute,
which has a value of 1.234, and has three children: a commented string “Some comment” and two instances of BlockB.
The name attribute is required for blocks that allow multiple instances, and should include a unique string to avoid
potential errors. Where applicable these blocks will be executed in the order in which they are specified in input file.
Input Validation
The optional xmlns:xsi and xsi:noNamespaceSchemaLocation attributes in the Problem block can be used to indicate
the type of document and the location of the xml schema to the text editor:
<Problem
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="/path/to/schema.xsd" />
The schema contains a list of xml blocks and attributes that are supported by GEOS, indicates whether a given object is
optional or required, and defines the format of the object (string, floating point number, etc.). A copy of the schema is
included in the GEOS source code (/path/to/GEOS/src/coreComponents/schema/schema.xsd). It can also be generated
using GEOS: geosx -s schema.xsd
Many text editors can use the schema to help in the construction of an xml file and to indicate whether it is valid. Using
a validation tool is highly recommended for all users. The following instructions indicate how to turn on validation for
a variety of tools:
xmllint
xmllint is a command-line tool that is typically pre-installed on UNIX-like systems. To check whether an input file is
valid, run the following command:
xmllint –schema /path/to/schema.xsd input_file.xml
Sublime Text
We recommend using the Exalt or SublimeLinter_xmllint plug-ins to validate xml files within sublime. If you have not
done so already, install the sublime Package Control. To install the package, press ctrl + shift + p, type and select
Package Control: Install Package, and search for exalt or SublimeLinter / SublimeLinter-xmllint.
Note that, depending on the circumstances, these tools may indicate only a subset of the validation errors at a given
time. Once resolved, the tools should re-check the document to look for any additional errors.
As an additional step for SublimLinter-xmllint, you will need to add a linter configuration. To do so, go to Prefer-
ences/Package Settings/SublimeLinter/Settings. In the right-hand side of the new window, add the xmllint configura-
tion:
{
"linters": {
"xmllint":
{
"args": "--schema /path/to/schema.xsd",
"styles": [
{
"mark_style": "fill",
"scope": "region.bluish",
"types": ["error"],
"icon": "stop",
}
]
},
}
}
VS Code
We recommend using the XML for validating xml files. After installing this extension, you can associate GEOS format
xml files by adding the following entry to the user settings file (replacing systemId with the correct path to the schema
file):
{
"xml.fileAssociations": [
{
"pattern": "**.xml",
"systemId": "/path/to/GEOS/src/coreComponents/schema/schema.xsd"
}
]
}
Eclipse
The Eclipse Web Develop Tools includes features for validating xml files. To install them, go to Help -> Eclipse Mar-
ketplace, search for the Eclipse Web Developer Tools, install the package, and restart Eclipse. Finally, configure the
xml validation preferences under Window -> Preferences -> XML -> XML Files -> Validation. Eclipse will automat-
ically fetch the schema, and validate an active xml file. The editor will highlight any lines with errors, and underline
the specific errors.
The geosx_xml_tools package, which is used to enable advanced features such as parameters, symbolic math, etc.,
contains tools for validating xml files. To do so, call the command-line script with the -s argument, i.e.: preprocess_xml
input_file.xml -s /path/to/schema.xsd. After compiling the final xml file, pygeosx will fetch the designated schema,
validate, and print any errors to the screen.
Note: Attributes that are using advanced xml features will likely contain characters that are not allowed by their cor-
responding type pattern. As such, file editors that are configured to use other validation methods will likely identify
errors in the raw input file.
XML Schema
An XML schema definition (XSD) file lays out the expected structure of an input XML file. During the build process,
GEOS automatically constructs a comprehensive schema from the code’s data structure, and updates the version in the
source (GEOS/src/coreComponents/schema/schema.xsd).
Schema Components
The first entry in the schema are a set of headers the file type and version. Following this, the set of available simple
types for attributes are laid out. Each of these includes a variable type name, which mirrors those used in the main
code, and a regular expression, which is designed to match valid inputs. These patterns are defined and documented in
rtTypes (in DataTypes.hpp. The final part of the schema is the file layout, beginning with the root Problem. Each
complex type defines an element, its children, and its attributes. Each attribute defines the input name, type, default
value, and/or usage. Comments preceding each attribute are used to relay additional information to the users.
A schema may be generated by calling the main code with the -s argument , e.g.: geosx -s schema.xsd (Note: this
is done automatically during the bulid process). To do this, GEOS does the following:
1) Initialize the GEOS data structure.
2) Initialize objects that are registered to catalogs via ManagedGroup::ExpandObjectCatalogs().
3) Recursively write element and attribute definitions to the schema using information stored in GEOS groups and
wrappers.
4) Define any expected deviations from the schema via ManagedGroup::SetSchemaDeviations().
Usage
An input file that uses advanced xml features requires preprocessing before it can be used with GEOS. The preprocessor
writes a compiled xml file to the disk, which can be read directly by GEOS and serves as a permanent record for the
simulation. There are three ways to apply the preprocessor:
1) Automatic Preprocessing: Substituting geosx for geosx_preprocessed when calling the code will automatically
apply the preprocessor to the input xml file, and then pass the remaining arguments to GEOS. With this method,
the compiled xml files will have the suffix ‘.preprocessed’. Before running the code, the compiled xml file will
also be validated against the xml schema.
# Serial example
geosx_preprocessed -i input.xml
# Parallel example
srun -n 2 geosx_preprocessed -i input.xml -x 2
2) Manual Preprocessing: For this approach, xml files are preprocessed manually by the user with the prepro-
cess_xml script. These files can then be submitted to GEOS separately:
3) Python / pygeosx: The preprocessor can also be applied directly in python or in pygeosx simulations. An example
of this is method is provided here: GEOS/examples/pygeosxExamples/hydraulicFractureWithMonitor/.
Each of these options support specifying multiple input files via the command line (e.g. geosx_preprocessed
-i input_a.xml -i input_b.xml). They also support any number of command-line parameter overrides (e.g.
geosx_preprocessed -i input_a.xml -p parameter_a alpha -p parameter_b beta).
Included Files
Both the XML preprocessor and GEOS executable itself provide the capability to build complex multi-file input decks
by including XML files into other XML files.
The files to be included are listed via the <Included> block. There maybe any number of such blocks. Each block
contains a list of <File name=”. . . ”/> tags, each indicating a file to include. The name attribute must contain either
an absolute or a relative path to the included file. If the path is relative, it is treated as relative to the location of the
referring file. Included files may also contain includes of their own, i.e. it is possible to have a.xml include b.xml which
in turn includes c.xml.
ò Note
When creating multi-file input decks, it is considered best practice to use relative file paths. This applies both to
XML includes, and to other types of file references (for example, table file names). Relative paths keep input decks
both relocatable within the file system and sharable between users.
XML preprocessor’s merging capabilities are more advanced than GEOS built-in ones. Both are outlined below.
XML preprocessor
The merging approach is applied recursively, allowing children to include their own files. Any potential conflicts are
handled via the following scheme:
• Merge two objects if:
– At the root level an object with the matching tag exists.
– If the “name” attribute is present and an object with the matching tag and name exists.
– Any preexisting attributes on the object are overwritten by the donor.
GEOS
GEOS’s built-in processing simply inserts the included files’ content (excluding the root node) into the XML element
tree, at the level of <Included> tag. Partial merging is handled implicitly by GEOS’s data structure, which treats
repeated top-level XML blocks as if they are one single block. This is usually sufficient for merging together top-level
input sections from multiple files, such as multiple <FieldSpecifications> or <Events> sections, but more complex
cases may require the use of preprocessor.
ò Note
While GEOS’s XML processing is capable of handling any number of <Included> block at any level, the XML
schema currently produced by GEOS only allows a single such block, and only directly within the <Problem> tag.
Inputs that use multiple blocks or nest them deeper may run but will fail to validate against the schema. This is a
known discrepancy that may be fixed in the future.
Parameters
Parameters are a convenient way to build a configurable and human-readable input XML. They are defined via a block
in the XML structure. To avoid conflicts with other advanced features, parameter names can include upper/lower case
letters and underscores. Parameters may have any value, including:
• Numbers (with or without units)
• A path to a file
• A symbolic expression
• Other parameters
• Etc.
They can be used as part of any input xml attribute as follows:
• $x_par$ (preferred)
• $x_par
• $:x_par
• $:x_par$
Attributes can be used across Included files, but cannot be used to set the names of included files themselves. The
following example uses parameters to set the root path for a table function, which is then scaled by another parameter:
<Parameters>
<Parameter
name="flow_scale"
value="0.5"/>
<Parameter
name="table_root"
value="/path/to/table/root"/>
</Parameters>
<FieldSpecifications>
<SourceFlux
name="sourceTerm"
(continues on next page)
<Functions>
<TableFunction
name="flow_rate"
inputVarNames="{time}"
coordinateFiles="{$table_root$/time_flow.geos}"
voxelFile="$table_root$/flow.geos"
interpolation="linear"/>
</Functions>
Any number of parameter overrides can be issued from the command line using the -p name value argument in the
preprocessor script. Note that if the override value contains any spaces, it may need to be surrounded by quotation
marks (-p name “paramter with spaces”).
Units
The units for any input values to GEOS can be in any self-consistent system. In many cases, it is useful to override
this behavior by explicitly specifying the units of the input. These are specified by appending a valid number with a
unit definition in square braces. During pre-processing, these units are converted into base-SI units (we plan to support
other unit systems in the future).
The unit manager supports most common units and SI prefixes, using both long- and abbreviated names (e.g.: c, centi,
k, kilo, etc.). Units may include predefined composite units (dyne, N, etc.) or may be built up from sub-units using a
python syntax (e.g.: [N], [kg*m/s**2]). Any (or no) amount of whitespace is allowed between the number and the unit
bracket. The following shows a set of parameters with units specified:
<Parameters>
<Parameter name="paramter_a" value="2[m]"/>
<Parameter name="paramter_b" value="1.2 [cm]"/>
<Parameter name="paramter_c" value="1.23e4 [bbl/day]"/>
<Parameter name="paramter_d" value="1.23E-4 [km**2]"/>
</Parameters>
Please note that the preprocessor currently does not check whether any user-specified units are appropriate for a given
input or symbolic expression.
Symbolic Expressions
Input XML files can also include symbolic mathematical expressions. These are placed within pairs of backticks (`),
and use a limited python syntax. Please note that parameters and units are evaluated before symbolic expressions.
While symbolic expressions are allowed within parameters, errors may occur if they are used in a way that results in
nested symbolic expressions. Also, note that residual alpha characters (e.g. sin() are removed before evaluation for
security. The following shows an example of symbolic expressions:
<Parameters>
<Parameter name="a" value="2[m]"/>
<Parameter name="b" value="1.2 [cm]"/>
<Parameter name="c" value="3"/>
(continues on next page)
Validation
Unmatched special characters ($, [, `, etc.) in the final xml file indicate that parameters, units, or symbolic math were
not specified correctly. If the prepreprocessor detects these, it will throw an error and exit. Additional validation of the
compiled files can be completed with preprocess_xml by supplying the -s argument and the path to the GEOS schema.
1.5.2 Meshes
The purpose of this document is to explain how users and developers interact with mesh data. This section describes
how meshes are handled and stored in GEOS.
There are two possible methods for generating a mesh: either by using GEOS’s internal mesh generator (for Cartesian
meshes only), or by importing meshes from various common mesh file formats. This latter options allows one to
work with more complex geometries, such as unstructured meshes comprised of a variety of element types (polyhedral
elements).
The Internal Mesh Generator allows one to quickly build simple cartesian grids and divide them into several regions.
The following attributes are supported in the input block for InternalMesh:
The following is an example XML <mesh> block, which will generate a vertical beam with two CellBlocks (one in
red and one in blue in the following picture).
<Mesh>
<InternalMesh name="mesh"
elementTypes="{ C3D8 }"
xCoords="{ 0, 1 }"
yCoords="{ 0, 1 }"
zCoords="{ 0, 2, 6 }"
nx="{ 1 }"
ny="{ 1 }"
nz="{ 2, 4 }"
cellBlockNames="{ cb1, cb2 }"/>
</Mesh>
Mesh Bias
The internal mesh generator is capable of producing meshes with element sizes that vary smoothly over space. This is
achieved by specifying xBias, yBias, and/or zBias fields. (Note: if present, the length of these must match nx, ny,
and nz, respectively, and each individual value must be in the range (-1, 1).)
For a given element block, the average element size will be
𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖 + 1] − 𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖]
𝑑𝑥𝑎𝑣𝑒𝑟𝑎𝑔𝑒 [𝑖] = ,
𝑛𝑥[𝑖]
the element on the left-most side of the block will have size
The following are the two most common scenarios that occur while designing a mesh with bias:
1. The size of the block and the element size on an adjacent region are known. Assuming that we are to the left of
the target block, the appropriate bias would be:
𝑛𝑥[𝑖] · 𝑑𝑥𝑙𝑒𝑓 𝑡 [𝑖 + 1]
𝑥𝐵𝑖𝑎𝑠[𝑖] = 1 −
𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖 + 1] − 𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖]
2. The bias of the block and the element size on an adjacent region are known. Again, assuming that we are to the
left of the target block, the appropriate size for the block would be:
𝑛𝑥[𝑖] · 𝑑𝑥𝑙𝑒𝑓 𝑡 [𝑖 + 1]
𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖 + 1] − 𝑥𝐶𝑜𝑜𝑟𝑑𝑠[𝑖] =
1 − 𝑥𝐵𝑖𝑎𝑠[𝑖]
The following is an example of a mesh block along each dimension, and an image showing the corresponding mesh.
Note that there is a core region of elements with zero bias, and that the transitions between element blocks are smooth.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ -10, -1, 0, 1, 10 }"
yCoords="{ -10, -1, 0, 1, 10 }"
zCoords="{ -10, -1, 0, 1, 10 }"
nx="{ 4, 1, 1, 4 }"
ny="{ 5, 1, 1, 5 }"
nz="{ 6, 1, 1, 6 }"
xBias="{ 0.555, 0, 0, -0.555 }"
yBias="{ 0.444, 0, 0, -0.444 }"
zBias="{ 0.333, 0, 0, -0.333 }"
cellBlockNames="{ cb1 }"/>
</Mesh>
<Solvers>
<SolidMechanics_LagrangianFEM
name="lagsolve"
strainTheory="1"
cflFactor="0.25"
discretization="FE1"
targetRegions="{ Region2 }"
/>
</Solvers>
It’s possible to generate more complex CellBlock using the InternalMeshGenerator. For instance, the staircase
example is a model which is often used in GEOS as an integrated test. It defines CellBlocks in the three directions
to generate a staircase-like model with the following code.
<Mesh>
<InternalMesh name="mesh1"
elementTypes="{C3D8}"
xCoords="{0, 5, 10}"
yCoords="{0, 5, 10}"
zCoords="{0, 2.5, 5, 7.5, 10}"
nx="{5, 5}"
ny="{5, 5}"
nz="{3, 3, 3, 3}"
cellBlockNames="{cb-0_0_0, cb-1_0_0, cb-0_1_0, cb-1_1_0,
(continues on next page)
<ElementRegions>
<CellElementRegion name="Channel"
cellBlocks="{cb-1_0_0, cb-0_0_0, cb-0_0_1, cb-0_1_1, cb-0_1_2, cb-1_1_
˓→2, cb-1_1_3, cb-1_0_3}"
materialList="{}"/>
</ElementRegions>
Note that CellBlocks are ordered following the natural IJK logic, with indices increasing first in I (x-direction), then
in J (y-direction) and last in K (z-direction).
GEOS provides features to run simulations on unstructured meshes. It uses VTK to read the external meshes and its
API to write it into the GEOS mesh data structure.
The supported mesh elements for volume elements consist of the following:
• 4-node tetrahedra,
• 5-node pyramids,
• 6-node wedges,
• 8-node hexahedra,
• n-gonal prisms (n = 7, . . . , 11).
The mesh can be divided in several regions. These regions are intended to support different physics or to define different
constitutive properties. By default, we use the attribute field to define the regions.
Importing regions
Several blocks are involved to import an external mesh into GEOS, defined in the XML input file. These are the <Mesh>
block and the <CellElementRegions> block.
The mesh block has the following syntax:
<Mesh>
<VTKMesh
name="MyMeshName"
logLevel="1"
(continues on next page)
..note::
We advise users to use absolute path to the mesh file, and recommend the use of a logLevel of 1 or more to
obtain some information about the mesh import, including the list of regions that are imported with their names,
which is particularly useful to fill the field of the CellElementRegions block (see below). Some information
about the imported surfaces is also provided.
GEOS uses ElementRegions to support different physics or to define different constitutive properties. The
ElementRegions block can contain several CellElementRegion blocks. A CellElementRegion is defined as a
set of cell-blocks, which are sets of elements with the same element geometry, defined within the cellBlocks at-
tribute.
The naming of cell-blocks depends on if the mesh contains a data array which has the same value as the
regionAttribute of the VTKMesh (which is attribute by default). This attribute is used to define regions in the
vtu file and assign the cells to a given region.
For now, loaded regions has the following limitations: - The regionAttribute can only refer to integer values (no
texts), - Each element can belong to only one region.
• If the vtu file contains an attribute equals to the regionAttribute of the VTKMesh, then all cellBlock are
named with this convention: regionAttribute_elementType. Let’s assume that the top region of the exemple
above has myAttribute to 1, and that the bottom region has myAttribute to 2,
– If we want the CellElementRegion to contain all the cells, we write:
<!-- Method one: Use `*` to match all cellBlock names automatically.
"{ [1-2]_* }" would have an equivalent result (range selection). --
˓→>
<ElementRegions>
<CellElementRegion
name="MyRegion"
cellBlocks="{ * }"
materialList="{ water, rock }" />
</ElementRegions>
<!-- Method two: Use `1, 2` to target the mesh regions. -->
<ElementRegions>
<CellElementRegion
name="MyRegion"
cellBlocks="{ 1, 2 }"
materialList="{ water, rock }" />
</ElementRegions>
– If we want two CellElementRegion with the top and bottom regions separated, we write:
<!-- Method one: Use the `regionAttribute` to select region '1' in 'Top' region, and␣
˓→region '2' in 'Bot' region. -->
<ElementRegions>
<CellElementRegion
name="Top"
cellBlocks="{ 1 }"
materialList="{ water, rock }"/>
<CellElementRegion
name="Bot"
cellBlocks="{ 2 }"
materialList="{ water, rock }" />
</ElementRegions>
<!-- Method two: Use `cellBlocks` for the same purpose, but by matching the name␣
˓→patterns. -->
<ElementRegions>
<CellElementRegion
name="Top"
cellBlocks="{ 1_* }"
(continues on next page)
<!-- Method three: manually name the cell-blocks in the same regions. -->
<ElementRegions>
<CellElementRegion
name="Top"
cellBlocks="{ 1_hexahedra, 1_wedges, 1_tetrahedra, 1_pyramids }"
materialList="{ water, rock }"/>
<CellElementRegion
name="Bot"
cellBlocks="{ 2_hexahedra, 2_wedges, 2_tetrahedra, 2_pyramids }"
materialList="{ water, rock }" />
</ElementRegions>
• If the vtu file does not contain any region attribute field, then all the cells are grouped in a single region, and
cellBlock names consist of just the cell types (hexahedra, wedges, tetrahedra, etc). Then in the exemple above,
the ElementRegions can be defined as bellow:
<!-- Method one: Use `*` to match all cellBlock names automatically. -->
<ElementRegions>
<CellElementRegion
name="MyRegion"
cellBlocks="{ * }"
materialList="{ water, rock }" />
</ElementRegions>
<!-- Exemple three: Use only the tetrahedric cell-blocks on this region (see the warning␣
˓→below) -->
<ElementRegions>
<CellElementRegion
name="MyRegion"
cellBlocks="{ tetrahedra }"
materialList="{ water, rock }" />
</ElementRegions>
. Warning
All the imported cellBlocks must be included in one (and only one) of the CellElementRegion. Even if some
cells are meant to be inactive during the simulation, they still have to be included in a CellElementRegion (this
CellElementRegion should simply not be included as a targetRegion of any of the solvers involved in the simu-
lation).
Importing surfaces
Surfaces are imported through point sets in GEOS. This feature is only supported using the vtk file format. In the
same way than the regions, the surfaces of interests can be defined using the physical entity names. The surfaces are
automatically imported in GEOS if they exist in the vtk file. Within GEOS, the point set will have the same name than
the one given in the file. This name can be used again to impose boundary condition.
For instance, if a surface is named “Bottom” and the user wants to impose a Dirichlet boundary condition of 0 on it, it
can be easily done using this syntax:
<FieldSpecifications>
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="Velocity"
component="2"
scale="0.0"
setNames="{ Bottom }"/>
</FieldSpecifications>
The name of the surface of interest appears under the keyword setNames. Again, an example of a vtk file with the
surfaces fully defined is available within Tutorial 3: Regions and Property Specifications or CO2 Plume Evolution With
Hysteresis Effect on Relative Permeability.
Solution Strategy
All physics solvers share a common solution strategy for nonlinear time-dependent problems. Here, we briefly describe
the nonlinear solver and the timestepping strategy employed.
Nonlinear Solver
Line Search
A line search method can be applied along with the Newton’s method to facilitate Nonlinear convergence. After the
Newton update, if the residual norm has increased instead of decreased, a line search algorithm is employed to correct
the Newton update.
The user can choose between two different behaviors in case the line search fails to provide a reduced residual norm:
1. accept the solution and move to the next Newton iteration;
2. reject the solution and request a timestep cut;
Timestepping Strategy
The actual timestep size employed is determined by a combination of several factors. In particular, specific output
events may have timestep requirements that force a specific timestep to be used. However, physics solvers do have the
possibility of requesting a specific timestep size to the event manager based on their specific requirements. In particular,
in case of fast convergence indicated by a small number of Newton iterations, i.e.
numIterations < dtIncIterLimit · newtonMaxIter,
the physics solver will require to double the timestep size. On the other hand, if a large number of nonlinear iterations
are necessary to find the solution at timestep 𝑛
numIterations > dtCutIterLimit · newtonMaxIter,
the physics solver will request the next timestep, 𝑛 + 1, to be half the size of timestep 𝑛. Here,
Additionally, in case the nonlinear solver fails to converge with the timestep provided by the event manager, the timestep
size is cut, i.e.
dt = timestepCutFactor · dt,
and the nonlinear loop is repeated with the new timestep size.
Parameters
All parameters defining the behavior of the nonlinear solver and determining the timestep size requested by the physics
solver are defined in the NonlinearSolverParameters and are presented in the following table.
lineSearchAction geos_NonlinearSolverParameters_LineSearchAction
Attempt
How the line search is to
be used. Options are:
* None - Do not use
line search.
* Attempt - Use line
search. Allow exit from
line search without
achieving smaller residual
than starting residual.
* Require - Use line
search. If smaller residual
than starting resdual is not
achieved, cut time-step.
Introduction
The SolidMechanics_LagrangianFEM solver applies a Continuous Galerkin finite element method to solve the linear
momentum balance equation. The primary variable is the displacement field which is discretized at the nodes.
Theory
Governing Equations
𝑇𝑖𝑗,𝑗 + 𝜌(𝑏𝑖 − 𝑥
¨𝑖 ) = 0,
which is a 3-dimensional expression for the well known expression of Newtons Second Law (𝐹 = 𝑚𝑎). These equations
of motion are discretized using the Finite Element Method, which leads to a discrete set of residual equations:
∫︁ ∫︁ ∫︁
(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 = Φ𝑎 𝑡𝑖 𝑑𝐴 − Φ𝑎,𝑗 𝑇𝑖𝑗 𝑑𝑉 + Φ𝑎 𝜌(𝑏𝑖 − Φ𝑏 𝑥 ¨𝑖𝑏 )𝑑𝑉 = 0
Γ𝑡 Ω Ω
The Quasi-Static time integration option solves the equation of motion after removing the inertial term, which is ex-
pressed by
𝑇𝑖𝑗,𝑗 + 𝜌𝑏𝑖 = 0,
which is essentially a way to express the equation for static equilibrium (Σ𝐹 = 0). Thus, selection of the Quasi-Static
option will yield a solution where the sum of all forces at a given node is equal to zero. The resulting finite element
discretized set of residual equations are expressed as
∫︁ ∫︁ ∫︁
(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 = Φ𝑎 𝑡𝑖 𝑑𝐴 − Φ𝑎,𝑗 𝑇𝑖𝑗 𝑑𝑉 + Φ𝑎 𝜌𝑏𝑖 𝑑𝑉 = 0,
Γ𝑡 Ω Ω
Taking the derivative of these residual equations wrt. the primary variable (displacement) yields
𝑒 ∫︁
𝜕(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 𝜕𝑇𝑖𝑘
= − Φ𝑎,𝑘 𝑑𝑉,
𝜕𝑢𝑏𝑗 𝜕𝑢𝑏𝑗
Ω𝑒
And finally, the expression for the residual equation and derivative are used to express a non-linear system of equations
(︂ 𝑒
)︂⃒𝑛+1 (︁
𝜕(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 ⃒⃒ 𝑛+1 𝑛+1
)︁
𝑛+1
(𝑢 )|
𝑏𝑗 𝑘𝑖𝑡𝑒𝑟+1 − (𝑢𝑏𝑗 𝑘𝑖𝑡𝑒𝑟 = −(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 |𝑘𝑖𝑡𝑒𝑟 ,
)|
𝜕𝑢𝑏𝑗 ⃒
𝑘𝑖𝑡𝑒𝑟
For implicit dynamic time integration, we use an implementation of the classical Newmark method. This update
method can be posed in terms of a simple SDOF spring/dashpot/mass model. In the following, 𝑀 represents the mass,
𝐶 represent the damping of the dashpot, 𝐾 represents the spring stiffness, and 𝐹 represents some external load.
and a series of update equations for the velocity and displacement at a point:
As intermediate quantities we can form an estimate (predictor) for the end of step displacement and midstep velocity
by assuming zero end-of-step acceleration.
(︂ )︂
𝑛+1 1 ˆ˜
𝑢
˜ = 𝑢 + 𝑣 + (1 − 2𝛽)𝑎 ∆𝑡 ∆𝑡 = 𝑢𝑛 + 𝑢
𝑛 𝑛 𝑛
2
𝑣˜𝑛+1 = 𝑣 𝑛 + (1 − 𝛾)𝑎𝑛 ∆𝑡 = 𝑣 𝑛 + 𝑣˜ˆ
This gives the end of step displacement and velocity in terms of the predictor with a correction for the end step accel-
eration.
𝑢𝑛+1 = 𝑢
˜𝑛+1 + 𝛽𝑎𝑛+1 ∆𝑡2
𝑣 𝑛+1 = 𝑣˜𝑛+1 + 𝛾𝑎𝑛+1 ∆𝑡
The acceleration and velocity may now be expressed in terms of displacement, and ultimately in terms of the incremental
displacement.
1 (︀ 𝑛+1 1 (︁ ˆ˜
)︁
𝑎𝑛+1 = 𝑛+1
)︀
𝑢 − 𝑢
˜ = 𝑢
ˆ − 𝑢
𝛽∆𝑡2 𝛽∆𝑡2
𝛾 𝛾 (︁ ˆ˜
)︁
𝑣 𝑛+1 = 𝑣˜𝑛+1 + 𝑢𝑛+1 − 𝑢 ˜𝑛+1 = 𝑣˜𝑛+1 +
(︀ )︀
𝑢ˆ−𝑢
𝛽∆𝑡 𝛽∆𝑡
plugging these into equation of motion for the SDOF system gives:
(︂ )︁)︂ (︂ )︁)︂
1 (︁ ˆ 𝑛+1 𝛾 (︁ ˆ˜
𝑀 𝑢
ˆ − 𝑢
˜ + 𝐶 𝑣
˜ + 𝑢
ˆ − 𝑢 + 𝐾𝑢𝑛+1 = 𝐹𝑛+1
𝛽∆𝑡2 𝛽∆𝑡
𝐶 = 𝑎𝑚𝑎𝑠𝑠 𝑀 + 𝑎𝑠𝑡𝑖𝑓 𝑓 𝐾
Of course we know that we intend to model a system of equations with many DOF. Thus the representation for the
mass, spring and dashpot can be replaced by our finite element discretized equation of motion. We may express the
system in context of a nonlinear residual problem
∫︁
𝑒
(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 = Φ𝑎 𝑡𝑖 𝑑𝐴
Γ𝑒𝑡
(︃ (︃ )︃ )︃
𝜕𝑇𝑖𝑗𝑛+1
∫︁ (︂ )︁)︂
𝛾 (︁ ˆ
− Φ𝑎,𝑗 𝑇𝑖𝑗𝑛+1
+ 𝑎𝑠𝑡𝑖𝑓 𝑓 𝑛+1
𝑣˜𝑏𝑘 + ˆ𝑏𝑘 − 𝑢
𝑢 ˜𝑏𝑘 𝑑𝑉
𝜕𝑢 ˆ𝑏𝑘 𝛽∆𝑡
Ω𝑒 𝑒𝑙𝑎𝑠𝑡𝑖𝑐
∫︁ (︂ (︂ (︂ )︁)︂ )︁)︂)︂
𝑛+1 𝛾 (︁ ˆ 1 (︁ ˆ
+ Φ𝑎 𝜌 𝑏𝑖 − Φ𝑏 𝑎𝑚𝑎𝑠𝑠 𝑣˜𝑏𝑖 + ˆ𝑏𝑖 − 𝑢
𝑢 ˜𝑏𝑖 + ˆ𝑏𝑖 − 𝑢
𝑢 ˜𝑏𝑖 𝑑𝑉,
𝛽∆𝑡 𝛽∆𝑡2
Ω𝑒
𝑒 ∫︁ (︂ 𝑛+1 (︂ 𝑛+1 )︂ )︂
𝜕(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 𝜕𝑇𝑖𝑘 𝛾 𝜕𝑇𝑖𝑘
= − Φ𝑎,𝑘 + 𝑎𝑠𝑡𝑖𝑓 𝑓 𝑑𝑉
𝜕𝑢ˆ𝑏𝑗 𝜕𝑢
ˆ𝑏𝑗 𝛽∆𝑡 𝜕𝑢
ˆ𝑏𝑗 𝑒𝑙𝑎𝑠𝑡𝑖𝑐
Ω𝑒
(︂ )︂ ∫︁
𝛾𝑎𝑚𝑎𝑠𝑠 1 𝜕𝑢ˆ𝑐𝑖
− + 2
𝜌Φ𝑎 Φ𝑐 𝑑𝑉.
𝛽∆𝑡 𝛽∆𝑡 𝜕𝑢ˆ𝑏𝑗
Ω𝑒
Again, the expression for the residual equation and derivative are used to express a non-linear system of equations
(︂ 𝑒
)︂⃒𝑛+1 (︁
𝜕(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 ⃒⃒ 𝑛+1 𝑛+1
)︁
𝑛+1
(𝑢𝑏𝑗 )|𝑘𝑖𝑡𝑒𝑟+1 − (𝑢𝑏𝑗 )|𝑘𝑖𝑡𝑒𝑟 = −(𝑅𝑠𝑜𝑙𝑖𝑑 )𝑎𝑖 |𝑘𝑖𝑡𝑒𝑟 ,
𝜕𝑢𝑏𝑗 ⃒
𝑘𝑖𝑡𝑒𝑟
which are solved via the solver package. Note that the derivatives involving 𝑢 and 𝑢
ˆ are interchangable, as are differences
between the non-linear iterations.
Explicit Dynamics Time Integration (Special Implementation of Newmark Method with gamma=0.5,
beta=0)
For the Newmark Method, if gamma=0.5, beta=0, and the inertial term contains a diagonalized “mass matrix”, the
update equations may be carried out without the solution of a system of equations. In this case, the update equations
simplify to a non-iterative update algorithm.
First the mid-step velocity and end-of-step displacements are calculated through the update equations
(︂ )︂
∆𝑡
𝑣 𝑛+1/2 = 𝑣 𝑛 + 𝑎𝑛 , and
2
𝑢𝑛+1 = 𝑢𝑛 + 𝑣 𝑛+1/2 ∆𝑡.
Then the residual equation/s are calculated, and acceleration at the end-of-step is calculated via
(︂ )︂
∆𝑡
𝑀+ 𝐶 𝑎𝑛+1 = 𝐹𝑛+1 − 𝐶𝑣 𝑛+1/2 − 𝐾𝑢𝑛+1 .
2
Note that the mass matrix must be diagonal, and damping term may not include the stiffness based damping coeffi-
cient for this method, otherwise the above equation will require a system solve. Finally, the end-of-step velocities are
calculated from the end of step acceleration:
(︂ )︂
𝑛+1 𝑛+1/2 𝑛+1 ∆𝑡
𝑣 =𝑣 +𝑎 .
2
Note that the velocities may be stored at the midstep, resulting one less kinematic update. This approach is typically
referred to as the “Leapfrog” method. However, in GEOS we do not offer this option since it can cause some confusion
that results from the storage of state at different points in time.
Parameters
In the preceding XML block, The SolidMechanics_LagrangianFEM is specified by the title of the subblock of the
Solvers block. The following attributes are supported in the input block for SolidMechanics_LagrangianFEM:
Datastructure: SolidMechanics_LagrangianFEM
Example
<Solvers>
<SolidMechanics_LagrangianFEM
name="lagsolve"
strainTheory="1"
cflFactor="0.25"
discretization="FE1"
targetRegions="{ Region2 }"
/>
</Solvers>
GEOS contact solvers solve the the balance of linear momentum within a fractured solid, accounting for the continuity
of stress across surfaces (i.e., fractures), i.e.
∇·𝜎 =0
[[𝜎]] · n = 0
Where:
• 𝜎 is the stress tensor in the solid,
• n is the outward unit normal to the surface,
• [[𝜎]] is the stress jump across the surface.
On each fracture surface, a no-interpenetration constraint is enforced. Additionally, tangential tractions can also be
generated, which are modeled using a regularized Coulomb model to describe frictional sliding.
Solvers
There exist two broad classes of discretization methods that model fractures as lower dimensional entities (eg, 2D
surfaces in a 3D domain): conforming grid methods and nonconforming (or embedded) methods. Both approaches
have been implemented in GEOS in the following solvers:
Introduction
Theory
Under construction
Governing Equations
Under construction
Parameters
In the preceding XML block, The SolidMechanicsLagrangeContact is specified by the title of the subblock of the
Solvers block. The following attributes are supported in the input block for SolidMechanicsLagrangeContact:
Datastructure: SolidMechanicsLagrangeContact
Introduction
The linear momentum balance equation is discretized using a low order finite element method. Moreover, to account
for the influence of the fractures on the overall behavior, we utilize the enriched finite element method (EFEM) with a
piece-wise constant enrichment. This method employs an element-local enrichment of the FE space using the concept
of assumedenhanced strain [1-6].
Example
<SolidMechanicsEmbeddedFractures
name="mechSolve"
targetRegions="{ Domain, Fracture }"
initialDt="10"
timeIntegrationOption="QuasiStatic"
discretization="FE1"
logLevel="1"
contactPenaltyStiffness="0.0e8">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="2"
maxTimeStepCuts="1"/>
<LinearSolverParameters
solverType="direct"
directParallel="0"
logLevel="0"/>
</SolidMechanicsEmbeddedFractures>
<EmbeddedSurfaceGenerator
name="SurfaceGenerator"
discretization="FE1"
targetRegions="{ Domain, Fracture }"
fractureRegion="Fracture"
targetObjects="{ FracturePlane }"
logLevel="1"
mpiCommOrder="1"/>
</Solvers>
Parameters
In the preceding XML block, The SolidMechanicsEmbeddedFractures is specified by the title of the subblock of the
Solvers block. Note that the SolidMechanicsEmbeddedFractures always relies on the existance of a The following
attributes are supported in the input block for SolidMechanicsEmbeddedFractures:
Datastructure: SolidMechanicsEmbeddedFractures
References
1. Simo JC, Rifai MS. A class of mixed assumed strain methods and the method of incompatible modes. Int J
Numer Methods Eng. 1990;29(8):1595-1638. Available at: http://arxiv.org/abs/https://onlinelibrary.wiley.com/
doi/pdf/10.1002/nme.1620290802.
2. Foster CD, Borja RI, Regueiro RA. Embedded strong discontinuity finite elements for fractured geomaterials
with variable friction. Int J Numer Methods Eng. 2007;72(5):549-581. Available at: http://arxiv.org/abs/https:
//onlinelibrary.wiley.com/doi/pdf/10.1002/nme.2020.
3. Wells G, Sluys L. Three-dimensional embedded discontinuity model for brittle fracture. Int J Solids Struct.
2001;38(5):897-913. Available at: https://doi.org/10.1016/S0020-7683(00)00029-9.
4. Oliver J, Huespe AE, Sánchez PJ. A comparative study on finite elements for capturing strong discontinuities:
E-fem vs x-fem. Comput Methods Appl Mech Eng. 2006;195(37-40):4732-4752. Available at: https://doi.org/
10.1002/nme.4814.
5. Borja RI. Assumed enhanced strain and the extended finite element methods: a unification of concepts. Comput
Methods Appl Mech Eng. 2008;197(33):2789-2803. Available at: https://doi.org/10.1016/j.cma.2008.01.019.
6. Wu J-Y. Unified analysis of enriched finite elements for modeling cohesive cracks. Comput Methods Appl Mech
Eng. 2011;200(45-46):3031-3050. Available at: https://doi.org/10.1016/j.cma.2011.05.008.
Here, we describe the single-phase flow solver. The role of this solver is to implement the fully implicit finite-volume
discretization (mainly, accumulation and source terms, boundary conditions) of the equations governing compressible
single-phase flow in porous media. This solver can be combined with the SinglePhaseWell class which handles the
discrete multi-segment well model and provides source/sink terms for the fluid flow solver.
Theory
Governing Equations
This is a cell-centered Finite Volume solver for compressible single-phase flow in porous media. Fluid pressure as the
primary solution variable. Darcy’s law is used to calculate fluid velocity from pressure gradient. The solver currently
only supports Dirichlet-type boundary conditions (BC) applied on cells or faces and Neumann no-flow type BC.
The following mass balance equation is solved in the domain:
𝜕
(𝜑𝜌) + ∇ · (𝜌𝑢) + 𝑞 = 0,
𝜕𝑡
where
1
𝑢 = − 𝑘(∇𝑝 − 𝜌𝑔)
𝜇
and 𝜑 is porosity, 𝜌 is fluid density, 𝜇 is fluid viscosity, 𝑘 is the permeability tensor, 𝑔 is the gravity vector, and 𝑞 is the
source function (currently not supported). The details on the computation of the density and the viscosity are given in
Compressible single phase fluid model.
When the entire pore space is filled by a single phase, we can substitute the Darcy’s law into the mass balance equation
to obtain the single phase flow equation
𝜕 𝜌𝑘
(𝜑𝜌) − ∇ · (∇𝑝 − 𝛾∇𝑧) + 𝑞 = 0,
𝜕𝑡 𝜇
with 𝛾∇𝑧 = 𝜌𝑔.
Discretization
Space Discretization
Let Ω ⊂ R𝑛 , 𝑛 = 1, 2, 3 be an open set defining the computational domain. We consider Ω meshed by element such
that Ω = ∪𝑖 𝑉𝑖 and integrate the single phase flow equation, described above, over each element 𝑉𝑖 :
∫︁ ∫︁ ∫︁
𝜕 𝜌𝑘
(𝜑𝜌)𝑑𝑉 − ∇· (∇𝑝 − 𝛾∇𝑧)𝑑𝑉 + 𝑞𝑑𝑉 = 0.
𝑉𝑖 𝜕𝑡 𝑉𝑖 𝜇 𝑉𝑖
where 𝑆𝑖 represents the surface area of the element 𝑉𝑖 and 𝑛 is a outward unit vector normal to the surface.
For the flux term, the (static) transmissibility is currently computed with a Two-Point Flux Approximation (TPFA) as
described in Finite Volume Discretization.
The pressure-dependent mobility 𝜆 = 𝜌
𝜇 at the interface is approximated using a first-order upwinding on the sign of
the potential difference.
Time Discretization
Let 𝑡0 < 𝑡1 < · · · < 𝑡𝑁 = 𝑇 be a grid discretization of the time interval [𝑡0 , 𝑇 ], 𝑡0 , 𝑇 ∈ R+ . We use the backward
Euler (fully implicit) method to integrate the single phase flow equation between two grid points 𝑡𝑛 and 𝑡𝑛+1 , 𝑛 < 𝑁
to obtain the residual equation:
)︂𝑛+1
(𝜑𝜌)𝑛+1 − (𝜑𝜌)𝑛𝑖
∫︁ ∮︁ (︂ ∫︁
𝜌𝑘
𝑖
− (∇𝑝 − 𝛾∇𝑧) · 𝑛𝑑𝑆 + 𝑞 𝑛+1 𝑑𝑉 = 0
𝑉𝑖 ∆𝑡 𝑆𝑖 𝜇 𝑉𝑖
where ∆𝑡 = 𝑡𝑛+1 − 𝑡𝑛 is the time-step. The expression of this residual equation and its derivative are used to form a
linear system, which is solved via the solver package.
Parameters
The solver is enabled by adding a <SinglePhaseFVM> node in the Solvers section. Like any solver, time stepping is
driven by events, see Event Management.
The following attributes are supported:
logLevel integer 0
414 Sets1.theTable
Chapter level of
of Contents
information to write in the
standard output (the
console typically).
GEOS Documentation
In particular:
• discretization must point to a Finite Volume flux approximation scheme defined in the Numerical Methods
section of the input file (see Finite Volume Discretization)
• fluidName must point to a single phase fluid model defined in the Constitutive section of the input file (see
Constitutive Models)
• solidName must point to a solid mechanics model defined in the Constitutive section of the input file (see
Constitutive Models)
• targetRegions is used to specify the regions on which the solver is applied
Primary solution field label is pressure. Initial conditions must be prescribed on this field in every region, and
boundary conditions must be prescribed on this field on cell or face sets of interest.
Example
<Solvers>
<SinglePhaseFVM
name="SinglePhaseFlow"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ mainRegion }">
<NonlinearSolverParameters
newtonTol="1.0e-6"
newtonMaxIter="8"/>
<LinearSolverParameters
solverType="gmres"
preconditionerType="amg"
krylovTol="1.0e-10"/>
</SinglePhaseFVM>
</Solvers>
We refer the reader to this page for a complete tutorial illustrating the use of this solver.
This flow solver is in charge of implementing the finite-volume discretization (mainly, accumulation and flux terms,
boundary conditions) of the equations governing compositional multiphase flow in porous media. The present solver
can be combined with the Compositional Multiphase Well Solver which handles the discrete multi-segment well model
and provides source/sink terms for the fluid flow solver.
Below, we first review the set of Governing Equations, followed by a discussion of the choice of Primary Variables
used in the global variable formulation. Then we give an overview of the Discretization and, finally, we provide a list
of the solver Parameters and an input Example.
Theory
Governing Equations
where 𝜑 is the porosity of the medium, 𝑆ℓ is the saturation of phase ℓ, 𝑦𝑐ℓ is the mass fraction of component 𝑐 in phase
ℓ, 𝜌ℓ is the phase density, and 𝑡 is time. We note that the formulation currently implemented in GEOS is isothermal.
Darcy’s Law
Using the multiphase extension of Darcy’s law, the phase velocity 𝑢ℓ is written as a function of the phase potential
gradient ∇Φℓ :
(︀ )︀
𝑢ℓ := −𝑘𝜆ℓ ∇Φℓ = −𝑘𝜆ℓ ∇(𝑝 − 𝑃𝑐,ℓ ) − 𝜌ℓ 𝑔∇𝑧 .
In this equation, 𝑘 is the rock permeability, 𝜆ℓ = 𝑘𝑟ℓ /𝜇ℓ is the phase mobility, defined as the phase relative permeability
divided by the phase viscosity, 𝑝 is the reference pressure, 𝑃𝑐,ℓ is the the capillary pressure, 𝑔 is the gravitational ac-
celeration, and 𝑧 is depth. The evaluation of the relative permeabilities, capillary pressures, and viscosities is reviewed
in the section about Constitutive Models.
Combining the mass conservation equations with Darcy’s law yields a set of 𝑛𝑐 equations written as:
(︂ )︂ (︂ ∑︁ )︂ ∑︁
𝜕 ∑︁
𝜑 𝜌ℓ 𝑦𝑐ℓ 𝑆ℓ − ∇ · 𝑘 𝜌ℓ 𝑦𝑐ℓ 𝜆ℓ ∇Φℓ − 𝜌ℓ 𝑦𝑐ℓ 𝑞ℓ = 0.
𝜕𝑡
ℓ ℓ ℓ
The volume constraint equation states that the pore space is always completely filled by the phases. The constraint can
be expressed as:
∑︁
𝑆ℓ = 1.
ℓ
𝑓𝑐ℓ − 𝑓𝑐𝑚 = 0.
where 𝑓𝑐ℓ is the fugacity of component 𝑐 in phase ℓ. The flash calculations performed to enforce the thermodynamical
equilibrium are reviewed in the section about Constitutive Models.
To summarize, the compositional multiphase flow solver assembles a set of 𝑛𝑐 + 1 equations in each element, i.e.,
𝑛𝑐 mass conservation equations and one volume constraint equation. A separate module discussed in the Constitutive
Models is responsible for the enforcement of the thermodynamic equilibrium at each nonlinear iteration.
Primary Variables
The variable formulation implemented in GEOS is a global variable formulation based on 𝑛𝑐 + 1 primary variables,
namely, one pressure, 𝑝, and 𝑛𝑐 component densities, 𝜌𝑐 . By default, we use molar component densities. A flag dis-
cussed in the section Parameters can be used to select mass component densities instead of molar component densities.
Assembling the residual equations and calling the Constitutive Models requires computing the molar component frac-
tions and saturations. This is done with the relationship:
𝜌𝑐
𝑧𝑐 := ,
𝜌𝑇
where
∑︁
𝜌𝑇 := 𝜌𝑐 .
𝑐
These secondary variables are used as input to the flash calculations. After the flash calculations, the saturations are
computed as:
𝜌𝑇
𝑆ℓ := 𝜈ℓ ,
𝜌ℓ
where 𝜈ℓ is the global mole fraction of phase ℓ and 𝜌ℓ is the molar density of phase ℓ. These steps also involve computing
the derivatives of the component fractions and saturations with respect to the pressure and component densities.
Discretization
Spatial Discretization
The governing equations are discretized using standard cell-centered finite-volume discretization.
In the approximation of the flux term at the interface between two control volumes, the calculation of the pressure
stencil is general and will ultimately support a Multi-Point Flux Approximation (MPFA) approach. The current imple-
mentation of the transmissibility calculation is reviewed in the section about Numerical Methods.
The approximation of the dynamic transport coefficients multiplying the discrete potential difference (e.g., the phase
mobilities) is performed with a first-order phase-per-phase single-point upwinding based on the sign of the phase
potential difference at the interface.
Temporal Discretization
The compositional multiphase solver uses a fully implicit (backward Euler) temporal discretization.
Solution Strategy
The nonlinear solution strategy is based on Newton’s method. At each Newton iteration, the solver assembles a residual
vector, 𝑅, collecting the 𝑛𝑐 discrete mass conservation equations and the volume constraint for all the control volumes.
Parameters
Example
<Solvers>
<CompositionalMultiphaseFVM
name="compflow"
logLevel="1"
discretization="fluidTPFA"
targetRelativePressureChangeInTimeStep="1"
targetPhaseVolFractionChangeInTimeStep="1"
targetRegions="{ Channel }"
temperature="300">
<NonlinearSolverParameters
newtonTol="1.0e-10"
newtonMaxIter="10"/>
<LinearSolverParameters
directParallel="0"/>
</CompositionalMultiphaseFVM>
</Solvers>
We refer the reader to Multiphase Flow for a complete tutorial illustrating the use of this solver.
Here, we present a description of the well solvers. These solvers are designed to be coupled with the flow solvers. Their
specific task is to implement the multi-segment well discretization using the fluid model used in the corresponding flow
solver – i.e., either single-phase flow or compositional multiphase flow. In particular, the perforation terms computed
by the well solvers are a source/sink term for the discrete reservoir equations assembled by the flow solvers.
In the present description, we focus on the compositional multiphase well solver. The structure of the single-phase well
solver is analogous and will not be described here for brevity.
Theory
Here, we give an overview of the well formulation implemented in GEOS. We review the set of Discrete Equations,
and then we describe the Primary variables used the well solvers.
Discrete Equations
We assume that the well is discretized into segments denoted by the index 𝑖.
Mass Conservation
where ∆Φ = 𝑝𝑖 − 𝑝𝑟𝑒𝑠 + 𝜌𝑚,𝑖 𝑔∆𝑑𝑖,𝑝𝑒𝑟𝑓 is the potential difference between the segment center∑︀ and the reservoir center.
In the expression of the potential difference, the mixture density is computed as 𝜌𝑚,𝑖 = ℓ 𝑆ℓ,𝑖 𝜌ℓ,𝑖 . The well index,
𝑊 𝐼, is currently an input of the simulator. The superscript 𝑟𝑒𝑠 means that the variable is evaluated at the center of the
reservoir element.
As in the Compositional Multiphase Flow Solver, the system is closed with a volume constraint equation.
Pressure Relations
where 𝜌𝑚,(𝑖,𝑖+1) is the arithmetic average of the mixture densities evaluated in segments 𝑖 and 𝑖 + 1. Pressure drop
components due to friction and acceleration are not implemented at the moment.
The well solver supports two types of control, namely, pressure control and rate control.
If pressure control is chosen, we add the following constraint for the pressure of the top segment of the well:
𝑝0 − 𝑝𝑡𝑎𝑟𝑔𝑒𝑡 = 0
In this case, we check that at each iteration of the Newton solver, the rate at the top of the first segment is smaller than
the maximum rate specified by the user. If this is not the case, we switch to rate control.
If rate control is used, we add the following constraint for the rate at the top of the first segment, denoted by 𝑞(−1,0) :
𝑞(−1,0) − 𝑞 𝑡𝑎𝑟𝑔𝑒𝑡 = 0
For an injector well, if the pressure at the top segment becomes larger than the target pressure specified by the user,
then we switch to pressure control. Similarly for a producer well, if the pressure at the top segment becomes smaller
than the target pressure specified by the user, then we switch to pressure control.
To summarize, the compositional multiphase flow solver assembles a set of 𝑛𝑐 + 2 equations, i.e., 𝑛𝑐 mass conservation
equations and 1 volume constraint equation in each segment, plus 1 pressure relation at the interface between a segment
and the next segment in the direction of the well head. For the top segment, the pressure relation is replaced with the
control equation.
Primary variables
The well variable formulation is the same as that of the Compositional Multiphase Flow Solver. In a well segment, in
addition to the 𝑛𝑐 + 1 primary variables of the Compositional Multiphase Flow Solver, namely, one pressure, 𝑝, and
𝑛𝑐 component densities, 𝜌𝑐 , we also treat the total mass flux at the interface with the next segment, denoted by 𝑞, as a
primary variable.
Parameters
Example
<CompositionalMultiphaseWell
name="compositionalMultiphaseWell"
logLevel="1"
targetRegions="{ wellRegion1, wellRegion2, wellRegion3 }">
<WellControls
name="wellControls1"
type="producer"
control="BHP"
referenceElevation="0.5"
targetBHP="4e6"
targetPhaseRate="1e-3"
targetPhaseName="oil"/>
<WellControls
name="wellControls2"
type="producer"
control="phaseVolRate"
referenceElevation="0.5"
targetBHP="2e6"
targetPhaseRate="2.5e-7"
targetPhaseName="oil"/>
<WellControls
name="wellControls3"
type="injector"
control="totalVolRate"
referenceElevation="0.5"
targetBHP="4e7"
targetTotalRate="5e-7"
injectionTemperature="297.15"
injectionStream="{ 0.1, 0.1, 0.1, 0.7 }"/>
</CompositionalMultiphaseWell>
Poromechanics Solver
Introduction
This section describes the use of the poroelasticity models implemented in GEOS.
Theory
Governing Equations
In our model, the geomechanics (elasticity) equation is expressed in terms of the total stress 𝜎:
∇𝜎 + 𝜌𝑏 g = 0
where it relates to effective stress 𝜎′ and pore pressure 𝑝 through Biot’s coefficient 𝑏:
𝜎 = 𝜎′ − 𝑏𝑝I
The fluid mass conservation equation is expressed in terms of pore pressure and volumetric (mean) total stress:
𝑏2
(︂ )︂
1 𝜕𝑝 𝑏 𝜕𝜎𝑣
+ + + ∇ · v𝑓 = 𝑓
𝑀 𝐾𝑑𝑟 𝜕𝑡 𝐾𝑑𝑟 𝜕𝑡
where 𝑀 is the Biot’s modulus and 𝐾𝑑𝑟 is the drained bulk modulus.
Unlike the conventional reservoir model that uses Lagranges porosity, in the coupled geomechanics and flow model,
Eulers porosity 𝜑 is adopted so the porosity variation is derived as:
(︂ )︂
𝑏−𝜑
𝜕𝜑 = 𝜕𝑝 + (𝑏 − 𝜑) 𝜕𝜖𝑣
𝐾𝑠
where 𝐾𝑠 is the bulk modulus of the solid grain and 𝜖𝑣 is the volumetric strain.
Parameters
The poroelasticity model is implemented as a main solver listed in <Solvers> block of the input XML file that calls
both SolidMechanicsLagrangianSSLE and SinglePhaseFlow solvers. In the main solver, it requires the specification of
solidSolverName, flowSolverName, and couplingTypeOption.
The following attributes are supported:
<ElasticIsotropic
name="skeleton"
defaultDensity="0"
defaultYoungModulus="1.0e4"
defaultPoissonRatio="0.2"/>
<CompressibleSinglePhaseFluid
name="fluid"
defaultDensity="1"
defaultViscosity="1.0"
referencePressure="0.0"
referenceDensity="1"
compressibility="0.0e0"
referenceViscosity="1"
viscosibility="0.0"/>
<BiotPorosity
name="skeletonPorosity"
defaultGrainBulkModulus="1.0e27"
defaultReferencePorosity="0.3"/>
<ConstantPermeability
name="skeletonPerm"
permeabilityComponents="{ 1.0e-4, 1.0e-4, 1.0e-4 }"/>
</Constitutive>
Example
<SinglePhasePoromechanics
name="PoroelasticitySolver"
solidSolverName="LinearElasticitySolver"
flowSolverName="SinglePhaseFlowSolver"
logLevel="1"
targetRegions="{ Domain }">
<LinearSolverParameters
solverType="gmres"
preconditionerType="mgr"/>
</SinglePhasePoromechanics>
<SinglePhaseFVM
name="SinglePhaseFlowSolver"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Domain }"/>
</Solvers>
The ProppantTransport solver applies the finite volume method to solve the equations of proppant transport in hydraulic
fractures. The behavior of proppant transport is described by a continuum formulation. Here we briefly outline the
usage, governing equations and numerical implementation of the proppant transport model in GEOS.
Theory
The following mass balance and constitutive equations are solved inside fractures,
𝜕
(𝜌𝑚 ) + ∇ · (𝜌𝑚 𝑢𝑚 ) = 0,
𝜕𝑡
where the proppant-fluid mixture velocity 𝑢𝑚 is approximated by the Darcy’s law as,
𝐾𝑓
𝑢𝑚 = − (∇𝑝 − 𝜌𝑚 𝑔),
𝜇𝑚
and 𝑝 is pressure, 𝜌𝑚 and 𝜇𝑚 are density and viscosity of the mixed fluid , respectively, and 𝑔 is the gravity vector.
The fracture permeability 𝐾𝑓 is determined based on fracture aperture 𝑎 as
𝑎2
𝐾𝑓 =
12
Proppant Transport
𝜕
(𝑐) + ∇ · (𝑐𝑢𝑝 ) = 0,
𝜕𝑡
in which 𝑐 and 𝑢𝑝 represent the volume fraction and velocity of the proppant particles.
𝜕
[𝜌𝑖 𝜔𝑖 (1 − 𝑐)] + ∇ · [𝜌𝑖 𝜔𝑖 (1 − 𝑐)𝑢𝑓 ] = 0.
𝜕𝑡
Here 𝑢𝑓 represents the carrying fluid velocity. 𝜌𝑖 and 𝜔𝑖 denote the density and concentration of i-th component in
fluid, respectively. The fluid density 𝜌𝑓 can now be readily written as
𝑁𝑐
∑︁
𝜌𝑓 = 𝜌𝑖 𝜔𝑖 ,
𝑖=1
where 𝑁𝑐 is the number of components in fluid. Similarly, the fluid viscosity 𝜇𝑓 can be calculated by the mass fraction
weighted average of the component viscosities.
The density and velocity of the slurry fluid are further expressed as,
𝜌𝑚 = (1 − 𝑐)𝜌𝑓 + 𝑐𝜌𝑝 ,
and
𝜌𝑚 𝑢𝑚 = (1 − 𝑐)𝜌𝑓 𝑢𝑓 + 𝑐𝜌𝑝 𝑢𝑝 ,
in which 𝜌𝑓 and 𝑢𝑓 are the density and velocity of the carrying fluid, and 𝜌𝑝 is the density of the proppant particles.
The proppant particle and carrying fluid velocities are related by the slip velocity 𝑢𝑠𝑙𝑖𝑝 ,
𝑢𝑠𝑙𝑖𝑝 = 𝑢𝑝 − 𝑢𝑓 .
The slip velocity between the proppant and carrying fluid includes gravitational and collisional components, which
take account of particle settling and collision effects, respectively.
The gravitational component of the slip velocity 𝑢𝑠𝑙𝑖𝑝𝐺 is written as a form as
𝑢𝑠𝑙𝑖𝑝𝐺 = 𝐹 (𝑐)𝑢𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 ,
where 𝑢𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 is the settling velocity for a single particle, 𝑑𝑝 is the particle diameter, and 𝐹 (𝑐) is the correction factor
to the particle settling velocity in order to account for hindered settling effects as a result of particle-particle interactions,
𝐹 (𝑐) = 𝑒−𝜆𝑠 𝑐 ,
with the hindered settling coefficient 𝜆𝑠 as an empirical constant set to 5.9 by default (Barree & Conway, 1995).
The settling velocity for a single particle, 𝑢𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 , is calculated based on the Stokes drag law by default,
𝑑𝑝 2
𝑢𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 = (𝜌𝑝 − 𝜌𝑓 ) 𝑔.
18𝜇𝑓
Single-particle settling under intermediate Reynolds-number and turbulent flow conditions can also be described re-
spectively by the Allen’s equation (Barree & Conway, 1995),
[︂ ]︂0.72 (︂ )︂0.45
𝑔(𝜌𝑝 − 𝜌𝑓 ) 𝜌𝑓
𝑢𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 = 0.2𝑑1.18
𝑝 𝑒,
𝜌𝑓 𝜇𝑓
𝜆−1
𝑢𝑠𝑙𝑖𝑝𝐻 = 𝑣𝑚
1−𝑐
with 𝑣 𝑚 denoting volume averaged mixture velocity. We use a simple expression of 𝜆 proposed by Barree & Conway
(1995) to correct the particle slip velocity in horizontal direction,
𝜆 = 𝛼 − |𝑐 − 𝑐𝑠𝑙𝑖𝑝 |𝛽
[︀ ]︀
where 𝛼 and 𝛽 are empirical constants, 𝑐𝑠𝑙𝑖𝑝 is the volume fraction exhibiting the greatest particle slip. By default the
model parameters are set to the values given in (Barree & Conway, 1995): 𝛼 = 1.27, 𝑐𝑠𝑙𝑖𝑝 = 0.1 and 𝛽 = 1.5. This
model can be extended to account for the transition to the particle pack as the proppant concentration approaches the
jamming transition.
In addition to suspended particle flow the GEOS has the option to model proppant settling into an immobile bed at the
bottom of the fracture. As the proppant cannot settle further down the proppant bed starts to form and develop at the
element that is either at the bottom of the fracture or has an underlying element already filled with particles. Such an
“inter-facial” element is divided into proppant flow and immobile bed regions based on the proppant-pack height.
Although proppant becomes immobile fluid can continue to flow through the settled proppant pack. The pack perme-
ability K is defined based on the Kozeny-Carmen relationship:
(𝑠𝑑𝑝 )2 𝜑3
𝐾=
180 (1 − 𝜑)2
and
𝜑 = 1 − 𝑐𝑠
where 𝜑 is the porosity of particle pack and 𝑐𝑠 is the saturation or maximum fraction for proppant packing, 𝑠 is the
sphericity and 𝑑𝑝 is the particle diameter.
The growth of the settled pack in an “inter-facial” element is controlled by the interplay between proppant gravitational
settling and shear-force induced lifting as (Hu et al., 2018),
𝑎 is fracture aperture, and 𝑁𝑠ℎ is the Shields number measuring the relative importance of the shear force to the
gravitational force on a particle of sediment (Miller et al., 1977; Biot & Medlin, 1985; McClure, 2018) as
𝜏
𝑁𝑠ℎ = ,
𝑑𝑝 𝑔(𝜌𝑝 − 𝜌𝑓 )
and
𝜏 = 0.125𝑓 𝜌𝑓 𝑢2𝑚
where 𝜏 is the shear stress acting on the top of the proppant bed and 𝑓 is the Darcy friction coefficient. 𝑁𝑠ℎ,𝑐 is the
critical Shields number for the onset of bed load transport.
Proppant bridging occurs when proppant particle size is close to or larger than fracture aperture. The aperture at which
bridging occurs, ℎ𝑏 , is defined simply by
ℎ𝑏 = 𝜆𝑏 𝑑𝑝 ,
The viscosity of the bulk fluid, 𝜇𝑚 , is calculated as a function of proppant concentration as (Keck et al., 1992),
[︂ (︂ )︂]︂2
𝑐
𝜇𝑚 = 𝜇𝑓 1 + 1.25 .
1 − 𝑐/𝑐𝑠
Note that continued model development and improvement are underway and additional empirical correlations or func-
tions will be added to support the above calculations.
Spatial Discretization
The above governing equations are discretized using a cell-centered two-point flux approximation (TPFA) finite volume
method. We use an upwind scheme to approximate proppant and component transport across cell interfaces.
Solution Strategy
The discretized non-linear slurry flow and proppant/component transport equations at each time step are separately
solved by the Newton-Raphson method. The coupling between them is achieved by a time-marching sequential
(operator-splitting) solution approach.
Parameters
The solver is enabled by adding a <ProppantTransport> node and a <SurfaceGenerator> node in the Solvers
section. Like any solver, time stepping is driven by events, see Event Management.
The following attributes are supported:
In particular:
• discretization must point to a Finite Volume flux approximation scheme defined in the Numerical Methods
section of the input file (see Finite Volume Discretization)
• proppantName must point to a particle fluid model defined in the Constitutive section of the input file (see
Constitutive Models)
• fluidName must point to a slurry fluid model defined in the Constitutive section of the input file (see Constitutive
Models)
• solidName must point to a solid mechanics model defined in the Constitutive section of the input file (see
Constitutive Models)
• targetRegions attribute is currently not supported, the solver is always applied to all regions.
Primary solution field labels are proppantConcentration and pressure. Initial conditions must be prescribed on
these field in every region, and boundary conditions must be prescribed on these fields on cell or face sets of interest.
For static (non-propagating) fracture problems, the fields ruptureState and elementAperture should be provided
in the initial conditions.
In addition, the solver declares a scalar field named referencePorosity and a vector field named permeability, that
contains principal values of the symmetric rank-2 permeability tensor (tensor axis are assumed aligned with the global
coordinate system). These fields must be populated via XML Element: FieldSpecification section and permeability
should be supplied as the value of coefficientName attribute of the flux approximation scheme used.
Example
First, we specify the proppant transport solver itself and apply it to the fracture region:
<ProppantTransport
name="ProppantTransport"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
newtonMaxIter="8"
lineSearchAction="None"/>
<LinearSolverParameters
directParallel="0"/>
</ProppantTransport>
Then, we specify a compatible flow solver (currently a specialized SinglePhaseProppantFVM solver must be used):
<SinglePhaseProppantFVM
name="SinglePhaseFVM"
logLevel="1"
discretization="singlePhaseTPFA"
targetRegions="{ Fracture }">
<NonlinearSolverParameters
newtonTol="1.0e-8"
newtonMaxIter="8"
lineSearchAction="None"/>
<LinearSolverParameters
solverType="gmres"
(continues on next page)
Finally, we couple them through a coupled solver that references the two above:
<FlowProppantTransport
name="FlowProppantTransport"
proppantSolverName="ProppantTransport"
flowSolverName="SinglePhaseFVM"
targetRegions="{ Fracture }"
logLevel="1">
<NonlinearSolverParameters
newtonMaxIter="8"
lineSearchAction="None"
couplingType="Sequential"/>
</FlowProppantTransport>
References
• R. D. Barree & M. W. Conway. “Experimental and numerical modeling of convective proppant transport”,
JPT. Journal of petroleum technology, 47(3):216-222, 1995.
• M. A. Biot & W. L. Medlin. “Theory of Sand Transport in Thin Fluids”, Paper presented at the SPE Annual
Technical Conference and Exhibition, Las Vegas, NV, 1985.
• X. Hu, K. Wu, X. Song, W. Yu, J. Tang, G. Li, & Z. Shen. “A new model for simulating particle transport in
a low-viscosity fluid for fluid-driven fracturing”, AIChE J. 64 (9), 35423552, 2018.
• R. G. Keck, W. L. Nehmer, & G. S. Strumolo. “A new method for predicting friction pressures and rheology
of proppant-laden fracturing fluids”, SPE Prod. Eng., 7(1):21-28, 1992.
• M. McClure. “Bed load proppant transport during slickwater hydraulic fracturing: insights from comparisons
between published laboratory data and correlations for sediment and pipeline slurry transport”, J. Pet. Sci.
Eng. 161 (2), 599610, 2018.
• M. C. Miller, I. N. McCave, & P. D. Komar. “Threshold of sediment motion under unidirectional currents”,
Sedimentology 24 (4), 507527, 1977.
• P. L. Wiberg & J. D. Smith. “Model for calculating bed load transport of sediment”, J. Hydraul. Eng. 115
(1), 101123, 1989.
Solid Models
A solid model governs the relationship between deformation and stress in a solid (or porous) material. GEOS provides
interfaces for both small and large deformation models, as well as specific implementations of a number of well known
models.
Deformation Theories
Table of Contents
• Deformation Theories
– Introduction
– Small Strain Models
– Finite Deformation Models with Hypo-Materials
– Finite Deformation Models with Hyper-Materials
Introduction
The solid mechanics solvers in GEOS work in a time-discrete setting, in which the system state at time 𝑡𝑛 is fully known,
and the goal of the solution procedure is to advance forward one timestep to 𝑡𝑛+1 = 𝑡𝑛 + ∆𝑡. As part of this process,
calls to a solid model must be made to compute the updated stress 𝜎 𝑛+1 resulting from incremental deformation over
the timestep. History-dependent models may also need to compute updates to one or more internal state variables
𝑄𝑛+1 .
The exact nature of the incremental update will depend, however, on the kinematic assumptions made. Appropriate
measures of deformation and stress depend on assumptions of infinitesimal or finite strain, as well as other factors like
rate-dependence and material anisotropy.
This section briefly reviews three main classes of solid models in GEOS, grouped by their kinematic assumptions. The
presentation is deliberately brief, as much more extensive presentations can be found in almost any textbook on linear
and nonlinear solid mechanics.
Let 𝑢 denote the displacement field, and ∇𝑢 its gradient. In small strain theory, ones assumes the displacement gradients
∇𝑢 ≪ 1. In this case, it is sufficient to use the linearized strain tensor
1
𝜖= (∇𝑢 + 𝑢∇)
2
as the deformation measure. Higher-order terms present in finite strain theories are neglected. For inelastic problems,
this strain is additively decomposed into elastic and inelastic components as
𝜖 = 𝜖𝑒 + 𝜖𝑖 .
Inelastic strains can arise from a number of sources: plasticity, damage, etc. Most constitutive models (including
nonlinear elastic and inelastic models) can then be generically expressed in rate form as
𝜎˙ = 𝑐 : 𝜖˙𝑒
where 𝜎˙ is the Cauchy stress rate and 𝑐 is the tangent stiffness tensor. Observe that the stress rate is driven by the elastic
component 𝜖˙𝑒 of the strain rate.
In the time-discrete setting (as implemented in the code) the incremental constitutive update for stress is computed
from a solid model update routine as
where ∆𝜖 = 𝜖𝑛+1 − 𝜖𝑛 is the incremental strain, ∆𝑡 is the timestep size (important for rate-dependent models), and
𝑄𝑛 is a collection of material state variables (which may include the previous stress and strain).
For path and rate independent models, such as linear elasticity, a simpler constitutive update may be formulated in
terms of the total strain:
𝜎 𝑛+1 = 𝜎(𝜖𝑛+1 ).
GEOS will use this latter form in specific, highly-optimized solvers when we know in advance that a linear elastic
model is being applied. The more general interface is the default, however, as it can accommodate a much wider range
of constitutive behavior within a common interface.
When implicit timestepping is used, the solid models must also provide the stiffness tensor,
𝜕𝜎 𝑛+1
𝑐𝑛+1 = ,
𝜕𝜖𝑛+1
in order to accurately linearize the governing equations. In many works, this fourth-order tensor is referred to as the
algorithmic or consistent tangent, in the sense that it must be “consistent” with the discrete timestepping scheme being
used (Simo and Hughes 1987). For inelastic models, it depends not only on the intrinsic material stiffness, but also the
incremental nature of the loading process. The correct calculation of this stiffness can have a dramatic impact on the
convergence rate of Newton-type solvers used in the implicit solid mechanics solvers.
In the finite deformation regime, there are two broad classes of constitutive models frequently used:
• Hypo-elastic models (and inelastic extensions)
• Hyper-elastic models (and inelastic extensions)
Hypo-materials typically rely on a rate-form of the constitutive equations expressed in the spatial configuration. Let
𝑣(𝑥, 𝑡) denote the spatial velocity field. It can be decomposed into symmetric and anti-symmetric components as
1 1
𝑑= (∇𝑣 + 𝑣∇) and 𝑤= (∇𝑣 − 𝑣∇) ,
2 2
where 𝑑 is the deformation rate tensor and 𝑤 is the spin tensor. A hypo-material model can be written in rate form as
𝜏 = 𝑐 : 𝑑𝑒
˚
where ˚𝜏 is an objective rate of the Kirchoff stress tensor, 𝑐 is the tangent stiffness tensor, and 𝑑𝑒 is the elastic component
of the deformation rate. We see that the structure is similar to the rate form in the small strain regime, except the rate
of Cauchy stress is replaced with an objective rate of Kirchoff stress, and the linearized strain rate is replaced with the
deformation rate tensor.
The key difference separating most hypo-models is the choice of the objective stress rate. In GEOS, we adopt the
incrementally objective integration algorithm proposed by Hughes and Winget (1980). This method relies on the
concept of an incrementally rotating frame of reference in order to preserve objectivity of the stress rate. In particular,
the stress update sequence is
1 1
∆𝑅 = (𝐼 − ∆𝑡𝑤)−1 (𝐼 + ∆𝑡𝑤) (compute incremental rotation),
2 2
𝜏¯𝑛 = ∆𝑅𝜏 𝑛 ∆𝑅𝑇 (rotate previous stress),
𝜏 𝑛+1 𝑛
= 𝜏¯ + ∆𝜏 (call constitutive model to update stress).
First, the previous timestep stress is rotated to reflect any rigid rotations occuring over the timestep. If the model has
tensor-valued state variables besides stress, these must also be rotated. Then, a standard constitutive update routine can
be called, typically driven by the incremental strain ∆𝜖 = ∆𝑡𝑑. In fact, an identical update routine as used for small
strain models can be re-used at this point.
ò Note
Hypo-models suffer from several well known deficiencies. Most notably, the energy dissipation in a closed loading
cycle of a hypo-elastic material is not guaranteed to be zero, as one might desire from thermodynamic considera-
tions.
Hyper-elastic models (and inelastic extensions) attempt to correct the thermodynamic deficiencies of their hypo-elastic
cousins. The constitutive update can be generically expressed at
where 𝑆 is the second Piola-Kirchoff stress and ∆F is the incremental deformation gradient. Depending on the model,
the deformation gradient can be converted to different deformation measures as needed. Similarly, different stress
tensors can be recovered through appropriate push-forward and pull-back operations.
In a hyperelastic material, the elastic response is expressed in terms of a stored strain-energy function that serves as the
potential for stress, e.g.
𝜕𝜓(𝐶)
S= ,
𝜕𝐶
where 𝜓 is the stored energy potential, and 𝐶 is the right Cauchy-Green deformation tensor. This potential guarantees
that the energy dissipated or gained in a closed elastic cycle is zero.
Voigt Notation
In GEOS we express rank-two symmetric tensors using Voigt notation. Stress tensors are represented as an “unrolled”
six-component vector storing only the unique component values. For strain tensors, note that engineering strains are
used such that the shear components of strain are multiplied by a factor of two. With this representation, the strain
energy density is, conveniently, the inner product of the stress and strain vectors.
Voigt representation of common rank-2 symmetric tensors are:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤
𝜎11 𝑆11 𝜖11 𝐷11 𝐸11 𝐵11 𝐶11
⎢ 𝜎22 ⎥ ⎢𝑆22 ⎥ ⎢ 𝜖22 ⎥ ⎢ 𝐷22 ⎥ ⎢ 𝐸22 ⎥ ⎢ 𝐵22 ⎥ ⎢ 𝐶22 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ 𝜎33 ⎥ ⎢𝑆33 ⎥ ⎢ 𝜖33 ⎥ ⎢ 𝐷33 ⎥ ⎢ 𝐸33 ⎥ ⎢ 𝐵33 ⎥ ⎢ 𝐶33 ⎥
𝜎=⎢ ⎢
⎥ , S = ⎢𝑆23 ⎥ , 𝜖 = ⎢ 2𝜖23 ⎥ , D = ⎢2𝐷23 ⎥ , E = ⎢2𝐸23 ⎥ , B = ⎢2𝐵23 ⎥ , C = ⎢2𝐶23 ⎥ ,
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ 𝜎23 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣ 𝜎13 ⎦ ⎣𝑆13 ⎦ ⎣ 2𝜖13 ⎦ ⎣2𝐷13 ⎦ ⎣2𝐸13 ⎦ ⎣2𝐵13 ⎦ ⎣2𝐶13 ⎦
𝜎12 𝑆12 2𝜖12 2𝐷12 2𝐸12 2𝐵12 2𝐶12
where 𝜎 is the Cauchy stress, S is the second Piola-Kirchhoff stress, 𝜖 is the small strain tensor, D is the rate of
deformation tensor, E is the Lagrangian finite strain tensor, B is the left Cauchy-Green tensor, C is the right Cauchy-
Green deformation tensor.
ò Note
The factor of two in the shear components of strain (and strain-like) quantities is a frequent source of confusion, even
for expert modelers. It can be particularly challenging to use in nuanced situations like stiffness tensor calculations
or invariant decompositions. If you plan to implement new models within GEOS, please pay extra attention to this
detail. We also provide many common operations in centralized helper functions to avoid re-inventing the wheel.
Plasticity Notation
Table of Contents
• Plasticity Notation
– Overview
– Two-Invariant Models
– Three-Invariant Models
Overview
According to the theory of plasticity in the small strain regime, the total strain 𝜖 can be additively split into elastic (𝜖𝑒 )
and plastic (𝜖𝑝 ) strains:
𝜖 = 𝜖𝑒 + 𝜖 𝑝 .
𝜎˙ = 𝑐𝑒 : 𝜖˙ 𝑒 ,
where 𝑐𝑒 is the fourth order elastic stiffness tensor. The Cauchy stress tensor is related to the total strain as
𝜎˙ = 𝑐𝑒𝑝 : 𝜖,
˙
Two-Invariant Models
Two-invariant plasticity models use the first invariant of the Cauchy stress tensor and the second invariant of the devi-
atoric stress tensor to describe the yield surface.
√
Here we use the following stress invariants to define the yield surface: the von Mises stress 𝑞 = 3𝐽2 = 3/2‖𝑠‖
√︀
and mean normal stress 𝑝 = 𝐼1 /3. Here, 𝐼1 and 𝐽2 are the first invariant of the stress tensor and second invariant of
the deviatoric stress, defined as
1
𝐼1 = 𝑡𝑟(𝜎)/3 , 𝐽2 = ‖𝑠‖2 , 𝑠 = 𝜎 − 𝑝1 ,
2
in which 1 is the identity tensor.
Similarly, we can define invariants of strain tensor, namely, volumetric strain 𝜖𝑣 and deviatoric strain 𝜖𝑠 .
√︂
2 1
𝜖𝑣 = 𝑡𝑟(𝜖) , 𝜖𝑠 = ‖𝑒‖ , where 𝑒 = 𝜖 − 𝜖𝑣 1.
3 3
Stress and strain tensors can then be recomposed from the invariants as:
√︂
2
𝜎 = 𝑝1 + ˆ
𝑞𝑛
3
√︂
1 3
𝜖 = 𝜖𝑣 1 + ˆ
𝜖𝑠 𝑛
3 2
in which 𝑛
ˆ = 𝑒/‖𝑒‖.
The following two-invariant models are currently implemented in GEOS:
• DruckerPrager
• J2Plasticity
• ModifiedCamClay
• DelftEgg
Three-Invariant Models
Several three-invariant models are under active development, but are not yet available in develop. If you are interested
in helping to add additional material models, please submit a feature request.
Overview
This model may be used for solid materials with a linear elastic isotropic behavior. The relationship between stress and
strain is given by Hooke’s Law, expressed as:
where 𝜎𝑖𝑗 is the 𝑖𝑗 component of the Cauchy stress tensor, 𝜖𝑖𝑗 is the 𝑖𝑗 component of the strain tensor, 𝜆 is the first
Lamé elastic constant, and 𝜇 is the elastic shear modulus.
Hooke’s Law may also be expressed using Voigt notation for stress and strain vectors as:
𝜎 = 𝐶 · 𝜖,
or,
⎡ ⎤ ⎡ ⎤⎡ ⎤
𝜎11 2𝜇 + 𝜆 𝜆 𝜆 0 0 0 𝜖11
⎢𝜎22 ⎥ ⎢ 𝜆 2𝜇 + 𝜆 𝜆 0 0 0⎥⎥ ⎢ 𝜖22 ⎥
⎢ ⎥
⎢ ⎥ ⎢
⎢𝜎33 ⎥ ⎢ 𝜆 𝜆 2𝜇 + 𝜆 0 0 0⎥ ⎢ 𝜖33 ⎥
⎢ ⎥=⎢ ⎥⎢ ⎥.
⎢𝜎23 ⎥ ⎢ 0 0 0 𝜇 0 0⎥⎥ ⎢2𝜖23 ⎥
⎢ ⎥
⎢ ⎥ ⎢
⎣𝜎13 ⎦ ⎣ 0 0 0 0 𝜇 0 ⎦ ⎣2𝜖13 ⎦
𝜎12 0 0 0 0 0 𝜇 2𝜖12
Variations
For finite deformation solvers, the elastic isotropic model can be called within a hypo-elastic update routine. See Finite
Deformation Models with Hypo-Materials
Parameters
The following attributes are supported. Note that any two elastic constants can be provided, and the other two will be
internally calculated. The “default” keyword in front of certain properties indicates that this is the default value adopted
for a region unless the user separately specifies a heterogeneous field via the FieldSpecification mechanism.
Example
<Constitutive>
<ElasticIsotropic
name="shale"
defaultDensity="2700"
defaultBulkModulus="60.0e6"
defaultShearModulus="30.0e6" />
</Constitutive>
Overview
This model may be used for solid materials with a pressure-dependent elastic isotropic behavior. The relationship
between stress and strain is given by a hyperelastic law. The elastic constitutive equations for the volumetric and
deviatoric stresses and strain are expressed as:
𝜖𝑣0 − 𝜖𝑒𝑣
(︂ )︂
𝑝 = 𝑝0 exp , 𝑞 = 3𝜇𝜖𝑒𝑠
𝑐𝑟
where 𝑝 and 𝑞 are the volumetric and deviatoric components of the Cauchy stress tensor. 𝜖𝑒𝑣 and 𝜖𝑒𝑠 are the volumetric
and deviatoric components of the strain tensor. 𝜖𝑣0 and 𝑝0 are the initial volumetric strain and initial pressure. 𝐶𝑟
denotes the elastic compressibility index, and 𝜇 is the elastic shear modulus. In this model, the shear modulus is
constant and the bulk modulus, 𝐾, varies linearly with pressure as follows:
𝑝
𝐾=−
𝑐𝑟
Parameters
The following attributes are supported. Note that two elastic constants 𝑐𝑟 and 𝜇, as well as the initial volumetric strain
and initial pressure need to be provided. The “default” keyword in front of certain properties indicates that this is the de-
fault value adopted for a region unless the user separately specifies a heterogeneous field via the FieldSpecification
mechanism.
Example
<Constitutive>
<ElasticIsotropicPressureDependent
name="elasticPressure"
defaultDensity="2700"
defaultRefPressure="-1.0"
defaultRefStrainVol="1"
defaultRecompressionIndex="0.003"
defaultShearModulus="200"/>
</Constitutive>
Overview
This model may be used for solid materials with a linear elastic, transverse-isotropic behavior. This is most readily
expressed in Voight notation as
⎡ ⎤ ⎡ ⎤⎡ ⎤
𝜎11 𝐶11 𝐶12 𝐶13 0 0 0 𝜖11
⎢𝜎22 ⎥ ⎢𝐶12 𝐶11 𝐶13 0 0 0 ⎥ ⎢ 𝜖22 ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢𝜎33 ⎥ ⎢𝐶13 𝐶13 𝐶33 0 0 0 ⎥ ⎢ 𝜖33 ⎥
⎢ ⎥=⎢
⎥ ⎢2𝜖23 ⎥ .
⎥⎢ ⎥
⎢𝜎23 ⎥ ⎢ 0 0 0 𝐶44 0 0
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎣𝜎13 ⎦ ⎣ 0 0 0 0 𝐶44 0 ⎦ ⎣2𝜖13 ⎦
𝜎12 0 0 0 0 0 (𝐶11 − 𝐶12 )/2 2𝜖12
This system contains five independent constants. These constants are calculated from the input parameters indicated
below.
Parameters
The following attributes are supported. The “default” keyword in front of certain properties indicates that this is the de-
fault value adopted for a region unless the user separately specifies a heterogeneous field via the FieldSpecification
mechanism.
Example
<Constitutive>
<ElasticTransverseIsotropic
name="shale"
defaultDensity="2700"
defaultPoissonRatioAxialTransverse="0.20"
defaultPoissonRatioTransverse="0.30"
defaultYoungModulusAxial="50.0e6"
defaultYoungModulusTransverse="60.0e6"
defaultShearModulusAxialTransverse="30.0e6" />
</Constitutive>
Overview
This model may be used for solid materials with a linear elastic, orthotropic behavior. This is most readily expressed
in Voight notation as
⎡ ⎤ ⎡ ⎤⎡ ⎤
𝜎11 𝐶11 𝐶12 𝐶13 0 0 0 𝜖11
⎢𝜎22 ⎥ ⎢𝐶12 𝐶22 𝐶23 0 0 0 ⎥⎥ ⎢ 𝜖22 ⎥
⎢ ⎥
⎢ ⎥ ⎢
⎢𝜎33 ⎥ ⎢𝐶13 𝐶23 𝐶33 0 0 0 ⎥ ⎢ 𝜖33 ⎥
⎥ ⎢
⎢ ⎥=⎢ ⎥.
⎢𝜎23 ⎥ ⎢ 0 0 0 𝐶44 0 0 ⎥⎥ ⎢2𝜖23 ⎥
⎢ ⎥
⎢ ⎥ ⎢
⎣𝜎13 ⎦ ⎣ 0 0 0 0 𝐶55 0 ⎦ ⎣2𝜖13 ⎦
𝜎12 0 0 0 0 0 𝐶66 2𝜖12
This system contains nine independent constants. These constants are calculated from the input parameters indicated
below.
Parameters
The following attributes are supported. The “default” keyword in front of certain properties indicates that this is the de-
fault value adopted for a region unless the user separately specifies a heterogeneous field via the FieldSpecification
mechanism.
Example
Model: Drucker-Prager
Overview
This model may be used to represent a solid material with plastic response to loading according to the Drucker-Prager
yield criterion below:
𝑓 (𝑝, 𝑞) = 𝑞 + 𝑏 𝑝 − 𝑎 = 0.
Fig. 1.83: Mohr-Coulomb and Drucker-Prager yield surfaces in principal stress axes (Borja, 2002).
The material behavior is linear elastic (see Model: Elastic Isotropic) for 𝑓 < 0, and plastic for 𝑓 = 0. The two material
parameters 𝑎 and 𝑏 are derived by approximating the Mohr-Coulomb surface with a cone. Figure 3 shows the Mohr-
Coulomb yield surface and circumscribing Drucker-Prager surface in principal stress space. The Drucker-Prager yield
surface has a circular cross-section in the deviatoric plane that passes through the tension or compression corners of
the Mohr-Coulomb yield surface, as shown in the Figure 4. The material parameters 𝑎 and 𝑏 are derived as:
6 𝑐 cos 𝜑 6 sin 𝜑
𝑎= , 𝑏=
3 ± sin 𝜑 3 ± sin 𝜑
where plus signs are for circles passing through the tension corners, and minus signs are for circles passing through
compression corners. Also, 𝜑 and 𝑐 denote friction angle and cohesion, respectively, as defined by the Mohr-Coulomb
failure envelope shown in Figure 5. In GEOS, we use a compression corner fit (minus signs) to convert the user-specified
friction angle and cohesion to 𝑎 and 𝑏.
Fig. 1.84: Mohr-Coulomb and Drucker-Prager yield surfaces on the deviatoric plane (Borja, 2013).
𝑔(𝑝, 𝑞) = 𝑞 + 𝑏′ 𝑝,
where 𝑏′ ≤ 𝑏 is the dilatancy parameter. Setting 𝑏′ = 𝑏 leads to associative flow rule, while for 𝑏′ < 𝑏 non-associative
flow is obtained. The parameter 𝑏′ is related to dilation angle as:
6 sin 𝜓
𝑏′ = ,
3 ± sin 𝜓
where 𝜓 ≤ 𝜑 is the dilation angle. If 𝜓 > 0, then the plastic flow is dilative. Again, we use a compression corner fit
(minus sign).
A hardening rule is defined which determines how the yield surface will change as a result of plastic deformations.
Here we use linear hardening for the cohesion parameter, 𝑎,
˙
𝑎˙ = ℎ 𝜆,
where ℎ is the hardening parameter. A positive hardening parameter will allow the cohesion to grow, shifting the co-
hesion intercept vertically on the q-axis. A negative hardening parameter will cause the cohesion to shrink, though
negative cohesion values are not allowed. Once all cohesion has been lost, the cohesion will remain at zero, so the cone
vertex is fixed at the origin. In either case, the friction and dilation angles remain constant. See the DruckerPragerEx-
tended model for an alternative version of hardening behavior.
Parameters
Example
<Constitutive>
<DruckerPrager name="drucker"
defaultDensity="2700"
defaultBulkModulus="1000.0"
defaultShearModulus="1000.0"
defaultFrictionAngle="30.0"
defaultDilationAngle="20.0"
defaultHardeningRate="0.0"
defaultCohesion="10.0" />
</Constitutive>
Variant: J2 plasticity
J2 yield criterion can be obtained as a special case of the Drucker-Prager model by setting the friction and dilation
angles to zero, i.e. 𝜑 = 𝜓 = 0.
Overview
This model implements a more sophisticated version of the Drucker-Prager model (see Model: Drucker-Prager) al-
lowing for both cohesion and friction hardening / softening. We implement the specific hardening model reported in
Liu et al. (2020). The yield surface is given by
(︂ )︂
𝑎𝑖
𝑓 (𝑝, 𝑞) = 𝑞 + 𝑏 𝑝 − = 0,
𝑏𝑖
where 𝑏 is the current yield surface slope, 𝑏𝑖 is the initial slope, and 𝑎𝑖 is the initial cohesion intercept in p-q space.
The vertex of the Drucker-Prager cone is fixed at 𝑝 = 𝑎𝑖 /𝑏𝑖 . Let 𝜆 denote the accumulated plastic strain measure. The
current yield surface slope is given by the hyperbolic relationship
𝜆
𝑏 = 𝑏𝑖 + (𝑏𝑟 − 𝑏𝑖 )
𝑚+𝜆
with 𝑚 a parameter controlling the hardening rate. Here, 𝑏𝑟 is the residual yield surface slope. If 𝑏𝑟 < 𝑏𝑖 , hardening
behavior will be observed, while for 𝑏𝑟 < 𝑏𝑖 softening behavior will occur.
In the resulting model, the yield surface begins at an initial position defined by the initial cohesion and friction angle.
As plastic deformation occurs, the friction angle hardens (or softens) so that it asymptoptically approaches a residual
friction angle. The vertex of the cone remains fixed in p-q space, but the cohesion intercept evolves in tandem with the
friction angle. See Liu et al. (2020) <https://doi.org/10.1007/s00603-019-01992-5> for complete details.
In order to allow for non-associative behavior, we define a “dilation ratio” parameter 𝜃 ∈ [0, 1] such that 𝑏′ = 𝜃𝑏,
where 𝑏′ is the slope of the plastic potential surface, while 𝑏 is the slope of the yield surface. Choosing 𝜃 = 1 leads to
associative behavior, while 𝜃 = 0 implies zero dilatancy.
Parameters
Example
<Constitutive>
<ExtendedDruckerPrager
name="edp"
defaultDensity="2700"
defaultBulkModulus="500"
defaultShearModulus="300"
defaultCohesion="0.0"
defaultInitialFrictionAngle="15.0"
defaultResidualFrictionAngle="23.0"
defaultDilationRatio="1.0"
defaultHardening="0.001"
/>
</Constitutive>
This model may be used to represent a solid material with plastic response to loading according to the Modified Cam-
Clay (MCC) critical state model. The MCC yield function is defined as:
𝑓 = 𝑞 2 + 𝑀 2 𝑝(𝑝 − 𝑝𝑐 ) = 0,
where 𝑝𝑐 is the preconsolidation pressure, and 𝑀 is the slope of the critical state line (CSL). 𝑀 can be related to the
critical state friction angle 𝜑𝑐𝑠 as
6 sin 𝜑𝑐𝑠
𝑀= .
3 − sin 𝜑𝑐𝑠
Here 𝑓 represents the yield surface, as shown in Figure 6.
Fig. 1.86: Cam-Clay and Modified Cam-Clay yield surfaces in p-q space (Borja, 2013).
Here we use a hyper-elastic constitutive law using the following elastic rate constitutive equation
𝑝 𝑒
𝑝˙ = − 𝜖˙ ,
𝑐𝑟 𝑣
where 𝑐𝑟 > 0 is the elastic compressibility index. The tangential elastic bulk modulus is 𝐾 = − 𝑐𝑝𝑟 and varies linearly
with pressure. We assume a constant shear modulus, and can write stress invariants p and q as
𝜖𝑣0 − 𝜖𝑒𝑣
(︂ )︂
𝑝 = 𝑝0 exp , 𝑞 = 3𝜇𝜖𝑒𝑠 ,
𝑐𝑟
where 𝑝0 is the reference pressure and 𝜖𝑣0 is the reference volumetric strain. The hardening law is derived from the
linear relationship between logarithm of specific volume and logarithm of preconsolidation pressure, as show in Figure
7.
The hardening law describes evolution of the preconsolidation pressure 𝑝𝑐 as
𝑡𝑟(𝜖˙ 𝑝 )
𝑝˙𝑐 = − 𝑝𝑐 ,
𝑐𝑐 − 𝑐𝑟
where 𝑐𝑐 is the virgin compressibility index and we have 0 < 𝑐𝑟 < 𝑐𝑐 .
Parameters
Example
Fig. 1.87: Bilogarithmic hardening law derived from isotropic compression tests (Borja, 2013).
<Constitutive>
<ModifiedCamClay name="mcc"
defaultDensity="2700"
defaultRefPressure="-1.0"
defaultRefStrainVol="0"
defaultShearModulus="200.0"
defaultPreConsolidationPressure="-1.5"
defaultCslSlope="1.2"
defaultRecompressionIndex="0.002"
defaultVirginCompressionIndex="0.003" />
</Constitutive>
The Delft-Egg plasticity model uses a generalization of the Modified Cam-Clay yield surface, defined as
𝛼2 (𝛼 − 1) 2
[︂ (︂ )︂ ]︂
2𝛼 𝛼
𝑓 = 𝑞 2 − 𝑀 2 𝛼2 𝑝 𝑝𝑐 − 𝑝 − 𝑝𝑐 = 0 (for 𝑝𝑐 > )
𝛼+1 𝛼+1 𝛼+1
(︂ )︂
2 2 2𝛼 𝛼
𝑓 =𝑞 −𝑀 𝑝 𝑝𝑐 − 𝑝 = 0 (for 𝑝𝑐 ≤ )
𝛼+1 𝛼+1
where 𝛼 ≥ 1 is the shape parameter. For 𝛼 = 1, this model leads to a Modified Cam-Clay (MCC) type model with an
ellipsoidal yield surface. For 𝛼 > 1, an egg-shaped yield surface is obtained. The additional parameter makes it easier
to fit the cap behavior of a broader range of soils and rocks.
Because Delft-Egg is frequently used for hard rocks, GEOS uses a linear model for the elastic response, rather than the
hyper-elastic model used for MCC. This is a slight deviation from the original formulation proposed in the reference
above. For reservoir applications, the ability to use a simpler linear model was a frequent user request.
Parameters
Example
<Constitutive>
<DelftEgg
name="DE"
defaultDensity="2700"
defaultBulkModulus="10.0e9"
defaultShearModulus="6.0e9"
defaultPreConsolidationPressure="-20.0e6"
defaultShapeParameter="6.5"
defaultCslSlope="1.2"
defaultVirginCompressionIndex="0.005"
defaultRecompressionIndex="0.001"/>
</Constitutive>
Damage Models
The damage models are in active development, and documentation will be added when they are ready for production
release.
Model: Viscoplasticity
The classical Perzyna-type viscoplasticity models are not suitable for rate-dependent viscoplastic models with non-
smooth multisurface, because of using unclearly defined nested viscoplastic loading surfaces. As an alternative, the
Duvaut-Lions viscoplastic theory, precludes these difficulties by excluding the concept of nested viscoplastic loading
surfaces. The viscoplastic constitutive equation that relates the stress 𝜎 and the viscoplastic strain rate 𝜖𝑣𝑝
˙ is given by:
1
𝜎−𝜎
¯= ˙
𝑐 : 𝜖𝑣𝑝
𝑡*
Here, 𝜎¯ represents the inviscid stress, which is the rate-independent elasto-plastic stress part that can be solved by using
elasto-plastic solvers (such as Drucker-Prager, CamClay, etc.). 𝑐 is the tangent stiffness tensor and 𝑡* is the relaxation
time, which is measured in units of time. The viscoplastic strain rate 𝜖˙ 𝑣𝑝 can be approximated using the following finite
difference formula:
1
˙ =
𝜖𝑣𝑝 (∆𝜖 − ∆𝜖𝑒𝑙𝑎𝑠 )
∆𝑡
Here, ∆𝑡 is the time increment, ∆𝜖 is the total strain increment, and ∆𝜖𝑒𝑙𝑎𝑠 is the elastic part of the strain increment.
Note that the elastic strain increment is related to the stress increment through Hook’s law.
∆𝜎 = 𝑐 : ∆𝜖𝑒𝑙𝑎𝑠
With some arrangements, we can obtain the following formula to update the stress tensor of the Duvaut-Lions elasto-
viscoplastic materials:
ˆ + (1 − 𝑟𝑡 )𝜎
𝜎 = 𝑟𝑡 𝜎 ¯
Here, the time ratio 𝑟𝑡 is calculated from the relaxation time 𝑡* and the time increment ∆𝑡 as:
1
𝑟𝑡 =
1 + ∆𝑡/𝑡*
The tangent stiffness tensor is updated using the following equivalent approximation:
𝑐𝑡+Δ𝑡 = 𝑟𝑡 𝑐𝑒 + (1 − 𝑟𝑡 )𝑐𝑡
Fluid Models
These models provide density, viscosity, and composition relationships for single fluids and fluid mixtures.
Overview
This model represents a compressible single-phase fluid with constant compressibility and pressure-dependent viscos-
ity. These assumptions are valid for slightly compressible fluids, such as water, and some types of oil with negligible
amounts of dissolved gas.
Specifically, fluid density is computed as
Parameters
Example
<Constitutive>
<CompressibleSinglePhaseFluid name="water"
referencePressure="2.125e6"
referenceDensity="1000"
compressibility="1e-19"
referenceViscosity="0.001"
viscosibility="0.0"/>
</Constitutive>
Overview
In the black-oil model three pseudo-components, oil (o), gas (g) and water (w) are considered. These are assumed to
be partitioned across three fluid phases, named liquid (l), vapor (v) and aqueous (a).
Phase behavior is characterized by the following quantities which are used to relate properties of the fluids in the
reservoir to their properties at surface conditions.
• 𝐵𝑜 : oil formation volume factor
Dead oil
In dead-oil each component occupies only one phase. Thus, the following partition matrix determines the components
distribution within the three phases:
⎡ ⎤ ⎡ ⎤
𝑦𝑔𝑣 𝑦𝑔𝑙 𝑦𝑔𝑎 1 0 0
⎣ 𝑦𝑜𝑣 𝑦𝑜𝑙 𝑦𝑜𝑎 ⎦ = ⎣0 1 0⎦
𝑦𝑤𝑣 𝑦𝑤𝑙 𝑦𝑤𝑎 0 0 1
𝜌𝑆𝑇
𝑜
𝐶
𝜌𝑙 =
𝐵𝑜
𝜌𝑆𝑇
𝑔
𝐶
𝜌𝑣 = .
𝐵𝑔
Live oil
The live oil fluid model make no assumptions about the partitioning of the hydrocarbon components and the following
composition matrix can be used
𝜌𝑆𝑇 𝐶
𝜌𝑆𝑇 𝐶
⎡ ⎤
𝑔 𝑔 𝑅𝑠
0
⎡ ⎤
𝑦𝑔𝑣 𝑦𝑔𝑙 𝑦𝑔𝑎 𝑆𝑇 𝐶 𝑆𝑇 𝐶
⎢ 𝜌𝑔 +𝜌𝑜 𝑟𝑠 𝜌𝑜 +𝜌𝑔 𝑅𝑠𝑆𝑇 𝐶 𝑆𝑇 𝐶
⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ 𝑦𝑜𝑣 𝑦𝑜𝑙 𝑦𝑜𝑎 ⎥ = ⎢ 𝜌𝑆𝑇 𝐶
𝑟 𝑠 𝜌 𝑆𝑇 𝐶
⎥ ⎢ 𝜌𝑆𝑇 𝐶𝑜+𝜌𝑆𝑇 𝐶 𝑟𝑠 𝜌𝑆𝑇 𝐶 +𝜌 𝑜
0
⎥
⎢ 𝑆𝑇 𝐶 𝑅 ⎥
⎣ ⎦ ⎢ 𝑔 𝑜 𝑜 𝑔 𝑠 ⎥
⎣ ⎦
𝑦𝑤𝑣 𝑦𝑤𝑙 𝑦𝑤𝑎
0 0 1
𝜌𝑆𝑇
𝑜
𝐶
+ 𝜌𝑆𝑇
𝑔
𝐶
𝑅𝑠
𝜌𝑙 =
𝐵𝑜
𝜌𝑆𝑇
𝑔
𝐶
+ 𝜌𝑆𝑇
𝑜
𝐶
𝑅𝑣
𝜌𝑣 =
𝐵𝑔
Parameters
Both types are represented by <BlackOilFluid> node in the input. Under the hood this is a wrapper around
PVTPackage library, which is included as a submodule. In order to use the model, GEOS must be built with
-DENABLE_PVTPACKAGE=ON (default).
The following attributes are supported:
hydrocarbonViscosi- groupNameRef_array {}
tyTableNames
List of viscosity
TableFunction names
from the Functions block.
The user must provide
one TableFunction per
hydrocarbon phase, in the
order provided in
“phaseNames”.
For instance, if “oil” is
before “gas” in
“phaseNames”, the table
order should be:
oilTableName,
gasTableName
Value Comment
oil Oil phase
gas Gas phase
water Water phase
Example
<Constitutive>
<BlackOilFluid name="fluid1"
fluidType="LiveOil"
phaseNames="{ oil, gas, water }"
surfaceDensities="{ 800.0, 0.9907, 1022.0 }"
componentMolarWeight="{ 114e-3, 16e-3, 18e-3 }"
tableFiles="{ pvto.txt, pvtg.txt, pvtw.txt }"/>
</Constitutive>
Overview
This model represents a full composition description of a multiphase multicomponent fluid. Phase behavior is modeled
by an equation of state (EOS) and partitioning of components into phases is computed based on instantaneous chemical
equilibrium via a two-phase flash. Each component (species) is characterized by molar weight and critical properties
that serve as input parameters for the EOS. See Petrowiki for more information.
In this model the fluid is described by 𝑁𝑐 components with 𝑧𝑐 being the total mole fraction of component 𝑐. The fluid
can partition into a liquid phase, denoted ℓ, and a vapor phase denoted by 𝑣. Therefore, by taking into account the
molar phase component fractions, (which is the fraction of the molar mass of phase 𝑝 represented by component 𝑐), the
following partition matrix establishes the component distribution within the two phases:
[︂ ]︂
𝑥1 𝑥2 𝑥3 · · · 𝑥𝑁𝑐
𝑦1 𝑦2 𝑦3 · · · 𝑦𝑁𝑐
where 𝑥𝑐 is the mole fraction of component 𝑐 in the liquid phase and 𝑦𝑐 is the mole fraction of component 𝑐 in the
vapor phase.
The fluid properties are updated through the following steps:
1) The phase fractions (𝜈𝑝 ) and phase component fractions (𝑥𝑐 and 𝑦𝑐 ) are computed as a function of pressure (𝑝),
temperature (𝑇 ) and total component fractions (𝑧𝑐 ).
2) The phase densities (𝜌𝑝 ) and phase viscosities (𝜇𝑝 ) are computed as a function of pressure, temperature and the
updated phase component fractions.
After calculating the phase fractions, phase component fractions, phase densities, phase viscosities, and their derivatives
with respect to pressure, temperature, and component fractions, the Compositional Multiphase Flow Solver then moves
on to assembling the accumulation and flux terms.
Step 1: Computation of the phase fractions and phase component fractions (flash)
Stability test
The first step is to determine if the provided mixture with total molar fractions 𝑧𝑐 is stable as a single phase at the
current pressure 𝑝 and temperature 𝑇 . However, this can only be confirmed through stability testing.
The stability of a mixture is traditionally assessed using the Tangent Plane Distance (TPD) criterion developed by
Michelsen (1982a). This criterion states that a phase with composition 𝑧 is stable at a specified pressure 𝑝 and temper-
ature 𝑇 if and only if
𝑁𝑐
∑︁
𝑔(𝑦) = 𝑦𝑖 (ln 𝑦𝑖 + ln 𝜑𝑖 (𝑦) − ln 𝑧𝑖 − ln 𝜑𝑖 (𝑧)) ≥ 0
𝑖=1
for any permissible trial composition 𝑦, where 𝜑𝑖 denotes the fugacity coefficient of component 𝑖.
To determine stability of the mixture this testing in initiated from a basic starting point, based on Wilson K-values, to
get both a lighter and a heavier trial mixture. The two trial mixtures are calculated as 𝑦𝑖 = 𝑧𝑖 /𝐾𝑖 and 𝑦𝑖 = 𝑧𝑖 𝐾𝑖 where
𝐾𝑖 are defined by
(︂ (︂ )︂)︂
𝑃𝑐𝑖 𝑇𝑐𝑖
𝐾𝑖 = exp 5.37(1 + 𝜔𝑖 ) 1 −
𝑝 𝑇
where 𝑃𝑐𝑖 and 𝑇𝑐𝑖 are respectively, the critical pressure and temperature of component 𝑖 and 𝜔𝑖 is the accentric factor
of component 𝑖.
The stability problem is solved by observing that a necessary condition is that 𝑔(𝑦) must be non-negative at all its
stationary points. The stationarity criterion can be expressed as
ln 𝑦𝑖 + ln 𝜑𝑖 (𝑦) − ℎ𝑖 = 𝑘 𝑖 = 1, 2, 3, . . . , 𝑁𝑐
where ℎ𝑖 = ln 𝑧𝑖 + ln 𝜑𝑖 (𝑧) is a constant parameter dependent on the feed composition 𝑧 and 𝑘 is an undetermined
constant. This constant can be further incorporated into the equation by defining the unnormalized trial phase moles
𝑌𝑖 as
𝑌𝑖 = exp(−𝑘)𝑦𝑖
which reduces the stationarity criterion to
ln 𝑌𝑖 + ln 𝜑𝑖 (𝑦) − ℎ𝑖 = 0
with the mole fractions 𝑦𝑖 related to the trial phase moles 𝑌𝑖 by
∑︁
𝑦𝑖 = 𝑌𝑖 / 𝑌𝑗
𝑗
With the two starting mixtures, the stationarity condition is solved using successive substitution to determine the sta-
tionary points. If both initial states converge to a solution which has 𝑔(𝑦) ≥ 0 then the mixture is deemed to be stable,
otherwise it is deemed unstable.
Phase labeling
Once it is confirmed that the fluid with composition 𝑧 is stable as a single phase at the current pressure and temperature, it
must be labeled as either ‘liquid’ or ‘vapor’. This is necessary only to apply the correct relative permeability function for
calculating the phase’s flow properties. The properties of the fluid (density, viscosity) are unchanged by the assignment
of the label.
Determining the mixture’s true critical point is the most rigorous method for labeling. It is however expensive and may
not always be necessary. As such, a simple correlation for pseudo-critical temperature is used and this is expected to
be sufficiently accurate for correct phase labeling, except under some specific conditions.
The Li-correlation is a weighted average of the component critical temperatures and is used to determine the label
applied to the mixture. The Li pseudo-critical temperature is calcaulated as
∑︀𝑁𝑐
𝑖=1 𝑇𝑐𝑖 𝑉𝑐𝑖 𝑧𝑖
𝑇𝑐𝑝 = ∑︀ 𝑁𝑐
𝑖=1 𝑉𝑐𝑖 𝑧𝑖
where 𝑉𝑐𝑖 and 𝑇𝑐𝑖 are respectively the critical volume and temperature of component 𝑖. This is compared to the current
temperature 𝑇 such that if 𝑇𝑐𝑝 < 𝑇 then the mixture is labeled as vapor and as liquid otherwise.
When a cell is identified as having an unstable mixture, it is necessary to determine the amounts in the liquid and vapor
phases through phase splitting. This phase split is calculated by ensuring that the two phases are in thermodynamic
equilibrium. For a system to be in thermodynamic equilibrium, the fugacities of each component in both the liquid and
vapor phases must be equal:
𝜑𝑖𝐿 = 𝜑𝑖𝑉 𝑖 = 1, 2, 3, . . . , 𝑁𝑐
where 𝜑𝑖𝐿 is the fugacity of component 𝑖 in the liquid phase and 𝜑𝑖𝐿 is the fugacity of component 𝑖 in the vapor phase.
Fugacities are functions of temperature, pressure, and composition:
and
6. If convergence is not achieved, successive substitution is used to update the set of K-values for the next iteration.
The new K-values at iteration 𝑡 + 1 are given by:
Parameters
The model represented by <CompositionalMultiphaseFluid> node in the input. Under the hood this is a wrapper
around PVTPackage library, which is included as a submodule. In order to use the model, GEOS must be built with
-DENABLE_PVTPACKAGE=ON (default).
The following attributes are supported:
Value Comment
oil Oil phase
gas Gas phase
water Water phase
Value Comment
PR Peng-Robinson EOS
SRK Soave-Redlich-Kwong EOS
Example
<Constitutive>
<CompositionalMultiphaseFluid name="fluid1"
phaseNames="{ oil, gas }"
equationsOfState="{ PR, PR }"
componentNames="{ N2, C10, C20, H2O }"
componentCriticalPressure="{ 34e5, 25.3e5, 14.6e5, 220.
˓→5e5 }"
References
• M. L. Michelsen, The Isothermal Flash Problem. Part I. Stability., Fluid Phase Equilibria, vol. 9.1, pp. 1-19,
1982a.
• M. L. Michelsen, The Isothermal Flash Problem. Part II. Phase-Split Calculation., Fluid Phase Equilibria, vol.
9.1, pp. 21-40, 1982b.
CO2-brine model
Summary
The CO2-brine model implemented in GEOS includes two components (CO2 and H2O) that are transported by one or
two fluid phases (the brine phase and the CO2 phase). We refer to the brine phase with the subscript ℓ and to the CO2
phase with the subscript 𝑔 (although the CO2 phase can be in supercritical, liquid, or gas state). The water component is
only present in the brine phase, while the CO2 component can be present in the CO2 phase as well as in the brine phase.
Thus, considering the molar phase component fractions, 𝑦𝑐,𝑝 (i.e., the fraction of the molar mass of phase 𝑝 represented
by component 𝑐) the following partition matrix determines the component distribution within the two phases:
[︂ ]︂
𝑦𝐻2𝑂,ℓ 𝑦𝐶𝑂2,ℓ
0 1
Once the phase fractions, phase component fractions, phase densities, phase viscosities–and their derivatives with
respect to pressure, temperature, and component fractions–have been computed, the Compositional Multiphase Flow
Solver proceeds to the assembly of the accumulation and flux terms. Note that the current implementation of the flow
solver is isothermal and that the derivatives with respect to temperature are therefore discarded.
The models that are used in steps 1) and 2) are reviewed in more details below.
Step 1: Computation of the phase fractions and phase component fractions (flash)
At initialization, GEOS performs a preprocessing step to construct a two-dimensional table storing the values of CO2
solubility in brine as a function of pressure, temperature, and a constant salinity. The user can parameterize the con-
struction of the table by specifying the salinity and by defining the pressure (𝑝) and temperature (𝑇 ) axis of the table
in the form:
Note that the pressures are in Pascal, temperatures are in Kelvin, and the salinity is a molality (moles of NaCl per kg of
brine). The temperature must be between 283.15 and 623.15 Kelvin. The table is populated using the model of Duan
and Sun (2003). Specifically, we solve the following nonlinear CO2 equation of state (equation (A1) in Duan and Sun,
2003) for each pair (𝑝, 𝑇 ) to obtain the reduced volume, 𝑉𝑟 .
where 𝑝𝑟 = 𝑝/𝑝𝑐𝑟𝑖𝑡 and 𝑇𝑟 = 𝑇 /𝑇𝑐𝑟𝑖𝑡 are respectively the reduced pressure and the reduced temperature. We refer the
reader to Table (A1) in Duan and Sun (2003) for the definition of the coefficients 𝑎𝑖 involved in the previous equation.
Using the reduced volume, 𝑉𝑟 , we compute the fugacity coefficient of CO2, ln𝜑 (𝑝, 𝑇 ), using equation (A6) of Duan
and Sun (2003). To conclude this preprocessing step, we use the fugacity coefficient of CO2 to compute and store the
solubility of CO2 in brine, 𝑠𝐶𝑂2 , using equation (6) of Duan and Sun (2003):
𝑦𝐶𝑂2 𝑃 Φ𝐶𝑂2 ∑︁ ∑︁ ∑︁
ln = − ln𝜑 (𝑝, 𝑇 ) + 2𝜆𝑐 𝑚 + 2𝜆𝑎 𝑚 + 𝜁𝑎,𝑐 𝑚2
𝑠𝐶𝑂2 𝑅𝑇 𝑐 𝑎 𝑎,𝑐
where Φ𝐶𝑂2 is the chemical potential of the CO2 component, 𝑅 is the gas constant, and 𝑚 is the salinity. The mole
fraction of CO2 in the vapor phase, 𝑦𝐶𝑂2 , is computed with equation (4) of Duan and Sun (2003). Note that the first,
third, fourth, and fifth terms in the equation written above are approximated using equation (7) of Duan and Sun (2003)
as recommended by the authors.
During the simulation, Step 1 starts with a look-up in the precomputed table to get the CO2 solubility, 𝑠𝐶𝑂2 , as a
function of pressure and temperature. Then, we compute the phase fractions as:
1 + 𝑠𝐶𝑂2
𝜈ℓ =
1 + 𝑧𝐶𝑂2 /(1 − 𝑧𝐶𝑂2 )
𝜈𝑔 = 1 − 𝜈ℓ
In GEOS, the computation of the CO2 phase density and viscosity is entirely based on look-up in precomputed tables.
The user defines the pressure (in Pascal) and temperature (in Kelvin) axis of the density table in the form:
This correlation is valid for pressures less than 8 × 108 Pascal and temperatures less than 1073.15 Kelvin. Using these
parameters, GEOS internally constructs a two-dimensional table storing the values of density as a function of pressure
and temperature. This table is populated as explained in the work of Span and Wagner (1996) by solving the following
nonlinear Helmholtz energy equation for each pair (𝑝, 𝑇 ) to obtain the value of density, 𝜌𝑔 :
𝑝
= 1 + 𝛿𝜑𝑟𝛿 (𝛿, 𝜏 )
𝑅𝑇 𝜌𝑔
where 𝑅 is the gas constant, 𝛿 := 𝜌𝑔 /𝜌𝑐𝑟𝑖𝑡 is the reduced CO2 phase density, and 𝜏 := 𝑇𝑐𝑟𝑖𝑡 /𝑇 is the inverse of the
reduced temperature. The definition of the residual part of the energy equation, denoted by 𝜑𝑟𝛿 , can be found in equation
(6.5), page 1544 of Span and Wagner (1996). The coefficients involved in the computation of 𝜑𝑟𝛿 are listed in Table
(31), page 1544 of Span and Wagner (1996). These calculations are done in a preprocessing step.
The pressure and temperature axis of the viscosity table can be parameterized in a similar fashion using the format:
This correlation is valid for pressures less than 3 × 108 Pascal and temperatures less than 1493.15 Kelvin. This table
is populated as explained in the work of Fenghour and Wakeham (1998) by computing the CO2 phase viscosity, 𝜇𝑔 , as
follows:
The “zero-density limit” viscosity, 𝜇0 (𝑇 ), is computed as a function of temperature using equations (3), (4), and (5),
as well as Table (1) of Fenghour and Wakeham (1998). The excess viscosity, 𝜇𝑒𝑥𝑐𝑒𝑠𝑠 (𝜌𝑔 , 𝑇 ), is computed as a function
of temperature and CO2 phase density (computed as explained above) using equation (8) and Table (3) of Fenghour
and Wakeham (1998). We currently neglect the critical viscosity, 𝜇𝑐𝑟𝑖𝑡 . These calculations are done in a preprocessing
step.
During the simulation, the update of CO2 phase density and viscosity is simply done with a look-up in the precomputed
tables.
The computation of the brine density involves a tabulated correlation presented in Phillips et al. (1981). The user
specifies the (constant) salinity and defines the pressure and temperature axis of the brine density table in the form:
The pressure must be in Pascal and must be less than 5 × 107 Pascal. The temperature must be in Kelvin and must be
between 283.15 and 623.15 Kelvin. The salinity is a molality (moles of NaCl per kg of brine). Using these parameters,
GEOS performs a preprocessing step to construct a two-dimensional table storing the brine density, 𝜌ℓ,𝑡𝑎𝑏𝑙𝑒 for the
specified salinity as a function of pressure and temperature using the expression:
𝜌ℓ,𝑡𝑎𝑏𝑙𝑒 = 𝐴 + 𝐵𝑥 + 𝐶𝑥2 + 𝐷𝑥3
𝑥 = 𝑐1 exp(𝑎1 𝑚) + 𝑐2 exp(𝑎2 𝑇 ) + 𝑐3 exp(𝑎3 𝑃 )
We refer the reader to Phillips et al. (1981), equations (4) and (5), pages 14 and 15 for the definition of the coefficients
involved in the previous equation. This concludes the preprocessing step.
Then, during the simulation, the brine density update proceeds in two steps. First, a table look-up is performed to
retrieve the value of density, 𝜌ℓ,𝑡𝑎𝑏𝑙𝑒 . Then, in a second step, the density is modified using the method of Garcia (2001)
to account for the presence of CO2 dissolved in brine as follows:
where 𝑀𝐶𝑂2 is the molecular weight of CO2, 𝑐𝐶𝑂2 is the concentration of CO2 in brine, and 𝑉𝜑 is the apparent molar
volume of dissolved CO2. The CO2 concentration in brine is obtained as:
𝑦𝐶𝑂2,ℓ 𝜌ℓ,𝑡𝑎𝑏𝑙𝑒
𝑐𝐶𝑂2 =
𝑀𝐻2𝑂 (1 − 𝑦𝐶𝑂2,ℓ )
where 𝑀𝐻2𝑂 is the molecular weight of water. The apparent molar volume of dissolved CO2 is computed as a function
of temperature using the expression:
The brine viscosity is controlled by a salinity parameter provided by the user in the form:
During the simulation, the brine viscosity is updated as a function of temperature using the analytical relationship of
Phillips et al. (1981):
𝜇ℓ = 𝑎𝑇 + 𝑏
Brine density 𝜌𝑙 is computed from pure water density 𝜌𝑤 at specified pressure and temperature corrected by Ezrokhi
correlation presented in Zaytsev and Aseyev (1993):
𝑙𝑜𝑔10 (𝜌𝑙 ) = 𝑙𝑜𝑔10 (𝜌𝑤 (𝑃, 𝑇 )) + 𝐴(𝑇 )𝑥𝐶𝑂2,ℓ
𝐴(𝑇 ) = 𝑎0 + 𝑎1 𝑇 + 𝑎2 𝑇 2 ,
where 𝑎0 , 𝑎1 , 𝑎2 are correlation coefficients defined by user:
DensityFun EzrokhiBrineDensity 𝑎0 𝑎1 𝑎2
While 𝑥𝐶𝑂2,ℓ is mass fraction of CO2 component in brine, computed from molar fractions as
𝑀𝐶𝑂2 𝑦𝐶𝑂2,ℓ
𝑥𝐶𝑂2,ℓ = ,
𝑀𝐶𝑂2 𝑦𝐶𝑂2,ℓ + 𝑀𝐻2𝑂 𝑦𝐻2𝑂,ℓ
Pure water density is computed according to:
where 𝑐𝑤 is water compressibility defined as a constant 4.5 × 10−10 𝑃 𝑎−1 , while 𝜌𝑤,𝑠𝑎𝑡 (𝑇 ) and 𝑃𝑤,𝑠𝑎𝑡 (𝑇 ) are density
and pressure of saturated water at a given temperature. Both are obtained through internally constructed tables tabulated
as functions of temperature and filled with the steam table data from Engineering ToolBox (2003, 2004).
Brine viscosity 𝜇ℓ is computed from pure water viscosity 𝜇𝑤 similarly:
ViscosityFun EzrokhiBrineViscosity 𝑏0 𝑏1 𝑏2
Mass fraction of CO2 component in brine 𝑥𝐶𝑂2,ℓ is exactly as in density calculation. The dependency of pure water
viscosity from pressure is ignored, and it is approximated as saturated pure water viscosity:
𝜇𝑤 (𝑃, 𝑇 ) = 𝜇𝑤,𝑠𝑎𝑡 (𝑇 ),
which is tabulated using internal table as a function of temperature based on steam table data Engineering ToolBox
(2004).
Parameters
Value Comment
gas CO2 phase
water Water phase
Value Component
co2,CO2 CO2 component
water,liquid Water component
Example
<Constitutive>
<CO2BrinePhillipsFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
flashModelParaFile="co2flash.txt"/>
</Constitutive>
<Constitutive>
<CO2BrineEzrokhiFluid
name="fluid"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
flashModelParaFile="co2flash.txt"/>
</Constitutive>
In the XML code listed above, “co2flash.txt” parameterizes the CO2 solubility table constructed in Step 1. The file
“pvtgas.txt” parameterizes the CO2 phase density and viscosity tables constructed in Step 2, the file “pvtliquid.txt”
parameterizes the brine density and viscosity tables according to Phillips or Ezrokhi correlation, depending on chosen
fluid model.
References
• Z. Duan and R. Sun, An improved model calculating CO2 solubility in pure water and aqueous NaCl solutions
from 273 to 533 K and from 0 to 2000 bar., Chemical Geology, vol. 193.3-4, pp. 257-271, 2003.
• R. Span and W. Wagner, A new equation of state for carbon dioxide covering the fluid region from the triple-point
temperature to 1100 K at pressure up to 800 MPa, J. Phys. Chem. Ref. Data, vol. 25, pp. 1509-1596, 1996.
• A. Fenghour and W. A. Wakeham, The viscosity of carbon dioxide, J. Phys. Chem. Ref. Data, vol. 27, pp.
31-44, 1998.
• S. L. Phillips et al., A technical databook for geothermal energy utilization, Lawrence Berkeley Laboratory report,
1981.
• J. E. Garcia, Density of aqueous solutions of CO2. No. LBNL-49023. Lawrence Berkeley National Laboratory,
Berkeley, CA, 2001.
• Zaytsev, I.D. and Aseyev, G.G. Properties of Aqueous Solutions of Electrolytes, Boca Raton, Florida, USA CRC
Press, 1993.
• Engineering ToolBox, Water - Density, Specific Weight and Thermal Expansion Coefficients, 2003
• Engineering ToolBox, Water - Dynamic (Absolute) and Kinematic Viscosity, 2004
Overview
The following paragraphs explain how the Brooks-Corey model is used to compute the phase relative permeabilities as
a function of volume fraction (i.e., saturation) with the expression:
𝜆ℓ
𝑘𝑟ℓ = 𝑘rℓ,max 𝑆ℓ,scaled ,
Parameters
The relative permeability constitutive model is listed in the <Constitutive> block of the input XML file. The relative
permeability model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegions> node.
The following attributes are supported:
• phaseNames - The number of phases can be either two or three. Note that for three-phase flow, this model does
not apply a special treatment to the intermediate phase relative permeability (no Stone or Baker interpolation).
Supported phase names are:
Value Phase
oil Oil phase
gas Gas phase
water Water phase
• phaseMinVolFraction - The list of minimum volume fractions 𝑆ℓ,𝑚𝑖𝑛 for each phase is specified in the same
order as in phaseNames. Below this volume fraction, the phase is assumed to be immobile.
• phaseRelPermExponent - The list of exponents 𝜆ℓ for each phase is specified in the same order as in
phaseNames.
• phaseMaxValue - The list of maximum values 𝑘rℓ,max for each phase is specified in the same order as in
phaseNames.
Examples
For a two-phase water-gas system (for instance in the CO2-brine fluid model), a typical relative permeability input
looks like:
<Constitutive>
...
<BrooksCoreyRelativePermeability
name="relPerm"
phaseNames="{ water, gas }"
phaseMinVolumeFraction="{ 0.02, 0.015 }"
phaseRelPermExponent="{ 2, 2.5 }"
phaseRelPermMaxValue="{ 0.8, 1.0 }"/>
...
</Constitutive>
For a three-phase oil-water-gas system (for instance in the Black-Oil fluid model), a typical relative permeability input
looks like:
<Constitutive>
...
<BrooksCoreyRelativePermeability
name="relPerm"
phaseNames="{ water, oil, gas }"
phaseMinVolumeFraction="{ 0.02, 0.1, 0.015 }"
phaseRelPermExponent="{ 2, 2, 2.5 }"
phaseRelPermMaxValue="{ 0.8, 1.0, 1.0 }"/>
...
</Constitutive>
Overview
For the simulation of three-phase flow in porous media, it is common to use a specific treatment (i.e., different from
the typical two-phase procedure) to evaluate the oil relative permeability. Specifically, the three-phase oil relative
permeability is obtained by interpolation of oil-water and oil-gas experimental data measured independently in two-
phase displacements.
Let 𝑘𝑟𝑤,𝑤𝑜 and 𝑘𝑟𝑜,𝑤𝑜 be the water-oil two-phase relative permeabilities for the water phase and the oil phase, re-
spectively. Let 𝑘𝑟𝑔,𝑔𝑜 and 𝑘𝑟𝑜,𝑔𝑜 be the oil-gas two-phase relative permeabilities for the gas phase and the oil phase,
respectively. In the current implementation, the two-phase relative permeability data is computed analytically using
the Brooks-Corey relative permeability model.
The water and gas three-phase relative permeabilities are simply given by two-phase data and only depend on 𝑆𝑤 and
𝑆𝑔 , respectively. That is,
This procedure provides a simple but effective formula avoiding the problems associated with the other interpolation
methods (negative values).
Another option can be triggered using threePhaseInterpolator to set interpolation model to be STONEII described by:
...
Parameters
The relative permeability constitutive model is listed in the <Constitutive> block of the input XML file. The relative
permeability model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegion> node.
The following attributes are supported:
Value Phase
oil Oil phase
gas Gas phase
water Water phase
• phaseMinVolFraction - The list of minimum volume fractions 𝑆ℓ,𝑚𝑖𝑛 for each phase is specified in the same
order as in phaseNames. Below this volume fraction, the phase is assumed to be immobile.
• waterOilRelPermExponent - The list of exponents 𝜆ℓ,𝑤𝑜 for the two-phase water-oil relative permeability
data, with the water exponent first and the oil exponent next. These exponents are then used to compute 𝑘𝑟ℓ,𝑤𝑜
in the Brooks-Corey relative permeability model.
• waterOilRelPermMaxValue - The list of maximum values 𝑘rℓ,𝑤𝑜,max for the two-phase water-oil relative per-
meability data, with the water max value first and the oil max value next. These exponents are then used to
compute 𝑘𝑟ℓ,𝑤𝑜 in the Brooks-Corey relative permeability model.
• gasOilRelPermExponent - The list of exponents 𝜆ℓ,𝑔𝑜 for the two-phase gas-oil relative permeability data,
with the gas exponent first and the oil exponent next. These exponents are then used to compute 𝑘𝑟ℓ,𝑔𝑜 in the
Brooks-Corey relative permeability model.
• gasOilRelPermMaxValue - The list of maximum values 𝑘rℓ,𝑔𝑜,max for the two-phase gas-oil relative permeabil-
ity data, with the gas max value first and the oil max value next. These exponents are then used to compute 𝑘𝑟ℓ,𝑔𝑜
in the Brooks-Corey relative permeability model.
Example
<Constitutive>
...
<BrooksCoreyBakerRelativePermeability name="relperm"
phaseNames="{oil, gas, water}"
phaseMinVolumeFraction="{0.05, 0.05, 0.05}"
waterOilRelPermExponent="{2.5, 1.5}"
waterOilRelPermMaxValue="{0.8, 0.9}"
gasOilRelPermExponent="{3, 3}"
gasOilRelPermMaxValue="{0.4, 0.9}"/>
...
</Constitutive>
Overview
The user can specify the relative permeabilities using tables describing a piecewise-linear relative permeability function
of volume fraction (i.e., saturation) for each phase. Depending on the number of fluid phases, this model is used as
follows:
• For two-phase flow, the user must specify two relative permeability tables, that is, one for the wetting-phase
relative permeability, and one for the non-wetting phase relative permeability. During the simulation, the relative
permeabilities are then obtained by interpolating in the tables as a function of phase volume fraction.
• For three-phase flow, following standard reservoir simulation practice, the user must specify four relative perme-
ability tables. Specifically, two relative permeability tables are required for the pair wetting-phase–intermediate
phase (typically, water-oil), and two relative permeability tables are required for the pair non-wetting-
phase–intermediate phase (typically, gas-oil). During the simulation, the relative permeabilities of the wetting
and non-wetting phases are computed by interpolating in the tables as a function of their own phase volume
fraction. The intermediate phase relative permeability is obtained by interpolating the two-phase relative perme-
abilities using the Baker interpolation procedure.
Parameters
The relative permeability constitutive model is listed in the <Constitutive> block of the input XML file. The relative
permeability model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegions> node.
The following attributes are supported:
wettingIntermedi- groupNameRef_array {}
ateRelPermTableNames
List of relative
permeability tables for the
pair (wetting phase,
intermediate phase)
The expected format is “{
wetting-
PhaseRelPermTable-
Name,
intermedi-
atePhaseRelPermTable-
Name }”, in that order
Note that this input is only
used for three-phase flow.
If you want to do a
two-phase simulation,
please use instead
wettingNonWettin-
gRelPermTableNames to
474 Chapter 1. Table
specify of names
the table Contents
wettingNonWettin- groupNameRef_array {}
gRelPermTableNames
GEOS Documentation
Value Phase
oil Oil phase
gas Gas phase
water Water phase
ò Note
We remind the user that the relative permeability must be a strictly increasing function of phase volume fraction.
GEOS throws an error when this condition is not satisfied.
Examples
For a two-phase water-gas system (for instance in the CO2-brine fluid model), a typical relative permeability input
looks like:
<Constitutive>
...
<TableRelativePermeability
name="relPerm"
phaseNames="{ water, gas }"
wettingNonWettingRelPermTableNames="{ waterRelativePermeabilityTable,␣
˓→gasRelativePermeabilityTable }"/>
...
</Constitutive>
ò Note
The name of the wetting-phase relative permeability table must be specified before the name of the non-wetting
phase relative permeability table.
For a three-phase oil-water-gas system (for instance in the Black-Oil fluid model), a typical relative permeability input
looks like:
<Constitutive>
...
<TableRelativePermeability
name="relPerm"
phaseNames="{ water, oil, gas }"
wettingIntermediateRelPermTableNames="{ waterRelativePermeabilityTable,␣
˓→oilRelativePermeabilityTableForWO }"
nonWettingIntermediateRelPermTableNames="{ gasRelativePermeabilityTable,␣
˓→oilRelativePermeabilityTableForGO }"/>
...
</Constitutive>
ò Note
For the wetting-phase–intermediate-phase pair, the name of the wetting-phase relative permeability table must be
specified first. For the non-wetting-phase–intermediate-phase pair, the name of the non-wetting-phase relative
permeability table must be specified first. If the results look incoherent, this is something to double-check.
The tables mentioned above by name must be defined in the <Functions> block of the XML file using the
<TableFunction> keyword.
Overview
In GEOS, the oil-phase pressure is assumed to be the primary pressure. The following paragraphs explain how the
Brooks-Corey capillary pressure model is used to compute the water-phase and gas-phase pressures as:
𝑝𝑤 = 𝑝𝑜 − 𝑃𝑐,𝑤 (𝑆𝑤 ),
and
𝑝𝑔 = 𝑝𝑜 + 𝑃𝑐,𝑔 (𝑆𝑔 ).
In the Brooks-Corey model, the water-phase capillary pressure is computed as a function of the water-phase volume
fraction with the following expression:
−1/𝜆
𝑃𝑐,𝑤 (𝑆𝑤 ) = 𝑝𝑒,𝑤 𝑆w,scaled𝑤 ,
𝑆𝑤 − 𝑆w,min
𝑆w,scaled = .
1 − 𝑆w,min − 𝑆o,min − 𝑆g,min
Parameters
The capillary pressure constitutive model is listed in the <Constitutive> block of the input XML file. The capillary
pressure model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegions> node.
The following attributes are supported:
Value Phase
oil Oil phase
gas Gas phase
water Water phase
• phaseMinVolFraction - The list of minimum volume fractions 𝑆ℓ,𝑚𝑖𝑛 for each phase is specified in the same
order as in phaseNames. Below this volume fraction, the phase is assumed to be immobile. The values entered
for this attribute have to match those of the same attribute in the relative permeability block.
• phaseCapPressureExponentInv - The list of exponents 𝜆ℓ for each phase is specified in the same order as in
phaseNames. The parameter corresponding to the oil phase is currently not used.
• phaseEntryPressure - The list of entry pressures 𝑝𝑒,ℓ for each phase is specified in the same order as in
phaseNames. The parameter corresponding to the oil phase is currently not used.
• capPressureEpsilon - This parameter is used for both the water-phase and gas-phase capillary pressure. To
avoid extremely large, or infinite, capillary pressure values, we set 𝑃𝑐,𝑤 (𝑆𝑤 ) := 𝑃𝑐,𝑤 (𝜖) whenever 𝑆𝑤 < 𝜖. The
gas-phase capillary pressure is treated analogously.
Example
<Constitutive>
...
<BrooksCoreyCapillaryPressure name="capPressure"
phaseNames="{oil, gas}"
phaseMinVolumeFraction="{0.01, 0.015}"
phaseCapPressureExponentInv="{0, 6}"
phaseEntryPressure="{0, 1e8}"
capPressureEpsilon="1e-8"/>
...
</Constitutive>
Overview
In GEOS, the oil-phase pressure is assumed to be the primary pressure. The following paragraphs explain how the Van
Genuchten capillary pressure model is used to compute the water-phase and gas-phase pressures as:
𝑝𝑤 = 𝑝𝑜 − 𝑃𝑐,𝑤 (𝑆𝑤 ),
and
𝑝𝑔 = 𝑝𝑜 + 𝑃𝑐,𝑔 (𝑆𝑔 ),
The Van Genuchten model computes the water-phase capillary pressure as a function of the water-phase volume fraction
as:
−1/𝑚
𝑤
𝑃𝑐 (𝑆𝑤 ) = 𝛼𝑤 (𝑆𝑤,𝑠𝑐𝑎𝑙𝑒𝑑 − 1)(1−𝑚𝑤 )/2 ,
𝑆𝑤 − 𝑆w,min
𝑆w,scaled = .
1 − 𝑆w,min − 𝑆o,min − 𝑆g,min
Parameters
The capillary pressure constitutive model is listed in the <Constitutive> block of the input XML file. The capillary
pressure model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegions> node.
The following attributes are supported:
Value Phase
oil Oil phase
gas Gas phase
water Water phase
• phaseMinVolFraction - The list of minimum volume fractions 𝑆ℓ,𝑚𝑖𝑛 for each phase is specified in the same
order as in phaseNames. Below this volume fraction, the phase is assumed to be immobile. The values entered
for this attribute have to match those of the same attribute in the relative permeability block.
• phaseCapPressureExponentInv - The list of exponents 𝑚ℓ for each phase is specified in the same order as in
phaseNames. The parameter corresponding to the oil phase is not used.
• phaseCapPressureMultiplier - The list of multipliers 𝛼ℓ for each phase is specified in the same order as in
phaseNames. The parameter corresponding to the oil phase is not used.
• capPressureEpsilon - The parameter 𝜖. This parameter is used for both the water-phase and gas-phase cap-
illary pressure. To avoid extremely large, or infinite, capillary pressure values, we set 𝑃𝑐,𝑤 (𝑆𝑤 ) := 𝑃𝑐,𝑤 (𝜖)
whenever 𝑆𝑤 < 𝜖. The gas-phase capillary pressure is treated analogously.
Example
<Constitutive>
...
<VanGenuchtenCapillaryPressure name="capPressure"
phaseNames="{ water, oil }"
phaseMinVolumeFraction="{ 0.1, 0.015 }"
phaseCapPressureExponentInv="{ 0.55, 0 }"
(continues on next page)
Overview
The user can specify the capillary pressures using tables describing a piecewise-linear capillary pressure function of
volume fraction (i.e., saturation) for each phase, except the reference phase for which capillary pressure is assumed to
be zero. Depending on the number of fluid phases, this model is used as follows:
• For two-phase flow, the user must specify one capillary pressure table. During the simulation, the capillary
pressure of the non-reference phase is computed by interpolating in the table as a function of the non-reference
phase saturation.
• For three-phase flow, the user must specify two capillary pressure tables. One capillary pressure table is required
for the pair wetting-phase–intermediate-phase (typically, water-oil), and one capillary pressure table is required
for the pair non-wetting-phase–intermediate-phase (typically, gas-oil). During the simulation, the former is used
to compute the wetting-phase capillary pressure as a function of the wetting-phase volume fraction and the latter
is used to compute the non-wetting-phase capillary pressure as a function of the non-wetting-phase volume
fraction. The intermediate phase is assumed to be the reference phase, and its capillary pressure is set to zero.
Below is a table summarizing the choice of reference pressure for the various phase combinations:
In all cases, the user-provided capillary pressure is used in GEOS to compute the phase pressure using the formula:
𝑃𝑐 = 𝑝𝑛𝑤 − 𝑝𝑤 .
where 𝑝𝑛𝑤 and 𝑝𝑤 are respectively the non-wetting-phase and wetting-phase pressures.
Parameters
The capillary pressure constitutive model is listed in the <Constitutive> block of the input XML file. The capillary
pressure model must be assigned a unique name via name attribute. This name is used to assign the model to regions
of the physical domain via a materialList attribute of the <ElementRegions> node.
The following attributes are supported:
wettingNonWettingCap- groupNameRef
PressureTableName
Capillary pressure table
[Pa] for the pair (wetting
phase, non-wetting phase)
Note that this input is only
used for two-phase flow.
If you want to do a
three-phase simulation,
please use instead
wettingIntermediateCap-
PressureTableName and
nonWettingIntermediate-
CapPressureTableName
to specify the table names
Value Phase
oil Oil phase
gas Gas phase
water Water phase
Examples
For a two-phase water-gas system (for instance in the CO2-brine fluid model), a typical capillary pressure input looks
like:
<Constitutive>
...
<TableCapillaryPressure
name="capPressure"
phaseNames="{ water, gas }"
wettingNonWettingCapPressureTableNames="waterCapillaryPressureTable"/>
...
</Constitutive>
For a three-phase oil-water-gas system (for instance in the Black-Oil fluid model), a typical capillary pressure input
looks like:
<Constitutive>
...
<TableCapillaryPressure
name="capPressure"
phaseNames="{ water, oil, gas }"
wettingIntermediateCapPressureTableName="waterCapillaryPressureTable"
nonWettingIntermediateCapPressureTableName="gasCapillaryPressureTable"/>
...
</Constitutive>
The tables mentioned above by name must be defined in the <Functions> block of the XML file using the
<TableFunction> keyword.
Porosity models
Pressure dependent porosity
Overview
This model assumes a simple exponential law for the porosity as function of pressure, i.e.
where 𝜑𝑟𝑒𝑓 is the reference porosity at reference pressure, 𝑝𝑟𝑒𝑓 , 𝑝 is the pressure and, 𝑐 is the compressibility.
Parameters
Example
<Constitutive>
...
<PressurePorosity name="rockPorosity"
referencePressure="1.0e27"
defaultReferencePorosity="0.3"
compressibility="1.0e-9"/>
...
</Constitutive>
Overview
According to the poroelasticity theory, the porosity (pore volume), 𝜑, can be computed as
Here, 𝜑𝑟𝑒𝑓 is the porosity at a reference state with pressure 𝑝𝑟𝑒𝑓 and volumetric strain 𝜖𝑣, 𝑟𝑒𝑓 . Additionally, 𝛼 is the Biot
coefficient, 𝜖𝑣 is the volumetric strain, 𝑝 is the fluid pressure and 𝑁 = 𝛼−𝜑
𝐾𝑠
𝑟𝑒𝑓
, where 𝐾𝑠 is the grain bulk modulus.
Parameters
The Biot Porosity Model can be called in the <Constitutive> block of the input XML file. This porosity model must
be assigned a unique name via the name attribute. This name is used to assign the model to regions of the physical
domain via a materialList attribute in the <ElementRegions> block.
The following attributes are supported:
Example
<Constitutive>
...
<BiotPorosity name="rockPorosity"
grainBulkModulus="1.0e27"
defaultReferencePorosity="0.3"/>
...
</Constitutive>
Permeability models
Constant Permeability Model
Overview
This model is used to define a diagonal permeability tensor that does not depend on any primary variable.
Parameters
Example
<Constitutive>
...
<ConstantPermeability name="matrixPerm"
permeabilityComponents="{1.0e-12, 1.0e-12, 1.0e-12}"/>
...
</Constitutive>
Overview
This stress-dependent permeability model assumes a simple exponential law for the fracture permeability as function
of the effective normal stress acting on the fracture surface (Gutierrez et al., 2000):
𝑘 = 𝑘𝑖 exp(−𝐶𝜎𝑛 ′ )
where 𝑘𝑖 is the initial unstressed fracture permeability; 𝐶 is an empirical constant; 𝜎𝑛 ′ is the effective normal stress.
Parameters
The Exponential Decay Permeability model can be called in the <Constitutive> block of the input XML
file. This permeability model must be assigned a unique name via the name attribute. This name is
used to assign the model to regions of the physical domain via a permeabilityModelName attribute in the
<CompressibleSolidExponentialDecayPermeability> block.
The following attributes are supported:
Example
<Constitutive>
...
<ExponentialDecayPermeability
name="fracturePerm"
empiricalConstant="0.27"
initialPermeability="{1e-15, 1e-15, 1e-15}"/>
...
</Constitutive>
Overview
In the Kozeny-Carman model (see ref), the permeability of a porous medium is governed by several key parameters,
including porosity, grain size, and grain shape:
(𝑠𝜖 𝐷𝑝 )2 𝜑3
𝑘=
150(1 − 𝜑)2
where 𝑠𝜖 is the sphericity of the particles, 𝐷𝑝 is the particle diameter, 𝜑 is the porosity of the porous medium.
Parameters
The Kozeny-Carman Permeability Model can be called in the <Constitutive> block of the input XML file. This
permeability model must be assigned a unique name via the name attribute. This name is used to assign the model to
regions of the physical domain via a materialList attribute in the <ElementRegions> block.
The following attributes are supported:
Example
<Constitutive>
...
<CarmanKozenyPermeability name="matrixPerm"
particleDiameter="0.0002"
sphericity="1.0"/>
...
</Constitutive>
Overview
The parallel plates permeability model defines the relationship between the hydraulic fracture aperture and its corre-
sponding permeability following the classic lubrication model (Witherspoon et al. ) . In this model, the two fracture
walls are assumed to be smooth and parallel to each other and separated by a uniform aperture.
𝑎3
𝑘=
12
where 𝑎 denotes the hydraulic fracture aperture.
Remark: 𝑘, dimensionally, is not a permeability (as it is expressed in 𝑚3 ).
Parameters
The Parallel Plates Permeability Model can be called in the <Constitutive> block of the input XML file. This
permeability model must be assigned a unique name via the name attribute. This name is used to assign the model to
regions of the physical domain via a materialList attribute in the <ElementRegions> block.
The following attributes are supported:
Overview
The slip dependent permeability model defines the relationship between the relative shear displacement and fracture
permeability. In this model, fractrues/faults are represented as slip interfaces.
[︂ (︂ )︂ ]︂
𝑈𝑠
𝑘 = 𝑘𝑖 (𝑀𝑚𝑢𝑙𝑡 − 1)tanh 3 +1
𝑈𝑠𝑡ℎ𝑟𝑒𝑠ℎ𝑜𝑙𝑑
where 𝑘𝑖 is the initial fracture permeability; 𝑀𝑚𝑢𝑙𝑡 is the maximum permeability multiplier; 𝑈𝑠 is the relative shear
displacement; 𝑈𝑠𝑡ℎ𝑟𝑒𝑠ℎ𝑜𝑙𝑑 is the slip threshold.
Parameters
The Slip Dependent Permeability model can be called in the <Constitutive> block of the input XML
file. This permeability model must be assigned a unique name via the name attribute. This name is
used to assign the model to regions of the physical domain via a permeabilityModelName attribute in the
<CompressibleSolidSlipDependentPermeability> block.
The following attributes are supported:
Example
<Constitutive>
...
(continues on next page)
Overview
In the Willis-Richards permeability model, the stress-aperture relationship is derived based on Barton–Bandis consti-
tutive model. In this model, fracture hydraulic aperture is assumed to be a function of effective normal stress acting on
the fracture surface and shear displacement along the fracture surface (Willis-Richards et al., 1996).
𝑎𝑚 + 𝑈𝑠 tan (𝜑𝑑𝑖𝑙 )
𝑎=
1 + 9 𝜎𝜎𝑟𝑒𝑓
𝑛
Based on the assumption of parallel plates, the correlation between fracture hydraulic aperture and its corresponding
permeability is defined as:
𝑎2
𝑘=
12
where
𝑎 is the fracture hydraulic aperture; 𝑎𝑚 is the fracture aperture at zero contact stress; 𝑈𝑠 is the relative shear
displacement; 𝜑𝑑𝑖𝑙 is the shear dilation angle; 𝜎𝑛 is the effective normal stress acting on the fracture surface;
𝜎𝑟𝑒𝑓 is the effective normal stress that causes a 90% reduction in the fracture hydraulic aperture.
Parameters
The Willis-Richards permeability model is called in the <Constitutive> block of the input XML file.
This permeability model must be assigned a unique name via the name attribute. This name is used
to attach the model to regions of the physical domain via a permeabilityModelName attribute in the
<CompressibleSolidWillisRichardsPermeability> block.
The following attributes are supported:
Example
<Constitutive>
...
(continues on next page)
Porous Solids
Overview
Simulation of fluid flow in porous media and of poromechanics, requires to define, along with fluid properties, the
hydrodynamical properties of the solid matrix. Thus, for porous media flow and and poromecanical simulation in
GEOS, two types of composite constitutive models can be defined to specify the characteristics of a porous material:
(1) a CompressibleSolid model, used for flow-only simulations and which assumes that all poromechanical effects can
be represented by the pressure dependency of the porosity; (2) a PorousSolid model which, instead, allows to couple
any solid model with a BiotPorosity model and to include permeability’s dependence on the mechanical response.
Both these composite models require the names of the solid, porosity and permeability models that, combined, define
the porous material. The following sections outline how these models can be defined in the Constitutive block of the
xml input files and which type of submodels they allow for.
CompressibleSolid
This composite constitutive model requires to define a NullModel as solid model (since no mechanical properties are
used), a PressurePorosity model and any type of Permeability model.
To define this composite model the keyword CompressibleSolid has to be appended to the name of the permeability
model of choice, as shown in the following example for the ConstantPermeability model.
<Constitutive>
<CompressibleSolidConstantPermeability name="porousRock"
solidModelName="nullSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPermeability"/>
<NullModel name="nullSolid"/>
<PressurePorosity name="rockPorosity"
referencePressure="1.0e27"
defaultReferencePorosity="0.3"
compressibility="1.0e-9"/>
<ConstantPermeability name="rockPermeability"
permeabilityComponents="{ 1.0e-4, 1.0e-4, 1.0e-4 }"/>
</Constitutive>
PorousSolid
To run poromechanical problems, the total stress is decomposed into an “effective stress” (driven by mechanical de-
formations) and a pore fluid pressure component, following the Biot theory of poroelasticity. For single-phase flow, or
multiphase problems with no capillarity, this decomposition reads
where 𝜎𝑖𝑗 is the 𝑖𝑗 component of the total stress tensor, 𝜎′𝑖𝑗 is the 𝑖𝑗 component of the effective (Cauchy) stress tensor,
𝑏 is Biot’s coefficient, 𝑝 is fluid pressure, and 𝛿 is the Kronecker delta.
The PorousSolid models simply append the keyword Porous in front of the solid model they contain, e.g., PorousE-
lasticIsotropic, PorousDruckerPrager, and so on. Additionally, they require to define a BiotPorosity model and a Con-
stantPermeability model. For example, a Poroelastic material with a certain permeability can be defined as
<Constitutive>
<PorousElasticIsotropic name="porousRock"
porosityModelName="rockPorosity"
solidModelName="rockSkeleton"
permeabilityModelName="rockPermeability"/>
<ElasticIsotropic name="rockSkeleton"
defaultDensity="0"
defaultYoungModulus="1.0e4"
defaultPoissonRatio="0.2"/>
<BiotPorosity name="rockPorosity"
grainBulkModulus="1.0e27"
defaultReferencePorosity="0.3"/>
<ConstantPermeability name="rockPermeability"
permeabilityComponents="{ 1.0e-4, 1.0e-4, 1.0e-4 }"/>
</Constitutive>
Note that any of the previously described solid models is used by the PorousSolid model to compute the effective stress,
leading to either poro-elastic, poro-plastic, or poro-damage behavior depending on the specific model chosen.
In this model, solid volumetric specific heat capacity is assumed to be a linear function of temperature:
𝑑𝐶
𝐶 = 𝐶0 + (𝑇 − 𝑇0 )
𝑑𝑇
where
𝐶 is the solid volumetric heat capacity at temperature T; 𝐶0 is the reference solid volumetric heat capacity at the
reference temperature; 𝑇0 is the reference temperature; 𝑑𝐶𝑑𝑇 is the gradient of the volumetric heat capacity with
respect to temperature, which equals to zero for the cases with constant solid volumetric heat capacity;
Parameters
The temperature-dependent solid volumetric heat capacity model is called in the <SolidInternalEnergy> block
of the input XML file. This model must be assigned a unique name via the name attribute. This name is used
to attach the model to regions of the physical domain via a solidInternalEnergyModelName attribute in the
<CompressibleSolidConstantPermeability> block.
Example
<Constitutive>
...
<SolidInternalEnergy
name="rockInternalEnergy"
referenceVolumetricHeatCapacity="4.56e6"
dVolumetricHeatCapacity_dTemperature="1e6"
referenceTemperature="0"
referenceInternalEnergy="0"/>
...
</Constitutive>
In this model, thermal conductivity of porous medium is defined as a linear function of temperature:
𝑑𝑘
𝑘 = 𝑘0 + (𝑇 − 𝑇0 )
𝑑𝑇
where
𝑘 is the thermal conductivity at temperature T, which is a vector; 𝑘0 is the reference thermal conductivity at
the reference temperature; 𝑇0 is the reference temperature; 𝑑𝑇𝑑𝑘
is the gradient of the thermal conductivity with
respect to temperature, which equals to zero for the cases with constant thermal conductivity; note that this term
is also in vector form, whose components could vary with directions.
Parameters
Example
<Constitutive>
...
<SinglePhaseThermalConductivity
name="thermalCond_nonLinear"
defaultThermalConductivityComponents="{ 1.5, 1.5, 1.5 }"
thermalConductivityGradientComponents="{ -12e-4, -12e-4, -12e-4 }"
referenceTemperature="20"/>
...
</Constitutive>
In an input XML file, constitutive models are listed in the <Constitutive> block. Each parameterized model has
its own XML tag, and each must be assigned a unique name via the name attribute. Names are used to assign models
to regions of the physical domain via the materialList attribute of the <CellElementRegion> node (see XML
Element: ElementRegions). In some cases, physics solvers must also be assigned specific constitutive models to use
(see Physics Solvers).
A typical <Constitutive> and <ElementRegions> block will look like:
<Problem>
<Constitutive>
</Constitutive>
<ElementRegions>
</ElementRegions>
</Problem>
PVT Driver
Table of Contents
• PVT Driver
– Introduction
– XML Structure
– Parameters
• XML Element: PVTDriver
– Output Format
– Unit Testing
Introduction
When calibrating fluid material parameters to experimental or other reference data, it can be a hassle to launch a full
flow simulation just to confirm density, viscosity, and other fluid properties are behaving as expected. Instead, GEOS
provides a PVTDriver allowing the user to test fluid property models for a well defined set of pressure, temperature,
and composition conditions. The driver itself is launched like any other GEOS simulation, but with a particular XML
structure:
./bin/geosx -i myFluidTest.xml
This driver will work for any multi-phase fluid model (e.g. black-oil, co2-brine, compositional multiphase) enabled
within GEOS.
XML Structure
A typical XML file to run the driver will have several key elements. Here, we will walk through an example file included
in the source tree at
src/coreComponents/unitTests/constitutiveTests/testPVT_docExample.xml
The first thing to note is that the XML file structure is identical to a standard GEOS input deck. In fact, once the
constitutive block is calibrated, one could start adding solver and discretization blocks to the same file to create a
proper field simulation. This makes it easy to go back and forth between calibration and simulation.
The first step is to define a parameterized fluid model to test. Here, we create a particular type of CO2-Brine mixture:
<Constitutive>
<CO2BrinePhillipsFluid
name="co2Mixture"
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
phasePVTParaFiles="{ testPVT_data/carbonDioxidePVT.txt, testPVT_data/brinePVT.txt }
˓→"
flashModelParaFile="testPVT_data/carbonDioxideFlash.txt"/>
</Constitutive>
We also define two time-history functions for the pressure (Pascal units) and temperature (Kelvin units) conditions we
want to explore.
<Functions>
<TableFunction
name="pressureFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 1.0 }"
values="{ 1e6, 50e6 }"/>
<TableFunction
name="temperatureFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 1.0 }"
values="{ 350, 350 }"/>
</Functions>
Note that the time-axis here is just a pseudo-time, allowing us to parameterize arbitrarily complicated paths through a
(pressure,temperature) diagram. The actual time values have no impact on the resulting fluid properties. Here, we fix
the temperature at 350K and simply ramp up pressure from 1 MPa to 50 MPa:
A PVTDriver is then added as a Task, a particular type of executable event often used for simple actions.
<Tasks>
<PVTDriver
name="testCO2"
fluid="co2Mixture"
feedComposition="{ 1.0, 0.0 }"
pressureControl="pressureFunction"
temperatureControl="temperatureFunction"
steps="49"
output="pvtOutput.txt"
logLevel="1"/>
</Tasks>
The driver itself takes as input the fluid model, the pressure and temperature control functions, and a “feed composition.”
The latter is the mole fraction of each component in the mixture to be tested. The steps parameter controls how many
steps are taken along the parametric (P,T) path. Results will be written in a simple ASCII table format (described
below) to the file output. The logLevel parameter controls the verbosity of log output during execution.
The driver task is added as a SoloEvent to the event queue. This leads to a trivial event queue, since all we do is
launch the driver and then quit.
<Events
maxTime="1">
<SoloEvent
name="eventA"
target="/Tasks/testCO2"/>
</Events>
Internally, the driver uses a simple form of time-stepping to advance through the (P,T) steps. This timestepping is
handled independently of the more complicated time-stepping pattern used by physics Solvers and coordinated by
the EventManager. In particular, in the XML file above, the maxTime parameter in the Events block is an event
manager control, controlling when/if certain events occur. Once launched, the PVTDriver internally determines its
own max time and timestep size using a combination of the input functions’ time coordinates and the requested number
of loadsteps. It is therefore helpful to think of the driver as an instantaneous event (from the event manager’s point of
view), but one which has a separate, internal clock.
Parameters
The key XML parameters for the PVTDriver are summarized in the following table:
Output Format
The output key is used to identify a file to which the results of the simulation are written. If this key is omitted, or the
user specifies output="none", file output will be suppressed. The file is a simple ASCII format with a brief header
followed by test data:
# column 1 = time
# column 2 = pressure
# column 3 = temperature
# column 4 = density
# columns 5-6 = phase fractions
# columns 7-8 = phase densities
# columns 9-10 = phase viscosities
0.0000e+00 1.0000e+06 3.5000e+02 1.5581e+01 1.0000e+00 4.1138e-11 1.5581e+01 1.0033e+03␣
˓→1.7476e-05 9.9525e-04
...
Note that the number of columns will depend on how many phases and components are present. In this case, we have a
two-phase, two-component mixture. The total density is reported in column 4, while phase fractions, phase densities,
and phase viscosities are reported in subsequent columns. If the outputCompressibility flag is activated, an extra
column will be added for the total fluid compressibility after the density. This is defined as 𝑐𝑡 = 𝜌1𝑡 (𝜕𝜌𝑡 /𝜕𝑃 ) where
𝜌𝑡 is the total density. If the outputMassDensity flag is activated, extra columns will be added for the mass density
of each phase. The number of columns will also depend on whether the outputPhaseComposition flag is activated
or not. If it is activated, there will be an extra column for the mole fraction of each component in each phase. The
phase order will match the one defined in the input XML (here, the co2-rich phase followed by the water-rich phase).
This file can be readily plotted using any number of plotting tools. Each row corresponds to one timestep of the driver,
starting from initial conditions in the first row.
Unit Testing
The development team also uses the PVTDriver to perform unit testing on the various fluid models within GEOS.
The optional argument baseline can be used to point to a previous output file that has been validated (e.g. against
experimental benchmarks or reference codes). If such a file is specified, the driver will perform a testing run and then
compare the new results against the baseline. In this way, any regressions in the fluid models can be quickly identified.
Developers of new models are encouraged to add their own baselines to src/coreComponents/constitutive/
unitTests. Adding additional tests is straightforward:
1. Create a new xml file for your test in src/coreComponents/constitutive/unitTests or (easier) add extra
blocks to the existing XML at src/coreComponents/constitutive/unitTests/testPVT.xml. For new XMLs,
we suggest using the naming convention testPVT_myTest.xml, so that all tests will be grouped together alphabet-
ically. Set the output file to testPVT_myTest.txt, and run your test. Validate the results however is appropriate.
If you have reference data available for this validation, we suggest archiving it in the testPVT_data/ subdirectory,
with a description of the source and formatting in the file header. Several reference datasets are included already as
examples. This directory is also a convenient place to store auxiliary input files like PVT tables.
2. This output file will now become your new baseline. Replace the output key with baseline so that the driver can
read in your file as a baseline for comparison. Make sure there is no remaining output key, or set output=none, to
suppress further file output. While you can certainly write a new output for debugging purposes, during our automated
unit tests we prefer to suppress file output. Re-run the driver to confirm that the comparison test passes.
3. Modify src/coreComponents/constitutive/unitTests/CMakeLists.txt to enable your new test in the unit
test suite. In particular, you will need to add your new XML file to the existing list in the gtest_pvt_xmls variable.
Note that if you simply added your test to the existing testPVT.xml file, no changes are needed.
set( gtest_pvt_xmls
testPVT.xml
testPVT_myTest.xml
)
4. Run make in your build directory to make sure the CMake syntax is correct
5. Run ctest -V -R PVT to run the PVT unit tests. Confirm your test is included and passes properly.
If you run into troubles, do not hesitate to contact the development team for help.
Triaxial Driver
Table of Contents
• Triaxial Driver
– Introduction
– XML Structure
• XML Element: TriaxialDriver
– Test Modes
– Output Format
– Model Convergence
– Unit Testing
Introduction
When calibrating solid material parameters to experimental data, it can be a hassle to launch a full finite element
simulation to mimic experimental loading conditions. Instead, GEOS provides a TriaxialDriver allowing the user
to run loading tests on a single material point. This makes it easy to understand the material response and fit it to lab
data. The driver itself is launched like any other GEOS simulation, but with a particular XML structure:
./bin/geosx -i myTest.xml
XML Structure
A typical XML file to run the triaxial driver will have the following key elements. We present the whole file first, before
digging into the individual blocks.
<Problem>
<Tasks>
<TriaxialDriver
name="triaxialDriver"
material="drucker"
(continues on next page)
<Events
maxTime="1">
<SoloEvent
name="triaxialDriver"
target="/Tasks/triaxialDriver"/>
</Events>
<Constitutive>
<ExtendedDruckerPrager
name="drucker"
defaultDensity="2700"
defaultBulkModulus="500"
defaultShearModulus="300"
defaultCohesion="0.0"
defaultInitialFrictionAngle="15.27"
defaultResidualFrictionAngle="23.05"
defaultDilationRatio="1.0"
defaultHardening="0.001"/>
</Constitutive>
<Functions>
<TableFunction
name="strainFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 3.0, 4.0, 7.0, 8.0 }"
values="{ 0, -0.003, -0.002, -0.005, -0.004 }"/>
<TableFunction
name="stressFunction"
inputVarNames="{ time }"
coordinates="{ 0.0, 8.0 }"
values="{ -1.0, -1.0 }"/>
</Functions>
<!-- Mesh is not used, but GEOSX throws an error without one. Will resolve soon-->
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0, 1 }"
yCoords="{ 0, 1 }"
zCoords="{ 0, 1 }"
(continues on next page)
<ElementRegions>
<CellElementRegion
name="dummy"
cellBlocks="{ * }"
materialList="{ dummy }"/>
</ElementRegions>
</Problem>
The first thing to note is that the XML structure is identical to a standard GEOS input deck. In fact, once the constitutive
block is calibrated, one could start adding solver and discretization blocks to the same file to create a proper field
simulation. This makes it easy to go back and forth between calibration and simulation.
The TriaxialDriver is added as a Task, a particular type of executable event often used for simple actions. It is
added as a SoloEvent to the event queue. This leads to a trivial event queue, since all we do is launch the driver and
then quit.
Internally, the triaxial driver uses a simple form of time-stepping to advance through the loading steps, allowing for both
rate-dependent and rate-independent models to be tested. This timestepping is handled independently from the more
complicated time-stepping pattern used by physics Solvers and coordinated by the EventManager. In particular,
in the XML file above, the maxTime parameter in the Events block is an event manager control, controlling when/if
certain events occur. Once launched, the triaxial driver internally determines its own max time and timestep size using
a combination of the strain function’s time coordinates and the requested number of loadsteps. It is therefore helpful
to think of the driver as an instantaneous event (from the event manager’s point of view), but one which has a separate,
internal clock.
The key parameters for the TriaxialDriver are:
ò Note
GEOS uses the engineering sign convention where compressive stresses and strains are negative. This is one of
the most frequent issues users make when calibrating material parameters, as stress- and strain-like quantities often
need to be negative to make physical sense. You may note in the XML above, for example, that stressFunction
and strainFunction have negative values for a compressive test.
Test Modes
The most complicated part of the driver is understanding how the stress and strain functions are applied in different
testing modes. The driver mimics laboratory core tests, with loading controlled in the axial and radial directions.
These conditions may be either strain-controlled or stress-controlled, with the user providing time-dependent functions
to describe the loading. The following table describes the available test modes in detail:
Note that a classical triaxial test can be described using either the stressControl or mixedControl mode. We
recommend using the mixedControl mode when possible, because this almost always leads to well-posed loading
conditions. In a pure stress controlled test, it is possible for the user to request that the material sustain a load beyond
its intrinsic strength envelope, in which case there is no feasible solution and the driver will fail to converge. Imagine,
for example, a perfectly plastic material with a yield strength of 10 MPa, but the user attempts to load it to 11 MPa.
A volumetric test can be created by setting the axial and radial control functions to the same time history function.
Similarly, an oedometer test can be created by setting the radial strain to zero.
The user should be careful to ensure that the initial stress set via the initialStress value is consistent any applied
stresses set through axial or radial loading functions. Otherwise, the material may experience sudden and unexpected
deformation at the first timestep because it is not in static equilibrium.
Output Format
The output key is used to identify a file to which the results of the simulation are written. If this key is omitted, or the
user specifies output="none", file output will be suppressed. The file is a simple ASCII format with a brief header
followed by test data:
# column 1 = time
# column 2 = axial_strain
# column 3 = radial_strain_1
# column 4 = radial_strain_2
# column 5 = axial_stress
# column 6 = radial_stress_1
# column 7 = radial_stress_2
# column 8 = newton_iter
# column 9 = residual_norm
0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 -1.0000e+00 -1.0000e+00 -1.0000e+00 0.
˓→0000e+00 0.0000e+00
1.6000e-01 -1.6000e-04 4.0000e-05 4.0000e-05 -1.1200e+00 -1.0000e+00 -1.0000e+00 2.
˓→0000e+00 0.0000e+00
3.2000e-01 -3.2000e-04 8.0000e-05 8.0000e-05 -1.2400e+00 -1.0000e+00 -1.0000e+00 2.
˓→0000e+00 0.0000e+00
...
This file can be readily plotted using any number of plotting tools. Each row corresponds to one timestep of the driver,
starting from initial conditions in the first row.
We note that the file contains two columns for radial strain and two columns for radial stress. For an isotropic material,
the stresses and strains along the two radial axes will usually be identical. We choose to output this way, however, to
accommodate both anisotropic materials and true-triaxial loading conditions. In these cases, the stresses and strains in
the radial directions could potentially differ.
These columns can be added and subtracted to produce other quantities of interest, like mean stress or deviatoric stress.
For example, we can plot the output produce stress / strain curves (in this case for a plastic rather than simple elastic
material):
In this plot, we have reversed the sign convention to be consistent with typical experimental plots. Note also that the
strainFunction includes two unloading cycles, allowing us to observe both plastic loading and elastic unloading.
Model Convergence
The last two columns of the output file contain information about the convergence behavior of the material driver. In
triaxial mode, the mixed nature of the stress/strain control requires using a Newton solver to converge the solution.
This last column reports the number of Newton iterations and final residual norm. Large values here would be indica-
tive of the material model struggling (or failing) to converge. Convergence failures can result from several reasons,
including:
1. Inappropriate material parameter settings
Unit Testing
The development team also uses the Triaxial Driver to perform unit testing on the various material models within
GEOS. The optional argument baseline can be used to point to a previous output file that has been validated (e.g.
against analytical or experimental benchmarks). If such a file is specified, the driver will perform a loading run and
then compare the new results against the baseline. In this way, any regressions in the material models can be quickly
identified.
Developers of new models are encouraged to add their own baselines to src/coreComponents/constitutive/
unitTests. Adding additional tests is straightforward:
1. Create a new xml file for your test in src/coreComponents/constitutive/unitTests. There are sev-
eral examples is this directory already to use as a template. We suggest using the naming convention
testTriaxial_myTest.xml, so that all triaxial tests will be grouped together alphabetically. Set the output
file to testTriaxial_myTest.txt, and run your test. Validate the results however is appropriate.
2. This output file will now become your new baseline. Replace the output key with baseline so that the
driver can read in your file as a baseline for comparison. Make sure there is no remaining output key, or
set output=none, to suppress further file output. While you can certainly write a new output for debugging
purposes, during our automated unit tests we prefer to suppress file output. Re-run the triaxial driver to confirm
that the comparison test passes.
3. Modify src/coreComponents/constitutive/unitTests/CMakeLists.txt to enable your new test in
the unit test suite. In particular, you will need to add your new XML file to the existing list in the
gtest_triaxial_xmls variable:
set( gtest_triaxial_xmls
testTriaxial_elasticIsotropic.xml
testTriaxial_druckerPragerExtended.xml
testTriaxial_myTest.xml
)
4. Run make in your build directory to make sure the CMake syntax is correct
5. Run ctest -V -R Triax to run the triaxial unit tests. Confirm your test is included and passes properly.
If you run into troubles, do not hesitate to contact the development team for help.
The user can request an initialization procedure enforcing a hydrostatic equilibrium for flow simulations and for coupled
flow and mechanics simulations. The hydrostatic initialization is done by placing one or more HydrostaticEquilibrium
tag(s) in the FieldSpecifications block of the XML input file. This initialization procedure is described below in the
context of single-phase and compositional multiphase flow. At the end of this document, we compare the hydrostatic
equilibrium method to another initialization method, based on the input of x-y-z tables.
For single-phase flow, the HydrostaticEquilibrium initialization procedure requires the following user input parame-
ters:
• datumElevation: the elevation (in meters) at which the datum pressure is enforced. The user must ensure that
the datum elevation is within the elevation range defined by the input mesh. GEOS issues a warning if this is not
the case.
• datumPressure: the pressure value (in Pascal) enforced by GEOS at the datum elevation.
• objectPath: the path defining the groups on which the hydrostatic equilibrium is computed. We recommend
using ElementRegions to apply the hydrostatic equilibrium to all the cells in the mesh. Alternatively, the
format ElementRegions/NameOfRegion/NameOfCellBlock can be used to select only a cell block on which
the hydrostatic equilibrium is computed.
ò Note
In GEOS, the z-axis is positive going upward, this is why the attributes listed in this page are expressed as a function
of elevation, not depth.
Using these parameters and the pressure-density constitutive relationship, GEOS uses a fixed-point iteration scheme
to populate a table of hydrostatic pressures as a function of elevation. The fixed-point iteration scheme uses two
optional attributes: equilibriumTolerance, the absolute tolerance to declare that the algorithm has converged, and
maxNumberOfEquilibrationTolerance, the maximum number of iterations for a given elevation in the fixed point
iteration scheme.
In addition, the elevation spacing of the hydrostatic pressure table is set with the optional
elevationIncrementInHydrostaticPressureTable parameter (in meters), whose default value is 0.6096
meters. Then, once the table is fully constructed, the hydrostatic pressure in each cell is obtained by interpolating in
the hydrostatic pressure table using the elevation at the center of the cell.
ò Note
The initialization algorithm assumes that the gravityVector (defined in the Solvers XML tag) is aligned with the
z-axis. If this is not the case, GEOS terminates the simulation when the HydrostaticEquilibrium tag is detected
in the XML file.
For compositional multiphase flow, the HydrostaticEquilibrium initialization procedure follows the same logic but
requires more input parameters. In addition to the required datumElevation, datumPressure, and objectPath
parameters listed above, the user must specify:
• componentNames: the names of the components present in the fluid model. This field is used to make sure
that the components provided to HydrostaticEquilibrium are consistent with the components listed in the fluid
model of the Constitutive block.
• componentFractionVsElevationTableNames: the names of 𝑛𝑐 tables (where 𝑛𝑐 is the number of compo-
nents) specifying the component fractions as a function of elevation. There must be one table name per compo-
nent, and the table names must be listed in the same order as the components in componentNames.
• temperatureVsElevationTableName: the names of the table specifying the temperature (in Kelvin) as a
function of elevation.
• initialPhaseName: the name of the phase initially saturating the domain. The other phases are assumed to be
at residual saturation at the beginning of the simulation.
These parameters are used with the fluid density model (depending for compositional flow on pressure, component
fractions, and in some cases, temperature) to populate the hydrostatic pressure table, and later initialize the pressure in
each cell.
ò Note
The current initialization algorithm has an important limitation and does not support initial phase contacts (e.g.,
water-oil, gas-oil, or water-gas contacts). The implementation assumes only one mobile phase in the initial system,
identified by the initialPhaseName attribute. The other phases are assumed at residual saturation. As a result,
the system may not be at equilibrium if there is initially more than one mobile phase in the system (for instance if
the domain is saturated with gas at the top, and water at the bottom, for instance).
ò Note
As in the single-phase flow case, GEOS terminates the simulation if HydrostaticEquilibrium tag is present in an
XML file defining a gravityVector not aligned with the z-axis.
Examples
<FieldSpecifications>
<HydrostaticEquilibrium
name="equil"
objectPath="ElementRegions"
datumElevation="5"
datumPressure="1e6"/>
</FieldSpecifications>
For compositional multiphase flow, using for instance the CO2-brine flow model, a typical hydrostatic equilibrium
<FieldSpecifications>
<HydrostaticEquilibrium
name="equil"
objectPath="ElementRegions"
datumElevation="28.5"
datumPressure="1.1e7"
initialPhaseName="water"
componentNames="{ co2, water }"
componentFractionVsElevationTableNames="{ initCO2CompFracTable,
initWaterCompFracTable }"
temperatureVsElevationTableName="initTempTable"/>
</FieldSpecifications>
In this case, a possible way to provide the three required tables is:
<Functions>
<TableFunction
name="initCO2CompFracTable"
coordinates="{ 0.0, 10.0, 20.0, 30.0 }"
values="{ 0.04, 0.045, 0.05, 0.055 }"/>
<TableFunction
name="initWaterCompFracTable"
coordinates="{ 0.0, 10.0, 20.0, 30.0 }"
values="{ 0.96, 0.955, 0.95, 0.945 }"/>
<TableFunction
name="initTempTable"
coordinates="{ 0.0, 15.0, 30.0 }"
values="{ 358.15, 339.3, 333.03 }"/>
</Functions>
Note that the spacing of the two component fraction tables must be the same, but the spacing of the temperature table
can be different.
As illustrated in Tutorial 3: Regions and Property Specifications, users can also use multiple FieldSpecification tags
to impose initial fields, such as the pressure, component fractions, and temperature fields. To help users select the
initialization method that best meets their needs, we summarize and compare below the two possible ways to initialize
complex, non-uniform initial fields for compositional multiphase simulations in GEOS.
This is the initialization procedure that we have described in the first sections of this page. In HydrostaticEquilib-
rium, the initial component fractions and temperatures are provided as a function of elevation only, and the hydrostatic
pressure is computed internally before the simulation starts. The typical input was illustrated for a CO2-brine fluid
model in the previous paragraph.
Expected behavior:
• If FieldSpecification tags specifying initial pressure, component fractions, and/or temperature are included in
an XML input file that also contains the HydrostaticEquilibrium tag, the FieldSpecification tags are ignored
by GEOS. In other words, only the pressure, component fractions, and temperature fields defined with the Hy-
drostaticEquilibrium tag as a function of elevation are taken into account.
• In the absence of source/sink terms and wells, the initial flow residual should be smaller than 10− 6. Similarly,
in coupled simulations, the residual of the mechanical problem should be close to zero.
This is the initialization method illustrated in Tutorial 3: Regions and Property Specifications. The user can impose ini-
tial pressure, component fractions, and temperature fields using FieldSpecification tags, such as, for a two-component
CO2-brine case:
<FieldSpecifications>
<FieldSpecification
name="initialPressure"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="pressure"
scale="1"
functionName="initialPressureTableXYZ"/>
<FieldSpecification
name="initialCO2CompFraction"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="globalCompFraction"
component="0"
scale="1"
functionName="initialCO2CompFracTableXYZ"/>
<FieldSpecification
name="initialWaterCompFrac"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="globalCompFraction"
component="1"
scale="1"
functionName="initialWaterCompFracTableXYZ"/>
<FieldSpecification
name="initialTemperature"
initialCondition="1"
setNames="{ all }"
objectPath="ElementRegions"
fieldName="temperature"
scale="1"
(continues on next page)
</FieldSpecifications>
Aquifer boundary conditions allow simulating flow between the computational domain (the reservoir) and one or mul-
tiple aquifers. In GEOS, we use a Carter-Tracy aquifer model parameterized in Aquifer tags of the FieldSpecifications
XML input file blocks.
Aquifer model
An aquifer 𝐴 is a source of volumetric flow rate 𝑞𝑓𝐴 , where 𝑓 is the index of a face connecting the aquifer and the
reservoir. We use a Carter-Tracy model in GEOS to compute this volumetric flow rate.
Once 𝑞𝑓𝐴 is computed, the aquifer mass contribution 𝐹𝑓𝐴 is assembled and added to the mass conservation equations of
the reservoir cell 𝐾 connected to face 𝑓 . The computation of 𝐹𝑓𝐴 depends on the sign of the volumetric flow rate 𝑞𝑓𝐴 .
The upwinding procedure is done as follows: if the sign of 𝑞𝑓𝐴 indicates that flow goes from the aquifer to the reservoir,
the aquifer contribution to the conservation equation of component 𝑐 is:
𝐴
𝐹𝑓,𝑐 = 𝜌𝐴 𝐴 𝐴
𝑤 𝑦𝑤,𝑐 𝑞𝑓
where 𝜌𝐴𝑤 is the aquifer mass/molar water phase density and 𝑦𝑤,𝑐 is the aquifer mass/molar fraction of component 𝑐 in
𝐴
the water phase. We assume that the aquifer is fully saturated with the water phase.
If the sign of 𝑞𝑓𝐴 indicates that flow goes from the reservoir into the aquifer, the aquifer contribution to the mass/molar
conservation equation of component 𝑐 is computed as:
𝑛𝑝
∑︁
𝐴
𝐹𝑓,𝑐 = (𝜌ℓ 𝑆ℓ 𝑦ℓ,𝑐 )𝐾 𝑞𝑓𝐴
ℓ=1
where 𝑛𝑝 is the number of fluid phases, (𝜌ℓ )𝐾 is the reservoir cell mass/molar density of phase ℓ, (𝑆ℓ )𝐾 is the reservoir
cell saturation of phase ℓ, and (𝑦ℓ,𝑐 )𝐾 is the reservoir cell mass/molar fraction of component 𝑐 in phase ℓ.
In the next section, we review the computation of the aquifer volumetric flow rate 𝑞𝑓𝐴 .
The Carter-Tracy aquifer model is a simplified approximation to a fully transient model (see R. D. Carter and G. W.
Tracy, An improved method for calculating water influx, Transactions of the AIME, 1960).
Although the theory was developed for a radially symmetric reservoir surrounded by an annular aquifer, this method
applies to any geometry where the dimensionless pressure can be expressed as a function of a dimensionless time.
The two main parameters that govern the behavior of the aquifer are the time constant and the influx constant. These
two parameters are precomputed at the beginning of the simulation and are later used to compute the aquifer volumetric
flow rate.
Time constant
𝜇𝐴 𝐴 𝐴 𝐴 2
𝑤 𝜑 𝑐𝑡 (𝑟0 )
𝑇𝑐 =
𝑘𝐴
where 𝜇𝐴𝑤 is the aquifer water phase viscosity, 𝜑 is the aquifer porosity, 𝑐𝑡 is the aquifer total compressibility (fluid
𝐴 𝐴
and rock), 𝑟0 is the inner radius of the aquifer, and 𝑘 is the aquifer permeability.
𝐴 𝐴
The time constant is used to convert time (𝑡, in seconds) into dimensionless time, 𝑡𝐷 using the following expression:
𝑡
𝑡𝐷 =
𝑇𝑐
Influx constant
𝛽 = 6.283ℎ𝐴 𝜃𝐴 𝜑𝐴 𝑐𝐴 𝐴 2
𝑡 (𝑟0 )
where ℎ𝐴 is the aquifer thickness, 𝜃𝐴 is the aquifer angle, 𝜑𝐴 is the aquifer porosity, 𝑐𝐴
𝑡 is the aquifer total compress-
ibility (fluid and rock), and 𝑟0𝐴 is the inner radius of the aquifer.
Let us consider a reservoir cell 𝐾 connected to aquifer 𝐴 through face 𝑓 , and the corresponding aquifer volumetric
flow rate 𝑞𝑓𝐴 over time interval [𝑡𝑛 , 𝑡𝑛+1 ].
The computation of 𝑞𝑓𝐴 proceeds as follows:
where 𝛼𝑓𝐴 is the area fraction of face f, and 𝑝𝐾 (𝑡𝑛+1 ) and 𝑝𝐾 (𝑡𝑛 ) are the pressures in cell 𝐾 at time 𝑡𝑛+1 and time 𝑡𝑛 ,
respectively.
The area fraction of face 𝑓 with area |𝑓 | is computed as:
|𝑓 |
𝛼𝑓𝐴 = ∑︀
𝑓𝑖 ∈𝐴 |𝑓𝑖 |
where ∆Φ𝐴 𝐾 (𝑡𝐷 ) := 𝑝 − 𝑝𝐾 (𝑡 ) − 𝜌𝑤 𝑔(𝑧𝐾 − 𝑧 ) is the potential difference between the reservoir cell and the aquifer
𝑛 𝐴 𝑛 𝐴 𝐴
with 𝑊 𝐴 (0) := 0.
Parameters
The main Carter-Tracy parameters and the expected units are listed below:
• aquiferPorosity: the aquifer porosity 𝜑𝐴 .
• aquiferPermeability: the aquifer permeability 𝑘 𝐴 (in m2).
𝐾.
• aquiferInitialPressure: the aquifer initial pressure 𝑝𝐴 (in Pa), used to compute ∆Φ𝐴
𝑤 (in Pa.s).
• aquiferWaterViscosity: the aquifer water viscosity 𝜇𝐴
• aquiferWaterDensity: the aquifer water mass/molar density 𝜌𝐴
𝑤 (in kg/m3 or mole/m3).
• aquiferWaterPhaseComponentNames: the name of the components in the water phase. These names must match
the component names listed in the fluid model of the Constitutive block. This parameter is ignored in single-
phase flow simulations.
• aquiferWaterPhaseComponentFraction: the aquifer component fractions in the water phase, 𝑦𝑤,𝑐
𝐴
. The compo-
nents must be listed in the order of the components in aquiferWaterPhaseComponentNames. This parameter is
ignored in single-phase flow simulations.
• aquiferTotalCompressibility: the aquifer total compressibility (for the fluid and the solid) 𝑐𝐴
𝑡 (in 1/Pa).
• setNames: the names of the face sets on which the aquifer boundary condition is applied.
ò Note
Following the GEOS convention, the z-coordinate is increasing upward. This convention must be taken into account
when providing the aquiferElevation. In other words, the z-value is not a depth.
Examples
Setting up the Aquifer boundary condition requires two additional pieces of information in the XML input file: a set
of faces to specify where the aquifer boundary conditions will apply, and an aquifer tag that specifies the physical
characteristics of the aquifer and determines how the boundary condition is applied.
1) To specify a set of faces: on simple grids, in the Geometry block of the XML file, we can define a Box that
selects and assigns a name to a set of faces. To be included in a set, the faces must be fully enclosed in the Box
(all vertices of a face must be inside the box for the face to be included to the set). The name of this box is a
user-defined string, and it will be used in the aquifer tag to locate the face set. Here is an example of XML code
to create such a face set from a box:
<Geometry>
...
<Box
name="aquifer"
xMin="{ 999.99, 199.99, 3.99 }"
xMax="{ 1010.01, 201.01, 6.01 }"/>
...
</Geometry>
ò Note
This step captures faces, not cells. For now, the user must ensure that the box actually contains faces (GEOS will
proceed even if the face set is empty).
For more complex meshes, sch as those imported using the VTKMesh, using a Box to perform a face selection is
challenging. We recommend using a surface in the vtk file instead, which will be used to locate the face set.
2) To specify the aquifer characteristics: in the FieldSpecifications block of the XML file, we include an Aquifer
tag. For single-phase flow, the aquifer definition looks like:
<FieldSpecifications>
...
<Aquifer
name="aquiferBC"
aquiferPorosity="2e-1"
aquiferPermeability="3e-13"
aquiferInitialPressure="9e6"
aquiferWaterViscosity="0.00089"
aquiferWaterDensity="962.81"
aquiferTotalCompressibility="1e-10"
aquiferElevation="4"
aquiferThickness="18"
aquiferInnerRadius="2000"
aquiferAngle="20"
setNames="{ aquifer }"/>
...
</FieldSpecifications>
For compositional multiphase flow, the user must include additional parameters to specify the water composition. We
have additional influx controls over the aquifer with allowAllPhasesIntoAquifer. This is illustrated below for the
CO2-brine fluid model:
<FieldSpecifications>
...
<Aquifer
name="aquiferBC"
aquiferPorosity="2e-1"
aquiferPermeability="3e-13"
aquiferInitialPressure="9e6"
aquiferWaterViscosity="0.00089"
aquiferWaterDensity="962.81"
aquiferWaterPhaseComponentFraction="{ 0.0, 1.0 }"
aquiferWaterPhaseComponentNames="{ co2, water }"
aquiferTotalCompressibility="1e-10"
aquiferElevation="4"
aquiferThickness="18"
aquiferInnerRadius="2000"
aquiferAngle="20"
allowAllPhasesIntoAquifer="1"
setNames="{ aquifer }"/>
...
</FieldSpecifications>
Finally, for both single-phase and multiphase flow, if a pressureInfluenceFunctionName attribute is specified in
the Aquifer tag, a TableFunction must be included in the Functions block of the XML file as follows:
<Functions>
...
<TableFunction
name="pressureInfluenceFunction"
coordinates="{ 0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,␣
˓→1.0, 1.5,
2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0,␣
˓→30.0, 40.0,
50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 200.0, 800.0, 1600.0, 3200.0,␣
˓→6400.0, 12800.0 }"
values="{ 0.112, 0.229, 0.315, 0.376, 0.424, 0.469, 0.503, 0.564, 0.616, 0.659, 0.
˓→702, 0.735, 0.772, 0.802,
0.927, 1.02, 1.101, 1.169, 1.275, 1.362, 1.436, 1.5, 1.556, 1.604, 1.651,␣
˓→1.829, 1.96, 2.067, 2.147,
2.282, 2.388, 2.476, 2.55, 2.615, 2.672, 2.723, 3.0537, 3.7468, 4.0934, 4.
˓→44, 4.7866, 5.1331 }"/>
...
</Functions>
ò Note
The values provided in the table above are the default values used internally in GEOS when the user does not specify
the pressure influence function in the XML file.
<Events maxTime="1.0e-2">
<PeriodicEvent name="event_a"
target="/path/to/event"
forceDt="1" />
<HaltEvent name="event_b"
target="/path/to/halt_target"
maxRunTime="1e6" />
</Events>
The children of the Event block define the events that may execute during a simulation. These may be of type
HaltEvent, PeriodicEvent, or SoloEvent. The exit criteria for the global event loop are defined by the attributes
maxTime and maxCycle (which by default are set to their max values). If the optional logLevel flag is set, the Event-
Manager will report additional information with regards to timestep requests and event forecasts for its children.
PeriodicEvent
This is the most common type of event used in GEOS. As its name suggests, it will execute periodically during a
simulation. It can be triggered based upon a user-defined cycleFrequency or timeFrequency.
If cycleFrequency is specified, the event will attempt to execute every X cycles. Note: the default behavior for a
PeriodicEvent is to execute every cycle. The event forecast for this case is given by: forecast = cycleFrequency
- (cycle - lastCycle) .
If timeFrequency is specified, the event will attempt to execute every X seconds (this will override any cycle-dependent
behavior). By default, the event will attempt to modify its timestep requests to respect the timeFrequency (this can
be turned off by specifying targetExactTimestep=”0”). The event forecast for this case is given by: if (dt > 0),
forecast = (timeFrequency - (time - lastTime)) / dt, otherwise forecast=max
By default, a PeriodicEvent will execute throughout the entire simulation. This can be restricted by specifying the
beginTime and/or endTime attributes. Note: if either of these values are set, then the event will modify its timestep
requests so that a cycle will occur at these times (this can be turned off by specifying targetExactStartStop=”0”).
The timestep request event is typically determined via its target. However, this value can be overridden by setting the
forceDt or maxEventDt attributes.
SoloEvent
This type of event will execute once once the event loop reaches a certain cycle (targetCycle) or time (targetTime).
Similar to the PeriodicEvent type, this event will modify its timestep requests so that a cycle occurs at the exact time
requested (this can be turned off by specifying targetExactTimestep=”0”). The forecast calculations follow an similar
approach to the PeriodicEvent type.
HaltEvent
This event type is designed to track the wall clock. When the time exceeds the value specified via maxRunTime, the
event will trigger and set a flag that instructs the main EventManager loop to cleanly exit at the end of the current cycle.
The event for cast for this event type is given by: forecast = (maxRuntime - (currentTime - startTime))
/ realDt
Because the event manager allows the user to specify the order of events, it could introduce ambiguity into the times-
tamps of output files. To resolve this, we pass two arguments to the target’s Execute method:
1. eventCounter (integer) - the application index for the event (or sub-event)
2. eventProgress (real64) - the percent completion of the event loop, paying attention to events whose targets are
associated with physics (from the start of the event, indicated via target->GetTimestepBehavior())
For example, consider the following Events block:
<Events maxTime="1.0e-2">
<PeriodicEvent name="outputs"
timeFrequency="1e-6"
targetExactTimestep="0"
target="/Outputs/siloOutput">
<PeriodicEvent name="solverApplications_a"
forceDt="1.0e-5"
target="/Solvers/lagsolve" />
<PeriodicEvent name="solverApplications_b"
target="/Solvers/otherSolver" />
<PeriodicEvent name="restarts"
timeFrequency="5.0e-4"
targetExactTimestep="0"
target="/Outputs/restartOutput"/>
</Events>
In this case, the events solverApplications_a and solverApplications_b point target physics events. The eventCounter,
eventProgress pairs will be: outputs (0, 0.0), solverApplications_a (1, 0.0), solverApplications_b (2, 0.5), and restarts
(3, 1.0). These values are supplied to the target events via their Execute methods for use. For example, for the name of
a silo output file will have the format: “%s_%06d%02d” % (name, cycle, eventCounter), and the time listed in the file
will be time = time + dt*eventProgress
Nested Events
The event manager allows its child events to be nested. If this feature is used, then the manager follows the basic
execution rules, with the following exception: When its criteria are met, an event will first execute its (optional) target.
It will then estimate the forecast for its own sub-events, and execute them following the same rules as in the main loop.
For example:
<Events maxTime="1.0e-2">
<PeriodicEvent name="event_a"
target="/path/to/target_a" />
<PeriodicEvent name="event_b"
timeFrequency="100">
<PeriodicEvent name="subevent_b_1"
target="/path/to/target_b_1"/>
<PeriodicEvent name="subevent_b_2"
target="/path/to/target_b_2"/>
<PeriodicEvent/>
</Events>
In this example, event_a will trigger during every cycle and call the Execute method on the object located at
/path/to/target_a. Because it is time-driven, event_b will execute every 100 s. When this occurs, it will execute it
will execute its own target (if it were defined), and then execute subevent_b_1 and subevent_b_2 in order. Note: these
are both cycle-driven events which, by default would occur every cycle. However, they will not execute until each of
their parents, grandparents, etc. execution criteria are met as well.
<Tasks>
<PackCollection name="historyCollection" objectPath="nodeManager" fieldName="Velocity"␣
˓→/>
</Tasks>
The children of the Tasks block define different Tasks to be triggered by events specified in the Event Management
during the execution of the simulation. At present the only supported task is the PackCollection used to collect time
history data for output by a TimeHistory output.
PackCollection
The PackCollection Task is used to collect time history information from fields. Either the entire field or specified
named sets of indices in the field can be collected.
Note: The time history information collected via this task is buffered internally until it is output by a linked TimeHistory
Output.
Tasks can be triggered using the Event Management. Recurring tasks sould use a <PeriodicEvent> and one-time
tasks should use a <SoloEvent>:
<PeriodicEvent name="historyCollectEvent"
timeFrequency="1.0"
targetExactTimeset="1"
target="/Tasks/historyCollection" />
The keyword target has to match the name of a Task specified as a child of the <Tasks> block.
1.5.9 Functions
Functions are the primary avenue for specifying values that change in space, time, or any other dimension. These are
specified in the Functions block, and may be referenced by name throughout the rest of the .xml file. For example:
<Functions>
<TableFunction name="q"
inputVarNames="time"
coordinates="0 60 1000"
values="0 1 1" />
</Functions>
<FieldSpecifications>
<SourceFlux name="sourceTerm"
objectPath="ElementRegions/Region1/block1"
scale="0.001"
functionName="q"
setNames="{source}"/>
</FieldSpecifications>
Function Types
There are three types of functions available for use: TableFunction, SymbolicFunction, and
CompositeFunction. Note: the symbolic and composite function types are currently only available for
x86-64 systems.
TableFunction
A table function uses a set of pre-computed values defined at points on a structured grid to represent an arbitrary-
dimensional function. Typically, the axes of the table will represent time and/or spatial dimensions; however, these can
be applied to represent phase diagrams, etc.
1D Table
For 1D tables, the function may be defined using the coordinates and values attributes. These represent the location of
the grid nodes (ordered from smallest to largest) and the function values at those points, respectively. For example, the
following function defines a simple ramp function with a rise-time of 60 seconds:
<TableFunction name="q"
inputVarNames="time"
coordinates="0 60 1000"
values="0 1 1" />
ND Table
For ND tables, the grid coordinates and values may be defined using a set of .csv files. The coordinateFiles attribute
specifies the file names that define the coordinates for each axis. The values in each coordinate file must be comma-
delimited and ordered from smallest to largest. The dimensionality of the table is defined by the number of coordinate
files (coordinateFiles=”x.csv” would indicate a 1D table, coordinateFiles=”x.csv y.csv z.csv t.csv” would indicate a
4D table, etc.). The voxelFile attribute specifies name of the file that defines the value of the function at each point
along the grid. These values must be comma-delimited (line-breaks are allowed) and be specified in Fortran order, i.e.,
column-major order (where the index of the first dimension changes the fastest, and the index of the last dimension
changes slowest).
The following would define a simple 2D function c = a + 2*b:
<TableFunction name="c"
inputVarNames="a b"
coordinateFiles="a.csv b.csv"
voxelFile="c.csv" />
• a.csv: “0, 1”
• b.csv: “0, 0.5, 1”
• c.csv: “0, 1, 1, 2, 2, 3”
Interpolation Methods
There are four interpolation methods available for table functions. Within the table axes, these will return a value:
• linear: using piecewise-linear interpolation
• upper: equal to the value of the next table vertex
• nearest: equal to the value of the nearest table vertex
• lower: equal to the value of the previous table vertex
Outside of the table axes, these functions will return the edge-values. The following figure illustrates how each of these
methods work along a single dimension, given identical table values:
import numpy as np
SymbolicFunction
This function leverages the symbolic expression library mathpresso to define and evaluate functions. These functions
are processed using an x86-64 JIT compiler, so are nearly as efficient as natively compiled C++ expressions.
The variableNames attribute defines a set of single-character names for the inputs to the symbolic function.
There should be a definition for each scalar input and for each component of a vector input. For example
if inputVarName="time, ReferencePosition", then variableNames="t, x, y, z". The expression at-
tribute defines the symbolic expression to be executed. Aside from the following exceptions, the syntax mirrors python:
• The function string cannot contain any spaces
• The power operator is specified using the C-style expression (e.g. pow(x,3) instead of x**3)
The following would define a simple 2D function c = a + 2*b:
<SymbolicFunction name="c"
inputVarNames="a b"
variableNames="x y"
expression="x+(2*y)"/>
CompositeFunction
This function is derived from the symbolic function. However, instead of using the time or object as inputs, it is used
to combine the outputs of other functions using a symbolic expression.
The functionNames attribute defines the set of input functions to use (these may be of any type, and may each have
any number of inputs). The variableNames attribute defines a set of single-character names for each function. The
expression attribute defines the symbolic expression, and follows the same rules as above. The inputVarNames
attribute is ignored for this function type.
The following would define a simple 1D table function f(t) = 1 + t, a 3D symbolic function g(x, y, z) = x**2
+ y**2 + z**2, and a 4D composite function h = sin(f(t)) + g(x, y, z):
<Functions>
<TableFunction name="f"
inputVarNames="time"
coordinates="0 1000"
values="1 1001" />
<SymbolicFunction name="g"
inputVarNames="ReferencePosition"
variableNames="x y z"
expression="pow(x,2)+pow(y,2)+pow(z,2)"/>
<CompositeFunction name="h"
inputVarNames="ignored"
functionNames="f g"
variableNames="x y"
expression="sin(x)+y"/>
</Events>
inputFiles/initialization/gravityInducedStress_initialization_base.xml
inputFiles/initialization/gravityInducedStress_initialization_benchmark.xml
src/coreComponents/physicsSolvers/multiphysics/docs/gravityInducedStressInitialization/
˓→gravityInitializationFigure.py
We model the in-situ state of stress of a subsurface reservoir subject to a gravity-only induced stress and hydrostatic in-
situ pressure condition. The domain is homogenous, isotropic and isothermal. The domain is subject to roller boundary
conditions on lateral surfaces and at the base of the model, while the top of the model is a free surface.
We set up and solve a PoroMechanics model to obtain the gradient of total stresses (principal stress components) across
the domain due to gravity effects and hydrostatic pressure only. These numerical predictions are compared with the
analytical solutions derived from Eaton et al. (1969, 1975)
For this example, we focus on the Mesh, the Constitutive, and the FieldSpecifications tags.
Mesh
The following figure shows the mesh used for solving this poromechanical problem:
The mesh was created with the internal mesh generator and parametrized in the InternalMesh XML tag. It con-
tains 20x20x40 eight-node brick elements in the x, y, and z directions respectively. Such eight-node hexahedral ele-
ments are defined as C3D8 elementTypes, and their collection forms a mesh with one group of cell blocks named here
cellBlockNames.
<Mesh>
<InternalMesh
name="mesh1"
elementTypes="{ C3D8 }"
xCoords="{ 0.0, 1000 }"
yCoords="{ 0.0, 1000 }"
zCoords="{ -1000, 0 }"
(continues on next page)
Poro-Mechanics Solver
For the initialization test, a hydrostatic pore pressure is imposed on the system. This is done using the Hydrostatic
Equilibrium tag under Field Specifications. We then define a poro-mechanics solver called here poroSolve. This solid
mechanics solver (see Solid Mechanics Solver) called lagSolve is based on the Lagrangian finite element formulation.
The problem is run as QuasiStatic without considering inertial effects. The computational domain is discretized by
FE1, defined in the NumericalMethods section. We use the targetRegions attribute to define the regions where
the poromechanics solver is applied. Since we only have one cellBlockName type called Domain, the poromechanics
solver is applied to every element of the model. The flow solver for this problem (see Singlephase Flow Solver) called
SinglePhaseFlow is discretized by fluidTPFA, defined in the NumericalMethods section.
<SinglePhasePoromechanics
name="poroSolve"
solidSolverName="lagsolve"
flowSolverName="SinglePhaseFlow"
logLevel="1"
targetRegions="{ Domain }">
<NonlinearSolverParameters
newtonMaxIter="2"
newtonTol="1.0e-2"
maxTimeStepCuts="1"
lineSearchMaxCuts="0" />
<LinearSolverParameters
directParallel="0" />
</SinglePhasePoromechanics>
<NumericalMethods>
<FiniteElements>
<FiniteElementSpace
name="FE1"
order="1" />
</FiniteElements>
<FiniteVolume>
<TwoPointFluxApproximation
name="fluidTPFA" />
</FiniteVolume>
</NumericalMethods>
Constitutive Laws
A homogeneous domain with one solid material is assumed, and its mechanical and fluid properties are specified in
the Constitutive section:
<Constitutive>
<PorousElasticIsotropic
name="rock"
solidModelName="rockSolid"
porosityModelName="rockPorosity"
permeabilityModelName="rockPerm" />
<ElasticIsotropic
name="rockSolid"
defaultDensity="2500"
defaultPoissonRatio="0.25"
defaultYoungModulus="100.0e6" />
<BiotPorosity
name="rockPorosity"
defaultGrainBulkModulus="1.0e27"
defaultReferencePorosity="0.375" />
<ConstantPermeability
name="rockPerm"
permeabilityComponents="{ 1.0e-12, 1.0e-12, 1.0e-12 }" />
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1000"
defaultViscosity="0.001"
referencePressure="0.000"
referenceDensity="1000"
compressibility="4.4e-10"
referenceViscosity="0.001"
viscosibility="0.0" />
</Constitutive>
As shown above, in the CellElementRegion section, rock is the solid material in the computational domain and
water is the fluid material. Here, Porous Elastic Isotropic model PorousElasticIsotropic is used to simulate
the elastic behavior of rock. As for the solid material parameters, defaultDensity, defaultPoissonRatio,
defaultYoungModulus, grainBulkModulus, defaultReferencePorosity, and permeabilityComponents de-
note the rock density, Poisson ratio, Young modulus, grain bulk modulus, porosity, and permeability components re-
spectively. In additon, the fluid property (water) of density, viscosity, compressibility and viscosibility are specified
with defaultDensity, defaultViscosity, compressibility, and viscosibility. All properties are specified
in the International System of Units.
In the Tasks section, SinglePhasePoromechanicsInitialization tasks are defined to initialize the model by
calling the poro-mechanics solver poroSolve. This task is used to determine stress gradients through designated den-
sities and established constitutive relationships to maintain mechanical equilibrium and reset all initial displacements
to zero following the initialization process.
<Tasks>
<SinglePhasePoromechanicsInitialization
logLevel="1"
name="singlephasePoromechanicsPreEquilibrationStep"
(continues on next page)
The initialization is triggered into action using the Event management section, where the soloEvent function calls
the task at the target time (in this case -1e10s).
<Events
maxTime="10.0"
minTime="-1e10">
<PeriodicEvent
name="outputs"
timeFrequency="10.0"
target="/Outputs/vtkOutput" />
<PeriodicEvent
name="solverApplication0"
beginTime="0.0"
endTime="10.0"
target="/Solvers/poroSolve" />
<SoloEvent
beginTime="-1e10"
name="singlephasePoromechanicsPreEquilibrationStep"
target="/Tasks/singlephasePoromechanicsPreEquilibrationStep"
targetTime="-1e10" />
</Events>
The PeriodicEvent function is used here to define recurring tasks that progress for a stipulated time during the
simuation. We also use it in this example to save the vtkOuput results.
<Outputs>
<VTK
name="vtkOutput" />
<Restart
name="restartOutput"/>
</Outputs>
We use Paraview to extract the data from the vtkOutput files at the initialization time, and then use a Python script to
read and plot the stress and pressure gradients for verification and visualization.
<FieldSpecifications>
<HydrostaticEquilibrium
datumElevation="0.0"
datumPressure="0.0"
name="equil"
objectPath="ElementRegions/Domain" />
<FieldSpecification
name="xconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="0"
scale="0.0"
setNames="{ xneg, xpos }" />
<FieldSpecification
name="yconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="1"
scale="0.0"
setNames="{ yneg, ypos }" />
<FieldSpecification
name="zconstraint"
objectPath="nodeManager"
fieldName="totalDisplacement"
component="2"
scale="0.0"
setNames="{ zneg }" />
</FieldSpecifications>
The parameters used in the simulation are summarized in the following table.
Inspecting Results
In the example, we request vtk output files for time-series (time history). We use paraview to visualize the outcome at the
time 0s. The following figure shows the final gradient of pressure and of the effective vertical stress after initialization
is completed.
The figure below shows the comparison between the total stress computed by GEOS(marks) and with an analytical
solutions (solid lines). Note that, because of the use of an isotropic model, the minimum and maximul horizontal
stresses are equal.
To go further
inputFiles/initialization/userdefinedStress_initialization_base.xml
inputFiles/initialization/userdefinedStress_initialization_benchmark.xml
0 Sxx_Total_GEOS
Sxx_Total_Analytical
Syy_Total_GEOS
Szz_Total_GEOS
Szz_Total_Analytical
Pore Pressure_GEOS
200 Pore Pressure_Analytical
400
Depth [m]
600
800
1000
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Total Stresses [MPa]
inputFiles/initialization/userTables/
The major distinction between this “user-defined” initialization and the “gravity-based” initialization is that in the user-
defined case, the user provides the following additional information:
• The distribution of effective stresses and pore pressure across the domain, with their gradients assumed constant
along the depth in this example. We use a table function (see Functions) to specify pressure and stress conditions
throughout the area.
This is shown in the following tags under the FieldSpecifications section below
<FieldSpecification
component="0"
fieldName="rockSolid_stress"
functionName="sigma_xx"
initialCondition="1"
name="init_sigma_xx"
objectPath="ElementRegions/Domain"
scale="1.0"
setNames="{ all }" />
<FieldSpecification
component="1"
fieldName="rockSolid_stress"
functionName="sigma_yy"
initialCondition="1"
name="init_sigma_yy"
objectPath="ElementRegions/Domain"
scale="1.0"
setNames="{ all }" />
<FieldSpecification
component="2"
fieldName="rockSolid_stress"
functionName="sigma_zz"
initialCondition="1"
name="init_sigma_zz"
objectPath="ElementRegions/Domain"
scale="1.0"
setNames="{ all }" />
<FieldSpecification
fieldName="pressure"
functionName="init_pressure"
initialCondition="1"
name="init_pressure"
objectPath="ElementRegions/Domain"
(continues on next page)
The tables for sigma_xx, sigma_yy, sigma_zz and init_pressure are listed under the Functions section as shown
below.
<Functions>
<TableFunction
coordinateFiles="{userTables/x.csv, userTables/y.csv, userTables/z.csv}"
inputVarNames="{elementCenter}"
interpolation="linear"
name="sigma_xx"
voxelFile="userTables/effectiveSigma_xx.csv" />
<TableFunction
coordinateFiles="{userTables/x.csv, userTables/y.csv,userTables/z.csv}"
inputVarNames="{elementCenter}"
interpolation="linear"
name="sigma_yy"
voxelFile="userTables/effectiveSigma_yy.csv" />
<TableFunction
coordinateFiles="{userTables/x.csv, userTables/y.csv, userTables/z.csv}"
inputVarNames="{elementCenter}"
interpolation="linear"
name="sigma_zz"
voxelFile="userTables/effectiveSigma_zz.csv" />
<TableFunction
coordinateFiles="{userTables/x.csv, userTables/y.csv, userTables/z.csv}"
inputVarNames="{elementCenter}"
interpolation="linear"
name="init_pressure"
voxelFile="userTables/porePressure.csv" />
</Functions>
The required input files: x.csv, y.csv, z.csv, effectiveSigma_xx.csv, effectiveSigma_yy.csv, effectiveSigma_zz.csv, and
porePressure.csv are generated based on the expected stress-gradients in the model.
A Python script to generate these files is provided:
src/coreComponents/physicsSolvers/multiphysics/docs/userTableStressInitialization/
˓→genetrateTable.py
In addition to generating the files listed above, the script prints out the corresponding fluid density and rock density
based on the model parameters provided. These values are then input into the defaultDensity parameter of the
CompressibleSinglePhaseFluid and ElasticIsotropic tags respectively, as shown below:
<ElasticIsotropic
name="rockSolid"
defaultDensity="3302.752294"
defaultPoissonRatio="0.25"
(continues on next page)
<CompressibleSinglePhaseFluid
name="water"
defaultDensity="1019.36799"
defaultViscosity="0.001"
referencePressure="0.000"
referenceDensity="1000"
compressibility="4.4e-10"
referenceViscosity="0.001"
viscosibility="0.0" />
Inspecting Results
In the example, we request vtk output files for time-series (time history). We use paraview to visualize the outcome at the
time 0s. The following figure shows the final gradient of pressure and of the effective vertical stress after initialization
is completed.
The figure below shows the comparisons between the numerical predictions (marks) and the corresponding user-
provided stress gradients. Note that anisotropic horizontal stresses are obtained through this intialization procedure;
however, mechanical equilibrium might not be guaranteed, especially for the heterogeneous models.
To go further
Ax = b
where A is the square sparse matrix, x the solution vector, and b the right-hand side. For example, in a classical linear
elastostatics problem A is the stiffness matrix, and x and b are the displacement and nodal force vectors, respectively.
This solution stage represents the most computationally expensive portion of a typical simulation. Solution algorithms
generally belong to two families of methods: direct methods and iterative methods. In GEOS both options are made
available wrapping around well-established open-source linear algebra libraries, namely HYPRE, PETSc, SuperLU,
and Trilinos.
Direct methods
The major advantages are their reliability, robustness, and ease of use. However, they have large memory requirements
and exhibit poor scalability. Direct methods should be used in a prototyping stage, for example when developing a new
formulation or algorithm, when the dimension of the problem, namely the size of matrix A, is small. Irrespective of
the selected direct solver implementation, three stages can be idenitified:
0 Sxx_Total_GEOS
Sxx_Total_Reference
Syy_Total_GEOS
Syy_Total_Reference
Szz_Total_GEOS
Szz_Total_Reference
200 Pore Pressure_GEOS
Pore Pressure_Reference
400
Depth [m]
600
800
1000
0 5 10 15 20 25
Total Stresses [MPa]
(1) Setup Stage: the matrix is first analyzed and then factorized
(2) Solve Stage: the solution to the linear systems involving the factorized matrix is computed
(3) Finalize Stage: the systems involving the factorized matrix have been solved and the direct solver lifetime ends
The default option in GEOS relies on SuperLU, a general purpose library for the direct solution of large, sparse,
nonsymmetric systems of linear equations, that is called taking advantage of the interface provided in HYPRE.
Iterative methods
As the problem size (number of computational cells) increases, global iterative solution strategies are the method of
choice—typically nonsymmetric Krylov solvers. Because of the possible poor conditioning of A, preconditioning is
essential to solve such systems efficiently. ‘’Preconditioning is simply a means of transforming the original linear
system into one which has the same solution, but which is likely to be easier to solve with an iterative solver” [Saad
(2003)].
The design of a robust and efficient preconditioner is based on a trade-off between two competing objectives:
• Robustness: reducing the number of iterations needed by the preconditioned solver to achieve convergence;
• Efficiency: limiting the time required to construct and apply the preconditioner.
Assuming a preconditioning matrix M is available, three standard approaches are used to apply the preconditioner:
(1) Left preconditioning: the preconditioned system is M−1 Ax = M−1 b
(2) Right preconditioning: the preconditioned system is AM−1 y = b, with x = M−1 y
(3) Split preconditioning: the preconditioned system is M−1 −1 −1 −1
𝐿 AM𝑅 y = M𝐿 b, with x = M𝑅 y
Summary
The following table summarizes the available input parameters for the linear solver.
Preconditioner descriptions
This section provides a brief description of the available preconditioners.
• None: no preconditioning is used, i.e., M−1 = I.
• Jacobi: diagonal scaling preconditioning, with M−1 = D−1 , with D the matrix diagonal. Further details can be
found in:
– HYPRE documentation,
– PETSc documentation,
– Trilinos documentation.
• ILUK: incomplete LU factorization with fill level k of the original matrix: M−1 = U−1 L−1 . Further details can
be found in:
– HYPRE documentation,
– PETSc documentation,
– Trilinos documentation.
• ILUT: a dual threshold incomplete LU factorization: M−1 = U−1 L−1 . Further details can be found in:
– HYPRE documentation,
– not yet available through PETSc interface,
– Trilinos documentation.
• ICC: incomplete Cholesky factorization of a symmetric positive definite matrix: M−1 = L−𝑇 L−1 . Further
details can be found in:
– not yet available through hypre interface,
– PETSc documentation,
– Trilinos documentation.
• AMG: algebraic multigrid (can be classical or aggregation-based according to the specific package). Further
details can be found in:
– HYPRE documentation,
– PETSc documentation,
– Trilinos documentation.
• MGR: multigrid reduction. Available through hypre interface only. Further details can be found in MGR docu-
mentation, also see section below.
• Block: custom preconditioner designed for a 2 x 2 block matrix.
Block preconditioner
This framework allows the user to design a block preconditioner for a 2 x 2 block matrix. The key component is the
Schur complement S = A11 −A10 A ̃︀ −1 A01 computation, that requires an approximation of the leading block. Currently,
00
−1
available options for A
̃︀ are:
00
Adaptive tolerance
This feature is available for iterative solvers and can be enabled using krylovAdaptiveTol flag in LinearSolverParameters.
It follows the Eisenstat-Walker inexact Newton approach described in [Eisenstat and Walker 1996]. The key idea is to
relax the linear solver tolerance at the beginning of the nonlinear iterations loop and tighten it when getting closer to
the final solution. The initial tolerance is defined by krylovWeakestTol and starting from second nonlinear iteration the
tolerance is chosen using the following steps:
• compute the current to previous nonlinear norm ratio: nr = min(norm𝑐𝑢𝑟𝑟 /norm𝑝𝑟𝑒𝑣 , 1.0)
• estimate the new linear solver tolerance: tol𝑛𝑒𝑤 = 𝛾 · nr𝑎𝑥
• compute a safeguard to avoid too sharp tolerance reduction: tol𝑎𝑙𝑡 = tol2𝑜𝑙𝑑 (the bound is the quadratic reduction
with respect to the previous tolerance value)
• apply safeguards and compute the final tolerance: tol = max(tol𝑛𝑒𝑤 , tol𝑎𝑙𝑡 ), tol =
min(tol𝑚𝑎𝑥 , max(tol𝑚𝑖𝑛 , tol))
Here 𝛾 is the forcing term, 𝑎𝑥 is the adaptivity exponent, tol𝑚𝑖𝑛 and tol𝑚𝑎𝑥 are prescribed tolerance bounds (defined
by krylovStrongestTol and krylovWeakestTol, respectively).
This is the standard scheme implemented in the SinglePhaseFVM flow solver. It only uses cell-centered degrees of
freedom and implements a Two-Point Flux Approximation (TPFA) for the computation of the flux. The numerical flux
is obtained using the following expression for the mass flux between cells 𝐾 and 𝐿:
𝜌𝑢𝑝𝑤 (︀
𝑝𝐾 − 𝑝𝐿 − 𝜌𝑎𝑣𝑔 𝑔(𝑑𝐾 − 𝑑𝐿 ) ,
)︀
𝐹𝐾𝐿 = Υ𝐾𝐿 𝑢𝑝𝑤
𝜇
where 𝑝𝐾 is the pressure of cell 𝐾, 𝑑𝐾 is the depth of cell 𝐾, and Υ𝐾𝐿 is the standard TPFA transmissibility coefficient
at the interface. The fluid density, 𝜌𝑢𝑝𝑤 , and the fluid viscosity, 𝜇𝑢𝑝𝑤 , are upwinded using the sign of the potential
difference at the interface.
This is currently the only available discretization in the Compositional Multiphase Flow Solver.
Hybrid FVM
This discretization scheme overcomes the limitations of the standard TPFA on non K-orthogonal meshes. The hybrid
finite-volume scheme–equivalent to the well-known hybrid Mimetic Finite Difference (MFD) scheme–remains consis-
tent with the pressure equation even when the mesh does not satisfy the K-orthogonality condition. This numerical
scheme is currently implemented in the SinglePhaseHybridFVM solver.
The hybrid FVM scheme uses both cell-centered and face-centered pressure degrees of freedom. The one-sided face
flux, 𝐹𝐾,𝑓 , at face 𝑓 of cell 𝐾 is computed as:
𝜌𝑢𝑝𝑤 ̃︀
𝐹𝐾,𝑓 = 𝐹𝐾,𝑓 ,
𝜇𝑢𝑝𝑤
In the previous equation, 𝑝𝐾 is the cell-centered pressure, 𝜋𝑓 is the face-centered pressure, 𝑑𝐾 is the depth of cell 𝐾,
and 𝑑𝑓 is the depth of face 𝑓 . The fluid density, 𝜌𝑢𝑝𝑤 , and the fluid viscosity, 𝜇𝑢𝑝𝑤 , are upwinded using the sign of
𝐹̃︀𝐾,𝑓 . The local transmissibility Υ of size 𝑛local faces × 𝑛local faces satisfies:
𝑁 𝐾 = Υ𝐶
Above, 𝑁 is a matrix of size 𝑛local faces × 3 storing the normal vectors to each face in this cell, 𝐶 is a matrix of size
𝑛local faces × 3 storing the vectors from the cell center to the face centers, and 𝐾 is the permeability tensor. The local
transmissibility matrix, Υ, is currently computed using the quasi-TPFA approach described in Chapter 6 of this book.
The scheme reduces to the TPFA discretization on K-orthogonal meshes but remains consistent when the mesh does
not satisfy this property. The mass flux 𝐹𝐾,𝑓 written above is then added to the mass conservation equation of cell 𝐾.
In addition to the mass conservation equations, the hybrid FVM involves algebraic constraints at each mesh face to
enforce mass conservation. For a given interior face 𝑓 between two neighboring cells 𝐾 and 𝐿, the algebraic constraint
reads:
𝐹̃︀𝐾,𝑓 + 𝐹̃︀𝐿,𝑓 = 0.
We obtain a numerical scheme with 𝑛cells cell-centered degrees of freedom and 𝑛faces face-centered pressure degrees of
freedom. The system involves 𝑛cells mass conservation equations and 𝑛faces face-based constraints. The linear systems
can be efficiently solved using the MultiGrid Reduction (MGR) preconditioner implemented in the Hypre linear algebra
package.
The implementation of the hybrid FVM scheme for Compositional Multiphase Flow Solver is in progress.
This concept of ghosting and communications between owned cells and ghost cells can also be applied to the other
types of elements in GEOS (Faces, Edges, Nodes). The next figure summarizes the way nodes, edges, faces and cells
are ghosted.
In the command line to run GEOS, the user can specify the partitioning pattern by adding the following switches:
• -x, --x-partitions - Number of partitions in the x-direction
• -y, --y-partitions - Number of partitions in the y-direction
• -z, --z-partitions - Number of partitions in the z-direction
Graph-based partitioning
The Graph-based partitioning is used only when importing exernal meshes using the VTKMesh (see Tutorial 3: Regions
and Property Specifications section for more details using external meshes). While importing themesh, vtk computes
the graph of connectivity between all the volume elements of the mesh. The partitioning is then done using whether
a KD-tree or the PTSCOTCH, METIS, PARMETIS libraries. The graph is not weighted so the expected result is as
mesh divided in n parts, with n being the number of MPI ranks used for simulation containing a similar amount of
cells.
Ghost ranks
Each object (node, edge, face, or cell) has a ghost rank attribute, stored in the ghostRank field. If a object does
not appear in any other partition as a ghost, its ghost rank is a large negative number, -2.14e9 in a typical system. If
a object is real (owned by the current partition) but exists in other partitions as ghosts, its ghost rank is -1. The ghost
rank of a ghost object is the rank of the partition that owns the corresponding real object.
1.5.15 Outputs
This section describes how outputs are handled by GEOS
The outputs are defined in a <Outputs> XML block.
There are three available formats to output the results of a simulation: SILO, VTK, and Time History output into simple
dataset HDF5 files which are consumable by post-processing scripts..
Defining an output
SILO Output
The SILO output is defined through the <Silo> XML node (subnode of <Outputs> XML block) as shown here:
<Outputs>
<Silo name="siloOutput"/>
</Outputs>
VTK Output
The VTK output is defined through the <VTK> XML node (subnode of <Outputs> XML block) as shown here:
<Outputs>
<VTK name="vtkOutput"/>
</Outputs>
TimeHistory Output
The TimeHistory output is defined through the <TimeHistory> XML node (subnode of <Outputs> XML block) as
shown here:
<Outputs>
<TimeHistory name="timeHistoryOutput" sources="{/Tasks/collectionTask}" filename=
˓→"timeHistory" />
</Outputs>
In order to properly collect and output time history information the following steps must be accomplished:
1. Specify one or more collection tasks using the Tasks Manager.
2. Specify a TimeHistory Output using the collection task(s) as source(s).
3. Specify an event in the Event Management to trigger the collection task(s).
4. Specify an event in the Event Management to trigger the output.
Note: Currently if the collection and output events are triggered at the same simulation time, the one specified first will
also trigger first. Thus in order to output time history for the current time in this case, always specify the time history
collection events prior to the time history output events.
<PeriodicEvent name="outputs"
timeFrequency="5000.0"
targetExactTimestep="1"
target="/Outputs/siloOutput" />
The keyword target has to match with the name of the <Silo>, <VTK>, or <TimeHistory> node.
If the <Silo> XML node was defined, GEOS writes the results in a folder called siloFiles.
In VisIT :
1. File > Open file. . .
2. On the right panel, browse to the siloFiles folder.
3. On the left panel, select the file(s) you want to visualize. Usually, one file is written according the frequency
defined in the timeFrequency keyword of the Event that has triggered the output.
4. To load fields, use the “Add” button and browse to the fields you want to plot.
5. To plot fields, use the “Draw” button.
Please consult the VisIT documentation for further explanations on its usage.
If the <VTK> XML node was defined, GEOS writes the results in a folder named after the plotFileRoot attribute
(default = vtkOutputs). For problems with multiple active regions (e.g. Hydraulic Fracturing), additional work may
be required to ensure that vtk files can be read by VisIt. Options include:
1. Using a VisIt macro / python script to convert default multi-region vtk files (see GEOS/src/coreComponents/
python/visitMacros/visitVTKConversion.py).
2. Using the outputRegionType attribute to output separate sets of files per region. For example:
<Problem>
<Events>
<!-- Use nested events to trigger both vtk outputs -->
<PeriodicEvent
name="outputs"
timeFrequency="2.0"
targetExactTimestep="0">
<PeriodicEvent
name="outputs_cell"
target="/Outputs/vtkOutput_cell"/>
<PeriodicEvent
name="outputs_surface"
target="/Outputs/vtkOutput_surface"/>
</PeriodicEvent>
</Events>
<Outputs>
<VTK
name="vtkOutput_cell"
outputRegionType="cell"
plotFileRoot="vtk_cell"/>
<VTK
name="vtkOutput_surface"
outputRegionType="surface"
plotFileRoot="vtk_surface"/>
</Outputs>
</Problem>
7. At some point you may be prompted to create a Database Correlation. If you select Yes, then VisIt will create a
new time slider, which can be used to change the time state while keeping the various aspects of the simulation
synchronized.
8. Finally, click the Draw button and use the time slider to visualize the output.
Please consult the VisIT documentation for further explanations on its usage.
If the <VTK> XML node was defined, GEOS writes a folder and a .pvd file named after the string defined in name
keyword.
The .pvd file contains references to the .pvtu files. One .pvtu file is output according the frequency defined in the
timeFrequency keyword of the Event that has triggered the output.
One .pvtu contains references to .vtu files. There is as much .vtu file as there were MPI processes used for the
computation.
All these files can be opened with paraview. To have the whole results for every output time steps, you can open the
.pvd file.
If the <TimeHistory> XML node was defined, GEOS writes a file named after the string defined in the filename
keyword and formatted as specified by the string defined in the format keyword (only HDF5 is currently supported).
The TimeHistory file contains the collected time history information from each specified time history collector. This
information includes datasets for the time itself, any metadata sets describing index association with specified collection
sets, and the time history information itself.
It is recommended to use MatPlotLib and format-specific accessors (like H5PY for HDF5) to access and easily plot the
time history datat.
. Warning
The pygeosx module provides plenty of opportunities to crash Python. See the Segmentation Faults section below.
Module Functions
pygeosx.initialize(rank, args)
Initialize GEOS for the first time, with a rank and command-line arguments.
This function should only be called once. To reinitialize, use the reinit function.
Generally the rank is obtained from the mpi4py module and the arguments are obtained from sys.argv.
Returns a Group representing the ProblemManager instance.
pygeosx.reinit(args)
Reinitialize GEOS with a new set of command-line arguments.
Returns a Group representing the ProblemManager instance.
pygeosx.apply_initial_conditions()
Apply the initial conditions.
pygeosx.finalize()
Finalize GEOS. After this no calls into pygeosx or to MPI are allowed.
pygeosx.run()
Enter the GEOS event loop.
Runs until hitting a breakpoint defined in the input deck, or until the simulation is complete.
Returns one of the state constants defined below.
GEOS State
pygeosx.UNINITIALIZED
pygeosx.INITIALIZED
pygeosx.READY_TO_RUN
This state indicates that GEOS still has time steps left to run.
pygeosx.COMPLETED
This state indicates that GEOS has completed the current simulation.
Module Classes
class pygeosx.Group
Python interface to geos::dataRepository::Group.
Used to get access to other groups, and ultimately to get wrappers and convert them into Python views of C++
objects.
groups()
Return a list of the subgroups.
wrappers()
Return a list of the wrappers.
get_group(path)
get_group(path, default)
Return the Group at the relative path path; default is optional. If no group exists and default is not
given, raise a ValueError; otherwise return default.
get_wrapper(path)
get_wrapper(path, default)
Return the Wrapper at the relative path path; default is optional. If no Wrapper exists and default is
not given, raise a ValueError; otherwise return default.
register(callback)
Register a callback on the physics solver.
The callback should take two arguments: the CRSMatrix and the array.
Raise TypeError if the group is not the Physics solver.
class pygeosx.Wrapper
Python interface to geos::dataRepository::WrapperBase.
Wraps a generic C++ object. Use repr to get a description of the type.
value()
Return a view of the wrapped value, or None if it cannot be exported to Python.
A breakdown of the possible return types:
• Instance of a pylvarray class If the wrapped type is one of the LvArray types that have a Python wrapper
type.
• 1D numpy.ndarray If the wrapped type is a numeric constant. The returned array is a shallow copy
and has a single entry.
• str If the wrapped type is a std::string this returns a copy of the string.
• list of str If the wrapped type is a LvArray::Array< std::string, 1, . . . > or a std::vector< std::string
>. This is a copy.
• None If the wrapped type is not covered by any of the above.
Segmentation Faults
Improper use of this module and associated programs can easily cause Python to crash. There are two main causes of
crashes. Both can be avoided by following some general guidelines.
The pylvarray classes (which may be returned from Wrapper.value()) provide various ways to get Numpy views
of their data. However, those views are only valid as long as the LvArray object’s buffer is not reallocated. The buffer
may be reallocated by invoking methods (the ones that require the pylarray.RESIZEABLE permission) or by calls
into pygeosx. It is strongly recommended that you do not keep Numpy views of LvArray objects around after calls to
pygeosx.
my_array = pygeosx.get_wrapper("path").value()
view = my_array.to_numpy()
my_array.resize(1000)
print(view) # segfault
As mentioned earlier, the classes defined in this module cannot be created in Python; pygeosx must create an LvArray
object in C++, then create a pylvarray view of it. However, the Python view will only be valid as long as the
underlying LvArray C++ object is kept around. If that is destroyed, the Python object will be left holding an invalid
pointer and subsequent attempts to use the Python object will cause undefined behavior. Unfortunately, pygeosx may
destroy LvArray objects without warning. It is therefore strongly recommended that you do not keep pylvarray
objects around after calls to pygeosx. The following code snippet, for instance, could segfault:
my_array = pygeosx.get_wrapper("path").value()
pygeosx.run()
view = my_array.to_numpy() # segfault
1.6.1 Contributing
Code style
Introduction
Naming Conventions
File Names
. Warning
There should not be identical filenames that only differ by case. Some filesystems are not case-sensitive, and worse,
some filesystems such as MacOSX are case-preserving but not case sensitive.
Function Names
Variable Names
Member Names
Member data should be camelCase prefix with “m_” (i.e. double m_dataVariable;)
Class/Struct Names
class MyClass;
class MyClass
{
double m_doubleDataMember;
int m_integerDataMember;
}
Alias/Typedef Names
Alias and typedefs should be the case of the underlying type that they alias. If no clear format is apparent, as is the case
with double, then use camelCase
Namespace Names
Example
One example of would be a for a class named “Foo”, the declaration would be in a header file named “Foo.hpp”
/*
* Foo.hpp
*/
namespace bar
{
class Foo
{
public:
(continues on next page)
/*
* Foo.cpp
*/
namespace bar
{
Foo::Foo():
m_myDouble(0.0)
{
// some constructor stuff
}
}
Const Keyword
1. All functions and accessors should be declared as “const” functions unless modification to the class is required.
2. In the case of accessors, both a “const” and “non-const” version should be provided.
3. The const keyword should be placed in the location read by the compiler, which is right to left.
The following examples are provided:
Code Format
GEOS applies a variant of the BSD/Allman Style. Key points to the GEOS style are:
1. Opening braces (i.e. “{”) go on the next line of any control statement, and are not indented from the control
statement.
2. NO TABS. Only spaces. In case it isn’t clear . . . NO TABS!
3. 2-space indentation
4. Try to stay under 100 character line lengths. To achieve this apply these rules in order
5. Align function declaration/definitions/calls on argument list
void
SolidMechanics_LagrangianFEM::
TimeStepExplicit( real64 const& time_n,
real64 const& dt,
const int cycleNumber,
DomainPartition * const domain )
{
code here
}
As part of the continuous integration testing, this GEOS code style is enforced via the uncrustify tool. While quite
extensive, uncrustify does not enforce every example of the preferred code style. In cases where uncrusitfy is unable to
enforce code style, it will ignore formatting rules. In these cases it is acceptable to proceed with pull requests, as there
is no logical recourse.
Header Guards
Header guard names should consist of the name GEOS, followed by the component name (e.g. dataRepository), and
finally the name of the header file. All characters in the macro should be capitalized.
Git Workflow
The GEOS project is hosted on github here. For instructions on how to clone and build GEOS, please refer to the Quick
Start Guide. Consider consulting https://try.github.io/ for practical references on how to use git.
Git Credentials
Those who want to contribute to GEOS should setup SSH keys for authentication, and connect to github through SSH
as discussed in this article. Before going further, you should test your ssh connection. If it fails (perhaps because of
your institution’s proxy), you may consider the personal access token option as an alternative.
Once you have created an ssh-key and you have added it to your Github account you can download the code through
SSH. The following steps clone the repository into your_geosx_dir:
If all goes well, you should have a complete copy of the GEOS source at this point. The most common errors people
encounter here have to do with Github not recognizing their authentication settings.
Branching Model
The branching model used in GEOS is a modified Gitflow approach, with some modifications to the merging strategy,
and the treatment of release branches, and hotfix branches.
In GEOS, there are two main branches, release and develop. The develop branch serves as the main branch for the
development of new features. The release branch serves as the “stable release” branch. The remaining branch types
are described in the following subsections.
ò Note
The early commits in GEOS (up to version 0.2) used a pure Gitflow approach for merging feature branches into
develop. This was done without cleaning the commit history in each feature branch prior to the merge into develop,
resulting in an overly verbose history. Furthermore, as would be expected, having many active feature branches
resulted in a fairly wide (spaghetti) history. At some point in the development process, we chose to switch primarily
to a squash-merge approach which results in a linear develop history. While this fixes the spaghetti history, we do
potentially lose important commit history during the development process. Options for merging are discussed in
the following sections.
Feature Branches
New developments (new features or modifications to features) are branched off of develop into a feature branch.
The naming of feature branches should follow feature/[developer]/[branch-description] if you expect that
only a single developer will contribute to the branch, or feature/[branch-description] if you expect it will be a
collaborative effort. For example, if a developer named neo were to add or modify a code feature expecting that they
would be the only contributor, they would create a branch using the following commands to create the local branch and
push it to the remote repository:
However if the branch is a collaborative branch amongst many developers, the appropriate commands would be:
When feature branches are ready to be merged into develop, a Pull Request should be created to perform the
review and merging process.
An example lifecycle diagram for a feature branch:
A-------B-------C (develop)
\
\
BA (feature/neo/freeYourMind)
A-------B--------C-------D--------E (develop)
\ /
\ /
BA----BB----BC (feature/neo/freeYourMind)
Bugfix Branches
Bugfix branches are used to fix bugs that are present in the develop branch. A similar naming convention to that of
the feature branches is used, replacing “feature” with “bugfix” (i.e. bugfix/neo/squashAgentSmith). Typically,
bugfix branches are completed by a single contributor, but just as with the feature branches, a collaborative effort
may be required resulting a dropping the developer name from the branch name.
When bugfix branches are ready to be merged into develop, a Pull Request should be created to perform the
review and merging process. See below for details about Submitting a Pull Request.
When develop has progressed to a point where we would like to create a new release, we will create a release
candidate branch with the name consisting of release_major.minor.x number, where the x represents the sequence
of patch tags that will be applied to the branch. For instance if we were releasing version 1.2.0, we would name the
branch release_1.2.x. Once the release candidate is ready, it is merged back into develop. Then the develop
branch is merged into the release branch and tagged. From that point the release branch exists to provide a basis
for maintaining a stable release version of the code. Note that the absence of hotfix branches, the history for release
and develop would be identical.
An example lifecycle diagram for a release candidate branch:
v1.2.0 (tag)
G (release)
^
|
A----B-----C----D-----E-----F-----G------------ (develop)
\ \ /
\ \ /
BA----BB----BC----BD (release_1.2.x)
Hotfix Branches
A hotfix branch fixes a bug in the release branch. It uses the same naming convention as a bugfix branch. The
main difference with a bugfix branch is that the primary target branch is the release branch instead of develop. As
a soft policy, merging a hotfix into a release branch should result in a patch increment for the release sequence of
tags. So if a hotfix was merged into release with a most recent tag of 1.2.1, the merged commit would be tagged
with 1.2.2. Finally, at some point prior to the next major/minor release, the release branch should be merged back
into develop to incorporate any hotfix changes into develop.
An example lifecycle diagram for hotfix branchs:
Documentation Branches
A docs branch is focused on writing and improving the documentation for GEOS. The use of the docs branch name
root applies to both sphinx documentation and doxygen documentation. The docs branch follows the same naming
conventions as described in the Feature Branches section. The html produced by a documentation branch should be
proofread using sphinx/doxygen prior to merging into develop.
Over the course of a long development effort in a single feature branch, a developer may need to either merge develop
into their feature branch, or rebase their feature branch on develop. We do not have a mandate on how you
keep your branch current, but we do have guidelines on the branch history when merging your branch into develop.
Typically, merging develop into your branch is the easiest approach, but will lead to a complex relationship with
develop with multiple interactions. . . which can lead to a confusing history. Conversely, rebasing your branch onto
develop is more difficult, but will lead to a linear history within the branch. For a complex history, we will perform a
squash merge into develop, thereby the work from the branch will appear as a single commit in develop. For clean
branch histories where the individual commits are meaningful and should be preserved, we have the option to perform
a merge commit in with the PR is merged into develop, with the addition of a merge commit, thus maintaining the
commit history.
During the development processes, sometimes it is appropriate to create a branch off of a branch. For instance, if there
is a large collaborative development effort on the branch feature/theMatrix, and a developer would like to add a
self-contained and easily reviewable contribution to that effort, he/she should create a branch as follows:
A----B----C----D----E----F----G----E (develop)
\ /
CA---CB---CC---CD (feature/theMatrix)
\
CCA--CCB--CCC (feature/smith/dodgeBullets)
In order to successfully merge feature/smith/dodgeBullets into develop, all commits present in feature/
smith/dodgeBullets after CC must be included, while discarding CA, CB, which exist in feature/smith/
dodgeBullets as part of its history, but not in develop.
One “solution” is to perform a git rebase --onto of feature/smith/dodgeBullets onto develop. Specif-
ically, we would like to rebase CCA, CCB, CCC onto G, and proceed with our development of feature/smith/
dodgeBullets. This would look like:
As should be apparent, we have specified the starting point as G, and the point at which we replay the commits in
feature/smith/dodgeBullets as all commits AFTER CC. The result is:
A----B----C----D----E----F----G----E (develop)
\
CCA'--CCB'--CCC' (feature/smith/dodgeBullets)
Now you may proceed with standard methods for keeping feature/smith/dodgeBullets current with develop.
Once you have created your branch and pushed changes to Github, you can create a Pull Request on Github. The PR
creates a central place to review and discuss the ongoing work on the branch. Creating a pull request early in the
development process is preferred as it allows for developers to collaborate on the branch more readily.
ò Note
When initially creating a pull request (PR) on GitHub, always create it as a draft PR while work is ongoing and the
PR is not ready for testing, review, and merge consideration.
When you create the initial draft PR, please ensure that you apply appropriate labels. Applying labels allows other
developers to more quickly filter the live PRs and access those that are relevant to them. Always add the new label upon
PR creation, as well as to the appropriate type, priority, and effort labels. In addition, please also add any appropriate
flags.
ò Note
If your branch and PR will resolve any open issues, be sure to link them to the PR to ensure they are appropriately
resolved once the PR is merged. In order to link the issue to the PR for automatic resolution, you must use one
of the keywords followed by the issue number (e.g. resolves #1020) in either the main description of the PR, or a
commit message. Entries in PR comments that are not the main description or a commit message will be ignored,
and the issue will not be automatically closed. A complete list of keywords are:
• close
• closes
• closed
• fix
• fixes
• fixed
• resolve
• resolves
• resolved
For more details, see the Github Documentation.
Once you are satisfied with your work on the branch, you may promote the PR out of draft status, which will allow our
integrated testing suite to execute on the PR branch to ensure all tests are passing prior to merging.
ò Note
The title of a PR has to follow the conventional commit specification. The allowed prefixes are:
• feat: A new feature
• fix: A bug fix,
• docs: Documentation only changes,
• style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc),
• refactor: A code change that neither fixes a bug nor adds a feature,
• perf: A code change that improves performance,
• test: Adding missing tests or correcting existing tests,
• build: Changes that affect the build system or external dependencies (example scopes: cmake),
• ci: Changes to our CI configuration files and scripts (example scopes: github),
• chore: Other changes that don’t modify src or test files,
• revert: Reverts a previous commit,
Once the tests are passing – or in some cases immediately – add the flag: ready for review label to the PR, and be sure
to tag any relevant developers to review the PR. The PR must be approved by reviewers in order to be merged.
Note that whenever a pull request is merged into develop, commits are either squashed, or preserved depending on
the cleanliness of the history.
Whenever you switch between branches locally, pull changes from origin and/or merge from the relevant branches,
it is important to update the submodules to move the head to the proper commit.
You may also wish to modify your git pull behavior to update your submodules recursively for you in one command,
though you forfeit some control granularity to do so. The method for accomplishing this varies between git versions,
but as of git 2.15 you should be able to globally configure git to accomplish this via:
In some cases, code changes will require to rebaseline the Integrated Tests. If that is the case, you will need
to modify the integrated tests submodule. Instructions on how to modify a submodule are presented in the
following section.
Sometimes it may be necessary to modify one of the submodules. In order to do so, you need to create a pull request
on the submodule repository. The following steps can be followed in order to do so.
Move to the folder of the submodule that you intend to modify.
cd submodule-folder
Currently the submodule is in detached head mode, so you first need to move to the main branch (either develop or
master) on the submodule repository, pull the latest changes, and then create a new branch.
You can perform some work on this branch, add and commit the changes and then push the newly created branch to the
submodule repository on which you can eventually create a pull request using the same process discussed above
in Submitting a Pull Request.
When you conduct work on a submodule during work on a primary GEOS branch with an open PR, the merging
procedure requires that the submodule referenced by the GEOS PR branch be consistent with the submodule in the
main branch of the project. This is checked and enforced via our CI.
Thus, in order to merge a PR that includes modifications to submodules, the various PRs for each repository should be
staged and finalized, to the point they are all ready to be merged, with higher-level PRs in the merge hierarchy having
the correct submodule references for the current main branch for their repository.
Starting from the bottom of the submodule hierarchy, the PRs are resolved, after which the higher-level PRs with
reference to a resolved PR must update their submodule references to point to the new main branch of the submodule
with the just-resolved PR merged. After any required automated tests pass, the higher-level PRs can then be merged.
The name of the main branch of each submodule is presented in the table below.
Sphinx Documentation
Generating the documentation
• To generate the documentation files, you will need to install Sphinx using:
• Then you can generate the documentation files with the following commands:
cd /path/to/GEOS/build-your-platform-release
make geosx_docs
/path/to/GEOS/build-your-platform-release/html/docs/sphinx
The documentation is generated from restructured text files (.rst). Most files can be found in src/docs/sphinx.
Files which are specific to parts of the code, like those describing a specific class, can instead be found in docs subdi-
rectory in the folder containing the source code.
Information about how to write rst files can be found here .
As part of the Continuous Integration process, the documentation is built on readthedocs, and any warnings or errors
result in a failure test failure. What follows is a brief guide on how to fix the most common errors.
1. Navigate to the readthedocs build logs. This can be done by clicking on the failed test in the github test summary.
1. Download the logs from the failed test on readthedocs through the “view raw” button.
#. Perform a case sensitive search for “WARNING:” or “ERROR” to locate the sphinx issues. Note that there will be
numerous doxygen warnings that should be ignored.
Doxygen Documentation
Developer documentation of code is provided in the form of Doxygen-style comment blocks. Doxygen is a tool for
generating html/xml/latex documentation for C++ code from specially marked code comments. Having concise but
high quality documentation of public APIs helps both users and developers of these APIs. We use Doxygen and Ctest
to enforce documentation coverage. If Doxygen produces any warnings, your pull request will fail CI checks! See Git
Workflow for more on pull requests and CI.
Accessing
Build locally
ò Note
cd GEOS/build-your-platform-release
make geosx_doxygen
make geosx_docs
Open in browser:
google-chrome html/doxygen_output/html/index.html
On readthedocs
Go to GEOS documentation, select the version of interest, and follow the Doxygen link at the left-hand-side.
Guidelines
What to document
The following entities declared in project header files within geosx namespace require documentation:
• all classes and structs, including public nested ones
• global functions, variables and type aliases
• public and protected member functions, variables and type aliases in classes
• preprocessor macros
Exceptions are made for:
• overrides of virtual functions in derived types
• implementation details nested in namespace internal
• template specializations in some cases
How to document
The following rules and conventions are used. Some are stricter than others.
1. We use @-syntax for all Doxygen commands (e.g. @brief instead of \brief ).
2. Entities such as type aliases and member variables that typically only require a brief description, can have a
single-line documentation starting with ///.
• @brief is not required for single-line comments.
3. Entities such as classes and functions that typically require either detailed explanation or parameter documenta-
tion, are documented with multiline comment blocks.
• @brief is required for comment blocks.
4. Brief and detailed descriptions should be complete sentences (i.e. start with a capital letter and end with a dot).
5. Prefer concise wording in @brief, e.g. “Does X.” instead of “This is a function that does X.”
6. All functions parameters and return values must be explicitly documented via @param and @return.
• An exception to this rule seem to be copy/move constructor/assignment, where parameter documentation
can be omitted.
7. Add [in] and [out] tags to function parameters, as appropriate.
8. Function and template parameter descriptions are not full sentences (i.e. not capitalized nor end with a dot).
9. For hierarchies with virtual inheritance, document base virtual interfaces rather than overriding implementations.
10. Documented functions cannot use GEOS_UNUSED_ARG() in their declarations.
11. For empty virtual base implementations that use GEOS_UNUSED_ARG(x) to remove compiler warnings, use
one of two options:
• move empty definition away (e.g. out of class body) and keep GEOS_UNUSED_ARG(x) in definition only;
• put GEOS_UNUSED_VAR(x) into the inline empty body.
12. For large classes, logically group functions using member groups via ///@{ and ///@} and give them group names
and descriptions (if needed) via a @name comment block. Typical groups may include:
• constructors/destructor/assignment operators;
• getter/setter type functions;
• overridable virtual functions;
• any other logically coherent groups (functions related to the same aspect of class behavior).
13. In-header implementation details (e.g. template helpers) often shouldn’t appear in user documentation. Wrap
these into internal namespace.
14. Use /// @cond DO_NOT_DOCUMENT and /// @endcond tags to denote a section of public API that should not
be documented for some reason. This should be used rarely and selectively. An example is in-class helper structs
that must be public but that user should not refer to explicitly.
Example
/**
* @brief Short description.
* @tparam T type of input value
* @param[in] x input value explanation
* @return return value explanation
*
* Detailed description goes here.
*
* @note A note warning users of something unexpected.
*/
template<typename T>
int Foo( T const & x );
/**
* @brief Class for showing Doxygen.
* @tparam T type of value the class operates on
*
* This class does nothing useful except show how to use Doxygen.
*/
template<typename T>
class Bar
{
public:
(continues on next page)
/**
* @name Constructors/destructors.
*/
///@{
/**
* @brief A documented constructor.
* @param value to initialize the object
*/
explicit Bar( T t );
/**
* @brief A deleted, but still documented copy constructor.
* @param an optionally documented parameter
*/
Bar( Bar const & source ) = delete;
/**
* @brief A defaulted, but still documented move constructor.
* @param an optionally documented parameter
*/
Bar( Bar const & source ) = default;
/**
* @brief A documented desctructor.
* virtual ~Bar() = default;
*/
///@}
/**
* @name Getters for stored value.
*/
///@{
/**
* @brief A documented public member function.
* @return a reference to contained value
*/
T & getValue();
/**
* @copydoc getValue()
*/
T const & getValue() const;
///@}
/**
* @brief A documented protected pure virtual function.
* @param[in] x the input value
* @param[out] y the output value
*
* Some detailed explanation for users and implementers.
*/
virtual void doSomethingOverridable( int const x, T & y ) = 0;
private:
};
Current Doxygen
Unit Testing
Unit testing is integral to the GEOS development process. While not all components naturally lend themselves to unit
testing (for example a physics solver) every effort should be made to write comprehensive quality unit tests.
Each sub-directory in coreComponents should have a unitTests directory containing the test sources. Each test
consists of a cpp file whose name begins with test followed by a name to describe the test. Please read over the
LvArray unit test documentation as it gives an intro to the Google Test framework and a set of best practices.
An informative example is testSinglePhaseBaseKernels which tests the single phase flow mobility and accumu-
lation kernels on a variety of inputs.
real64 mob;
real64 dMob_dPres;
// compute etalon
real64 const mob_et = dens[i] / visc[i];
real64 const dMob_dPres_et = mob_et * (dDens_dPres[i] / dens[i] - dVisc_dPres[i] /␣
˓→visc[i]);
[Source: coreComponents/physicsSolvers/fluidFlow/unitTests/testSinglePhaseMobilityKernel.cpp]
What makes this such a good test is that it depends on very little other than kernels themselves. There is no need to
involve the data repository or parse an XML file. Sometimes however this is not possible, or at least not without a
significant duplication of code. In this case it is better to embed the XML file into the test source as a string instead
of creating a separate XML file and passing it to the test as a command line argument or hard coding the path. One
example of this is testLaplaceFEM which tests the laplacian solver. The embedded XML is shown below.
<NonlinearSolverParameters newtonTol="1.0e-6"
newtonMaxIter="2"/>
<LinearSolverParameters solverType="gmres"
krylovTol="1.0e-10"/>
</CompositionalMultiphaseFVM>
(continues on next page)
</ElementRegions>
<Constitutive>
<CompositionalMultiphaseFluid name="fluid"
phaseNames="{oil, gas}"
equationsOfState="{PR, PR}"
componentNames="{N2, C10, C20, H2O}"
componentCriticalPressure="{34e5, 25.3e5, 14.6e5,␣
˓→220.5e5}"
[Source: coreComponents/physicsSolvers/fluidFlow/unitTests/testCompMultiphaseFlow.cpp]
MPI
Often times it makes sense to write a unit test that is meant to be run with multiple MPI ranks. This can be accomplished
by simply adding the NUM_MPI_TASKS parameter to geos_add_test in the CMake file. For example
With this addition make test or calling ctest directly will run testWithMPI via something analogous to mpirun
-n NUMBER_OF_MPI_TASKS testWithMPI.
<Included>
<File name="./myProblem_base.xml"/>
</Included>
The files should be placed in the appropriate application specific subdirectory under the GEOS/inputFiles directory.
For example, the beamBending problem input files reside in the inputFiles/solidMechanics directory. The files
then be linked to from the appropriate location in the integratedTests repository as described in the following
section.
Integrated Tests
About
The GEOS integrated test system leverages the Automated Test System (ATS) and GEOS ATS packages to run various
combinations of input files and machine configurations. The output of these runs are then compared to baseline files
and/or analytic solutions to guarantee the accuracy of the code.
Structure
GEOS integrated tests are defined in the GEOS/inputFiles directory, and are organized into folders based on the physical
processes being tested. A test folder can contain any number of .ats configuration files, .xml input files, and supporting
inputs (tables files, meshes, etc.).
- inputFiles/
- main.ats/
- solidMechanics/
- sedov.ats
- sedov.xml
(continues on next page)
Test baselines are stored as .tar.gz archive and share the same directory structure as GEOS/inputFiles. During
test execution, the geos_ats package will fetch and unpack any necessary baselines described in the top-level .inte-
grated_tests.yaml configuration file.
GEOS CI Pipeline
In most cases, developers will be able to rely on the integrated tests that are run as part of the GEOS CI Pipeline. These
can be triggered if the ci: run integrated tests label is selected for a pull request (this can be added from the right-hand
panel on PR page).
To inspect the results of CI tests, select the Checks tab from the top of the pull request and then select
run_integrated_tests/build_test_deploy from the left-hand panel.
This page will show the full output of GEOS build process and the integrated test suite. At the bottom of this page, the
logs will contain a summary of the test results and a list of any ignored/failed tests.
=======================
Integrated test results
=======================
expected: 0
created: 0
(continues on next page)
The log will provide instructions on where to download the test results and a baseline ID that can be assigned in the
.integrated_tests.yaml file.
. code-block:: sh
Download the bundle at https://storage.googleapis.com/geosx/integratedTests/baseline_
integratedTests-pr3044-4400-e6359ca.tar.gz New baseline ID: baseline_integratedTests-pr3044-4400-
e6359ca
ò Note
Integrated tests within GEOS CI pipeline are run on a shared machine, and may take up to 30 minutes to complete.
It may take some time for the tests to begin if the machine is in use by other developers.
Before running the integrated tests manually, we recommend that you define the following variables in your machine’s
host configuration file:
• ATS_WORKING_DIR : The location where tests should be run (default=*GEOS/[build-
dir]/integratedTests/workingDir*)
• ATS_BASELINE_DIR : The location where test baselines should be stored (default=*GEOS/integratedTests*)
ò Note
The ATS_WORKING_DIR should be located on a file system that is amenable to parallel file IO.
After building GEOS, the integrated tests can be triggered in the GEOS build directory with the following commands:
• make ats_environment : Setup the testing environment (Note: this step is run by default for the other make
targets). This process will install packages required for testing into the python environment defined in your
current host config file. Depending on how you have built GEOS, you may be prompted to manually run the
make pygeosx command and then re-run this step.
• make ats_run : Run all of the available tests (see the below note on testing resources).
• make ats_clean : Remove any unnecessary files created during the testing process (.vtk, .hdf5 files, etc.)
• make ats_rebaseline : Selectively update the baseline files for tests.
• make ats_rebaseline_failed : Automatically update the baseline files for any failed tests.
ò Note
The make ats_environment and make ats_run steps may require internet access to collect python packages and
baseline files.
ò Note
Running the integrated tests requires significant computational resources. If you are on a shared system, we rec-
ommend that you only run make ats_run within an allocation.
ò Note
We forward any arguments included in the ATS_ARGUMENTS cmake variable to the testing system. For example,
on LLNL Lassen builds we select a couple of runtime options: set(ATS_ARGUMENTS “–ats jsrun_omp –ats
jsrun_bind=packed” CACHE STRING “”)
ò Note
When running test or creating new baselines on LC systems, we recommend that you use the quartz-gcc-12-release
configuration
For cases where you need additional control over the integrated tests behavior, you can use this script in your build
directory: /path/to/GEOS/build-xyz/integratedTests/geos_ats.sh. To run the tests, simply call this script with any desired
arguments (see the output of geos_ats.sh –help for additional details.) Common options for this script include:
• -a/–action : The type of action to run. Common options include: run, veryclean, rebaseline, and rebaselinefailed.
• -r/–restartCheckOverrides : Arguments to pass to the restart check function. Common options include:
skip_missing (ignores any new/missing values in restart files) and exclude parameter1 parameter2 (ignore these
values in restart files).
• –machine : Set the ats machine type name.
• –ats : Pass an argument to the underlying ats framework. Running geos_ats.sh –ats help will show you a list of
available options for your current machine.
Machine Definitions
On many machines, ATS will automatically identify your machine’s configuration and optimize it’s performance. If
the tests fail to run or to properly leverage your machine’s resources, you may need to manually configure the machine.
If you know the appropriate name for your machine in ATS (or the geos_ats package), then you can run ./geos_ats.sh
–machine machine_name –ats help to see a list of potential configuration options.
The openmpi machine is a common option for non-LC systems. For a system with 32 cores/node, an appropriate run
command might look like:
˓→installation"
ò Note
ò Note
When you have identified a set of arguments that work for your machine, we recommend recording in the
ATS_ARGUMENTS cmake variable in your system host config file.
Test Filtering
An arbitrary number of filter arguments can be supplied to ATS to limit the number of tests to be run. Filter ar-
guments should refer to an ATS test variable and use a python-syntax (e.g.: “‘some_string’ in ats_variable” or
“ats_variable<10”). These can be set via command-line arguments (possible via the ATS_ARGUMENTS variable):
While the tests are running, the name and size of the active test will be periodically printed out to the
screen. Test result summaries will also be periodically written to the screen and files in /path/to/GEOS/build-
xyz/integratedTests/TestsResults. For most users, we recommend inspecting the test_results.html file in your browser
(e.g.: firefox integratedTests/TestsResults/test_results.html). Tests will be organized by their status variable, which in-
cludes:
• RUNNING : The test is currently running
• NOT RUN : The test is waiting to start
Test Output
Output files from the tests will be stored in the specified working directory (linked here: /path/to/GEOS/build-
xyz/integratedTests/TestsResults). Using the serial beam bending test as an example, key output files include:
• beamBending_01.data : Contains the standard output for all test steps.
• beamBending_01.err : Contains the standard error output for all test steps.
• displacement_history.hdf5 : Contains time history information that is used as an input to the curve check step.
• totalDisplacement_trace.png : A figure displaying the results of the curve check step.
• beamBending.geos.out : Contains the standard output for only the geos run step.
• beamBending_restart_000000010.restartcheck which holds all of the standard output for only the restartcheck
step.
• beamBending_restart_000000010.0.diff.hdf5 which mimmics the hierarchy of the restart file and has links to the
See Restart Check and Curve Check for further details on the test checks and output files.
Restart Check
This check compares a restart file output at the end of a run against a baseline. The python
script that evaluates the diff is included in the geos_ats package, and is located here: integrat-
edTests/scripts/geos_ats_package/geos_ats/helpers/restart_check.py. The script compares the two restart files
and writes out a .restart_check file with the results, as well as exiting with an error code if the files compare differently.
This script takes two positional arguments and a number of optional keyword arguments:
• file_pattern : Regex specifying the restart file. If the regex matches multiple files the one with the greater string
is selected. For example restart_100.hdf5 wins out over restart_088.hdf5.
• baseline_pattern : Regex specifying the baseline file.
• -r/–relative : The relative tolerance for floating point comparison, the default is 0.0.
• -a/–absolute : The absolute tolerance for floating point comparison, the default is 0.0.
• -e/–exclude : A list of regex expressions that match paths in the restart file tree to exclude from comparison. The
default is [.*/commandLine].
• -w/-Werror : Force warnings to be treated as errors, default is false.
• -m/–skip-missing : Ignore values that are missing from either the baseline or target file.
The itself starts off with a summary of the arguments. The script begins by recording the arguments to the .restart_check
file header, and then compares the .root restart files to their baseline. If these match, the script will compare the linked
.hdf5 data files to their baseline. If the script encounters any differences it will output an error message, and record a
summary to the .restart_check file.
The restart check step can be run in parallel using mpi via
In this case rank zero reads in the restart root file and then each rank parses a subset of the data files creating a
.$RANK.restartcheck file. Rank zero then merges the output from each of these files into the main .restartcheck file
and prints it to standard output.
Error: /datagroup_0000000/sidre/external/ProblemManager/domain/ConstitutiveManager/shale/
˓→YoungsModulus
Where the first value is the value in the test’s restart file and the second is the value in the baseline.
Error: /datagroup_0000000/sidre/external/ProblemManager/domain/MeshBodies/mesh1/Level0/
˓→nodeManager/TotalDisplacement
Arrays of types float64 and float64 have 1836 values of which 1200 have differing␣
˓→values.
This means that the max absolute difference is 2.47 which occurs at value 1834. Of the values that are not equal the
mean absolute difference is 0.514 and the standard deviation of the absolute difference is 0.702.
When the tolerances are non zero the comparison is a bit more complicated. From the FileCompari-
son.compareFloatArrays method documentation
Error: /datagroup_0000000/sidre/external/ProblemManager/domain/MeshBodies/mesh1/Level0/
˓→nodeManager/TotalDisplacement
Arrays of types float64 and float64 have 1836 values of which 1200 fail both the␣
˓→relative and absolute tests.
Statistics of the q values greater than 1.0 defined by the absolute tolerance: N = 1200
max = 16492717650.3, mean = 3430023217.52, std = 4680859258.74
Statistics of the q values greater than 1.0 defined by the relative tolerance: N = 0
Each error generated in the restartcheck step creates a group with three children in the _diff.df5 file. For example the
error given above will generate a hdf5 group
/FILENAME/datagroup_0000000/sidre/external/ProblemManager/domain/MeshBodies/mesh1/Level0/
˓→nodeManager/TotalDisplacement
with datasets baseline, run and message where FILENAME is the name of the restart data file being compared. The
message dataset contains a copy of the error message while baseline is a symbolic link to the baseline dataset and run
is a sumbolic link to the dataset genereated by the run. This allows for easy access to the raw data underlying the diff
without data duplication. For example if you want to extract the datasets into python you could do this:
import h5py
file_path = "beamBending_restart_000000003_diff.hdf5"
path_to_data = "/beamBending_restart_000000011_0000000.hdf5/datagroup_0000000/sidre/
˓→external/ProblemManager/domain/MeshBodies/mesh1/Level0/nodeManager/TotalDisplacement"
f = h5py.File("file_path", "r")
error_message = f["path_to_data/message"]
run_data = f["path_to_data/run"][:]
baseline_data = f["path_to_data/baseline"][:]
# Now run_data and baseline_data are numpy arrays that you may use as you see fit.
rtol = 1e-10
atol = 1e-15
absolute_diff = np.abs(run_data - baseline_data) < atol
hybrid_diff = np.close(run_data, baseline_data, rtol, atol)
When run in parallel each rank creates a .$RANK.diff.hdf5 file which contains the diff of each data file processed by
that rank.
Curve Check
This check compares time history (.hdf5) curves generated during GEOS execution against baseline and/or analytic
solutions. In contrast to restart checks, curve checks are designed to be flexible with regards to things like mesh
construction, time stepping, etc. The python script that evaluates the diff is included in the geos_ats package, and is
located here: integratedTests/scripts/geos_ats_package/geos_ats/helpers/curve_check.py. The script renders the curve
check results as a figure, and will throw an error if curves are out of tolerance. This script takes two positional arguments
and a number of optional keyword arguments:
• filename : Path to the time history file.
• baseline : Path to the baseline file.
• -c/–curve : Add a curve to the check (value) or (value, setname). Multiple curves are allowed.
• -s/–script : Python script instructions for curve comparisons (path, function, value, setname)
• -t/–tolerance : The tolerance for each curve check diffs (||x-y||/N). Default is 0.
if __name__ == '__main__':
main()
This script will then check the size of the time history items, and will attempt to interpolate them if they do not match
(currently, we only support interpolation in time). Finally, the script will compare the time history values to the baseline
values and any script-generated values. If any curves do not match (||x-y||/N > tol), this will be recorded as an error.
The following error would indicate that the requested baseline file was not found:
This type of error can occur if you are adding a new test, or if you time history output failed.
The following errors would indicate that values were not found in time history files:
The following error would indicate that a given curve exceeded its tolerance compared to script-generated values:
Files with the .ats extension are used to configure the integratedTests. They use a Python 3.x syntax, and have a
set of ATS-related methods loaded into the scope (TestCase, geos, source, etc.). The root configuration file (integrat-
edTests/tests/allTests/main.ats) finds and includes any test definitions in its subdirectories. The remaining configuration
files typically add one or more tests with varying partitioning and input xml files to ATS.
The inputFiles/solidMechanics/sedov.ats file shows how to add three groups of tests. This file begins by defining a set
of common parameters, which are used later:
curvecheck_params = {}
curvecheck_params['filename'] = 'veloc_history.hdf5'
curvecheck_params['tolerance'] = 1e-10
curvecheck_params['time_units'] = 'milliseconds'
curvecheck_params['curves'] = [['velocity', 'source']]
decks = [
TestDeck(
name="sedov_finiteStrain_smoke",
description="Test the basic sedov problem and restart capabilities",
partitions=partitions,
restart_step=50,
check_step=100,
restartcheck_params=RestartcheckParameters(**restartcheck_params),
curvecheck_params=CurveCheckParameters(**curvecheck_params))
]
generate_geos_tests(decks)
and registers a unique test case with the TestDeck method, which accepts the following arguments:
• name : The name of the test
• description : A brief description of the test
• partitions : A list of partition schemes to be tested
• restart_step : The cycle number where GEOS should test its restart capability
• check_step : The cycle number where GEOS should evaluate output files
• restartcheck_params : Parameters to forward to the restart check (tolerance, etc.)
• curvecheck_params: Parameters to forward to the curve check (tolerance, etc.)
ò Note
An .ats file can create any number of tests and link to any number of input xml files. For any given test step, we
expect that at least one restart or curve check be defined.
To add a new set of tests, create a new folder under the GEOS/inputFiles directory. This folder needs to include at
least one .ats file to be included in the integrated tests. Using the sedov example, after creating sedov.ats the directory
should look like
- inputFiles/solidMechanics
- sedov.ats
- sedov.xml
These changes will be reflected in the new baselines after triggering the manual rebaseline step.
Rebaselining Tests
Occasionally you may need to add or update baseline files in the repository (possibly due to feature changes in the
code). This process is called rebaselining. We suggest the following workflow:
1. Open a pull request for your branch on github and select the ci: run integrated tests label
2. Wait for the tests to finish
3. Download and unpack the new baselines from the link provided at the bottom of the test logs
4. Inspect the test results using the test_results.html file
5. Verify that the changes in the baseline files are desired
6. Update the baseline ID in the GEOS/.integrated_tests.yaml file
7. Add a justification for the baseline changes to the GEOS/BASELINE_NOTES.md file
8. Commit your changes and push the code
9. Wait for the CI tests to re-run and verify that the integrated tests step passed
Tips
Parallel Tests: On some development machines geosxats won’t run parallel tests by default (e.g. on an linux laptop or
workstation), and as a result many baselines will be skipped. We highly recommend running tests and rebaselining on
an MPI-aware platform.
Filtering Checks: A common reason for rebaselining is that you have changed the name of an XML node in the input
files. While the baselines may be numerically identical, the restarts will fail because they contain different node names.
In this situation, it can be useful to add a filter to the restart check script using the geos_ats.sh script (see the -e and -m
options in Override Test Behavior )
Benchmarks
In addition to the integrated tests which track code correctness we have a suite of benchmarks that track performance.
Because performance is system specific we currently only support running the benchmarks on the LLNL machines
Quartz and Lassen. If you are on either of these machines the script benchmarks/runBenchmarks.py can be used
to run the benchmarks.
positional arguments:
geosxPath The path to the GEOS executable to benchmark.
outputDirectory The parent directory to run the benchmarks in.
(continues on next page)
optional arguments:
-h, --help show this help message and exit
-t TIMELIMIT, --timeLimit TIMELIMIT
Time limit for the entire script in minutes, the
default is 60.
-o TIMINGCOLLECTIONDIR, --timingCollectionDir TIMINGCOLLECTIONDIR
Directory to copy the timing files to.
-e ERRORCOLLECTIONDIR, --errorCollectionDir ERRORCOLLECTIONDIR
Directory to copy the output from any failed runs to.
At a minimum you need to pass the script the path to the GEOS executable and a directory to run the benchmarks in.
This directory will be created if it doesn’t exist. The script will collect a list of benchmarks to be run and submit a
job to the system’s scheduler for each benchmark. This means that you don’t need to be in an allocation to run the
benchmarks. Note that this is different from the integrated tests where you need to already be in an allocation and an
internal scheduler is used to run the individual tests. Since a benchmark is a measure of performance to get consistent
results it is important that each time a benchmark is run it has access to the same resources. Using the system scheduler
guarantees this.
In addition to whatever outputs the input would normally produce (plot files, restart files, . . . ) each benchmark will
produce an output file output.txt containing the standard output and standard error of the run and a .cali file
containing the Caliper timing data in a format that Spot can read.
ò Note
A future version of the script will be able to run only a subset of the benchmarks.
Specifying a benchmark
A group of benchmarks is specified with a standard GEOS input XML file with an extra Benchmarks block added at
the top level. This block is ignored by GEOS itself and only used by the runBenchmarks.py script.
<Benchmarks>
<quartz>
<Run
name="OMP"
nodes="1"
tasksPerNode="1"
timeLimit="10"
autoPartition="On"/>
<Run
name="MPI_OMP"
autoPartition="On"
timeLimit="10"
nodes="1"
tasksPerNode="2"
scaling="strong"
scaleList="{ 1, 2, 4, 8 }"/>
<Run
name="MPI"
autoPartition="On"
timeLimit="10"
(continues on next page)
<lassen>
<Run
name="OMP_CUDA"
nodes="1"
tasksPerNode="1"
autoPartition="On"
timeLimit="10"/>
<Run
name="MPI_OMP_CUDA"
autoPartition="On"
timeLimit="10"
nodes="1"
tasksPerNode="4"
scaling="strong"
scaleList="{ 1, 2, 4, 8 }"/>
</lassen>
</Benchmarks>
[Source: benchmarks/SSLE-small.xml]
The Benchmarks block consists of a block for each machine the benchmarks are to run on. Currently the only options
are quartz, lassen, and crusher.
Each machine block contains a number of Run blocks each of which specify a family of benchmarks to run. Each Run
block must have the following required attributes
• name: The name of the family of benchmarks, must be unique among all the other Run blocks on that system.
• nodes: An integer which specifies the base number of nodes to run the benchmark with.
• tasksPerNode: An integer that specifies the number of tasks to launch per node.
Each Run block may contain the following optional attributes
• threadsPerTask: An integer specifying the number of threads to allocate each task.
• timeLimit: An integer specifying the time limit in minutes to pass to the system scheduler when submitting the
benchmark.
• args: containing any extra command line arguments to pass to GEOS.
• autoPartition: Either On or Off, not specifying autoPartition is equivalent to autoPartition="Off".
When auto partitioning is enabled the script will compute the number of x, y and z partitions such that the
the resulting partition is close to a perfect cube as possible, ie with 27 tasks x = 3, y = 3, z = 3 and with
36 tasks x = 4, y = 3, z = 3. This is optimal when the domain itself is a cube, but will be suboptimal
otherwise.
• strongScaling: A list of unique integers specifying the factors to scale the number of nodes by. If N number
are provided then N benchmarks are run and benchmark i uses nodes * strongScaling[ i ] nodes. Not
specifying strongScaling is equivalent to strongScaling="{ 1 }".
Looking at the example Benchmarks block above on Lassen one benchmark from the OMP_CUDA family will be run
with one node and one task. Four benchmarks from the MPI_OMP_CUDA family will be run with one, two, four and
eight nodes and four tasks per node.
Note that specifying a time limit for each benchmark family can greatly decrease the time spent waiting in the scheduler’s
queue. A good rule of thumb is that the time limit should be twice as long as it takes to run the longest benchmark in
the family.
To add a new group of benchmarks you need to create an XML input file describing the problem to be run. Then you
need to add the Benchmarks block described above which specifies the specific benchmarks. Finally add a symbolic
link to the input file in benchmarks and run the benchmarks to make sure everything works as expected.
Each night the NightlyTests repository runs the benchmarks on both Quartz and Lassen, the timingFiles directory
contains all of the resulting caliper output files. If you’re on LC then these files are duplicated at /usr/gapps/GEOSX/
timingFiles/ and if you have LC access you can view them in Spot. You can also open these files in Python and
analyse them (See Opening Spot caliper files in Python).
If you want to run the benchmarks on your local branch and compare the results with develop you can use the
benchmarks/compareBenchmarks.py python script. This requires that you run the benchmarks on your branch
and on develop. It will print out a table with the initialization time speed up and run time speed up, so a run speed up
of of 2x means your branch runs twice as fast as develop where as a initialization speed up of 0.5x means the set up
takes twice as long.
ò Note
A future version of the script will be able to pull timing results straight from the .cali files so that if you have
access to the NightlyTests timing files you won’t need to run the benchmarks on develop. Furthermore it will be
able to provide more detailed information than just initialization and run times.
Configuring Caliper
Caliper configuration is done by specifying a string to initialize Caliper with via the -t option. A few options are listed
below but we refer the reader to Caliper Config for the full Caliper tutorial.
• -t runtime-report,max_column_width=200 Will make Caliper print aggregated timing information to
standard out, with a column width large enought that it doesn’t truncate most function names.
• -t runtime-report,max_column_width=200,profile.cuda Does the same as the above, but also instru-
ments CUDA API calls. This is only an option when building with CUDA.
• -t runtime-report,aggregate_across_ranks=false Will make Caliper write per rank timing informa-
tion to standard out. This isn’t useful when using more than one rank but it does provide more information for
single rank runs.
• -t spot() Will make Caliper output a .cali timing file that can be viewed in the Spot web server.
Using Adiak
Adiak is a library that allows the addition of meta-data to the Caliper Spot output, it is enabled with Caliper. This
meta-data allows you to easily slice and dice the timings available in the Spot web server. To export meta-data use the
adiak::value function.
See Adiak API for the full Adiak documentation.
Using Spot
To use Spot you will need an LC account and a directory full of .cali files you would like to analyse. Point your browser
to Spot and open up the directory containing the timing files.
An example Python program for analyzing Spot Caliper files in Python is provided below. Note that it requires pandas
and hatchet both of which can be installed with a package manager. In addition it requires that cali-query is in the
PATH variable, this is built with Caliper so we can just point it into the TPLs.
import sys
import subprocess
import json
import os
import pandas as pd
from IPython.display import display, HTML
CALI_FILES = [
{ "cali_file": "/usr/gapps/GEOSX/timingFiles/200612-04342891243.cali", "metric_name":
˓→"avg#inclusive#sum#time.duration"},
grouping_attribute = "prop:nested"
default_metric = "avg#inclusive#sum#time.duration"
query = "select %s,sum(%s) group by %s format json-split" % (grouping_attribute, default_
˓→metric, grouping_attribute)
# Compute the speedup between the first two cali files (exlusive and inclusive metrics␣
˓→only)
# Compute the difference between the first two cali files (exclusive and inclusive␣
˓→metrics only)
# Compute the sum of the first two cali files (exclusive and inclusive metrics only)
# Print the resulting tree
gf5 = gf1 + gf2
print(gf5.tree(color=True, metric="sum#"+default_metric))
a machine in the cloud with an environment already configured to build and run geos. The submodules are
automatically cloned (except for the integratedTests which you may need to init yourself if you really need
them, see .devcontainer/postCreateCommand.sh). You do not need to run the scripts/config-build.py
scripts since cmake and vscode are already configured. Last, run cmake through the vscode interface and start
hacking!
You must first install docker on your machine. Note that there now exists a rootless install that may help you in case you
are not granted extended permissions on your environment. Also be aware that nvidia provides its own nvidia-docker
that grants access to GPUs.
Once you’ve installed docker, you must select from our docker registry the target environment you want to develop into.
• You can select the distribution you are comfortable with, or you may want to mimic (to some extend) a production
environment.
• Our containers are built with a relative CPU agnosticism (still x86_64), so you should be fine.
• Our GPU containers are built for a dedicated compute capability that may not match yours. Please dive into
our configuration files and refer to the official nvidia page to see what matches your needs.
• There may be risks of kernel inconsistency between the container and the host, but if you have relatively modern
systems (and/or if you do not interact directly with the kernel like perf) it should be fine.
• You may have noticed that our docker containers are tagged like 224-965. Please refer to Continuous Integration
process for further information.
Now that you’ve selected your target environment, you must be aware that just running a TPL docker image is not
enough to let you develop. You’ll have to add extra tools.
The following example is for our ubuntu flavors. You’ll notice the arguments IMG, VERSION, ORG. While surely overkill
for most cases, if you develop in GEOS on a regular basis you’ll appreciate being able to switch containers easily. For
example, simply create the image remote-dev-ubuntu20.04-gcc9:224-965 by running
export VERSION=224-965
export IMG=ubuntu20.04-gcc9
export REMOTE_DEV_IMG=remote-dev-${IMG}
docker build --build-arg ORG=geosx --build-arg IMG=${IMG} --build-arg VERSION=${VERSION}␣
˓→-t ${REMOTE_DEV_IMG}:${VERSION} -f /path/to/Dockerfile .
14
15 # You may need to define your time zone. This is a way to do it. Please adapt to your␣
˓→own needs.
26 # You'll most likely need ssh/sshd too (e.g. CLion and VSCode allow remote dev through␣
˓→ssh).
29 # The default user is root. If you plan your docker instance to be a disposable␣
˓→environment,
30 # with no sensitive information that a split between root and normal user could protect,
31 # then this is a choice which can make sense. Make your own decision.
32 RUN echo "PermitRootLogin prohibit-password" >> /etc/ssh/sshd_config
33 RUN echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config
34 RUN mkdir -p -m 700 /root/.ssh
35 # Put your own public key here!
36 RUN echo "ssh-rsa AAAAB... your public ssh key here ...EinP5Q== [email protected]" >
˓→ /root/.ssh/authorized_keys
37
Now that you’ve created the image, you must instantiate it as a container. I like to do
Now hack.
On your Windows machine, follow these steps. Download the most recent installer for Docker Desktop. Before instal-
lation please check the current status of Windows Subsystem for Linux ( WSL ) on your machine as Docker will use
WSL2 as a backend. To do that, open a PowerShell(Admin)
The first command should install WSL2, download an Ubuntu distribution for it and ask for a restart. The following
commands are used to check the status, and if the WSL is still the default one, change it to WSL2. More details on the
installation procedure can be found here.
Once the WSL2 is set as default, proceed with the Docker Desktop installation.
When launching Docker Desktop for the first time, you should be prompted with a message informing you that it uses
WSL2. Using PowerShell, you can check that Docker and WSL2 are actually running in the background:
You should be able to see one docker process and several wsl processes.
3. Preparing DockerFile
Let us now prepare the installation, picking a destination folder and editing our Dockerfile:
PS > cd D:/
PS > mkdir install-geosx-docker
PS > cd install-geosx-docker/
PS > notepad.exe Dockerfile
Let us edit the Dockerfile, which is the declarative file for out container:
14
15 # You may need to define your time zone. This is a way to do it. Please adapt to your␣
˓→own needs.
26 # You'll most likely need ssh/sshd too (e.g. CLion and VSCode allow remote dev through␣
˓→ssh).
29 # The default user is root. If you plan your docker instance to be a disposable␣
˓→environment,
30 # with no sensitive information that a split between root and normal user could protect,
31 # then this is a choice which can make sense. Make your own decision.
32 RUN echo "PermitRootLogin prohibit-password" >> /etc/ssh/sshd_config
33 RUN echo "PermitUserEnvironment yes" >> /etc/ssh/sshd_config
34 RUN mkdir -p -m 700 /root/.ssh
35 # Put your own public key here!
36 RUN echo "ssh-rsa AAAAB... your public ssh key here ...EinP5Q== [email protected]" >
˓→ /root/.ssh/authorized_keys
37
This file enriches a base image already containing the GEOS’s TPL as well as extra utils, such as cmake and preparing
for ssh connexion. In the end, we will be able to run it in a detached mode, and connect to it to run and develop in
GEOS.
There are two things you may have noticed reading through the Dockerfile :
• It has environment variables to be passed to it to select the proper image to pull, namely ${ORG}, ${IMG} and
${VERSION}, we’ll then have to declare them
PS> $env:VERSION='224-965'
PS> $env:IMG='ubuntu20.04-gcc9'
PS> $env:REMOTE_DEV_IMG="remote-dev-${env:IMG}"
Please note the preposition of env: in the windows formalisme. The ${ORG} variable will be hard-coded as geosx.
The last variable will be use as the image name. 224-965 refers to a specific version of the TPLs which may not be up
to date. Please refer to Continuous Integration process for further info.
• You’ll need to generate a ssh-key to be able to access the container without the need for defining a password.
This can be done from the PowerShell,
PS > ssh-keygen.exe
PS > cat [path-to-gen-key]/[your-key].pub
The first command will prompt you with a message asking you to complete the desired path for the key as well as a
passphrase, with confirmation. More details on ssh-key generation.
The preliminary tasks are now done. Let us build the image that will be containerized.
PS> cd [path-to-dockerfile-folder]/
PS > docker build --build-arg ORG=geosx --build-arg IMG=${env:IMG} --build-arg VERSION=$
˓→{env:VERSION} -t ${env:REMOTE_DEV_IMG}:${env:VERSION} -f Dockerfile .
As described above, we are passing our environment variables in the building stage, which offer the flexibility of
changing the version or image by a simple redefinition. A log updating or pulling the different layers should be displayed
afterwards and on the last line the image id. We can check that the image is created using PowerShell CLI:
Now that we have the image build, let us run a container from,
˓→DEV_IMG}:${env:VERSION}
Note that in addition to the detached flag (-d) and the name tage (--name), we provide Docker with the port the
container should be associated to communicate with ssh port 22, as well as a binding between a host mount point (D:/
install_geosx_docker/) and a container mount point (/app) to have a peristent storage for our development/geosx
builds. More details on the –mount options
A similar step can be achieved using the Docker Desktop GUI in the image tabs, clicking on the run button and filling
the same information in the interface,
Coming back to our PowerShell terminal, we can check that our container is running and trying to ssh to it.
PS > docker ps -a
CONTAINER ID IMAGE COMMAND CREATED ␣
˓→ STATUS PORTS NAMES
1efffac66c4c remote-dev-ubuntu20.04-gcc9:224-965 "/usr/sbin/sshd -D" Less than a␣
˓→second ago Up 18 seconds 0.0.0.0:64000->22/tcp, :::64000->22/tcp remote-dev-
˓→ubuntu20.04-gcc9-224-965
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This system has been minimized by removing packages and contents that are
not required on a system that users do not log into.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
We are now logged into our container and can start Quick Start Guide.
ò Note
Note that :
1. You might be prompted that you miss certificates to clone, this can be resolved by installing
ca-certificates and updating them
2. It might occur that git-lfs is missing then install it
PS > apt install ca-certificates && update-ca-certificates
PS > apt install git-lfs
From there you should be able to develop in your container or access it from an IDE, e.g. VSCode or MSVC19.
5. Running a case
Once the code is configured and compiled, let us check the status of the build,
Trying to launch a case using mpirun, you might get the following warning
--------------------------------------------------------------------------
mpirun has detected an attempt to run as root.
Running at root is *strongly* discouraged as any mistake (e.g., in
defining TMPDIR) or bug can result in catastrophic damage to the OS
file system, leaving your system in an unusable state.
A possible workaround is to create a new user account and a run folder from this account
First, as much as you can, try to reduce the number of jobs you’re triggering by commenting out the configurations you
do not require for your debugging. Then in your branch, add the following GHA step to the .github/build_and_test.yml
(see full documentation of the action here <https://github.com/lhotari/action-upterm>_).
- name: ssh
uses: lhotari/action-upterm@v1
with:
## limits ssh access and adds the ssh public key for the user which triggered the␣
˓→workflow
limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed GitHub users
limit-access-to-users: GitHubLogin
The action should be added after whichever step triggers an error. In case of a build failure it is best to add the action
after the build, test and deploy step. It is also important to prevent the job to exit upon failure. For instance, it is
suggested to comment the following lines in the build, test and deploy step.
set -e
exit ${EXIT_STATUS}
You can now commit the changes and push them to your remote branch.
Run lhotari/action-upterm@v1
upterm
Host: ssh://uptermd.upterm.dev:22
SSH Session: ssh␣
˓→Q16oBofblOdjVa3TrXPl:ZTc4NGUxMWRiMjI5MDgudm0udXB0ZXJtLmludGVybmFsOjIyMjI=@uptermd.
˓→upterm.dev
You can now open a terminal in your own machine and sshe to the upterm server, e.g.,
ssh Q16oBofblOdjVa3TrXPl:ZTc4NGUxMWRiMjI5MDgudm0udXB0ZXJtLmludGVybmFsOjIyMjI=@uptermd.
˓→upterm.dev
Once you are connected to the machine it is convenient to follow these steps to interactively run the docker container:
docker ps -a
The id of the existing docker container will be displayed and you can use it to commit the container.
˓→bash debug_image
Data Repository
The GEOS “Data Repository” is intended to provide the building blocks for the code structure within GEOS. The
“Data Repository” provides a general capability to store arbitrary data and objects in a hierarchical structure, similar to
a standard file system. The “Wrapper” object is a generic container for any object, and provides a standard interface for
accessing an object and performing standard operations. The “Group” object is a container for “Wrapper” and other
“Group” objects.
The components/classes of the data structure that a developer should have some knowledge of are:
Group
dataRepository::Group serves as a base class for most objects in GEOS. In GEOS, the Group may be thought of as
an analogy to the file folder in a hierachical filesystem-like structure. As such, a Group is used as a container class that
holds a collection of other Groups, or sub-Groups, a pointer to the parent of the Group, and a collection of Wrappers.
The Group also defines a general capability to create and traverse/access the objects in the hierarchy. The Wrappers
contained in a Group may be of arbitrary type, but in the case of an LvArray object, a Group size and capacity may
be translated down to array, thereby keeping a collection of wrapped Array objects that will resize in unison with the
Group. Each group has a string “name” that defines its key in the parent Group. This key string must be unique in the
scope of the parent Group.
Implementation Details
• In the GEOS repository, the keyType is specified to be a string for all collection objects, while the indexType
is specified to be a localIndex. The types are set in the common/DataTypes.hpp file, but are typically a
string and a std::ptrdiff_t respectively.
/// The template specialization of MappedVector to use for the collection of sub-Group␣
˓→objects.
using subGroupMap = MappedVector< Group, Group *, keyType, indexType >;
/// The template specialization of MappedVector to use for the collection wrappers␣
˓→objects.
using wrapperMap = MappedVector< WrapperBase, WrapperBase *, keyType, indexType >;
• The subGroupMap and wrapperMap aliases represent the type of container that the collection of sub-Group s and
Wrapper s are stored in for each Group. These container types are template specializations of the MappedVector
class, which store a pointer to a type, and provides functionality for a key or index based lookup. More details
may be found in the documentation for MappedVector.
/// The parent Group that contains "this" Group in its "sub-Group" collection.
Group * m_parent = nullptr;
/// Specification that this group will have the same m_size as m_parent.
integer m_sizedFromParent;
/// The container for the collection of all wrappers continued in "this" Group.
wrapperMap m_wrappers;
/// The container for the collection of all sub-groups contained in "this" Group.
subGroupMap m_subGroups;
/// The size/length of this Group...and all Wrapper<> that are are specified to have␣
˓→the same size as their
/// owning group.
indexType m_size;
(continues on next page)
/// The capacity for wrappers in this group...and all Wrapper<> that are specified to␣
˓→have the same size as their
/// owning group.
indexType m_capacity;
• The m_parent member is a pointer to the Group that contains the current Group as part of its collection of
sub-Group s.
. Warning
The existence of the non-const m_parent gives the current Group access to alter the parent Group. Special
care should be taken to avoid using this access whenever possible. Remember. . . with great power comes
great responsibility.
• The m_wrappers member is the collection of Wrappers contained in the current Group.
• The m_subGroups member is the collection of Group s contained in the current Group.
• The m_size and m_capacity members are used to set the size and capacity of any objects contained in the
m_wrappers collection that have been specified to be set by their owning Group. This is typically only useful
for Array types and is implemented within the WrapperBase object.
• The m_name member is the key of this Group in the collection of m_parent->m_subGroups. This key is unique
in the scope of m_parent, so some is required when constructing the hierarchy.
Interface Functions
The public interface for dataRepository::Group provides functionality for constructing a hierarchy, and traversing
that hierarchy, as well as accessing the contents of objects stored in the Wrapper containers stored within a Group.
To add new sub-Group s there are several registerGroup functions that add a new Group under the calling Group
scope. A listing of these functions is provided:
/**
* @name Sub-group registration interface
*/
///@{
/**
* @brief Register a new Group as a sub-group of current Group.
*
* @tparam T The type of the Group to add/register. This should be a type that derives␣
˓→from Group.
*/
template< typename T = Group >
T & registerGroup( string const & name, std::unique_ptr< T > newObject )
{
newObject->m_parent = this;
return dynamicCast< T & >( *m_subGroups.insert( name, newObject.release(), true ) );
}
/**
* @brief @copybrief registerGroup(string const &,std::unique_ptr<T>)
*
* @tparam T The type of the Group to add/register. This should be a type that derives␣
˓→from Group.
*/
template< typename T = Group >
T & registerGroup( string const & name, T * newObject )
{ return dynamicCast< T & >( *m_subGroups.insert( name, newObject, false ) ); }
/**
* @brief @copybrief registerGroup(string const &,std::unique_ptr<T>)
*
* @tparam T The type of the Group to add/register. This should be a type that derives␣
˓→from Group.
*/
template< typename T = Group >
T & registerGroup( string const & name )
{ return registerGroup< T >( name, std::make_unique< T >( name, this ) ); }
/**
* @brief @copybrief registerGroup(string const &,std::unique_ptr<T>)
*
* @tparam T The type of the Group to add/register. This should be a type that derives␣
˓→from Group.
* @param keyIndex A KeyIndexT object that will be used to specify the name of
* the new group. The index of the KeyIndex will also be set.
(continues on next page)
*
* Creates and registers a Group or class derived from Group as a subgroup of this␣
˓→Group.
*/
template< typename T = Group >
T & registerGroup( subGroupMap::KeyIndex const & keyIndex )
{
T & rval = registerGroup< T >( keyIndex.key(), std::make_unique< T >( keyIndex.key(),
˓→ this ) );
/**
* @brief @copybrief registerGroup(string const &,std::unique_ptr<T>)
*
* @tparam T The type of the Group to add/register. This should be a type that derives␣
˓→from Group.
* @tparam TBASE The type whose type catalog will be used to look up the new sub-group␣
˓→type
*/
template< typename T = Group, typename TBASE = Group >
T & registerGroup( string const & name, string const & catalogName )
{
std::unique_ptr< TBASE > newGroup = TBASE::CatalogInterface::Factory( catalogName,␣
˓→name, this );
/**
* @brief Removes a child group from this group.
* @param name the name of the child group to remove from this group.
*/
void deregisterGroup( string const & name );
/**
* @brief Creates a new sub-Group using the ObjectCatalog functionality.
* @param[in] childKey The name of the new object type's key in the
* ObjectCatalog.
* @param[in] childName The name of the new object in the collection of
* sub-Groups.
* @return A pointer to the new Group created by this function.
*/
virtual Group * createChild( string const & childKey, string const & childName );
(continues on next page)
///@}
These functions all take in a name for the new Group, which will be used as the key when trying to access the Group in
the future. Some variants create a new Group, while some variants take in an existing Group . The template argument
is to specify the actaul type of the Group as it it is most likely a type that derives from Group that is we would like to
create in the repository. Please see the doxygen documentation for a detailed description of each option.
Getting Groups
The collection of functions to retrieve a Group and their descriptions are taken from source and shown here:
/**
* @name Sub-group retrieval methods.
*
* This collection of functions are used to get a sub-Group from the current group.␣
˓→Various methods
* for performing the lookup are provided (localIndex, string, KeyIndex), and each␣
˓→have their
* advantages and costs. The lowest cost lookup is the "localIndex" lookup. The␣
˓→KeyIndex lookup
* will add a cost for checking to make sure the index stored in KeyIndex is valid (a␣
˓→string
* compare, and a hash if it is incorrect). The string lookup is the full cost hash␣
˓→lookup every
* to cast the pointer that is stored in m_subGroups to a pointer of the desired type.␣
˓→If this
/**
* @brief Return a pointer to a sub-group of the current Group.
* @tparam T The type of subgroup.
* @tparam KEY The type of the lookup.
* @param key The key used to perform the lookup.
* @return A pointer to @p T that refers to the sub-group, if the Group does not exist␣
˓→or it
/**
* @copydoc getGroupPointer(KEY const &)
(continues on next page)
/**
* @brief Return a reference to a sub-group of the current Group.
* @tparam T The type of subgroup.
* @tparam KEY The type of the lookup.
* @param key The key used to perform the lookup.
* @return A reference to @p T that refers to the sub-group.
* @throw std::domain_error If the Group does not exist is thrown.
*/
template< typename T = Group, typename KEY = void >
T & getGroup( KEY const & key )
{
Group * const child = m_subGroups[ key ];
GEOS_THROW_IF( child == nullptr,
"Group " << getDataContext() << " has no child named " << key <<␣
˓→std::endl
<< dumpSubGroupsNames(),
std::domain_error );
T * const castedChild = dynamicCast< T * >( child );
GEOS_THROW_IF( castedChild == nullptr,
GEOS_FMT( "{} was expected to be a '{}'.",
child->getDataContext(), LvArray::system::demangleType< T >
˓→() ),
BadTypeError );
return *castedChild;
}
/**
* @copydoc getGroup( KEY const & )
*/
template< typename T = Group, typename KEY = void >
T const & getGroup( KEY const & key ) const
{
Group const * const child = m_subGroups[ key ];
GEOS_THROW_IF( child == nullptr,
"Group " << getDataContext() << " has no child named " << key <<␣
˓→std::endl
<< dumpSubGroupsNames(),
std::domain_error );
T const * const castedChild = dynamicCast< T const * >( child );
GEOS_THROW_IF( castedChild == nullptr,
GEOS_FMT( "{} was expected to be a '{}'.",
child->getDataContext(), LvArray::system::demangleType< T >
˓→() ),
BadTypeError );
return *castedChild;
}
/**
* @copydoc getGroupByPath(string const &)
*/
template< typename T = Group >
T const & getGroupByPath( string const & path ) const
{ return dynamicCast< T const & >( getBaseGroupByPath( path ) ); }
Register Wrappers
/**
* @name Wrapper registration interface
*/
///@{
/**
* @brief Create and register a Wrapper around a new object.
* @tparam T The type of the object allocated.
* @tparam TBASE The type of the object that the Wrapper holds.
* @param[in] name the name of the wrapper to use as a string key
* @param[out] rkey a pointer to a index type that will be filled with the new
* Wrapper index in this Group
* @return A reference to the newly registered/created Wrapper
*/
template< typename T, typename TBASE=T >
Wrapper< TBASE > & registerWrapper( string const & name,
wrapperMap::KeyIndex::index_type * const rkey =␣
˓→nullptr );
/**
* @copybrief registerWrapper(string const &,wrapperMap::KeyIndex::index_type * const)
* @tparam T the type of the wrapped object
* @tparam TBASE the base type to cast the returned wrapper to
* @param[in] viewKey The KeyIndex that contains the name of the new Wrapper.
* @return A reference to the newly registered/created Wrapper
*/
template< typename T, typename TBASE=T >
Wrapper< TBASE > & registerWrapper( Group::wrapperMap::KeyIndex const & viewKey );
*/
template< typename T >
Wrapper< T > & registerWrapper( string const & name, std::unique_ptr< T > newObject );
/**
* @brief Register a Wrapper around an existing object, does not take ownership of the␣
˓→object.
*/
template< typename T >
Wrapper< T > & registerWrapper( string const & name,
T * newObject );
/**
* @brief Register and take ownership of an existing Wrapper.
* @param wrapper A pointer to the an existing wrapper.
* @return An un-typed pointer to the newly registered/created wrapper
*/
WrapperBase & registerWrapper( std::unique_ptr< WrapperBase > wrapper );
/**
* @brief Removes a Wrapper from this group.
* @param name the name of the Wrapper to remove from this group.
*/
void deregisterWrapper( string const & name );
///@}
/**
* @name Untyped wrapper retrieval methods
*
* These functions query the collection of Wrapper objects for the given
* index/name/KeyIndex and returns a WrapperBase pointer to the object if
* it exists. If it is not found, nullptr is returned.
*/
///@{
(continues on next page)
/**
* @brief Return a reference to a WrapperBase stored in this group.
* @tparam KEY The lookup type.
* @param key The value used to lookup the wrapper.
* @return A reference to the WrapperBase that resulted from the lookup.
* @throw std::domain_error if the wrapper doesn't exist.
*/
template< typename KEY >
WrapperBase const & getWrapperBase( KEY const & key ) const
{
WrapperBase const * const wrapper = m_wrappers[ key ];
GEOS_THROW_IF( wrapper == nullptr,
"Group " << getDataContext() << " has no wrapper named " << key <<␣
˓→std::endl
<< dumpWrappersNames(),
std::domain_error );
return *wrapper;
}
/**
* @copydoc getWrapperBase(KEY const &) const
*/
template< typename KEY >
WrapperBase & getWrapperBase( KEY const & key )
{
WrapperBase * const wrapper = m_wrappers[ key ];
GEOS_THROW_IF( wrapper == nullptr,
"Group " << getDataContext() << " has no wrapper named " << key <<␣
˓→std::endl
<< dumpWrappersNames(),
std::domain_error );
return *wrapper;
}
/**
* @brief
* @param name
* @return
*/
indexType getWrapperIndex( string const & name ) const
{ return m_wrappers.getIndex( name ); }
/**
* @brief Get access to the internal wrapper storage.
* @return a reference to wrapper map
*/
wrapperMap const & wrappers() const
{ return m_wrappers; }
/**
* @brief Return the number of wrappers.
* @return The number of wrappers.
*/
indexType numWrappers() const
{ return m_wrappers.size(); }
/**
* @return An array containing all wrappers keys
*/
std::vector< string > getWrappersNames() const;
///@}
/**
* @name Typed wrapper retrieval methods
*
* These functions query the collection of Wrapper objects for the given
* index/key and returns a Wrapper<T> pointer to the object if
* it exists. The template parameter @p T is used to perform a cast
* on the WrapperBase pointer that is returned by the lookup, into
* a Wrapper<T> pointer. If the wrapper is not found, or the
* WrapperBase pointer cannot be cast to a Wrapper<T> pointer, then nullptr
* is returned.
*/
///@{
/**
* @brief Check if a wrapper exists
* @tparam LOOKUP_TYPE the type of key used to perform the lookup.
* @param[in] lookup a lookup value used to search the collection of wrappers
* @return @p true if wrapper exists (regardless of type), @p false otherwise
*/
template< typename LOOKUP_TYPE >
bool hasWrapper( LOOKUP_TYPE const & lookup ) const
{ return m_wrappers[ lookup ] != nullptr; }
/**
* @brief Retrieve a Wrapper stored in this group.
* @tparam T the object type contained in the Wrapper
* @tparam LOOKUP_TYPE the type of key used to perform the lookup
* @param[in] index a lookup value used to search the collection of wrappers
* @return A reference to the Wrapper<T> that resulted from the lookup.
* @throw std::domain_error if the Wrapper doesn't exist.
*/
template< typename T, typename LOOKUP_TYPE >
(continues on next page)
/**
* @copydoc getWrapper(LOOKUP_TYPE const &) const
*/
template< typename T, typename LOOKUP_TYPE >
Wrapper< T > & getWrapper( LOOKUP_TYPE const & index )
{
WrapperBase & wrapper = getWrapperBase( index );
return dynamicCast< Wrapper< T > & >( wrapper );
}
/**
* @brief Retrieve a Wrapper stored in this group.
* @tparam T the object type contained in the Wrapper
* @tparam LOOKUP_TYPE the type of key used to perform the lookup
* @param[in] index a lookup value used to search the collection of wrappers
* @return A pointer to the Wrapper<T> that resulted from the lookup, if the Wrapper
* doesn't exist or has a different type a @c nullptr is returned.
*/
template< typename T, typename LOOKUP_TYPE >
Wrapper< T > const * getWrapperPointer( LOOKUP_TYPE const & index ) const
{ return dynamicCast< Wrapper< T > const * >( m_wrappers[ index ] ); }
/**
* @copydoc getWrapperPointer(LOOKUP_TYPE const &) const
*/
template< typename T, typename LOOKUP_TYPE >
Wrapper< T > * getWrapperPointer( LOOKUP_TYPE const & index )
{ return dynamicCast< Wrapper< T > * >( m_wrappers[ index ] ); }
///@}
/**
* @name Wrapper data access methods.
*
* These functions can be used to get referece/pointer access to the data
* stored by wrappers in this group. They are essentially just shortcuts for
* @p Group::getWrapper() and @p Wrapper<T>::getReference().
* An additional template parameter can be provided to cast the return pointer
* or reference to a base class pointer or reference (e.g. Array to ArrayView).
*/
///@{
/**
* @brief Look up a wrapper and get reference to wrapped object.
* @tparam T return value type
* @tparam WRAPPEDTYPE wrapped value type (by default, same as return)
(continues on next page)
/**
* @copydoc getReference(LOOKUP_TYPE const &) const
*/
template< typename T, typename LOOKUP_TYPE >
T & getReference( LOOKUP_TYPE const & lookup )
{ return getWrapper< T >( lookup ).reference(); }
Looping Interface
/**
* @name Functor-based subgroup iteration
*
* These functions loop over sub-groups and executes a functor that uses the sub-group␣
˓→as an
* argument. The functor is only executed if the group can be cast to a certain type␣
˓→specified
* by the @p ROUPTYPE/S pack. The variadic list consisting of @p GROUPTYPE/S will be␣
˓→used recursively
* to check if the group is able to be cast to the one of these types. The first type␣
˓→in the
* @p GROUPTYPE/S list will be used to execute the functor, and the next sub-group␣
˓→will be processed.
*/
///@{
/**
* @brief Apply the given functor to subgroups that can be casted to one of specified␣
˓→types.
* @tparam GROUPTYPE the first type that will be used in the attempted casting of␣
˓→group.
* @tparam GROUPTYPES a variadic list of types that will be used in the attempted␣
˓→casting of group.
/**
* @copydoc forSubGroups(LAMBDA &&)
*/
template< typename GROUPTYPE = Group, typename ... GROUPTYPES, typename LAMBDA >
void forSubGroups( LAMBDA && lambda ) const
{
for( auto const & subGroupIter : m_subGroups )
{
applyLambdaToContainer< GROUPTYPE, GROUPTYPES... >( *subGroupIter.second, [&](␣
˓→auto const & castedSubGroup )
{
lambda( castedSubGroup );
} );
}
}
/**
* @brief Apply the given functor to subgroups that can be casted to one of specified␣
˓→types.
* @tparam GROUPTYPE the first type that will be used in the attempted casting of␣
˓→group.
* @tparam GROUPTYPES a variadic list of types that will be used in the attempted␣
˓→casting of group.
/**
* @copydoc forSubGroupsIndex(LAMBDA &&)
*/
(continues on next page)
{
lambda( counter, castedSubGroup );
} );
++counter;
}
}
/**
* @copybrief forSubGroups(LAMBDA &&)
* @tparam GROUPTYPE the first type that will be used in the attempted casting␣
˓→of group.
* loop
* @tparam LAMBDA type of functor callable with an index in lookup container␣
˓→and a reference to casted
* subgroup
* @param[in] subGroupKeys container with subgroup lookup keys (e.g. names or␣
˓→indices) to apply the functor to
{
lambda( counter, castedSubGroup );
} );
++counter;
}
}
/**
* @copybrief forSubGroups(LAMBDA &&)
* @tparam GROUPTYPE the first type that will be used in the attempted casting␣
(continues on next page)
* loop
* @tparam LAMBDA type of functor callable with an index in lookup container␣
˓→and a reference to casted
* subgroup
* @param[in] subGroupKeys container with subgroup lookup keys (e.g. names or␣
˓→indices) to apply the functor to
void forSubGroups( LOOKUP_CONTAINER const & subGroupKeys, LAMBDA && lambda ) const
{
localIndex counter = 0;
for( auto const & subgroup : subGroupKeys )
{
applyLambdaToContainer< GROUPTYPE, GROUPTYPES... >( getGroup( subgroup ), [&](␣
˓→auto const & castedSubGroup )
{
lambda( counter, castedSubGroup );
} );
++counter;
}
}
///@}
/**
* @name Functor-based wrapper iteration
*
* These functions loop over the wrappers contained in this group, and executes a␣
˓→functor that
* uses the Wrapper as an argument. The functor is only executed if the Wrapper can be␣
˓→casted to
* a certain type specified by the @p TYPE/S pack. The variadic list consisting of
* @p TYPE/S will be used recursively to check if the Wrapper is able to be casted to␣
˓→the
* one of these types. The first type in the @p WRAPPERTYPE/S list will be used to␣
˓→execute the
/**
* @brief Apply the given functor to wrappers.
* @tparam LAMBDA the type of functor to call
* @param[in] lambda the functor to call
*/
template< typename LAMBDA >
(continues on next page)
/**
* @copydoc forWrappers(LAMBDA &&)
*/
template< typename LAMBDA >
void forWrappers( LAMBDA && lambda ) const
{
for( auto const & wrapperIter : m_wrappers )
{
lambda( *wrapperIter.second );
}
}
/**
* @brief Apply the given functor to wrappers that can be cast to one of specified␣
˓→types.
* @tparam TYPE the first type that will be used in the attempted casting of Wrapper
* @tparam TYPES a variadic list of types that will be used in the attempted casting␣
˓→of Wrapper
std::forward<␣
˓→LAMBDA >( lambda ));
}
}
/**
* @brief Apply the given functor to wrappers that can be cast to one of specified␣
˓→types.
* @tparam TYPE the first type that will be used in the attempted casting of Wrapper
* @tparam TYPES a variadic list of types that will be used in the attempted casting␣
˓→of Wrapper
std::forward<␣
˓→LAMBDA >( lambda ));
}
}
///@}
Group API
Wrapper
This class encapsulates an object for storage in a Group and provides an interface for performing some common oper-
ations on that object.
Description
In the filesystem analogy, a Wrapper may be thought of as a file that stores actual data. Each Wrapper belong to a
single Group much like a file belongs to a filesystem directory. In general, more than one wrapper in the tree may refer
to the same wrapped object, just like symlinks in the file system may refer to the same file. However, only one wrapper
should be owning the data (see below).
In the XML input file, Wrapper correspond to attribute of an XML element representing the containing Group. See
XML Input for the relationship between XML input files and Data Repository.
Wrapper<T> is templated on the type of object it encapsulates, thus providing strong type safety when retrieving the ob-
jects. As each Wrapper class instantiation will be a distinct type, Wrapper derives from a non-templated WrapperBase
class that defines a common interface. WrapperBase is the type of pointer that is stored in the MappedVector container
within a Group.
WrapperBase provides several interface functions that delegate the work to the wrapped object if it supports the corre-
sponding method signature. This allows a collection of heterogeneous wrappers (i.e. over different types) to be treated
uniformly. Examples include:
• size()
• resize(newSize)
• reserve(newCapacity)
• capacity()
• move(LvArray::MemorySpace)
A Wrapper may be owning or non-owning, depending on how it’s constructed. An owning Wrapper will typically
either take a previously allocated object via std::unique_ptr<T> or no pointer at all and itself allocate the object. It
will delete the wrapped object when destroyed. A non-owning Wrapper may be used to register with the data repository
objects that are not directly heap-allocated, for example data members of other objects. It will take a raw pointer as
input and not delete the wrapped object when destroyed.
Attributes
Each instance of Wrapper has a set of attributes that control its function in the data repository. These attributes are:
• InputFlags
A strongly typed enum that defines the relationship between the Wrapper and the XML input. Possible values
are:
Value Explanation
FALSE Data is not read from XML input (default).
OPTIONAL Data is read from XML if an attribute matching Wrapper’s name is found.
REQUIRED Data is read from XML and an error is raised if the attribute is not found.
ò Note
A runtime error will occur when attempting to read from XML a wrapped type T that does not have operator>>
defined.
• RestartFlags
Enumeration that describes how the Wrapper interacts with restart files.
Value Explanation
NO_WRITE Data is not written into restart files.
WRITE Data is written into restart files but not read upon restart.
WRITE_AND_READ Data is both written and read upon restart (default).
ò Note
A runtime error will occur when attempting to write a wrapped type T that does not support buffer packing. There-
fore, when registering custom types (i.e. not a basic C++ type or an LvArray container) we recommend setting the
flag to NO_WRITE. A future documentation topic will explain how to extend buffer packing capabilities to custom
user-defined types.
• PlotLevel
Enumeration that describes how the Wrapper interacts with plot (visualization) files.
Value Explanation
LEVEL_0 Data always written to plot files.
LEVEL_1 Data written to plot when plotLevel>=1 is specified in input.
LEVEL_2 Data written to plot when plotLevel>=2 is specified in input.
LEVEL_3 Data written to plot when plotLevel>=3 is specified in input.
NOPLOT Data never written to plot files.
ò Note
Only data stored in LvArray’s Array<T> containers is currently written into plot files.
Default Values
Wrapper supports setting a default value for its wrapped object. The default value is used if a wrapper with
InputFlags::OPTIONAL attribute does not match an attribute in the input file. For LvArray containers it is also
used as a default value for new elements upon resizing the container.
Default value can be set via one of the following two methods:
• setDefaultValue sets the default value but does not affect the actual value stored in the wrapper.
• setApplyDefaultValue sets the default value and applies it to the stored value.
ò Note
A runtime error is raised if a default value is not set for a wrapper with InputFlags::OPTIONAL attribute.
The type DefaultValue<T> is used to store the default value for the wrapper.
v Todo
DefaultValue is actually not a type but an alias for another internal struct. As such, it cannot currently be spe-
cialized for a user’s custom type.
Wrapper API
ObjectCatalog
The “ObjectCatalog” is a collection of classes that acts as a statically initialized factory. It functions in a similar
manner to a classic factory method, except that there is no maintained list of derived objects that is required to create
new objects. In other words, there is no case-switch/if-elseif block to maintain. Instead, the ObjectCatalog creates
a “catalog” of derived objects using a std::unordered_map. The “catalog” is filled when new types are declared
through the declaration of a helper class named CatalogEntryConstructor.
The key functional features of the “ObjectCatalog” concept may be summarized as:
• Anonymous addition of new objects to the catalog. Because we use a statically initialized singleton map ob-
ject to store the catalog, no knowledge of the contents of the catalog is required in the main code. Therefore
if a proprietary/sensitive catalog entry is desired, it is only required that the object definition be outside of
the main repository and tied into the build system through some non-specific mechanism (i.e. a link in the
src/externalComponents directory) and the catalog entry will be registered in the catalog without sharing any
knowledge of its existence. Then a proprietary input file may refer to the object to call for its creation.
• Zero maintenance catalog. Again, because we use a singleton map to store the catalog, there is no updating of
code required to add new entries into the catalog. The only modifications required are the actual source files of
the catalog entry, as described in the Usage section below.
Implementation Details
There are three key objects that are used to provide the ObjectCatalog functionality.
CatalogInterface
The CatalogInterface class provides the base definitions and interface for the ObjectCatalog concept. It is tem-
plated on the common base class of all derived objects that are creatable by the “ObjectCatalog”. In addition,
CatalogInterface is templated on a variadic parameter pack that allows for an arbitrary constructor argument list as
shown in the declaration shown below:
The CatalogInterface also defines the actual catalog type using the template arguments:
The CatalogInterface::CatalogType is a std::unordered_map with a string “key” and a value type that is a
pointer to the CatalogInterface that represents a specific combination of BASETYPE and constructor arguments.
After from setting up and populating the catalog, which will be described in the “Usage” section, the only interface
with the catalog will typically be when the Factory() method is called. The definition of the method is given as:
string errorMsg = "Could not find keyword \"" + objectTypeName + "\" in this␣
˓→context. ";
errorMsg += "Please be sure that all your keywords are properly spelled or that␣
˓→input file parameters have not changed.\n";
GEOS_ERROR( errorMsg );
}
It can be seen that the static Factory method is simply a wrapper that calls the virtual Allocate method on a the
catalog which is returned by getCatalog(). The usage of the Factory method will be further discussed in the Usage
section.
ò Note
The method for organizing constructing new objects relies on a common constructor list between the derived type
and the BASETYPE. This means that there is a single catalog for each combination of BASETYPE and the variadic
parameter pack representing the constructor arguments. In the future, we can investigate removing this restriction
and allowing for construction of a hierarchy of objects with an arbitrary constructor parameter list.
CatalogEntry
The CatalogEntry class derives from CatalogInterface and adds the a TYPE template argument to the arguments
of the CatalogInterface.
The TYPE template argument is the type of the object that you would like to be able to create with the “Ob-
jectCatalog”. TYPE must be derived from BASETYPE and have a constructor that matches the variadic param-
eter pack specified in the template parameter list. The main purpose of the CatalogEntry is to override the
CatalogInterface::Allocate() virtual function s.t. when key is retrieved from the catalog, then it is possible
to create a new TYPE. The CatalogEntry::Allocate() function is a simple creation of the underlying TYPE as
shown by its definition:
#endif
#if ( __cplusplus >= 201402L )
return std::make_unique< TYPE >( args ... );
#else
return std::unique_ptr< BASETYPE >( new TYPE( args ... ) );
#endif
}
CatalogEntryConstructor
The CatalogEntryConstructor is a helper class that has a sole purpose of creating a new CatalogEntry and
adding it to the catalog. When a new CatalogEntryConstructor is created, a new CatalogEntry entry is created
and inserted into the catalog automatically.
Usage
When creating a new “ObjectCatalog”, it typically is done within the context of a specific BASETYPE. A simple example
of a class hierarchy in which we would like to use the “ObjectCatalog” to use to generate new objects is given in the
unit test located in testObjectCatalog.cpp.
virtual ~Base()
{
GEOS_LOG( "calling Base destructor" );
}
Once a Base class is defined with the required features, the next step is to add a new derived type to the catalog defined
in Base. There are three requirements for the new type to be registered in the catalog:
• The derived type must have a constructor with the arguments specified by the variadic parameter pack specified
in the catalog.
• There must be a static function static string catalogName() that returns the name of the type that will be
used to as keyname when it is registered Base’s catalog.
• The new type must be registered with the catalog held in Base. To accomplish this, a convenience macro
REGISTER_CATALOG_ENTRY() is provided. The arguments to this macro are the name type of Base, the type of
the derived class, and then the variadic pack of constructor arguments.
A pair of of simple derived class that have the required methods are used in the unit test.
class Derived1 : public Base
{
public:
Derived1( int & junk, double const & junk2 ):
(continues on next page)
~Derived1()
{
GEOS_LOG( "calling Derived1 destructor" );
}
static string catalogName() { return "derived1"; }
string getCatalogName() { return catalogName(); }
};
REGISTER_CATALOG_ENTRY( Base, Derived1, int &, double const & )
~Derived2()
{
GEOS_LOG( "calling Derived2 destructor" );
}
static string catalogName() { return "derived2"; }
string getCatalogName() { return catalogName(); }
};
REGISTER_CATALOG_ENTRY( Base, Derived2, int &, double const & )
The test function in the unit test shows how to allocate a new object of one of the derived types from Factory method.
Note the call to Factory is scoped by Base::CatalogInterface, which is an alias to the full templated instantiation
of CatalogInterface. The arguments for Factory
EXPECT_STREQ( derived1->getCatalogName().c_str(),
Derived1::catalogName().c_str() );
EXPECT_STREQ( derived2->getCatalogName().c_str(),
Derived2::catalogName().c_str() );
GEOS_LOG( "EXITING MAIN" );
}
The unit test creates two new objects of type Derived1 and Derived2 using the catalogs Factory method. Then the
test checks to see that the objects that were created are of the correct type. This unit test has some extra output to screen
to help with understanding of the sequence of events. The result of running this test is:
$ tests/testObjectCatalog
Calling constructor for CatalogEntryConstructor< Derived1 , Base , ... >
Calling constructor for CatalogInterface< Base , ... >
Calling constructor for CatalogEntry< Derived1 , Base , ... >
Registered Base catalog component of derived type Derived1 where Derived1::catalogName()␣
˓→= derived1
In the preceding output, it is clear that the static catalog in Base::getCatalog() is initialized prior the execution of
main, and destroyed after the completion of main. In practice, there have been no indicators of problems due to the use
of a statically initialized/deinitialized catalog.
Mapped Vector
Description
The container stores pointers to objects (which are themselves heap-allocated). Each element may be optionally owned
by the container, in which case it will be deleted upon removal or container destruction. The pointers are stored in a
contiguous memory allocation, and thus are accessible through an integral index lookup. In addition, there is a map
that provides a key lookup capability to the container if that is the preferred interface.
The container template has four type parameters:
• T is the object type pointed to by container entries
• T_PTR is a pointer-to-T type which must be either T * (default) or std::unique_ptr<T>
• KEY_TYPE is the type of key used in associative lookup
• INDEX_TYPE is the type used in index lookup
Element access
MappedVector API
XML Input
In this document, you will learn how GEOS classes interact with external information parsed from XML files, and how
to add a new XML block that can be interpreted by GEOS. Flow solvers and relative permeability are used as examples.
All GEOS classes derive from a base class called dataRepository::Group. The Group class provides a way to
organize all GEOS objects in a filesystem-like structure. One could think of Group s as file folders that can bear data
(stored in Wrapper s), have a parent folder (another Group), and have possibly multiple subfolders (referred to as
the subgroups). Below, we briefly review the data members of the Group class that are essential to understand the
correspondence between the GEOS data structure and the XML input. For more details, we refer the reader to the
extensive documentation of the Data Repository, including the Group class documentation.
In the code listing below, we see that each Group object is at minimum equipped with the following member properties:
• A pointer to the parent Group called m_parent (member classes are prefixed by m_),
• The Group ‘s own data, stored for flexibility in an array of generic data Wrapper s called m_wrappers,
• A map of one or many children (also of type Group) called m_subGroups.
• The m_size and m_capacity members, that are used to set the size and capacity of any objects contained.
• The name of the Group, stored as a string in m_name. This name can be seen as the object unique ID.
/// The parent Group that contains "this" Group in its "sub-Group" collection.
Group * m_parent = nullptr;
/// Specification that this group will have the same m_size as m_parent.
integer m_sizedFromParent;
/// The container for the collection of all wrappers continued in "this" Group.
wrapperMap m_wrappers;
/// The container for the collection of all sub-groups contained in "this" Group.
subGroupMap m_subGroups;
/// The size/length of this Group...and all Wrapper<> that are are specified to have␣
˓→the same size as their
/// owning group.
indexType m_size;
/// The capacity for wrappers in this group...and all Wrapper<> that are specified to␣
˓→have the same size as their
/// owning group.
indexType m_capacity;
//END_SPHINX_INCLUDE_02
/// Restart flag for this group... and subsequently all wrappers in this group.
[Source: src/coreComponents/dataRepository/Group.hpp]
/**
* @class CompositionalMultiphaseBase
*
* A compositional multiphase solver
*/
class CompositionalMultiphaseBase : public FlowSolverBase
{
[Source: src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.hpp]
2. To let GEOS know where to search in the ObjectCatalog, a macro needs to be added at the end of the .cpp
file implementing the class. This macro (illustrated below) must contain the type of the base class (in this case,
PhysicsSolverBase), and the name of the derived class (continuing with the example used above, this is
CompositionalMultiphaseFlow). As a result of this construct, the ObjectCatalog is not a flat list of string
s mapping the C++ classes. Instead, the ObjectCatalog forms a tree that reproduces locally the structure of
the class diagram, from the base class to the derived classes.
[Source: src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp]
Summary: All GEOS objects form a filesystem-like structure. If an object needs to be accessible externally,
it must be registered in the ObjectCatalog. This is done by adding CatalogName() method that returns
a string key to the object’s class, and by adding the appropriate macro. The catalog has the same tree
structure as the class diagram.
In this section, we describe with more details the connection between internal GEOS objects and external XML tags
parsed from parameter files. We call this process Registration. The registration process works in three steps:
1. The XML document is parsed. Each time a new XML tag is found, the current local scope of the ObjectCatalog
is inspected. The goal is to find a catalogName string that matches the XML tag.
2. If it is the case (the current local scope of the ObjectCatalog contains a catalogName identical to the XML
tag), then the code creates a new instance of the class that the catalogName refers to. This new object is inserted
in the Group tree structure at the appropriate location, as a subgroup.
3. By parsing the XML attributes of the tag, the new object properties are populated. Some checks are performed
to ensure that the data supplied is conform, and that all the required information is present.
Let’s look at this process in more details.
Consider again that we are registering a flow solver deriving from FlowSolverBase, and assume that this solver is
called CppNameOfMySolver. This choice of name is not recommended (we want names that reflect what the solver
does!), but for this particular example, we just need to know that this name is the class name inside the C++ code.
To specify parameters of this new solver from an XML file, we need to be sure that the XML tag and the catalogName
of the class are identical. Therefore, we equip the CppNameOfMySolver class with a CatalogName() method that
returns the solver catalogName (=XML name). Here, this method returns the string “XmlNameOfMySolver”.
We have deliberately distinguished the class name from the catalog/XML name for the sake of clarity in this example.
It is nevertheless a best practice to use the same name for the class and for the catalogName. This is the case below
for the existing CompositionalMultiphaseFVM class.
/**
* @brief name of the solver in the object catalog
* @return string that contains the catalog name to generate a new object through the␣
˓→object catalog.
*/
static string catalogName() { return "CompositionalMultiphaseFVM"; }
/**
* @copydoc PhysicsSolverBase::getCatalogName()
(continues on next page)
[Source: src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.hpp]
Now that we have implemented a CatalogName() method returning a specific key (of type string), we can have a
block in our XML input file with a tag that corresponds to the catalogName “XmlNameOfMySolver”. This is how
the XML block would look like.
<Problem>
<Solvers
gravityVector="{ 0.0, 0.0, -9.81 }">
<XmlNameOfMySolver name="nameOfThisSolverInstance"
verboseLevel="1"
gravityFlag="1"
temperature="297.15" />
<LinearSolverParameters newtonTol="1.0e-6"
maxIterNewton="15"
useDirectSolver="1"/>
</XmlNameOfMySolver>
</Solvers>
</Problem>
Here, we see that the XML structure defines a parent node “Problem”, that has (among many others) a child node
“Solvers”. In the “Solvers” block, we have placed the new solver block as a child node of the “Solvers” block with
the XML tag corresponding to the catalogName of the new class. We will see in details next how the GEOS internal
structure constructed from this block mirrors the XML file structure.
Above, we have specified an XML block with the tag “XmlNameOfMySolver”. Now, when reading the XML file and
encountering an “XmlNameOfMySolver” solver block, we add a new instance of the class CppNameOfMySolver in
the filesystem structure as explained below.
We saw that in the XML file, the new solver block appeared as child node of the XML block “Solvers”. The internal
construction mirrors this XML structure. Specifically, the new object of class CppNameOfMySolver is registered as a
subgroup (to continue the analogy used so far, as a subfolder) of its parent Group, the class PhysicsSolverManager
(that has a catalogName “Solvers”). To do this, the method CreateChild of the PhysicsSolverManager class is
used.
// Variable values in this example:
// --------------------------------
// childKey = "XmlNameOfMySolver" (string)
// childName = "nameOfThisSolverInstance" (string)
// PhysicsSolverBase::CatalogInterface = the Catalog attached to the base Solver class
// hasKeyName = bool method to test if the childKey string is present in the Catalog
// registerGroup = method to create a new instance of the solver and add it to the group␣
˓→tree
}
return rval;
}
[Source: src/coreComponents/physicsSolvers/PhysicsSolverManager.cpp]
In the code listing above, we see that in the PhysicsSolverManager class, the ObjectCatalog is searched to find
the catalogName “CompositionalMultiphaseFlow” in the scope of the PhysicsSolverBase class. Then, the factory
function of the base class PhysicsSolverBase is called. The catalogName (stored in childKey) is passed as an
argument of the factory function to ensure that it instantiates an object of the desired derived class.
As explained above, this is working because 1) the XML tag matches the catalogName of the
CompositionalMultiphaseFlow class and 2) a macro is placed at the end of the .cpp file implementing the
CompositionalMultiphaseFlow class to let the ObjectCatalog know that CompositionalMultiphaseFlow is
a derived class of PhysicsSolverBase.
Note that several instances of the same type of solver can be created, as long as they each have a different name.
After finding and placing the new solver Group in the filesystem hierarchy, properties are read and stored. This is done
by registering data wrappers. We refer to the documentation of the Data Repository for additional details about the
Wrapper s. The method used to do that is called registerWrapper and is placed in the class constructor when the
data is required in the XML file. Note that some properties are registered at the current (derived) class level, and other
properties can also be registered at a base class level.
Here, the only data (=wrapper) that is defined at the level of our CppNameOfMySolver class is temperature, and every-
thing else is registered at the base class level. We register a property of temperature, corresponding to the member class
m_temperature of CppNameOfMySolver. The registration also checks if a property is required or optional (here, it
is required), and provides a brief description that will be used in the auto-generated code documentation.
[Source: src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp]
This operation is done recursively if XML tags are nested.
To summarize:
• Every class in GEOS derive from a Group in a filesystem-like structure. A Group must have a parent Group,
can have data (in Wrapper s), and can have one or many children (the subgroups). There is an ObjectCatalog
in which the classes derived from Group are identified by a key called the catalogName.
• When parsing XML input files, GEOS inspects each object’s scope in the ObjectCatalog to find classes with
the same catalogName as the XML tag. Once it finds an XML tag in the ObjectCatalog, it registers it inside
As explained above we add the class to the ObjectCatalog in two steps. First we implement the CatalogName
function:
[source: src/coreComponents/constitutive/relativePermeability/BrooksCoreyRelativePermeability.hpp]
Then in the .cpp file we add the macro to register the catalog entry:
[source: src/coreComponents/constitutive/relativePermeability/BrooksCoreyRelativePermeability.cpp]
Now every time a “BrooksCoreyRelativePermeability” string is encountered inside a Relative Permeability
catalog, we will instantiate a class BrooksCoreyRelativePermeability.
When attaching properties (i.e. data Wrapper s) to a class, a similar registration process must be done. Every property
is accessed through its ViewKey namespace. In this namespace, we define string s that correspond to the tags of
XML attributes of the “BrooksCoreyRelativePermeability” block.
[source: src/coreComponents/constitutive/relativePermeability/BrooksCoreyRelativePermeability.hpp]
The data members are defined in the class. They will ultimately contain the data read from the XML file (other data
members not read from the XML file can also exist).
real64 m_volFracScale;
[source: src/coreComponents/constitutive/relativePermeability/BrooksCoreyRelativePermeability.hpp]
The registration process done in the class constructor puts everything together. It connects the attributes values in the
XML file to class member data. For instance, in the listing below, the first registerWrapper call means that we want
to read in the XML file the attribute value corresponding to the attribute tag ‘’phaseMinVolumeFraction” defined in
the .hpp file, and that we want to store the read values into the m_phaseMinVolumeFraction data members. We see
that this input is not required. If it is absent from the XML file, the default value is used instead. The short description
that completes the registration will be added to the auto-generated documentation.
setApplyDefaultValue( 0.0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Minimum volume fraction value for each phase" );
[source: src/coreComponents/constitutive/relativePermeability/BrooksCoreyRelativePermeability.cpp]
We are ready to use the relative permeability model in GEOS. The corresponding XML block (child node of the
“Constitutive” block) reads:
<Constitutive>
<BrooksCoreyBakerRelativePermeability name="relperm"
phaseNames="{oil, gas, water}"
phaseMinVolumeFraction="{0.05, 0.05, 0.05}"
waterOilRelPermExponent="{2.5, 1.5}"
waterOilRelPermMaxValue="{0.8, 0.9}"
gasOilRelPermExponent="{3, 3}"
gasOilRelPermMaxValue="{0.4, 0.9}"/>
<Constitutive>
With this construct, we instruct the ConstitutiveManager class (whose catalogName is “Constitutive”) to instan-
tiate a subgroup of type BrooksCoreyRelativePermeability. We also fill the data members of the values that we
want to use for the simulation. For a simulation with multiple regions, we could define multiple relative permeability
models in the “Constitutive” XML block (yielding multiple relperm subgroups in GEOS), with a unique name attribute
for each model.
For more examples on how to contribute to GEOS, please read Adding a new Physics Solver
A schema file is a useful tool for validating input .xml files and constructing user-interfaces. Rather than manually
maintaining the schema during development, GEOS is designed to automatically generate one by traversing the docu-
mentation structure.
To generate the schema, run GEOS with the input, schema, and the (optional) schema_level arguments, i.e.: geosx -i
input.xml -s schema.xsd. There are two ways to limit the scope of the schema:
1. Setting the verbosity flag for an object in the documentation structure. If the schema-level argument is used, then
only objects (and their children) and attributes with (verbosity < schema-level) will be output.
2. By supplying a limited input xml file. When GEOS builds its data structure, it will only include objects that are
listed within the xml (or those that are explicitly appended when those objects are initialized). The code will add
all available attributes for these objects to the schema.
To take advantage of this design it is necessary to use the automatic xml parsing approach that relies upon the docu-
mentation node. If values are read in manually, then the schema can not be used to validate xml those inputs.
Note: the lightweight xml parser that is used in GEOS cannot be used to validate inputs with the schema directly. As
such, it is necessary to use an external tool for validation, such as the geosx_tools python module.
The mesh objects in GEOS such as the FaceManager or NodeManager, are derived from ObjectManagerBase, which
in turn derives from Group. The important distinction is that ObjectManagerBase contains various members that are
useful when defining mesh object managers. When considering data that is attached to a mesh object, we group the
data into two categories:
• Intrinsic data is data that is required to describe the object. For instance, to define a Node, the NodeManager con-
tains an array of positions corresponding to each Node it contains. Thus the ReferencePosition is Intrinsic
data. Intrinsic data is almost always a member of the mesh object, and is registered on the mesh object in the
constructor of mesh object itself.
• Field data (or Extrinsic data) is data that is not required to define the object. For instance, a physics package
may request that a Velocity value be stored on the nodes. Appropriately the data will be registered on the
NodeManager. However, this data is not required to define a Node, and is viewed as Fields or Extrinsic.
Field data is never a member of the mesh object, and is typically registered on the mesh object outside of the
definition of the mesh object (i.e. from a physics solver).
As mentioned above, Intrinsic data is typically a member of the mesh object, and is registered in the constructor
of the mesh Object. Taking the NodeManager and the referencePosition as an example, we point out that the
reference position is actually a member in the NodeManager.
/**
* @brief Get the mutable reference position array. This table will contain all the␣
˓→node coordinates.
/**
* @brief Provide an immutable arrayView of the reference position. This table will␣
˓→contain all the node coordinates.
Finally in order to access this data, the NodeManager provides explicit accessors.
/**
* @brief Get the mutable reference position array. This table will contain all the␣
˓→node coordinates.
/**
* @brief Provide an immutable arrayView of the reference position. This table will␣
˓→contain all the node coordinates.
Thus the interface for Intrinsic data is set by the object that it is a part of, and the developer may only access the
data through the accesssors from outside of the mesh object class scope.
To register Field data, there are many ways a developer may proceed. We will use the example of
registering a totalDisplacement on the NodeManager from the SolidMechanics solver. The most
general approach is to define a string key and call one of the Group::registerWrapper() functions from
PhysicsSolverBase::registerDataOnMesh(). Then when you want to use the data, you can call
Group::getReference(). For example this would look something like:
and
This approach is flexible and extendible, but is potentially error prone due to its verbosity and lack of information
centralization. Therefore we also provide a more controlled/uniform method by which to register and extract commonly
used data on the mesh. The trait approach requires the definition of a traits struct for each data object that
will be supported. To apply the trait approach to the example use case shown above, there should be the following
definition somewhere in a header file:
namespace fields
{
struct totalDisplacement
{
static constexpr auto key = "totalDisplacement";
using DataType = real64;
using Type = array2d< DataType, nodes::TOTAL_DISPLACEMENT_PERM >;
static constexpr DataType defaultValue = 0;
static constexpr auto plotLevel = dataRepository::PlotLevel::LEVEL_0;
};
}
Also note that you should use the DECLARE_FIELD C++ macro that will perform this tedious task for you. Then the
registration is simplified as follows:
}
}
The end result of the trait approach to this example is that the developer has defined a standard specification for
totalDisplacement, which may be used uniformly across the code.
Mesh Hierarchy
In GEOS, the mesh structure consists of a hierarchy of classes intended to encapsulate data and functionality for each
topological type. Each class in the mesh hierarchy represents a distinct topological object, such as a nodes, edges,
faces, elements, etc. The mesh data structure is illustrated in an object instantiation hierarchy. The object instantiation
hierarchy differs from a “class hierarchy” in that it shows how instantiations of each class relate to each other in the
data hierarchy rather than how each class type relates to each other in an inheritance diagram.
To illustrate the mesh hierarchy, we propose to present it along with a model with two regions (Top and Bottom) (Fig.
1.96).
Fig. 1.95: Object instances describing the mesh domain. Cardinalities and relationships are indicated.
DomainPartition
In Fig. 1.95 the top level object DomainPartition represents a partition of the decomposed physical domain. At this
time there is a unique DomainPartition for every MPI rank.
ò Note
Hypothetically, there may be more than one DomainPartition in cases where the ranks are overloaded. Currently
GEOS does not support overloading multiple DomainPartition’s onto a rank, although this may be a future option
if its use is properly motivated.
For instance, the model presented as example can be split into two different domains (Fig. 1.97).
MeshBody
The MeshBody represents a topologically distinct mesh body. For instance if a simulation of two separate spheres was
required, then one option would be to have both spheres as part of a single mesh body, while another option would be
to have each sphere be a individual body.
ò Note
While not currently utilized in GEOS, the intent is to have the ability to handle the bodies in a multi-body mesh
on an individual basis. For instance, when conducting high resolution crush simulations of granular materials (i.e.
sand), it may be advantagous to represent each particle as a MeshBody.
MeshLevel
ò Note
In current practice, the code utilizes a single MeshLevel until such time as we implement a proper multi-level mesh
capability. The MeshLevel contains the main components that compose a discretized mesh in GEOS.
Each of the “Manager” objects are responsible for holding child objects, data, and providing functionality specific
to a single topological object. Each topological object that is used to define a discretized mesh has a “Manager”
to allow for simple traversal over the hierarchy, and to provide modular access to data. As such, the NodeManager
manages data for the “nodes”, the EdgeManager manages data for the edges, the FaceManager holds data for the
faces and the ElementRegionManager manages the physical groups within the MeshLevel ( regions, fractures, wells
etc. . . ). Additionally each manager contains index maps to the other types objects that are connected to the objects in
that manager. For instance, the FaceManager contains a downward pointing map that gives the nodes that comprise
each face in the mesh. Similarly the FaceManager contains an upward pointing map that gives the elements that are
connected to a face.
ElementRegionManager
The element data structure is significantly more complicated than the other Managers. While the other managers are
“flat” across the MeshLevel, the element data structure seeks to provide a hierarchy in order to define groupings of
the physical problem, as well as collecting discretization of similar topology. At the top of the element branch of
the hierarchy is the ElementRegionManager. The ElementRegionManager holds a collection of instantiations of
ElementRegionBase derived classes.
ElementRegion
Conceptually the ElementRegion are used to defined regions of the problem domain where a PhysicsSolver will
be applied.
• The CellElementRegion is related to all the polyhedra
• The FaceElementRegion is related to all the faces that have physical meaning in the domain, such as fractures
and faults. This object should not be mistaken with the FaceManager. The FaceManager handles all the faces
of the mesh, not only the faces of interest.
• The WellElementRegion is related to the well geometry.
An ElementRegion also has a list of materials allocated at each quadrature point across the entire region. One example
of the utility of the ElementRegion is the case of the simulation of the mechanics and flow within subsurface reservoir
with an overburden. We could choose to have two ElementRegion, one being the reservoir, and one for the overburden.
The mechanics solver would be applied to the entire problem, while the flow problem would be applied only to the
reservoir region.
Each ElementRegion holds some number of ElementSubRegion. The ElementSubRegion is meant to hold all the
element topologies present in an ElementSubRegion in their own groups. For instance, for a CellElementRegion,
there may be one CellElementSubRegion for all tetrahedra, one for all hexahedra, one for all wedges and one for all
the pyramids (Fig. 1.98).
Now that all the classes of the mesh hierarchy has been described, we propose to adapt the diagram presented in Fig.
1.95 to match with the example presented in Fig. 1.96.
Direct links to some useful class documentation:
ObjectManagerBase API
MeshLevel API
NodeManager API
FaceManager API
DoF Manager
Brief description
The main aim of the Degrees-of-Freedom (DoF) Manager class is to handle all degrees of freedom associated with
fields that exist on mesh elements, faces, edges and nodes. It creates a map between local mesh objects and global DoF
indices. Additionally, DofManager simplifies construction of system matrix sparsity patterns.
Key concepts are locations and connectors. Locations, that can be elements, faces, edges or nodes, represent where the
DoF is assigned. For example, a DoF for pressure in a two-point flux approximation will be on a cell (i.e. element),
while a displacement DoF for structural equations will be on a node. The counterparts of locations are connectors, that
are the geometrical entities that link together different DoFs that create the sparsity pattern. Connectors can be elements,
faces, edges, nodes or none. Using the same example as before, connectors will be faces and cells, respectively. The
case of a mass matrix, where every element is linked only to itself, is an example when there are no connectors, i.e.
these have to be set to none.
DoFs located on a mesh object are owned by the same rank that owns the object in parallel mesh partitioning. Two
types of DoF numbering are supported, with the difference only showing in parallel runs of multi-field problems.
• Initially, each field is assigned an independent DoF numbering that starts at 0 and is contiguous across all MPI
ranks. Within each rank, locally owned DoFs are numbered sequentially across mesh locations, and within each
mesh location (e.g. node) - sequentially according to component number. With this numbering, sparsity patterns
can be constructed for individual sub-matrices that represent diagonal/off-diagonal blocks of the global coupled
system matrix.
• After all fields have been declared, the user can call DofManager::reorderByRank(), which constructs a
globally contiguous DoF numbering across all fields. Specifically, all DoFs owned by rank 0 are numbered field-
by-field starting from 0, then those on rank 1, etc. This makes global system sparsity pattern compatible with
linear algebra packages that only support contiguous matrix rows on each rank. At this point, coupled system
Methods
• addField: creates a new set of DoF, labeled field, with specific location. Default number of components
is 1, like for pressure in flux. Default regions is the empty string, meaning all domain.
• addCoupling: creates a coupling between two fields (rowField and colField) according to a given
connectivity in the regions defined by regions. Both fields (row and column) must have already been defined
on the regions where is required the coupling among them. Default value for regions is the whole intersection
between the regions where the first and the second fields are defined. This method also creates the coupling
between colField and rowField, i.e. the transpose of the rectangular sparsity pattern. This default behaviour
can be disabled by passing symmetric = false.
• reorderByRank: finish populating field and coupling information and apply DoF re-numbering
void reorderByRank();
• getKey: returns the “key” associated with the field, that can be used to access the index array on the mesh object
manager corresponding to field’s location.
• clear: removes all fields, releases memory and re-opens the DofManager
void clear();
• setSparsityPattern: populates the sparsity for the given rowField and colField into matrix. Closes the
matrix if closePattern is true.
• setSparsityPattern: populates the sparsity for the full system matrix into matrix. Closes the matrix if
closePattern is true.
• numGlobalDofs: returns the total number of DoFs across all processors for the specified name field (if given)
or all fields (if empty).
• numLocalDofs: returns the number of DoFs on this process for the specified name field (if given) or all fields
(if empty).
• printFieldInfo: prints a short summary of declared fields and coupling to the output stream os.
Example
Here we show how the sparsity pattern is computed for a simple 2D quadrilateral mesh with 6 elements. Unknowns
are pressure, located on the element center, and displacements (x and y components), located on the nodes. For fluxes,
a two-point flux approximation (TPFA) is used. The representation of the sparsity pattern of the CL matrix (connec-
tors/locations) for the simple mesh, shown in Fig. 1.99, is reported in Fig. 1.100. It can be noticed that the two unknowns
for the displacements x and y are grouped together. Elements are the connectivity for DoF on nodes (Finite Element
Method for displacements) and on elements (pressures). Faces are the connectivity for DoF on elements (Finite Volume
Method for pressure), being the flux computation based on the pressure on the two adjacent elements.
Fig. 1.99: Small 2D quadrilateral mesh used for this examples. Nodes are label with black numbers, elements with
light gray numbers and faces with italic dark gray numbers.
The global sparsity pattern, shown in Fig. 1.101, is obtained through the symbolic multiplication of the transpose of
the matrix CL and the matrix itself, i.e. P = CT
L CL .
Fig. 1.101: Sparsity pattern of the global matrix, where red and green entries are related to the displacement field and
to the pressure field, respectively. Blue entries represent coupling blocks.
Now we build the pattern of the Jacobian matrix for a simple 3D mesh, shown in Fig. 1.102. Fields are:
• displacement (location: node, connectivity: element) defined on the blue, orange and red regions;
• pressure (location: element, connectivity: face) defined on the green, orange and red regions;
• mass matrix (location: element, connectivity: element) defined on the green region only.
Moreover, following coupling are imposed:
• displacement-pressure (connectivity: element) on the orange region only;
• pressure-mass matrix and transpose (connectivity: element) everywhere it is possibile.
Fig. 1.103 shows the global pattern with the field-based ordering of unknowns. Different colors mean different fields.
Red unkwnons are associated with displacement, yellow ones with pressure and blue ones with mass matrix. Orange
means the coupling among displacement and pressure, while green is the symmetric coupling among pressure and mass
matrix.
Fig. 1.103: Global pattern with field-based ordering. Red is associated with displacement unknowns, yellow with
pressure ones and blue with those of mass matrix field. Orange means the coupling among displacement and pressure,
while green is the symmetric coupling among pressure and mass matrix.
Fig. 1.104 shows the global pattern with the MPI rank-based ordering of unknowns. In this case, just two processes are
used. Again, different colors indicate different ranks.
Fig. 1.104: Global pattern with MPI rank-based ordering. Red unkwnons are owned by rank 0 and green ones by rank
1. Blue indicates the coupling among the two processes.
LvArray
Use in GEOS
LvArray containers are used in GEOS as primary storage mechanism for mesh topology, field data and any other type of
“large” data sets (i.e. ones that scale with the size of the problem). When allocating a new field, using one of LvArray
containers is mandatory if the data is meant to be used in any computational kernel. The file common/DataTypes.hpp
provides shorthand aliases for commonly used containers:
/**
* @name Aliases for LvArray::Array class family.
*/
///@{
///@}
/**
* @name Short-hand aliases for commonly used array types.
*/
///@{
/**
* @name Aliases for sorted arrays and set types.
*/
///@{
///@}
/**
* @name Aliases for LvArray::ArrayOfArrays class family.
*/
///@{
///@}
LvArray documentation
Please refer to the full LvArray documentation for details on each of the classes.
Kernel interface
Finite Element Method Kernel Interface
The finite element method kernel interface (FEMKI) specifies an API for the launching of computational kernels for
solving physics discretized using the finite element method. Using this approach, a set of generic element looping
pattens and kernel launching functions may be implemented, and reused by various physics solvers that contain kernels
conforming to the FEMKI.
There are several main components of the FEMKI:
1. A collection of element looping functions that provide various looping patterns, and call the launch function.
2. The kernel interface, which is specified by the finiteElement::KernelBase class. Each physics solver will define
a class that contains its kernels functions, most likely deriving, or conforming to the API specified by the Ker-
nelBase class. Also part of this class will typically be a nested StackVariables class that defines a collection
of stack variables for use in the various kernel interface functions.
3. A launch function, which launches the kernel, and calls the kernel interface functions conforming to the interface
defined by KernelBase. This function is actually a member function of the Kernel class, so it may be overridden
by a specific physics kernel, allowing complete customization of the interface, while maintaining the usage of
the looping patterns.
/**
* @brief Performs a loop over specific regions (by type and name) and calls a kernel␣
˓→launch on the subregions
* with compile time knowledge of sub-loop bounds such as number of nodes and␣
˓→quadrature points per element.
* @tparam POLICY The RAJA launch policy to pass to the kernel launch.
* @tparam CONSTITUTIVE_BASE The common base class for constitutive pass-thru/dispatch␣
˓→which gives the kernel
*
* @details Loops over all regions Applies/Launches a kernel specified by the @p KERNEL_
˓→TEMPLATE through
* #::geos::finiteElement::KernelBase::kernelLaunch().
*/
template< typename POLICY,
typename CONSTITUTIVE_BASE,
typename SUBREGION_TYPE,
typename KERNEL_FACTORY >
static
real64 regionBasedKernelApplication( MeshLevel & mesh,
arrayView1d< string const > const & targetRegions,
string const & finiteElementName,
string const & constitutiveStringName,
KERNEL_FACTORY & kernelFactory )
{
GEOS_MARK_FUNCTION;
// save the maximum residual contribution for scaling residuals for convergence␣
˓→criteria.
real64 maxResidualContribution = 0;
// Loop over all sub-regions in regions of type SUBREGION_TYPE, that are listed in the␣
˓→ targetRegions array.
elementRegionManager.forElementSubRegions< SUBREGION_TYPE >( targetRegions,
[&constitutiveStringName,
&maxResidualContribution,
&nodeManager,
&edgeManager,
(continues on next page)
}
else
{
nullConstitutiveModel = &elementSubRegion.template registerGroup<␣
˓→constitutive::NullModel >( "nullModelGroup" );
constitutiveRelation = nullConstitutiveModel;
}
// Call the constitutive dispatch which converts the type of constitutive model into␣
˓→a compile time constant.
constitutive::ConstitutivePassThru< CONSTITUTIVE_BASE >::execute(␣
˓→*constitutiveRelation,
[&
˓→maxResidualContribution,
&nodeManager,
&edgeManager,
&faceManager,
targetRegionIndex,
&kernelFactory,
&elementSubRegion,
&
˓→finiteElementName,
numElems]
( auto &␣
˓→castedConstitutiveRelation )
{
FiniteElementBase &
subRegionFE = elementSubRegion.template getReference< FiniteElementBase >(␣
˓→finiteElementName );
// Call the kernelLaunch function, and store the maximum contribution to the␣
˓→residual.
maxResidualContribution =
std::max( maxResidualContribution,
KERNEL_TYPE::template kernelLaunch< POLICY, KERNEL_TYPE >( numElems,␣
˓→kernel ) );
} );
} );
} );
return maxResidualContribution;
}
This pattern may be used with any kernel class that either:
1. Conforms to the KernelBase interface by defining each of the kernel functions in KernelBase.
2. Defines its own kernelLaunch function that conforms the the signature of KernelBase::kernelLaunch. This
option essentially allows for a custom kernel that does not conform to the interface defined by KernelBase and
KernelBase::kernelLaunch.
The kernelLaunch function is a member of the kernel class itself. As mentioned above, a physics implementation
may use the existing KernelBase interface, or define its own. The KernelBase::kernelLaunch function defines
a launching policy, and an internal looping pattern over the quadrautre points, and calls the functions defined by the
KernelBase as shown here:
kernelComponent.setup( k, stack );
// #pragma unroll
for( integer q=0; q<numQuadraturePointsPerElem; ++q )
{
kernelComponent.quadraturePointKernel( k, q, stack );
}
maxResidual.max( kernelComponent.complete( k, stack ) );
} );
return maxResidual.get();
}
Each of the KernelBase functions called in the KernelBase::kernelLaunch function are intended to provide a
certain amount of modularity and flexibility for the physics implementations. The general purpose of each function is
described by the function name, but may be further descibed by the function documentation found here.
Constitutive models
In GEOS, all constitutive models defining fluid and rock properties are implemented in the namespace constitutive
and derived from a common base class, ConstitutiveBase. All objects are owned and handled by the
ConstitutiveManager.
Standalone models
• contact laws.
Each constitutive model owns, as member variables, LvArray::Array containers that hold the properties (or fields)
and their derivatives with respect to the other fields needed to update each property. Each property is stored as an array
with the first dimension representing the elementIndex and the second dimension storing the index of the integration
point. These dimensions are determined by the number of elements of the subregion on which each constitutive model
is registered, and by the chosen discretization method. Vector and tensor fields have an additional dimension to identify
their components. Similarly, an additional dimension is necessary for multiphase fluid models with properties defined
for each component in each phase. For example, a single-phase fluid model where density and viscosity are functions
of the fluid pressure has the following members:
array2d< real64 > m_density;
array2d< real64 > m_dDensity_dPressure;
array2d< real64 > m_dDensity_dTemperature;
Resizing all fields of the constitutive models happens during the initialization phase by the ConstitutiveManger
through a call to ConstitutiveManger::hangConstitutiveRelation, which sets the appropriate subRegion as
the parent Group of each constitutive model object. This function also resizes all fields based on the size of the subregion
and the number of quadrature points on it, by calling CONSTITUTIVE_MODEL::allocateConstitutiveData. For
the single phase fluid example used before, this call is:
void SingleFluidBase::allocateConstitutiveData( Group & parent,
localIndex const␣
˓→numConstitutivePointsPerParentIndex )
{
ConstitutiveBase::allocateConstitutiveData( parent,␣
˓→numConstitutivePointsPerParentIndex );
resize( parent.size() );
m_dInternalEnergy_dTemperature.resize( parent.size(),␣
˓→numConstitutivePointsPerParentIndex );
Any property or field stored on a constitutive model must be updated within a computational kernel to ensure that host
and device memory in GPUs are properly synced, and that any updates are performed on device. Some properties
are updated within finite element kernels of specific physics (such as stress in a mechanics kernel). Consequently, for
each constitutive model class, a corresponding nameOfTheModelUpdates, which only contains LvArray::arrayView
containers to the data, can be captured by value inside computational kernels. For example, for the single phase fluid
model Updates are:
/**
* @brief Base class for single-phase fluid model kernel wrappers.
*/
class SingleFluidBaseUpdate
{
public:
/**
* @brief Get number of elements in this wrapper.
* @return number of elements
*/
GEOS_HOST_DEVICE
localIndex numElems() const { return m_density.size( 0 ); }
/**
* @brief Get number of gauss points per element.
* @return number of gauss points per element
*/
GEOS_HOST_DEVICE
localIndex numGauss() const { return m_density.size( 1 ); };
protected:
/**
* @brief Constructor.
* @param density fluid density
* @param dDens_dPres derivative of density w.r.t. pressure
* @param viscosity fluid viscosity
* @param dVisc_dPres derivative of viscosity w.r.t. pressure
*/
SingleFluidBaseUpdate( arrayView2d< real64 > const & density,
(continues on next page)
/**
* @brief Copy constructor.
*/
SingleFluidBaseUpdate( SingleFluidBaseUpdate const & ) = default;
/**
* @brief Move constructor.
*/
SingleFluidBaseUpdate( SingleFluidBaseUpdate && ) = default;
/**
* @brief Deleted copy assignment operator
* @return reference to this object
*/
SingleFluidBaseUpdate & operator=( SingleFluidBaseUpdate const & ) = delete;
/**
* @brief Deleted move assignment operator
* @return reference to this object
*/
SingleFluidBaseUpdate & operator=( SingleFluidBaseUpdate && ) = delete;
Because Updates classes are responsible for updating the fields owned by the constitutive models, they also implement
all functions needed to perform property updates, such as:
private:
/**
* @brief Compute fluid properties and derivatives at a single point.
* @param[in] pressure the target pressure value
* @param[out] density fluid density
(continues on next page)
/**
* @brief Compute fluid properties and derivatives at a single point.
* @param[in] pressure the target pressure value
* @param[in] temperature the target temperature value
* @param[out] density fluid density
* @param[out] dDensity_dPressure fluid density derivative w.r.t. pressure
* @param[out] dDensity_dTemperature fluid density derivative w.r.t. temperature
* @param[out] viscosity fluid viscosity
* @param[out] dViscosity_dPressure fluid viscosity derivative w.r.t. pressure
* @param[out] dViscosity_dTemperature fluid viscosity derivative w.r.t. temperature
* @param[out] internalEnergy fluid internal energy
* @param[out] dInternalEnergy_dPressure fluid internal energy derivative w.r.t.␣
˓→pressure
/**
* @brief Update fluid state at a single point.
* @param[in] k element index
* @param[in] q gauss point index
* @param[in] pressure the target pressure value
*/
(continues on next page)
/**
* @brief Update fluid state at a single point.
* @param[in] k element index
* @param[in] q gauss point index
* @param[in] pressure the target pressure value
* @param[in] temperature the target temperature value
*/
GEOS_HOST_DEVICE
virtual void update( localIndex const k,
localIndex const q,
real64 const pressure,
real64 const temperature ) const = 0;
};
Compound models
Compound constitutive models are employed to mimic the behavior of a material that requires a combination of con-
stitutive models linked together. These compound models do not hold any data. They serve only as an interface with
the individual models that they couple.
Coupled Solids
CoupledSolid models are employed to represent porous materials that require both a mechanical behavior and con-
stitutive laws that describe the dependency of porosity and permeability on the primary unknowns.
The base class CoupledSolidBase implements some basic behaviors and is used to access a generic CoupledSolid
in a physics solver:
geos::constitutive::CoupledSolidBase const & solid =
getConstitutiveModel< geos::constitutive::CoupledSolidBase >( subRegion, subRegion.
˓→template getReference< string >( viewKeyStruct::solidNamesString() ) );
Additionally, a template class defines a base CoupledSolid model templated on the types of solid, porosity, and
permeability models:
template< typename SOLID_TYPE,
typename PORO_TYPE,
typename PERM_TYPE >
class CoupledSolid : public CoupledSolidBase
While physics solvers that need a porous material only interface with a compound model, this one has access to the
standalone models needed:
protected:
SOLID_TYPE const & getSolidModel() const
{ return this->getParent().template getGroup< SOLID_TYPE >( m_solidModelName ); }
LaplaceFEM overview
In order to register an enumeration type with the Data Repository and have its value read from input, we must define
stream insertion/extraction operators. This is a common task, so GEOS provides a facility for automating it. Upon
including common/EnumStrings.hpp, we can call the following macro at the namespace scope (in this case, right
after the LaplaceBaseH1 class definition is complete):
ENUM_STRINGS( LaplaceBaseH1::TimeIntegrationOption,
"SteadyState",
"ImplicitTransient" );
Once explained the main variables and enum, let us start reading through the different member functions:
/// The constructor needs a user-defined "name" and a parent Group (to place this␣
˓→instance in the
/// tree structure of classes)
LaplaceFEM( const string & name,
Group * const parent );
/// Destructor
virtual ~LaplaceFEM() override;
/// "CatalogName()" return the string used as XML tag in the input file. It ties the␣
˓→XML tag with
/// this C++ classes. This is important.
static string catalogName() { return "LaplaceFEM"; }
/**
* @copydoc PhysicsSolverBase::getCatalogName()
*/
string getCatalogName() const override { return catalogName(); }
Start looking at the class LaplaceFEM constructor and destructor declarations shows the usual string name and Group*
pointer to parent that are required to build the global file-system like structure of GEOS (see Group : the base class of
GEOS for details). It can also be noted that the nullary constructor is deleted on purpose to avoid compiler automatic
generation and user misuse.
The next method catalogName() is static and returns the key to be added to the Catalog for this type of solver (see
A few words about the ObjectCatalog for details). It has to be paired with the following macro in the implementation
file.
REGISTER_CATALOG_ENTRY( PhysicsSolverBase, LaplaceFEM, string const &, Group * const )
It is used to assign fields onto the discretized mesh object and will be further discussed in the Implementation File
(reference) section.
The next block consists in solver interface functions. These member functions set up and specialize every time step
from the system matrix assembly to the solver stage.
virtual void
setupSystem( DomainPartition & domain,
DofManager & dofManager,
CRSMatrix< real64, globalIndex > & localMatrix,
ParallelVector & rhs,
ParallelVector & solution,
bool const setSparsity = false ) override;
virtual void
assembleSystem( real64 const time,
real64 const dt,
DomainPartition & domain,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs ) override;
Furthermore, the following functions are inherited from the base class.
virtual real64 solverStep( real64 const & time_n,
real64 const & dt,
integer const cycleNumber,
DomainPartition & domain ) override;
virtual void
implicitStepSetup( real64 const & time_n,
real64 const & dt,
DomainPartition & domain ) override;
virtual void
setupDofs( DomainPartition const & domain,
DofManager & dofManager ) const override;
virtual void
applyBoundaryConditions( real64 const time,
real64 const dt,
DomainPartition & domain,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const &␣
(continues on next page)
virtual void
applySystemSolution( DofManager const & dofManager,
arrayView1d< real64 const > const & localSolution,
real64 const scalingFactor,
real64 const dt,
DomainPartition & domain ) override;
virtual void
resetStateToBeginningOfStep( DomainPartition & GEOS_UNUSED_PARAM( domain ) )␣
˓→override;
virtual void
implicitStepComplete( real64 const & time,
real64 const & dt,
DomainPartition & domain ) override;
This embedded instantiated structure is a common pattern shared by all solvers. It stores dataRepository::ViewKey
type objects that are used as binding data between the input XML file and the source code.
struct viewKeyStruct : public PhysicsSolverBase::viewKeyStruct
{
static constexpr char const * timeIntegrationOption() { return "timeIntegrationOption
˓→"; }
<LaplaceFEM
name="laplace"
discretization="FE1"
timeIntegrationOption="SteadyState"
fieldName="Temperature"
targetRegions="{ Domain }">
<LinearSolverParameters
directParallel="0"/>
</LaplaceFEM>
In the following section, we will see where this binding takes place.
Switching to implementation, we will focus on few implementations, leaving details to other tutorials. The LaplaceFEM
constructor is implemented as follows.
setInputFlag( InputFlags::REQUIRED ).
setDescription( "Time integration method. Options are:\n* " + EnumStrings<␣
˓→TimeIntegrationOption >::concat( "\n* " ) );
Checking out the constructor, we can see that the use of a registerWrapper<T>(...) allows us to register the key
value from the enum viewKeyStruct defining them as:
• InputFlags::OPTIONAL if they are optional and can be provided;
• InputFlags::REQUIRED if they are required and will throw error if not;
registerDataOnMesh() is browsing all subgroups in the mesh Group object and for all nodes in the sub group:
• register the observed field under the chosen m_fieldName key;
• apply a default value;
• set the output verbosity level (here PlotLevel::LEVEL_0);
• set the field associated description for auto generated docs.
{
NodeManager & nodeManager = mesh.getNodeManager();
string const dofKey = dofManager.getKey( m_fieldName );
arrayView1d< globalIndex const > const &
dofIndex = nodeManager.getReference< array1d< globalIndex > >( dofKey );
dummyString,
kernelFactory );
(continues on next page)
} );
assembleSystem() will be our core focus as we want to change the diffusion coefficient from its hard coded value
to a XML read user-defined value. One can see that this method is in charge of constructing in a parallel fashion
the FEM system matrix. Bringing nodeManager and ElementRegionManager from domain local MeshLevel ob-
ject together with FiniteElementDiscretizationManager from the NumericalMethodManager, it uses nodes
embedded loops on degrees of freedom in a local index embedded loops to fill a matrix and a rhs container.
As we spotted the place to change in a code to get a user-defined diffusion coefficient into the game, let us jump to
writing our new LaplaceDiffFEM solver.
ò Note
We might want to remove final keyword from postInputInitialization() as it will prevent you from overrid-
ing it.
Declaration File
As there is only few places where we have to change, the whole declaration file is reported below and commented
afterwards.
#include "physicsSolvers/simplePDE/LaplaceFEM.hpp"
namespace geos
{
LaplaceDiffFEM() = delete;
virtual void
assembleSystem( real64 const time,
real64 const dt,
DomainPartition * const domain,
DofManager const & dofManager,
ParallelMatrix & matrix,
(continues on next page)
protected:
virtual void postInputInitialization() override final;
private:
real64 m_diffusion;
};
We intend to have a user-defined diffusion coefficient, we then need a real64 class variable m_diffusion to store it.
Consistently with LaplaceFEM, we will also delete the nullary constructor and declare a constructor with the same
arguments for forwarding to Group master class. Another mandatory step is to override the static CatalogName()
method to properly register any data from the new solver class.
Then as mentioned in Implementation File (reference), the diffusion coefficient is used when assembling the matrix
coefficient. Hence we will have to override the assembleSystem() function as detailed below.
Moreover, if we want to introduce a new binding between the input XML and the code we will have to work on the
three struct viewKeyStruct , postInputInitialization() and the constructor.
Our new solver viewKeyStruct will have its own structure inheriting from the LaplaceFEM one to have the
timeIntegrationOption and fieldName field. It will also create a diffusionCoeff field to be bound to the
user defined homogeneous coefficient on one hand and to our m_diffusion class variable on the other.
Implementation File
As we have seen in Implementation File (reference), the first place where to implement a new register from XML input
is in the constructor. The diffusionCoeff entry we have defined in the laplaceDiffFEMViewKeys will then be
asked as a required input. If not provided, the error thrown will ask for it described asked an “input uniform diffusion
coefficient for the Laplace equation”.
Another important spot for binding the value of the XML read parameter to our m_diffusion is in
postInputInitialization().
void LaplaceDiffFEM::postInputInitialization()
{
LaplaceFEM::postInputInitialization();
(continues on next page)
Now that we have required, read and bind the user-defined diffusion value to a variable, we can use it in the construction
of our matrix into the overridden assembleSystem().
}
}
matrix.add( elemDofIndex, elemDofIndex, element_matrix );
rhs.add( elemDofIndex, element_rhs );
}
}
Note: For consistency do not forget to change LaplaceFEM to LaplaceDiffFEM in the guards comments
Last steps
After assembling both declarations and implementations for our new solver, the final steps go as:
• add declarations to parent CMakeLists.txt (here add to physicsSolvers_headers );
• add implementations to parent CMakeLists.txt (here add to physicsSolvers_sources);
• check that Doxygen comments are properly set in our solver class;
• uncrustify it to match the code style by going to the build folder and running the command: make uncrustify_style;
• write unit tests for each new features in the solver class;
• write an integratedTests for the solver class.
1.7 Doxygen
The GEOS c++ API in is documented using doxygen. The doxygen class list pages
Developers may find it helpful to review the Code Components described in the Developer Guide before diving into
the doxygen.
Some key doxygen pages are linked below:
Group API
Wrapper API
ObjectManagerBase API
PhysicsSolverBase API
List of prerequisites
Minimal requirements:
• CMake build system generator (3.23.1+).
• build tools (GNU make or ninja on Linux, XCode on MacOS).
• a C++ compiler with full c++17 standard support (gcc 12+ or clang 13.0+ are recommended).
• python 3.9-3.11 (versions 3.12+ are untested).
• zlib, blas and lapack libraries
• any compatible MPI runtime and compilers (if building with MPI)
If you want to build from a repository check out (instead of a release tarball):
• git (2.20+ is tested, but most versions should work fine)
If you plan on building bundled third-party library (TPLs) dependencies yourself:
• Compatible C and Fortran compilers
If you will be checking out and running integrated tests (a submodule of GEOS, currently not publicly available):
• git-lfs (Git Large File Storage extension)
• h5py and mpi4py python modules
If you are interested in building Doxygen documentation:
• GNU bison
• LaTeX
• ghostscript
• Graphviz
In order for XML validation to work (executed as an optional build step):
• xmllint
Installing prerequisites
On a local development machine with sudo/root privileges, most of these dependencies can be installed with a system
package manager. For example, on a Debian-based system (check your package manager for specific package names):
sudo apt install build-essential git git-lfs gcc g++ gfortran cmake libopenmpi-dev␣
˓→libblas-dev liblapack-dev zlib1g-dev python3 python3-h5py python3-mpi4py libxml2-utils
On HPC systems it is typical for these tools to be installed by system administrators and provided via modules. To list
available modules, type:
module avail
Then load the appropriate modules using module load command. Please contact your system administrator if you
need help choosing or installing appropriate modules.
Libraries
Tools
The following tools are used as part of the build process to support GEOS development:
Some other dependencies (GoogleTest, GoogleBenchmark) are provided through BLT build system which is embedded
in GEOS source. No actions are needed to build them.
If you would like to create a Docker image with all dependencies, take a look at Dockerfiles that are used in our CI
process.
cd thirdPartyLibs
python scripts/config-build.py --hostconfig=/path/to/host-config.cmake --
˓→buildtype=Release --installpath=/path/to/install/dir -DNUM_PROC=8
where
– --buildpath or -bp is the build directory (by default, created under current).
– --installpath or -ip is the installation directory(wraps CMAKE_INSTALL_PREFIX).
– --buildtype or -bt is a wrapper to the CMAKE_BUILD_TYPE option.
– --hostconfig or -hc is a path to host-config file.
– all other command-line options are passed to CMake.
• Run the build:
cd <buildpath>
make
. Warning
Do not provide -j argument to make here, since the top-level make only launches sub-project builds. Instead
use -DNUM_PROC option above, which is passed to each sub-project’s make command.
You may also run the CMake configure step manually instead of relying on config-build.py. The full TPL build
may take anywhere between 15 minutes and 2 hours, depending on your machine, number of threads and libraries
enabled.
ò Note
An exception from the above pattern, sphinx is currently not a part of the TPL bundle and must be installed with
your Python or package manager.
ò Note
PETSc build currently downloads pt-scotch from the internet. If you do not have access to internet, modify the
./configure step of petsc in CMakeLists.txt and change the --download-ptscotch option accordingly. pt-scotch
also relies on bison and flex.
include("/path/to/GEOS/host-configs/tpls.cmake")
which will set all the individual TPL paths for you.
• Configure via config-build.py script:
cd GEOS
python scripts/config-build.py --hostconfig=/path/to/host-config.cmake --
˓→buildtype=Release --installpath=/path/to/install/dir
where
– --buildpath or -bp is the build directory (by default, created under current working dir).
– --installpath or -ip is the installation directory(wraps CMAKE_INSTALL_PREFIX).
– --buildtype or -bt is a wrapper to the CMAKE_BUILD_TYPE option.
– --hostconfig or -hc is a path to host-config file.
– all unrecognized options are passed to CMake.
If --buildpath is not used, build directory is automatically named
build-<config-filename-without-extension>-<buildtype>. It is possible to keep automatic
naming and change the build root directory with --buildrootdir. In that case, build path will be set to
<buildrootdir>/<config-filename-without-extension>-<buildtype>. Both --buildpath and
--buildrootdir are incompatible and cannot be used in the same time. Same pattern is applicable to install
path, with --installpath and --installrootdir options.
• Run the build:
cd <buildpath>
make -j $(nproc)
You may also run the CMake configure step manually instead of relying on config-build.py. A full build typically
takes between 10 and 30 minutes, depending on chosen compilers, options and number of cores.
Configuration options
Below is a list of CMake configuration options, in addition to TPL options above. Some options, when enabled, require
additional settings (e.g. ENABLE_CUDA). Please see host-config examples.
./scripts/uberenv/uberenv.py
This will create a directory uberenv_libs (or a directory name you specify by adding --prefix directory-name)
in the current working directory, clone Spack into uberenv_libs/spack and install the dependencies into
uberenv_libs/system_dependent_path. It will then spit out a host-config file in the current directory which you
can use to build GEOS. While the above command should work on every system, it should never be used. Invoked as
such, Spack will ignore any system libraries you have installed and will go down a rabbit hole building dependencies.
Furthermore this does not allow you to choose the compiler to build. Both of these are easily solved by creating a
directory with a spack.yaml.
To prevent this from happening you’ll need to create a directory with a spack.yaml file. You can find working examples
for commonly used systems in scripts/spack_configs.
Once you have these files setup you can run Uberenv again and instruct it to use them with. If for instance you added
Clang 10.0.1 to the spack.yaml file the your command would look something like this:
It is worth noting that GEOS has two project json files (.uberenv_config.json and scripts/pygeosx_configs/
pygeosx.json) and two configuration directories for LC systems (scripts/spack_configs and scripts/
ò Note
When building pygeosx, Spack will build various python packages, however by default they are not installed in
python. There are various ways of accomplishing this, but the recommended approach is to use spack environments.
Once you build pygeosx using Uberenv, Spack will create a view that ensures the Spack-built python can find the
built python packages. For example, with a default uberenv_libs directory of dependencies, the path to the view
of python will be uberenv_libs/._view/*/bin/python3. If you want to use your pygeosx python3 executable
in GEOS, you will need to update your host-config’s Python3_ROOT_DIR and Python3_EXECUTABLE to the path
to Spack’s view of python.
Build Configuration
. Warning
The spack build system is undergoing updates. The petsc variant and others are still a work in progress.
The GEOS Spack package has a lot of options for controlling which dependencies you would like to build and how you’d
like them built. The GEOS Spack package file is at `scripts/spack_packages/packages/geosx/package.py
<https://github.com/GEOS-DEV/GEOS/tree/develop/scripts/spack_packages/packages/geosx/
package.py>`_. The variants for the package are as follows
For example if you wanted to build with GCC 8.3.1, without Caliper and with Hypre as the Linear Algebra Interface,
your spec would be %[email protected] ~caliper lai=hypre.
The GEOS Spack package lists out the libraries that GEOS depends ons. Currently these dependencies are
depends_on('[email protected]:', type='build')
depends_on('blt')
#
# Virtual packages
#
depends_on('mpi')
depends_on('blas')
depends_on('lapack')
#
# Performance portability
#
depends_on('raja +openmp~examples~exercises~shared')
depends_on('umpire +c+openmp~examples+fortran~device_alloc~shared')
depends_on('[email protected] +raja+openmp~examples~shared')
depends_on('camp')
with when('+cuda'):
for sm_ in CudaPackage.cuda_arch_values:
depends_on('raja+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.
˓→format(sm_))
#
# IO
#
depends_on('[email protected]')
depends_on('[email protected]~fortran')
depends_on('[email protected]~test~fortran~hdf5_compat')
depends_on('[email protected]', when='+caliper')
depends_on('[email protected]~gotcha~sampler~libunwind~libdw', when='+caliper')
depends_on('[email protected]')
depends_on('[email protected] cxxstd=14')
depends_on('[email protected]', when='+vtk')
(continues on next page)
depends_on('fesapi', when='+fesapi')
#
# Math
#
depends_on('[email protected]+int64')
depends_on('superlu-dist +int64+openmp')
depends_on('[email protected]+openmp')
trilinos_build_options = '+openmp'
trilinos_packages = '+aztec+stratimikos~amesos2~anasazi~belos~ifpack2~muelu~
˓→sacado+thyra'
depends_on("hypre +cuda+superlu-dist+mixedint+mpi+openmp+umpire+unified-memory␣
˓→cxxflags='-fPIC'", when='+hypre+cuda')
with when('+cuda'):
for sm_ in CudaPackage.cuda_arch_values:
depends_on('hypre+cuda cuda_arch={0}'.format(sm_), when='cuda_arch={0}'.
˓→format(sm_))
depends_on('[email protected]~hdf5~hypre+int64', when='+petsc')
depends_on('petsc+ptscotch', when='+petsc+scotch')
#
# Python
#
depends_on('python')
#
# Dev tools
#
depends_on('uncrustify', when='+uncrustify')
#
# Documentation
#
depends_on('[email protected]', when='+docs', type='build')
depends_on('[email protected]:', when='+docs', type='build')
Using the Spack spec syntax you can inturn specify variants for each of the dependencies of GEOS. So for example
if you could modify the spec above to build RAJA in debug by using %[email protected] ~caliper lai=hypre ^raja
build_type=Debug. When building with Uberenv Spack should print out a table containing the full spec for every
dependency it will build. If you would like to look at the variants for say RAJA in more detail you can find the package
file at uberenv_libs/spack/var/spack/repos/builtin/packages/raja/package.py.
GEOS_TPL_DIR
variable contains the absolute path of the installation root directory of the third party libraries. GEOS must use it when
building.
Other variables are classical absolute path compiler variables.
CC
CXX
MPICC
MPICXX
MPIEXEC
The following openmpi environment variables allow it to work properly in the docker container. But there should be
no reason to access or use them explicitly.
OMPI_CC=$CC
OMPI_CXX=$CXX
note: this is the command for `zsh`. Other shells will require different commands.␣
˓→Homebrew should provide the correct command after install is complete.
brew install bison cmake gfortran git-lfs open-mpi lapack python3 ninja m4
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/m4/bin:$PATH"' >> ~/.zshrc
git lfs install
Clone GEOS
Clone thirdPartyLibs
cd build-macOS_arm-release
make
You will get an error at the end. . . you can ignore it.
Build GEOS
cd ../../GEOS
python3 scripts/config-build.py -hc host-configs/apple/macOS_arm.cmake -bt Release --
˓→ninja
cd build-macOS_arm-release
ninja geosx
hydrocarbonViscosi- groupNameRef_array {}
tyTableNames
List of viscosity
TableFunction names
from the Functions block.
The user must provide
one TableFunction per
hydrocarbon phase, in the
order provided in
“phaseNames”.
For instance, if “oil” is
before “gas” in
“phaseNames”, the table
order should be:
oilTableName,
gasTableName
hydrocarbonViscosi- groupNameRef_array {}
tyTableNames
List of viscosity
TableFunction names
from the Functions block.
The user must provide
one TableFunction per
hydrocarbon phase, in the
order provided in
“phaseNames”.
For instance, if “oil” is
before “gas” in
“phaseNames”, the table
order should be:
oilTableName,
gasTableName
nonWettingIntermedi- real64 0
ateSurfaceTension
Surface tension [N/m] for
the pair (non-wetting
phase, intermediate
phase)
If you have a value in
[dyne/cm], divide it by
1000 to obtain the value
in [N/m]
Note that this input is only
used for three-phase flow.
If you want to do a
two-phase simulation,
please use instead
wettingNonWettingSur-
faceTension to specify the
surface tensions.
permeabilityDirection geos_constitutive_JFunctionCapillaryPressure_PermeabilityDirection
required
Permeability direction.
Options are:
XY - use the average of
the permeabilities in the x
and y directions,
X - only use the
permeability in the x
direction,
Y - only use the
permeability in the y
direction,
Z - only use the
permeability in the z
direction.
1.9. Datastructure Index 761
permeabilityExponent real64 0.5 Permeability exponent
phaseNames groupNameRef_array required List of fluid phases
porosityExponent real64 0.5 Porosity exponent
GEOS Documentation
lineSearchAction geos_NonlinearSolverParameters_LineSearchAction
Attempt
How the line search is to
be used. Options are:
* None - Do not use
line search.
* Attempt - Use line
search. Allow exit from
line search without
achieving smaller residual
than starting residual.
* Require - Use line
search. If smaller residual
than starting resdual is not
achieved, cut time-step.
logLevel integer 0
logLevel integer 0
logLevel integer 0
816 Sets1.theTable
Chapter level of
of Contents
information to write in the
standard output (the
console typically).
GEOS Documentation
wettingNonWettingCap- groupNameRef
PressureTableName
Capillary pressure table
[Pa] for the pair (wetting
phase, non-wetting phase)
Note that this input is only
used for two-phase flow.
If you want to do a
three-phase simulation,
please use instead
wettingIntermediateCap-
PressureTableName and
nonWettingIntermediate-
CapPressureTableName
to specify the table names
wettingIntermedi- groupNameRef_array {}
ateRelPermTableNames
List of relative
permeability tables for the
pair (wetting phase,
intermediate phase)
The expected format is “{
wetting-
PhaseRelPermTable-
Name,
intermedi-
atePhaseRelPermTable-
Name }”, in that order
Note that this input is only
used for three-phase flow.
If you want to do a
two-phase simulation,
please use instead
wettingNonWettin-
gRelPermTableNames to
1.9. Datastructure Index specify the table names 849
wettingNonWettin- groupNameRef_array {}
gRelPermTableNames
GEOS Documentation
drainageWettingInterme- groupNameRef_array {}
diateRelPermTableNames
List of drainage relative
permeability tables for the
pair (wetting phase,
intermediate phase)
The expected format is “{
wetting-
PhaseRelPermTable-
Name,
intermedi-
atePhaseRelPermTable-
Name }”, in that order
Note that this input is only
used for three-phase flow.
If you want to do a
two-phase simulation,
please use instead
drainageWettingNonWet-
tingRelPermTableNames
to specify the table names
drainageWettingNonWet- groupNameRef_array {}
tingRelPermTableNames
List of drainage relative
permeability tables for the
pair (wetting phase,
non-wetting phase)
The expected format is “{
wetting-
1.9. Datastructure Index PhaseRelPermTable- 851
Name,
nonWetting-
PhaseRelPermTableName
GEOS Documentation
internalEnergyModelType geos_constitutive_ExponentApproximationType
linear
Type of internal energy
model. Valid options:
* exponential
* linear
* quadratic
enableCrossflow integer 1
Flag to enable crossflow.
Currently only supported
for injectors:
- If the flag is set to
1, both
reservoir-to-well
flow and
well-to-reservoir
flow are allowed at
the perforations.
- If the flag is set to
0, we only allow
well-to-reservoir
flow at the
perforations.
Datastructure: AcousticElasticSEM
Datastructure: AcousticFirstOrderSEM
Datastructure: AcousticSEM
Datastructure: AcousticVTISEM
Datastructure: Aquifer
Datastructure: Benchmarks
Datastructure: BiotPorosity
Datastructure: BlackOilFluid
Datastructure: Blueprint
Datastructure: Box
Datastructure: BrooksCoreyBakerRelativePermeability
Datastructure: BrooksCoreyCapillaryPressure
Datastructure: BrooksCoreyRelativePermeability
Datastructure: BrooksCoreyStone2RelativePermeability
Datastructure: CO2BrineEzrokhiFluid
Datastructure: CO2BrineEzrokhiThermalFluid
Datastructure: CO2BrinePhillipsFluid
Datastructure: CO2BrinePhillipsThermalFluid
Datastructure: CarmanKozenyPermeability
Datastructure: CellElementRegion
Datastructure: CellToCellDataCollection
Datastructure: CeramicDamage
Datastructure: ChomboIO
Datastructure: CompositeFunction
Datastructure: CompositionalMultiphaseFVM
Datastructure: CompositionalMultiphaseFluid
Datastructure: CompositionalMultiphaseHybridFVM
Datastructure: CompositionalMultiphaseReservoir
Datastructure: CompositionalMultiphaseReservoirPoromechanics
Datastructure: CompositionalMultiphaseReservoirPoromechanicsInitialization
Datastructure: CompositionalMultiphaseStatistics
Datastructure: CompositionalMultiphaseWell
Datastructure: CompositionalThreePhaseFluidLohrenzBrayClark
Datastructure: CompositionalTwoPhaseFluid
Datastructure: CompositionalTwoPhaseFluidLohrenzBrayClark
Datastructure: CompressibleSinglePhaseFluid
Datastructure: CompressibleSolidCarmanKozenyPermeability
Datastructure: CompressibleSolidConstantPermeability
Datastructure: CompressibleSolidExponentialDecayPermeability
Datastructure: CompressibleSolidParallelPlatesPermeability
Datastructure: CompressibleSolidPressurePermeability
Datastructure: CompressibleSolidSlipDependentPermeability
Datastructure: CompressibleSolidWillisRichardsPermeability
Datastructure: ConstantDiffusion
Datastructure: ConstantPermeability
Datastructure: Constitutive
Datastructure: ConstitutiveModels
Datastructure: Coulomb
Datastructure: CustomPolarObject
Datastructure: Cylinder
Datastructure: DamageElasticIsotropic
Datastructure: DamageSpectralElasticIsotropic
Datastructure: DamageVolDevElasticIsotropic
Datastructure: DeadOilFluid
Datastructure: DelftEgg
Datastructure: Dirichlet
Datastructure: Disc
Datastructure: DruckerPrager
Datastructure: ElasticFirstOrderSEM
Name Type
displacementxNp1AtReceivers real32_array2d
Name Type
displacementyNp1AtReceivers real32_array2d
displacementzNp1AtReceivers real32_array2d
indexSeismoTrace integer
linearDASVectorX real32_array
linearDASVectorY real32_array
linearDASVectorZ real32_array
maxStableDt real64
meshTargets geos_mapBase<std___1_pair<std___1_basic_string<char, std___1_char_traits<char>, std___1_alloc
receiverConstants real64_array2d
receiverElem integer_array
receiverIsLocal integer_array
receiverNodeIds integer_array2d
receiverRegion integer_array
sigmaxxNp1AtReceivers real32_array2d
sigmaxyNp1AtReceivers real32_array2d
sigmaxzNp1AtReceivers real32_array2d
sigmayyNp1AtReceivers real32_array2d
sigmayzNp1AtReceivers real32_array2d
sigmazzNp1AtReceivers real32_array2d
sourceConstants real64_array2d
sourceElem integer_array
sourceIsAccessible integer_array
sourceNodeIds integer_array2d
sourceRegion integer_array
timeStep real64
usePML integer
LinearSolverParameters node
NonlinearSolverParameters node
SolverStatistics node
Datastructure: ElasticIsotropic
Datastructure: ElasticIsotropicPressureDependent
Datastructure: ElasticOrthotropic
Datastructure: ElasticSEM
Datastructure: ElasticTransverseIsotropic
Datastructure: ElementRegions
Datastructure: EmbeddedSurfaceGenerator
Datastructure: Events
Datastructure: ExponentialDecayPermeability
Datastructure: ExtendedDruckerPrager
Datastructure: ExternalDataSource
Datastructure: FieldSpecification
Datastructure: FieldSpecifications
Datastructure: File
Datastructure: FiniteElementSpace
Datastructure: FiniteElements
Datastructure: FiniteVolume
Datastructure: FlowProppantTransport
Datastructure: FrictionlessContact
Datastructure: Functions
Datastructure: Geometry
Datastructure: HaltEvent
Datastructure: HybridMimeticDiscretization
Datastructure: HydraulicApertureTable
Datastructure: Hydrofracture
Datastructure: HydrofractureInitialization
Datastructure: HydrostaticEquilibrium
Datastructure: Included
Datastructure: InternalMesh
Datastructure: InternalWell
Datastructure: InternalWellbore
Datastructure: JFunctionCapillaryPressure
Datastructure: LaplaceFEM
Datastructure: Level0
Datastructure: LinearIsotropicDispersion
Datastructure: LinearSolverParameters
Datastructure: Mesh
Datastructure: MeshBodies
Datastructure: ModifiedCamClay
Datastructure: MultiPhaseConstantThermalConductivity
Datastructure: MultiPhaseVolumeWeightedThermalConductivity
Datastructure: MultiphasePoromechanics
Datastructure: MultiphasePoromechanicsInitialization
Datastructure: MultiphasePoromechanicsReservoir
Datastructure: MultivariableTableFunction
Datastructure: NonlinearSolverParameters
Datastructure: NullModel
Datastructure: NumericalMethods
Datastructure: Outputs
Datastructure: PML
Datastructure: PVTDriver
Datastructure: PackCollection
Datastructure: ParallelPlatesPermeability
Datastructure: Parameter
Datastructure: Parameters
Datastructure: ParticleFluid
Datastructure: ParticleMesh
Datastructure: ParticleRegion
Datastructure: ParticleRegions
Datastructure: PerfectlyPlastic
Datastructure: Perforation
Datastructure: PeriodicEvent
Datastructure: PhaseFieldDamageFEM
Datastructure: PhaseFieldFracture
Datastructure: PorousDamageElasticIsotropic
Datastructure: PorousDamageSpectralElasticIsotropic
Datastructure: PorousDamageVolDevElasticIsotropic
Datastructure: PorousDelftEgg
Datastructure: PorousDruckerPrager
Datastructure: PorousElasticIsotropic
Datastructure: PorousElasticOrthotropic
Datastructure: PorousElasticTransverseIsotropic
Datastructure: PorousExtendedDruckerPrager
Datastructure: PorousModifiedCamClay
Datastructure: PorousViscoDruckerPrager
Datastructure: PorousViscoExtendedDruckerPrager
Datastructure: PorousViscoModifiedCamClay
Datastructure: PressurePermeability
Datastructure: PressurePorosity
Datastructure: Problem
Datastructure: ProppantPermeability
Datastructure: ProppantPorosity
Datastructure: ProppantSlurryFluid
Datastructure: ProppantSolidProppantPermeability
Datastructure: ProppantTransport
Datastructure: Python
Datastructure: QuasiDynamicEQ
Datastructure: QuasiDynamicEQRK32
Datastructure: RateAndStateFriction
Datastructure: ReactiveBrine
Datastructure: ReactiveBrineThermal
Datastructure: ReactiveCompositionalMultiphaseOBL
Datastructure: ReactiveFluidDriver
Datastructure: Rectangle
Datastructure: Region
Datastructure: RelpermDriver
Datastructure: Restart
Datastructure: Run
Datastructure: SeismicityRate
Datastructure: Silo
Datastructure: SinglePhaseFVM
Datastructure: SinglePhaseHybridFVM
Datastructure: SinglePhasePoromechanics
Datastructure: SinglePhasePoromechanicsConformingFractures
Datastructure: SinglePhasePoromechanicsConformingFracturesInitialization
Datastructure: SinglePhasePoromechanicsConformingFracturesReservoir
Datastructure: SinglePhasePoromechanicsEmbeddedFractures
Datastructure: SinglePhasePoromechanicsEmbeddedFracturesInitialization
Datastructure: SinglePhasePoromechanicsInitialization
Datastructure: SinglePhasePoromechanicsReservoir
Datastructure: SinglePhaseProppantFVM
Datastructure: SinglePhaseReservoir
Datastructure: SinglePhaseReservoirPoromechanics
Datastructure: SinglePhaseReservoirPoromechanicsConformingFractures
Datastructure: SinglePhaseReservoirPoromechanicsConformingFracturesInitialization
Datastructure: SinglePhaseReservoirPoromechanicsInitialization
Datastructure: SinglePhaseStatistics
Datastructure: SinglePhaseThermalConductivity
Datastructure: SinglePhaseWell
Datastructure: SlipDependentPermeability
Datastructure: SolidInternalEnergy
Datastructure: SolidMechanicsAugmentedLagrangianContact
Datastructure: SolidMechanicsEmbeddedFractures
Datastructure: SolidMechanicsLagrangeContact
Datastructure: SolidMechanicsLagrangeContactBubbleStab
Datastructure: SolidMechanicsLagrangianSSLE
Datastructure: SolidMechanicsStateReset
Datastructure: SolidMechanicsStatistics
Datastructure: SolidMechanics_LagrangianFEM
Datastructure: SolidMechanics_MPM
Datastructure: SoloEvent
Datastructure: SolverStatistics
Datastructure: Solvers
Datastructure: SourceFlux
Datastructure: SourceFluxStatistics
Datastructure: SurfaceElementRegion
Datastructure: SurfaceGenerator
Datastructure: SymbolicFunction
Datastructure: TableCapillaryPressure
Datastructure: TableFunction
Datastructure: TableRelativePermeability
Datastructure: TableRelativePermeabilityHysteresis
Datastructure: Tasks
Datastructure: ThermalCompressibleSinglePhaseFluid
Datastructure: ThickPlane
Datastructure: TimeHistory
Datastructure: Traction
Datastructure: TriaxialDriver
Datastructure: TwoPointFluxApproximation
Datastructure: VTK
Datastructure: VTKHierarchicalDataSource
Datastructure: VTKMesh
Datastructure: VTKWell
Datastructure: VanGenuchtenBakerRelativePermeability
Datastructure: VanGenuchtenCapillaryPressure
Datastructure: VanGenuchtenStone2RelativePermeability
Datastructure: ViscoDruckerPrager
Datastructure: ViscoExtendedDruckerPrager
Datastructure: ViscoModifiedCamClay
Datastructure: WellControls
Datastructure: WellElementRegion
Datastructure: WellElementRegionUniqueSubRegion
Datastructure: WillisRichardsPermeability
Datastructure: commandLine
Datastructure: crusher
Datastructure: domain
Datastructure: edgeManager
Datastructure: elementRegionsGroup
Datastructure: elementSubRegions
Datastructure: embeddedSurfacesEdgeManager
Datastructure: embeddedSurfacesNodeManager
Datastructure: faceManager
Datastructure: lassen
Datastructure: meshLevels
Datastructure: neighborData
Datastructure: nodeManager
Datastructure: particleRegionsGroup
Datastructure: particleSubRegions
Datastructure: quartz
Datastructure: sets
Datastructure: wellElementSubRegion
1.10 Contributors
An up-to-date list of all GEOS contributors can be found on our Github page:
GEOS Contributors
The following is the list of GEOS contributors as of January 2019:
1.11 Publications
Last updated 16-December-2024
A benchmark study on reactive two-phase flow in porous media: Part II - results and discussion
E Ahusborde, B Amaziane, S de Hoop, M El Ossmani, E Flauraud, FP Hamon, M Kern, A Socié, D Su, KU
Mayer, M Tóth, D Voskov
Computational Geosciences
doi.org/10.1007/s10596-024-10269-y
Pressure stability in explicitly coupled simulations of poromechanics with application to CO2 sequestration
RM Aronson, P Tomin, N Castelletto, FP Hamon, JA White, HA Tchelepi
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2024.117633
Managing reservoir dynamics when converting natural gas fields to underground hydrogen storage
JT Camargo, JA White, FP Hamon, V Fakeye, TA Buscheck, N Huerta
International Journal of Hydrogen Energy
doi.org/10.1016/j.ijhydene.2023.09.165
Surrogate model for geological CO2 storage and its use in hierarchical MCMC history matching
Y Han, FP Hamon, S Jiang, LJ Durlofsky
Advances in Water Resources
doi:10.1016/j.advwatres.2024.104678
Simulation of Multiphase Flow and Poromechanical Effects Around Injection Wells in CO2 Storage Sites
J Huang, F Hamon, M Cusini, T Gazzola, RR Settgast, JA White, H Gross
Rock Mechanics and Rock Engineering
doi:10.1007/s00603-024-04051-w
1.11.3 2023
A phase-field model for hydraulic fracture nucleation and propagation in porous media
F Fei, A Costa, JE Dolbow, R Settgast, M Cusini
International Journal for Numerical and Analytical Methods in Geomechanics
doi.org/10.1002/nag.3612
Validation and Application of a Three-Dimensional Model for Simulating Proppant Transport and
Fracture Conductivity
J Huang, Y Hao, RR Settgast, JA White, K Mateen, H Gross
Rock Mechanics and Rock Engineering
doi:10.1007/s00603-022-03092-3
1.11.4 2022
Smooth implicit hybrid upwinding for compositional multiphase flow in porous media
SBM Bosma, FP Hamon, BT Mallison, HA Tchelepi
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2021.114288
A scalable preconditioning framework for stabilized contact mechanics with hydraulically active fractures
A Franceschini, L Gazzola, M Ferronato
Journal of Computational Physics
doi:10.1016/j.jcp.2022.111276
An aggregation-based nonlinear multigrid solver for two-phase flow and transport in porous media
CS Lee, FP Hamon, N Castelletto, PS Vassilevski, JA White
Computers & Mathematics with Applications
doi:10.1016/j.camwa.2022.03.026
Deep learning-accelerated 3D carbon storage reservoir pressure forecasting based on data assimilation
using surface displacement from InSAR
H Tang, P Fu, H Jo, S Jiang, CS Sherman, F Hamon, NA Azzolina, JP Morris
982 Chapter 1. Table of Contents
International Journal of Greenhouse Gas Control
doi:10.1016/j.ijggc.2022.103765
GEOS Documentation
1.11.5 2021
Hybrid mimetic finite-difference and virtual element formulation for coupled poromechanics
A Borio, FP Hamon, N Castelletto, JA White, RR Settgast
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2021.113917
Multigrid reduction preconditioning framework for coupled processes in porous and fractured media
QM Bui, FP Hamon, N Castelletto, D Osei-Kuffuor, RR Settgast, JA White
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2021.114111
Simulation of coupled multiphase flow and geomechanics in porous media with embedded discrete fractures
M Cusini, JA White, N Castelletto, RR Settgast
International Journal for Numerical and Analytical Methods in Geomechanics
doi:10.1002/nag.3168
1.11.6 2020
Algebraically stabilized Lagrange multiplier method for frictional contact mechanics with hydraulically
active fractures
A Franceschini, N Castelletto, JA White, HA Tchelepi
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2020.113161
Fully implicit multidimensional hybrid upwind scheme for coupled flow and transport
F Hamon, B Mallison
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2019.112606
Nonlinear multigrid based on local spectral coarsening for heterogeneous diffusion problems
CS Lee, F Hamon, N Castelletto, PS Vassilevski, JA White
Computer Methods in Applied Mechanics and Engineering
doi:10.1016/j.cma.2020.113432
1.11.7 2019
A relaxed physical factorization preconditioner for mixed finite element coupled poromechanics
M Frigo, N Castelletto, M Ferronato
SIAM Journal on Scientific Computing
doi:10.1137/18M120645X
1.12 Acknowledgements
GEOS was developed with supporting funds from a number of organizations, including
• Lawrence Livermore National Laboratory
• U.S. Department of Energy, Office of Science
• TotalEnergies.
This support is gratefully acknowledged.
TWO
• genindex
• modindex
• search
987
GEOS Documentation
B
built-in function
pygeosx.apply_initial_conditions(), 556
pygeosx.finalize(), 556
pygeosx.initialize(), 555
pygeosx.reinit(), 555
pygeosx.run(), 556
G
get_group() (pygeosx.Group method), 556
get_wrapper() (pygeosx.Group method), 556
groups() (pygeosx.Group method), 556
P
pygeosx.apply_initial_conditions()
built-in function, 556
pygeosx.COMPLETED (built-in variable), 556
pygeosx.finalize()
built-in function, 556
pygeosx.Group (built-in class), 556
pygeosx.initialize()
built-in function, 555
pygeosx.INITIALIZED (built-in variable), 556
pygeosx.READY_TO_RUN (built-in variable), 556
pygeosx.reinit()
built-in function, 555
pygeosx.run()
built-in function, 556
pygeosx.UNINITIALIZED (built-in variable), 556
pygeosx.Wrapper (built-in class), 557
R
register() (pygeosx.Group method), 556
V
value() (pygeosx.Wrapper method), 557
W
wrappers() (pygeosx.Group method), 556
989