User Manual
403 Poyntz Avenue, Suite B
Manhattan, KS 66502
USA
+1.785.770.8511
www.thunderheadeng.com
User Manual
PetraSim 5
PetraSim User Manual
Table of Contents
Disclaimer........................................................................................................................................ xii
Acknowledgements......................................................................................................................... xiii
1. Getting Started ............................................................................................................................1
Welcome ................................................................................................................................................... 1
Installation ................................................................................................................................................ 1
Purchase PetraSim .................................................................................................................................... 1
Software Registration ............................................................................................................................... 1
Additional TOUGH Documentation........................................................................................................... 2
System Requirements ............................................................................................................................... 2
Contact Us ................................................................................................................................................. 2
2. Background .................................................................................................................................3
Flow in Porous Media ............................................................................................................................... 3
Darcy’s Law for Single Phase Flow ........................................................................................................ 3
Multi-Phase Flow .................................................................................................................................. 3
TOUGH Concepts ...................................................................................................................................... 5
Components and Phases ....................................................................................................................... 5
Mass and Energy Balance ..................................................................................................................... 7
Spatial Discretization............................................................................................................................. 8
Temporal Discretization ........................................................................................................................ 9
Equations of State ..................................................................................................................................... 9
Selecting an EOS.................................................................................................................................... 9
Global Properties ................................................................................................................................ 11
Details for Each EOS ............................................................................................................................ 11
3. PetraSim at a Glance .................................................................................................................. 12
Main Window.......................................................................................................................................... 12
3D Results View....................................................................................................................................... 13
Time History Results ............................................................................................................................... 14
Example Problems .................................................................................................................................. 14
PetraSim Tour (Five Spot) ....................................................................................................................... 15
Load the EOS1 five_spot sample model.............................................................................................. 15
Enable flux output ............................................................................................................................... 15
Run the simulation .............................................................................................................................. 16
View 3D simulation results ................................................................................................................. 17
View cell time history data.................................................................................................................. 18
4. PetraSim Basics .......................................................................................................................... 20
Work Flow in a Typical Analysis .............................................................................................................. 20
Terminology ............................................................................................................................................ 20
PetraSim Interface .................................................................................................................................. 21
3D View ................................................................................................................................................... 21
Navigation ........................................................................................................................................... 21
View Mode .......................................................................................................................................... 21
Colors .................................................................................................................................................. 22
Selection.............................................................................................................................................. 23
Show/Hide/Filter Objects.................................................................................................................... 24
Tree View ................................................................................................................................................ 25
iv
Units ........................................................................................................................................................ 25
Displaying a Surface Image on the Model .............................................................................................. 25
Floating Background Image................................................................................................................. 25
Draped Image ...................................................................................................................................... 26
User-Defined Labels ................................................................................................................................ 26
5. Working with Files ..................................................................................................................... 28
PetraSim Model File (SIM) ...................................................................................................................... 28
TOUGH Input File (DAT) .......................................................................................................................... 28
Creating and Saving a New PetraSim Model .......................................................................................... 28
Open a Saved PetraSim Model ............................................................................................................... 28
Contour Files ........................................................................................................................................... 28
XYZ Files .................................................................................................................................................. 29
DXF Files .................................................................................................................................................. 30
6. Conceptual Model ...................................................................................................................... 31
Problem Boundary .................................................................................................................................. 31
Defining boundary with a new model................................................................................................. 31
Defining boundary with the boundary editor ..................................................................................... 32
Layers ...................................................................................................................................................... 34
Defining the default layer with a new model ..................................................................................... 37
Defining layers with the layer manager .............................................................................................. 37
Regions .................................................................................................................................................... 39
Internal Boundaries................................................................................................................................. 40
Faults ....................................................................................................................................................... 42
Cleaning Up the Model ........................................................................................................................... 43
7. Solution Mesh............................................................................................................................ 45
Defining a Solution Mesh ........................................................................................................................ 46
Setting Z Divisions ............................................................................................................................... 46
Creating the solution mesh ................................................................................................................. 47
Editing Cells ............................................................................................................................................. 50
Enabled, Disabled, and Fixed State Cells ............................................................................................ 52
Extra Cells ................................................................................................................................................ 52
8. Materials ................................................................................................................................... 55
Relative Permeability .............................................................................................................................. 56
Capillary Pressure.................................................................................................................................... 57
Miscellaneous Material Data .................................................................................................................. 58
Assigning Different Materials by Cell ...................................................................................................... 59
9. Boundary and Initial Conditions ................................................................................................. 61
Initial Conditions ..................................................................................................................................... 61
Default Initial Conditions .................................................................................................................... 61
Layer and Regional Initial Conditions.................................................................................................. 62
Cell Initial Conditions .......................................................................................................................... 62
Loading Previous Results as Initial Conditions .................................................................................... 63
Boundary Conditions............................................................................................................................... 63
Fixed Boundary Conditions ................................................................................................................. 63
Sources and Sinks ................................................................................................................................ 64
Using Wells in PetraSim ...................................................................................................................... 65
Time-Dependent Essential (Direchlet) Boundary Conditions ............................................................. 67
10. Solution and Output Controls ..................................................................................................... 74
v
Solution Controls..................................................................................................................................... 74
Times Tab ............................................................................................................................................ 74
Solver Tab............................................................................................................................................ 75
TOUGH2-MP Tab (TOUGH2-MP license only) ..................................................................................... 76
Weighting Tab ..................................................................................................................................... 77
Convergence Tab................................................................................................................................. 78
Options Tab ......................................................................................................................................... 79
Output Controls ...................................................................................................................................... 80
11. Running Simulation .................................................................................................................... 82
Running a Simulation .............................................................................................................................. 82
Setting TOUGH2 Analysis Priority ........................................................................................................... 82
Monitoring Progress of TOUGH Analysis ................................................................................................ 83
Writing the Input File .............................................................................................................................. 83
Running TOUGH2-MP ............................................................................................................................. 83
12. Plotting Results .......................................................................................................................... 85
3D Plots of Results .................................................................................................................................. 85
Line Plots of Results ................................................................................................................................ 89
Time History Plots of Results .................................................................................................................. 90
Source/Sink and Cell History Plots .......................................................................................................... 91
Well Plots ................................................................................................................................................ 95
General Use of the Comma-Separated Value (CSV) Files ....................................................................... 95
13. Flow in Fractured Media ............................................................................................................ 97
The MINC Approach ................................................................................................................................ 97
Using MINC in PetraSim .......................................................................................................................... 97
14. Miscellaneous ............................................................................................................................ 99
Finding TOUGH2 Options in PetraSim .................................................................................................... 99
TITLE .................................................................................................................................................... 99
MESHM ............................................................................................................................................... 99
ROCKS.................................................................................................................................................. 99
MULTI ................................................................................................................................................ 100
START Record .................................................................................................................................... 100
CHEMP (T2VOC only) ........................................................................................................................ 100
PARAM .............................................................................................................................................. 100
INDOM .............................................................................................................................................. 102
INCON................................................................................................................................................ 102
SOLVR ................................................................................................................................................ 102
FOFT .................................................................................................................................................. 102
GOFT.................................................................................................................................................. 102
NOVER ............................................................................................................................................... 102
DIFFU ................................................................................................................................................. 102
SELEC ................................................................................................................................................. 102
RPCAP ................................................................................................................................................ 103
TIMES ................................................................................................................................................ 103
ELEME................................................................................................................................................ 103
CONNE............................................................................................................................................... 103
GENER ............................................................................................................................................... 103
15. Troubleshooting ...................................................................................................................... 104
Convergence Problems ......................................................................................................................... 104
vi
Licensing/Registration Problems .......................................................................................................... 106
Contacting Technical Support ............................................................................................................... 107
References..................................................................................................................................... 108
Index ............................................................................................................................................. 110
vii
Figures
Figure 1.1: Licensing and Activation dialog................................................................................................... 2
Figure 2.1: Illustration of pendular (a) and funicular (b) saturation regime in the case of an idealized
porous medium consisting of packed spheres (7) ........................................................................................ 4
Figure 2.2: Capillary Pressure........................................................................................................................ 5
Figure 2.3: Capillary pressure using van Genuchten function ...................................................................... 5
Figure 2.4: Single phase liquid initial conditions for EOS3 ............................................................................ 6
Figure 2.5: Single phase gas initial conditions for EOS3 ............................................................................... 6
Figure 2.6: Two phase initial conditions for EOS3 ........................................................................................ 7
Figure 2.7: States corresponding to the three initial condition options....................................................... 7
Figure 2.8: States corresponding to the three initial condition options....................................................... 7
Figure 2.9: Space discretization and geometry data in the integral finite difference method (from
TOUGH2 User's Guide) .................................................................................................................................. 8
Figure 2.10: States corresponding to the three initial condition options..................................................... 9
Figure 2.11: New Model dialog ................................................................................................................... 10
Figure 2.12: Global Properties dialog.......................................................................................................... 10
Figure 3.1: Main Window............................................................................................................................ 12
Figure 3.2: 3D Results View......................................................................................................................... 13
Figure 3.3: Time History Results ................................................................................................................. 14
Figure 3.4: Opening the five spot model .................................................................................................... 15
Figure 3.5: Select fluxes and velocities output ........................................................................................... 16
Figure 3.6: Time step graph during simulation ........................................................................................... 17
Figure 3.7: Temperature contours and flow vectors .................................................................................. 18
Figure 3.8: Cell time history ........................................................................................................................ 19
Figure 4.1: Boundary Mode ........................................................................................................................ 22
Figure 4.2: Layer Mode ............................................................................................................................... 22
Figure 4.3: Mesh Mode ............................................................................................................................... 22
Figure 4.4: Example background image ...................................................................................................... 26
Figure 4.5: Example draped image ............................................................................................................. 26
Figure 6.1: Examples of different model boundaries ................................................................................. 31
Figure 6.2: Entering a boundary in the New Model dialog ......................................................................... 32
Figure 6.3: Boundary editor ........................................................................................................................ 32
Figure 6.4: Quick Set Boundary dialog ........................................................................................................ 33
Figure 6.5: Auto Size Boundary dialog ........................................................................................................ 34
Figure 6.6: Auto Size Boundary combinations ............................................................................................ 34
Figure 6.7: Example of layers ...................................................................................................................... 35
Figure 6.8: Example of extending an input file boundary ........................................................................... 36
Figure 6.9: Example of invalid layer divisions ............................................................................................. 36
Figure 6.10: Fixed layer divisions ................................................................................................................ 37
viii
Figure 6.11: Layer manager dialog .............................................................................................................. 38
Figure 6.12: New Layer dialog..................................................................................................................... 38
Figure 6.13: Example of layers split into multiple regions .......................................................................... 39
Figure 6.14: Region properties dialog ......................................................................................................... 40
Figure 6.15: Defining an internal boundary ................................................................................................ 40
Figure 6.16: The internal boundary shown in the model ........................................................................... 41
Figure 6.17: Example of floating internal boundary ................................................................................... 42
Figure 6.18: A cylindrical region defined using a DXF file ........................................................................... 42
Figure 6.19: Selecting fault regions............................................................................................................. 43
Figure 6.20: Cleaning a conceptual model .................................................................................................. 44
Figure 7.1: Types of solution meshes.......................................................................................................... 45
Figure 7.2: Example of a mesh conforming to the model layers ................................................................ 46
Figure 7.3: Creating custom layer Dz .......................................................................................................... 47
Figure 7.4: The Create Mesh dialog showing regular parameters.............................................................. 47
Figure 7.5: Calculating cell size when the factor is not 1.0 ......................................................................... 48
Figure 7.6: Example of custom divisions for a regular mesh ...................................................................... 48
Figure 7.7: Parameters for a polygonal mesh ............................................................................................. 49
Figure 7.8: Radial mesh representation in PetraSim .................................................................................. 50
Figure 7.9: Parameters for a radial mesh.................................................................................................... 50
Figure 7.10: Editing a cell in the 3D View.................................................................................................... 51
Figure 7.11: Editing cell properties ............................................................................................................. 52
Figure 7.12: Defining the basic extra cell properties .................................................................................. 53
Figure 7.13: Defining the extra cell connections to the model................................................................... 54
Figure 8.1: Material properties ................................................................................................................... 56
Figure 8.2: Relative permeability functions ................................................................................................ 57
Figure 8.3: Capillary pressure functions...................................................................................................... 58
Figure 8.4: Miscellaneous material data ..................................................................................................... 59
Figure 8.5: Assign Cell Materials dialog ...................................................................................................... 60
Figure 9.1: Setting default initial conditions ............................................................................................... 61
Figure 9.2: Setting region initial conditions ................................................................................................ 62
Figure 9.3: Setting cell initial conditions ..................................................................................................... 63
Figure 9.4: Defining a cell as a source/sink ................................................................................................. 65
Figure 9.5: Add Well dialog ......................................................................................................................... 66
Figure 9.6: Edit Well dialog ......................................................................................................................... 66
Figure 9.7: Well completion interval in 3D View ........................................................................................ 67
Figure 9.8: Desired boundary conditions .................................................................................................... 70
Figure 9.9: Graph of desired boundary conditions ..................................................................................... 71
Figure 9.10: Desired boundary conditions .................................................................................................. 71
Figure 9.11: Calculated heat flux ................................................................................................................ 72
Figure 9.12: Calculated flow rates .............................................................................................................. 72
Figure 9.13: Comparison of desired and calculated boundary condition temperatures ........................... 73
Figure 9.14: Comparison of desired and calculated boundary condition pressures in TOUGH2 ............... 73
ix
Figure 10.1: The Times tab controls............................................................................................................ 74
Figure 10.2: The Solver tab controls ........................................................................................................... 76
Figure 10.3: The TOUGH2-MP tab controls ................................................................................................ 77
Figure 10.4: The Weighting tab controls..................................................................................................... 78
Figure 10.5: The Convergence tab .............................................................................................................. 79
Figure 10.6: The Options tab controls ........................................................................................................ 80
Figure 10.7: Output controls dialog ............................................................................................................ 81
Figure 11.1: Running the TOUGH analysis .................................................................................................. 82
Figure 12.1: The 3D results window ........................................................................................................... 85
Figure 12.2: Scalar Properties dialog .......................................................................................................... 86
Figure 12.3: 3D Vector results..................................................................................................................... 87
Figure 12.4: Vector Properties dialog ......................................................................................................... 87
Figure 12.5: Slice Planes dialog ................................................................................................................... 88
Figure 12.6: Example of contours on slice planes....................................................................................... 88
Figure 12.7: Slice contours colored by cell ................................................................................................. 89
Figure 12.8: Example line plot..................................................................................................................... 90
Figure 12.9: Example time history plot ....................................................................................................... 90
Figure 12.10: Plot of production flow ......................................................................................................... 91
Figure 12.11: Plot of production from cell 169 ........................................................................................... 92
Figure 12.12: Connections for cell 169 ....................................................................................................... 92
Figure 12.13: Plot of FLOF(X) for cell 170 ................................................................................................... 93
Figure 12.14: FLOF(X) plot for cell 169........................................................................................................ 94
Figure 12.15: Flows into cell 169 ................................................................................................................ 95
Figure 13.1: Activating MINC in PetraSim ................................................................................................... 98
x
List of Tables
Table 12.1: Data for connections to cell 169 .............................................................................................. 94
xi
Disclaimer
Thunderhead Engineering makes no warranty, expressed or implied, to users of PetraSim, and accepts
no responsibility for its use. Users of PetraSim assume sole responsibility under Federal law for
determining the appropriateness of its use in any particular application; for any conclusions drawn from
the results of its use; and for any actions taken or not taken as a result of analyses performed using
these tools.
Users are warned that PetraSim is intended for use only by those competent in the field of multi-phase,
multi-component fluid flow in porous and fractured media. PetraSim is intended only to supplement the
informed judgment of the qualified user. The software package is a computer model that may or may
not have predictive capability when applied to a specific set of factual circumstances. Lack of accurate
predictions by the model could lead to erroneous conclusions. All results should be evaluated by an
informed user.
Throughout this document, the mention of computer hardware or commercial software does not
constitute endorsement by Thunderhead Engineering, nor does it indicate that the products are
necessarily those best suited for the intended purpose.
xii
Acknowledgements
We thank Karsten Pruess, Tianfu Xu, George Moridis, Michael Kowalsky, Curt Oldenburg, and Stefan
Finsterle in the Earth Sciences Division of Lawrence Berkeley National Laboratory for their gracious
responses to our many questions. We also thank Ron Falta at Clemson University and Alfredo Battistelli
at Aquater S.p.A., Italy, for their help with T2VOC and TMVOC. Without TOUGH2, T2VOC, TOUGHREACT,
and TOUGH-Fx/HYDRATE, PetraSim would not exist.
In preparing this manual, we have liberally used descriptions from the user manuals for the TOUGH
family of codes. Links to download the TOUGH manuals are given at http://www.petrasim.com. More
information about the TOUGH family of codes can be found at: http://www-esd.lbl.gov/TOUGH2/.
Printed copies of the user manuals may be obtained from Karsten Pruess at <[email protected]>.
The original development of PetraSim was funded by a Small Business Innovative Research grant from
the U.S. Department of Energy. Additional funding was provided by a private consortium for the
TOUGHREACT version and by the U.S. Department of Energy NETL for the TOUGH-Fx/HYDRATE version.
We most sincerely thank our users for their feedback and support.
xiii
Getting Started
1. Getting Started
Welcome
PetraSim is an interactive pre-processor and post-processor for the TOUGH family of codes. It helps
users rapidly develop models and view results for these general purpose simulators which model
nonisothermal flows of multicomponent, multiphase fluids in porous and fractured media. The T2VOC
and TMVOC simulators include three-phase flows of water, air, and volatile organic chemicals. TOUGH2MP is a multi-processor/multi-core version of TOUGH2. The TOUGHREACT simulator adds chemical
reactions. The TOUGH-Fx/HYDRATE simulator includes the capability to represent methane hydrates.
Installation
A PetraSim installer can be obtained at http://www.rockware.com/ by searching for "PetraSim" or at
http://www.petrasim.com.
You must install PetraSim with administrator privileges. If your current account is not an administrator
account, use the Run as Administrator option on the right-click menu.
Purchase PetraSim
All PetraSim sales are handled by RockWare at http://www.rockware.com/. Our representative is Alison
at [email protected]
Software Registration
When you purchase a license, you will receive a key that activates the software. You must enter this key
in the Licensing and Activation dialog. To activate your license using Online Activation:
1. Start PetraSim. If the installation of PetraSim is not currently licensed, the Licensing and
Activation dialog will automatically appear and you can skip to step 3.
2. On the Help menu, click License…
3. Select the Online Activation option.
4. Enter your Registration Key into the Key box shown in Figure 1.1.
5. Click the Activate button.
1
Getting Started
Figure 1.1: Licensing and Activation dialog
Additional TOUGH Documentation
In preparing this manual, we have liberally used descriptions from the user manuals for the TOUGH
family of codes. Links to download the TOUGH manuals are given at http://www.petrasim.com. More
information about the TOUGH family of codes can be found at: http://www-esd.lbl.gov/TOUGH2/.
Printed copies of the user manuals may be obtained from Karsten Pruess at [email protected]
System Requirements
PetraSim will run well on any newer computer. At a minimum, the processor should be at least as fast
as a 1 GHz Pentium III, with at least 512 MB RAM. A graphics card that supports OpenGL 1.1 or later with
64 MB of graphics memory is recommended.
Contact Us
Thunderhead Engineering
403 Poyntz Avenue, Suite B
Manhattan, KS 66502-6081
USA
Product Support: [email protected]
Phone: +1.785.770.8511
Fax: +1.785.532.9102
2
Background
2. Background
Flow in Porous Media
This section will provide only the briefest overview of the basic assumptions used in the TOUGH family
of codes. The reader is referred to the TOUGH2 User's Guide (1), the T2VOC User's Guide (2), the
TMVOC User's Guide (3), the TOUGHREACT User's Guide (4), and the TOUGH-Fx/HYDRATE User's Guide
(5) for detailed information on the TOUGH codes.
A good fundamental reference on flow in porous media is The Physics of Flow Through Porous Media (6).
Darcy’s Law for Single Phase Flow
The TOUGH family of codes (and thus PetraSim) simulates flow in porous media. A basic assumption is
that the flow is described by Darcy's law,
(
where is the seepage velocity vector,
density, and is the gravity vector.
)
is the total permeability,
the viscosity,
the pressure,
the
Multi-Phase Flow
As described by Scheidegger (6), when two (or more) immiscible fluids or phases exist simultaneously in
a porous medium one phase will generally wet the solid. There are in general three saturation regimes:



Saturation regime: The porous medium is completely saturated with one phase.
Pendular regime: The porous medium has the lowest possible saturation with one phase. This
phase occurs in the form of pendular bodies throughout the porous medium. These pendular
bodies do not touch each other so that there is no possibility of flow for that phase; see Figure
2.1 (a).
Fenicular regime: The porous medium exhibits an intermediate saturation with both phases. If
the pendular bodies of the pendular regime expand through addition of the corresponding fluid,
they eventually become so large that they touch each other and merge. The result is a
continuous network of both phases across the porous medium. It is thus possible that
simultaneous flow of both phases occurs along tortuous paths; see Figure 2.1 (b).
3
Background
Figure 2.1: Illustration of pendular (a) and funicular (b) saturation regime in the case of an idealized
porous medium consisting of packed spheres (7)
For multi-phase flow, Darcy's law is modified to introduce the concept of relative permeability:
(
where
indicates the phase,
)
is the relative permeability (between 0 and 1) for the phase, and
is the fluid pressure in the phase, which is the sum of the pressure in a reference phase (usually the gas
phase) and the capillary pressure
(capillary pressure is negative).
Relative Permeability
The TOUGH codes provide several options for relative permeability. A typical option is the use of
Corey's curves (8) as illustrated in Figure 2.2. At low liquid saturation, the gas relative permeability is 1.0
and the liquid permeability is very low. Conversely, at high liquid saturation the gas relative
permeability is very low and the liquid permeability is 1.0. This is consistent with the flow regimes as
described above.
4
Background
Figure 2.2: Capillary Pressure
Capillary Pressure
The TOUGH codes also provide several options for capillary pressure. A typical option is the van
Genuchten function (9) as illustrated in Figure 2.3. At low liquid saturation, the capillary pressure is
large, but rapidly becomes smaller as liquid saturation increases.
Figure 2.3: Capillary pressure using van Genuchten function
TOUGH Concepts
Components and Phases
A clear understanding of the terms component and phase is necessary when using the TOUGH codes.
Consider a system consisting of water and air (implemented as EOS3 in TOUGH2). This system consists
of two components (water and air) and will have two phases (liquid and gas). Note that TOUGH2 does
5
Background
not include a solid phase, which would consist of ice; TOUGH-Fx/HYDRATE does include ice as a solid
phase.
Importantly, the two components (water and air) can be present in both phases. The liquid phase can
consist of liquid water and dissolved air. Similarly, the gaseous phase can be comprised of gaseous air
and water vapor.
For single phase conditions, the thermodynamic state is defined by pressure, temperature, and air mass
fraction. If the single phase is liquid, then the air mass fraction will be the air dissolved in the water,
which is a small value. An example of a valid initial condition specification for single phase liquid is
shown in Figure 2.4, with pressure of 1.0E5 Pa, temperature of 20 C, and a small air mass fraction of
1.0E-5. This small amount of air will be dissolved in the water.
If the single phase is gas, the gas can consist of both water vapor and air. The air mass fraction can be as
large as 1. A valid initial condition specification for single phase gas is given in Figure 2.5 with pressure
of 1.0E5 Pa, temperature of 20 C, and air mass fraction of 0.999. This means that a small amount of the
gas will consist of water vapor.
For two phase conditions, the thermodynamic state is defined by gas phase pressure, gas saturation,
and temperature. An example of a two phase initial condition is given in Figure 2.6, with pressure of
1.0E5 Pa, temperature of 20 C, and gas saturation of 0.5.
Figure 2.4: Single phase liquid initial conditions for EOS3
Figure 2.5: Single phase gas initial conditions for EOS3
6
Background
Figure 2.6: Two phase initial conditions for EOS3
As an example, a single element with a volume of 1 cubic meter and 0.1 porosity was run using the initial
conditions given above. The resulting solution and mass fractions for each component are given below,
in Figure 2.7 and Figure 2.8. The two phase solution is of particular interest since this case provides the
saturation conditions for water vapor in the gas phase and dissolved air in the liquid phase. The reader
is encouraged to use single element problems when starting to use a new equation of state (EOS).
Figure 2.7: States corresponding to the three initial condition options
Figure 2.8: States corresponding to the three initial condition options
In TOUGH2, all water properties are represented by the steam table equations as given by the
International Formulation Committee (10). Air is approximated as an ideal gas, and addititivity is
assumed for air and vapor partial pressures in the gas phase. The viscosity of air-vapor mixtures is
computed from a formulation give by Hirshfelder et al. (11). The solubility of air in liquid water is
represented by Henry's law.
Because of the detailed physics that are included in the TOUGH codes, setting of multi-phase initial
conditions requires detailed understanding of the problem. For help in setting mixture conditions, the
user may refer to a thermodynamics text, such as (12).
Mass and Energy Balance
As described in the TOUGH2 manual, the basic mass and energy balance equations solved by TOUGH2
can be written in the general form:
∫
∫
∫
7
Background
The integration is over an arbitrary subdomain of the flow system under study, which is bounded by
the closed surface . The quantity appearing in the accumulation term (left hand side) represents
mass or energy per volume, with labeling the mass components and an extra heat “component” if the
analysis is nonisothermal. denotes mass or heat flux and denotes sinks and sources. is a normal
vector on surface element
, pointing inward to .
The user should consult Appendix A of the TOUGH2 User’s Guide (1) for a further discussion of this topic.
Spatial Discretization
As described in the TOUGH2 User's Manual, the continuum equations are discretized in space using the
integral finite difference method (IFD), (13) and (14). Introducing appropriate volume averages, we have
∫
where is a volume-normalized extensive quantity, and
is the average value of over
integrals are approximated as a discrete sum of averages over surface segments
:
∫
. Surface
∑
Here
is the average value of the (inward) normal component of over the surface segment
between volume elements and . The discretization approach used in the integral finite difference
method and the definition of the geometric parameters are illustrated in Figure 2.9.
Figure 2.9: Space discretization and geometry data in the integral finite difference method (from
TOUGH2 User's Guide)
The discretized flux is expressed in terms of averages over parameters for elements
basic Darcy flux term, we have
[
]
[
and
. For the
]
Where the subscripts ( ) denote a suitable averaging at the interface between grid blocks and
(interpolation, harmonic weighting, upstream weighting).
is the distance between the
8
Background
nodal points
.
and
, and
is the component of gravitational acceleration in the direction from
to
The user should consult Appendix B of the TOUGH2 User’s Guide (1) for a further discussion of this topic.
Temporal Discretization
Substituting the volume averaged quantities and surface integral approximations into the mass and
energy balance, a set of first-order ordinary differential equations in time is obtained.
∑
Time is discretized as a first order finite difference, and the flux and sink and source terms on the righthand side are evaluated at the new time, to obtain the numerical stability needed for an efficient
calculation of multiphase flow.
The user should consult Appendix B of the TOUGH2 User’s Guide (1) for a further discussion of this topic.
Equations of State
As described in the TOUGH2 User's Guide, the thermophysical properties of fluid mixtures needed for
assembling the governing mass- and energy-balance equations are provided by "equation-of-state"
(EOS) modules. Each EOS uses a different set of primary variables (such as pressure, temperature, and
mass fractions) to define each possible phase condition.
PetraSim supports the following EOS options in TOUGH2 (Figure 2.10). PetraSim also supports
TOUGHREACT, TMVOC, and TOUGH-Fx/HYDRATE.
Figure 2.10: States corresponding to the three initial condition options
Selecting an EOS
There can be only one EOS in an analysis at a time. The EOS can be specified when creating a new
model or changed while working on the model.
To specify the EOS when creating a new model, select File->New…. The New Model dialog will appear,
as shown in Figure 2.11. First select the desired simulator mode on the left. Depending on the mode
chosen, different EOS options will be enabled on the right. Select the desired EOS on the right and then
click OK to create the new model with the chosen EOS.
9
Background
Figure 2.11: New Model dialog
To change the EOS while working on a model, from the Properties menu choose Global Properties.
Click Change EOS… as shown in Figure 2.12.
Figure 2.12: Global Properties dialog
NOTE: While it is possible to change the EOS while working on a model, this is discouraged. PetraSim
does not have a reliable way to re-interpret state variable information. For example, consider a model
where you are using EOS1 and have set the default initial condition to be two-phase (Pg, Sg, X), then you
change EOS to EOS7R [which contains more state variables, e.g. single-phase (P, Xb, Xrn1, Xrn2, Xair, T)].
Rather than attempt to guess the user's intent, PetraSim behaves defensively. Initial conditions will be
set to single-phase mode and some primary variable values will be carried over. In this case gas-phase
10
Background
pressure will be copied into the value for pressure and the tracer mass fraction will be copied over to
the brine mass fraction. All other values will be the defaults. With the exception of pressure and
temperature, this mapping is entirely dependent on the internal numbering of the state variables and
does not necessarily follow a particular pattern. After changing EOS, you should always re-check any
EOS-related settings.
Global Properties
Each EOS has different options that define the assumptions used in the analysis. For EOS3, this includes
whether to include heat transfer (isothermal or non-isothermal) and whether to include molecular
diffusion. These options are selected by selecting Properties->Global Preferences... or
on the
toolbar. On the EOS tab all available options will be displayed.
Details for Each EOS
The user is referred to the TOUGH2 User’s Guide (1) for detailed descriptions of the options available for
each EOS.
11
PetraSim at a Glance
3. PetraSim at a Glance
Main Window
The main window contains a 3D design view of the model (3D Model View) which can be used to
visualize and edit simulator input.
Figure 3.1: Main Window
1. Navigation Tree – Use this to quickly identify and manage items in your model.
2. View - Click to reset the 3D Model View to top, front, or side views.
3. 3D Model View – Use this to visualize and interact with the structure of your model in 3D. This
view is also used to edit mesh cells.
4. Toolbar – The toolbar provides quick access to the steps required to define, run, and postprocess an analysis.
5. View Mode – Use this to switch between viewing the conceptual model with layer sides on or
off or viewing the solution mesh. This is also used to color regions or cells by different
properties.
12
PetraSim at a Glance
6. 3D Labels - Add 3D labels to help keep track of model features. Labels are added automatically
when you add wells and when you create a model.
7. Find – Use this to find cells by name or id.
8. Axis Legend – To ensure that you never become disoriented, the axis legend rotates with your
model and always displays the x, y, and z axes.
9. Cell Count – Use the cell count display to see how many cells are in your model.
10. Simulator – Display the current simulator and EOS.
3D Results View
You can use the 3D Results View to visualize properties of your model as they evolved over time.
Figure 3.2: 3D Results View
1. 3D Results Display – Contours, vectors, and slice planes are shown against an outline of your
model. You can also make high-resolution screen shots for publications or presentation
graphics.
2. Scalar Legend – The scalar legend shows what colors were used to display scalar quantities. You
can also double-click the legend to define the range and number of colors.
3. Time List – Click a time step to view the results data at that time during the simulation.
13
PetraSim at a Glance
4. Scalar Property – Select a scalar property, such as temperature or pressure) to display from this
list. All slice planes and contours will be updated show the new property.
5. Vector Property – Select a vector property (such as water flow rate) to display from this list. All
vectors will be updated to show the new property.
6. Isosurface Controls – Change the number of isosurfaces and and other scalar display properties.
7. Vector Controls – Use sliders to scale the vectors in the 3D view.
8. Slice Planes – Click this to add 2D slice planes to the 3D view.
Time History Results
You can make time history plots of individual cell data and export the data in a format for import into
spreadsheets.
Figure 3.3: Time History Results
1. Time History Results – You can plot output data for any cell.
2. Output Variable – Select the output variable for plotting.
3. Cell Selection – Plots can be made for any cell. Named cells display the name and the cell
number.
4. Line Style – Select the style for the graph.
Example Problems
Examples problems for loading in PetraSim can be downloaded from the web at
http://www.petrasim.com under the Support link.
14
PetraSim at a Glance
PetraSim Tour (Five Spot)
This section is a (very) quick walkthrough for one of the sample problems included with TOUGH2. The
problem specification is not discussed. You can just load the data, run the simulator, and look at the
results. When you are ready, follow the steps below.
Load the EOS1 five_spot sample model
1. Download the example zip file containing five_spot.sim from http://www.petrasim.com on the
Support page.
2. Extract the zip file to the desired directory.
3. Start PetraSim.
4. Under the File menu, click Open….
5. Choose five_spot.sim from the extracted location, and then click Open.
Figure 3.4: Opening the five spot model
Enable flux output
1. On the Analysis menu, click Output Controls…
2. Click to select Fluxes and Velocities
3. Click OK
15
PetraSim at a Glance
Figure 3.5: Select fluxes and velocities output
Run the simulation
To run the simulation: On the Analysis menu, click Run TOUGH2.
The Running TOUGH2 dialog will open and show how the simulation is progressing. The graph displays
simulation time steps on the X-axis and the log10 of the time step on the Y-axis. As a rule of thumb, an
increasing Y value is a good sign of simulation progress. If your time steps start to become smaller, it
may indicate that the simulator is having a difficult time converging.
When the simulation finishes (approx 10 seconds), a message will be displayed and the Cancel button
will turn into a Close button. Click the Close button.
16
PetraSim at a Glance
Figure 3.6: Time step graph during simulation
View 3D simulation results
To view 3D simulation results: On the Results menu, click 3D Results....
Since this example problem is a 2D problem, it might be useful to add a scaling factor to the Z-axis. To
scale an axis in the 3D Results:
1. On the View menu, click Scale…
2. In the Z-Factor box, type 0.01
3. Click OK
The image below shows contour data for temperature and vectors for heat flow at the end of the
simulation. When you are finished looking at the 3D results, close the 3D Results dialog and return to
the PetraSim main window.
17
PetraSim at a Glance
Figure 3.7: Temperature contours and flow vectors
View cell time history data
To open the cell time history view: On the Results menu, click Cell History Plots.
If you ask for additional time history data for some of your cells, they will appear in bold in the cell list.
In this example, the injection and production cells were marked for additional output. These cells will
have a data point for each time step of the simulation. You can view the time history of the rest of your
cells by selecting the Show All option in the View menu.
18
PetraSim at a Glance
Figure 3.8: Cell time history
19
PetraSim Basics
4. PetraSim Basics
Work Flow in a Typical Analysis
Many problems will be run in two stages: (1) an analysis that establishes a steady state initial condition,
and (2) an analysis that loads the steady state results as an initial condition and then proceeds with a
transient disturbance, such as a spill or production from a reservoir. PetraSim makes it easy to load the
results of a previous analysis as the starting condition of a new analysis.
The PetraSim interface helps guide the user through the steps of an analysis. These include:









Selecting an EOS.
Defining the problem boundaries, creating a conceptual model, and creating a mesh.
Selecting the global options to be used in the analysis.
Specifying the material properties.
Defining the default initial conditions for the model, either directly or by loading the results of a
previous analysis.
Defining cell-specific data, such as material, sources, sinks, and initial conditions.
Setting the solution and output options.
Solving the problem.
Post-processing of results using contour and time history plots.
The user must recognize that this process is seldom linear. It will likely be necessary to iterate as new
understanding of the model and physics is obtained. New users are especially tempted to immediately
proceed with a complex model. Don't do this! It is always recommended that the user perform 1D and
2D analyses before a 3D analysis.
A suite of examples taken from the TOUGH user guides is available at http://www.petrasim.com/.
Terminology
PetraSim divides the problem space into two sections. There is a Conceptual Model and a Solution
Mesh. The Conceptual Model defines all the high-level features of the model, such as a model
boundary, geologic layers, internal boundaries, and regions. The Solution Mesh defines cells and
connections that divide the conceptual model into pieces for the TOUGH simulator. The conceptual
model and solution mesh are further discussed in the topics, Conceptual Model and Solution Mesh.




Boundary – this defines a 2D path around the problem space that limits the X,Y coordinates in
the model.
Layers – these define the stratification of the problem space.
Internal boundaries – define surfaces that split the layers into sub-regions.
Regions – sub-regions that result when a layer is split by an internal boundary. Each region can
have its own set of properties parented by the layer’s properties.
20
PetraSim Basics

Cell – a piece of the solution mesh that tries to conform to a portion of the conceptual model.
Each cell has its own properties, such as initial conditions, sources/sinks, etc.
PetraSim Interface
PetraSim uses multiple views to display the model and results:




3D View. Used to rapidly view the model, including internal boundaries and wells and define
cell-specific parameters including sources and sinks and initial conditions.
Tree View. Used to display and select regions in the model, materials, wells, and extra cells.
3D Plots. Used to display isosurfaces and contour plots of results.
Time History Plots. Used to display detailed cell results as a function of time.
3D View
Navigation
To navigate using the 3D model use the navigation toolbar:







To spin the 3D model, select the Orbit Tool ( ) and left-click and hold on the model and move
the mouse. The model will spin as though you have selected a point on a sphere.
To zoom, hold the Alt key and drag the mouse vertically with the Orbit Tool or use the Zoom
Tool ( ).
To zoom to a window, use the Zoom Box Tool ( ).
To move the model, hold the Shift key and drag to reposition the model in the window using the
Orbit Tool or use the Pan Tool ( ).
To reset the model, type "r" or click Reset View ( ).
To change to a standard view, select
for a top view,
for front view, and for a side view.
To go through the view history, use and .
View Mode
PetraSim provides three modes for viewing the model that can be selected through the View Mode
Toolbar:



Boundary Mode: This mode shows the conceptual model with the layer sides visible as
shown in Figure 4.1. Regions and layers can be selected and edited in this mode.
Layer Mode: This mode shows only the conceptual model with the layer sides invisible as
shown in Figure 4.2. Like the Boundary Mode, this mode allows regions and layers to be
selected and edited.
Mesh Mode: This mode shows only the solution mesh and internal boundaries and allows
cells to be selected and edited, Figure 4.3.
21
PetraSim Basics
Figure 4.1: Boundary Mode
Figure 4.2: Layer Mode
Figure 4.3: Mesh Mode
Colors
Depending on the current View Mode, visible elements can be colored by various properties using the
Cell Color option:
22
PetraSim Basics







By Layer – The visible cells or regions are colored by the layer to which they belong. The layer
color is specified in the Edit Layers dialog as discussed in Defining layers with the layer manager.
Color Scheme – All cells or regions are colored by the current color scheme, which can be
changed under View->Color Scheme.
Material – The cells or regions are colored by their currently set material. The material color is
set in the Edit Materials dialog as discussed in Materials.
Print Flags (only available in Mesh Mode) – If a cell has print flags set, the cell will be colored
red, otherwise grey.
Fixed State (only available in Mesh Mode) – If a cell is marked as Fixed State, the cell will be
colored red.
Source/Sink (only available in Mesh Mode) – If a cell is marked as a Source or Sink, the cell will
be colored red.
All others – All other properties come from the boundary conditions and material values for the
element and are displayed with a color legend. If the property is inapplicable for a particular
element, the element will be colored grey.
Selection
Selection in PetraSim allows actions to be performed on specific objects in the model. Selection can be
performed in either the Tree View or the 3D View. Once an object is selected, actions can be performed
on it through the Edit menu or right-click context menu.
In the 3D View, selection can be performed with the Orbit Tool ( ) or Selection Tool ( ). Singleclicking an item in the 3D View will select one item and Ctrl-clicking will select multiple items. With the
Selection Tool, multiple items can be selected by left-clicking and dragging a box around the desired
items. This selection box will select all items in the box and will penetrate through the model.
Additional items can be selected by holding the Alt and Shift modifier keys while clicking the desired
objects. The additional items that are selected depend on the current View Mode.
Selecting Regions and Layers
Selecting regions and layers in the 3D View can only be performed when either the Boundary Mode or
Layer Mode is active as discussed in View Mode. In either of these modes, the default selection action
will select regions. If the owning layer should be selected instead, hold Alt while selecting the region.
Selecting Cells
Selecting cells in the 3D View must be performed in the Mesh Mode ( ) as discussed in the View Mode
section. When using the Orbit Tool or Selection Tool, the default selection action will select individual
cells. Holding Alt while selecting will select an entire layer of cells. Holding Shift while selecting will
select an entire column of cells. Alternatively, selecting an entire layer or column can be done with the
Select Mesh Layer Tool
and Select Mesh Column Tool , respectively.
23
PetraSim Basics
For some concept-level objects, such as layers, regions, and wells, the cells that belong to that object
may be selected all at once. To do so, select the layer, region, or well from the 3D View or Tree View,
right click it, and from the context menu select “Select Cells.”
Show/Hide/Filter Objects
PetraSim provides a variety of ways of limiting the currently visible objects. Some objects can be
shown/hidden by classification, such as showing/hiding all wells or internal boundaries. Others can be
shown/hidden several at a time, such as cells.
The following classes of objects can be shown or hidden with one of the buttons on the Filter Toolbar:




Shows/Hides all wells
Shows/Hides all background images and textures
Shows/Hides all internal boundaries
Shows/Hides all disabled cells
Show/Hide/Filter Cells
When in the Mesh Mode ( ) cells can be hidden to reveal inner portions of the mesh. There are
several ways to show and hide cells, some of which are chosen from the Mesh Toolbar:





Show only a subset of cells (filter) – select the cells that should be visible and either select the
Filter button ( ) from the Mesh Toolbar or right-click the selection and select “Show Only
Selected Cells.”
Show all cells – select the Show All Cells button ( ) from the Mesh Toolbar or right-click in any
view and from the context menu select “Show All Cells.”
Show cells in only one mesh layer – the
and
buttons in the Mesh Toolbar show only one
layer of cells at a time.
will move the visibility to the next layer up from the current visible
layer.
will move visibility to the next layer down. If any cells are selected when using these
buttons, the buttons will maintain the selection in the cell column.
Hide individual cells - select the desired cells, right-click the selection, and then from the
context menu select “Hide Cells.”
Hide all cells above a mesh layer – select a cell on the layer that should be visible, right-click it,
and from the context menu select “Hide Cells Above.” This will leave the selected cell and all on
its layer and below visible and hide the rest.
24
PetraSim Basics
Tree View
The Tree View (on the left of the 3D window) is used to display, select, and edit layers, regions, internal
boundaries, materials, wells, and cells. Expand the list and then double-click on an object to edit its
properties or right-click to show an additional context menu.






Layers – Lists all layers in the model. Under each layer are all the sub-regions in that layer. Both
layers and layer sub-regions can be edited by double-clicking the layer or region.
Internal Boundaries – Lists all internal boundaries in the model.
Materials – Lists all materials in the model.
Wells – Lists all wells in the model.
Named/Print Cells – Lists all cells that have either been given a name or been marked as a print
cell.
Extra Cells – Lists all extra cells that have been defined in the model.
Units
All input uses metric (SI) units, such as meters, seconds, kilograms, degrees C, and the corresponding
derived units, such as Newton, Joules, and Pascal for pressure. In some dialogs, the unit may be entered
using a different scale. For instance, in the Solution Controls dialog, the time quantities may be entered
in seconds, days, or years by following the number with the appropriate abbreviation.
Displaying a Surface Image on the Model
It is possible to display a surface image on the model. This can be useful to help relate underground
features with the surface image or to enhance the visual display. There are two ways to specify an
image. One is as a floating background image that can exist at any Z location and the other is to drape
an image over the terrain of the top layer.
Floating Background Image
A floating background image is a flat image that can be specified at any Z location and with
transparency. This type of image is useful for orienting underground features. To specify this type of
image:
1.
2.
3.
4.
5.
6.
7.
Save the image file (.bmp, .gif, .jpg, .jpeg, .png).
On the View menu, click Background Image…
In the Background Image Dialog, click the file selection icon, and select the image file.
The Origin defines the position of the lower left corner of the image in the model coordinates.
The Extent defines the length of the image in the model coordinates.
The Z-Coord defines the position of the image in the Z direction.
The Transparency slider defines the amount of transparency used to display the image. Move
the slider to the left to minimize transparency.
An example surface image is shown in Figure 4.4.
25
PetraSim Basics
Figure 4.4: Example background image
Draped Image
A draped image appears as a texture on the top of the terrain as shown in Figure 4.5. It conforms to the
terrain on the top layer of the model and can be viewed in any View Mode. When viewed in Mesh
Mode it is draped on the top layer of visible cells. To add a draped (top) image: on the Model menu,
click Set Top Image.
Figure 4.5: Example draped image
User-Defined Labels
It is possible to add labels to the model in addition to those automatically created by the boundary and
wells. To define labels
26
PetraSim Basics
1. On the Model menu, click Labels...
2. In the Labels dialog, add the X, Y, and Z coordinate data and Name text for each label.
3. Each label will now be displayed in the 3D View. You can control the display of the labels in the
View menu.
27
Working with Files
5. Working with Files
Several files are used when performing an analysis using PetraSim. These include the PetraSim model
file, the TOUGH input file, and TOUGH output files. It is important to understand the differences
between these files to take full advantage of PetraSim's features.
PetraSim Model File (SIM)
The PetraSim model file (SIM) is a binary file that represents a PetraSim model. The SIM file contains all
information needed to write a TOUGH input file.
The SIM file can be used to save the model and share with other PetraSim users.
TOUGH Input File (DAT)
Execution of TOUGH is integrated into PetraSim. Before PetraSim executes TOUGH, a TOUGH input file
(DAT) is automatically written. This file is then read by the TOUGH executable. The TOUGH input file
contains all information needed for a TOUGH analysis. The DAT file is an ASCII text format file.
Most PetraSim users will never need to explicitly create or edit the TOUGH input file. In special cases,
such as when a user has developed a special version of TOUGH, the user may need to edit the TOUGH
input file before an analysis. In this case, PetraSim provides the option to export this file
File/Export/TOUGH File...) for manual editing.
PetraSim users should not use the DAT file to share models, since this file does not contain
information needed to reconstruct a model in PetraSim.
Creating and Saving a New PetraSim Model
When PetraSim is started, it begins with an empty model. The user can immediately begin work on a
new model. If another model has already been opened, select File->New... to clear the current model
and start a new empty model. PetraSim always has one (and only one) active model.
To save the new model, select File->Save... and give the file name. Because the files written by TOUGH
have a fixed name, it is recommended that the user create a new directory for each model. If this is not
done, the TOUGH results from a first analysis will lost when a second model is run, even if the PetraSim
model has a different name.
Open a Saved PetraSim Model
To open a saved model, select File->Open... and select the file. To speed model selection, a list of
recently opened files is available under File->Recent PetraSim Files....
Contour Files
Externally generated contour data can be used to define 3D initial conditions, the geometry of layer
divisions for the conceptual model, or internal boundaries.
28
Working with Files
The format of the contour file is given below. The contour data can be viewed as a set of planes on
which contours are defined. The planes can be defined at several depths in the model, forming a
complete 3D definition of the data. Linear interpolation is performed in the Z direction between the
contour planes.
The data consists of the depth (Z coordinate) followed by a definition of contours at that depth. In the
following example, the "!" and following comments are included only for description. These should not
be included in an actual file.
Define top of reservoir
<top origin>
<depth>
0.
<contour>
0.
1
-1000. 1000.
<contour>
200.
3
-100. 1000.
-300. 800.
-1000. 200.
<contour>
100.
4
200. 1000.
0. 600.
-400. 200.
-800.
0.
<contour>
0.
4
400. 1000.
200. 600.
-200. 200.
-600.
0.
<contour>
0.
2
1000.
0.
1000. 1000.
!
!
!
!
!
!
!
!
!
!
!
!
!
!
The first line is a description
Include this line (not used at this time)
Keyword to indicate beginning of a contour set
The Z coordinate for this contour set
Keyword to define a contour at the given depth
Value of contour followed by number of points
X and Y coordinates of the point(s)
Start of a new contour
Value (200.0) and number of points (3)
X and Y coordinates of the point(s)
X and Y coordinates of the point(s)
X and Y coordinates of the point(s)
Complete the contours at this depth.
! Repeat <depth> and <contour> data
XYZ Files
XYZ files may be used to define the geometry of layer divisions and internal boundaries as discussed in
the topic, Conceptual Model.
The XYZ file format consists of a list of XYZ points. PetraSim triangulates these points to form a surface.
Following is a typical file.
-1000. 1000.
-100. 1000.
-300. 800.
-1000. 200.
200. 1000.
0. 600.
-400. 200.
-800.
0.
400. 1000.
200. 600.
-200. 200.
-600.
0.
-500.
-300.
-300.
-300.
-400.
-400.
-400.
-400.
-500.
-500.
-500.
-500.
29
Working with Files
1000.
0.
1000. 1000.
-500.
-500.
DXF Files
PetraSim contains limited support for DXFs to define layer divisions and internal boundaries as discussed
in the topic, Conceptual Model.
The DXF file is limited to 3DFACE entities and Polyface meshes. These must be the top objects in the
hierarchy, not embedded in blocks. If you have further questions, please contact Thunderhead
Engineering.
30
Conceptual Model
6. Conceptual Model
The conceptual model defines the high-level features of the model. These are detailed descriptions of
entities as they exist in the world, including a problem boundary, geologic layers, regions, and internal
boundaries. The conceptual model is independent of the solution mesh and is used to generate the
solution mesh as discussed in the topic, Solution Mesh.
Problem Boundary
The problem-space is limited in scope by defining a problem boundary. This is a 2D polygon that can be
thought of as cutting a section out of the earth. The boundary polygon may be any shape, concave or
convex, as long as it does not self-intersect. Some examples of boundaries are shown in Figure 6.1.
Figure 6.1: Examples of different model boundaries
The model boundary may be defined at any time, but it is preferable to define it either when starting to
build the model or just after creating the layers. There are two ways to define the boundary. It can
either be done when creating a new model or with the Boundary Editor.
Defining boundary with a new model
To define the boundary as part of a new model, select File->New to create the new model. The New
Model dialog is shown as in Figure 6.2. A rectangular boundary can be specified in this dialog by
entering the X Min, X Max, Y Min, and Y Max.
31
Conceptual Model
Figure 6.2: Entering a boundary in the New Model dialog
Defining boundary with the boundary editor
To edit the boundary once a model has been created, open the Boundary Editor dialog by going to the
Model menu and choosing Edit Boundary… ( ). The Boundary Editor dialog is shown in Figure 6.3.
Figure 6.3: Boundary editor
This dialog shows an overhead view of the model along with the current boundary path. An existing
point on the path can be edited either by clicking and dragging the point with the left mouse button or
right-clicking a point and selecting “Edit…” from the context menu to set the point to a specific
32
Conceptual Model
coordinate. A point can be added to the boundary by clicking on one of the edges. The point will be
added at the set point. Existing points can also be deleted by right-clicking the point and selecting
“Delete” from the context menu.
There are also several ways to create the boundary from scratch using the toolbar:
From a file – Select this option to use an XY input file to create the boundary.
file is similar to XYZ files discussed in the topic,



