Commit cfce348b authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Added particle hitFace() function

parent 1b168470
......@@ -499,6 +499,9 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
} while (faceI_ < 0);
ParticleType& p = static_cast<ParticleType&>(*this);
p.hitFace(td);
if (cloud_.internalFace(faceI_))
{
// Change tet ownership because a tri face has been crossed,
......@@ -527,8 +530,6 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
}
else
{
ParticleType& p = static_cast<ParticleType&>(*this);
label origFaceI = faceI_;
label patchI = patch(faceI_);
......@@ -641,9 +642,7 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
vector nHat = wallTri.normal();
nHat /= mag(nHat);
const ParticleType& p = static_cast<const ParticleType&>(*this);
scalar r = p.wallImpactDistance(nHat);
const scalar r = p.wallImpactDistance(nHat);
// Removing (approximately) the wallTri normal
// component of the existing correction, to avoid the
......@@ -694,6 +693,12 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&)
{}
template<class ParticleType>
template<class TrackData>
void Foam::Particle<ParticleType>::hitFace(TrackData&)
{}
template<class ParticleType>
template<class TrackData>
bool Foam::Particle<ParticleType>::hitPatch
......
......@@ -219,6 +219,10 @@ protected:
// Patch interactions
//- Overridable function to handle the particle hitting a face
template<class TrackData>
void hitFace(TrackData& td);
//- Overridable function to handle the particle hitting a
// patch. Executed before other patch-hitting functions.
// trackFraction is passed in to allow mesh motion to
......
......@@ -243,6 +243,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
)
:
Particle<ParcelType>(p),
active_(p.active_),
typeId_(p.typeId_),
nParticle_(p.nParticle_),
d_(p.d_),
......@@ -270,6 +271,7 @@ Foam::KinematicParcel<ParcelType>::KinematicParcel
)
:
Particle<ParcelType>(p, c),
active_(p.active_),
typeId_(p.typeId_),
nParticle_(p.nParticle_),
d_(p.d_),
......@@ -393,6 +395,20 @@ bool Foam::KinematicParcel<ParcelType>::move
}
template<class ParcelType>
template<class TrackData>
void Foam::KinematicParcel<ParcelType>::hitFace(TrackData& td)
{
ParcelType& p = static_cast<ParcelType&>(*this);
td.cloud().postProcessing().postFace(p);
}
template<class ParcelType>
void Foam::KinematicParcel<ParcelType>::hitFace(int& td)
{}
template<class ParcelType>
template<class TrackData>
bool Foam::KinematicParcel<ParcelType>::hitPatch
......
......@@ -581,6 +581,14 @@ public:
// Patch interactions
//- Overridable function to handle the particle hitting a face
// without trackData
void hitFace(int& td);
//- Overridable function to handle the particle hitting a face
template<class TrackData>
void hitFace(TrackData& td);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
......
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