Go to the documentation of this file.
30 template<
class TrackData>
34 const scalar trackFraction
38 typedef typename TrackData::cloudType::particleType particleType;
40 particleType&
p =
static_cast<particleType&
>(*this);
43 if (!internalFace(faceI_))
45 label origFaceI = faceI_;
46 label patchI = patch(faceI_);
59 mesh_.boundaryMesh()[patchI],
69 if (faceI_ != origFaceI)
71 patchI = patch(faceI_);
76 if (isA<wedgePolyPatch>(patch))
83 else if (isA<symmetryPlanePolyPatch>(patch))
85 p.hitSymmetryPlanePatch
90 else if (isA<symmetryPolyPatch>(patch))
97 else if (isA<cyclicPolyPatch>(patch))
104 else if (isA<processorPolyPatch>(patch))
111 else if (isA<wallPolyPatch>(patch))
120 p.hitPatch(patch, td);
135 template<
class TrackData>
156 scalar trackFraction = 0.0;
158 if (!td.isWallPatch_[tetFace()])
162 const edge meshEdge(currentEdge());
166 if (mesh_.isInternalFace(tetFace()))
170 cellI_ == mesh_.faceOwner()[faceI_]
171 ? mesh_.faceNeighbour()[faceI_]
172 : mesh_.faceOwner()[faceI_]
177 tetIndices nbrTi(nbrCellI, tetFaceI_, tetPtI_, mesh_);
178 if ((nbrTi.
faceTri(mesh_).
normal() & (endPosition-position())) < 0)
184 patchInteraction(td, trackFraction);
190 crossEdgeConnectedFace(meshEdge);
191 patchInteraction(td, trackFraction);
198 crossEdgeConnectedFace(meshEdge);
199 patchInteraction(td, trackFraction);
207 if (mesh_.isInternalFace(tetFace()))
210 <<
"Can only track on boundary faces."
211 <<
" Face:" << tetFace()
212 <<
" at:" << mesh_.faceCentres()[tetFace()]
216 point projectedEndPosition = endPosition;
219 const triFace tri(currentTetIndices().faceTriIs(mesh_));
222 const point& basePt = mesh_.points()[tri[0]];
223 projectedEndPosition -= ((projectedEndPosition-basePt)&
n)*
n;
227 bool doTrack =
false;
228 if (meshEdgeStart_ == -1 && diagEdge_ == -1)
237 doTrack = isTriAlongTrack(projectedEndPosition);
245 trackFraction = trackFaceTri(projectedEndPosition, triEdgeI);
253 return trackFraction;
277 meshEdgeStart_ = fp0;
279 crossEdgeConnectedFace(currentEdge());
280 patchInteraction(td, trackFraction);
282 else if (ti.
facePtA() ==
f.rcIndex(fp0))
290 meshEdgeStart_ =
f.rcIndex(fp0);
292 crossEdgeConnectedFace(currentEdge());
293 patchInteraction(td, trackFraction);
301 diagEdge_ +=
f.size();
308 else if (triEdgeI == 1)
314 crossEdgeConnectedFace(currentEdge());
315 patchInteraction(td, trackFraction);
325 crossEdgeConnectedFace(currentEdge());
326 patchInteraction(td, trackFraction);
328 else if (ti.
facePtB() ==
f.fcIndex(fp0))
336 meshEdgeStart_ = fp0;
338 crossEdgeConnectedFace(currentEdge());
339 patchInteraction(td, trackFraction);
348 diagEdge_ +=
f.size();
360 if (meshEdgeStart_ != -1)
363 crossEdgeConnectedFace(currentEdge());
365 patchInteraction(td, trackFraction);
379 return trackFraction;
383 template<
class TrackData>
389 const scalar trackFraction,
398 template<
class TrackData>
406 td.keepParticle =
false;
410 template<
class TrackData>
418 td.keepParticle =
false;
422 template<
class TrackData>
430 td.keepParticle =
false;
434 template<
class TrackData>
442 td.keepParticle =
false;
446 template<
class TrackData>
454 td.switchProcessor =
true;
463 if (meshEdgeStart_ != -1)
465 meshEdgeStart_ =
f.size()-meshEdgeStart_-1;
470 diagEdge_ =
f.size()-diagEdge_;
475 template<
class TrackData>
485 template<
class TrackData>
493 td.keepParticle =
false;
497 template<
class CloudType>
528 template<
class CloudType>
549 meshEdgeStart[i] = iter().meshEdgeStart_;
550 diagEdge[i] = iter().diagEdge_;
554 meshEdgeStart.
write();
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A primitive field of type <T> with automated input and output.
Wedge front and back plane patch.
static void writeFields(const CloudType &)
Write.
void patchInteraction(TrackData &td, const scalar trackFraction)
Do all patch interaction.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual bool write() const
Write using setting from DB.
scalar trackToEdge(TrackData &td, const vector &endPosition)
Equivalent of trackToFace.
dimensioned< scalar > mag(const dimensioned< Type > &)
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label facePtB() const
Return face point B.
label meshEdgeStart() const
-1 or label of mesh edge
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
vector normal() const
Return vector normal.
triPointRef faceTri(const polyMesh &mesh) const
Return the geometry corresponding to the tri on the.
A patch is a list of labels that address the faces in the global face list.
label face() const
Return the face.
Symmetry patch for non-planar or multi-plane patches.
void hitSymmetryPatch(const symmetryPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
Neighbour processor patch.
Templated base class for dsmc cloud.
label faceBasePt() const
Return the face base point.
void hitWedgePatch(const wedgePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a wedge.
errorManip< error > abort(error &err)
void hitSymmetryPlanePatch(const symmetryPlanePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
bool hitPatch(const polyPatch &, TrackData &td, const label patchI, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a patch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A triangular face using a FixedList of labels corresponding to mesh vertices.
label facePtA() const
Return face point A.
static void readFields(CloudType &)
Read.
void hitCyclicPatch(const cyclicPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a cyclic.
const dimensionedScalar c
Speed of light in a vacuum.
label diagEdge() const
-1 or diagonal edge
static void readFields(CloudType &c)
Read the fields associated with the owner cloud.
A face is a list of labels corresponding to mesh vertices.
static void writeFields(const CloudType &c)
Write the fields associated with the owner cloud.