This input
XYZ Files. The main difference is that the XY file doesn’t require a Z coordinate and must specify
the coordinates in the proper order to form a polygon describing the boundary.
Quick Set Min/Max – Select this to create a boundary that is an axis-aligned box using
min/max x and y bounds as shown in Figure 6.4.
Auto Size to Layers – Select this option to automatically create a boundary from the current
layers if their divisions were generated from input files, such XYZ, Contour, or DXF files. Because
the geometry in the input files may make different shapes or may not overlap in coordinates,
another dialog will ask how to generate the resulting boundary as shown in Figure 6.5.
o If the Bounding Box option is chosen for shape, the resulting boundary will be an axisaligned box that fits the outer points of the input files.
o Convex Hull will make the boundary a convex polygon that fits the points in the input
files. This option is only relevant if the input points were not specified as a rectangular
array of points in the input file.
o The input for the shape is determined by combining the geometry from the different
layer divisions in the model. The geometry can either be a Union of the shapes or an
Intersection.
o Different combinations of shape and layer-combining are shown in Figure 6.6.
Figure 6.4: Quick Set Boundary dialog
33
Conceptual Model
Figure 6.5: Auto Size Boundary dialog
Figure 6.6: Auto Size Boundary combinations
Layers
Layers can be used to describe the stratigraphy of the model. Layers are horizontal regions that are
stacked on top of each other in the Z direction. A model can be composed of any number of layers, each
having its own set of properties, including name, material, color, number of divisions in the solution
34
Conceptual Model
mesh, and initial conditions. Figure 6.7 shows several layers within one model. As can be seen in the
figure, a layer does not have to extend to the boundary.
Figure 6.7: Example of layers
In PetraSim layers are defined by the geometric surfaces, or divisions, between each layer. Each
division may be created by using a constant Z value, a planar function, or an input file for more complex
surfaces. There will always be one more division than there are layers in the model. This extra division
is used to define the top of the model. In Figure 6.7 it can be seen in the left image that there are four
layers and in the right image there are five divisions defining the layers. PetraSim always associates the
top two divisions with the top layer, and each subsequent layer is defined only by its lower division
(each subsequent layer’s upper division is implicitly defined by the next higher layer’s lower division).
The colors of the divisions in Figure 6.7 (right) demonstrate which division is associated with which layer.
The following guidelines are strongly suggested for layer divisions:


