Simplified near-wall distance: no neighbourhood search. Experimental
This commit is contained in:
parent
ec3f650fdb
commit
bfee0e5dc0
1 changed files with 72 additions and 56 deletions
|
@ -33,70 +33,86 @@ License
|
|||
|
||||
void Foam::nearWallDist::doAll()
|
||||
{
|
||||
cellDistFuncs wallUtils(mesh_);
|
||||
const fvPatchList& patches = mesh_.boundary();
|
||||
|
||||
// AJ: make sure to pick up all patches that are specified as a wall
|
||||
const polyBoundaryMesh& bMesh = wallUtils.mesh().boundaryMesh();
|
||||
labelHashSet wallPatchIDs(bMesh.size());
|
||||
forAll(bMesh, patchI)
|
||||
forAll (patches, patchI)
|
||||
{
|
||||
if (bMesh[patchI].isWall())
|
||||
fvPatchScalarField& yPatch = operator[](patchI);
|
||||
|
||||
if (patches[patchI].isWall())
|
||||
{
|
||||
wallPatchIDs.insert(patchI);
|
||||
}
|
||||
}
|
||||
|
||||
// Get patch ids of walls
|
||||
// labelHashSet wallPatchIDs(wallUtils.getPatchIDs<wallPolyPatch>());
|
||||
|
||||
// Size neighbours array for maximum possible
|
||||
|
||||
labelList neighbours(wallUtils.maxPatchSize(wallPatchIDs));
|
||||
|
||||
|
||||
// Correct all cells with face on wall
|
||||
|
||||
const volVectorField& cellCentres = mesh_.C();
|
||||
|
||||
forAll(mesh_.boundary(), patchI)
|
||||
{
|
||||
fvPatchScalarField& ypatch = operator[](patchI);
|
||||
|
||||
const fvPatch& patch = mesh_.boundary()[patchI];
|
||||
|
||||
if (patch.isWall())
|
||||
{
|
||||
const polyPatch& pPatch = patch.patch();
|
||||
|
||||
const unallocLabelList& faceCells = patch.faceCells();
|
||||
|
||||
// Check cells with face on wall
|
||||
forAll(patch, patchFaceI)
|
||||
{
|
||||
label nNeighbours = wallUtils.getPointNeighbours
|
||||
(
|
||||
pPatch,
|
||||
patchFaceI,
|
||||
neighbours
|
||||
);
|
||||
|
||||
label minFaceI = -1;
|
||||
|
||||
ypatch[patchFaceI] = wallUtils.smallestDist
|
||||
(
|
||||
cellCentres[faceCells[patchFaceI]],
|
||||
pPatch,
|
||||
nNeighbours,
|
||||
neighbours,
|
||||
minFaceI
|
||||
);
|
||||
}
|
||||
yPatch = 1/patches[patchI].deltaCoeffs();
|
||||
}
|
||||
else
|
||||
{
|
||||
ypatch = 0.0;
|
||||
yPatch = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
// cellDistFuncs wallUtils(mesh_);
|
||||
|
||||
// // AJ: make sure to pick up all patches that are specified as a wall
|
||||
// const polyBoundaryMesh& bMesh = wallUtils.mesh().boundaryMesh();
|
||||
// labelHashSet wallPatchIDs(bMesh.size());
|
||||
// forAll(bMesh, patchI)
|
||||
// {
|
||||
// if (bMesh[patchI].isWall())
|
||||
// {
|
||||
// wallPatchIDs.insert(patchI);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Get patch ids of walls
|
||||
// // labelHashSet wallPatchIDs(wallUtils.getPatchIDs<wallPolyPatch>());
|
||||
|
||||
// // Size neighbours array for maximum possible
|
||||
|
||||
// labelList neighbours(wallUtils.maxPatchSize(wallPatchIDs));
|
||||
|
||||
|
||||
// // Correct all cells with face on wall
|
||||
|
||||
// const volVectorField& cellCentres = mesh_.C();
|
||||
|
||||
// forAll(mesh_.boundary(), patchI)
|
||||
// {
|
||||
// fvPatchScalarField& ypatch = operator[](patchI);
|
||||
|
||||
// const fvPatch& patch = mesh_.boundary()[patchI];
|
||||
|
||||
// if (patch.isWall())
|
||||
// {
|
||||
// const polyPatch& pPatch = patch.patch();
|
||||
|
||||
// const unallocLabelList& faceCells = patch.faceCells();
|
||||
|
||||
// // Check cells with face on wall
|
||||
// forAll(patch, patchFaceI)
|
||||
// {
|
||||
// label nNeighbours = wallUtils.getPointNeighbours
|
||||
// (
|
||||
// pPatch,
|
||||
// patchFaceI,
|
||||
// neighbours
|
||||
// );
|
||||
|
||||
// label minFaceI = -1;
|
||||
|
||||
// ypatch[patchFaceI] = wallUtils.smallestDist
|
||||
// (
|
||||
// cellCentres[faceCells[patchFaceI]],
|
||||
// pPatch,
|
||||
// nNeighbours,
|
||||
// neighbours,
|
||||
// minFaceI
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ypatch = 0.0;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
Reference in a new issue