mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: trackedParticle: could get stuck on processor face
This commit is contained in:
@ -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);
|
||||
|
||||
dt *= trackToFace(end_, td);
|
||||
// mark visited cell with max level.
|
||||
td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_);
|
||||
|
||||
tEnd -= dt;
|
||||
stepFraction() = 1.0 - tEnd/trackedParticle;
|
||||
dt *= trackToFace(end_, td);
|
||||
|
||||
tEnd -= dt;
|
||||
stepFraction() = 1.0 - tEnd/trackTime;
|
||||
}
|
||||
}
|
||||
|
||||
return td.keepParticle;
|
||||
|
||||
Reference in New Issue
Block a user