Layer divisions should extend to the boundary of the model. If an input file does not do so,
PetraSim will automatically extend the geometry to the boundary in the X,Y direction as shown
in Figure 6.8. This may result in unintended geometric artifacts.
Layer divisions are allowed to touch along areas, pinching the layer, but they should not cross
within the model boundary. While PetraSim does not enforce this rule, it is best practice to
make sure this rule is followed since it reduces ambiguities in determining the order of the
layers along the Z direction. An example of invalid divisions is shown in Figure 6.9. PetraSim
cannot reliably determine which layer should be the top, middle, and bottom. The model in this
image could be fixed by changing the boundary to only include the portion of the model to the
left or right of the divisions’ intersection as shown in Figure 6.10.
35
Conceptual Model
Figure 6.8: Example of extending an input file boundary
Figure 6.9: Example of invalid layer divisions
36
Conceptual Model
Figure 6.10: Fixed layer divisions
In PetraSim, there must always be at least one layer. For every new model there is, by default, one layer
defined by two Z-planar divisions. These divisions can be specified when creating the new model. In
addition, layers may be added, edited, and removed after the model is created.
Defining the default layer with a new model
The divisions of the default layer may be specified when creating a new model. To do so, on the File
menu, click New…. The New Model dialog appears as shown in Figure 6.2. Enter the desired Z Min and
Z Max. The default layer divisions are always Z-planar.
Defining layers with the layer manager
At any time while working on a model, layers may be added, edited, and removed through the Layer
Manager dialog. On the Model menu, click Edit Layers… ( ). This will open the layer manager as
shown in Figure 6.11. The current model layers appear in the left-hand list in the layer manager, and the
properties of the selected layer are shown in the right-hand pane.
37
Conceptual Model
Figure 6.11: Layer manager dialog
Create a new layer
By default, there is always one layer in the model. To create a new layer, click the New… button in the
layer manager dialog. This will open the New Layer dialog shown in Figure 6.12. Specify the name of
the new layer and the geometry defining its bottom (base) division. Then click OK. The geometry may
be defined as follows:



