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))
80 static_cast<const wedgePolyPatch&>(patch), td
83 else if (isA<symmetryPlanePolyPatch>(patch))
85 p.hitSymmetryPlanePatch
87 static_cast<const symmetryPlanePolyPatch&>(patch), td
90 else if (isA<symmetryPolyPatch>(patch))
94 static_cast<const symmetryPolyPatch&>(patch), td
97 else if (isA<cyclicPolyPatch>(patch))
101 static_cast<const cyclicPolyPatch&>(patch), td
104 else if (isA<processorPolyPatch>(patch))
108 static_cast<const processorPolyPatch&>(patch), td
111 else if (isA<wallPolyPatch>(patch))
115 static_cast<const wallPolyPatch&>(patch), td, faceHitTetIs
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()))
211 "wallBoundedParticle::trackToEdge" 212 "(TrackData&, const vector&)" 213 ) <<
"Can only track on boundary faces." 214 <<
" Face:" << tetFace()
215 <<
" at:" << mesh_.faceCentres()[tetFace()]
219 point projectedEndPosition = endPosition;
222 const triFace tri(currentTetIndices().faceTriIs(mesh_));
225 const point& basePt = mesh_.points()[tri[0]];
226 projectedEndPosition -= ((projectedEndPosition-basePt)&n)*
n;
230 bool doTrack =
false;
231 if (meshEdgeStart_ == -1 && diagEdge_ == -1)
240 doTrack = isTriAlongTrack(projectedEndPosition);
248 trackFraction = trackFaceTri(projectedEndPosition, triEdgeI);
256 return trackFraction;
280 meshEdgeStart_ = fp0;
282 crossEdgeConnectedFace(currentEdge());
283 patchInteraction(td, trackFraction);
293 meshEdgeStart_ = f.
rcIndex(fp0);
295 crossEdgeConnectedFace(currentEdge());
296 patchInteraction(td, trackFraction);
304 diagEdge_ += f.
size();
311 else if (triEdgeI == 1)
317 crossEdgeConnectedFace(currentEdge());
318 patchInteraction(td, trackFraction);
328 crossEdgeConnectedFace(currentEdge());
329 patchInteraction(td, trackFraction);
339 meshEdgeStart_ = fp0;
341 crossEdgeConnectedFace(currentEdge());
342 patchInteraction(td, trackFraction);
351 diagEdge_ += f.
size();
363 if (meshEdgeStart_ != -1)
366 crossEdgeConnectedFace(currentEdge());
368 patchInteraction(td, trackFraction);
382 return trackFraction;
386 template<
class TrackData>
392 const scalar trackFraction,
401 template<
class TrackData>
409 td.keepParticle =
false;
413 template<
class TrackData>
421 td.keepParticle =
false;
425 template<
class TrackData>
433 td.keepParticle =
false;
437 template<
class TrackData>
445 td.keepParticle =
false;
449 template<
class TrackData>
457 td.switchProcessor =
true;
466 if (meshEdgeStart_ != -1)
468 meshEdgeStart_ = f.
size()-meshEdgeStart_-1;
473 diagEdge_ = f.
size()-diagEdge_;
478 template<
class TrackData>
488 template<
class TrackData>
496 td.keepParticle =
false;
500 template<
class CloudType>
531 template<
class CloudType>
label meshEdgeStart() const
-1 or label of mesh edge
void hitWedgePatch(const wedgePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a wedge.
label diagEdge() const
-1 or diagonal edge
dimensioned< scalar > mag(const dimensioned< Type > &)
Wedge front and back plane patch.
label faceBasePt() const
Return the face base point.
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
Symmetry patch for non-planar or multi-plane patches.
#define forAllIter(Container, container, iter)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void patchInteraction(TrackData &td, const scalar trackFraction)
Do all patch interaction.
A patch is a list of labels that address the faces in the global face list.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static void writeFields(const CloudType &)
Write.
static void readFields(CloudType &c)
Read the fields associated with the owner cloud.
A face is a list of labels corresponding to mesh vertices.
Neighbour processor patch.
static void writeFields(const CloudType &c)
Write the fields associated with the owner cloud.
vector normal() const
Return vector normal.
scalar trackToEdge(TrackData &td, const vector &endPosition)
Equivalent of trackToFace.
errorManip< error > abort(error &err)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
static void readFields(CloudType &)
Read.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
void hitSymmetryPlanePatch(const symmetryPlanePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
void hitCyclicPatch(const cyclicPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a cyclic.
triPointRef faceTri(const polyMesh &mesh) const
Return the geometry corresponding to the tri on the.
A triangular face using a FixedList of labels corresponding to mesh vertices.
const dimensionedScalar c
Speed of light in a vacuum.
label facePtA() const
Return face point A.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
void hitSymmetryPatch(const symmetryPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
Templated base class for dsmc cloud.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.
bool hitPatch(const polyPatch &, TrackData &td, const label patchI, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a patch.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
label facePtB() const
Return face point B.
A primitive field of type <T> with automated input and output.
label face() const
Return the face.