37template<
class ParcelType>
43template<
class ParcelType>
44template<
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;
73template<
class ParcelType>
74template<
class TrackCloudType>
77 TrackCloudType&
cloud,
82 td.
Uc() =
cloud.dispersion().update
94template<
class ParcelType>
95template<
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);
116template<
class ParcelType>
117template<
class TrackCloudType>
120 TrackCloudType&
cloud,
125 td.
Uc() +=
cloud.UTrans()[this->
cell()]/massCell(td);
129template<
class ParcelType>
130template<
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;
182template<
class ParcelType>
183template<
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;
251 meshTools::constrainDirection(
mesh,
mesh.solutionD(), Unew);
252 meshTools::constrainDirection(
mesh,
mesh.solutionD(), dUTrans);
260template<
class ParcelType>
269 nParticle_(
p.nParticle_),
271 dTarget_(
p.dTarget_),
277 UCorrect_(
p.UCorrect_)
281template<
class ParcelType>
284 const KinematicParcel<ParcelType>&
p,
291 nParticle_(
p.nParticle_),
293 dTarget_(
p.dTarget_),
299 UCorrect_(
p.UCorrect_)
305template<
class ParcelType>
306template<
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;
400template<
class ParcelType>
401template<
class TrackCloudType>
404 TrackCloudType&
cloud,
408 typename TrackCloudType::parcelType&
p =
409 static_cast<typename TrackCloudType::parcelType&
>(*this);
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);
443template<
class ParcelType>
444template<
class TrackCloudType>
451 td.switchProcessor =
true;
455template<
class ParcelType>
456template<
class TrackCloudType>
467template<
class ParcelType>
476template<
class ParcelType>
const Mesh & mesh() const
Return mesh.
const vector & Uc() const
Return the continuous phase velocity.
scalar muc() const
Return the continuous phase viscosity.
const interpolation< vector > & UInterp() const
scalar rhoc() const
Return the continuous phase density.
const interpolation< scalar > & muInterp() const
const interpolation< scalar > & rhoInterp() const
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.
void calcUCorrection(TrackCloudType &cloud, trackingData &td, const scalar dt)
Correct U following MP-PIC sub-models.
void calcDispersion(TrackCloudType &cloud, trackingData &td, const scalar dt)
Apply dispersion to the carrier phase velocity and update.
void hitProcessorPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a.
bool hitPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a patch.
void setCellValues(TrackCloudType &cloud, trackingData &td)
Set cell values.
void hitWallPatch(TrackCloudType &cloud, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
A cell is defined as a list of faces with extra functionality.
Stores all relevant solution info for cloud.
const Switch cellValueSourceCorrection() const
Return const access to the cell value correction flag.
A cloud is a registry collection of lagrangian particles.
virtual const word & constraintType() const
Return the constraint type this pointPatch implements.
Helper container for force Su and Sp terms.
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
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.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
Selector class for relaxation factors, solver type and solution.
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
const volScalarField & mu
PtrList< coordinateSystem > coordinates(solidRegions.size())
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))
#define WarningInFunction
Report a warning using Foam::Warning.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
scalarField Re(const UList< complex > &cf)
Extract real component.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)