Commit 27b2f7ad authored by mattijs's avatar mattijs
Browse files

ENH: Particle: allow hitPatch to move particle to different face, different patchId.

parent fbaea3c9
......@@ -334,11 +334,18 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
position_ = endPosition;
}
label origFacei = facei_;
label patchi = patch(facei_);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
if (!p.hitPatch(patch, td, patchi))
if (!p.hitPatch(mesh.boundaryMesh()[patchi], td, patchi))
{
// Did patch interaction model switch patches?
if (facei_ != origFacei)
{
patchi = patch(facei_);
}
const polyPatch& patch = mesh.boundaryMesh()[patchi];
if (isA<wedgePolyPatch>(patch))
{
p.hitWedgePatch
......
......@@ -378,6 +378,9 @@ public:
//- Return current cell particle is in
inline label cell() const;
//- Return current face particle is on otherwise -1
inline label& face();
//- Return current face particle is on otherwise -1
inline label face() const;
......
......@@ -325,6 +325,13 @@ inline Foam::label Foam::Particle<ParticleType>::face() const
}
template<class ParticleType>
inline Foam::label& Foam::Particle<ParticleType>::face()
{
return facei_;
}
template<class ParticleType>
inline bool Foam::Particle<ParticleType>::onBoundary() const
{
......
Markdown is supported
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