Explanation of fvOptions in OpenFOAM


The fvOptions functionality in OpenFOAM is flexible framework to add various source terms to the governing equations without the need to rewrite the original source code. The available options in the latest versions of OpenFOAM (v4.0 and v1606+) are listed below.

My explanations are available for the options shown in red.

I’ll extend the coverage.

Available Options

General Sources:


Pressure Gradient Sources:

  • meanVelocityForce:

    to adjust the average velocity in the whole domain or user-specified cellZone or cellSet to the desired value Ubar by adding a momentum source

  • [3.0+] directionalPressureGradientExplicitSource

Heat Exchanger Sources:


Buoyancy Sources:

  • buoyancyForce:

    to add the gravitational force term \(\rho\boldsymbol{g}\) to the momentum conservation equation in XiFoam, reactingFoam and rhoReactingFoam

  • buoyancyEnergy:

    to add the work done by gravitational force \(\rho(\boldsymbol{u} \cdot \boldsymbol{g})\) to the energy conservation equation


Porosity Sources:


Acceleration Source:


Phase Change Source:


Acoustic Damping Source:

  • [1606+] acousticDampingSource:

    to damp the acoustic waves before they reach the boundaries by adding a momentum source term in a buffer region so that the solution will not be contaminated by the reflected waves from the boundaries


Other Sources:


Solver Robustness:


Set Value:

How to Set Source Region

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

The meanings of these options are described in this post.

 

Author: fumiya

CFD engineer in Japan