mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: Particle: allow hitPatch to move particle to different face, different patchId.
This commit is contained in:
@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user