Constant – Specifies a Z location such that the division will be a plane located at Z=the entered
value.
Function – Specifies a planar division defined as
.
From File – Allows the division’s geometry to be defined by an input file. The geometry may be
an XYZ file, Contour file, or DXF file as described in the Working with Files section.
The new layer will automatically be sorted and inserted into the list of layers based on its based division.
Figure 6.12: New Layer dialog
Delete a layer
To delete an existing layer, first select it in the list and then click the Delete… button.
Edit a layer
To edit an existing layer, first select it in the list. Its properties will be shown in the right-hand pane.
38
Conceptual Model







Name – the layer name
Color – the layer color. This will define how geometry is to be colored when the Region or Cell
color is set to “By Layer” as discussed in the topic, Colors.
Material – the layer material. All regions and cells in the layer will inherit this material unless
the material is individually overridden by the layer or cell.
Top – the top division. This field may only be edited on the top layer. See Create a new layer
for a description of division input.
Base – the bottom division. See the Create a new layer section for a description of division
input.
Dz – the divisions used to create the solution mesh. This is described in the Setting Z Divisions
section.
Initial Conditions – these are discussed in the Boundary and Initial Conditions section.
Once changes have been made to a layer, either press Apply to commit the changes and keep the dialog
open or OK to commit the changes and close the layer manager dialog.
Regions
Regions are portions of the model that have non-zero volume. They are the basis for creating high-level
features in the model, such as faults. With no internal boundaries in the model, each layer consists of
one region. Regions may be divided into smaller regions by adding internal boundaries as discussed in
the next section. Regions are always parented by layers, and can be found in the Tree View as shown in
Figure 6.13. This figure shows four layers that have been divided by an internal boundary, creating two
regions in each layer.
Figure 6.13: Example of layers split into multiple regions
Each region may have its own set of properties, which can be accessed by double-clicking a region in the
Tree View or in the 3D View. The region properties window is shown in Figure 6.14.
39
Conceptual Model
Figure 6.14: Region properties dialog




Name – the name of the region.
Material – the region’s material. Cells in this region will inherit this material if they have not
explicitly set a material in their properties. If this value is set to “Auto” the material will come
from the owning layer.
Enable Region – whether to include this region in the simulation. If this is unchecked, all cells in
this region will be disabled and excluded from the simulation.
Initial Conditions – see Layer and Regional Initial Conditions.
Internal Boundaries
Internal boundaries are used to divide layers into multiple regions. Material properties and initial
conditions can then be defined by region. Select Model->Add Internal Boundary... or
to open the
Add Internal Boundary dialog, Figure 6.15.
Figure 6.15: Defining an internal boundary
There are four options for specifying an internal boundary: Strike + Dip, Three Points, Point + Normal,
and Input File. The first three options create planar divisions, each containing a different set of options
to specify the plane. Figure 6.15 shows the input using the Strike + Dip option.
For the Strike + Dip option, the data include:

Point on Plane – The coordinates of a point on the boundary plane.
40
Conceptual Model


Strike Azimuth – The degrees from North (the positive Y axis) in a clockwise direction.
Dip Angle – Degrees from horizontal of the plane. If the viewer is facing the azimuth direction,
the dip is to the viewer’s right.
For the 3 Points on a Plane option, the data include:

Points on Plane – The coordinates of three points on the boundary plane.
For the Point + Normal option, the data include:


Point on Plane – The coordinates of a point on the boundary plane.
Normal to Plane – The components of a vector normal to the plane. They do not need to be
normalized.
For the Input File option, a 3D contour can be defined using the contour, XYZ, or DXF file formats (see
Working with Files). An example is shown in Figure 6.16.
Figure 6.16: The internal boundary shown in the model
NOTE: Internal boundaries from input files are not automatically extended to the model boundary as
layer divisions are. This means that the internal boundary will only split off new regions if it touches or
intersects all surrounding geometry. If it does not, it will be added to the model as a geometric surface
floating in the middle of the model as shown in Figure 6.17.
41
Conceptual Model
Figure 6.17: Example of floating internal boundary
A video example of how to use SketchUp to create a DXF file for import to PetraSim is available at
www.petrasim.com. The demo shows how to define a cylindrical region inside a rectangular mesh, so
that different material properties can be associated with that region, Figure 6.18.
a. Closed internal region defined using DXF file
b. Mesh created using material properties
assigned by region
Figure 6.18: A cylindrical region defined using a DXF file
Faults
Faults are not explicitly modeled in PetraSim, but they can be created using internal boundaries and
regions. To do so, add two internal boundaries to split off a new region. This new region between the
boundaries corresponds to the fault. The fault properties can then be specified by editing the region as
discussed in the previous section.
42
Conceptual Model
With more complex models with several layers, the fault may be split into many regions, spread across
several layers as shown in Figure 6.19. This may make it difficult to find the fault regions using just the
Tree View or 3D View. To more easily find the regions, perform the following steps:
1. Select the two internal boundaries defining the fault from the Tree View.
2. Right click on one of the boundaries in the Tree View, and from the context menu, select “Select
Regions Inbetween.”
This will select and highlight the fault regions as shown in Figure 6.19.
Figure 6.19: Selecting fault regions
Cleaning Up the Model
Sometimes after making many changes to a model, such as adding and deleting internal boundaries or
layers, the conceptual model may appear to have extraneous edges or other irregularities as shown in
Figure 6.20. To fix these problems and clean up the model, from the Model menu select Regenerate
Conceptual Model. This will rebuild the conceptual model. This should be a safe operation that will
maintain all model properties and should make the model appear cleaner, but it is recommended to
save the model before performing this operation.
43
Conceptual Model
Figure 6.20: Cleaning a conceptual model
44
Solution Mesh
7. Solution Mesh
PetraSim provides three types of solution meshes:



Regular – cells are rectangular hexahedrons.
Polygonal – uses extruded Voronoi cells to conform to any boundary and support refinement
around wells.
Radial – represents a slice of an axisymmetric cylindrical mesh. This is based on the Regular
mesh, but it only allows 1 Y-division.
Figure 7.1 shows the different types of meshes.
a. Regular Mesh
b. Polygonal Mesh
c. Radial Mesh
Figure 7.1: Types of solution meshes
All meshes in PetraSim conform to the layers of the model in the Z direction, so if a layer slopes upward,
the mesh cells will also slope upward to conform. An example of this is shown in Figure 7.2.
45
Solution Mesh
Figure 7.2: Example of a mesh conforming to the model layers
Defining a Solution Mesh
Defining a solution mesh requires two steps. First the Z divisions must be specified per-layer in the
Layer Manager dialog. Then a mesh of the desired type must be created with the Create Mesh dialog.
In the following sections, it is important to note the distinction between a model layer and a cell layer.
A model layer is a layer defined in the conceptual model to define stratigraphy or other model
properties. A cell layer is a portion of the model layer that corresponds to the solution mesh. Each
model layer may be split into any number of cell layers.
Setting Z Divisions
The Z divisions control how many cell layers are created per model layer. When a new mesh is created,
each model layer is divided into a number of cell layers as seen in Figure 7.2 and then each cell layer is
further refined in the XY dimensions based on the type of mesh created as discussed in the following
section.
To edit the Z divisions for a layer, open the Layer Manager dialog as described in Defining layers with
the layer manager. The Z divisions are entered in the Dz section. If Dz is set to Regular, the layer will be
divided evenly into a constant number of cell layers when creating a new mesh. If this is set to Custom,
a table will appear, allowing the cell layer divisions to be entered as custom sizes. Figure 7.3 shows an
example of creating custom Dz. This Dz table allows the divisions to be entered such that a Fraction of
the layer will be divided into the specified number of Cells. Each row in the table is ordered such that
going down in the table corresponds to increasing Z values.1
1
If a solution mesh already exists in the model and Dz is changed for a layer, the mesh will NOT automatically
update with the new number of layer divisions. The mesh must be recreated to update the divisions.
46
Solution Mesh
Figure 7.3: Creating custom layer Dz
Creating the solution mesh
Once the Z-divisions have been set per layer, a mesh may be created in the Create Mesh dialog. The
parameters entered in the Create Mesh dialog control how each cell layer is divided into horizontal
pieces. To create the mesh, from the Model menu select Create Mesh… or click
to open the Create
Mesh dialog, Figure 7.4. Choose the desired Mesh Type from the drop-down box, and enter the
required parameters as described in the following sections.
Figure 7.4: The Create Mesh dialog showing regular parameters
Regular Mesh
A regular mesh is rectangular and is made of six-sided cells. It is created such that it fits the bounding
box of the model. Because a model boundary does not necessarily have to be a rectangle, any cells
outside the model boundary are disabled. The parameters for controlling cell sizes in the X and Y
47
Solution Mesh
directions are shown in Figure 7.4. Cell sizes can either be constant in the x and y directions using the
Regular division type or vary in either direction using the Custom division type or size factors.
If Regular divisions are specified, X Cells and Y Cells correspond to the number of cells in the X and Y
directions. A factor can be used to increase or decrease element size. If the factor is 1.0, then all cells in
that direction have the same size. If not, the relations in Figure 7.5 can be used to calculate the cell size
that will result for a given initial size and factor.
Figure 7.5: Calculating cell size when the factor is not 1.0
Cell sizes can also be more finely controlled using the Custom division option. The sizes are entered into
a table as shown in Figure 7.6. Each row in the table specifies that a portion of the mesh in the X or Y
dimension should be a specific number of evenly spaced cells. Similarly to specifying Z divisions, the
order of the rows matter: each entry going down in the table corresponds to an increase in the X or Y
direction. In Figure 7.6, the model boundary goes from X=0 to X=1500, and Y=0 to Y=1000. From the
table, the first half of the solution mesh in the X dimension (X=0 to 750) contains 5 evenly spaced
divisions and the second half (X=750 to 1500) contains 15. Similarly in the Y dimension, the first quarter
(Y=0 to 250) contains 12 cells and the last three quarters (Y=250 to 1000) contains 3 cells. Note that the
Fraction for each dimension must add up to 1.0.
Figure 7.6: Example of custom divisions for a regular mesh
Polygonal Mesh
A polygonal mesh can be used to match an arbitrary boundary or provide additional refinement around
wells. The parameters for creating a polygonal mesh are shown in Figure 7.7.
48
Solution Mesh



Maximum Cell Area –defines an approximate value for the maximum area of each cell in the XY
plane.
Max Area near Wells –defines an approximate XY cell area near wells.
Min Refinement Angle – controls how quickly the area near wells disperses. The smaller this
value is, the more quickly the cells will return to the maximum cell area extending radially out
from the well.
Figure 7.7: Parameters for a polygonal mesh
Radial Mesh
The user can also create a radial RZ (axisymmetric) mesh. An RZ mesh is modeled as a 2D slice through a
cylinder centered at (0,0,0) as shown in Figure 7.8. In this slice, the red line is the portion of the cylinder
that is modeled by the RZ mesh. It appears in the model as a 2D regular mesh with the X divisions
representing the radial divisions and the number of Y divisions being 1.1
1
While the radial mesh will be displayed as a rectangular mesh with only one Y division, all cell data is
displayed and written to the TOUGH input file with the correct cell volumes and connection areas to
represent the cell revolved around the center of the cylinder.
49
Solution Mesh
Figure 7.8: Radial mesh representation in PetraSim
To create a radial mesh, select the radial mesh option in the Create Mesh dialog as in Figure 7.9. The
only parameter needed to create the mesh is the radial divisions, which correspond to the X divisions in
the resulting mesh. These are specified similarly to the divisions in a Regular Mesh.
Figure 7.9: Parameters for a radial mesh
Editing Cells
Once a mesh has been created, every cell will be assigned to a region in the conceptual model based on
the center of the cell. This allows each cell to inherit the properties of the owning region, such as
materials and initial conditions. Each cell may be edited to provide more fine-grained control over its
properties. The user can edit the properties of a cell from the 3D View or Tree View by double-clicking
the desired cell or selecting the desired cells, right-clicking on one, and selecting Edit Cells… from the
context menu as shown in Figure 7.10. The Edit Cells dialog is shown in Figure 7.11.
50
Solution Mesh








