Commit 3f510323 authored by Will Bainbridge's avatar Will Bainbridge Committed by Andrew Heather
Browse files

KinematicParcel: Apply in-cell updates before hitting the face

The evolution of a KinematicParcel happens in three stages; (1) tracking
across the cell, (2) interaction with the face or patch that has been
hit, and (3) clculation and and update of parcel and cell properties.
The KinematicParcel used to evolve in this order, as steps 1 and 2 were
part of the same lower level method. This meant that the update stage
was done after interacting with the face, meaning the parcel was not in
the cell that had just been tracked through, or, by means of a patch
interaction, had been modified such that it was no longer representative
of the track through the cell.

With the separation of stages 1 and 2 in the base class, it is now
possible to do the update stage before interacting with the face (i.e.,
proceeding in the order 1, 3, 2). This makes the state consistent for
the updates, and avoids the issues described.

Patch contributed by Timo Niemi, VTT.
This resolves bug report https://bugs.openfoam.org/view.php?id=2282
parent f021409d
......@@ -292,8 +292,8 @@ bool Foam::KinematicParcel<ParcelType>::move
f = min(f, maxCo*l/max(SMALL*l, mag(s)));
if (p.active())
{
// Track to and hit the next face
p.trackToAndHitFace(f*s, f, td);
// Track to the next face
p.trackToFace(f*s, f);
}
else
{
......@@ -321,6 +321,11 @@ bool Foam::KinematicParcel<ParcelType>::move
p.calc(td, dt, celli);
}
if (p.onFace() && td.keepParticle)
{
p.hitFace(s, td);
}
if (p.onBoundaryFace() && td.keepParticle)
{
if (isA<processorPolyPatch>(pbMesh[p.patch()]))
......
Supports Markdown
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