mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: initial support for cyclicSlip
This commit is contained in:
@ -1047,7 +1047,12 @@ void Foam::autoRefineDriver::splitAndMergeBaffles
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove any now dangling parts
|
// Remove any now dangling parts
|
||||||
meshRefiner_.splitMeshRegions(refineParams.keepPoints()[0]);
|
meshRefiner_.splitMeshRegions
|
||||||
|
(
|
||||||
|
globalToMasterPatch_,
|
||||||
|
globalToSlavePatch_,
|
||||||
|
refineParams.keepPoints()[0]
|
||||||
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,7 +131,7 @@ void Foam::meshRefinement::calcNeighbourData
|
|||||||
// Other cell more refined. Adjust normal distance
|
// Other cell more refined. Adjust normal distance
|
||||||
d *= 0.5;
|
d *= 0.5;
|
||||||
}
|
}
|
||||||
neiLevel[bFaceI] = cellLevel[ownLevel];
|
neiLevel[bFaceI] = faceLevel;
|
||||||
// Calculate other cell centre by extrapolation
|
// Calculate other cell centre by extrapolation
|
||||||
neiCc[bFaceI] = faceCentres[i] + d*fn;
|
neiCc[bFaceI] = faceCentres[i] + d*fn;
|
||||||
bFaceI++;
|
bFaceI++;
|
||||||
@ -1901,8 +1901,6 @@ void Foam::meshRefinement::selectSeparatedCoupledFaces(boolList& selected) const
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
|
||||||
|
|
||||||
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
|
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
|
||||||
if (isA<coupledPolyPatch>(patches[patchI]))
|
if (isA<coupledPolyPatch>(patches[patchI]))
|
||||||
{
|
{
|
||||||
@ -1913,9 +1911,9 @@ void Foam::meshRefinement::selectSeparatedCoupledFaces(boolList& selected) const
|
|||||||
|
|
||||||
if (cpp.separated() || !cpp.parallel())
|
if (cpp.separated() || !cpp.parallel())
|
||||||
{
|
{
|
||||||
forAll(pp, i)
|
forAll(cpp, i)
|
||||||
{
|
{
|
||||||
selected[pp.start()+i] = true;
|
selected[cpp.start()+i] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1925,6 +1923,8 @@ void Foam::meshRefinement::selectSeparatedCoupledFaces(boolList& selected) const
|
|||||||
|
|
||||||
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
|
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
|
||||||
(
|
(
|
||||||
|
const labelList& globalToMasterPatch,
|
||||||
|
const labelList& globalToSlavePatch,
|
||||||
const point& keepPoint
|
const point& keepPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1933,7 +1933,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
|
|||||||
|
|
||||||
// Determine connected regions. regionSplit is the labelList with the
|
// Determine connected regions. regionSplit is the labelList with the
|
||||||
// region per cell.
|
// region per cell.
|
||||||
regionSplit cellRegion(mesh_);
|
|
||||||
|
boolList blockedFace(mesh_.nFaces(), false);
|
||||||
|
selectSeparatedCoupledFaces(blockedFace);
|
||||||
|
|
||||||
|
regionSplit cellRegion(mesh_, blockedFace);
|
||||||
|
|
||||||
label regionI = -1;
|
label regionI = -1;
|
||||||
|
|
||||||
@ -1985,22 +1989,39 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
|
|||||||
removeCells cellRemover(mesh_);
|
removeCells cellRemover(mesh_);
|
||||||
|
|
||||||
labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
|
labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
|
||||||
|
labelList exposedPatch;
|
||||||
|
|
||||||
if (exposedFaces.size())
|
label nExposedFaces = returnReduce(exposedFaces.size(), sumOp<label>());
|
||||||
|
if (nExposedFaces)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
//FatalErrorIn
|
||||||
|
//(
|
||||||
|
// "meshRefinement::splitMeshRegions(const point&)"
|
||||||
|
//) << "Removing non-reachable cells should only expose"
|
||||||
|
// << " boundary faces" << nl
|
||||||
|
// << "ExposedFaces:" << exposedFaces << abort(FatalError);
|
||||||
|
|
||||||
|
// Patch for exposed faces for lack of anything sensible.
|
||||||
|
label defaultPatch = 0;
|
||||||
|
if (globalToMasterPatch.size())
|
||||||
|
{
|
||||||
|
defaultPatch = globalToMasterPatch[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
WarningIn
|
||||||
(
|
(
|
||||||
"meshRefinement::splitMeshRegions(const point&)"
|
"meshRefinement::splitMeshRegions(const point&)"
|
||||||
) << "Removing non-reachable cells should only expose boundary faces"
|
) << "Removing non-reachable cells exposes "
|
||||||
<< nl
|
<< nExposedFaces << " internal or coupled faces." << endl
|
||||||
<< "ExposedFaces:" << exposedFaces << abort(FatalError);
|
<< " These get put into patch " << defaultPatch << endl;
|
||||||
|
exposedPatch.setSize(exposedFaces.size(), defaultPatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
return doRemoveCells
|
return doRemoveCells
|
||||||
(
|
(
|
||||||
cellsToRemove,
|
cellsToRemove,
|
||||||
exposedFaces,
|
exposedFaces,
|
||||||
labelList(exposedFaces.size(),-1), // irrelevant since 0 size.
|
exposedPatch,
|
||||||
cellRemover
|
cellRemover
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -868,7 +868,12 @@ public:
|
|||||||
void selectSeparatedCoupledFaces(boolList&) const;
|
void selectSeparatedCoupledFaces(boolList&) const;
|
||||||
|
|
||||||
//- Split mesh. Keep part containing point.
|
//- Split mesh. Keep part containing point.
|
||||||
autoPtr<mapPolyMesh> splitMeshRegions(const point& keepPoint);
|
autoPtr<mapPolyMesh> splitMeshRegions
|
||||||
|
(
|
||||||
|
const labelList& globalToMasterPatch,
|
||||||
|
const labelList& globalToSlavePatch,
|
||||||
|
const point& keepPoint
|
||||||
|
);
|
||||||
|
|
||||||
//- Update local numbering for mesh redistribution
|
//- Update local numbering for mesh redistribution
|
||||||
void distribute(const mapDistributePolyMesh&);
|
void distribute(const mapDistributePolyMesh&);
|
||||||
|
|||||||
@ -1411,6 +1411,7 @@ void Foam::meshRefinement::findCellZoneInsideWalk
|
|||||||
{
|
{
|
||||||
// Analyse regions. Reuse regionsplit
|
// Analyse regions. Reuse regionsplit
|
||||||
boolList blockedFace(mesh_.nFaces());
|
boolList blockedFace(mesh_.nFaces());
|
||||||
|
//selectSeparatedCoupledFaces(blockedFace);
|
||||||
|
|
||||||
forAll(namedSurfaceIndex, faceI)
|
forAll(namedSurfaceIndex, faceI)
|
||||||
{
|
{
|
||||||
@ -2055,7 +2056,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
|
|||||||
runTime++;
|
runTime++;
|
||||||
}
|
}
|
||||||
|
|
||||||
splitMeshRegions(keepPoint);
|
splitMeshRegions(globalToMasterPatch, globalToSlavePatch, keepPoint);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user