OpenFOAM guide/Interpolation (OpenFOAM)

From OpenFOAMWiki
This article is about Interpolation in OpenFOAM. For other uses, see Interpolation (disambiguation).

OpenFOAM has a number of interpolation methods available. Some are classes that exist for the purpose of interpolation, such as interpolateXY; whereas others use interpolation in their code, such as specieThermo.

1 Main OpenFOAM library

Interpolation available in the main OpenFOAM library includes:

2 finiteVolume library

Interpolation available in the finiteVolume library includes:

  • interpolation (by cell) - interpolation to an arbitrary positions within a specified cell, used by:
    • Lagrange particle tracking (member of solidParticle); and
    • sampling (used in meshToMeshInterpolation);
  • surfaceInterpolation - interpolate volume field to face field;
    • \left . \phi \right \vert_{v\to f}
    • code: fvc::interpolate(phi);
  • pointVolInterpolation - interpolate point field to volume field;
  • volPointInterpolation - interpolate volume field to point field;

The last two are an extension of primitivePatchInterpolation to finite volume: a primitive mesh does not have cell centres.

3 sampling library

Interpolation available in the sampling library includes meshToMesh interpolation.

4 Other interpolation

Other forms of interpolation exist in OpenFOAM, such as:

  • in the finiteArea library - for finiteArea discretization;
  • in the tetDecompositionFiniteElement library - for finite element discretization; and
  • in specieThermo, for interpolating thermodynamic properties to curves.