particle: Added trackToCell function

This is equivalent to track to face, but it additionally crosses
internal faces at the end of the track to move into the next cell. This
is a common procedure when performing post-processing tracking
operations.
This commit is contained in:
Will Bainbridge
2018-05-14 15:16:13 +01:00
parent dc499e25a9
commit e7a9581d79
2 changed files with 28 additions and 4 deletions

View File

@ -570,6 +570,23 @@ Foam::scalar Foam::particle::track
} }
Foam::scalar Foam::particle::trackToCell
(
const vector& displacement,
const scalar fraction
)
{
const scalar f = trackToFace(displacement, fraction);
if (onInternalFace())
{
changeCell();
}
return f;
}
Foam::scalar Foam::particle::trackToFace Foam::scalar Foam::particle::trackToFace
( (
const vector& displacement, const vector& displacement,

View File

@ -513,16 +513,23 @@ public:
const scalar fraction const scalar fraction
); );
//- As particle::track, but also stops on internal faces. //- As particle::track, but stops when a new cell is reached.
scalar trackToCell
(
const vector& displacement,
const scalar fraction
);
//- As particle::track, but stops when a face is hit.
scalar trackToFace scalar trackToFace
( (
const vector& displacement, const vector& displacement,
const scalar fraction const scalar fraction
); );
//- As particle::trackToFace, but also stops on tet triangles. On //- As particle::trackToFace, but stops when a tet triangle is hit. On
// exit, tetTriI is set to the index of the tet triangle that was // exit, tetTriI is set to the index of the tet triangle that was hit,
// hit, or -1 if the end position was reached. // or -1 if the end position was reached.
scalar trackToTri scalar trackToTri
( (
const vector& displacement, const vector& displacement,