OpenFOAM guide/InterpolationTable

From OpenFOAMWiki

interpolationTable performs temporal piecewise linear interpolation based on a provided dataset (file) of the variation of a <Type> with respect to time. It also provides a variety of out-of-bounds behaviours.

This class is itself a list of paired elements called a 2-tuple (Tuple2.H) with the format:

(scalar, <Type>),


  • scalar is the time value; and
  • Type is the quantity that varies with time.

Out-of-bounds behaviours include:

  • ERROR - fail;
  • WARN - throw a warning, then CLAMP;
  • CLAMP - hold last value; and
  • REPEAT - cyclic pattern that repeats.

1 operators

  • operator[] - retrieve list element - this one is overloaded to accomodate out-of-bounds behaviour; and
  • operator() - interpolate - piecewise linear interpolation at given time value (scalar) - returns <Type>.

2 functions

  • check() - internally verifies that the time value is monotonically increasing through the list (if not, fail); and
  • write() - writes filename, file contents, and out-of-bounds behaviour to Ostream.

3 used by

Some time varying fvPatchFields.