Commit 2de68a9a authored by mattijs's avatar mattijs
Browse files

BUG: snappyHexMesh: minThickness > 1 caused truncation of layers

The start of the layer addition loop does a synchronisation of the wanted
displacement. This also does a truncation of the displacement if it is <
minThickness. At the first iteration the displacement was initialised to
vector::one which might trigger the truncation logic (and then disable
extrusion altogether). Instead we now initialise the displacement to
vector::GREAT before entering the synchronisation.
parent 4d1159e6
......@@ -3068,8 +3068,10 @@ void Foam::autoLayerDriver::addLayers
)
);
// Displacement for all pp.localPoints.
vectorField patchDisp(pp().nPoints(), vector::one);
// Displacement for all pp.localPoints. Set to large value to
// avoid truncation in syncPatchDisplacement because of
// minThickness.
vectorField patchDisp(pp().nPoints(), vector(GREAT, GREAT, GREAT));
labelList patchNLayers(pp().nPoints(), 0);
label nIdealTotAddedCells = 0;
List<extrudeMode> extrudeStatus(pp().nPoints(), EXTRUDE);
......@@ -3086,6 +3088,8 @@ void Foam::autoLayerDriver::addLayers
nIdealTotAddedCells
);
// Make sure displacement is equal on both sides of coupled patches.
// Note that we explicitly disable the minThickness truncation
// of the patchDisp here.
syncPatchDisplacement
(
pp,
......@@ -3297,8 +3301,9 @@ void Foam::autoLayerDriver::addLayers
// Point-wise extrusion data
// ~~~~~~~~~~~~~~~~~~~~~~~~~
// Displacement for all pp.localPoints.
vectorField patchDisp(pp().nPoints(), vector::one);
// Displacement for all pp.localPoints. Set to large value so does
// not trigger the minThickness truncation (see syncPatchDisplacement below)
vectorField patchDisp(pp().nPoints(), vector(GREAT, GREAT, GREAT));
// Number of layers for all pp.localPoints. Note: only valid if
// extrudeStatus = EXTRUDE.
......@@ -3533,6 +3538,9 @@ void Foam::autoLayerDriver::addLayers
// Make sure displacement is equal on both sides of coupled patches.
// Note that this also does the patchDisp < minThickness truncation
// so for the first pass make sure the patchDisp is larger than
// that.
syncPatchDisplacement
(
pp,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment