49template<
class CloudType>
52 dispersionModel_.reset
61 patchInteractionModel_.reset
70 stochasticCollisionModel_.reset
79 surfaceFilmModel_.reset
117 integrationScheme::New
120 solution_.integrationSchemes()
126template<
class CloudType>
127template<
class TrackCloudType>
130 TrackCloudType&
cloud,
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();
172template<
class CloudType>
175 if (!cellOccupancyPtr_)
177 cellOccupancyPtr_.reset
182 else if (cellOccupancyPtr_().size() != mesh_.nCells())
187 cellOccupancyPtr_().setSize(mesh_.nCells());
204template<
class CloudType>
210 if (cellOccupancyPtr_)
212 buildCellOccupancy();
217template<
class CloudType>
218template<
class TrackCloudType>
221 TrackCloudType&
cloud,
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);
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());
264template<
class CloudType>
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);
311template<
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());
339template<
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",
480template<
class CloudType>
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",
552template<
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),
620template<
class CloudType>
624 const scalar lagrangianDt
628 if (constProps_.rho0() != -1)
630 parcel.rho() = constProps_.rho0();
635template<
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
661template<
class CloudType>
668 clone(this->
name() +
"Copy").ptr()
674template<
class CloudType>
677 cloudReset(cloudCopyPtr_());
678 cloudCopyPtr_.clear();
682template<
class CloudType>
686 UCoeff().field() = 0.0;
690template<
class CloudType>
699 const scalar coeff = solution_.relaxCoeff(
name);
704template<
class CloudType>
712 const scalar coeff = solution_.relaxCoeff(
name);
717template<
class CloudType>
723 this->
relax(UTrans_(), cloudOldTime.
UTrans(),
"U");
724 this->
relax(UCoeff_(), cloudOldTime.
UCoeff(),
"U");
728template<
class CloudType>
731 this->scale(UTrans_(),
"U");
732 this->scale(UCoeff_(),
"U");
736template<
class CloudType>
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())
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);
774template<
class CloudType>
777 if (solution_.canEvolve())
785template<
class CloudType>
786template<
class TrackCloudType>
789 TrackCloudType&
cloud,
793 td.part() = parcelType::trackingData::tpLinearTrack;
796 if (isotropyModel_->active())
798 td.updateAverages(
cloud);
799 isotropyModel_->calculate();
802 updateCellOccupancy();
806template<
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);
848template<
class CloudType>
851 updateCellOccupancy();
852 injectors_.updateMesh();
853 cellLengthScale_ =
mag(
cbrt(mesh_.V()));
857template<
class CloudType>
866template<
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;
936 Info<<
" Min dense number of parcels = " << nMin <<
endl;
941template<
class CloudType>
944 parcelType::readObjects(*
this, obr);
948template<
class CloudType>
const List< DynamicList< molecule * > > & cellOccupancy
const uniformDimensionedVectorField & g
void deleteLostParticles()
Remove lost particles from cloud and delete.
void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
Templated base class for dsmc cloud.
Base class for collisional damping models.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Base class for dispersion modelling.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Template class for intrusive linked lists.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
InfoProxy< IOobject > info() const
Return info proxy, for printing information to a stream.
The IOstreamOption is a simple container for options an IOstream can normally have.
Base class for collisional return-to-isotropy models.
Templated base class for kinematic cloud.
cloudSolution solution_
Solution properties.
void setModels()
Set cloud sub-models.
void relaxSources(const KinematicCloud< CloudType > &cloudOldTime)
Apply relaxation to (steady state) cloud sources.
void storeState()
Store the current cloud state.
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
virtual void readObjects(const objectRegistry &obr)
Read particle fields from objects in the obr registry.
void cloudReset(KinematicCloud< CloudType > &c)
Reset state of cloud.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
void scaleSources()
Apply scaling to (transient) cloud sources.
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
void updateCellOccupancy()
Update (i.e. build) the cellOccupancy if it has.
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
void evolve()
Evolve the cloud.
volScalarField::Internal & UCoeff()
Return coefficient for carrier phase U equation.
void evolveCloud(TrackCloudType &cloud, typename parcelType::trackingData &td)
Evolve the cloud.
volVectorField::Internal & UTrans()
Return reference to momentum source.
void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve.
void info()
Print cloud information.
void restoreState()
Reset the current cloud to the previously stored state.
void resetSourceTerms()
Reset the cloud source terms.
void buildCellOccupancy()
Build the cellOccupancy.
void updateMesh()
Update mesh.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void postEvolve()
Post-evolve hook.
scalar scale
Overall scale factor.
Base class for packing models.
Templated patch interaction model class.
Inter-processor communications stream.
Templated stochastic collision model class.
Templated wall surface film model class.
const Switch resetSourcesOnStartup() const
Return const access to the reset sources flag.
const Switch active() const
Return the active flag.
A cloud is a registry collection of lagrangian particles.
const motionSolver & motion() const
Return the motionSolver.
Class used to pass data into container.
void relax()
Relax matrix (for steady-state solution).
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Allows specification of different writing frequency of objects registered to the database.
Mesh data needed to do the Finite Volume discretisation.
A class for handling keywords in dictionaries.
Virtual abstract base class for templated KinematicCloud.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
const FieldField< Field, Type > & patchData() const
label index() const noexcept
The index of this patch in the boundaryMesh.
constant condensation/saturation model.
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label l) const
Return label of face in patch from global face label.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
regionModels::surfaceFilmModel & surfaceFilm
const volScalarField & mu
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
dimensionedScalar cbrt(const dimensionedScalar &ds)
Type gMin(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
Type gMax(const FieldField< Field, Type > &f)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a)
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.
const word cloudName(propsDict.get< word >("cloud"))