snappyHexMesh: Corrected use of layer featureAngle
The 'featureAngle' control defines the included angle between faces above which layer extrusion is prevented. Its use within snappyHexMesh was incorrect in that the cosine was not being taken before being compared to dot products of face normals. This has now been corrected. Existing 'featureAngle' settings may need changing to recover equivalent behaviour. Any angle previously set to 58 degrees or above previously resulted in no reduction of layer coverage. A large angle between 90 and 180 degrees is likely to be an appropriate replacement for cases such as this. Angles previously set to 57 degrees and below can be equivalently replaced by a value of (180/pi)*arccos(<angle>*(pi/180)). Note that changing the feature angle also affects the slip feature angle. The slip feature angle is taken to be half the feature angle if a 'slipFeatureAngle' is not specified.
This commit is contained in:
@ -412,7 +412,7 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 130;
|
||||
featureAngle 100;
|
||||
|
||||
// Stop layer growth on highly warped cells
|
||||
maxFaceThicknessRatio 0.5;
|
||||
|
||||
@ -2793,9 +2793,8 @@ void Foam::snappyLayerDriver::mergePatchFacesUndo
|
||||
const dictionary& motionDict
|
||||
)
|
||||
{
|
||||
// Clip to 30 degrees. Not helpful!
|
||||
// scalar planarAngle = min(30.0, layerParams.featureAngle());
|
||||
scalar planarAngle = layerParams.featureAngle();
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(planarAngle));
|
||||
|
||||
scalar concaveCos = Foam::cos(degToRad(layerParams.concaveAngle()));
|
||||
@ -2990,7 +2989,7 @@ void Foam::snappyLayerDriver::addLayers
|
||||
(
|
||||
pp,
|
||||
meshEdges,
|
||||
degToRad(layerParams.featureAngle()),
|
||||
Foam::cos(degToRad(layerParams.featureAngle())),
|
||||
|
||||
patchDisp,
|
||||
patchNLayers,
|
||||
|
||||
@ -227,7 +227,8 @@ addLayersControls
|
||||
finalLayerThickness 0.3;
|
||||
minThickness 0.1;
|
||||
nGrow 0;
|
||||
featureAngle 30;
|
||||
featureAngle 60;
|
||||
slipFeatureAngle 15;
|
||||
nRelaxIter 3;
|
||||
nSmoothSurfaceNormals 1;
|
||||
nSmoothNormals 3;
|
||||
|
||||
@ -288,7 +288,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
@ -317,7 +321,6 @@ addLayersControls
|
||||
// Create buffer region for new layer terminations
|
||||
nBufferCellsNoExtrude 0;
|
||||
|
||||
|
||||
// Overall max number of layer addition iterations. The mesher will exit
|
||||
// if it reaches this number of iterations; possibly with an illegal
|
||||
// mesh.
|
||||
|
||||
@ -200,10 +200,10 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle.
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
|
||||
@ -223,7 +223,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -247,10 +247,10 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle.
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
|
||||
@ -333,7 +333,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 30;
|
||||
featureAngle 60;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 15;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -265,7 +265,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -211,7 +211,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -197,7 +197,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -197,7 +197,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -197,7 +197,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -231,7 +231,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 30;
|
||||
featureAngle 60;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 15;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -196,7 +196,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -231,7 +231,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 60;
|
||||
featureAngle 100;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 30;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -333,7 +333,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 30;
|
||||
featureAngle 60;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 15;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
@ -234,7 +234,11 @@ addLayersControls
|
||||
|
||||
// When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||
// are perpendicular
|
||||
featureAngle 30;
|
||||
featureAngle 60;
|
||||
|
||||
// At non-patched sides allow mesh to slip if extrusion direction makes
|
||||
// angle larger than slipFeatureAngle. Default is 0.5*featureAngle.
|
||||
slipFeatureAngle 15;
|
||||
|
||||
// Maximum number of snapping relaxation iterations. Should stop
|
||||
// before upon reaching a correct mesh.
|
||||
|
||||
Reference in New Issue
Block a user