The function object cellDecomposer
decomposes cells into 'basic' shapes and maps selected fields onto it (similar to mapFields
). The main benefit is for postprocessing OpenFOAM meshes and results with third-party tools that cannot handle polyhedral shapes.
There are two main controls:
fvOption
so e.g. selectionMode all
or selectionMode cellSet
decomposeType
:
A typical example to convert all polyhedral cells into a sub-region mesh containing non-polyhedral cells only:
functions
{
cellDecomposer
{
// Mandatory entries
type cellDecomposer;
fields (p U);
mapRegion simpleMesh;
// Decompose type
decomposeType polyhedral;
// Which cells to convert
selectionMode all;
}
}
This mesh and results can then be handled using the usual -region
option:
checkMesh -region simpleMesh
foamToEnsight -region simpleMesh
Another example to convert all cells in a certain geometric region to tetrahedra:
functions
{
cellDecomposer
{
// Mandatory entries
type cellDecomposer;
fields (p U);
mapRegion tetMesh;
// Decompose type
decomposeType faceCentre;
// Which cells to convert
selectionMode geometric;
// Generate cellSet c0 using topoSet commands:
cellSet c0;
selection
{
a
{
action use;
source boxToCell;
box (1 1 1)(0 0 0);
}
b
{
action invert;
}
}
}
}
checkMesh
this shows up asChecking topology...
..
<<Found 2015 neighbouring cells with multiple inbetween faces.
Upper triangular ordering OK.
<<Writing 4034 unordered faces to set upperTriangularFace
***High aspect ratio cells found, Max aspect ratio: 1.59875e+96, number of cells 99
<<Writing 99 cells with high aspect ratio to set highAspectRatioCells
Minimum face area = 1.34886e-06. Maximum face area = 1.00344. Face area magnitudes OK.
***Zero or negative cell volume detected. Minimum negative volume: -3.55077e-07, Number of negative volume cells: 99
<<Writing 99 zero volume cells to set zeroVolumeCells
Mesh non-orthogonality Max: 158.664 average: 21.4979