From 2a6ac7edcec7d279a93e5103fa4ec2b89b125a5b Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 30 Apr 2018 13:08:58 +0100 Subject: [PATCH] BUG: nearWallFields: correct exit condition for particles. Fixes #812. --- .../field/nearWallFields/findCellParticle.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/functionObjects/field/nearWallFields/findCellParticle.C b/src/functionObjects/field/nearWallFields/findCellParticle.C index ade118370f..824c10ab54 100644 --- a/src/functionObjects/field/nearWallFields/findCellParticle.C +++ b/src/functionObjects/field/nearWallFields/findCellParticle.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -110,7 +110,10 @@ bool Foam::findCellParticle::move trackToAndHitFace(f*(end_ - start_), f, cloud, td); } - if (stepFraction() == 1 || !td.keepParticle) + // Note: stepFraction is might not be exactly 1 so check for 1 or + // slightly larger + + if (stepFraction() >= 1 || !td.keepParticle) { // Hit endpoint or patch. If patch hit could do fancy stuff but just // to use the patch point is good enough for now.