Neater handling of non-patch face crossing. Not applying a small

tracking increase to patch interactions.
This commit is contained in:
graham
2009-10-11 00:02:36 +01:00
parent bf68452326
commit 0cbddca2c8

View File

@ -286,6 +286,9 @@ void Foam::Particle<ParticleType>::trackToFaceConcave
{ {
if (!cloud_.internalFace(facei_)) if (!cloud_.internalFace(facei_))
{ {
// For a patch face, allow a small value of lambda to
// ensure patch interactions occur.
label patchi = patch(facei_); label patchi = patch(facei_);
const polyPatch& patch = mesh.boundaryMesh()[patchi]; const polyPatch& patch = mesh.boundaryMesh()[patchi];
@ -312,27 +315,37 @@ void Foam::Particle<ParticleType>::trackToFaceConcave
} }
} }
} }
else if (correctLambda < Cloud<ParticleType>::minValidTrackFraction) else
{ {
// The particle is not far enough away from the face if (correctLambda < Cloud<ParticleType>::minValidTrackFraction)
// to decide if it is valid crossing. Let it move a {
// little without crossing the face to resolve the // The particle is not far enough away from the face
// ambiguity. // to decide if it is valid crossing. Let it move a
// little without crossing the face to resolve the
// ambiguity.
// Pout<< "Ambiguous face crossing, correcting towards cell " // Pout<< "Ambiguous face crossing, correcting towards cell "
// << "centre and not crossing face" << endl; // << "centre and not crossing face" << endl;
// const point& cc = mesh.cellCentres()[celli_]; // const point& cc = mesh.cellCentres()[celli_];
// position_ += // position_ +=
// Cloud<ParticleType>::trackingRescueTolerance // Cloud<ParticleType>::trackingRescueTolerance
// *(cc - position_); // *(cc - position_);
// Pout<< "Ambiguous face crossing. " << endl; // Pout<< "Ambiguous face crossing. " << endl;
facei_ = -1; facei_ = -1;
}
// If the face hit was not on a wall, add a small
// amount to the track to move it off the face, If it
// was not an ambiguous face crossing, this makes sure
// the face is not ambiguous next tracking step. If
// it was ambiguous, this should resolve it.
correctLambda += Cloud<ParticleType>::minValidTrackFraction;
} }
correctLambda += Cloud<ParticleType>::minValidTrackFraction;
trackFraction = correctLambda; trackFraction = correctLambda;
position_ += trackFraction*(endPosition - position_); position_ += trackFraction*(endPosition - position_);
} }