OpenFOAM® v2012: New and improved parallel operation

23/12/2020

New multi-application coupling through boundary conditions

In this release the explicitly coupled patch and boundary conditions, e.g.mapped, mappedField, turbulentTemperatureCoupledBaffleMixed etc. have been extended to communicate between different applications. Each application now has an optional world command line argument, later referred to in the mapped condition by the sampleWorld entry. Internally the coupling is performed through an MPI communicator so there is no file system overhead. There are currently two ways of interfacing:

Boundary condition to boundary condition

This coupling is triggered every time the value of the boundary condition is updated. This limits the running to solvers where both sides run exactly the same number of evaluations.

For example, two worlds, one fluid and one solid, each running on one processor are started using an mpirun (OpenMPI syntax) command:

mpirun -app fluid_solid.scheme
where the fluid˙solid.scheme application scheme file contains:

-np 1 rhoPimpleFoam -world fluid
-np 1 solidFoam -world solid
In each coupled boundary specification in the constant/polyMesh/boundary file there is now the optional sampleWorld entry which specifies the world to retrieve the data from (for each face centre):

type            mappedWall;
sampleMode      nearestPatchFace;

sampleWorld     solid;
sampleRegion    bottomSolid;
samplePatch     top;
In the following test case the fluid (top block) is coupled to a solid (bottom block) through the temperature coupled boundary condition:

[Picture]

[Picture]

Source code
$FOAM_SRC/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
Tutorial
$FOAM_APP/test/multiWorld/chtMultiRegionSimpleFoam

Loose coupling : boundary condition to function object coupling

A looser coupling is available using a functionObject to exchange the data. The case set up is exactly the same except for:

  • an additional flag to indicate loose coupling: sampleDatabase
  • both applications have to run the syncObjects function object.

Example of set-up:

  • in system/controlDict:

functions
{
    syncObjects
    {
        type        syncObjects;
        libs        (utilityFunctionObjects);
    }
}
  • in fluid/0/T:

boundaryField
{
    heater
    {
        type            mappedMixed;

        // What to sample:
        sampleMode      nearestPatchFace;

        // Simulation world to sample
        sampleWorld     solid;

        // If sampleMode is nearestPatchFace : patch to find faces of
        samplePatch     coupled;

        // Use database to exchange data (one-way or loose coupling in
        // combination with syncObjects functionObject)
        sampleDatabase  true;
    }
}

Note that this functionality is

  • a beta release feature: very new, not well tested
  • only operating for one-to-one (nearestPatchFace) coupling, AMI is not supported
  • only works for both solvers running the same time step and number of time steps

Source code
$FOAM_SRC/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C
Tutorial
$FOAM_TUTORIALS/multiphase/compressibleInterFoam/laminar/waterCooler

Improved redistributePar utility

The redistributePar parallel pre- and post-processing application has been extended to internally use mapping for all patches and boundary conditions. This avoids messages of the form:

--> FOAM Warning :
    ...
    in file src/finiteVolume/lnInclude/fixedValueFvPatchField.C at line 81
    On field subsetepsilon patch lowerWall patchField fixedValue : mapper does not map all values.
    To avoid this warning fully specify the mapping in derived patch fields.

Source code
$FOAM_SRC/dynamicMesh/fvMeshSubset
Tutorial
$FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily