Close

6th March 2013

OpenFOAM 2.2.0: Meshing

Changes to checkMesh

The checkMesh utility can now read user-defined mesh quality settings that the user can specify in a separate meshQualityDict file in the system directory. The file has the same format as the meshQualityControls sub-dictionary in the snappyHexMeshDict configuration file for snappyHexMesh. For convenience, users may set up a meshQualityDict file, and simply include that file in their snappyHexMeshDict file(s), e.g.

#include "meshQualityDict" 

To use the user-defined mesh quality controls, the utility must be executed with the following option

checkMesh -meshQuality 

In the current release of OpenFOAM, checkMesh has been improved to handle coupled faces (e.g. at processor and cyclic boundaries) consistent with the underlying numerics. In particular coupled faces are checked for non-orthogonality as if they were internal faces.

Mesh Renumbering

The utility for renumbering mesh cells, renumberMesh has been extended to include a choice of different renumbering algorithms. By default, the it uses the Cuthill-McKee renumbering algorithm, as it did in previous versions of OpenFOAM. In the latest version, however, the user can select from a range of schemes and options through a control file using the -dict option when executing the utility, e.g.

renumberMesh -dict system/renumberMeshDict 

Example

  • Configuration file
    $FOAM_UTILITIES/mesh/manipulation/renumberMesh/renumberMeshDict

Creating Baffles

The createBaffles utility creates zero-thickness baffles by converting internal mesh faces into (pairs of co-located) boundary faces. In previous version of OpenFOAM, the utility has simply modified the mesh geometry. In the latest release, createBaffles has been extended to modify the field files, e.g. U, p, to include entries for the new baffle patches.

Previously, createBaffles required a list of faces to be generated, e.g. by the topoSet utility. In this version, some functionality to generate the face list has been added to createBaffles, allowing it to operate as a stand-alone tool. For example, the user can specify a triangulated surface (e.g. STL or OBJ file) or analytical surface (e.g. searchableSphere) to select the baffle faces.

Example

  • T-Junction example
    $FOAM_TUTORIALS/incompressible/pimpleFoam/TJunctionFan

Mesh Decomposition

For parallel running, OpenFOAM uses domain decomposition, which is controlled by the decomposePar utility; any subsequent domain reconstruction is performed by the reconstructPar utility. This release includes the following extensions to these utilities.

For multi-region simulations in OpenFOAM, each region is decomposed separately. In this release, both decomposePar and reconstructPar include have an -allRegions option that will perform decomposition (or reconstruction) of all regions in one execution, using the region information in constant/regionProperties.

Example

  • Multi-region heater
    $FOAM_TUTORIALS/heatTransfer/chtMultiRegionFoam/multiRegionHeater

A new extension to reconstructPar allows the user to select, for reconstruction, only the decomposed field/mesh data that have not previously been reconstructed. With this functionality, the user can repeatedly execute reconstructPar with the new -newTimes option to work with the latest results in serial, e.g. for post-processing.

Changes to collapseEdges

The collapseEdges utility can be used to remove small edges from a mesh, sliver faces, or merge edges in a line. In v2.2.0, the utility collapses edges consistently across processor boundaries. It now requires a collapseDict input file, replacing command line options. The collapseDict file includes a sub-dictionary to control the collapse of edges, e.g.

collapseEdgesCoeffs
{
    // Edges shorter than this absolute value will be merged
    minimumEdgeLength   1e-6;

    // Maximum angle between 2 edges sharing a point attached to no other edges
    maximumMergeAngle   30;
}

The user can also control collapsing of small faces through a sub-dictionary, as shown below

collapseFacesCoeffs
{
    // The initial face length factor
    initialFaceLengthFactor                 0.5;

    // If the face can't be collapsed to an edge, and it has a span less than
    // the target face length multiplied by this coefficient, collapse it
    // to a point.
    maxCollapseFaceToPointSideLengthCoeff   0.3;

    // Allow early collapse of edges to a point
    allowEarlyCollapseToPoint               on;

    // Fraction to premultiply maxCollapseFaceToPointSideLengthCoeff by if
    // allowEarlyCollapseToPoint is enabled
    allowEarlyCollapseCoeff                 0.2;

    // Defining how close to the midpoint (M) of the projected
    // vertices line a projected vertex (X) can be before making this
    // an invalid edge collapse
    //
    // X---X-g----------------M----X-----------g----X--X
    //
    // Only allow a collapse if all projected vertices are outwith
    // guardFraction (g) of the distance form the face centre to the
    // furthest vertex in the considered direction
    guardFraction                           0.1;
} 

The user can supply mesh quality constraints to the edge collapser. The collapser will check the quality of the initial mesh and attempt to collapse edges whilst staying within the given mesh quality criteria. As in the example of checkMesh above, the user can include mesh quality controls within collapseDict through a separate meshQualityDict file:

controlMeshQuality      on;

controlMeshQualityCoeffs
{
    // Name of the dictionary that has the mesh quality coefficients used
    // by motionSmoother::checkMesh
    #include                    "meshQualityDict";

    // The amount that minimumEdgeLength will be reduced by for each
    // edge if that edge's collapse generates a poor quality face
    edgeReductionFactor         0.5;

    // The amount that initialFaceLengthFactor will be reduced by for each
    // face if its collapse generates a poor quality face
    faceReductionFactor         0.5;

    // Maximum number of smoothing iterations for the reductionFactors
    maximumSmoothingIterations  2;

    // Maximum number of outer iterations is mesh quality checking is enabled
    maximumIterations           10;

    // Maximum number of iterations deletion of a point can cause a bad face
    // to be constructed before it is forced to not be deleted
    maxPointErrorCount          5;

Example

  • Biconic 25/55
    $FOAM_TUTORIALS/compressible/rhoCentralFoam/biconic25-55Run35

Changes to Mesh Motion Solver

Within the mesh motion solver framework in OpenFOAM, we have introduced a rigorous split between those solvers that solve for displacement of vertices from those that solve for velocity. In addition, each motion solver is controlled through its own sub-dictionary within dynamicMeshDict, in a manner typical of OpenFOAM model selection.

Source code

  • Motion solver
    $FOAM_SRC/dynamicMesh/motionSolver