BUG: Fixes bug in plicRDF interface reconstruction across cyclic boundaries (fixes #3279)

Description:
The plicRDF interface reconstruction scheme calculates a reconstructed distance
function (RDF) in all interface cells and their point neighbours.
In point neighbours to interface cells, the RDF is calculated as a weighted
average of the distances to all adjacent interface cell centres with the weight
being the inverse distance to the cell centre.
By using the zoneDistribute class written by Henning Scheufler, the required
stencil data is communicated efficiently for stencil cells living on different
sides of one or more processor patches.
Some of the data required for the RDF reconstruction are cell centre and
interface centre positions. When a stencil extends across a cyclic patch these
positions have so far not been properly transformed in OpenFOAM. This issue is
fixed by the current contribution.
The fix is done by modifying the zoneDistribute class to hold the required
information about zone cells adjacent to cyclic patches. Positions are then
communicated with a new getPosition function which replaces getValue for
position data in the reconstructedDistanceFunction and plicRDF classes.
The implementation does not change the behaviour for cells not on
a cyclic patch and should have insignificant effect on efficiency for these.
The implementation can probably be optimised in terms of efficiency for zone
cells on cyclic patches, but we note that there are generally only very few of
these (interface cells and their point neighbours on cyclic patches) and so
the potential for speedup is expected to be limited.

Current limitations:

- In parallel, the user must constrain the decomposition to preserve cyclic
patches on the same processor, for the implementation to work properly.
  - See an example here: tutorials/discInConstantFlowCyclicBCs/system/decomposeParDict
- In the case of parallel rotational cyclics that are split by the decomposition
the current bugfix does not work and therefore throws an error. This is ongoing
work and should be reported and fixed by a future patch.

For further details, please see the modified files and the comments therein:
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.H
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistributeI.H
- $FOAM_SRC/transportModels/geometricVoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C
- $FOAM_SRC/src/transportModels/geometricVoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C

Co-authored-by: David Müller <> KIT
Co-authored-by: Konstantinos Missios <> Roskilde University
Co-authored-by: Johan Roenby <> Roskilde University and STROMNING
This commit is contained in:
Johan Roenby
2025-01-10 15:32:29 +00:00
committed by Kutalmis Bercin
parent cb1aa273fd
commit 4fe3f55e4d
10 changed files with 424 additions and 18 deletions

View File

@ -5,4 +5,6 @@ cd "${0%/*}" || exit # Run from this directory
cleanCase0
rm -f Phase1
#------------------------------------------------------------------------------

View File

@ -5,10 +5,20 @@ cd "${0%/*}" || exit # Run from this directory
restore0Dir
touch case.foam
runApplication blockMesh
runApplication setAlphaField
runApplication $(getApplication)
runApplication decomposePar
runParallel $(getApplication)
grep "Phase-1" log.$(getApplication) | cut -d' ' -f5 > Phase1
echo "Volume conservation:"
echo "Initial Phase-1: " $(head -1 Phase1)
echo "Final Phase-1 : " $(tail -1 Phase1)
#------------------------------------------------------------------------------

View File

@ -35,7 +35,7 @@ purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writePrecision 12;
writeCompression off;

View File

@ -24,5 +24,13 @@ coeffs
n ( 2 1 2 );
}
constraints
{
preservePatches
{
type preservePatches;
patches (left right top bottom);
}
}
// ************************************************************************* //

View File

@ -22,10 +22,10 @@ solvers
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
snapTol 1e-10;
snapTol 0;
nAlphaBounds 3;
clip true;
reconstructionScheme isoAlpha; // isoAlpha
clip false;
reconstructionScheme plicRDF;
nAlphaSubCycles 1;
cAlpha 1; // Read but not used by interIsoFoam