Commit Graph

5951 Commits

Author SHA1 Message Date
f9d575060e reconstructPar: Reinstate support for reconstructing pointLevel and cellLevel files
to be run with the -constant option after reconstructParMesh when reconstructing
a mesh generated by snappyHexMesh in parallel.
2022-06-04 11:15:03 +01:00
e3298597e1 compressibleInterFoam: Register dgdt to ensure it is mapped after mesh topology change 2022-06-04 11:14:26 +01:00
2a2cc976c4 tutorials/incompressible/pimpleFoam/laminar/movingCone: Added Allrun-parallel
to test and demonstrate the run-time mesh-to-mesh mapping in parallel
20220602
2022-05-30 15:20:34 +01:00
50a1522aaa Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-05-30 13:04:34 +01:00
8a517c4732 fvMeshTopoChangers::meshToMesh: Added support for "cutting" patches
These are introduced patches which do not correspond to any existing patches and
instead "cut" the internal mesh, thus requiring mapping from the internal mesh
fields rather than the patch fields.  Cutting patches are specified using the
optional 'cuttingPatches' keyword, e.g. in dynamicMeshDict:

topoChanger
{
    type        meshToMesh;

    libs        ("libmeshToMeshTopoChanger.so");

    cuttingPatches (splitter);

    times       (0.5 1.0);

    timeDelta   1e-6;
}
2022-05-30 13:00:37 +01:00
3e664e9279 mapFieldsPar: Removed unused function 2022-05-30 13:00:22 +01:00
f93300ee11 createBaffles: Simplified input syntax
This utility now always creates two patches, and only creates duplicate
faces when they connect to different cells and point in opposite
directions. Now that ACMI has been removed, there is no need to create
duplicate faces on the same cell and with similar orientations. This is
unituitive and is now considered an invalid mesh topology.

The preferred syntax for createBaffles is now as follows:

    internalFacesOnly true;

    baffles
    {
        cyclics
        {
            type        faceZone;
            zoneName    cyclicFaces;

            owner
            {
                name            cyclicLeft;
                type            cyclic;
                neighbourPatch  cyclicRight;
            }

            neighbour
            {
                name            cyclicRight;
                type            cyclic;
                neighbourPatch  cyclicLeft;
            }
        }
    }

Note that the 'patches' sub-dictionary is not needed any more; the
'owner' and 'neighbour' sub-dictionaries can be in the same dictionary
as the parameters with which faces are selected. For backwards
compatibility, however, a 'patches' sub-dictionary is still permitted,
as are keywords 'master' and 'slave' (in place of 'owner' and
'neighbour', respectively).

The 'patchPairs' syntax has been removed. Whilst consise, this syntax
made a number of assumptions and decisions regarding naming conventions
that were not sufficiently intuitive for the user to understand without
extensive reference to the code. If identical boundaries are desired on
both sides of the patch, dictionary substitution provides a more
intuitive way of minimising the amount of specifiection required. For
example, to create two back-to-back walls, the following specification
could be used:

    internalFacesOnly true;

    fields true;

    baffles
    {
        walls
        {
            type        faceZone;
            zoneName    wallFaces;

            owner
            {
                name            baffleWallLeft;
                type            wall;

                patchFields
                {
                    p
                    {
                        type            zeroGradient;
                    }

                    U
                    {
                        type            noSlip;
                    }
                }
            }

            neighbour
            {
                name            baffleWallRight;
                $owner; // <-- Use the same settings as for the owner
            }
        }
    }
2022-05-27 13:39:34 +01:00
d151a85bf7 tutorials/multiphase/multiphaseEulerFoam/RAS: Updated kineticTheoryModel tutorials 2022-05-27 10:28:48 +01:00
4b907e9bb0 semiPermeableBaffle: Move mapping to patch
This boundary condition no longer stores its own mapping. It now has to
be applied to a mapped wall (or equivalent) patch, which does the
mapping for it. This ensures that mapping information is shared between
multiple fields, and that redundant copies are not generated.
2022-05-26 11:08:43 +01:00
68151b8d01 multiphaseEulerFoam::kineticTheoryModel: Simplified the name of the divDevTau term in fvSchemes
For a single particle phase the divDevTau term in fvSchemes is now specified
thus:

    divDevTau(U.particles)    Gauss linear;

previously:
    div((((thermo:rho.particles*nut.particles)*dev2(T(grad(U.particles))))+(((thermo:rho.particles*lambda.particles)*div(phi.particles))*I))) Gauss linear;
