Go to the documentation of this file.
37 template<
class ParcelType>
43 template<
class ParcelType>
44 template<
class TrackCloudType>
47 TrackCloudType&
cloud,
55 if (td.
rhoc() <
cloud.constProps().rhoMin())
60 <<
"Limiting observed density in cell " << this->
cell()
61 <<
" to " <<
cloud.constProps().rhoMin() <<
nl <<
endl;
73 template<
class ParcelType>
74 template<
class TrackCloudType>
77 TrackCloudType&
cloud,
82 td.
Uc() =
cloud.dispersion().update
94 template<
class ParcelType>
95 template<
class TrackCloudType>
98 TrackCloudType&
cloud,
103 typename TrackCloudType::parcelType&
p =
104 static_cast<typename TrackCloudType::parcelType&
>(*this);
106 this->UCorrect_ =
Zero;
109 cloud.dampingModel().velocityCorrection(
p, dt);
112 cloud.packingModel().velocityCorrection(
p, dt);
116 template<
class ParcelType>
117 template<
class TrackCloudType>
120 TrackCloudType&
cloud,
125 td.
Uc() +=
cloud.UTrans()[this->
cell()]/massCell(td);
129 template<
class ParcelType>
130 template<
class TrackCloudType>
133 TrackCloudType&
cloud,
140 const scalar np0 = nParticle_;
141 const scalar mass0 = mass();
144 const scalar
Re = this->
Re(td);
165 calcVelocity(
cloud, td, dt,
Re, td.
muc(), mass0,
Su, dUTrans, Spu);
167 this->U_ += this->UCorrect_;
171 if (
cloud.solution().coupled())
174 cloud.UTrans()[this->
cell()] += np0*dUTrans;
182 template<
class ParcelType>
183 template<
class TrackCloudType>
186 TrackCloudType&
cloud,
197 const typename TrackCloudType::parcelType&
p =
198 static_cast<const typename TrackCloudType::parcelType&
>(*this);
199 typename TrackCloudType::parcelType::trackingData& ttd =
200 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
202 const typename TrackCloudType::forceType& forces =
cloud.forces();
205 const forceSuSp Fcp = forces.calcCoupled(
p, ttd, dt, mass,
Re,
mu);
206 const forceSuSp Fncp = forces.calcNonCoupled(
p, ttd, dt, mass,
Re,
mu);
207 const scalar massEff = forces.massEff(
p, ttd, mass);
233 const vector acp = (Fcp.
Sp()*td.
Uc() + Fcp.
Su())/massEff;
235 const scalar bcp = Fcp.
Sp()/massEff;
238 const vector deltaU =
cloud.UIntegrator().delta(U_, dt, acp + ancp, bcp);
239 const vector deltaUncp = ancp*dt;
240 const vector deltaUcp = deltaU - deltaUncp;
243 vector Unew = U_ + deltaU;
245 dUTrans -= massEff*deltaUcp;
260 template<
class ParcelType>
269 nParticle_(
p.nParticle_),
271 dTarget_(
p.dTarget_),
277 UCorrect_(
p.UCorrect_)
281 template<
class ParcelType>
284 const KinematicParcel<ParcelType>&
p,
291 nParticle_(
p.nParticle_),
293 dTarget_(
p.dTarget_),
299 UCorrect_(
p.UCorrect_)
305 template<
class ParcelType>
306 template<
class TrackCloudType>
309 TrackCloudType&
cloud,
311 const scalar trackTime
314 typename TrackCloudType::parcelType&
p =
315 static_cast<typename TrackCloudType::parcelType&
>(*this);
316 typename TrackCloudType::parcelType::trackingData& ttd =
317 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
319 ttd.switchProcessor =
false;
320 ttd.keepParticle =
true;
326 while (ttd.keepParticle && !ttd.switchProcessor &&
p.stepFraction() < 1)
329 const point start =
p.position();
330 const scalar sfrac =
p.stepFraction();
336 const scalar l = cellLengthScale[
p.cell()];
339 const vector d =
p.deviationFromMeshCentre();
344 scalar
f = 1 -
p.stepFraction();
350 p.trackToFace(
f*
s - d,
f);
359 p.stepFraction() +=
f;
362 const scalar dt = (
p.stepFraction() - sfrac)*trackTime;
368 p.setCellValues(
cloud, ttd);
370 p.calcDispersion(
cloud, ttd, dt);
372 if (
solution.cellValueSourceCorrection())
374 p.cellValueSourceCorrection(
cloud, ttd, dt);
377 p.calcUCorrection(
cloud, ttd, dt);
384 if (
p.active() &&
p.onFace())
386 cloud.functions().postFace(
p, ttd.keepParticle);
388 cloud.functions().postMove(
p, dt, start, ttd.keepParticle);
390 if (
p.active() &&
p.onFace() && ttd.keepParticle)
396 return ttd.keepParticle;
400 template<
class ParcelType>
401 template<
class TrackCloudType>
404 TrackCloudType&
cloud,
408 typename TrackCloudType::parcelType&
p =
409 static_cast<typename TrackCloudType::parcelType&
>(*this);
411 const polyPatch& pp =
p.mesh().boundaryMesh()[
p.patch()];
414 cloud.functions().postPatch(
p, pp, td.keepParticle);
416 if (isA<processorPolyPatch>(pp))
421 else if (
cloud.surfaceFilm().transferParcel(
p, pp, td.keepParticle))
434 cloud.patchInteraction().addToEscapedParcels(nParticle_*mass());
438 return cloud.patchInteraction().correct(
p, pp, td.keepParticle);
443 template<
class ParcelType>
444 template<
class TrackCloudType>
451 td.switchProcessor =
true;
455 template<
class ParcelType>
456 template<
class TrackCloudType>
467 template<
class ParcelType>
470 ParcelType::transformProperties(
T);
476 template<
class ParcelType>
482 ParcelType::transformProperties(separation);
int debug
Static debugging option.
const vector & Uc() const
Return the continuous phase velocity.
Selector class for relaxation factors, solver type and solution.
void cellValueSourceCorrection(TrackCloudType &cloud, trackingData &td, const scalar dt)
Correct cell values using latest transfer information.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar mu
Atomic mass unit.
static constexpr const zero Zero
Global zero (0)
void calcDispersion(TrackCloudType &cloud, trackingData &td, const scalar dt)
Apply dispersion to the carrier phase velocity and update.
void hitWallPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
void calc(TrackCloudType &cloud, trackingData &td, const scalar dt)
Update parcel properties over the time interval.
A patch is a list of labels that address the faces in the global face list.
KinematicParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
Stores all relevant solution info for cloud.
Helper container for force Su and Sp terms.
PtrList< coordinateSystem > coordinates(solidRegions.size())
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
const interpolation< vector > & UInterp() const
bool hitPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a patch.
void hitProcessorPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a.
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
A cloud is a registry collection of lagrangian particles.
const interpolation< scalar > & muInterp() const
bool move(TrackCloudType &cloud, trackingData &td, const scalar trackTime)
Move the parcel.
scalar rhoc() const
Return the continuous phase density.
scalar muc() const
Return the continuous phase viscosity.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalarField Re(const UList< complex > &cf)
Extract real component.
Kinematic parcel class with rotational motion (as spherical particles only) and one/two-way coupling ...
void calcUCorrection(TrackCloudType &cloud, trackingData &td, const scalar dt)
Correct U following MP-PIC sub-models.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
void setCellValues(TrackCloudType &cloud, trackingData &td)
Set cell values.
virtual Type interpolate(const vector &position, const label celli, const label facei=-1) const =0
Interpolate field to the given point in the given cell.
#define WarningInFunction
Report a warning using Foam::Warning.
A cell is defined as a list of faces with extra functionality.
const interpolation< scalar > & rhoInterp() const
const vector calcVelocity(TrackCloudType &cloud, trackingData &td, const scalar dt, const scalar Re, const scalar mu, const scalar mass, const vector &Su, vector &dUTrans, scalar &Spu) const
Calculate new particle velocity.