mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'cvm' of /home/noisy3/OpenFOAM/OpenFOAM-dev into cvm
This commit is contained in:
@ -565,8 +565,35 @@ void Foam::conformalVoronoiMesh::createExternalEdgePointGroup
|
||||
const vector& nA = feNormals[edNormalIs[0]];
|
||||
const vector& nB = feNormals[edNormalIs[1]];
|
||||
|
||||
if (mag(nA & nB) > 1 - SMALL)
|
||||
{
|
||||
// The normals are nearly parallel, so this is too sharp a feature to
|
||||
// conform to.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalised distance of reference point from edge point
|
||||
vector refVec((nA + nB)/(1 + (nA & nB)));
|
||||
|
||||
if (magSqr(refVec) > sqr(5.0))
|
||||
{
|
||||
// Limit the size of the conformation
|
||||
ppDist *= 5.0/mag(refVec);
|
||||
|
||||
// Pout<< nl << "createExternalEdgePointGroup limit "
|
||||
// << "edgePt " << edgePt << nl
|
||||
// << "refVec " << refVec << nl
|
||||
// << "mag(refVec) " << mag(refVec) << nl
|
||||
// << "ppDist " << ppDist << nl
|
||||
// << "nA " << nA << nl
|
||||
// << "nB " << nB << nl
|
||||
// << "(nA & nB) " << (nA & nB) << nl
|
||||
// << endl;
|
||||
}
|
||||
|
||||
// Convex. So refPt will be inside domain and hence a master point
|
||||
Foam::point refPt = edgePt - ppDist*(nA + nB)/(1 + (nA & nB) + VSMALL);
|
||||
Foam::point refPt = edgePt - ppDist*refVec;
|
||||
|
||||
// Result when the points are eventually inserted.
|
||||
// Add number_of_vertices() at insertion of first vertex to all numbers:
|
||||
@ -616,8 +643,35 @@ void Foam::conformalVoronoiMesh::createInternalEdgePointGroup
|
||||
const vector& nA = feNormals[edNormalIs[0]];
|
||||
const vector& nB = feNormals[edNormalIs[1]];
|
||||
|
||||
if (mag(nA & nB) > 1 - SMALL)
|
||||
{
|
||||
// The normals are nearly parallel, so this is too sharp a feature to
|
||||
// conform to.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalised distance of reference point from edge point
|
||||
vector refVec((nA + nB)/(1 + (nA & nB)));
|
||||
|
||||
if (magSqr(refVec) > sqr(5.0))
|
||||
{
|
||||
// Limit the size of the conformation
|
||||
ppDist *= 5.0/mag(refVec);
|
||||
|
||||
// Pout<< nl << "createInternalEdgePointGroup limit "
|
||||
// << "edgePt " << edgePt << nl
|
||||
// << "refVec " << refVec << nl
|
||||
// << "mag(refVec) " << mag(refVec) << nl
|
||||
// << "ppDist " << ppDist << nl
|
||||
// << "nA " << nA << nl
|
||||
// << "nB " << nB << nl
|
||||
// << "(nA & nB) " << (nA & nB) << nl
|
||||
// << endl;
|
||||
}
|
||||
|
||||
// Concave. master and reflected points inside the domain.
|
||||
Foam::point refPt = edgePt - ppDist*(nA + nB)/(1 + (nA & nB) + VSMALL);
|
||||
Foam::point refPt = edgePt - ppDist*refVec;
|
||||
|
||||
// Generate reflected master to be outside.
|
||||
Foam::point reflMasterPt = refPt + 2*(edgePt - refPt);
|
||||
@ -628,7 +682,7 @@ void Foam::conformalVoronoiMesh::createInternalEdgePointGroup
|
||||
Foam::point reflectedB = reflMasterPt - 2*ppDist*nB;
|
||||
|
||||
scalar totalAngle =
|
||||
radToDeg(constant::mathematical::pi + acos(mag(nA & nB)));
|
||||
radToDeg(constant::mathematical::pi + acos(nA & nB));
|
||||
|
||||
// Number of quadrants the angle should be split into
|
||||
int nQuads = int(totalAngle/cvMeshControls().maxQuadAngle()) + 1;
|
||||
|
||||
@ -1630,12 +1630,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
|
||||
}
|
||||
}
|
||||
|
||||
if (checkFaces.size() < fAreas.size())
|
||||
{
|
||||
Info<< "Excluding "
|
||||
<< returnReduce(fAreas.size() - checkFaces.size(), sumOp<label>())
|
||||
<< " faces from check, < " << faceAreaLimit << " area" << endl;
|
||||
}
|
||||
Info<< "Excluding "
|
||||
<< returnReduce(fAreas.size() - checkFaces.size(), sumOp<label>())
|
||||
<< " faces from check, < " << faceAreaLimit << " area" << endl;
|
||||
|
||||
motionSmoother::checkMesh
|
||||
(
|
||||
|
||||
@ -696,10 +696,13 @@ void Foam::conformalVoronoiMesh::findRemainingProtrusionSet
|
||||
}
|
||||
}
|
||||
|
||||
if (returnReduce(protrudingCells.size(), sumOp<label>()) > 0)
|
||||
label protrudingCellsSize = protrudingCells.size();
|
||||
|
||||
reduce(protrudingCellsSize, sumOp<label>());
|
||||
|
||||
if (protrudingCellsSize > 0)
|
||||
{
|
||||
Info<< nl << "Found "
|
||||
<< returnReduce(protrudingCells.size(), sumOp<label>())
|
||||
Info<< nl << "Found " << protrudingCellsSize
|
||||
<< " cells protruding from the surface, writing cellSet "
|
||||
<< protrudingCells.name()
|
||||
<< endl;
|
||||
|
||||
Reference in New Issue
Block a user