33 template<
class ParcelType>
39 template<
class ParcelType>
40 template<
class TrackData>
50 rhoc_ = td.rhoInterp().interpolate(this->
coordinates(), tetIs);
52 if (rhoc_ < td.cloud().constProps().rhoMin())
57 <<
"Limiting observed density in cell " << celli <<
" to " 58 << td.cloud().constProps().rhoMin() <<
nl <<
endl;
61 rhoc_ = td.cloud().constProps().rhoMin();
64 Uc_ = td.UInterp().interpolate(this->
coordinates(), tetIs);
66 muc_ = td.muInterp().interpolate(this->
coordinates(), tetIs);
69 Uc_ = td.cloud().dispersion().update
81 template<
class ParcelType>
82 template<
class TrackData>
90 Uc_ += td.cloud().UTrans()[celli]/massCell(celli);
94 template<
class ParcelType>
95 template<
class TrackData>
105 const scalar np0 = nParticle_;
106 const scalar mass0 = mass();
109 const scalar Re = this->
Re(U_, d_, rhoc_, muc_);
129 this->U_ = calcVelocity(td, dt, celli, Re, muc_, mass0, Su, dUTrans, Spu);
134 if (td.cloud().solution().coupled())
137 td.cloud().UTrans()[celli] += np0*dUTrans;
140 td.cloud().UCoeff()[celli] += np0*Spu;
145 template<
class ParcelType>
146 template<
class TrackData>
160 typedef typename TrackData::cloudType cloudType;
161 typedef typename cloudType::parcelType parcelType;
162 typedef typename cloudType::forceType forceType;
164 const forceType& forces = td.cloud().forces();
167 const parcelType& p =
static_cast<const parcelType&
>(*this);
168 const forceSuSp Fcp = forces.calcCoupled(p, dt, mass, Re, mu);
169 const forceSuSp Fncp = forces.calcNonCoupled(p, dt, mass, Re, mu);
171 const scalar massEff = forces.massEff(p, mass);
178 const vector abp = (Feff.
Sp()*Uc_ + (Feff.
Su() +
Su))/massEff;
179 const scalar bp = Feff.
Sp()/massEff;
184 td.cloud().UIntegrator().integrate(U_, dt, abp, bp);
189 dUTrans += dt*(Feff.
Sp()*(Ures.
average() - Uc_) - Fcp.
Su());
192 const polyMesh& mesh = td.cloud().pMesh();
202 template<
class ParcelType>
225 template<
class ParcelType>
251 template<
class ParcelType>
252 template<
class TrackData>
256 const scalar trackTime
259 typename TrackData::cloudType::parcelType& p =
260 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
262 td.switchProcessor =
false;
263 td.keepParticle =
true;
265 const polyMesh& mesh = td.cloud().pMesh();
267 const scalarField& cellLengthScale = td.cloud().cellLengthScale();
268 const scalar
maxCo = td.cloud().solution().maxCo();
270 while (td.keepParticle && !td.switchProcessor && p.stepFraction() < 1)
273 p.constrainToMeshCentre();
276 const point start = p.position();
277 const label celli = p.cell();
278 const scalar sfrac = p.stepFraction();
284 const scalar l = cellLengthScale[p.cell()];
289 scalar
f = 1 - p.stepFraction();
291 f =
min(f, maxCo*l/
max(SMALL*l,
mag(s)));
295 p.trackToFace(f*s, f, td);
304 p.stepFraction() +=
f;
308 const scalar dt = (p.stepFraction() - sfrac)*trackTime;
314 p.setCellValues(td, dt, celli);
316 if (td.cloud().solution().cellValueSourceCorrection())
318 p.cellValueSourceCorrection(td, dt, celli);
321 p.calc(td, dt, celli);
324 if (p.onBoundaryFace() && td.keepParticle)
326 if (isA<processorPolyPatch>(pbMesh[p.patch()]))
328 td.switchProcessor =
true;
334 td.cloud().functions().postMove(p, celli, dt, start, td.keepParticle);
337 return td.keepParticle;
341 template<
class ParcelType>
342 template<
class TrackData>
345 typename TrackData::cloudType::parcelType& p =
346 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
348 td.cloud().functions().postFace(p, p.face(), td.keepParticle);
352 template<
class ParcelType>
357 template<
class ParcelType>
358 template<
class TrackData>
364 const scalar trackFraction,
368 typename TrackData::cloudType::parcelType& p =
369 static_cast<typename TrackData::cloudType::parcelType&
>(*this);
372 td.cloud().functions().postPatch
382 if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle))
395 return td.cloud().patchInteraction().correct
407 template<
class ParcelType>
408 template<
class TrackData>
415 td.switchProcessor =
true;
419 template<
class ParcelType>
420 template<
class TrackData>
432 template<
class ParcelType>
433 template<
class TrackData>
440 td.keepParticle =
false;
444 template<
class ParcelType>
447 ParcelType::transformProperties(T);
453 template<
class ParcelType>
459 ParcelType::transformProperties(separation);
463 template<
class ParcelType>
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
virtual scalar wallImpactDistance(const vector &n) const
The nearest distance to a wall that the particle can be.
Kinematic parcel class with rotational motion (as spherical particles only) and one/two-way coupling ...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Helper class to supply results of integration.
scalar tTurb_
Time spent in turbulent eddy [s].
Ostream & endl(Ostream &os)
Add newline and flush stream.
KinematicParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
vector Uc_
Velocity [m/s].
Neighbour processor patch.
Helper container for force Su and Sp terms.
bool move(TrackData &td, const scalar trackTime)
Move the parcel.
scalar dTarget_
Target diameter [m].
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
scalar rho_
Density [kg/m3].
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
scalar muc_
Viscosity [Pa.s].
void hitFace(int &td)
Overridable function to handle the particle hitting a face.
bool active_
Active flag - tracking inactive when active = false.
label typeId_
Parcel type id.
vector UTurb_
Turbulent velocity fluctuation [m/s].
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Type value() const
Return const access to the value.
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
scalar nParticle_
Number of particles in Parcel.
void cellValueSourceCorrection(TrackData &td, const scalar dt, const label celli)
Correct cell values using latest transfer information.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void calc(TrackData &td, const scalar dt, const label celli)
Update parcel properties over the time interval.
scalar rhoc_
Density [kg/m3].
vector U_
Velocity of Parcel [m/s].
PtrList< coordinateSystem > coordinates(solidRegions.size())
#define WarningInFunction
Report a warning using Foam::Warning.
void setCellValues(TrackData &td, const scalar dt, const label celli)
Set cell values.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
A patch is a list of labels that address the faces in the global face list.
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.
scalarField Re(const UList< complex > &cf)
Type average() const
Return const access to the average.
dimensionSet transform(const dimensionSet &)