2022-05-26 11:00:16 +01:00
861b7ba2b4 tutorials: Standardised boundary field indentation 2022-05-25 19:41:37 +01:00
141ee94b69 tutorials: Corrected end-of-file delimiter 2022-05-25 17:27:23 +01:00
3b4470d499 multiphaseEulerFoam, MovingPhaseModel: Register fields
All construct-on-demand fields are now registered, so tha they resize
and map appropriately when mesh changes occur
2022-05-25 16:02:57 +01:00
c58fa1c075 fvMeshStitchers::moving: Prevent communication missmatch
The sub mesh on which mesh fluxes are corrected potentially only exists
on a small subset of the processors. This was causing issues when
processor boundaries were evaluated as this triggered the construction
of weights and delta coefficients on only some of the processors,
causing a communications missmatch. This has been resolved by a
pre-emptive call to construct the surface interpolation coefficients.
2022-05-25 16:02:57 +01:00
744924bf69 mixtureKEpsilon: mixture k and epsilon fields are now required
to ensure complex BCs are selected and initialised correctly.

All mixture fields are now constructed and read as required in the construction
of the liquid (phase 1) mixtureKEpsilon model to ensure they are read before
time-increment and possible mesh topology change.
2022-05-25 15:57:33 +01:00
6d3e31f8e0 multiphaseEulerFoam::kineticTheoryModels, phasePressureModel: now use the phase.alphaMax()
rather than read and use a potentially inconsistent local value for alphaMax.
2022-05-25 13:47:18 +01:00
51307a5808 omegaWallFunction: Prevent hangs in cases where some processes have no wall 2022-05-25 10:19:11 +01:00
447ec4b5c2 epsilonWallFunction: Prevent hangs in cases where some processes have no wall 2022-05-24 16:55:45 +01:00
8521cdd0f4 polyMesh: Removed 'virtual' from methods that are never overridden 2022-05-24 14:22:22 +01:00
9302074836 createPatch: Simplification and removed unused dictionaries
The 'pointSync' setting in createPatchDict is now optional and defaults
to false. This setting is very rarely used. A number of unused
'createPatchDict' files have also been removed and obsolete information
has been removed from the annotated example dictionaries.
2022-05-20 14:04:17 +01:00
f54376b20c Code documentation: corrected typos 2022-05-20 10:42:25 +01:00
eb95e3f2c2 etc/templates: updated rotating cases to use non-conformal coupling (NCC) 20220520 2022-05-20 09:56:59 +01:00
d522047f95 etc/templates/singleFluidCHT: split models and constraints into separate files 2022-05-20 09:53:46 +01:00
14be487a80 etc/templates: renamed properties file to 'physicalProperties' 2022-05-20 09:52:23 +01:00
bda6db534f etc/templates: changed 'defaultPatch' to 'internal' type to help detect meshing errors 2022-05-20 09:49:11 +01:00
b439fc1599 polyMesh: Changed the mesh writing following motion and topology change
The mesh will now be written only for the write time following mesh-motion or
topology change (refinement/unrefinement, mesh-to-mesh mapping, load-balancing
etc.) and not for all subsequent time-steps as it did previously.  This reduces
storage and reconstruction effort of changing mesh cases.
2022-05-19 18:20:48 +01:00
8f8fa29e3e createNonConformalCouples: linked genericPatchFields library 2022-05-19 16:42:52 +01:00
2cac6285ea foamCloneCase: -startFrom option to set the time directory
When cloning a case, users can copy the field data from the
from the latest time directory in the source case, using
the -latestTime option.

The -startFrom option enables the copied time directory to be
renamed, often as the '0' (zero) directory in the new case, e.g.

    foamCloneCase -latestTime -startFrom 0 sourceCase newCase

