Skip to content
Snippets Groups Projects
Commit 4d420577 authored by mattijs's avatar mattijs
Browse files

BUG: trackedParticle: could get stuck on processor face

parent 6af4a60a
Branches
Tags
No related merge requests found
......@@ -90,27 +90,36 @@ Foam::trackedParticle::trackedParticle
bool Foam::trackedParticle::move
(
trackingData& td,
const scalar trackedParticle
const scalar trackTime
)
{
td.switchProcessor = false;
td.keepParticle = true;
scalar tEnd = (1.0 - stepFraction())*trackedParticle;
scalar tEnd = (1.0 - stepFraction())*trackTime;
scalar dtMax = tEnd;
while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
if (tEnd <= SMALL)
{
// set the lagrangian time-step
scalar dt = min(dtMax, tEnd);
// Remove the particle
td.keepParticle = false;
}
else
{
td.keepParticle = true;
// mark visited cell with max level.
td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_);
while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
{
// set the lagrangian time-step
scalar dt = min(dtMax, tEnd);
// mark visited cell with max level.
td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_);
dt *= trackToFace(end_, td);
dt *= trackToFace(end_, td);
tEnd -= dt;
stepFraction() = 1.0 - tEnd/trackedParticle;
tEnd -= dt;
stepFraction() = 1.0 - tEnd/trackTime;
}
}
return td.keepParticle;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment