sampling: Reset counters on particles that are used without clouds

This commit is contained in:
Will Bainbridge
2021-08-12 12:05:58 +01:00
parent 9765f87202
commit 5fcfbce8dc
3 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -140,6 +140,8 @@ void Foam::sampledSets::lineFace::calcSamples
const vector s =
sign*(end - start)*(1 - dist/mag(end - start));
sampleParticle.reset();
if
(
(!first && sampleParticle.onBoundaryFace())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -83,6 +83,7 @@ void Foam::sampledSets::lineUniform::calcSamples
if (++ sampleI < nPoints_)
{
sampleT = scalar(sampleI)/(nPoints_ - 1);
sampleParticle.reset();
sampleParticle.track((end_ - start_)/(nPoints_ - 1), 0);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,6 +112,7 @@ void Foam::sampledSets::points::calcSamplesOrdered
{
const vector s = points_[sampleI] - points_[sampleI - 1];
sampleDist += mag(s);
sampleParticle.reset();
sampleParticle.track(s, 0);
}
}