Porous Flow Tutorial Page 00

Contents

  • Page 01 A single fluid

  • Page 02 Numerical issues

  • Page 03 Adding heat advection and conduction

  • Page 04 Adding solid mechanics

  • Page 05 Using a realistic equation of state for the fluid

  • Page 06 Adding a tracer

  • Page 07 A chemically reactive tracer with porosity and permeability changes

  • Page 08 The PorousFlowSink and unsaturated flow

  • Page 09 An overview of the PorousFlow architecture

  • Page 10 Unleashing the full power of PorousFlow: using Kernels and Materials

  • Page 11 Two-phase THM borehole injection

  • Page 12 Boundary sinks and sources, and polyline sinks and sources (boreholes and rivers)

  • Page 13 More elaborate chemistry

Introduction

The PorousFlow module is a library of physics for fluid and heat flow in porous media. It is formulated in a general manner, so is capable of solving problems with an arbitrary number of phases, fluid components and chemical reactants. This tutorial guides the user through some commonly-used aspects of PorousFlow. Lots of core documentation may be found in Porous Flow.

This tutorial concerns fluid injection through a borehole into a large fluid-filled reservoir. The borehole is vertical, and cylindrical symmetry around the borehole axis is assumed. The tutorial begins with simple Darcy flow, and gradually adds more complex phenomena such as coupling with heat and solid mechanics, multi-phase flows and chemical reactions.

After conceptual modelling, the first step in any finite-element simulation is to create the mesh. The 3D mesh used for this tutorial is deliberately coarse (so that the tutorial input files may be easily run on the smallest computers) and is generated using MOOSE's inbuilt meshing capabilities. Firstly, a 2D annular mesh is created:

[Mesh]
  [annular]
    type = AnnularMeshGenerator
    nr = 10
    rmin = 1.0
    rmax = 10
    growth_r = 1.4
    nt = 4
    dmin = 0
    dmax = 90
  []
(modules/porous_flow/examples/tutorial/00.i)

The radius of the borehole is 1m, the radius of the model is 10m, and only of the annulus is considered.

Now a sequence of MeshModifiers are applied to this 2D mesh. First, it is extruded to be 12m high using:

  [make3D]
    type = MeshExtruderGenerator
    extrusion_vector = '0 0 12'
    num_layers = 3
    bottom_sideset = 'bottom'
    top_sideset = 'top'
    input = annular
  []
(modules/porous_flow/examples/tutorial/00.i)

Then it is shifted downwards (ie, in the negative direction) by 6m to place the injection region around the origin:

  [shift_down]
    type = TransformGenerator
    transform = TRANSLATE
    vector_value = '0 0 -6'
    input = make3D
  []
(modules/porous_flow/examples/tutorial/00.i)

An aquifer region is created in the central 6m:

  [aquifer]
    type = SubdomainBoundingBoxGenerator
    block_id = 1
    bottom_left = '0 0 -2'
    top_right = '10 10 2'
    input = shift_down
  []
(modules/porous_flow/examples/tutorial/00.i)

and an injection area is created on the borehole's wall in the aquifer region:

  [injection_area]
    type = ParsedGenerateSideset
    combinatorial_geometry = 'x*x+y*y<1.01'
    included_subdomains = 1
    new_sideset_name = 'injection_area'
    input = 'aquifer'
  []
(modules/porous_flow/examples/tutorial/00.i)

Finally, the subdomains are named "caps" (for the upper and lower caprock) and "aquifer":

  [rename]
    type = RenameBlockGenerator
    old_block = '0 1'
    new_block = 'caps aquifer'
    input = 'injection_area'
(modules/porous_flow/examples/tutorial/00.i)

This process has created the 3D mesh. Each of the input files in the tutorial follow this process. The result is shown in Figure 1.

Figure 1: The 3D mesh. The aquifer is shown in red and the caprocks in blue. The green surface is the injection area.

If this were a real simulation rather than just a tutorial, it would be much more efficient to use cylindrical coordinates, which are called "RZ" coordinates in MOOSE. The mesh-generation process is

[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
  [gen]
    type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "../../source/meshgenerators/GeneratedMeshGenerator.html"}>>>
    dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
    nx<<<{"description": "Number of elements in the X direction"}>>> = 10
    xmin<<<{"description": "Lower X Coordinate of the generated mesh"}>>> = 1.0
    xmax<<<{"description": "Upper X Coordinate of the generated mesh"}>>> = 10
    bias_x<<<{"description": "The amount by which to grow (or shrink) the cells in the x-direction."}>>> = 1.4
    ny<<<{"description": "Number of elements in the Y direction"}>>> = 3
    ymin<<<{"description": "Lower Y Coordinate of the generated mesh"}>>> = -6
    ymax<<<{"description": "Upper Y Coordinate of the generated mesh"}>>> = 6
  []
  [aquifer]
    type = SubdomainBoundingBoxGenerator<<<{"description": "Changes the subdomain ID of elements either (XOR) inside or outside the specified box to the specified ID.", "href": "../../source/meshgenerators/SubdomainBoundingBoxGenerator.html"}>>>
    block_id<<<{"description": "Subdomain id to set for inside/outside the bounding box"}>>> = 1
    bottom_left<<<{"description": "The bottom left point (in x,y,z with spaces in-between)."}>>> = '0 -2 0'
    top_right<<<{"description": "The bottom left point (in x,y,z with spaces in-between)."}>>> = '10 2 0'
    input<<<{"description": "The mesh we want to modify"}>>> = gen
  []
  [injection_area]
    type = ParsedGenerateSideset<<<{"description": "A MeshGenerator that adds element sides to a sideset if the centroid of the side satisfies the `combinatorial_geometry` expression.", "href": "../../source/meshgenerators/ParsedGenerateSideset.html"}>>>
    combinatorial_geometry<<<{"description": "Function expression encoding a combinatorial geometry"}>>> = 'x<1.0001'
    included_subdomains<<<{"description": "A set of subdomain names or ids whose sides will be included in the new sidesets. A side is only added if the subdomain id of the corresponding element is in this set."}>>> = 1
    new_sideset_name<<<{"description": "The name of the new sideset"}>>> = 'injection_area'
    input<<<{"description": "The mesh we want to modify"}>>> = 'aquifer'
  []
  [rename]
    type = RenameBlockGenerator<<<{"description": "Changes the block IDs and/or block names for a given set of blocks defined by either block ID or block name. The changes are independent of ordering. The merging of blocks is supported.", "href": "../../source/meshgenerators/RenameBlockGenerator.html"}>>>
    old_block<<<{"description": "Elements with these block ID(s)/name(s) will be given the new block information specified in 'new_block'"}>>> = '0 1'
    new_block<<<{"description": "The new block ID(s)/name(s) to be given by the elements defined in 'old_block'."}>>> = 'caps aquifer'
    input<<<{"description": "The mesh we want to modify"}>>> = 'injection_area'
  []
[]
(modules/porous_flow/examples/tutorial/00_2D.i)