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:
Will Bainbridge
2024-05-09 12:26:09 +01:00
parent cdef200385
commit 47fa9bc620
18 changed files with 74 additions and 23 deletions

View File

@ -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,