Files
OpenFOAM-12/tutorials/modules/CHT
Will Bainbridge 8d229041dd mappedPatchBase: Separated into mapped and mappedInternal
The mappedPatchBase has been separated into a type which maps from
another patch (still called mappedPatchBase) and one that maps from
internal cell values (mappedInternalPatchBase). This prevents the user
needing to specify settings for mapping procedures that are not being
used, and potentially don't even make sense given the context in which
they are being applied. It also removes a lot of fragile logic and error
states in the mapping engine and its derivatives regarding the mode of
operation. Mapping from any face in the boundary is no longer supported.

Most region-coupling mapping patches are generated automatically by
utilities like splitMeshRegions and extrudeToRegionMesh. Cases which
create region-coupling mapped patches in this way will likely require no
modification.

Explicitly user-specified mapping will need modifying, however. For
example, where an inlet boundary is mapped to a downstream position in
order to evolve a developed profile. Or if a multi-region simulation is
constructed manually, without using one of the region-generating
utilities.

The available mapped patch types are now as follows:

  - mapped: Maps values from one patch to another. Typically used for
    inlets and outlets; to map values from an outlet patch to an inlet
    patch in order to evolve a developed inlet profile, or to permit
    flow between regions. Example specification in blockMesh:

        inlet
        {
            type    mapped;
            neighbourRegion region0;  // Optional. Defaults to the same
                                      // region as the patch.
            neighbourPatch outlet;
            faces   ( ... );
        }

    Note that any transformation between the patches is now determined
    automatically. Alternatively, it can be explicitly specified using
    the same syntax as for cyclic patches. The "offset" and "distance"
    keywords are no longer used.

  - mappedWall: As mapped, but treated as a wall for the purposes of
    modelling (wall distance). No transformation. Typically used for
    thermally coupling different regions. Usually created automatically
    by meshing utilities. Example:

        fluid_to_solid
        {
            type    mappedWall;
            neighbourRegion solid;
            neighbourPatch solid_to_fluid;
            method  intersection;     // The patchToPatch method. See
                                      // below.
            faces   ( ... );
        }

  - mappedExtrudedWall: As mapped wall, but with corrections to account
    for the thickness of an extruded mesh. Used for region coupling
    involving film and thermal baffle models. Almost always generated
    automatically by extrudeToRegionMesh (so no example given).

  - mappedInternal: Map values from internal cells to a patch. Typically
    used for inlets; to map values from internal cells to the inlet in
    order to evolve a developed inlet profile. Example:

        inlet
        {
            type    mappedInternal;
            distance 0.05;            // Normal distance from the patch
                                      // from which to map cell values
            //offset  (0.05 0 0);     // Offset from the patch from
                                      // which to map cell values
            faces   ( ... );
        }

    Note that an "offsetMode" entry is no longer necessary. The mode
    will be inferred from the presence of the distance or offset
    entries. If both are provided, then offsetMode will also be required
    to choose which setting applies.

The mapped, mappedWall and mappedExtrudedWall patches now permit
specification of a "method". This selects a patchToPatch object and
therefore determines how values are transferred or interpolated between
the patches. Valid options are:

  - nearest: Copy the value from the nearest face in the neighbouring
    patch.

  - matching: As nearest, but with checking to make sure that the
    mapping is one-to-one. This is appropriate for patches that are
    identically meshed.

  - inverseDistance: Inverse distance weighting from a small stencil of
    nearby faces in the neighbouring patch.

  - intersection: Weighting based on the overlapping areas with faces in
    the neighbouring patch. Equivalent to the previous AMI-based mapping
    mode.

If a method is not specfied, then the pre-existing approach will apply.
This should be equivalent to the "nearest" method (though in most such
cases, "matching" is probably more appropriate). This fallback may be
removed in the future once the patchToPatch methods have been proven
robust.

The important mapped boundary conditions are now as follows:

  - mappedValue: Maps values from one patch to another, and optionally
    modify the mapped values to recover a specified average. Example:

        inlet
        {
            type    mappedValue;
            field   U;                // Optional. Defaults to the same
                                      // as this field.
            average (10 0 0);         // The presence of this entry now
                                      // enables setting of the average,
                                      // so "setAverage" is not needed
            value   uniform 0.1;
        }

  - mappedInternalValue: Map values from cells to a patch, and
    optionally specify the average as in mappedValue. Example:

        inlet
        {
            type    mappedValue;
            field   k;                // Optional. Defaults to the same
                                      // as this field.
            interpolationScheme cell;
            value   uniform 0.1;
        }

  - mappedFlowRateVelocity: Maps the flow rate from one patch to
    another, and use this to set a patch-normal velocity. Example:

        inlet
        {
            type    mappedFlowRate;
            value   uniform (0 0 0);
        }

Of these, mappedValue and mappedInternalValue can override the
underlying mapped patch's settings by additionally specifying mapping
information (i.e., the neighbourPatch, offset, etc... settings usually
supplied for the patch). This also means these boundary condtions can be
applied to non-mapped patches. This functionality used to be provided
with a separate "mappedField" boundary condition, which has been removed
as it is no longer necessary.

Other mapped boundary conditions are either extremely niche (e.g.,
mappedVelocityFlux), are always automatically generated (e.g.,
mappedValueAndPatchInternalValue), or their usage has not changed (e.g.,
compressible::turbulentTemperatureCoupledBaffleMixed and
compressible::turbulentTemperatureRadCoupledMixed). Use foamInfo to
obtain further details about these conditions.
2022-09-09 10:03:58 +01:00
..