functionObjects: nearWallFields: Fixed particle not found error

Removed all the special handling for awkward particles from the
nearWallFields function object. The version 5+ tracking already handles
this more robustly.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2728
This commit is contained in:
Will Bainbridge
2017-10-20 11:47:44 +01:00
parent 638557bb4c
commit 26b8a50286

View File

@ -76,46 +76,19 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
const fvPatch& patch = mesh_.boundary()[patchi]; const fvPatch& patch = mesh_.boundary()[patchi];
vectorField nf(patch.nf()); vectorField nf(patch.nf());
vectorField faceCellCentres(patch.patch().faceCellCentres());
forAll(patch, patchFacei) forAll(patch, patchFacei)
{ {
label meshFacei = patch.start()+patchFacei; const point& start = patch.Cf()[patchFacei];
const point end = start - distance_*nf[patchFacei];
// Find starting point on face (since faceCentre might not
// be on face-diagonal decomposition)
pointIndexHit startInfo
(
mappedPatchBase::facePoint
(
mesh_,
meshFacei,
polyMesh::FACE_DIAG_TRIS
)
);
point start;
if (startInfo.hit())
{
start = startInfo.hitPoint();
}
else
{
// Fallback: start tracking from neighbouring cell centre
start = faceCellCentres[patchFacei];
}
const point end = start-distance_*nf[patchFacei];
// Add a particle to the cloud with originating face as passive data
cloud.addParticle cloud.addParticle
( (
new findCellParticle new findCellParticle
( (
mesh_, mesh_,
start, start,
-1, patch.faceCells()[patchFacei],
end, end,
globalWalls.toGlobal(nPatchFaces) // passive data globalWalls.toGlobal(nPatchFaces) // passive data
) )