From aa24a97c8b5102cee0f96f1ecdac59ed1e0afe98 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 20 Oct 2017 11:38:13 +0100 Subject: [PATCH] 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 --- .../field/nearWallFields/nearWallFields.C | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.C b/src/functionObjects/field/nearWallFields/nearWallFields.C index 8e42496ab6..fa4e086ee2 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/functionObjects/field/nearWallFields/nearWallFields.C @@ -76,46 +76,19 @@ void Foam::functionObjects::nearWallFields::calcAddressing() const fvPatch& patch = mesh_.boundary()[patchi]; vectorField nf(patch.nf()); - vectorField faceCellCentres(patch.patch().faceCellCentres()); 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 ( new findCellParticle ( mesh_, start, - -1, + patch.faceCells()[patchFacei], end, globalWalls.toGlobal(nPatchFaces) // passive data )