# OpenFOAM® v1912: New and improved post-processing

23/12/2019

## Improvements in particle post-processing

##### Cloud patch interaction models

Optionally write patch interaction statistics, e.g. number and mass of particles that stick, escape etc. to file using the optional writeToFile entry. As an example, if using the localInteraction particle patch interaction model, the new entry can be added as follows:

localInteractionCoeffs
{
patches
(
"(walls|cyc.*)"
{
type        rebound;
}

"inlet|outlet"
{
type escape;
}
);

// New optional entry
writeToFile     yes;
}

##### Cloud function objects

The new fields entry can be used to select which particle fields to post-process; if empty or the entry is not given all fields are written (to maintain backwards compatibility)

patchPostProcessing1
{
type            patchPostProcessing;

// Optional new entry
fields          (position "U.*" d T nParticle);

maxStoredParcels 20;
patches
(
cycLeft_half0
cycLeft_half1
);
}

Tutorial

## New distance to surface function object

The new surfaceDistance function object generates a field (volScalarField) showing the distance to a provided geometry. This can be used to detect meshing problems e.g. insufficient resolution to mesh into gaps.

• the specification of the surface(s) is through a geometry entry, compatible with snappyHexMesh and foamyHexMesh.
• it does not limit search to any particular surface - it finds the nearest on any surface
• by default it will find the nearest also for all cell centres. This can be suppressed by unsetting the optional doCells boolean flag.
• the value on the boundary will be the distance from the face centre

A sample system/surfaceDistance dictionary:

surfaceDistance
{
// Where to load it from
libs            (fieldFunctionObjects);
type            surfaceDistance;

geometry
{
motorBike.obj
{
type triSurfaceMesh;
}
}
}
This can then be used with e.g. the postProcess:

postProcess -func surfaceDistance

Or to see how close the meshed surface is to the input geometry surfaces:

Source code
\$FOAM_SRC/functionObjects/field/surfaceDistance