sampling: Ensure tracking is done at the new-time mesh state
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -169,7 +169,7 @@ void Foam::Cloud<ParticleType>::move
|
||||
// Initialise the stepFraction moved for the particles
|
||||
forAllIter(typename Cloud<ParticleType>, *this, pIter)
|
||||
{
|
||||
pIter().reset();
|
||||
pIter().reset(0);
|
||||
}
|
||||
|
||||
// List of lists of particles to be transferred for all of the
|
||||
|
||||
@ -447,11 +447,11 @@ void Foam::particle::locate
|
||||
const class face& f = mesh_.faces()[c[cellTetFacei]];
|
||||
for (label tetPti = 1; tetPti < f.size() - 1; ++ tetPti)
|
||||
{
|
||||
reset();
|
||||
coordinates_ = barycentric(1, 0, 0, 0);
|
||||
tetFacei_ = c[cellTetFacei];
|
||||
tetPti_ = tetPti;
|
||||
facei_ = -1;
|
||||
reset(1);
|
||||
|
||||
label tetTriI = -1;
|
||||
const scalar f = trackToTri(displacement, 0, tetTriI);
|
||||
@ -472,11 +472,11 @@ void Foam::particle::locate
|
||||
|
||||
// The particle must be (hopefully only slightly) outside the cell. Track
|
||||
// into the tet which got the furthest.
|
||||
reset();
|
||||
coordinates_ = barycentric(1, 0, 0, 0);
|
||||
tetFacei_ = minTetFacei;
|
||||
tetPti_ = minTetPti;
|
||||
facei_ = -1;
|
||||
reset(1);
|
||||
|
||||
track(displacement, 0);
|
||||
if (!onFace())
|
||||
|
||||
@ -528,9 +528,9 @@ public:
|
||||
|
||||
// Track
|
||||
|
||||
//- Set step fraction and behind data to zero in preparation for a new
|
||||
// track
|
||||
inline void reset();
|
||||
//- Set the step fraction and clear the behind data in preparation for
|
||||
// a new track
|
||||
inline void reset(const scalar stepFraction);
|
||||
|
||||
//- Track along the displacement for a given fraction of the overall
|
||||
// step. End when the track is complete, or when a boundary is hit.
|
||||
|
||||
@ -281,9 +281,9 @@ inline Foam::vector Foam::particle::position() const
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::particle::reset()
|
||||
inline void Foam::particle::reset(const scalar stepFraction)
|
||||
{
|
||||
stepFraction_ = 0;
|
||||
stepFraction_ = stepFraction;
|
||||
stepFractionBehind_ = 0;
|
||||
nTracksBehind_ = 0;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ void Foam::sampledSets::lineFace::calcSamples
|
||||
const vector s =
|
||||
sign*(end - start)*(1 - dist/mag(end - start));
|
||||
|
||||
sampleParticle.reset();
|
||||
sampleParticle.reset(1);
|
||||
|
||||
if
|
||||
(
|
||||
|
||||
@ -89,7 +89,7 @@ void Foam::sampledSets::lineUniform::calcSamples
|
||||
if (++ sampleI < nPoints_)
|
||||
{
|
||||
sampleT = scalar(sampleI)/(nPoints_ - 1);
|
||||
sampleParticle.reset();
|
||||
sampleParticle.reset(1);
|
||||
sampleParticle.track((end_ - start_)/(nPoints_ - 1), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ void Foam::sampledSets::points::calcSamplesOrdered
|
||||
{
|
||||
const vector s = points_[sampleI] - points_[sampleI - 1];
|
||||
sampleDist += mag(s);
|
||||
sampleParticle.reset();
|
||||
sampleParticle.reset(1);
|
||||
sampleParticle.track(s, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user