v2106: New and improved usability

Improved OpenFOAM packaging

TOP

OpenFOAM is distributed by OpenCFD under the GPL License. In addition to source code packages suitable for compilation on a variety of Linux and other POSIX systems, this release also has a number of pre-compiled binary packages

Windows users have three options for pre-compiled packages (more information):

  • Using Windows Subsystem for Linux (Ubuntu, centos or openSUSE packs)
  • Native executables with cross-compiled
  • A docker installation

Mac OSX users have the option to compile from source, or use Docker containers for pre-compiled packages (more information).

For this release, the docker containers have been modified to provide a smoother integration and are available in three standard sizes:

  • -run : a small-footprint runtime-only image
  • -dev : runtime with OpenFOAM development environment
  • -default : a just-give-me-everything image

Starting with this release, docker containers are now derived from the Ubuntu pre-compiled packages and the Windows Subsystem for Linux components now also use the regular Linux pre-compiled packages. This consolidation ensures a more consistent update frequency for the docker and WSL components.

Parsing of scalars and labels

TOP

The dictionary reading of scalars and labels (ie, floating and fixed point values) has been relaxed to handle slightly sloppier input. This is particularly useful for dictionaries with variable expansion such as this simple example:

valueA 2;
valueB -$valueA;

While reading, the dictionary expansion causes it to be expanded as follows:

valueA 2;
valueB - 2;

When getting values from the dictionary:

Info<< "val = " << dict.get<scalar>("valueB") << nl;

This would normally fail, since the entry has two separate tokens. The reading routines have been adjusted to accept this as valid (but ugly) input for scalars and labels. If the first token is -, it is used to negate the next token, which must be a valid numerical token.

With this low-level change to the reading of tokenized input, composite types such as vector are automatically handled as well. Here is a simple example with a bounding box definition:

dim 100;
min (-$dim -$dim -$dim);
max ( $dim $dim $dim);

To achieve the same result in previous versions is considerably less user-friendly:

dim 100;
min #eval{ vector (-$dim, -$dim, -$dim) };
max ( $dim $dim $dim);

 

Improved command-line handling of file-names

TOP

The internal fileName validation and cleaning have been modified to properly handle backslash conversion and all solver and utilities have been modified to now uniformly use args.get<fileName>(...) when retrieving fileNames from the command-line.

This ensures that path names arising from MS-Windows are consistently handled internally.

Function1, PatchFunction1 specification

TOP

The constant, polynomial and table entries can now be specified as dictionary entries. The table Function1 now also includes TableFile functionality, which simplifies switching and modifying content.

Provide dictionary access for coded boundary conditions and code Function1 definitions. In particular, this makes it possible to write simple mashups of Function1 entries to create a new Function1 definition.

New Compiler Support

TOP

Additional support for the Intel oneAPI compiler suite. Contribution: Jong-Gwan (Jason) Do

Updated compiler settings for Gcc and Clang

Build-versioning

TOP

The internal cmake wrappers now include MPI information in their versioning. This makes it possible to build modules such as runTimePostProcessing for multiple MPI instances.

Portability changes

TOP

All IO objects now support the concept of meta data for their headers. The content of this meta dictionary are entirely free-format and are not re-read by OpenFOAM. The purpose of the meta data is to provide an overview of the data contents solely from the data header.

The mesh zones are one of the places where this new content is used. For example,

FoamFile
{
    version     2.0;
    format      binary;
    arch        "LSB;label=32;scalar=64";
    class       regIOobject;
    location    "constant/polyMesh";
    object      cellZones;
    meta
    {
        names 15( inlet outlet ... porous );
    }
}

This allows downstream consumers quick access to the available zone names without needing to parse the entire file! With future changes to the ParaView/VTK reader, this will allow user selection of specified regions with absolutely minimal overhead.

A similar concern has prompted an update in the collated file output. Here the header information is augmented with additional information about the contents contained in the file. For example,

FoamFile
{
    version     2.0;
    format      binary;
    arch        "LSB;label=32;scalar=64";
    class       decomposedBlockData;
    location    "constant/polyMesh";
    object      boundary;
    data.format ascii;
    data.class  polyBoundaryMesh;
}

Here the outside container is decomposedBlockData in binary format, but the actual contents of the payload are polyBoundaryMesh in ascii format. In previous version it would not be possible to determine the contents type or format without actually reading and in the first block of decomposed data and re-parsing its content. Reflecting this information in the header reduces the effort and improves the IO efficiency when scanning files.

As with the addition of meta information, these changes have been made to improve downstream support for ParaView/VTK and other utilities.

Arch information

All output file headers now contain the arch information. This was previously suppressed for ASCII format as being clutter, but without it there is no context for interpreting the type of data contained in ASCII files: potentially leading to integer overflows when reading in ParaView etc.

Standardization

TOP

In the continuing push to use more standard C++ elements in OpenFOAM, the base implementation of Foam::Swap now uses std::swap instead of providing duplicate code. Basic types now use std::swap, which makes it clearer that they do not rely on any special semantics. The Foam::swap function is still used to invoke specialized forms of swapping, but in many fewer places.

The OpenFOAM overloads of hashing have been reworked to handle all derived string and integer types. The default hasher for HashSet/HashTable now uses the hash-key type. This avoids questionable hashing calls and/or avoids compiler resolution problems and aligns things more with std::map etc.

These changes improve consistency, avoid erroneous mappings, and alignment with standard C++ practices.

See the Developer Upgrade Guide for more details