TOUGH4 User Manual
  • Quick Entry to Keywords for Data Input
  • 1️⃣INTRODUCTION
    • About TOUGH
    • TOUGH Development History
    • TOUGH4 Implementation
    • Scope and Methodology
  • 2️⃣WHAT IS NEW IN TOUGH4
  • 3️⃣CODE COMPILATION AND INSTALLATION
    • Setup for Compilation
    • Code Compilation
      • 1. Compilation of TOUGH4 using Visual Studio
      • 2. Compilation of TOUGH4 on Linux-like platform
    • Installation
    • Running the Executable for Simulations
  • 4️⃣GOVERNING EQUATIONS
    • Mass-Balance Equation
    • Accumulation Terms
    • Flux Terms
    • Sink and Source Terms
    • Virtual Node Well Treatment
    • Semi-Analytical Conductive Heat Exchange
    • Drift Model
    • Non-Darcy Flow
  • 5️⃣NUMERICAL METHOD
    • Space and Time Discretization
    • Interface Weighting Schemes
    • Initial and Boundary Conditions
      • Initial Conditions and Restarting
      • Neumann Boundary Conditions
      • Dirichlet Boundary Conditions
      • Atmospheric Boundary Conditions
      • Constant Temperature Boundary Conditions
    • Parallel computing schemes
    • Linear Solvers
    • Python Functions
      • Relative Permeability
      • Capillary Pressure
      • Initial Condition Calculation
      • Fetching Output Data
      • Fetching Thermophysical Property Data From NIST Webbook
      • Coupling With Third-Party Software
  • 6️⃣SOFTWARE ARCHITECTURE
    • Program Design
    • Data Structure
    • Linear Equation Setup
  • 7️⃣PROCESS MODELING
    • EOS1
    • EOS2
    • EOS3
    • EOS4
    • EOS6
    • EOS7
    • EOS9
    • ECO2
    • EWASG
    • TMVOC
    • Tracers/Decay Chain
    • Biodegradation Reaction
    • Wellbore Flow
    • Non-Darcy Flow
    • Enhanced Coal Bed Methane
  • 8️⃣PREPARATION OF MODEL INPUT
    • Input Formatting
    • Keywords and Input Data
      • TITLE
      • BIODG
      • CBMDA
      • CHEMP
      • COFT
      • CONNE
      • COUPL
      • DIFFU
      • ELEME
      • ENDCY
      • ENDFI
      • FLAC
      • FNIST
      • FOFT
      • FORCH
      • GASES
      • GENER
      • GOFT
      • HYSTE
      • INCON
      • INDOM
      • MESHM
      • MODDE
      • MOMOP
      • MULTI
      • OUTPU
      • PARAM
      • ROCKS
      • ROFT
      • RPCAP
      • SELEC
      • SOLVR
      • SPAVA
      • TIMBC
      • TIMES
      • TRACR
      • WELLB
    • Inputs for Initial Conditions
      • EOS1
      • EOS2
      • EOS3
      • EOS4
      • EOS6
      • EOS7
      • EOS9
      • ECO2
      • EWASG
      • TMVOC
    • Geometry Data
      • General Concepts
      • MESHMaker
      • Multiple-continuum processing
    • Inputs for MESHMaker
      • Generation of radially symmetric grids
        • RADII
        • EQUID
        • LOGAR
        • LAYER
      • Generation of rectilinear grids
      • MINC processing for fractured media
    • Adjustment of Computing Parameters at Run-time
  • 9️⃣OUTPUTS
  • 🔟VALIDATION AND APPLICATION EXAMPLES
    • EOS1
      • Problem 1 - Code Demonstration
      • Problem 2 - Heat Sweep in a Vertical Fracture (rvf)
      • Problem 3 - Five-spot Geothermal Production/Injection (rfp)
      • Problem 4 - Coupled Wellbore Flow (r1q)
      • Problem 5 - Five-Spot Geothermal Production/Injection under extremely high temperature
    • EOS2
      • Problem 1 -Five-spot Geothermal Production/Injection (rfp)
    • EOS3
      • Problem 1 - Code Demonstration (eos3p1)
      • Problem 2 - 1D TH Problem with Heating and Gas Source (by Guanlong Guo)
      • Problem 3 - Heat Pipe in Cylindrical Geometry (rhp)
      • Problem 4 - 3D Thermal Consolidation Test, Coupling with FLAC3D Simulator (by Guanlong Guo)
    • EOS4
      • Problem 1 - Code Demonstration (eos4p1)
      • Problem 2 - Heat Pipe in Cylindrical Geometry (rhp)
    • EOS6
      • Problem 1-Validation with EOS2
      • Problem 2-Noble Gas Transport
    • EOS7
      • Problem 1-Multiphase and Nonisothermal Processes in a System with Variable Salinity (rf1)
      • Problem 2-Thermal and Tracer Diffusion (EOS7R/rdif7)
      • Problem 3-Contamination of an Aquifer from VOC Vapors in the Vadose Zone (EOS7R/rdica)
      • Problem 4-Density, Viscosity, Solubility, and Enthalpy of Real Gas Mixtures (EOS7C/SAM7C1)
      • Problem 5-CO2 Injection into a Depleted Gas Reservoir (EOS7C2/SAM7C2)
      • Problem 6- CO2 Injection into a Saturated System (EOS7C/SAM7C3)
      • Problem 7-Density, Viscosity, and Enthalpy of Real Gas Mixtures (EOS7CA/SAM7CA1)
      • Problem 8-CO2 Injection into a Shallow Vadose Zone (EOS7CA/SAM7CA2)
      • Problem 9-Non-Isothermal Compressed Air Energy Storage in Reservoir (by Julien Mouli-Castillo)
    • EOS9
      • Page 1
    • ECO2
      • Problem 1-Demonstration of Initialization Options (ECO2N/rtab)
      • Problem 2-Radial Flow from a CO2 Injection Well (ECO2N/rcc3)
      • Problem 3-CO2 Discharge Along a Fault Zone (ECO2N/r1dv)
      • Problem 4-CO2 Injection into a 2-D Layered Brine Formation (ECO2N/rtp7)
      • Problem 5-Upflow of CO2 along a Deep Fault Zone (ECO2M/r1d)
      • Problem 6-Migration of a CO2 Plume in a Sloping Aquifer, Intersected by a Fault (ECO2M/rwaf)
      • Problem 7-GCS/GHE with a double-porosity reservoir (Case6_50kg_DP/ECO2NV2)
    • EWASG
      • Problem 1 - Brine Density Calculation (dnh)
      • Problem 2 - Production from a Geothermal Reservoir with Hypersaline Brine and CO2 (rhbc)
    • TMVOC
      • Problem 1-Initialization of Different Phase Conditions (r7c)
      • Problem 2-1-D Buckley-Leverett Flow (rblm)
      • Problem 3-Diffusion of components (rdif2)
      • Problem 4-Steam Displacement of a NAPL in a Laboratory Column (rtcem)
      • Problem 5-Steam Displacement of a Benzene-Toluene Mixture in a Laboratory Column (rbt)
      • Problem 6 -Air Displacement of a NAPL from a Laboratory Column (rad)
      • Problem 7-NAPL Spill in the Unsaturated Zone (r2dl)
    • T4.Well
      • Problem 1-Steady-state two-phase flow upward
      • Problem 2-Non-isothermal CO2 flow through a wellbore initially full of water
  • CONCLUSION REMARKS
  • REFERENCES
  • ACKNOWLEDGEMENT
  • Appendix
    • ☑️A: RELATIVE PERMEABILITY FUNCTIONS
      • IRP=1 Linear function
      • IRP=2 Power function
      • IRP=3 Corey's curves
      • IRP=4 Grant's curve
      • IRP=5 Perfectly mobile
      • IRP=6 Fatt and Klikoff function
      • IRP=7 van Genuchten-Mualem Model
      • IRP=8 Verma function
      • IRP=10 Modified Brooks-Corey Model
      • IRP=11 Modified van Genuchten Model
      • IRP=12 Regular hysteresis
      • IRP=13 Simple hysteresis
      • IRP=31 Three phase perfectly mobile
      • IRP=32 Modified Stone's first 3-phase method
      • IRP=33 Three-phase Parker's function
      • IRP=34 Alternative Stone 3-phase
      • IRP=35 Power-law function
      • IRP=36 Faust for two-phase Buckley-Leverett problem
      • IRP=37 Another alternative to Stone function
      • IRP=40 Table lookup
      • IRP=41 User-Defined relative permeability function
    • ☑️B: CAPILLARY PRESSURE FUNCTIONS
      • ICP=1 Linear function
      • ICP=2 Function of Pickens
      • ICP=3 TRUST capillary pressure
      • ICP=4 Milly’s function
      • ICP=6 Leverett’s function
      • ICP=7 van Genuchten function
      • ICP=8 No capillary pressure
      • ICP=10 Modified Brooks-Corey Model
      • ICP=11 Modified van Genuchten Model
      • ICP=12 Regular hysteresis
      • ICP=13 Simple hysteresis
      • ICP=31 Parker et al 3-phase function
      • ICP=32 Parker 3-phase function, alternative 1
      • ICP=33 Parker 3-phase function, alternative 2
      • ICP=34 Parker 3-phase function, alternative 3
      • ICP=40 Table lookup
      • ICP=41 User-Defined capillary pressure function
    • ☑️C: ADDITIONAL PROGRAM OPTIONS
    • ☑️D: DESCRIPTION OF FRACTURED FLOW
      • Multiple Continuum Approaches
      • Active Fracture Modle
