49 template<
class CloudType>
52 dispersionModel_.reset
61 patchInteractionModel_.reset
70 stochasticCollisionModel_.reset
79 surfaceFilmModel_.reset
120 solution_.integrationSchemes()
126 template<
class CloudType>
127 template<
class TrackCloudType>
130 TrackCloudType&
cloud,
131 typename parcelType::trackingData& td
136 if (solution_.steadyState())
142 evolveCloud(
cloud, td);
144 if (solution_.coupled())
153 evolveCloud(cloud, td);
155 if (solution_.coupled())
157 cloud.scaleSources();
163 cloud.postEvolve(td);
165 if (solution_.steadyState())
167 cloud.restoreState();
172 template<
class CloudType>
175 if (!cellOccupancyPtr_)
177 cellOccupancyPtr_.reset
179 new List<DynamicList<parcelType*>>(mesh_.nCells())
182 else if (cellOccupancyPtr_().size() != mesh_.nCells())
187 cellOccupancyPtr_().setSize(mesh_.nCells());
190 List<DynamicList<parcelType*>>&
cellOccupancy = cellOccupancyPtr_();
197 for (parcelType&
p : *
this)
204 template<
class CloudType>
210 if (cellOccupancyPtr_)
212 buildCellOccupancy();
217 template<
class CloudType>
218 template<
class TrackCloudType>
221 TrackCloudType& cloud,
222 typename parcelType::trackingData& td
225 if (solution_.coupled())
227 cloud.resetSourceTerms();
230 if (solution_.transient())
232 label preInjectionSize = this->size();
238 if (preInjectionSize != this->size())
240 updateCellOccupancy();
241 preInjectionSize = this->size();
244 injectors_.inject(cloud, td);
248 cloud.motion(cloud, td);
250 stochasticCollision().update(td, solution_.trackTime());
256 injectors_.injectSteadyState(cloud, td, solution_.trackTime());
258 td.part() = parcelType::trackingData::tpLinearTrack;
259 CloudType::move(
cloud, td, solution_.trackTime());
264 template<
class CloudType>
267 const typename parcelType::trackingData& td
274 this->writePositions();
277 this->dispersion().cacheFields(
false);
279 this->patchInteraction().postEvolve();
281 forces_.cacheFields(
false);
283 functions_.postEvolve(td);
285 solution_.nextIter();
287 if (this->db().time().writeTime())
289 outputProperties_.writeObject
294 this->db().time().writeCompression()
300 if (this->dampingModel().active())
302 this->dampingModel().cacheFields(
false);
304 if (this->packingModel().active())
306 this->packingModel().cacheFields(
false);
311 template<
class CloudType>
314 CloudType::cloudReset(
c);
318 forces_.transfer(
c.forces_);
320 functions_.transfer(
c.functions_);
322 injectors_.transfer(
c.injectors_);
324 dispersionModel_.reset(
c.dispersionModel_.ptr());
325 patchInteractionModel_.reset(
c.patchInteractionModel_.ptr());
326 stochasticCollisionModel_.reset(
c.stochasticCollisionModel_.ptr());
327 surfaceFilmModel_.reset(
c.surfaceFilmModel_.ptr());
329 packingModel_.reset(
c.packingModel_.ptr());
330 dampingModel_.reset(
c.dampingModel_.ptr());
331 isotropyModel_.reset(
c.isotropyModel_.ptr());
333 UIntegrator_.reset(
c.UIntegrator_.ptr());
339 template<
class CloudType>
352 cloudCopyPtr_(nullptr),
377 solution_(mesh_, particleProperties_.subDict(
"solution")),
378 constProps_(particleProperties_),
381 particleProperties_.subOrEmptyDict
390 cellLengthScale_(
mag(
cbrt(mesh_.V()))),
400 subModelProperties_.subOrEmptyDict
411 particleProperties_.subOrEmptyDict(
"cloudFunctions"),
416 subModelProperties_.subOrEmptyDict(
"injectionModels"),
419 dispersionModel_(nullptr),
420 patchInteractionModel_(nullptr),
421 stochasticCollisionModel_(nullptr),
422 surfaceFilmModel_(nullptr),
424 packingModel_(nullptr),
425 dampingModel_(nullptr),
426 isotropyModel_(nullptr),
428 UIntegrator_(nullptr),
435 this->
name() +
":UTrans",
451 this->
name() +
":UCoeff",
462 if (solution_.active())
469 this->deleteLostParticles();
473 if (solution_.resetSourcesOnStartup())
480 template<
class CloudType>
483 KinematicCloud<CloudType>&
c,
489 cloudCopyPtr_(nullptr),
491 particleProperties_(
c.particleProperties_),
492 outputProperties_(
c.outputProperties_),
493 solution_(
c.solution_),
494 constProps_(
c.constProps_),
495 subModelProperties_(
c.subModelProperties_),
496 rndGen_(
c.rndGen_, true),
497 cellOccupancyPtr_(nullptr),
498 cellLengthScale_(
c.cellLengthScale_),
503 pAmbient_(
c.pAmbient_),
505 functions_(
c.functions_),
506 injectors_(
c.injectors_),
507 dispersionModel_(
c.dispersionModel_->clone()),
508 patchInteractionModel_(
c.patchInteractionModel_->clone()),
509 stochasticCollisionModel_(
c.stochasticCollisionModel_->clone()),
510 surfaceFilmModel_(
c.surfaceFilmModel_->clone()),
512 packingModel_(
c.packingModel_->clone()),
513 dampingModel_(
c.dampingModel_->clone()),
514 isotropyModel_(
c.isotropyModel_->clone()),
516 UIntegrator_(
c.UIntegrator_->clone()),
523 this->
name() +
":UTrans",
552 template<
class CloudType>
562 cloudCopyPtr_(nullptr),
580 name +
"OutputProperties",
591 subModelProperties_(),
593 cellOccupancyPtr_(nullptr),
594 cellLengthScale_(
c.cellLengthScale_),
599 pAmbient_(
c.pAmbient_),
600 forces_(*this,
mesh),
603 dispersionModel_(nullptr),
604 patchInteractionModel_(nullptr),
605 stochasticCollisionModel_(nullptr),
606 surfaceFilmModel_(nullptr),
608 packingModel_(nullptr),
609 dampingModel_(nullptr),
610 isotropyModel_(nullptr),
612 UIntegrator_(nullptr),
620 template<
class CloudType>
624 const scalar lagrangianDt
628 if (constProps_.rho0() != -1)
630 parcel.rho() = constProps_.rho0();
635 template<
class CloudType>
639 const scalar lagrangianDt,
640 const bool fullyDescribed
643 const scalar carrierDt = mesh_.time().deltaTValue();
644 parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
646 if (parcel.typeId() == -1)
648 parcel.typeId() = constProps_.parcelTypeId();
651 if (parcel.rho() == -1)
654 <<
"The kinematic cloud needs rho0 in the constantProperties "
655 <<
" dictionary. " <<
nl
661 template<
class CloudType>
666 static_cast<KinematicCloud<CloudType>*
>
668 clone(this->
name() +
"Copy").ptr()
674 template<
class CloudType>
677 cloudReset(cloudCopyPtr_());
678 cloudCopyPtr_.clear();
682 template<
class CloudType>
685 UTrans().field() =
Zero;
686 UCoeff().field() = 0.0;
690 template<
class CloudType>
699 const scalar coeff = solution_.relaxCoeff(
name);
704 template<
class CloudType>
712 const scalar coeff = solution_.relaxCoeff(
name);
717 template<
class CloudType>
723 this->
relax(UTrans_(), cloudOldTime.
UTrans(),
"U");
724 this->
relax(UCoeff_(), cloudOldTime.
UCoeff(),
"U");
728 template<
class CloudType>
731 this->scale(UTrans_(),
"U");
732 this->scale(UCoeff_(),
"U");
736 template<
class CloudType>
739 const typename parcelType::trackingData& td
744 label nGeometricD = mesh_.nGeometricD();
746 Info<<
"\nSolving" << nGeometricD <<
"-D cloud " << this->
name() <<
endl;
748 this->dispersion().cacheFields(
true);
749 forces_.cacheFields(
true);
751 pAmbient_ = constProps_.dict().template
752 getOrDefault<scalar>(
"pAmbient", pAmbient_);
754 if (this->dampingModel().active() || this->packingModel().active())
756 const_cast<typename parcelType::trackingData&
>(td).updateAverages(*
this);
759 if (this->dampingModel().active())
761 this->dampingModel().cacheFields(
true);
763 if (this->packingModel().active())
765 this->packingModel().cacheFields(
true);
768 updateCellOccupancy();
770 functions_.preEvolve(td);
774 template<
class CloudType>
777 if (solution_.canEvolve())
779 typename parcelType::trackingData td(*
this);
785 template<
class CloudType>
786 template<
class TrackCloudType>
789 TrackCloudType& cloud,
790 typename parcelType::trackingData& td
793 td.part() = parcelType::trackingData::tpLinearTrack;
794 CloudType::move(cloud, td, solution_.trackTime());
796 if (isotropyModel_->active())
798 td.updateAverages(cloud);
799 isotropyModel_->calculate();
802 updateCellOccupancy();
806 template<
class CloudType>
821 if (isA<wallPolyPatch>(pp))
823 const label patchi = pp.
index();
824 const label patchFacei = pp.
whichFace(
p.face());
830 if (U_.boundaryField()[patchi].fixesValue())
832 const vector Uw1(U_.boundaryField()[patchi][patchFacei]);
834 U_.oldTime().boundaryField()[patchi][patchFacei];
836 const scalar
f =
p.currentTimeFraction();
838 const vector Uw(Uw0 +
f*(Uw1 - Uw0));
842 Up = (nnw & Up) + Uw - (nnw & Uw);
848 template<
class CloudType>
851 updateCellOccupancy();
852 injectors_.updateMesh();
853 cellLengthScale_ =
mag(
cbrt(mesh_.V()));
857 template<
class CloudType>
866 template<
class CloudType>
869 const vector linearMomentum =
872 const scalar linearKineticEnergy =
877 const scalar particlePerParcel =
885 <<
" Current number of parcels = " << nTotParcel <<
nl
886 <<
" Current mass in system = "
888 <<
" Linear momentum = " << linearMomentum <<
nl
889 <<
" |Linear momentum| = " <<
mag(linearMomentum) <<
nl
890 <<
" Linear kinetic energy = " << linearKineticEnergy <<
nl
891 <<
" Average particle per parcel = " << particlePerParcel <<
nl;
893 injectors_.info(
Info);
895 this->patchInteraction().info(
Info);
897 if (this->packingModel().active())
901 if (this->db().time().writeTime())
906 const scalar alphaMin =
gMin(
alpha().primitiveField());
909 Info<<
" Min cell volume fraction = " << alphaMin <<
endl;
934 reduce(nMin, minOp<scalar>());
936 Info<<
" Min dense number of parcels = " << nMin <<
endl;
941 template<
class CloudType>
944 parcelType::readObjects(*
this, obr);
948 template<
class CloudType>
951 parcelType::writeObjects(*
this, obr);