mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
updated hitPatch() to return true if particle remmains in original cell
This commit is contained in:
@ -115,22 +115,26 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td)
|
||||
}
|
||||
|
||||
|
||||
void Foam::trackedParticle::hitPatch
|
||||
bool Foam::trackedParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackedParticle::trackData& td,
|
||||
const label patchI
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::trackedParticle::hitPatch
|
||||
bool Foam::trackedParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::trackedParticle::hitWedgePatch
|
||||
|
||||
@ -171,13 +171,13 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
trackedParticle::trackData& td,
|
||||
const label patchI
|
||||
);
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
|
||||
@ -339,46 +339,47 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
label patchi = patch(facei_);
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
|
||||
p.hitPatch(patch, td, patchi);
|
||||
|
||||
if (isA<wedgePolyPatch>(patch))
|
||||
if (!p.hitPatch(patch, td, patchi))
|
||||
{
|
||||
p.hitWedgePatch
|
||||
(
|
||||
static_cast<const wedgePolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<symmetryPolyPatch>(patch))
|
||||
{
|
||||
p.hitSymmetryPatch
|
||||
(
|
||||
static_cast<const symmetryPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
p.hitCyclicPatch
|
||||
(
|
||||
static_cast<const cyclicPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<processorPolyPatch>(patch))
|
||||
{
|
||||
p.hitProcessorPatch
|
||||
(
|
||||
static_cast<const processorPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
p.hitWallPatch
|
||||
(
|
||||
static_cast<const wallPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
p.hitPatch(patch, td);
|
||||
if (isA<wedgePolyPatch>(patch))
|
||||
{
|
||||
p.hitWedgePatch
|
||||
(
|
||||
static_cast<const wedgePolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<symmetryPolyPatch>(patch))
|
||||
{
|
||||
p.hitSymmetryPatch
|
||||
(
|
||||
static_cast<const symmetryPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<cyclicPolyPatch>(patch))
|
||||
{
|
||||
p.hitCyclicPatch
|
||||
(
|
||||
static_cast<const cyclicPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<processorPolyPatch>(patch))
|
||||
{
|
||||
p.hitProcessorPatch
|
||||
(
|
||||
static_cast<const processorPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
p.hitWallPatch
|
||||
(
|
||||
static_cast<const wallPolyPatch&>(patch), td
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
p.hitPatch(patch, td);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -426,13 +427,15 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&)
|
||||
|
||||
template<class ParticleType>
|
||||
template<class TrackData>
|
||||
void Foam::Particle<ParticleType>::hitPatch
|
||||
bool Foam::Particle<ParticleType>::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
|
||||
@ -171,7 +171,7 @@ protected:
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
template<class TrackData>
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData& td,
|
||||
|
||||
@ -61,15 +61,9 @@ bool Foam::DsmcParcel<ParcelType>::move
|
||||
|
||||
if (p.onBoundary() && td.keepParticle)
|
||||
{
|
||||
if (p.face() > -1)
|
||||
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
|
||||
{
|
||||
if
|
||||
(
|
||||
isType<processorPolyPatch>(pbMesh[p.patch(p.face())])
|
||||
)
|
||||
{
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,13 +74,15 @@ bool Foam::DsmcParcel<ParcelType>::move
|
||||
|
||||
template<class ParcelType>
|
||||
template<class TrackData>
|
||||
void Foam::DsmcParcel<ParcelType>::hitPatch
|
||||
bool Foam::DsmcParcel<ParcelType>::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData& td,
|
||||
const label patchI
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
|
||||
@ -242,7 +242,7 @@ public:
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
template<class TrackData>
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
TrackData& td,
|
||||
|
||||
@ -253,28 +253,30 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
|
||||
|
||||
template<class ParcelType>
|
||||
template<class TrackData>
|
||||
void Foam::KinematicParcel<ParcelType>::hitPatch
|
||||
bool Foam::KinematicParcel<ParcelType>::hitPatch
|
||||
(
|
||||
const polyPatch& pp,
|
||||
TrackData& td,
|
||||
const label patchI
|
||||
)
|
||||
{
|
||||
td.cloud().patchInteraction().correct(pp, this->face(), U_);
|
||||
|
||||
ParcelType& p = static_cast<ParcelType&>(*this);
|
||||
td.cloud().postProcessing().postPatch(p, patchI);
|
||||
|
||||
return td.cloud().patchInteraction().correct(pp, this->face(), U_);
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::KinematicParcel<ParcelType>::hitPatch
|
||||
bool Foam::KinematicParcel<ParcelType>::hitPatch
|
||||
(
|
||||
const polyPatch& pp,
|
||||
int& td,
|
||||
const label patchI
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
|
||||
@ -430,7 +430,7 @@ public:
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
template<class TrackData>
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch& p,
|
||||
TrackData& td,
|
||||
@ -440,7 +440,7 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions without trackData
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch& p,
|
||||
int& td,
|
||||
|
||||
@ -108,7 +108,7 @@ bool Foam::LocalInteraction<CloudType>::active() const
|
||||
|
||||
|
||||
template <class CloudType>
|
||||
void Foam::LocalInteraction<CloudType>::correct
|
||||
bool Foam::LocalInteraction<CloudType>::correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
@ -129,7 +129,11 @@ void Foam::LocalInteraction<CloudType>::correct
|
||||
}
|
||||
|
||||
U -= patchData_[pp.index()].mu()*Ut;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -159,7 +159,8 @@ public:
|
||||
bool active() const;
|
||||
|
||||
//- Apply velocity correction
|
||||
virtual void correct
|
||||
// Returns true if particle remains in same cell
|
||||
virtual bool correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
|
||||
@ -125,7 +125,8 @@ public:
|
||||
virtual bool active() const = 0;
|
||||
|
||||
//- Apply velocity correction
|
||||
virtual void correct
|
||||
// Returns true if particle remains in same cell
|
||||
virtual bool correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
|
||||
@ -57,7 +57,7 @@ bool Foam::Rebound<CloudType>::active() const
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::Rebound<CloudType>::correct
|
||||
bool Foam::Rebound<CloudType>::correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
@ -76,6 +76,8 @@ void Foam::Rebound<CloudType>::correct
|
||||
}
|
||||
|
||||
U -= Ut;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -77,7 +77,8 @@ public:
|
||||
bool active() const;
|
||||
|
||||
//- Apply velocity correction
|
||||
virtual void correct
|
||||
// Returns true if particle remains in same cell
|
||||
virtual bool correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
|
||||
@ -58,7 +58,7 @@ bool Foam::StandardWallInteraction<CloudType>::active() const
|
||||
|
||||
|
||||
template <class CloudType>
|
||||
void Foam::StandardWallInteraction<CloudType>::correct
|
||||
bool Foam::StandardWallInteraction<CloudType>::correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
@ -79,7 +79,11 @@ void Foam::StandardWallInteraction<CloudType>::correct
|
||||
}
|
||||
|
||||
U -= mu_*Ut;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,8 @@ public:
|
||||
bool active() const;
|
||||
|
||||
//- Apply velocity correction
|
||||
virtual void correct
|
||||
// Returns true if particle remains in same cell
|
||||
virtual bool correct
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label faceId,
|
||||
|
||||
@ -241,22 +241,26 @@ void Foam::molecule::setSiteSizes(label size)
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitPatch
|
||||
bool Foam::molecule::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
molecule::trackData&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitPatch
|
||||
bool Foam::molecule::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::molecule::hitProcessorPatch
|
||||
|
||||
@ -312,7 +312,7 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
molecule::trackData& td,
|
||||
@ -321,7 +321,7 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions without trackData
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch& p,
|
||||
int& td,
|
||||
|
||||
@ -84,12 +84,9 @@ bool Foam::solidParticle::move(solidParticle::trackData& td)
|
||||
|
||||
if (onBoundary() && td.keepParticle)
|
||||
{
|
||||
if (face() > -1)
|
||||
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -98,22 +95,26 @@ bool Foam::solidParticle::move(solidParticle::trackData& td)
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidParticle::hitPatch
|
||||
bool Foam::solidParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
solidParticle::trackData&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidParticle::hitPatch
|
||||
bool Foam::solidParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
int&,
|
||||
const label
|
||||
)
|
||||
{}
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidParticle::hitProcessorPatch
|
||||
|
||||
@ -173,7 +173,7 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
solidParticle::trackData& td,
|
||||
@ -182,7 +182,7 @@ public:
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions without trackData
|
||||
void hitPatch
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch& p,
|
||||
int& td,
|
||||
|
||||
Reference in New Issue
Block a user