Robustness improvement in donorBasedLayeredOverlapFringe
Looking at bounding box of the connected region to determine whether we are going in the right direction.
This commit is contained in:
parent
0590d254e0
commit
9e1470a06d
2 changed files with 40 additions and 3 deletions
|
@ -331,6 +331,10 @@ void Foam::donorBasedLayeredOverlapFringe::calcAddressing() const
|
|||
const unallocLabelList& owner = mesh.faceOwner();
|
||||
const unallocLabelList& neighbour = mesh.faceNeighbour();
|
||||
|
||||
// Get bounding box of this region for additional check when marking
|
||||
// acceptors
|
||||
const boundBox& bb = allRegions[regionID].globalBounds();
|
||||
|
||||
// Mark cells that are eligible to be acceptors (not donors)
|
||||
boolList eligibleCells(mesh.nCells(), true);
|
||||
forAllConstIter (labelHashSet, donors, iter)
|
||||
|
@ -371,11 +375,16 @@ void Foam::donorBasedLayeredOverlapFringe::calcAddressing() const
|
|||
mag(faceCentre - centrePoint);
|
||||
|
||||
if
|
||||
(
|
||||
// First, distance based criterium
|
||||
(
|
||||
faceCentreToRegionCentreDist
|
||||
- donorCentreToRegionCentreDist
|
||||
< distTol_
|
||||
)
|
||||
// Second, bounding box based criterium
|
||||
&& (bb.contains(faceCentre))
|
||||
)
|
||||
{
|
||||
// Face is closer to the centre point than cell: we
|
||||
// are moving in the right direction. Mark the face
|
||||
|
@ -681,6 +690,27 @@ Foam::donorBasedLayeredOverlapFringe::donorBasedLayeredOverlapFringe
|
|||
<< "The number should be greater than 0."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Recommendation: use at least two layers in order to avoid going defining
|
||||
// acceptors on the wrong side and filling in the whole region with holes
|
||||
if (nLayers_ == 1)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"donorBasedLayeredOverlapFringe::"
|
||||
"donorBasedLayeredOverlapFringe\n"
|
||||
"(\n"
|
||||
" const fvMesh& mesh,\n"
|
||||
" const oversetRegion& region,\n"
|
||||
" const dictionary& dict\n"
|
||||
")"
|
||||
) << "It is recommended to use at least 2 layers (nLayers = 2) in"
|
||||
<< " order to avoid defining acceptor cells on the wrong side"
|
||||
<< " of the region."
|
||||
<< nl
|
||||
<< "Be sure to check the fringe layer for this region."
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,13 @@ Description
|
|||
each other (e.g. 10:1 cell ratio, where the finer cells are found on the
|
||||
background mesh will probably be problematic to correctly set-up).
|
||||
|
||||
Note: based on distance tolerance (see distTol_ member), specified number of
|
||||
layers and the bounding box of the connected donor region, it is possible
|
||||
that acceptors end also on the wrong side (from the region centre as opposed
|
||||
to towards the region centre). I do all I can to prevent this by looking at
|
||||
the bounding box and hinting that at least 2 layers should be used. Be sure
|
||||
to check the overset assembly for this region using calcOverset utility.
|
||||
|
||||
Author
|
||||
Vuko Vukcevic, Wikki Ltd. All rights reserved.
|
||||
|
||||
|
|
Reference in a new issue