mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: checkMesh: add stabilisation. Fixes #2171
This commit is contained in:
@ -180,7 +180,7 @@ void Foam::writeFields
|
||||
(
|
||||
radToDeg
|
||||
(
|
||||
Foam::acos(min(scalar(1), faceOrthogonality))
|
||||
Foam::acos(min(scalar(1), max(scalar(-1), faceOrthogonality)))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -117,8 +117,16 @@ Foam::tmp<Foam::surfaceScalarField> Foam::basicFvGeometryScheme::weights() const
|
||||
// but the result will be poor.
|
||||
scalar SfdOwn = mag(Sf[facei] & (Cf[facei] - C[owner[facei]]));
|
||||
scalar SfdNei = mag(Sf[facei] & (C[neighbour[facei]] - Cf[facei]));
|
||||
|
||||
if (mag(SfdOwn + SfdNei) > ROOTVSMALL)
|
||||
{
|
||||
w[facei] = SfdNei/(SfdOwn + SfdNei);
|
||||
}
|
||||
else
|
||||
{
|
||||
w[facei] = 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
surfaceScalarField::Boundary& wBf = weights.boundaryFieldRef();
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -101,15 +101,22 @@ void Foam::cellAspectRatio::calcAspectRatio()
|
||||
}
|
||||
sumA /= cFaces.size();
|
||||
|
||||
aRatio[celli] = 1.0;
|
||||
if (sumA > ROOTVSMALL)
|
||||
{
|
||||
// Local length scale
|
||||
const scalar length = cellVolumes[celli]/sumA;
|
||||
|
||||
if (length > ROOTVSMALL)
|
||||
{
|
||||
// Max edge length
|
||||
maxMag = Foam::sqrt(maxMag);
|
||||
|
||||
//aRatio[celli] = Foam::sqrt(4.0/3.0)*maxMag/length;
|
||||
aRatio[celli] = 2.0*maxMag/length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user