Robustness improvement for layer addition/removal triggering

This commit is contained in:
Hrvoje Jasak 2018-04-12 14:05:28 +01:00
parent c52c51e367
commit efcc2b1b7d
3 changed files with 39 additions and 15 deletions

View file

@ -87,7 +87,7 @@ void Foam::layerAdditionRemoval::addCellLayer
{
extrusionDir[mpI] = points[ptc[mpI]] - points[mp[mpI]];
}
extrusionDir *= addDelta_*maxLayerThickness_;
extrusionDir *= addDelta_()*maxLayerThickness_;
}
else
{
@ -118,7 +118,7 @@ void Foam::layerAdditionRemoval::addCellLayer
polyAddPoint
(
points[mp[pointI]] // point
// + addDelta_*maxLayerThickness_*extrusionDir[pointI],
// + addDelta_()*maxLayerThickness_*extrusionDir[pointI],
+ extrusionDir[pointI],
mp[pointI], // master point
-1, // zone for point

View file

@ -48,8 +48,19 @@ namespace Foam
}
const Foam::scalar Foam::layerAdditionRemoval::addDelta_ = 0.3;
const Foam::scalar Foam::layerAdditionRemoval::removeDelta_ = 0.1;
const Foam::debug::tolerancesSwitch
Foam::layerAdditionRemoval::motionDelta_
(
"layerAdditionRemoval::motionDelta",
0.01
);
const Foam::debug::tolerancesSwitch
Foam::layerAdditionRemoval::addDelta_
(
"layerAdditionRemoval::addDelta",
0.3
);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -354,7 +365,12 @@ bool Foam::layerAdditionRemoval::changeTopology() const
topologicalChange = false;
}
else if (avgDelta < oldLayerThickness_)
// New criterion to avoid round-off triggering layer addition/removal
// HJ, 30/Mar/2018
else if
(
(oldLayerThickness_ - avgDelta) > motionDelta_()*minLayerThickness_
)
{
// Layers moving towards removal
if (minDelta < minLayerThickness_)
@ -397,7 +413,12 @@ bool Foam::layerAdditionRemoval::changeTopology() const
oldLayerThickness_ = avgDelta;
}
}
else
// New criterion to avoid round-off triggering layer addition/removal
// HJ, 30/Mar/2018
else if
(
(avgDelta - oldLayerThickness_) > motionDelta_()*minLayerThickness_
)
{
// Layers moving towards addition
if (maxDelta > maxLayerThickness_)
@ -422,6 +443,8 @@ bool Foam::layerAdditionRemoval::changeTopology() const
oldLayerThickness_ = avgDelta;
}
}
// else the motion change is smaller than the tolerance and the layer
// interface is practically static. HJ, 30/Mar/2018
return topologicalChange;
}

View file

@ -40,6 +40,7 @@ SourceFiles
#include "polyMeshModifier.H"
#include "primitiveFacePatch.H"
#include "ZoneIDs.H"
#include "tolerancesSwitch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -128,13 +129,14 @@ class layerAdditionRemoval
// Static data members
//- Thickness insertion fraction for the pre-motion
static const scalar addDelta_;
//- Motion detection fraction: if the motion is smaller than
// motionDelta*minLayerThickness_, it is assumed that the mesh is
// not layering
static const debug::tolerancesSwitch motionDelta_;
//- Thickness insertion fraction for the pre-motion
static const debug::tolerancesSwitch addDelta_;
//- Thickness removal fraction for the cell collapse
// Note: the cell will be collapsed to this relative
// thickness before the layer is removed.
static const scalar removeDelta_;
public:
@ -166,8 +168,7 @@ public:
);
// Destructor
//- Destructor
virtual ~layerAdditionRemoval();