Powered by GitBook
On this page
  1. GOVERNING EQUATIONS

Virtual Node Well Treatment

The well boundary condition can also be treated using a “virtual node” method (Wu et al., 1996; Wu, 1999; Wu, 2000). The method handles a wellbore as a single or several computational nodes screened and connected to many neighboring nodes for a multi-layered well. The wellbore can be vertical, inclined, or horizontal. A borehole node is treated in the same way as for any other non-well nodes, and pumping/injection conditions are accounted for using sink or source terms to the node, depending on whether they are flux-specified or pressure-specified. In general, the mass balance Equations are still applicable to well node i. It is assumed in TOUGH4 that a well node is subject only to pumping or injection operations without any other boundary conditions. For simplification, the equations discussed in this section are for three phases (aqueous, gas and oil phases) and each phase with single mass component (water in aqueous, gas in the gas phase, and oil in the oil phase). The only difference for a system with multiple components in each phase is by multiplying the mass fractions (XβκX_\beta^\kappaXβκ​) in each phase to the accumulation terms and the flux terms. Therefore, the equation (5-7) for well node i, cab be rewritten in the form:

Riβ,k+1={[φSβρβ]ik+1−[φSβρβ]ik}ViΔt−Qβ,βk+1−∑j∈ηi(ρβλβ)ij+1/2mPIij[ψβjk+1−ψβik+1]R_i^{\beta ,k + 1} = \left\{ {\left[ {\varphi {S_\beta }{\rho _\beta }} \right]_i^{k + 1} - \left[ {\varphi {S_\beta }{\rho _\beta }} \right]_i^k} \right\}\frac{{{V_i}}}{{\Delta t}} - Q_{\beta ,\beta }^{k + 1} - \sum\nolimits_{j \in {\eta _i}} {\left( {{\rho _\beta }{\lambda _\beta }} \right)_{ij + 1/2}^m} P{I_{ij}}\left[ {\psi _{\beta j}^{k + 1} - \psi _{\beta i}^{k + 1}} \right]Riβ,k+1​={[φSβ​ρβ​]ik+1​−[φSβ​ρβ​]ik​}ΔtVi​​−Qβ,βk+1​−∑j∈ηi​​(ρβ​λβ​)ij+1/2m​PIij​[ψβjk+1​−ψβik+1​] (4-25)

