33 template<
class ParcelType>
34 template<
class TrackCloudType>
37 TrackCloudType&
cloud,
39 const scalar trackTime
42 typename TrackCloudType::parcelType&
p =
43 static_cast<typename TrackCloudType::parcelType&
>(*this);
45 td.switchProcessor =
false;
46 td.keepParticle =
true;
56 while (
td.keepParticle && !
td.switchProcessor &&
p.stepFraction() < 1)
65 const vector d =
p.deviationFromMeshCentre();
67 const scalar
f = 1 -
p.stepFraction();
68 p.trackToAndHitFace(
f*trackTime*Utracking - d,
f,
cloud,
td);
71 return td.keepParticle;
75 template<
class ParcelType>
76 template<
class TrackCloudType>
83 template<
class ParcelType>
84 template<
class TrackCloudType>
91 td.switchProcessor =
true;
95 template<
class ParcelType>
96 template<
class TrackCloudType>
99 TrackCloudType&
cloud,
103 const label wppIndex = this->
patch();
108 this->
mesh().boundaryMesh()[wppIndex]
117 const constantProperties& constProps(
cloud.constProps(typeId_));
119 scalar m = constProps.mass();
123 scalar U_dot_nw = U_ & nw;
125 vector Ut = U_ - U_dot_nw*nw;
127 scalar invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, VSMALL);
129 cloud.rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
131 cloud.rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
133 cloud.linearKEBF()[wppIndex][wppLocalFace] +=
134 0.5*m*(U_ & U_)*invMagUnfA;
136 cloud.internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
138 cloud.iDofBF()[wppIndex][wppLocalFace] +=
139 constProps.internalDegreesOfFreedom()*invMagUnfA;
141 cloud.momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
144 scalar preIE = 0.5*m*(U_ & U_) + Ei_;
149 cloud.wallInteraction().correct(*
this);
153 Ut = U_ - U_dot_nw*nw;
155 invMagUnfA = 1/
max(
mag(U_dot_nw)*fA, VSMALL);
157 cloud.rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
159 cloud.rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
161 cloud.linearKEBF()[wppIndex][wppLocalFace] +=
162 0.5*m*(U_ & U_)*invMagUnfA;
164 cloud.internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
166 cloud.iDofBF()[wppIndex][wppLocalFace] +=
167 constProps.internalDegreesOfFreedom()*invMagUnfA;
169 cloud.momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
172 scalar postIE = 0.5*m*(U_ & U_) + Ei_;
177 scalar deltaQ =
cloud.nParticle()*(preIE - postIE)/(deltaT*fA);
179 vector deltaFD =
cloud.nParticle()*(preIMom - postIMom)/(deltaT*fA);
181 cloud.qBF()[wppIndex][wppLocalFace] += deltaQ;
183 cloud.fDBF()[wppIndex][wppLocalFace] += deltaFD;
187 template<
class ParcelType>
190 ParcelType::transformProperties(
T);
195 template<
class ParcelType>
201 ParcelType::transformProperties(separation);
label whichFace(const label facei) const noexcept
Return label of face in patch from global face label.
scalar deltaTValue() const noexcept
Return time step value.
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
void hitWallPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
const Time & time() const noexcept
Return time registry.
A cloud is a registry collection of lagrangian particles.
const vectorField::subField faceAreas() const
Return face normals.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
void hitProcessorPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a.
bool move(TrackCloudType &cloud, trackingData &td, const scalar trackTime)
Move the parcel.
bool hitPatch(TrackCloudType &, trackingData &)
Overridable function to handle the particle hitting a patch.
const std::string patch
OpenFOAM patch number as a std::string.
ParcelType::trackingData trackingData
Use base tracking data.
Mesh consisting of general polyhedral cells.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Tensor of scalars, i.e. Tensor<scalar>.