31 template<
class ParcelType>
32 template<
class TrackData>
35 typename TrackData::cloudType::parcelType&
p =
36 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
38 td.switchProcessor =
false;
39 td.keepParticle =
true;
44 scalar tEnd = (1.0 - p.stepFraction())*trackTime;
45 const scalar dtMax = tEnd;
53 while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
65 scalar dt =
min(dtMax, tEnd);
67 dt *= p.trackToFace(p.position() + dt*Utracking, td);
71 p.stepFraction() = 1.0 - tEnd/trackTime;
73 if (p.onBoundary() && td.keepParticle)
75 if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
77 td.switchProcessor =
true;
82 return td.keepParticle;
86 template<
class ParcelType>
87 template<
class TrackData>
101 template<
class ParcelType>
102 template<
class TrackData>
109 td.switchProcessor =
true;
113 template<
class ParcelType>
114 template<
class TrackData>
128 const scalar deltaT = td.cloud().pMesh().time().deltaTValue();
132 scalar m = constProps.
mass();
137 scalar U_dot_nw = U_ &
nw;
141 scalar invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, VSMALL);
143 td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
145 td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
147 td.cloud().linearKEBF()[wppIndex][wppLocalFace] +=
148 0.5*m*(U_ & U_)*invMagUnfA;
150 td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
152 td.cloud().iDofBF()[wppIndex][wppLocalFace] +=
153 constProps.internalDegreesOfFreedom()*invMagUnfA;
155 td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
158 scalar preIE = 0.5*m*(U_ & U_) + Ei_;
163 td.cloud().wallInteraction().correct
171 Ut = U_ - U_dot_nw*
nw;
173 invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, VSMALL);
175 td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
177 td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
179 td.cloud().linearKEBF()[wppIndex][wppLocalFace] +=
180 0.5*m*(U_ & U_)*invMagUnfA;
182 td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
184 td.cloud().iDofBF()[wppIndex][wppLocalFace] +=
185 constProps.internalDegreesOfFreedom()*invMagUnfA;
187 td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
190 scalar postIE = 0.5*m*(U_ & U_) + Ei_;
195 scalar deltaQ = td.cloud().nParticle()*(preIE - postIE)/(deltaT*fA);
197 vector deltaFD = td.cloud().nParticle()*(preIMom - postIMom)/(deltaT*fA);
199 td.cloud().qBF()[wppIndex][wppLocalFace] += deltaQ;
201 td.cloud().fDBF()[wppIndex][wppLocalFace] += deltaFD;
206 template<
class ParcelType>
207 template<
class TrackData>
210 td.keepParticle =
false;
214 template<
class ParcelType>
217 ParcelType::transformProperties(T);
222 template<
class ParcelType>
228 ParcelType::transformProperties(separation);
const vectorField::subField faceAreas() const
Return face normals.
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 whichFace(const label l) const
Return label of face in patch from global face label.
A face is a list of labels corresponding to mesh vertices.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.
bool move(TrackData &td, const scalar trackTime)
Move the parcel.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
bool hitPatch(const polyPatch &, TrackData &td, const label patchi, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a patch.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Neighbour processor patch.
Class to hold DSMC particle constant properties.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar mass() const
Return const access to the particle mass [kg].
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
label index() const
Return the index of this patch in the boundaryMesh.
dimensionSet transform(const dimensionSet &)