mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: foamyHexMesh: Normalise the aspect ratio direction
This commit is contained in:
@ -40,11 +40,15 @@ Foam::cellAspectRatioControl::cellAspectRatioControl
|
||||
aspectRatioDict_.lookupOrDefault<vector>
|
||||
(
|
||||
"aspectRatioDirection",
|
||||
vector(0, 0, 0)
|
||||
vector::zero
|
||||
)
|
||||
)
|
||||
{
|
||||
Info<< nl << "Cell Aspect Ratio Control" << nl
|
||||
// Normalise the direction
|
||||
aspectRatioDirection_ /= mag(aspectRatioDirection_) + SMALL;
|
||||
|
||||
Info<< nl
|
||||
<< "Cell Aspect Ratio Control" << nl
|
||||
<< " Ratio : " << aspectRatio_ << nl
|
||||
<< " Direction : " << aspectRatioDirection_
|
||||
<< endl;
|
||||
@ -66,20 +70,18 @@ void Foam::cellAspectRatioControl::updateCellSizeAndFaceArea
|
||||
scalar& targetCellSize
|
||||
) const
|
||||
{
|
||||
const scalar cosAngle = mag
|
||||
(
|
||||
vectorTools::cosPhi(alignmentDir, aspectRatioDirection_)
|
||||
);
|
||||
const scalar cosAngle =
|
||||
mag(vectorTools::cosPhi(alignmentDir, aspectRatioDirection_));
|
||||
|
||||
// Change target face area based on aspect ratio
|
||||
targetFaceArea +=
|
||||
targetFaceArea
|
||||
+= targetFaceArea
|
||||
*(aspectRatio_ - 1.0)
|
||||
*(1.0 - cosAngle);
|
||||
|
||||
// Change target cell size based on aspect ratio
|
||||
targetCellSize +=
|
||||
targetCellSize
|
||||
+= targetCellSize
|
||||
*(aspectRatio_ - 1.0)
|
||||
*cosAngle;
|
||||
|
||||
@ -95,12 +97,11 @@ void Foam::cellAspectRatioControl::updateDeltaVector
|
||||
vector& delta
|
||||
) const
|
||||
{
|
||||
const scalar cosAngle = mag
|
||||
(
|
||||
vectorTools::cosPhi(alignmentDir, aspectRatioDirection_)
|
||||
);
|
||||
const scalar cosAngle =
|
||||
mag(vectorTools::cosPhi(alignmentDir, aspectRatioDirection_));
|
||||
|
||||
delta += 0.5
|
||||
delta +=
|
||||
0.5
|
||||
*delta
|
||||
*cosAngle
|
||||
*(targetCellSize/rABMag)
|
||||
|
||||
@ -56,7 +56,7 @@ class cellAspectRatioControl
|
||||
|
||||
const scalar aspectRatio_;
|
||||
|
||||
const vector aspectRatioDirection_;
|
||||
vector aspectRatioDirection_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -73,10 +73,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
cellAspectRatioControl
|
||||
(
|
||||
const dictionary& motionDict
|
||||
);
|
||||
cellAspectRatioControl(const dictionary& motionDict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
Reference in New Issue
Block a user