Commit aa7be71d authored by mattijs's avatar mattijs
Browse files

problem cell deletion

parent a5b60b17
......@@ -131,6 +131,12 @@ castellatedMeshControls
level (3 3);
}
}
// Optional angle to detect small-large cell situation perpendicular
// to the surface. Is the angle of face w.r.t the local surface
// normal. Use on flat(ish) surfaces only. Otherwise
// leave out or set to negative number.
//perpendicularAngle 10;
}
}
......@@ -317,9 +323,9 @@ meshQualityControls
minTriangleTwist -1;
//- if >0 : preserve single cells with all points on the surface if the
// resulting volume after snapping is larger than minVolFraction times old
// volume. If <0 : delete always.
minVolFraction 0.1;
// resulting volume after snapping (approximation) is larger than
// minVolFraction times old volume. If <0 : delete always.
minVolFraction 0.5;
// Advanced
......
......@@ -58,35 +58,6 @@ defineTypeNameAndDebug(autoSnapDriver, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::autoSnapDriver::getZonedSurfaces
(
labelList& zonedSurfaces,
labelList& unzonedSurfaces
) const
{ // Surfaces with zone information
const wordList& faceZoneNames = meshRefiner_.surfaces().faceZoneNames();
zonedSurfaces.setSize(faceZoneNames.size());
label zonedI = 0;
unzonedSurfaces.setSize(faceZoneNames.size());
label unzonedI = 0;
forAll(faceZoneNames, surfI)
{
if (faceZoneNames[surfI].size())
{
zonedSurfaces[zonedI++] = surfI;
}
else
{
unzonedSurfaces[unzonedI++] = surfI;
}
}
zonedSurfaces.setSize(zonedI);
unzonedSurfaces.setSize(unzonedI);
}
// Get faces to repatch. Returns map from face to patch.
Foam::Map<Foam::label> Foam::autoSnapDriver::getZoneBafflePatches
(
......@@ -711,9 +682,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::createZoneBaffles
List<labelPair>& baffles
)
{
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
labelList zonedSurfaces = meshRefiner_.surfaces().getNamedSurfaces();
autoPtr<mapPolyMesh> map;
......@@ -798,9 +767,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::mergeZoneBaffles
const List<labelPair>& baffles
)
{
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
labelList zonedSurfaces = meshRefiner_.surfaces().getNamedSurfaces();
autoPtr<mapPolyMesh> map;
......@@ -1048,9 +1015,10 @@ Foam::vectorField Foam::autoSnapDriver::calcNearestSurface
labelList snapSurf(localPoints.size(), -1);
// Divide surfaces into zoned and unzoned
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
labelList zonedSurfaces =
meshRefiner_.surfaces().getNamedSurfaces();
labelList unzonedSurfaces =
meshRefiner_.surfaces().getUnnamedSurfaces();
// 1. All points to non-interface surfaces
......@@ -1368,9 +1336,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::repatchToSurface
indirectPrimitivePatch& pp = ppPtr();
// Divide surfaces into zoned and unzoned
labelList zonedSurfaces;
labelList unzonedSurfaces;
getZonedSurfaces(zonedSurfaces, unzonedSurfaces);
labelList zonedSurfaces = meshRefiner_.surfaces().getNamedSurfaces();
labelList unzonedSurfaces = meshRefiner_.surfaces().getUnnamedSurfaces();
// Faces that do not move
......
......@@ -84,9 +84,6 @@ class autoSnapDriver
// Snapping
//- Split surfaces into non-zoned and zones ones
void getZonedSurfaces(labelList&, labelList&) const;
//- Get faces to repatch. Returns map from face to patch.
Map<label> getZoneBafflePatches(const bool allowBoundary) const;
......
......@@ -374,11 +374,28 @@ private:
const labelList&
) const;
bool isCollapsedFace
(
const pointField&,
const pointField& neiCc,
const scalar minFaceArea,
const scalar maxNonOrtho,
const label faceI
) const;
bool isCollapsedCell
(
const pointField&,
const scalar volFraction,
const label cellI
) const;
//- Returns list with for every internal face -1 or the patch
// they should be baffled into. If removeEdgeConnectedCells is set
// removes cells based on perpendicularAngle.
labelList markFacesOnProblemCells
(
const dictionary& motionDict,
const bool removeEdgeConnectedCells,
const scalarField& perpendicularAngle,
const labelList& globalToPatch
......
......@@ -1503,6 +1503,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
(
markFacesOnProblemCells
(
motionDict,
removeEdgeConnectedCells,
perpendicularAngle,
globalToPatch
......@@ -1548,6 +1549,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
(
markFacesOnProblemCells
(
motionDict,
removeEdgeConnectedCells,
perpendicularAngle,
globalToPatch
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment