OpenFOAM® v1912: New and updated portability

23/12/2019

New binary file compatibility

OpenFOAM-v1912 now handles binary reading of different precision or label sizes to support workflows with mixed compilations of OpenFOAM.

One such workflow could be the following:

  • Meshing with snappyHexMesh in double precision.
  • Single precision for aerodynamics (for reduced memory bandwidth)
  • Further calculation with chemistry (double precision)

This is now possible with binary formatted OpenFOAM files, provided that they contain the necessary size information in their header. For example,

FoamFile
{
    version     2.0;
    format      binary;
    arch        "LSB;label=32;scalar=64";
    class       vectorField;
    object      points;
}
Binary files generated with OpenFOAM-v1612 and later will already contain this information and can be used.

Note that when narrowing the data range e.g. 64-bit label width to 32-bit label width, any range overflows will be truncated.