selectionMode of fvOptions in OpenFOAM

When specifying a source term using fvOptions in OpenFOAM, we can select the selectionMode (how to set the source region) from the following four options:

  • points
  • cellSet
  • cellZone
  • all

These options are defined in theĀ cellSetOption class along with the other common parameters among the fvOptions such as timeStart and duration. Let’s check out the meaning of each option along with its source code.

selectionMode 1: points

In this case, we specify some points as shown in the following example. The source region consists of theĀ individual cells that contain the specified points.

  • Example of description

  • Source code

selectionMode 2: cellSet

In this case, we preliminarily create a cellSet corresponding to the source region using OpenFOAM’s utilities such as setSet and specify the created cellSet name.

  • Example of description

  • Source code

selectionMode 3: cellZone

In this case, we preliminarily create a cellZone corresponding to the source region using OpenFOAM’s utilities such as setSet and specify the created cellZone name.

  • Example of description

  • Source code

selectionMode 4: all

The source region is the entire computational domain.

  • Example of description

  • Source code