Cell Name - A descriptive name that can be used to access cell results for plotting. If this name
is not empty, the cell will be displayed in the Tree View under “Named/Print Cells”.
Cell ID - This is calculated by PetraSim, not editable.
X, Y, and Z Center - The center of the cell, not editable.
Volume - The volume of the cell calculated based on dimensions, not editable.
Volume Factor - A multiplier on the volume that is used to obtain the final volume sent to the
TOUGH input file.
Permeability Factor – A multiplier for the permeability of the cell sent to the TOUGH input file.
Material - The material for the cell.1
Type – The cell type. See Enabled, Disabled, and Fixed State Cells for further details.1
Figure 7.10: Editing a cell in the 3D View
1
If “Auto” is selected in the drop-down, the property will be taken from the cell’s owning region.
51
Solution Mesh
Figure 7.11: Editing cell properties
The Sources/Sinks and Initial Conditions tabs will be described in Boundary and Initial Conditions.
The Print Options tab is used to output cell data every time step for the selected cells (this is the FOFT
file as used by TOUGH). In addition, connection data can be written (this is the COFT file as used by
TOUGH).
Enabled, Disabled, and Fixed State Cells
In the cell editor, a cell can be set to Type Enabled, Disabled, or Fixed State, with the following
meanings:



An Enabled cell is a standard cell in the analysis.
A Disabled cell will not be included in the analysis. No information about this cell will be written
to the TOUGH input file. It will not be included in the results.
A Fixed State cell is used to set boundary conditions. The cell is included in the analysis, but the
state of the cell (Pressure, Temperature, etc.) will not change. In the TOUGH2 User's Guide,
such cells are named "Inactive". It was necessary for us to use a different name to distinguish
between Fixed and Disabled cells.
Extra Cells
There are times when the capability to add non-geometric "extra" cells is useful. These extra cells can
be used to define special boundary conditions or in other ways to "trick" the model into representing
some special feature.
52
Solution Mesh
Support for "extra" cells is provided in PetraSim through dialogs. Since these cells are not geometric,
the user must define the volume and connections of these cells to the regular grid cells. To create an
extra cell, on the Model menu, click Add Extra Cell.... Figure 7.12 illustrates the definition of the basic
cell properties. These basic properties are similar to that of a normal cell as discussed in Editing Cells.
Figure 7.12: Defining the basic extra cell properties
The Sources/Sinks, Initial Conditions, and Print Options for an extra cell are the same as a standard cell.
The connections of the extra cell to the grid are specified by selecting the Connected Cells tab, Figure
7.13. The user must manually specify the connection data required by TOUGH. This includes:







To Cell - This is the cell to which the extra cell is connected. This will be the cell ID of a cell in the
mesh. You can find the cell ID of any cell using the Grid Editor and then viewing the cell
properties.
Orientation - This is must be 1, 2, or 3 and corresponds to the PermX, PermY, or PermZ
definitions in the material data.
Dist. This - The distance of the connection in the extra cell. See TOUGH concepts "Spatial
Discretization."
Dist. To - The distance of the connection in the connecting cell.
Area - The cross-sectional area of the connection.
Gravitational Acceleration - The cosine of the angle between the gravitational acceleration
victor and the line between the two elements. If positive, the extra element is above the
connecting "To" element.
Radiative Heat Transfer - "Radian emmittance" factor for radiative heat transfer. Usually left as
0.0.
53
Solution Mesh
Figure 7.13: Defining the extra cell connections to the model
To edit an extra cell, double click on the extra cell in the Tree View.
54
Materials
8. Materials
Materials are used to define the permeability and other properties in an analysis. Each cell is associated
with a material. Materials can be assigned by layer (select a layer and edit the layer properties), by
region (select a region and edit the region properties), or to individual cells (select the cell and edit the
cell properties). PetraSim uses inheritance to determine any particular cell property: it first looks in the
cell; if the property is not found there, it looks in the region; then it looks in the layer; finally it looks in
the default model.
When a new model is started, there is one default material. Material data is edited by selecting . In
this dialog, the user can edit, create, and delete materials, Figure 8.1. The basic material data includes
(many are self-explanatory):








Name - The material name that will be written to the TOUGH input file, limited to five
characters.
Description - A longer description for user clarity.
Color – The color that will be used in the 3D and Results Views to color cells and regions when
the cell or region color option is set to “Material.”
Rock Density - Density.
Porosity - Porosity
X, Y, and Z Permeability - The permeability is defined along each axis.1
Wet Heat Conductivity - Wet conductivity
Specific Heat - Specific heat.
1
When using a Polygonal mesh, only an XY and Z permeabilities may be specified. The XY permeability is used
between cells in one cell layer.
55
Materials
Figure 8.1: Material properties
Relative Permeability
Selecting the Relative Perm... button displays the Additional Material Data dialog. The first tab is used
to define Relative Permeability, Figure 8.2. The user selects the desired relative permeability function
and then defines the parameters used by that function. A graph will display the permeability (magenta
is gas; blue is liquid) as a function of liquid saturation.
56
Materials
Figure 8.2: Relative permeability functions
Capillary Pressure
Select the Capillary Pressure tab to define the capillary pressure function, Figure 8.3. The user selects
the desired capillary pressure function and then defines the parameters used by that function. The
value of ICP corresponds to the TOUGH function ID. The Help section of http://www.petrasim.com
provides a spreadsheet to plot the capillary pressure functions.
57
Materials
Figure 8.3: Capillary pressure functions
Miscellaneous Material Data
Select the Misc tab to define additional material properties, Figure 8.4. These include:





Pore Compressibility - This defines how the pore volume changes as a function of pressure. This
is used when storativity is to be included in the model, such as when performing a well test
analysis. In most cases, this is not used and remains 0.0.
Pore Expansivity - This defines how the pore volume changes with temperature. In most
cases, this is not used and remains 0.0.
Dry Heat Conductivity - Used with the wet heat conductivity to change the thermal
conductivity of the rock.
Tortuosity Factor - The user is referred to Appendix D of the TOUGH2 User's Guide for a
detailed discussion of this factor. In most cases, this is not used and remains 0.0.
Klinkenberg Parameter - The user is referred to Appendix A of the TOUGH2 User's Guide for a
detailed discussion of this factor. In most cases, this is not used and remains 0.0.
58
Materials
Figure 8.4: Miscellaneous material data
Assigning Different Materials by Cell
To support the use of geostatistical data, PetraSim allows the user to import a table of material
assignments for all cells. This is useful if the user has an independent representation of the model that
can be queried to obtain a spatial definition of materials. PetraSim provides two tools:


The capability to write a file with cell IDs and X, Y, Z coordinates.
The ability to paste a table of material types for all cells.
To write a file with cell IDs and X, Y, Z coordinates, on the File menu, click Write Grid Data.... The
resulting file defines the cell coordinates in their PetraSim order that allows you to query a separate
material database.
On the Model menu, click Assign Cell Materials... to open the Assign Cell Materials dialog, Figure 8.5.
You can either type or paste a list of materials to be assigned to each cell. All materials must have
already been defined. Values in the Material Name column must match the name of a material stored
in the current model.
59
Materials
Figure 8.5: Assign Cell Materials dialog
60
Boundary and Initial Conditions
9. Boundary and Initial Conditions
Initial Conditions
Initial conditions are used to define the initial state of each cell. When generating the simulator input
file, a hierarchy is used to determine values for each cell: if a value is defined at the cell, that value is
used; if defined at the region, the region's value is used; if defined at the layer, the layer's value is used;
finally, the default model initial conditions will be used.
The specific initial conditions are different for each EOS. For any specific EOS, there are at least singleand two-phase initial conditions, as well as options for different components. The user is referred to
Chapter 3, Tough Concepts for a discussion of components and an example of setting single- and twophase initial conditions.
Only for the simplest models will the initial conditions be uniform over the model. In most realistic
analyses, a steady state simulation will be used to reach an equilibrium solution. For example, this will
be used to reach gravity-capillary equilibrium in a vadose zone analysis or heat and fluid flow
equilibrium in a geothermal reservoir analysis. The steady state results will then be used as initial
conditions for the transient analysis. When this approach is used, two separate folders should be used
to store the steady state analysis and the transient analysis.
Because of the complex physics represented in TOUGH, setting of the initial conditions can be
challenging. The user is directed to the many examples available at the PetraSim web site for guidance
on how others specify initial conditions.
Default Initial Conditions
Default initial conditions are always defined for the model. To set these conditions, on the Properties
menu, click Initial Conditions... ( ). This will open the Default Initial Conditions dialog, Figure 9.1.
You will then be provided all the available initial condition options that are valid for the EOS and
selected components. Based on your knowledge of the problem, define these appropriately.
Figure 9.1: Setting default initial conditions
61
Boundary and Initial Conditions
Layer and Regional Initial Conditions
Initial conditions can also be set per layer or region. To do so, select the layer or region and then select
Edit->Properties.... On the dialog, select the Initial Conditions tab. After selecting, Specify by
Layer/Region, you will be able to define initial conditions, Figure 9.2. If you do not want region initial
conditions to be used, deselect Specify by Layer/Region and the initial conditions will inherit from the
parenting layer or default initial conditions for regions and layers, respectively.
Figure 9.2: Setting region initial conditions
Cell Initial Conditions
To define initial conditions by cell, open the Edit Cells dialog as discussed in Editing Cells. On the Initial
Conditions tab of the Edit Cell Data dialog, select Specify Initial Conditions by Cell, Figure 9.3. You will
then be able to define initial conditions for a cell. If you do not want cell initial conditions to be used,
select Use Region (or Global) Initial Conditions.
62
Boundary and Initial Conditions
Figure 9.3: Setting cell initial conditions
Loading Previous Results as Initial Conditions
To read initial conditions from a previous analysis, select File->Load Initial Conditions... and read a
previous SAVE file. The model used to write the SAVE file must have the same geometry as the model
for which you are reading data. To avoid over-writing of files by TOUGH, each analysis should be run in
a separate directory.
Boundary Conditions
Fixed Boundary Conditions
Boundary conditions where the pressure, temperature, and other variables do not change with time
(called "essential" or Dirichlet boundary conditions) are typically set using "Fixed State" option in a cell.
This is done by editing the cell (see Editing Cells for details).
A cell with fixed conditions will act as a source/sink for fluid and heat flow.
"Tricks" can be used to selectively fix the pressure or temperature independently. For example, to fix
the pressure, the material of the cell can be changed so that the thermal conductivity is zero. Then, only
fluid will flow to the cell and the cell will act as a fixed pressure. Similarly, the permeability could be set
to zero for the cell to act as a fixed temperature condition.
63
Boundary and Initial Conditions
Sources and Sinks
Sources and sinks are used to define flow into or out of the cell. These are typically used to define
production from or injection into a cell. This is used for situations such as a well in a reservoir or rainfall
on the surface.
The rates can be defined as constant or using a table to give time/rate pairs. By default, PetraSim
assumes a step change when a time history of input is specified. This can be changed in the Solution
Parameters options.
To define a source or sink, open the Edit Cell dialog as discussed in Editing Cells. Select the
Sources/Sinks tab as shown in Figure 9.4. The user has several options:





Heat - The rate of Heat In can be defined as a constant or through a table as a function of time.
Use a negative number to remove heat. If a flux is selected, the flow rate is equal to the flux
multiplied by the area of the cell projected on the XY plane (the flux is in the Z direction).
Mass Out - This defines the mass (or mass flux) rate produced from the cell.
Well on Deliverability - This defines a boundary condition where the cell produces to a fixed
pressure. The user defines the Productivity Index and the pressure. See page 64 of the TOUGH2
User's Guide for instructions on calculation of the Productivity Index.
Well from File - This is a coupled wellbore flow model. See page 66 of the TOUGH2 User's Guide
for instructions on its use.
Injection - Injection parameters will vary depending on the EOS being used. In general, the user
will specify a rate (or flux) and an enthalpy for each component to be injected.
64
Boundary and Initial Conditions
Figure 9.4: Defining a cell as a source/sink
Using Wells in PetraSim
PetraSim provides a basic option to define wells as geometric objects (lines in 3D space). Injection or
production options are assigned to the well and PetraSim handles the details of identifying the cells that
are intersected by the well and applying the appropriate boundary conditions to each cell. This is not a
true coupled well model; it is a means of identifying the cells that intersect a well and creating the
individual sources/sinks for each cell. It also provides a way to label and display wells. The cells
intersecting a well can be easily viewed and selected by right-clicking the well in the Tree View and
selecting “Select Cells.” Additional mesh refinement may be achieved around wells by using Polygonal
meshes as discussed in the topic, Polygonal Mesh.
Adding a well and defining the boundary conditions is a two step process. Define the well coordinates by
selecting Add Well... on the Model menu or
from the main toolbar. This will open the Add Well
dialog as shown in Figure 9.5. Name the well and give the coordinates in order, either starting at the top
or bottom of the well. The new well will be displayed in the tree view.
65
Boundary and Initial Conditions
Figure 9.5: Add Well dialog
To edit the well, double-click it in the Tree View. This will show the Edit Well dialog as shown in Figure
9.6.
Figure 9.6: Edit Well dialog
The minimum and maximum Z coordinates of the completion interval (the range over which the well can
flow to the porous media) can be edited under the Geometry tab. In the 3D View, the completion
interval is the red portion of the well as shown in Figure 9.7. For models that will use the Well on
Deliverability option, it is best if these completion bounds correspond to gridlines in the model. This is
because the entire cell depth is used when calculating the Well on Deliverability flow. If the well will
use k*h or Uniform options to distribute the flow, then the completion interval does not need to
correspond to the gridlines.
66
Boundary and Initial Conditions
Figure 9.7: Well completion interval in 3D View
Select the appropriate production or injection options under the Flow tab. When flow rates are
specified, the number is for the entire well. Flow into each cell the well intersects is apportioned either
by k*h (permeability*height) or uniformly. If k*h is used, the total k*h is calculated for the entire well
and then the flow into each cell is determined by the permeability and height (intersection length) for
that cell. Using this approach, more flow is injected (produced) into cells with higher permeability. The
uniform distribution proportions flow by the intersection length of each cell. In either of these cases,
PetraSim creates individual sources/sinks for each cell intersected by the well. These sources/sinks are
independent of each other.
For the Well on Deliverability option, the user can select the Well Model or User Defined gradient. The
Well Model option activates the TOUGH2 well on deliverability model, where the pressure gradient is
calculated using a depth dependent flowing density in the wellbore (see the TOUGH2 user manual). In
this case, the specified pressure corresponds to the pressure at the center of the top cell in the well. If
the User Defined gradient is selected, the pressure is that at the top of the completion interval and the
user specifies the gradient directly. For both cases, follow the TOUGH2 guidelines for calculating the
Productivity Index.
Output for the well can be controlled under the Print Options tab.
Time-Dependent Essential (Direchlet) Boundary Conditions
Although TOUGH2 provides an easy way to set constant essential (Dirichlet) boundary conditions using
the "Inactive" cell option, there is no similar provision for time-dependent boundary conditions. There
are two reasons for this decision:

This places a significant burden on the user to ensure that all specified states would be
physically meaningful.
67
Boundary and Initial Conditions

"The user could get into terrible problems when phase compositions change in the boundary
cell, because then primary variables get switched. The user could end up interpolating between
one number that means temperature, and another that means saturation." (15)
The alternate approach is to rely on TOUGH2 to handle any phase change by injecting or withdrawing
mass and/or heat from boundary condition cells, thus using natural (Neumann) boundary conditions to
obtain the desired essential boundary conditions in the cell. However, since this is an indirect way to
accomplish the desired goal, the user needs some guidance on how to accomplish this.
The boundary condition cells should be thought of as cells that are not part of the solution. Therefore,
we can set material properties and other parameters in ways that are not tied to the actual problem to
be solved. The following sections describe some useful "tricks."
Use a Very Large Volume
The first concept is to make the volume of the cell with the boundary condition "very large" relative to
the other cells in the grid. There is no absolute definition of "very large" but the concept is that the
volume should be so large that flow in and out of the boundary condition cell to model cells will have
negligible effect on temperature or pressure in the boundary condition cell. A typical value could be a
volume of 1.0E50 m3. In PetraSim, this can be accomplished by setting the volume multiplication factor
to a large number (see Editing Cells).
Setting a Temperature Condition
For a simple temperature boundary condition, we do not want flow into or out of the cell. This can be
accomplished by making a special material that has zero permeability and small porosity and applying it
to this cell. It is also necessary that the connections between the temperature boundary condition cells
and the other cells in the model have a non-zero length in the boundary condition cell. The use of zero
permeability and small porosity has two effects:


