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);
129 template<
class TrackData>
157 scalar trackFraction = 0.0;
159 if (!td.isWallPatch_[tetFace()])
163 const edge meshEdge(currentEdge());
167 if (mesh_.isInternalFace(tetFace()))
171 celli_ == mesh_.faceOwner()[facei_]
172 ? mesh_.faceNeighbour()[facei_]
173 : mesh_.faceOwner()[facei_]
178 tetIndices nbrTi(nbrCelli, tetFacei_, tetPtI_, mesh_);
179 if ((nbrTi.
faceTri(mesh_).
normal() & (endPosition-position())) < 0)
185 patchInteraction(td, trackFraction);
191 crossEdgeConnectedFace(meshEdge);
192 patchInteraction(td, trackFraction);
199 crossEdgeConnectedFace(meshEdge);
200 patchInteraction(td, trackFraction);
208 if (mesh_.isInternalFace(tetFace()))
211 <<
"Can only track on boundary faces." 212 <<
" Face:" << tetFace()
213 <<
" at:" << mesh_.faceCentres()[tetFace()]
217 point projectedEndPosition = endPosition;
220 const triFace tri(currentTetIndices().faceTriIs(mesh_));
223 const point& basePt = mesh_.points()[tri[0]];
224 projectedEndPosition -= ((projectedEndPosition-basePt)&n)*
n;
228 bool doTrack =
false;
229 if (meshEdgeStart_ == -1 && diagEdge_ == -1)
238 doTrack = isTriAlongTrack(projectedEndPosition);
246 trackFraction = trackFaceTri(projectedEndPosition, triEdgeI);
254 return trackFraction;
278 meshEdgeStart_ = fp0;
280 crossEdgeConnectedFace(currentEdge());
281 patchInteraction(td, trackFraction);
291 meshEdgeStart_ = f.
rcIndex(fp0);
293 crossEdgeConnectedFace(currentEdge());
294 patchInteraction(td, trackFraction);
302 diagEdge_ += f.
size();
309 else if (triEdgeI == 1)
315 crossEdgeConnectedFace(currentEdge());
316 patchInteraction(td, trackFraction);
326 crossEdgeConnectedFace(currentEdge());
327 patchInteraction(td, trackFraction);
337 meshEdgeStart_ = fp0;
339 crossEdgeConnectedFace(currentEdge());
340 patchInteraction(td, trackFraction);
349 diagEdge_ += f.
size();
361 if (meshEdgeStart_ != -1)
364 crossEdgeConnectedFace(currentEdge());
366 patchInteraction(td, trackFraction);
380 return trackFraction;
384 template<
class TrackData>
390 const scalar trackFraction,
399 template<
class TrackData>
407 td.keepParticle =
false;
411 template<
class TrackData>
419 td.keepParticle =
false;
423 template<
class TrackData>
431 td.keepParticle =
false;
435 template<
class TrackData>
443 td.keepParticle =
false;
447 template<
class TrackData>
455 td.switchProcessor =
true;
464 if (meshEdgeStart_ != -1)
466 meshEdgeStart_ = f.
size()-meshEdgeStart_-1;
471 diagEdge_ = f.
size()-diagEdge_;
476 template<
class TrackData>
486 template<
class TrackData>
494 td.keepParticle =
false;
498 template<
class CloudType>
529 template<
class CloudType>
Symmetry patch for non-planar or multi-plane patches.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label facePtA() const
Return face point A.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void hitSymmetryPatch(const symmetryPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
triPointRef faceTri(const polyMesh &mesh) const
Return the geometry corresponding to the tri on the.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
void size(const label)
Override size to be inconsistent with allocated storage.
bool hitPatch(const polyPatch &, TrackData &td, const label patchi, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a patch.
void hitWedgePatch(const wedgePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a wedge.
static void readFields(CloudType &c)
Read the fields associated with the owner cloud.
Neighbour processor patch.
label faceBasePt() const
Return the face base point.
vector normal(const pointField &) const
Vector normal; magnitude is equal to area of face.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
label facePtB() const
Return face point B.
static void writeFields(const CloudType &c)
Write the fields associated with the owner cloud.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A triangular face using a FixedList of labels corresponding to mesh vertices.
Wedge front and back plane patch.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
label face() const
Return the face.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
static void readFields(CloudType &)
Read.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
label meshEdgeStart() const
-1 or label of mesh edge
static void writeFields(const CloudType &)
Write.
void hitCyclicPatch(const cyclicPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a cyclic.
void patchInteraction(TrackData &td, const scalar trackFraction)
Do all patch interaction.
scalar trackToEdge(TrackData &td, const vector &endPosition)
Equivalent of trackToFace.
const dimensionedScalar c
Speed of light in a vacuum.
dimensioned< scalar > mag(const dimensioned< Type > &)
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
label diagEdge() const
-1 or diagonal edge
void hitSymmetryPlanePatch(const symmetryPlanePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
A patch is a list of labels that address the faces in the global face list.
Templated base class for dsmc cloud.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
A primitive field of type <T> with automated input and output.
vector normal() const
Return vector normal.