31 template<
class ParcelType>
32 template<
class TrackCloudType>
35 TrackCloudType&
cloud,
39 typename TrackCloudType::parcelType&
p =
40 static_cast<typename TrackCloudType::parcelType&
>(*this);
42 td.keepParticle =
true;
55 while (td.keepParticle && td.sendToProc == -1 &&
p.stepFraction() < 1)
64 const vector d =
p.deviationFromMeshCentre(mesh);
66 const scalar
f = 1 -
p.stepFraction();
67 p.trackToAndHitFace(
f*trackTime*Utracking - d,
f,
cloud, td);
70 return td.keepParticle;
74 template<
class ParcelType>
75 template<
class TrackCloudType>
78 TrackCloudType&
cloud,
82 const label wppIndex = this->patch(
cloud.pMesh());
87 cloud.pMesh().boundaryMesh()[wppIndex]
98 scalar m = constProps.
mass();
103 scalar U_dot_nw = U_ & nw;
105 vector Ut = U_ - U_dot_nw*nw;
107 scalar invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, vSmall);
109 cloud.rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
111 cloud.rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
113 cloud.linearKEBF()[wppIndex][wppLocalFace] +=
114 0.5*m*(U_ & U_)*invMagUnfA;
116 cloud.internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
118 cloud.iDofBF()[wppIndex][wppLocalFace] +=
121 cloud.momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
124 scalar preIE = 0.5*m*(U_ & U_) + Ei_;
129 cloud.wallInteraction().correct(*
this);
133 Ut = U_ - U_dot_nw*nw;
135 invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, vSmall);
137 cloud.rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
139 cloud.rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
141 cloud.linearKEBF()[wppIndex][wppLocalFace] +=
142 0.5*m*(U_ & U_)*invMagUnfA;
144 cloud.internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
146 cloud.iDofBF()[wppIndex][wppLocalFace] +=
149 cloud.momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
152 scalar postIE = 0.5*m*(U_ & U_) + Ei_;
157 scalar deltaQ =
cloud.nParticle()*(preIE - postIE)/(deltaT*fA);
159 vector deltaFD =
cloud.nParticle()*(preIMom - postIMom)/(deltaT*fA);
161 cloud.qBF()[wppIndex][wppLocalFace] += deltaQ;
163 cloud.fDBF()[wppIndex][wppLocalFace] += deltaFD;
167 template<
class ParcelType>
173 ParcelType::transformProperties(
transform);
Class to hold DSMC particle constant properties.
scalar mass() const
Return const access to the particle mass [kg].
direction internalDegreesOfFreedom() const
Return the internalDegreesOfFreedom.
bool move(TrackCloudType &cloud, trackingData &td)
Move the parcel.
ParcelType::trackingData trackingData
Use base tracking data.
virtual void transformProperties(const transformer &)
Transform the physical properties of the particle.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
scalar deltaTValue() const
Return time step value.
A cloud is a collection of lagrangian particles.
friend dimensionSet transform(const dimensionSet &)
A face is a list of labels corresponding to mesh vertices.
const Time & time() const
Return time.
Mesh consisting of general polyhedral cells.
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
label whichFace(const label l) const
Return label of face in patch from global face label.
const vectorField::subField faceAreas() const
Return face areas.
const scalarField::subField magFaceAreas() const
Return face area magnitudes.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionSet transform(const dimensionSet &)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)