Go to the documentation of this file.
34 template<
class ParcelType>
40 template<
class ParcelType>
41 template<
class TrackData>
51 rhoc_ = td.rhoInterp().interpolate(this->position(), tetIs);
53 if (rhoc_ < td.cloud().constProps().rhoMin())
58 <<
"Limiting observed density in cell " << cellI <<
" to "
59 << td.cloud().constProps().rhoMin() <<
nl <<
endl;
62 rhoc_ = td.cloud().constProps().rhoMin();
65 Uc_ = td.UInterp().interpolate(this->position(), tetIs);
67 muc_ = td.muInterp().interpolate(this->position(), tetIs);
70 Uc_ = td.cloud().dispersion().update
82 template<
class ParcelType>
83 template<
class TrackData>
91 Uc_ += td.cloud().UTrans()[cellI]/massCell(cellI);
95 template<
class ParcelType>
96 template<
class TrackData>
106 const scalar np0 = nParticle_;
107 const scalar mass0 = mass();
110 const scalar
Re = this->
Re(U_, d_, rhoc_, muc_);
123 vector dUTrans = vector::zero;
130 this->U_ = calcVelocity(td, dt, cellI,
Re, muc_, mass0,
Su, dUTrans, Spu);
135 if (td.cloud().solution().coupled())
138 td.cloud().UTrans()[cellI] += np0*dUTrans;
141 td.cloud().UCoeff()[cellI] += np0*Spu;
146 template<
class ParcelType>
147 template<
class TrackData>
161 typedef typename TrackData::cloudType cloudType;
162 typedef typename cloudType::parcelType parcelType;
163 typedef typename cloudType::forceType forceType;
168 const parcelType&
p =
static_cast<const parcelType&
>(*this);
172 const scalar massEff =
forces.massEff(
p, mass);
179 const vector abp = (Feff.
Sp()*Uc_ + (Feff.
Su() +
Su))/massEff;
180 const scalar bp = Feff.
Sp()/massEff;
185 td.cloud().UIntegrator().integrate(U_, dt, abp, bp);
190 dUTrans += dt*(Feff.
Sp()*(Ures.
average() - Uc_) - Fcp.
Su());
203 template<
class ParcelType>
212 nParticle_(
p.nParticle_),
214 dTarget_(
p.dTarget_),
226 template<
class ParcelType>
229 const KinematicParcel<ParcelType>&
p,
236 nParticle_(
p.nParticle_),
238 dTarget_(
p.dTarget_),
252 template<
class ParcelType>
253 template<
class TrackData>
257 const scalar trackTime
260 typename TrackData::cloudType::parcelType&
p =
261 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
263 td.switchProcessor =
false;
264 td.keepParticle =
true;
269 const scalarField& cellLengthScale = td.cloud().cellLengthScale();
271 scalar tEnd = (1.0 -
p.stepFraction())*trackTime;
272 scalar dtMax =
solution.deltaTMax(trackTime);
274 bool tracking =
true;
275 label nTrackingStalled = 0;
277 while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL)
282 const point start(
p.position());
285 scalar dt =
min(dtMax, tEnd);
288 const label cellI =
p.cell();
290 const scalar magU =
mag(U_);
291 if (
p.active() && tracking && (magU > ROOTVSMALL))
293 const scalar d = dt*magU;
294 const scalar deltaLMax =
solution.deltaLMax(cellLengthScale[cellI]);
295 const scalar dCorr =
min(d, deltaLMax);
298 *
p.trackToFace(
p.position() + dCorr*U_/magU, td);
303 const scalar newStepFraction = 1.0 - tEnd/trackTime;
309 mag(
p.stepFraction() - newStepFraction)
315 if (nTrackingStalled > maxTrackAttempts)
322 nTrackingStalled = 0;
326 p.stepFraction() = newStepFraction;
328 bool calcParcel =
true;
329 if (!tracking &&
solution.steadyState())
335 if ((dt > ROOTVSMALL) && calcParcel)
338 p.setCellValues(td, dt, cellI);
340 if (
solution.cellValueSourceCorrection())
342 p.cellValueSourceCorrection(td, dt, cellI);
345 p.calc(td, dt, cellI);
348 if (
p.onBoundary() && td.keepParticle)
350 if (isA<processorPolyPatch>(pbMesh[
p.patch(
p.face())]))
352 td.switchProcessor =
true;
358 td.cloud().functions().postMove(
p, cellI, dt, start, td.keepParticle);
361 return td.keepParticle;
365 template<
class ParcelType>
366 template<
class TrackData>
369 typename TrackData::cloudType::parcelType&
p =
370 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
372 td.cloud().functions().postFace(
p,
p.face(), td.keepParticle);
376 template<
class ParcelType>
381 template<
class ParcelType>
382 template<
class TrackData>
388 const scalar trackFraction,
392 typename TrackData::cloudType::parcelType&
p =
393 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
396 td.cloud().functions().postPatch
406 if (td.cloud().surfaceFilm().transferParcel(
p, pp, td.keepParticle))
414 return td.cloud().patchInteraction().correct
426 template<
class ParcelType>
427 template<
class TrackData>
434 td.switchProcessor =
true;
438 template<
class ParcelType>
439 template<
class TrackData>
451 template<
class ParcelType>
452 template<
class TrackData>
459 td.keepParticle =
false;
461 td.cloud().patchInteraction().addToEscapedParcels(nParticle_*mass());
465 template<
class ParcelType>
468 ParcelType::transformProperties(
T);
474 template<
class ParcelType>
480 ParcelType::transformProperties(separation);
484 template<
class ParcelType>
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Type value() const
Return const access to the value.
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Selector class for relaxation factors, solver type and solution.
void cellValueSourceCorrection(TrackData &td, const scalar dt, const label cellI)
Correct cell values using latest transfer information.
static const scalar minStepFractionTol
Minimum stepFraction tolerance.
const dimensionedScalar mu
Atomic mass unit.
virtual scalar wallImpactDistance(const vector &n) const
The nearest distance to a wall that the particle can be.
scalarField Re(const UList< complex > &cf)
solution(const solution &)
Disallow default bitwise copy construct and assignment.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
const vector calcVelocity(TrackData &td, const scalar dt, const label cellI, const scalar Re, const scalar mu, const scalar mass, const vector &Su, vector &dUTrans, scalar &Spu) const
Calculate new particle velocity.
bool move(TrackData &td, const scalar trackTime)
Move the parcel.
Mesh consisting of general polyhedral cells.
dimensionSet transform(const dimensionSet &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
A patch is a list of labels that address the faces in the global face list.
Stores all relevant solution info for cloud.
Helper container for force Su and Sp terms.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Helper class to supply results of integration.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
Neighbour processor patch.
Type average() const
Return const access to the average.
void hitFace(int &td)
Overridable function to handle the particle hitting a face.
This function object calculates the forces and moments by integrating the pressure and skin-friction ...
bool hitPatch(const polyPatch &p, 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.
void setCellValues(TrackData &td, const scalar dt, const label cellI)
Set cell values.
Kinematic parcel class with rotational motion (as spherical particles only) and one/two-way coupling ...
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
KinematicParcel(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from owner, position, and cloud owner.
void calc(TrackData &td, const scalar dt, const label cellI)
Update parcel properties over the time interval.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
#define WarningInFunction
Report a warning using Foam::Warning.
forces(const forces &)
Disallow default bitwise copy construct.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.