where PIijPI_{ij}PIij​ is a well productivity or injectivity index for connection between well node i and neighboring node j; Qβ,βn+1Q_{\beta ,\beta}^{n + 1}Qβ,βn+1​ is the total mass rate ( β\betaβ is both phase and component index, = g, w or o) of pumping or injection at the well, to be determined in the following for different pumping or injection specifications; and j is the index of a neighboring formation node, connected to well node i. λβ\lambda _\betaλβ​ is the mobility of fluid in phase β\betaβ.

It should be pointed out that from now on we will drop the subscript for time level (k, k+1) in the equations for convenience (for this section only), and always assume that well boundary condition terms are evaluated fully implicitly.

There are many methods and equations, especially in the petroleum industry literature, for evaluating the well index, Typically, equation (4-15) is used for PIijPI_{ij}PIij​ calculation. The user is recommended to refer to the literature for various well indexes of vertical, inclined or horizontal wells (Peaceman, 1978, 1982, 1991, and 1995; Lee et al., 1993; and Fung et al., 1991).

The injection rate for phase β\betaβ (= g, w or o) at an injection well is evaluated by

Qβ, β=∑j ∈ ηi(ρβ λβ)i j+1/2PIi j[Pβ, j−Pw−ρβ g  (Dj−Dw)]{Q_{\beta ,\,\beta}} = \sum\limits_{j\, \in \,{\eta _i}} {\left( {{\rho _\beta }\,{\lambda _\beta }} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}\left[ {{P_{\beta ,\,j}} - {P_w} - {\rho _\beta }\,g\;\left( {{D_j} - {D_w}} \right)} \right]Qβ,β​=j∈ηi​∑​(ρβ​λβ​)ij+1/2​PIij​[Pβ,j​−Pw​−ρβ​g(Dj​−Dw​)] (4-26)

In above equation, the total mass rate is calculated from summation of the flow terms between well node, i, and all its neighbors of formation nodes, j; PwP_wPw​ is the well pressure, determined using an additional constraint equation in the following discussions; DwD_wDw​is the depth at which a pump of pumping or injection is located inside the wellbore; DjD_jDj​is the depth of node j. It is important to note that the Z coordinate of the well elements and elements connected to them must be provided for the calculation DwD_wDw​and DjD_jDj​, which are not required by original TOUGH simulation.

The mobility terms ( λ\lambda λ) in the well flow Equations of (4-26) are evaluated using the upstream weighting schemes. In other words, the well node is treated as a virtual node, like any other node in the grid, except that the sink/source term is determined by Equations (4-26). The following subsections will provide detailed treatment for different pumping and injection scenarios.

In applying the “virtual ‘node” method, special attention is needed to specifying the “rock properties” to the virtual node. Capillary pressure and relative permeability functions are also needed for all the well nodes, and should be specified differently for a particular phase, depending on if it is at a pumping or injection condition. All the flow properties and constitutive correlations are needed for well nodes, since the well node is regarded as a normal grid block in the solution.

Rate-Specified Pumping Well

There are in general two types of rate-specified pumping wells: (a) total liquid (water and oil) volumetric pumping rate is specified, and (b) one-phase liquid pumping volumetric rate is specified, including oil, gas or water pumping rate. The two rate-specified pumping scenarios are treated differently in this section. The following approach is not only rigorous and efficient in treating a pumping well, but also allows back flow to occur. The back flow may occur at certain layers in a thick-screened, pumping well, which penetrates multi-layers, or along a long horizontal well, which cannot be controlled in general in the ground, and needs to be determined by the code.

Total Liquid Rate Specification

With a total volumetric pumping rate, QLQ_LQL​ (> 0), of liquid (water + oil) is specified at the well, the well flowing pressure is evaluated by,

P w={−QL+∑j ∈ ηi∑β(ρβ λβ/ρβo)i j+1/2PIi j[Pβ, j−ρβ g  (Dj−Dw)]}÷{∑j ∈ ηi∑β(ρβ λβ/ρβo)i j+1/2PIi j}{P_{\,w}} = \left\{ { - {Q_L} + \sum\limits_{j\, \in \,{\eta _i}} {\sum\limits_\beta {\left( {{\rho _\beta }\,{\lambda _\beta }/\rho _\beta ^o} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}\left[ {{P_{\beta ,\,j}} - {\rho _\beta }\,g\;\left( {{D_j} - {D_w}} \right)} \right]} } \right\}\\ \quad \quad \div \left\{ {\sum\limits_{j\, \in \,{\eta _i}} {\sum\limits_\beta {\left( {{\rho _\beta }\,{\lambda _\beta }/\rho _\beta ^o} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}} } \right\} Pw​={−QL​+j∈ηi​∑​β∑​(ρβ​λβ​/ρβo​)ij+1/2​PIij​[Pβ,j​−ρβ​g(Dj​−Dw​)]}÷{j∈ηi​∑​β∑​(ρβ​λβ​/ρβo​)ij+1/2​PIij​} (4-27)

with β\betaβ = o and w.

The well pressure determined by Equation (4-27) is subject to a constraint,

P w≥Pw, min⁡{P_{\,w}} \ge {P_{w,\,\min }}Pw​≥Pw,min​ (4-28)

where Pw,minP_{w,min}Pw,min​ is the minimum well pressure allowed. Using Equation (4-28) is to enforce a physical constraint that it is not always possible to produce liquid at the specified rate. If not, the pumping well is switched to a pressure-specified pumping operation.

The actual pumping rate, to be added to Equations (4-25) as a sink term, is evaluated using Equation (4-26) for different mass components, respectively, with the well pressure determined by Equation (4-27). In addition, gas phase is also flowing out simultaneously at the well, which we have no control on, even though a liquid rate is specified. In general, the well pressure, PwP_wPw​ from (4-27) and (4-28), should approach the well nodal pressure, PiP_iPi​, from the simulation when a solution is converged and if zero capillary forces are specified for the well node.

Single-Phase Rate Specification

With a single-phase liquid volumetric pumping rate, Qβ(>0)Q_\beta( > 0 )Qβ​(>0), of oil, water or gas, is specified at the well, the well pressure is evaluated as follows,

P w={−ρβ,STCQo+∑j ∈ ηi(ρβ λβ)i j+1/2PIi j[Pβ, j−ρβ g  (Dj−Dw)]}÷{∑j ∈ ηi(ρβ λo)i j+1/2PIi j}{P_{\,w}} = \left\{ { - \rho _{\beta ,{\kern 1pt} STC}^{}{Q_o} + \sum\limits_{j\, \in \,{\eta _i}} {\left( {{\rho _\beta }\,{\lambda _\beta }} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}\left[ {{P_{\beta ,\,j}} - {\rho _\beta }\,g\;\left( {{D_j} - {D_w}} \right)} \right]} \right\} \\ \quad \quad \div \left\{ {\sum\limits_{j\, \in \,{\eta _i}} {\left( {{\rho _\beta }\,{\lambda _o}} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}} \right\}Pw​={−ρβ,STC​Qo​+j∈ηi​∑​(ρβ​λβ​)ij+1/2​PIij​[Pβ,j​−ρβ​g(Dj​−Dw​)]}÷{j∈ηi​∑​(ρβ​λo​)ij+1/2​PIij​} (4-29)

with β=o,w,org\beta=o,w,\quad or \quad gβ=o,w,org, where ρβ,STC\rho_{\beta,STC}ρβ,STC​ is the density of phase β\betaβ at standard conditions.

The well pressure from (4-29) is also subject to a constraint condition (4-28) physically. Then the actual pumping rate for the phase is evaluated using Equations (4.3.6) to (4.3.8) and added to Equations (4.3.1) to (4.3.3). Again non-specified phases may be pumped out, and their flow terms should also be accordingly calculated subject to the same well pressure.

Pressure-Specified Pumping Well

If a pumping well is operated at a specified well pressure, this pressure is directly substituted into Equations (4.3.1) to (4.3.3) for Pw. This type of pumping condition is generally named as production under “deliverability”. In this case, any phase or all of the three phases may be produced, which are decided by the formation conditions at the nodes connected to the well. In TOUGH4, three sink terms for the three phases are calculated using (4-26), respectively, and then added to Equations (4-25).

Rate-Specified Injection Well

For injection wells, injection rates are known in practice. The injected phase can be water, oil (maybe), and gas. In this case, back flow (i.e., pumping a phase from the well) is not allowed. With a total mass injection rate, Qβ(>0)Q_{\beta}( > 0)Qβ​(>0), of phase β\betaβ, specified at the well, the well injection pressure is then evaluated by,

P w={Qβ+∑j ∈ ηi(ρβ λβ)i j+1/2PIi j[Pβ, j−ρβ g  (Dj−Dw)]}÷{∑j ∈ ηi(ρβ λβ)i j+1/2PIi j}{P_{\,w}} = \left\{ {{Q_\beta } + \sum\limits_{j\, \in \,{\eta _i}} {\left( {{\rho _\beta }\,{\lambda _\beta }} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}\left[ {{P_{\beta ,\,j}} - {\rho _\beta }\,g\;\left( {{D_j} - {D_w}} \right)} \right]} \right\} \\ \quad \div \left\{ {\sum\limits_{j\, \in \,{\eta _i}} {\left( {{\rho _\beta }\,{\lambda _\beta }} \right)_{i\,j + 1/2}^{}} P{I_{i\,j}}} \right\}Pw​={Qβ​+j∈ηi​∑​(ρβ​λβ​)ij+1/2​PIij​[Pβ,j​−ρβ​g(Dj​−Dw​)]}÷{j∈ηi​∑​(ρβ​λβ​)ij+1/2​PIij​} (4-30)

with β=o,worg\beta = o,\quad w \quad or \quad g β=o,worg, and the well injection pressure is subject to the following constraint,

P w≤Pw, max⁡{P_{\,w}} \le {P_{w,\,\max }}Pw​≤Pw,max​

where Pw,maxP_{w,max}Pw,max​ is the maximum well injection pressure allowed. Equation (4.3.13) is used for the situation that the specified injection rate may be too high for the well condition, and then the injection well is switched to a pressure-specified injection operation.

The actual injection rate for the specified phase is evaluated using Equation (4.3,5), with the well injection pressure determined by Equations (4.3.12) and (4.3.13), and then is added to Equations (4.3.1) and (4.3.3) for well node i.

Pressure-Specified Injection Well

If a fluid is injected at a specified well pressure, this pressure is directly substituted into Equation (4.3.5) for PwP_wPw​ for the injected phase. This type of injection condition can be treated using the big-volume method, as discussed in Section 4.1, if it is a single grid layer injection well. However, for a multi-layered injection well, the injection rate of the specified phase must be determined and partitioned using Equation (4.3.5), and then added to (4.3.1), (4.3.2), or (4.3.3), accordingly.

Special Considerations for Treatment of Well Conditions

The virtual node approach for treating well conditions, as discussed above, is a general, flexible and efficient method. The major advantages of the virtual node scheme, as compared with the conventional potential or mobility allocation method, are that it is natural to include “back flow” occurring and to incorporate contributions from all the connections to a well into the Jacobian matrix. The full Jacobian matrix and the full implicit scheme make the method very robust and stable in solving a multi-layered well flow problem.

One potential problem, however, is that since the wellbore node has a very small volume and high flow rates, it may cause some numerical difficulty during a Newton iteration. This problem can be alleviated by increasing the volume of the wellbore nodes by a factor of 102 - 103. This has the effect of adding a pseudo wellbore storage effect and dampens out oscillations in the Newton iteration (Wu et al., 1996). Unless one is interested in very small-scale transient behavior of wells, numerical tests indicate that this pseudo wellbore storage has almost no effects on the converged solution. It is recommended that the pseudo wellbore storage approach should be always used for rate-specified pumping or injection problems. For pressure-specified pumping or injection problems, however, an infinite-large volume of a wellbore can also be used to obtain a much better numerical performance.

PreviousSink and Source TermsNextSemi-Analytical Conductive Heat Exchange
4️⃣