When the time directories in the source and new cases are
different, the uniform directory and flux field "phi" are
deleted from the copied time directory to avoid incorrect
initial state.
2022-05-19 15:30:06 +01:00
94132c3a55 createNonConformalCouples: Added the option to modify fields
This utility can now add boundary conditions to fields which correspond
to the non-conformal patches that it adds to the mesh. This action is
enabled by means of a 'fields true;' flag which can be added to the
'system/createNonConformalCouplesDict'. No additional control is needed,
because all patches created by this utility are of constraint type.
2022-05-19 11:39:31 +01:00
755c0aa869 tutorials: TJunctionFan: Simplified orig usage 2022-05-19 09:50:46 +01:00
5fadb57d5d fvMeshStitcher: Fixed compilation of list reductions with Clang 2022-05-18 16:07:06 +01:00
4ee4477343 meshToMesh: Prevent initialisation failure on conformal sets of cells 2022-05-18 14:45:11 +01:00
2d25eacea8 pointPatchFields: Corrected setInInternalField -> setInternalField 2022-05-18 13:46:49 +01:00
90dffb91af polyBoundaryMesh: Clear patch-face IDs along with patch IDs 2022-05-18 11:47:06 +01:00
b4b8b212bf cyclicACMI, cyclicRepeatAMI: Removed
The functionality provided by 'cyclicACMI' and 'cyclicRepeatAMI' has
been entirely superseded by non-conformal coupled (NCC). All references
to 'cyclicACMI' and 'cyclicRepeatAMI' have therefore been removed.

See previous commits 569fa31d and 420866cf for more explanation,
instructions on updating, and relevant tutorial cases.
2022-05-18 10:26:34 +01:00
420866cfa6 Non-Conformal Coupled (NCC): Conversion of tutorials from AMI to NCC
The following examples in the tutorials ($FOAM_TUTORIALS) directory have
been converted from using AMI to the new NCC system:

+ compressible/rhoPimpleFoam/RAS/annularThermalMixer
+ incompressible/pimpleFoam/RAS/propeller
+ lagrangian/particleFoam/mixerVessel2D (formerly mixerVesselAMI2D)
+ multiphase/interFoam/RAS/mixerVessel
+ multiphase/interFoam/RAS/propeller
+ multiphase/multiphaseEulerFoam/laminar/mixerVessel2D (formerly mixerVesselAMI2D)

The following tutorial has been converted from using ACMI:

+ incompressible/pimpleFoam/RAS/oscillatingInlet

The following tutorial has been converted from using Repeat AMI:

+ incompressible/pimpleFoam/RAS/impeller

The following tutorial has been added to demonstrate NCC's ability to
create a sufficiently conservative solution in a closed domain to
maintain phase fraction boundedness:

+ multiphase/interFoam/laminar/mixerVessel2D

The following tutorials have been added to demonstrate NCC's ability to
simulate partially overlapping couples on curved surfaces:

+ incompressible/pimpleFoam/RAS/ballValve
+ multiphase/compressibleInterFoam/RAS/ballValve

The following tutorial has been added to provide a simple comparison of
the conservation behaviour of AMI and NCC:

+ incompressible/pimpleFoam/laminar/nonConformalChannel

The following tutorial has been removed, as there were sufficiently many
examples involving this geometry:

+ incompressible/pimpleFoam/laminar/mixerVesselAMI2D
2022-05-18 10:25:43 +01:00
569fa31d09 Non-Conformal Coupled (NCC): Conservative coupling of non-conforming patches
This major development provides coupling of patches which are
non-conformal, i.e. where the faces of one patch do not match the faces
of the other. The coupling is fully conservative and second order
accurate in space, unlike the Arbitrary Mesh Interface (AMI) and
associated ACMI and Repeat AMI methods which NCC replaces.

Description:

A non-conformal couple is a connection between a pair of boundary
patches formed by projecting one patch onto the other in a way that
fills the space between them. The intersection between the projected
surface and patch forms new faces that are incorporated into the finite
volume mesh. These new faces are created identically on both sides of
the couple, and therefore become equivalent to internal faces within the
mesh. The affected cells remain closed, meaning that the area vectors
sum to zero for all the faces of each cell. Consequently, the main
benefits of the finite volume method, i.e. conservation and accuracy,
are not undermined by the coupling.

A couple connects parts of mesh that are otherwise disconnected and can
be used in the following ways:

+ to simulate rotating geometries, e.g. a propeller or stirrer, in which
  a part of the mesh rotates with the geometry and connects to a
  surrounding mesh which is not moving;
+ to connect meshes that are generated separately, which do not conform
  at their boundaries;
+ to connect patches which only partially overlap, in which the
  non-overlapped section forms another boundary, e.g. a wall;
+ to simulate a case with a geometry which is periodically repeating by
  creating multiple couples with different transformations between
  patches.

