v2406: New and improved pre-processing

New createViewFactors application

TOP

The new createViewFactors utility creates patch-to-patch view factors for the viewFactor radiation model. This serves as a potential replacement for the current viewFactorsGen utility. Users can select the models used to both construct the face-to-face addressing and how the view factors are calculated, i.e.

Ray generation:

  • voxel: space divided into uniform voxels
  • ...further methods will be released in the near future

View factor calculation:

  • viewFactorHottel: 2D method based on Hottel's crossed strings method
  • viewFactor2AI: double area integral
  • viewFactor2LI: double line integral

Instead of testing all faces against all faces, i.e. using an N^2 algorithm (viewFactorsGen), the user supplies the number of rays to seed per face. These are issued uniformly across a hemisphere. Hence, the results are more approximate than the previous utility, but can now be applied to production cases with much improved performance. Examples:

2D: linearly distributed in the range 0-180 deg (2D). Example using 300 rays, coloured by ray index:

3D: distributed using a hemisphere of equally spaced points. Example using 1024 rays

Note that this is currently in beta-level and is likely to change in the near future.

Tutorial

  • TBA

Source code

Gitlab

Improved renumberMesh

TOP

The renumberMesh utility has been extended to include new options and functionality, e.g.

  • Use -dry-run with the -write-maps option to visualize the before/after effects of renumbering (creates a VTK file) without making any changes.
  • Use the -no-fields option to renumber the mesh only without affecting the fields. This is useful and much faster when the input fields are uniform, and the -overwrite option is specified.

The new -renumber-method and -renumber-coeffs options permit use of renumberMesh without needing to edit a separate file, e.g.

  • renumberMesh -renumber-method CuthillMcKee
  • renumberMesh -renumber-method RCM (ie, Reverse Cuthill-McKee)
  • renumberMesh -renumber-method random
  • renumberMesh -renumber-method none (very special case!)

For methods requiring coefficients, these can be specified with the -renumber-coeffs option. Here are four different ways to specify reverse Cuthill-McKee:

  • renumberMesh -renumber-method RCM
  • renumberMesh -renumber-method CuthillMcKee -renumber-coeffs 'reverse true;'
  • `renumberMesh -renumber-coeffs 'method CuthillMcKee; reverse true;'
  • `renumberMesh -renumber-coeffs 'method RCM;'

As can be seen from these examples, the -renumber-coeffs correspond to OpenFOAM dictionary content, which allows relatively complex content:

renumberMesh \
    renumber-method spring \
    renumber-coeffs 'maxCo 0.1; maxIter 1000; freezeFraction 0.99;'

In addition to the renumbering methods, renumberMesh now supports a -decompose method, applied before renumbering. This can be used as a replacement for parallel renumbering to simplify workflows.

Tutorial

Source code

Improved snappyHexMesh

TOP

snappyHexMesh aims to produce identical meshes when running in both serial and parallel modes. In this release two synchronisations were addressed:

  • when using the slower-than-2:1 refinement, i.e. nCellsBetweenLevels > 1
  • when detecting cells with all points on the boundary. These were treated differently if the points were on processor boundaries.

Tutorials

  • N/A

Source code

Gitlab

Improved surfaceInertia utility

TOP

The surfaceInertia utility now emits information about the average area normal, which can be useful for various orientation-related geometry or mesh manipulations during pre- and post-processing:

  • combine with linearDirection to achieve better extrusion results.
  • orientation of transformations, blockMesh, result projections, ...

Source code

New overlapping zones

TOP

More utilities now support overlapping zones of points, faces, and cells. In previous releases this was only supported in decomposePar and specific solvers.

  • redistributePar : full support
  • subsetMesh : full support
  • polyTopoChange : extended routines to add/modify mesh elements into multiple zones instead of a single one
  • polyMesh : additional interrogation routine to check the zones an element is in

This adds to the existing support for constructing zones directly inside topoSet using any source, e.g.:

name    c0;
type    cellZoneSet;
action  new;
source  boxToCell;
box     (0.04 0 0)(0.06 100 100);

This will directly generate a cellZone c0 from a rectangular section of the mesh.

Source code

Tutorial

Gitlab

topoSet : optional transformation of geometric selection

TOP

Geometric selection sources in topoSet now support optional transformations for cell, face centre or point locations before the selection is applied. Transformations take the form of solidBodyMotionFunctions, e.g.

name                    c0;
type                    cellSet;
action                  new;
source                  boxToCell;
box                     (0.04 0 0)(0.06 100 100);
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
    // coefficients
}

This is useful for simulating moving sources, e.g. in <constant>/fvOptions:

selectionMode   geometric;
selection
{
    cyl1
    {
        action  use;
        source  cylinder;

        point1  (0.05 0.03 -1); // beg point on cylinder axis
        point2  (0.05 0.03  1); // end point on cylinder axis
        radius  0.003;

        solidBodyMotionFunction oscillatingLinearMotion;
        oscillatingLinearMotionCoeffs
        {
            // coefficients
            amplitude       (0 0.02 0);
            omega           0.7;            // rad/s
        }
    }
}

Source code

Tutorial

Gitlab

Improved transformations

TOP

The transformPoints and surfaceTransformPoints utilities are used to transform mesh (or surface) points. The new option -cylToCart applies a cylindrical-to-Cartesian transformation to aid cylindrical mesh generation.

The example below is from the new tutorial $FOAM_TUTORIALS/incompressible/pimpleFoam/RAS/axialTurbine_rotating_oneBlade where the left image shows the components constructed in cylindrical coordinates, and the right image the sections after transformation to Cartesian coordinates.

Tutorial

Source code

Gitlab

Attribution

  • Thanks to Håkan Nilsson for contributing the transformation code