Because of the small porosity, calculating the necessary heat input/output to change the cell
temperature is easy, since there is negligible fluid in the cell and the rock specific heat can be
assumed for the entire cell.
Because of zero permeability, no fluid will flow from this cell into any connected cells (the nonzero length connections are also necessary). Note: Although zero permeability is the correct
approach, the user should be aware that for upstream weighting of absolute permeability
(MOP(11) = 0 or 1), it is still possible to force flow into a cell with zero permeability and non-zero
nodal distance (15).
The user then sets the desired initial temperature and then specifies the heat flow into (or out) of the
cell to obtain the desired change in boundary condition cell temperature.
This method is directly applicable in PetraSim.
68
Boundary and Initial Conditions
Setting a Pressure Boundary Condition
Setting a pressure boundary condition can be accomplished in a similar manner as that used to set a
temperature. In this case, a new material is created with zero thermal conductivity and assigned to the
cell. As before, it is also necessary that the connections between the temperature boundary condition
cells and the other cells in the model have a non-zero length in the boundary condition cell. The
pressures in the cell can now be controlled by flow into and out of the cell (see the following example).
This method is directly applicable in PetraSim.
Caution: If the specified pressure results in flow from the boundary condition cell to model cells, the heat
transported by that flow will affect the temperature in the model cells.
Combined Pressure and Temperature Boundary Conditions for Single Phase Liquid
Experienced TOUGH2 users often apply simultaneous temperature and pressure boundary conditions by
creating two boundary condition cells, as described above, and then connecting both boundary
condition cells to the same cell in the model. TOUGH2 accommodates this, since it is not required that
connections represent physically meaningful geometries. PetraSim supports this option through the use
of "extra cells."
In the following we describe a way to accomplish the same objective, but using only physically
meaningful geometry. This method also handles the combined pressure and temperature conditions in
a way that usually corresponds to the desired physical behavior with respect to heat transport by flow
out of the boundary condition cell.
Setting combined pressure and temperature boundary conditions will use the following concepts:






A "very large" volume in the boundary condition cell. Consequently, heat or mass flow to
connected model cells will have negligible effect on the temperature or pressure in the
boundary condition cell.
A "somewhat larger" permeability in the boundary condition cell (maybe 1000 times the normal
value). This allows fluid flow into or out of the boundary condition cell and ensures that the
pressure drop in the boundary condition cell will be approximately zero. Note: Pruess does not
recommend changing the permeability due to possible numerical problems, but instead
suggests changing the nodal distance to be small (1.0E-10).
A "small" value for the porosity of the boundary condition cell. As a result, the rock heat
capacity can be used to calculate the required heat flow to change temperatures.
A "large" value of pore compressibility. This means that water compressibility can be neglected
in the calculation of pressure changes due to flow into or out of the boundary condition cell and
that changes in volume due to temperature changes will have negligible effect on pressure.
Specification of heat flow to the boundary condition cell to obtain the desired time-dependent
boundary temperature.
Specification of fluid flow to the boundary condition cell to obtain the desired time-dependent
boundary pressure.
69
Boundary and Initial Conditions
Multi-Phase Pressure and Temperature Boundary Conditions
For multi-phase conditions, the pore compressibility can be left as zero, since the gas phase will serve
the same purpose. The flow to control pressure would use the gas phase and would need to account for
the mixture compressibility.
Solution Controls
The solution cannot resolve transients to a level finer than the time step. Therefore, it is necessary to
limit the maximum time step. For example, if the period of a transient is one day, it will be necessary to
divide the day into several time steps (5 to 10) to capture the transient response.
By default, TOUGH2 averages the flow data at the beginning and end of the time step. This is fine if the
transient is smooth and several time steps are used during to resolve the transient. If larger time steps
are used, it is important to activate the rigorous step rate option (In PetraSim, Solution
Controls/Options).
Example
The following example is based on a desire to specify time-dependent temperatures and pressures that
represent the conditions for a stream in a groundwater calculation. The desired values are given in
Figure 9.8 and Figure 9.9.
Figure 9.8: Desired boundary conditions
70
Boundary and Initial Conditions
Figure 9.9: Graph of desired boundary conditions
For the example, create a cell with dimensions of 1 m on each side, but set the volume factor to be
1.0E50. We set the material properties as Figure 9.10.
Figure 9.10: Desired boundary conditions
We calculate the heat flux as follows:
̇
where ̇ is the heat flux, is the cell volume, is the rock density, is the rock heat capacity,
is the
change in temperature, and is the change in time. Note that since the porosity is very small, we only
use the rock properties and apply this to the entire cell volume. The calculated values are shown in
Figure 9.11.
71
Boundary and Initial Conditions
Figure 9.11: Calculated heat flux
Similarly, we calculate the required fluid flow rates using:
̇
where
is the density of water, is the porosity, is the pore compressibility, and
change in pressure. The calculated values are shown in Figure 9.12.
is the
Figure 9.12: Calculated flow rates
These are input to TOUGH2. Note that this is a bit tricky, since injection and production must both be
set on the same cell. This means that two separate conditions must be set. The injection for flow in and
72
Boundary and Initial Conditions
the production for flow out. Set these terms zero when the other is acting, that is, during injection, the
production is zero and during production the injection is zero.
The resulting plots show excellent agreement between temperatures, and not quite as good agreement
for pressures.
Figure 9.13: Comparison of desired and calculated boundary condition temperatures
Figure 9.14: Comparison of desired and calculated boundary condition pressures in TOUGH2
These concepts are described in an example problem available on the PetraSim web site.
73
Solution and Output Controls
10. Solution and Output Controls
Solution Controls
The Solution Controls dialog allows the user to specify all aspects that will be used by TOUGH in solving
the problem. To set these controls, select Analysis->Solution Controls… or
to open the Solution
Controls dialog.
Times Tab
Select the Times tab, Figure 10.1. This tab is used to input all data related to solution times and time
step control.
Figure 10.1: The Times tab controls



Start Time - The start of the analysis. In most cases this will be 0.0.
End Time - The end time of the analysis. Usually specified, but can be set to infinite and then
solution will run for the Max Num Time Steps
Time Step - User control of the time steps. If Automatic Time Step Adjustment is enabled
(recommended), this is the initial time step used in the analysis. The user can also specify a
table of time steps for the solution. If a list of time steps is given, the last time step will be used
until the End Time is reached. If the user has selected to define the time steps in a table and
enabled Automatic Time Step Adjustment, the specified table of time steps is used first, with
74
Solution and Output Controls







automatic adjustment after if the number of solution time steps exceeds the number of time
steps in the list.
Max Num Time Steps - The maximum number of time steps for the solution. If this number is
exceeded, the analysis ends.
Max CPU Time - A control to limit the maximum CPU time used in the analysis. If this number is
exceeded, the analysis ends
Max Iterations per Step - The maximum number of iterations for a time step. If exceeded and
Automatic Time Step Adjustment is enabled, then time step will be reduced.
Automatic Time Step Adjustment - If selected, the time step size will be automatically adjusted
(recommended).
Max Time Step - Maximum time step that will be used when adjusting the time step.
Iter. to Double Time Step - If convergence is reached in this number of iterations, then time step
size will be increased.
Reduction Factor - If convergence fails in Max Iterations per Step, then time step will be
reduced by this factor.
Solver Tab
Select the Solver tab, Figure 10.2. TOUGH provides conjugate gradient and direct solvers, with several
options. The user can select the solution method and options for that method. Either the
Preconditioned Bi-Conjugate Gradient (default) or Stabilized Bi-Conjugate Gradient methods are
recommended.
75
Solution and Output Controls
Figure 10.2: The Solver tab controls
TOUGH2-MP Tab (TOUGH2-MP license only)
Select the TOUGH2-MP tab, Figure 10.3. These are options for the TOUGH2-MP simulator. The
Additional N/R iterations after convergence option controls the value of MOP(21) in record PARAM.1.
The simulator can be set to perform one additional Newton-Raphson iteration after convergence if
needed.
76
Solution and Output Controls
Figure 10.3: The TOUGH2-MP tab controls
Weighting Tab
Select the Weighting tab, Figure 10.4. This tab provides several options about the weighting in
calculations at interfaces.
77
Solution and Output Controls
Figure 10.4: The Weighting tab controls
The Upstream Weighting Factor is used to calculate mobilities and enthalpies at interfaces, and must be
a value from 0 to 1. The Newton-Raphson Weighting Factor is used to calculate increments in NewtonRaphson iteration, and must be a value from 0 to 1.
Convergence Tab
Select the Convergence tab, Figure 10.5 to edit the Relative Error Criterion and Absolute Error Criterion.
For more information on these values, see the TOUGH2 User’s Guide.
78
Solution and Output Controls
Figure 10.5: The Convergence tab
Options Tab
Select the Options tab, Figure 10.6. This tab allows the selection of various other options provided by
TOUGH2.
79
Solution and Output Controls
Figure 10.6: The Options tab controls




Composition of Produced Fluids - The relative amounts of phases in the produced fluid are
determined either according to the relative mobilities in the source element or the same as the
producing element.
Heat Conductivity Interpolation - The interpolation formula for heat conductivity as a function
of liquid saturation (Sl).
Boundary Condition Interpolation -The interpolation procedure for time dependent sink/source
data (flow rates and enthalpies).
Derivative Increment Factor – The increment factor for numerically computing derivatives.
Output Controls
The Output Controls dialog allows the user to specify output options. To set these controls, on the
Analysis menu, click Output Controls… ( ), see Figure 10.7.
80
Solution and Output Controls
Figure 10.7: Output controls dialog
Output Controls options include:




Print and Plot Every # Steps - Output will be written at the specified time step increment.
Additional Print and Plot Times - This opens a table in which you can give specific times at
which output is desired.
Additional Output Data - Select fluxes and velocities to have the output data necessary to
include flux arrows in the 3D plots. Selecting Primary Variables is usually only used for
debugging purposes.
Additional Printout - These options are usually only used for debugging purposes.
81
Running Simulation
11. Running Simulation
Running a Simulation
To run a simulation: on the Analysis menu, click Run TOUGH2 ( ). This will first save the PetraSim
model file and then the Running TOUGH2 dialog will be displayed, Figure 11.1.
The Running TOUGH2 dialog displays simulation time steps on the X-axis and the log of the time step on
the Y-axis. As a rule of thumb, a growing time step is a good sign of simulation progress. If your time
steps start to become smaller, it may indicate that the simulator is having a difficult time converging.
When the simulation finishes, a message will be displayed and the Cancel button will turn into a Close
button. Click the Close button.
Figure 11.1: Running the TOUGH analysis
Setting TOUGH2 Analysis Priority
A TOUGH2 analysis makes heavy demands of the computer processor; if you are running a single core
computer, you may want to reduce the priority of the TOUGH analysis. Start the Task Manager
(Ctrl+Alt+Delete or right-click on the lower toolbar). On the Processes tab, click on CPU to sort by the
process using the most CPU (you many need to click twice to bring highest CPU users to the top of the
list). You will see a process such as "EOS7.exe". Right-click on the process, select Set Priority and select
Low. Close the dialog.
82
Running Simulation
Setting the priority low will keep your computer response snappy to other tasks and allow the CPU to
support the TOUGH analysis when not needed for other tasks.
Monitoring Progress of TOUGH Analysis
During the TOUGH analysis, there are several ways to monitor progress. One way is to go to the
problem directory and, using a text editor, open the *.out file as it is written by TOUGH. In this file will
be text similar to the following:
********************************************************
260( 21, 3) ST = 0.209715E+09 DT = 0.104858E+09
365( 22, 3) ST = 0.419430E+09 DT = 0.209715E+09
51( 23, 4) ST = 0.838861E+09 DT = 0.419430E+09
216( 24, 4) ST = 0.125829E+10 DT = 0.419430E+09
258( 25, 4) ST = 0.167772E+10 DT = 0.419430E+09
The first number is the ID of the cell with the smallest time step. The first number in the parentheses is
the time step counter and the second number is the number of iterations required for that step to
converge. ST is the total solution time. DT is the solution time increment.
Writing the Input File
Most users will not need to explicitly save a input file, since this is automatically written when the
analysis is performed. However, if you are using a special executable, you can save the input file
without attempting to run a simulation. To save the input file(s): on the File menu, click Write TOUGH2
File... to write the input file. If you are using another simulator (e.g. TOUGHREACT) the name of this
action will be slightly different.
This file can then be edited (if necessary) and used to run your custom simulator from the command
line. The results of custom compiles are not generally compatible with PetraSim's results visualization
system. If you would like suggestions on how to modify custom binaries to generate PetraSimcompatible output, please contact technical support.
Running TOUGH2-MP
TOUGH2-MP is a parallel version of TOUGH2 providing several improvements to the TOUGH2 code,
including support for multiple processors and multiple machines, which can significantly reduce the time
needed to run simulations. It also removes the cell count and cell connection limitations in TOUGH2,
allowing multi-million cell problems.
Support for TOUGH2-MP is seamlessly integrated into PetraSim and can be purchased for nearly all EOS’.
PetraSim supports TOUGH2-MP by running several processes on a single-computer with multiple cores.
The number of processes to be used for TOUGH2-MP simulations may be specified in the Preferences
dialog by going to the File menu and selecting Preferences…. By default, PetraSim will start TOUGH2MP with as many processes as there are cores on the current PC. For instance, if the PC contains two,
four-core processors (eight total), PetraSim will use eight processes to run the simulation.
83
Running Simulation
TOUGH2-MP is run similarly to TOUGH2: after setting up the problem, under the Analysis menu, select
Run TOUGH2-MP ( ). The same progress dialog is used to monitor the simulation as shown Figure
11.1. Viewing results is the same as in TOUGH2.
84
Plotting Results
12. Plotting Results
PetraSim reads the TOUGH output files to make plots of results. The user can make 3D or time history
plots of the data. When a plot is displayed, selecting File/Export Data... will allow the user to export the
current plot data in either Tecplot or spreadsheet format.
3D Plots of Results
To make a 3D plot of results: on the Results menu, click 3D Results... ( ). This will open a new window
with a display of the model and pressure isosurfaces at the first output time, Figure 12.1.
Figure 12.1: The 3D results window
Plot controls include:




Time (s) - A window that displays all the available output times. Select one of these times for
plotting.
Scalar - Select the output parameter for plotting. The scalar parameter is the one that will be
used for isosurfaces and contours on slice planes. The list of parameters is dynamically created
from the TOUGH output file and will be different for each EOS.
Vectors - If vector data was written to the output (this must be selected as one of the Output
Controls options), this will display a list of available vector data. The list of parameters is
dynamically created from the TOUGH output file and will be different for each EOS.
Show Isosurfaces - This checkbox turns on the display of isosurfaces for the selected scalar. The
number indicates how many isosurfaces will divide the plot range. Selecting the Scalar
85
Plotting Results