The capability for simulating partial overlaps replaces the ACMI
functionality, currently provided by the 'cyclicACMI' patch type, and
which is unreliable unless the couple is perfectly flat. The capability
for simulating periodically repeating geometry replaces the Repeat AMI
functionality currently provided by the 'cyclicRepeatAMI' patch type.

Usage:

The process of meshing for NCC is very similar to existing processes for
meshing for AMI. Typically, a mesh is generated with an identifiable set
of internal faces which coincide with the surface through which the mesh
will be coupled. These faces are then duplicated by running the
'createBaffles' utility to create two boundary patches. The points are
then split using 'splitBaffles' in order to permit independent motion of
the patches.

In AMI, these patches are assigned the 'cyclicAMI' patch type, which
couples them using AMI interpolation methods.

With NCC, the patches remain non-coupled, e.g. a 'wall' type. Coupling
is instead achieved by running the new 'createNonConformalCouples'
utility, which creates additional coupled patches of type
'nonConformalCyclic'. These appear in the 'constant/polyMesh/boundary'
file with zero faces; they are populated with faces in the finite volume
mesh during the connection process in NCC.

For a single couple, such as that which separates the rotating and
stationary sections of a mesh, the utility can be called using the
non-coupled patch names as arguments, e.g.

    createNonConformalCouples -overwrite rotatingZoneInner rotatingZoneOuter

where 'rotatingZoneInner' and 'rotatingZoneOuter' are the names of the
patches.

For multiple couples, and/or couples with transformations,
'createNonConformalCouples' should be run without arguments. Settings
will then be read from a configuration file named
'system/createNonConformalCouplesDict'. See
'$FOAM_ETC/caseDicts/annotated/createNonConformalCouplesDict' for
examples.

Boundary conditions must be specified for the non-coupled patches. For a
couple where the patches fully overlap, boundary conditions
corresponding to a slip wall are typically applied to fields, i.e
'movingWallSlipVelocity' (or 'slip' if the mesh is stationary) for
velocity U, 'zeroGradient' or 'fixedFluxPressure' for pressure p, and
'zeroGradient' for other fields.  For a couple with
partially-overlapping patches, boundary conditions are applied which
physically represent the non-overlapped region, e.g. a no-slip wall.

Boundary conditions also need to be specified for the
'nonConformalCyclic' patches created by 'createNonConformalCouples'. It
is generally recommended that this is done by including the
'$FOAM_ETC/caseDicts/setConstraintTypes' file in the 'boundaryField'
section of each of the field files, e.g.

    boundaryField
    {
        #includeEtc "caseDicts/setConstraintTypes"

        inlet
        {
             ...
        }

        ...
    }

For moving mesh cases, it may be necessary to correct the mesh fluxes
that are changed as a result of the connection procedure. If the
connected patches do not conform perfectly to the mesh motion, then
failure to correct the fluxes can result in noise in the pressure
solution.

Correction for the mesh fluxes is enabled by the 'correctMeshPhi' switch
in the 'PIMPLE' (or equivalent) section of 'system/fvSolution'. When it
is enabled, solver settings are required for 'MeshPhi'. The solution
just needs to distribute the error enough to dissipate the noise. A
smooth solver with a loose tolerance is typically sufficient, e.g. the
settings in 'system/fvSolution' shown below:

    solvers
    {
        MeshPhi
        {
            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-2;
            relTol          0;
        }
        ...
    }

    PIMPLE
    {
         correctMeshPhi      yes;
         ...
    }

The solution of 'MeshPhi' is an inexpensive computation since it is
applied only to a small subset of the mesh adjacent to the
couple. Conservation is maintained whether or not the mesh flux
correction is enabled, and regardless of the solution tolerance for
'MeshPhi'.

Advantages of NCC:

+ NCC maintains conservation which is required for many numerical
  schemes and algorithms to operate effectively, in particular those
  designed to maintain boundedness of a solution.

+ Closed-volume systems no longer suffer from accumulation or loss of
  mass, poor convergence of the pressure equation, and/or concentration
  of error in the reference cell.

+ Partially overlapped simulations are now possible on surfaces that are
  not perfectly flat. The projection fills space so no overlaps or
  spaces are generated inside contiguously overlapping sections, even if
  those sections have sharp angles.

+ The finite volume faces created by NCC have geometrically accurate
  centres. This makes the method second order accurate in space.

+ The polyhedral mesh no longer requires duplicate boundary faces to be
  generated in order to run a partially overlapped simulation.

+ Lagrangian elements can now transfer across non-conformal couplings in
  parallel.

