OpenFOAM® Developer Upgrade Guide

OpenFOAM®  Developer Upgrade Guide

Note: this is a work-in-progress and will be updated in the near future

This guide is for developers looking for assistance in upgrading their OpenFOAM developments to more recent versions of OpenFOAM.

Changes for version 1612+

Geometric field access

The following examples show manipulation of scalar fields; similar constructs are used for other primitive types, i.e. vector, sphericalTensor, symmTensor and tensor classes.

Internal field

OLD

const scalarField& isf = field.internalField();
scalarField& isf = field.internalField();
NEW

const scalarField& isf = field.primitiveField();
scalarField& isf = field.primitiveFieldRef();

Dimensioned internal field

OLD

const volScalarField::DimensionedInternalField& dsf = field.dimensionedInternalField();
volScalarField::DimensionedInternalField& dsf = field.dimensionedInternalField();
NEW

const volScalarField::Internal& dsf = field()();
const volScalarField::Internal& dsf = field.internalField();
volScalarField::Internal& dsf = field.ref();

Boundary field

OLD:

const volScalarField::GeometricBoundaryField& bsf = field.boundaryField();
volScalarField::GeometricBoundaryField& bsf = field.boundaryField();
NEW

const volScalarField::Boundary& bsf = field.boundaryField();
volScalarField::Boundary& bsf = field.boundaryFieldRef();

Patch field

OLD

fvPatchScalarField& psf = ...
const volScalarField::DimensionedInternalField& dsf = psf.dimensionedInternalField();

const scalarField& psif = psf.internalField();
NEW

fvPatchScalarField& psf = ...
const volScalarField::Internal& dsf = psf.internalField();

const scalarField& psif = psf.primitiveField();

Temporary fields

OLD:

tmp<volScalarField> tField = ...
volScalarField& non_const_field = tField();
const volScalarField& const_field = tField();
NEW

tmp<volScalarField> tField = ...
volScalarField& non_const_field = tField().ref();
const volScalarField& const_field = tField();

Function objects
functionObjectState -> stateFunctionObject