Properties... button displays a dialog, Figure 12.2, on which you can specify a specific plot range,
choose to use a logarithmic scale, and specify the number of colors used on contour plots.
Show Vectors - If vector information is available, selecting the checkbox will turn on the display
of vector data, Figure 12.3. The Vector Scale controls the scaling factor applied to the vectors
and the Vector Size Range controls the relative size of the longest to shortest vectors. By
default, both the relative size and color of the vectors correspond to the magnitude of the
vector. Moving the Vector Size Range to the left will result in all vectors having the same length.
Selecting the Vector Properties... button displays a dialog, Figure 12.4, in which the user can set
the range for vectors and choose whether the vector color should indicate the magnitude.
Show Slice Planes - Turns on slice planes on which contours of the scalar parameter are
displayed. Select the Slice Planes... button to define the axes normal to the planes and the
coordinates of the planes, Figure 12.5. Typical plots are shown in Figure 12.6. You can also view
the slices as discrete values per cell as shown in Figure 12.7 by selecting Color Slices by Cell.
Figure 12.2: Scalar Properties dialog
86
Plotting Results
Figure 12.3: 3D Vector results
Figure 12.4: Vector Properties dialog
87
Plotting Results
Figure 12.5: Slice Planes dialog
Figure 12.6: Example of contours on slice planes
88
Plotting Results
Figure 12.7: Slice contours colored by cell
To write a file that can be read into Tecplot: on the File menu, click Export Data... The format of the
data will be a value and then the X, Y, and Z coordinates. The data can be written either at the center or
corners of each cell.
Line Plots of Results
A line plot, an XY plot of a variable along a line, can also be made from the 3D Results window. Such a
plot would be used to plot temperature along a well. To make a line plot, first open a 3D Results window
as discussed in 3D Plots of Results.
To make a line plot
1. On the File menu of the 3D Results window, click Line Plot....
2. In the Point 1 coordinate boxes (X, Y, and Z) type the coordinates of the starting point of the
line.
3. In the Point 2 coordinate boxes (X, Y, and Z) type the coordinates of the ending point of the line.
4. Click OK to close the Line Plot dialog.
5. This will open a Line Plot window.
6. In the Variable list, select the variable for plotting.
7. In the Time list, select the time for which you want to plot the data.
An example is shown in Figure 12.8. You can export this data to a comma separated value file for import
into a spreadsheet.
89
Plotting Results
Figure 12.8: Example line plot
Time History Plots of Results
To make a time history plot: on the Results menu, click Cell History Plots… (
window shown in Figure 12.9.
). This will open the
Figure 12.9: Example time history plot
You can select the variable and cell to plot. The Cell Name is the name given to the cell in the Edit Cells
dialog. Time history plotting for a cell is also activated in Edit Cells dialog.
90
Plotting Results
By default, only the cells for which time history data have been requested or which have been given a
name are listed. To expand the list to show all cells: on the View menu, click All Cells. When all cells are
selected, data will only be available at the times in the standard output file. For cells for which time
history output was specified, the results are available at each time step.
Source/Sink and Cell History Plots
This section explains the flow plots created by PetraSim and how to obtain time histories of cells that
have sources or sinks.
The model used as an example represents production from a highly permeable layer at about 500m
depth (average P = 5 MPa, constant T = 25 ºC, single-phase conditions). The model uses EOS1 and
extends for 500x500x20m with a grid of 10x10x4 cells. An initial hydrostatic solution was run. In the
production run, two of the boundaries are set to a fixed state and cell 169 uses a Well on Deliverability
condition with a Productivity Index of 6.0E-9 and a Pressure of 5.0E6 Pa.
Figure 12.10: Plot of production flow
The most important piece of information for a source or sink is the flow rate into/out of the cell. On the
Results menu, click Source/Sink Plots..., Figure 12.11. To make this plot, the Y Scale Range was adjusted
to Min Y = -135.2, Max Y = 0.0 (use View->Range...). This plot indicates that the production rate is 135.0
kg/sec.
91
Plotting Results
Figure 12.11: Plot of production from cell 169
This information can be verified by looking at the TOUGH2 output file. At the end of every printed time
step, the source/sink (generation) data is given, as shown below. This data shows that the generation
rate is -135.0 kg/s, which matches the PetraSim plot.
TOUGH2 Analysis
KCYC =
20
-
ITER =
1
-
TIME = 0.63070E+08
ELEM SRC INDEX
GENERATION RATE
(KG/S) OR (W)
169
-0.13500E+03
1
1
ENTHALPY
(J/KG)
0.10940E+06
X1
X2
0.10E+01
0.00E+00
To understand the cell history flow plots it is necessary to know the cell names and connections. Figure
12.12 shows the cells names and how they are physically connected for the cells adjacent to cell 169.
The production cell is 169 and it is connected to adjacent cells in layer 2 and to cell 48 in layer 1 and cell
290 in layer 3.
Figure 12.12: Connections for cell 169
We will first focus on the flow plot for cell 170, since that is the simplest. To see the plot shown in
Figure 12.13:
92
Plotting Results
1. On the Results menu, click Cell History Plots...
2. On the View menu, click All Cells..., then select FLOF(X) for cell #170
Select File->Export Data... to view the numerical value of -0.029 kg/s-m2.
Figure 12.13: Plot of FLOF(X) for cell 170
The flow data plotted in the Cell History plot is the flux averaged at that cell. If we go to the output file,
we can obtain the actual values of flow for each connection. A part of the file is shown below.
EL1
EL2
INDEX
169
170
171
172
173
170
171
172
173
174
385
386
387
388
389
FLOH
(W)
0.107373E+07
0.513309E+06
0.340934E+06
0.268545E+06
0.233448E+06
FLOH/FLOF
(J/KG)
0.109403E+06
0.109404E+06
0.109404E+06
0.109405E+06
0.109405E+06
FLOF
(KG/S)
0.981440E+01
0.469187E+01
0.311627E+01
0.245460E+01
0.213379E+01
FLO(GAS)
(KG/S)
0.000E+00
0.000E+00
0.000E+00
0.000E+00
0.000E+00
FLO(AQ.)
(KG/S)
0.981440E+01
0.469187E+01
0.311627E+01
0.245460E+01
0.213379E+01
FLO(WTR2)
(KG/S)
0.000E+00
0.000E+00
0.000E+00
0.000E+00
0.000E+00
For the connection between cells 169 and 170, the flow is 9.81 kg/sec. For the connection between cell
170 and 171, the flow is 4.69 kg/sec. To calculate the average X flux at cell 170, we average the two
flows and divide by the area between the cells (250 m2 since the cell face width is 50m and the cell
height is 5m). The resulting value is 0.029 kg/s-m2, which matches Figure 12.11.
In the plot the negative sign indicates that the X flux is in the negative X direction. This is consistent with
the positive connection sign convention used by TOUGH2. For a connection between cell 1 and cell 2, a
negative FLOF indicates a flow from cell 1 to cell 2. A positive FLOF indicates flow from cell 2 to cell 1.
We now look at the more complex case of flow into cell 169, which is a production cell. To see the plot
shown in Figure 12.14:
1. On the Results menu, click Cell History Plots...
93
Plotting Results
2. In the Variable box, click FLOF(X)
This is a graph of fluid flux in the X direction at cell 169. The value is -0.00368 kg/s-m2. To view specific
values: on the File menu, click Export Data....
Figure 12.14: FLOF(X) plot for cell 169
If we look in the output file, we will find the following data for the connections, Table 12.1.
Table 12.1: Data for connections to cell 169
Connection
FLOF
168->169
-7.97
169->170
9.81
158->169
-7.95
169->180
9.95
48->169
-34.32
169->290
64.98
Using these values and the sign convention for flows, the flows into cell 169 are represented in Figure
12.15.
94
Plotting Results
Figure 12.15: Flows into cell 169
If we sum these flows, the total is 135.0 kg/sec, consistent with previously discussed source/sink data.
Since this cell is a production cell, there is flow in from the left and in from the right. The average X flux
is then ((7.97-9.81)/2)/250 = -0.00368 kg/s-m2, which matches Figure 12.14.
Thanks to Hildenbrand Alexandra for providing this model.
Well Plots
Well plots are used to show the accumulation of cell quantities for entire wells. Well plots can be
enabled by opening the Edit Well dialog as discussed in Using Wells in PetraSim, and under the Print
Options tab, select “Print Time Dependent Flow and Generation (BC) Data.”
Well plots can be viewed after a simulation by opening the Results menu and selecting Well Plots.
PetraSim calculates various quantities for wells based on the individual cell results for the well, including
the following:


Flow Rate –the total flow rate into/out of the well, calculated as ∑
.
Flow Rate – Liquid – the total flow rate of liquid into/out of the well, calculated as
∑
(
).

Flow Rate – Gas – the total flow rate of gas into/out of the well, calculated as ∑

Energy – the total thermal energy moving into/out of the well, calculated as ∑
where n is the number of cells in the well,
gas, and
is the enthalpy.
is the flow rate in the
th
cell,
.
.
is the flow fraction of
General Use of the Comma-Separated Value (CSV) Files
In Version 4.0 of PetraSim a significant change was made in how output data is accessed for plotting.
The TOUGH2 source code was modified to output all data in comma separated value (CSV) format. This
approach made plotting significantly more robust. It also provides the user with direct access to results
data. The output mirrors the data output in the standard TOUGH2 output file.
The following files are available in CSV format:
95
Plotting Results





mesh.csv – This file includes output for each cell for each output variable for all solution output
times.
conn.csv – This file includes output for each connection between cells for each output variable
for all solution output times.
foft.csv – If individual cells are selected for additional output, data is written to this file for those
specific cells for every time step.
coft.csv – If individual connections are selected for additional output, data is written to this file
for those specific connections for every time step.
goft.csv – This file includes output for each source/sink in the model.
If the user imports a CSV file into a spreadsheet, the filter options in the spreadsheet can be used to
focus on specific details in the data. The CSV format also makes it easy for the user to write their own
programs to read and manipulate the data.
96
Flow in Fractured Media
13. Flow in Fractured Media
The MINC Approach
TOUGH uses the "Multiple INteracting Continua" (MINC) method to approximate modeling fluid and
heat flow in fracture-porous media. As described in (16), "The method is applicable to flow processes in
which an important aspect is the exchange of fluid, heat, or chemical species between fractures and
unfractured rock. ... MINC can only be applied to media in which the fractures are sufficiently well
connected so that a continuum treatment of flow in the fracture network can be made." If the fractures
are not sufficiently connected, a discrete representation of the fracture should be used with a different
porous material for flow in the fracture. A detailed explanation of MINC is provided in (17).
As described in (16), "The method is an extension of the double-porosity concept, originally developed
by (18) and (19). It is based on the notion that fractures have large permeability and small porosity
(when averaged over a reservoir subdomain), while the intact rock (the rock "matrix") has the opposite
characteristics. Therefore, any disturbance in reservoir conditions will travel rapidly through the
network of interconnected fractures, while invading the matrix blocks only slowly."
MINC is implemented in TOUGH as a mesh processor of the mesh. Additional cells and connections are
created so that matrix blocks are "discretized into a sequence of nested volume elements which are
defined on the basis of distance from the fractures. Continuum #1 represents the fractures, continuum
#2 represents matrix rock in close proximity to the fractures, continuum #3 represents matrix rock at
larger distance, etc. In response to an imposed disturbance in the fracture system, fluid and/or heat can
migrate in the matrix blocks outward towards the fractures, or inward away from the fractures.
For a complete description, the user is referred to (16) and (17), copies of which are available in the help
section of http://www.petrasim.com.
Using MINC in PetraSim
To activate the MINC option in PetraSim: on the Properties menu, click Global Properties... ( ). Click
the MINC tab, Figure 13.1. Select Enable Multiple Interacting Continua (MINC). Then, the input data
corresponds to that given in the TOUGH2 User's Guide.
97
Flow in Fractured Media
Figure 13.1: Activating MINC in PetraSim
Once the MINC option is activated, the user will need to specify the fracture material data on the
Fracture tab of the Material Data dialog. This will be the data used for the fractures. The Matrix data
will be used for the rock matrix.
98
Miscellaneous
14. Miscellaneous
Finding TOUGH2 Options in PetraSim
This map provides a listing of where TOUGH2 variables are accessed in PetraSim. Italics are used to
indicate a menu item. The map is organized following the TOUGH2 User's Guide format. In addition,
one each dialog, the TOUGH name for each input variable is provided.
TITLE
 TITLE - Properties->Global Properties… in Tough Global Data dialog on Analysis tab.
MESHM
This is only used with the MINC option. MINC data is given in Properties->Global Properties… in the
Tough Global Data dialog on the MINC tab.
ROCKS
ROCKS.1 Record
 MAT - Properties->Materials in Material Data dialog.
 NAD - Automatically determined based on user input.
 DROK - Properties->Materials in Material Data dialog.
 POR - Properties->Materials in Material Data dialog.
 PER(I) - Properties->Materials in Material Data dialog.
 CWET - Properties->Materials in Material Data dialog.
 SPHT - Properties->Materials in Material Data dialog.
ROCKS.1.1 Record
 COM - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc tab
Additional Material Data dialog.
 EXPAN - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc
tab Additional Material Data dialog.
 CDRY - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc
tab Additional Material Data dialog.
 TORTX - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc
tab Additional Material Data dialog.
 GK - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc tab
Additional Material Data dialog.
 XKD3 - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc
tab Additional Material Data dialog. Only shown for EOS7R.
 XKD4 - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc
tab Additional Material Data dialog. Only shown for EOS7R.
99
Miscellaneous

FOC - Properties->Materials Select Relative Perm... button in Material Data dialog. On Misc tab
Additional Material Data dialog. Only shown for T2VOC.
ROCKS.1.2 Record
 IRP - Properties->Materials Select Relative Perm... button in Material Data dialog. Automatically
determined from selection on Relative Perm tab of Additional Material Data dialog.
 RP(I) - Properties->Materials Select Relative Perm... button in Material Data dialog. On Relative
Perm tab of Additional Material Data dialog.
ROCKS.1.3. Record
 ICP - Properties->Materials Select Relative Perm... button in Material Data dialog. Automatically
determined from selection on Capillary Press tab of Additional Material Data dialog.
 CP(I) - Properties->Materials Select Relative Perm... button in Material Data dialog. On Capillary
Press tab of Additional Material Data dialog.
ROCKS.2 Record
 Automatically written.
MULTI
Automatically written based on EOS type and EOS options selected on Properties->Global Properties in
Tough Global Data dialog on EOS tab.
START Record
Written automatically.
CHEMP (T2VOC only)
Automatically written for T2VOC based on VOC data specified in Properties->Global Properties in Tough
Global Data dialog on EOS tab.
PARAM
PARAM.1 Record
 NOITE - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 KDATA - Automatically determined from selections on Analysis->Solution Controls in the Print
and Plot Options dialog.
 MCYC - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 MSEC - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 MCYPR - Analysis->Solution Controls in the Print and Plot Options dialog.
 MOP(1) through MOP(7) - Automatically determined from selections on Analysis->Solution
Controls in the Print and Plot Options dialog.
 MOP(9) Analysis->Solution Controls in Solution Parameters dialog on Options tab.
 MOP(10) - Analysis->Solution Controls in Solution Parameters dialog on Options tab.
 MOP(11) - Analysis->Solution Controls in Solution Parameters dialog on Weighting tab.
 MOP(12) - Analysis->Solution Controls in Solution Parameters dialog on Options tab.
100
Miscellaneous















MOP(13) - Not implemented. Used only by T2DM option.
MOP(14) - Analysis->Solution Controls in Solution Parameters dialog on Solver tab.
MOP(15) - Properties->Boundary Conditions in Boundary Conditions dialog.
MOP(16) - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
MOP(17) - Analysis->Solution Controls in Solution Parameters dialog on Solver tab.
MOP(18) - Analysis->Solution Controls in Solution Parameters dialog on Weighting tab.
MOP(19) - Properties->Global Properties in Tough Global Data dialog on EOS tab, as appropriate.
MOP(20) - Not implemented. Used only by EOS4 option.
MOP(21) - Not used. Instead the alternate SOLVR record is used to select the solver. Select the
solver in Analysis->Solution Controls in Solution Parameters dialog on Solver tab.
MOP(22) - Not implemented. Used only by T2DM option.
MOP(23) - Not implemented. Used only by T2DM option.
MOP(24) - Analysis->Solution Controls in Solution Parameters dialog on Weighting tab.
TEXP - Properties->Global Properties in Tough Global Data dialog on EOS tab. Select Molecular
Diffusion and specify on Edit Coefficients dialog. For T2VOC on EOS tab.
BE - Properties->Global Properties in Tough Global Data dialog on EOS tab. Select Molecular
Diffusion and specify on Edit Coefficients dialog.
DIFF0 - Properties->Global Properties in Tough Global Data dialog on EOS tab. Only for T2VOC.
PARAM.2 Record
 TSTART - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 TIMAX - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 DELTEN - Automatically determined based on options selected in Analysis->Solution Controls in
Solution Parameters dialog on Times tab. You can edit the table of time steps.
 DELTMX - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 ELST - Not implemented, instead select cell for printing in Edit Cells dialog.
 GF - Properties->Global Properties in Tough Global Data dialog on Misc tab.
 REDLT - Analysis->Solution Controls in Solution Parameters dialog on Times tab.
 SCALE - Properties->Global Properties in Tough Global Data dialog on Misc tab.
PARAM.2.1, 2.2, etc. Record
 Automatically written if table is used to give time steps in Analysis->Solution Controls in Solution
Parameters dialog on Times tab.
PARAM.3 Record
 RE1 - Analysis->Solution Controls in Solution Parameters dialog on Convergence tab.
 RE2 - Analysis->Solution Controls in Solution Parameters dialog on Convergence tab.
 U - Analysis->Solution Controls in Solution Parameters dialog on Solver tab.
 WUP - Analysis->Solution Controls in Solution Parameters dialog on Weighting tab.
 WNR - Analysis->Solution Controls in Solution Parameters dialog on Weighting tab.
 DFAC - Analysis->Solution Controls in Solution Parameters dialog on Options tab.
101
Miscellaneous
PARAM.4 Record
 This record is not used. Instead, initial conditions for each element are written using the INCON
record, see below.
INDOM
This record is not used. Instead, initial conditions for each element are written using the INCON record,
see below.
INCON
These records are created for each element based on initial condition data. The appropriate data is EOS
dependent. See the Initial Conditions chapter for help with defining initial conditions.
SOLVR
This record is written based on options selected in Analysis->Solution Controls in the Solution
Parameters dialog on the Solver tab.
FOFT
The FOFT record defines a list of cells for which output data will be written to a file every time step. This
record is written automatically by PetraSim, based on the cells that have been selected for detailed
printing.
To select a cell for output, open the Edit Cells dialog (see Editing Cells). Go to the Print Options tab. Use
the check box to turn on printing. In the Properties tab, you can give the cell a name that will be
displayed in the plot. After the analysis is completed and a time history plot made, the data can be
written to a file for import into a spreadsheet.
GOFT
Automatically written for all sources and sinks.
NOVER
NOVERsion Record
 Analysis->Output Controls in Output Controls dialog.
DIFFU
DIFFUsion Record
 All diffusion data is input from Properties->Global Properties in the Tough Global Data dialog on
the EOS tab. Select Molecular Diffusion and then the Edit Coefficients button and dialog. Not
valid for T2VOC.
SELEC
SELECtion Record
 Automatically written from data input on Properties->Global Properties in the Tough Global Data
dialog on the EOS tab.
102
Miscellaneous
RPCAP
This record is not used. Instead, all data is written as part of ROCKS record.
TIMES
TIMES Record
 A table of output times can be specified in Analysis->Output Controls in the Output Controls
