Go to the documentation of this file.
36 template<
class ParcelType>
42 template<
class ParcelType>
43 template<
class TrackCloudType>
46 TrackCloudType&
cloud,
54 if (td.
rhoc() <
cloud.constProps().rhoMin())
59 <<
"Limiting observed density in cell " << this->
cell()
60 <<
" to " <<
cloud.constProps().rhoMin() <<
nl <<
endl;
72 template<
class ParcelType>
73 template<
class TrackCloudType>
76 TrackCloudType&
cloud,
81 td.
Uc() =
cloud.dispersion().update
93 template<
class ParcelType>
94 template<
class TrackCloudType>
97 TrackCloudType&
cloud,
102 td.
Uc() +=
cloud.UTrans()[this->
cell()]/massCell(td);
106 template<
class ParcelType>
107 template<
class TrackCloudType>
110 TrackCloudType&
cloud,
117 const scalar np0 = nParticle_;
118 const scalar mass0 = mass();
121 const scalar
Re = this->
Re(td);
142 calcVelocity(
cloud, td, dt,
Re, td.
muc(), mass0,
Su, dUTrans, Spu);
147 if (
cloud.solution().coupled())
150 cloud.UTrans()[this->
cell()] += np0*dUTrans;
158 template<
class ParcelType>
159 template<
class TrackCloudType>
162 TrackCloudType&
cloud,
173 const typename TrackCloudType::parcelType&
p =
174 static_cast<const typename TrackCloudType::parcelType&
>(*this);
175 typename TrackCloudType::parcelType::trackingData& ttd =
176 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
178 const typename TrackCloudType::forceType& forces =
cloud.forces();
181 const forceSuSp Fcp = forces.calcCoupled(
p, ttd, dt, mass,
Re,
mu);
182 const forceSuSp Fncp = forces.calcNonCoupled(
p, ttd, dt, mass,
Re,
mu);
183 const scalar massEff = forces.massEff(
p, ttd, mass);
209 const vector acp = (Fcp.
Sp()*td.
Uc() + Fcp.
Su())/massEff;
211 const scalar bcp = Fcp.
Sp()/massEff;
214 const vector deltaU =
cloud.UIntegrator().delta(U_, dt, acp + ancp, bcp);
215 const vector deltaUncp = ancp*dt;
216 const vector deltaUcp = deltaU - deltaUncp;
219 vector Unew = U_ + deltaU;
221 dUTrans -= massEff*deltaUcp;
236 template<
class ParcelType>
245 nParticle_(
p.nParticle_),
247 dTarget_(
p.dTarget_),
256 template<
class ParcelType>
259 const KinematicParcel<ParcelType>&
p,
266 nParticle_(
p.nParticle_),
268 dTarget_(
p.dTarget_),
279 template<
class ParcelType>
280 template<
class TrackCloudType>
283 TrackCloudType&
cloud,
285 const scalar trackTime
288 typename TrackCloudType::parcelType&
p =
289 static_cast<typename TrackCloudType::parcelType&
>(*this);
290 typename TrackCloudType::parcelType::trackingData& ttd =
291 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
293 ttd.switchProcessor =
false;
294 ttd.keepParticle =
true;
300 while (ttd.keepParticle && !ttd.switchProcessor &&
p.stepFraction() < 1)
303 const point start =
p.position();
304 const scalar sfrac =
p.stepFraction();
310 const scalar l = cellLengthScale[
p.cell()];
313 const vector d =
p.deviationFromMeshCentre();
318 scalar
f = 1 -
p.stepFraction();
324 p.trackToFace(
f*
s - d,
f);
333 p.stepFraction() +=
f;
336 const scalar dt = (
p.stepFraction() - sfrac)*trackTime;
342 p.setCellValues(
cloud, ttd);
344 p.calcDispersion(
cloud, ttd, dt);
346 if (
solution.cellValueSourceCorrection())
348 p.cellValueSourceCorrection(
cloud, ttd, dt);
356 if (
p.active() &&
p.onFace())
358 cloud.functions().postFace(
p, ttd.keepParticle);
361 cloud.functions().postMove(
p, dt, start, ttd.keepParticle);
363 if (
p.active() &&
p.onFace() && ttd.keepParticle)
369 return ttd.keepParticle;
373 template<
class ParcelType>
374 template<
class TrackCloudType>
377 TrackCloudType&
cloud,
381 typename TrackCloudType::parcelType&
p =
382 static_cast<typename TrackCloudType::parcelType&
>(*this);
384 const polyPatch& pp =
p.mesh().boundaryMesh()[
p.patch()];
387 cloud.functions().postPatch(
p, pp, td.keepParticle);
389 if (isA<processorPolyPatch>(pp))
394 else if (
cloud.surfaceFilm().transferParcel(
p, pp, td.keepParticle))
407 cloud.patchInteraction().addToEscapedParcels(nParticle_*mass());
411 return cloud.patchInteraction().correct(
p, pp, td.keepParticle);
416 template<
class ParcelType>
417 template<
class TrackCloudType>
424 td.switchProcessor =
true;
428 template<
class ParcelType>
429 template<
class TrackCloudType>
440 template<
class ParcelType>
443 ParcelType::transformProperties(
T);
449 template<
class ParcelType>
455 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 ...
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.