+ Once the intersection has been computed and applied to the finite
  volume mesh, it can use standard cyclic or processor cyclic finite
  volume boundary conditions, with no need for additional patch types or
  matrix interfaces.

+ Parallel communication is done using the standard
  processor-patch-field system. This is more efficient than alternative
  systems since it has been carefully optimised for use within the
  linear solvers.

+ Coupled patches are disconnected prior to mesh motion and topology
  change and reconnected afterwards. This simplifies the boundary
  condition specification for mesh motion fields.

Resolved Bug Reports:

+ https://bugs.openfoam.org/view.php?id=663
+ https://bugs.openfoam.org/view.php?id=883
+ https://bugs.openfoam.org/view.php?id=887
+ https://bugs.openfoam.org/view.php?id=1337
+ https://bugs.openfoam.org/view.php?id=1388
+ https://bugs.openfoam.org/view.php?id=1422
+ https://bugs.openfoam.org/view.php?id=1829
+ https://bugs.openfoam.org/view.php?id=1841
+ https://bugs.openfoam.org/view.php?id=2274
+ https://bugs.openfoam.org/view.php?id=2561
+ https://bugs.openfoam.org/view.php?id=3817

Deprecation:

NCC replaces the functionality provided by AMI, ACMI and Repeat AMI.
ACMI and Repeat AMI are insufficiently reliable to warrant further
maintenance so are removed in an accompanying commit to OpenFOAM-dev.
AMI is more widely used so will be retained alongside NCC for the next
version release of OpenFOAM and then subsequently removed from
OpenFOAM-dev.
2022-05-18 10:25:43 +01:00
94679fa88d meshTools: Added patchToPatch class for patch mapping 2022-05-18 10:25:42 +01:00
96199075a6 meshTools: Added triIntersect algorithm 2022-05-18 10:25:42 +01:00
967a0257f2 Added vol, surface, and point label fields 2022-05-18 10:25:42 +01:00
583fc4aec0 driftFluxFoam::relativeVelocityModel: Updated dispersed-phase flow acceleration estimate
// Dispersed phase velocity
    // const volVectorField Ud(mixture_.U() + Udm_);

    // Use the mixture rather than the dispersed-phase velocity to approximate
    // the dispersed-phase acceleration to improve stability as only the mixture
    // momentum equation is coupled to continuity and pressure
    //
    // This approximation is valid only in the limit of small drift-velocity.
    // For large drift-velocity an Euler-Euler approach should be used in
    // which both the continuous and dispersed-phase momentum equations are
    // solved and coupled to the pressure.
    const volVectorField& Ud = mixture_.U();

    return g_ - (Ud & fvc::grad(Ud));
2022-05-17 14:01:59 +01:00
0ead4cbc81 driftFluxFoam::mixtureViscosityModels::Quemada: Improved stability in the limit of alpha -> alphaMax 2022-05-17 14:01:24 +01:00
7dd5c4d3fa XiFoam: Removed redundant rhoEqn solution after mesh topology change
Resolves bug-report https://bugs.openfoam.org/view.php?id=3838
2022-05-14 13:00:27 +01:00
590d2ce5d0 Function1, Function2: Improved and standardised usage documentation 2022-05-13 22:23:59 +01:00
16c0c68e92 tutorials: planarCouette: Simplify creation of cyclic patches 2022-05-13 16:17:31 +01:00
e22784f5b2 regionCoupled: Removed unused code 2022-05-12 20:17:18 +01:00
2d1428f667 sampledSurfaces: Added optional "writeEmpty" keyword
This control forces writing of surfaces, even when they have no faces.
This can be useful for smoothly animating isoSurfaces that do not exist
at all write times.

It can be used to force writing of an isoSurface in the following way,
in system/controlDict:

    functions
    {
        #includeFunc isoSurface
        (
            isoField=alpha.water,
            isoValue=0.5,
            writeEmpty=yes
        )
    }
2022-05-12 16:25:23 +01:00
6ebf845bc8 Function1s::squarePulse: Implemented integral 2022-05-12 12:00:20 +01:00
137a40ef56 Documentation: Moved "Notes" entries into the corresponding "Description" or "Usage"
This simplifies parsing the headers and ensures the notes are included in the
text they relate to by both Doxygen and foamInfo.
2022-05-12 09:51:14 +01:00
03211cda95 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-05-11 21:28:42 +01:00