dialog. These times are then written to the TIMES record.
ELEME
All element (cell) data is written based on the grid defined by the user.
CONNE
All connection data is written based on the grid defined by the user.
GENER
The GENER record defines a list of cells with source or sink boundary conditions. See 0.
103
Troubleshooting
15. Troubleshooting
Convergence Problems
It is inevitable that some of the analyses you run will stop execution before your specified end time.
Usually this is because of convergence problems during the solution.
Diagnosing TOUGH2 convergence problems is not a trivial task. It requires that you view TOUGH2's
output file directly and understand the relationship between the printed output and the solver over
time. When problems can't execute a single time step, this process is a bit easier because there is
usually some indication of the erroneous input. However, when the simulation runs for several time
steps before failing to converge (usually following a rapid sequence of time step size reductions) it is
necessary to understand what transient change caused the problem.
Following is the step-by-step process used to look at one user's convergence problems. The user was
learning about PetraSim and TOUGH2, so was developing the skills needed to run analyses.
STEP 1: Open the OUT file and look for messages printed before the data for the last time step. This will
be before the text "THE TIME IS", so you can search for that text. A sample is copied below. DT is the
time step and you can see that it has gotten very small -- 0.0488 sec. We also see that it cannot find the
parameters for element 11126 and the problem is that the TEMPERATURE is out of range in SAT. The
TEMPERATURE value is 0.999, so it looks like something is cooling down to freezing and TOUGH2 cannot
handle that (the new TOUGH-FX version can handle freezing). Jump to step 2.
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 144, 1]
TEMPERATURE = 0.999981E+00 OUT OF RANGE IN SAT
+++++++++
CANNOT FIND PARAMETERS AT ELEMENT *11126* IND = 4
+++++++++
XX(M) = 0.118536E+06 0.549628E+00 0.999981E+00
+++++++++ REDUCE TIME STEP AT ( 144, 1) ++++++ NEW DELT = 0.488281E-01
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 144, 1]
11126( 144, 1) ST = 0.176848E+05 DT = 0.488281E-01 DX1= 0.000000E+00 ...
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 145, 1]
TEMPERATURE = 0.999996E+00 OUT OF RANGE IN SAT
+++++++++
CANNOT FIND PARAMETERS AT ELEMENT *11126* IND = 4
+++++++++
XX(M) = 0.118536E+06 0.549627E+00 0.999996E+00
+++++++++ REDUCE TIME STEP AT ( 145, 1) +++++
NEW DELT = 0.244141E-01
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 145, 1]
11126( 145, 1) ST = 0.176848E+05 DT = 0.244141E-01 DX1= 0.000000E+00 ...
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 146, 1]
11126( 146, 1) ST = 0.176849E+05 DT = 0.488281E-01 DX1= 0.000000E+00 ...
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 147,
TEMPERATURE = 0.999996E+00 OUT OF RANGE IN SAT
+++++
CANNOT FIND PARAMETERS AT ELEMENT *11126* IND = 4
+++++
XX(M) = 0.118536E+06 0.549627E+00 0.999996E+00
1]
+++++ CONVERGENCE FAILURE ON TIME STEP # 147 WITH DT = 0.976562E-01 SECONDS,
FOLLOWING TWO STEPS THAT CONVERGED ON ITER = 1
STOP EXECUTION AFTER NEXT TIME STEP
+++++ REDUCE TIME STEP AT ( 147, 1) +++++++++++
NEW DELT = 0.244141E-01
104
Troubleshooting
QQQQQQQQQQ SUBROUTINE QU QQQQQQQQQQQQQQQQQQQQ --- [KCYC,ITER] = [ 147, 1]
11126( 147, 1) ST = 0.176849E+05 DT = 0.244141E-01 DX1= 0.000000E+00 ...
TOUGH2 Analysis
OUTPUT DATA AFTER ( 147, 1)-2-TIME STEPS
THE TIME IS 0.20469E+00 DAYS
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
TOTAL TIME
KCYC
ITER ITERC
KON
0.17685E+05
147
1
689
2
DX1M
DX2M
DX3M
DX4M
DX5M
DX6M
0.00000E+00 0.00000E+00 0.00000E+00
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ELEM.
1
2
3
INDEX
P
(PA)
T
(DEG-C)
SG
SW
SO
1 0.42499E+06 0.20003E+02 0.00000E+00 0.10000E+01 0.00000E+00
2 0.42344E+06 0.20003E+02 0.00000E+00 0.10000E+01 0.00000E+00
3 0.42299E+06 0.20003E+02 0.00000E+00 0.10000E+01 0.00000E+00
STEP 2. Go to the bottom of the OUT file and do an upward search for 11126 with the intent of finding
out the current state of that cell. However, the first hit is at the source/sink output and is listed below.
So knowing that cell 11126 is a source/sink with a generation rate, the first guess is that the generation
rate is larger than can be supported by the flow into the cell and as a result pressure and temperature
are dropping in that cell. Go to step 3.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
TOUGH2 Analysis
KCYC =
147
-
ITER =
1
-
TIME = 0.17685E+05
ELEMENT SOURCE INDEX TYPE GENERATION RATE ENTHALPY
(MOLE/S) OR (W) (J/MOLE)
FF(GAS)
FF(AQ)
11126
1
1 COM1
0.22003E+03 0.00000E+00
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
STEP 3: Continue the search for 11126 to get the state of the cell until we find the P, T, etc data, as given
below (the last line is for cell 11126). This confirms that the temperature is dropping. The saturation of
gas is also lower in this cell. So now let us go and look at the cell in more detail. Go to step 4.
ELEM.
111 4
111 5
111 6
111 7
111 8
111 9
11110
11111
11112
11113
11114
11115
11116
11125
11126
INDEX
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
P
(PA)
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.10102E+06
0.11854E+06
T
(DEG-C)
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19999E+02
0.19987E+02
0.10000E+01
SG
SW
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87874E+00
0.87838E+00
0.45037E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12126E+00
0.12162E+00
0.54963E+00
105
SO
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
0.00000E+00
Troubleshooting
STEP 4: Now we need to find the cell in the model. Cells are numbered in X,Y, Z order starting at the
bottom layer. This example model has 36 cells in the X directly and 39 in the Y, so each layer has
36*39=1404 cells. If we divide 11126 by 1404, we get 7.9, which means this cell is in layer 8. We now
go to layer 8 in the Grid Editor and see the cell with the Source/Sink in the upper left corner. Zoom in
and right-click on the cell. Under Properties the cell ID is 11126, so this is the problem cell. Under
Sources/Sinks we see that the user is injecting Water/Steam into this cell at a rate of 3.9 kg/s but with
0.0 enthalpy. BINGO! - zero enthalpy corresponds to water at absolute zero, so the cell is being cooled
by very cold injection. We need to change the enthalpy to a realistic value. This means getting out the
steam tables. You can either get out the old thermodynamics text or you can download an Excel
spreadsheet from the Tools section of Help at our website at:
http://www.thunderheadeng.com/petrasim.html.
Below is the steam table data for a temperature of 250 C and pressure of 2MPa (482 F and 290 psia).
The enthalpy is 2901869.965 J/kg and the quality is pure vapor. So doing the calculation with this
enthalpy would represent steam injection. Go to step 5.
Input Data Here
Input (Do not change)
Temperature, C
250.00
Pressure, Pa (abs) 2.00E+06
Quality, 0=L, 100=V
Spec volume, m3/kg
Enthalpy, J/kg
Entropy, J/kg/C
English Units
Output
Temperature, C 250.00
Pressure, Pa 2.00E+06
Quality, 0=L, 100=V 100.00
Spec volume, m3/kg 0.111450802
Enthalpy, J/kg 2901869.965
Entropy, J/kg/C 6544.287025
Tsat, C 212.38
Psat, Pa 3.98E+07
Deg superheat, C 19.85
Deg subcool, C -17.78
Viscosity, Pa-s 1.79E-05
Crit velocity
Density, kg/m3 8.972568916
SG 0.009
Viscosity, poise (P) 1.79E-04
Output
Temperature, F 482.000
Pressure, psia 290.08
Quality, 0=L, 100=V 100.00
Spec volume, ft3/lb 1.7852
Enthalpy, btu/lb 1247.79
Entropy, btu/lb/f 1.5633
Tsat, F 414.3
Psat, psia 576.90
Deg superheat, F 67.7
Deg subcool, F 0.0
Viscosity, lb-sec/ft2 3.74E-07
Crit velocity 1480.67
Density, lb/ft3 0.5602
SG 0.009
Temperature, F 482.00
Pressure, psia 290.08
Quality, 0=L, 100=V 0
Spec volume, ft3/lb
Enthalpy, btu/lb 0
Entropy, btu/lb/f 0
STEP 5: Change the enthalpy to an appropriate value, then try to run again. This might not fix
everything. For example, maybe the rate you are using for injection will be larger than can be supported
by flow to the adjacent cells and the pressure may become too large in the injection cell. This will again
be an indication of an unrealistic problem.
Licensing/Registration Problems
If you experience trouble registering PetraSim, please contact <[email protected]>.
106
Troubleshooting
Contacting Technical Support
Questions and suggestions should be sent to [email protected] or by phone to
+1.785.770.8511.
107
References
1. Pruess, Karsten, Oldenburg, Curt and Moridis, George. TOUGH2 User's Guide, Version 2.0. Berkeley,
CA, USA : Earth Sciences Division, Lawrence Berkeley National Laboratory, November 1999. LBNL-43134.
2. Falta, Ronald, et al., et al. T2VOC User's Guide. Berkeley, CA, USA : Earth Sciences Division, Lawrence
Berkeley National Laboratory, March 1995. LBNL-36400.
3. Pruess, Karsten and Battistelli, Alfredo. TMVOC, A Numerical Simulator for Three-Phase NonIsothermal Flows of Multicomponent Hydrocarbon Mixtures in Saturated-Unsaturated Herogeneous
Media. Berkeley, CA, USA : Earth Sciences Division, Lawrence Berkeley National Laboratory, April 2002.
LBNL-49375.
4. Xu, Tianfu, et al., et al. TOUGHREACT User's Guide: A Simulation Program for Non-isothermal
Multiphase Reactive Geochemical Transport in Variably Saturated Geologic Media. Berkeley, CA, USA :
Earth Sciences Division, Lawrence Berkeley National Laboratory, September 2004. LBNL-55460.
5. Moridis, George, Kowalsky, Michael and Pruess, Karsten. TOUGH-Fx/HYDRATE v1.0 User's Manual: A
Code for the Simulation of System Behavior in Hydrate-Bearing Geologic Media. Berkeley, CA, USA :
Earth Sciences Division, Lawrence Berkeley National Laboratory, February 2005. LBNL-3185.
6. Scheidegger, Adrian. The Physics of Flow Through Porous Media. London : University of Toronto Press
and Oxford University Press, 1957.
7. Versluys, J. 1931, Bull. Amer. Ass. Petrol. Geol., Vol. 15, p. 189.
8. The Interrelation Between Gas and Oil Relative Permeabilities. Corey, A. November 1954, Producers
Monthly, pp. 38-41.
9. A Closed-Form Equation for Predicting the Hydraulic Conductivity of Unsaturated Soils. van
Genuchten, M. 44, 1980, Soil Sci. Soc., pp. 892-898.
10. Committee, International Formulation. A Formulation of the Thermodynamic Properties of Ordinary
Water Substance. Dusseldorf, Germany : IFC Secretariat, 1987.
11. Hirschfelder, C. Curtis and Bird, R. Molecular Theory of Gases and Liquids. New York : John Wiley
and Sons, 1954.
12. Cengel, Yunus and Boles, Michael. Thermodynamics: An Engineering Approach. s.l. : McGraw-Hill,
Inc., 1989. 0-07-101356-9.
13. Edwards, A. L. TRUMP: A Computer Program for Transient and Steady State Temperature
Distributions in Multidimensional Systems. Springfield : National Technical Information Service, 1972.
108
14. An Integrated Finite Difference Method for Analyzing Fluid Flow in Porous Media. Warren, J. E. and
Root, P. J. 12, 1976, Water Resour. Res., pp. 57-64.
15. Pruess, Karsten. Personal communication. 2003. email.
16. —. Brief Guide to the MINC - Method for Modeling Flow and Transport in Fractured Media. Berkeley,
CA, USA : Earth Sciences Division, Lawrence Berkeley National Laboratory, May 1992. LBL-32195.
17. —. A Mesh Generator for Flow Simulations in Fractured Reservoirs. Berkeley, CA, USA : Earth
Sciences Division, Lawrence Berkeley National Laboratory, May 1992. LBL-15227.
18. Basic Concepts in the Theory of Seepage of Homogeneous Liquids in Fractured Rocks. Barenblatt, G.
E., Zheltov, I. P. and Kochina, I. N. 5, 1960, J. Appl. Math. (USSR), Vol. 24, pp. 1286-1303.
19. The Behavior of Naturally Fractured Reservoirs. Warren, J. E. and Root, P. J. 228, s.l. : Transactions,
AIME, September 1963, Society of Petroleum Engineers Journal, pp. 245-255.
109
Index
3
Boundary .................................................................31
Boundary Conditions
Fixed ....................................................................63
Sources and Sinks ................................................64
Transient .............................................................67
Wells ....................................................................65
Initial conditions ..................................................61
Load initial conditions .........................................63
Material data .......................................................98
Miscellaneous material data ...............................58
Output controls ...................................................80
Relative permeability data ..................................56
Save .....................................................................83
Scalar properties .................................................85
Solution controls .................................................74
Tough Global Data (MINC) ..................................97
TOUGH2 simulation run ......................................82
Vector properties ................................................85
Disable Cells .............................................................52
DXF File Format........................................................30
C
E
Capillary pressure ......................................................5
Cell editing ...............................................................50
Cell history plots ......................................................91
Cells .........................................................................52
Comma separated value files ..................................95
Component ................................................................5
Computer hardware requirements ...........................2
Contour File Format .................................................28
Contour Files ............................................................28
Convergence problems ..........................................104
CSV files ...................................................................95
Enabled Cells ............................................................52
Energy balance ..........................................................7
EOS.............................................................................9
Equations of state ......................................................9
Example Problems ...................................................14
Export 3D plot data..................................................89
Extra Cells ................................................................52
3D Plots ....................................................................85
3D View ....................................................................21
A
Assigning different materials by cell ........................59
B
F
Faults .......................................................................40
File
New .....................................................................28
Open ....................................................................28
PetraSim (*.sim) ..................................................28
TOUGH Input (*.dat) ...........................................28
File Format
Contour ...............................................................28
DXF ......................................................................30
Fixed Boundary Conditions ......................................63
Fixed State Cells .......................................................52
Flow in fractured media...........................................97
Flow in Porous Media ................................................3
D
Darcy’s Law ................................................................3
Dialog
Add internal boundary ........................................40
Additional material data .....................................56
Assign cell materials data ....................................59
Boundary editor ..................................................31
Capillary pressure ................................................57
Create mesh ........................................................46
Default initial conditions .....................................61
Edit Cell ...............................................................50
Edit cell data ........................................................62
Edit extra cell .......................................................52
Edit layers ............................................................34
Edit region data ...................................................62
I
Initial conditions ......................................................61
Internal Boundaries .................................................40
110
L
R
Labels .......................................................................26
Layers .......................................................................34
Licensing Problems ................................................106
Line Plots .................................................................89
Loading previous results as initial conditions ..........63
Registration Problems ...........................................106
Relative permeability .................................................4
Results .....................................................................85
3D plots ...............................................................85
Cell history plots ..................................................91
CSV files ...............................................................95
Line plots .............................................................89
Source/Sink plots.................................................91
Time history plots ................................................90
Running a TOUGH2 Simulation ................................82
M
Map of Features ......................................................99
Mass balance .............................................................7
Materials ..................................................................55
MINC ........................................................................97
Monitoring Progress of TOUGH Analysis .................83
Multi-Phase Flow .......................................................3
S
SAVE file ...................................................................63
Setting TOUGH Analysis Priority ..............................82
Solution controls......................................................74
Solution Mesh
Radial ...................................................................49
Regular ................................................................47
Source/Sink plots .....................................................91
Sources and Sinks ....................................................64
Spatial discretization .................................................8
Surface image ..........................................................25
N
New model ..............................................................28
O
Open saved model ...................................................28
Output controls .......................................................74
P
PetraSim Tour ..........................................................15
Phase .........................................................................5
Plots .........................................................................85
3D plots ...............................................................85
Cell history plots ..................................................91
CSV files ...............................................................95
Export 3D plot data .............................................89
Labels ..................................................................26
Line plots .............................................................89
Source/Sink plots.................................................91
Surface image ......................................................25
Time history plots ................................................90
Porous media
Capillary pressure ..................................................5
Darcy's Law ............................................................3
Multi-Phase flow ...................................................3
Relative permeability ............................................4
Porous Media.............................................................3
Purchase ....................................................................1
T
Tecplot .....................................................................89
Time discretization ....................................................8
Time Discretization ....................................................9
Time History Plots ....................................................90
Time-dependent boundary conditions ....................67
Tough Global Data(MINC) ........................................97
Transient boundary conditions ................................67
Tree View .................................................................25
Troubleshooting ....................................................104
Licensing/Registration Problems .......................106
U
Units.........................................................................25
User interface ..........................................................21
W
Wells ........................................................................65
Work flow ................................................................20
111
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement