Go to the documentation of this file.
43 template<
class CloudType>
46 dispersionModel_.reset
55 patchInteractionModel_.reset
64 stochasticCollisionModel_.reset
73 surfaceFilmModel_.reset
87 solution_.integrationSchemes()
93 template<
class CloudType>
94 template<
class TrackCloudType>
97 TrackCloudType&
cloud,
103 if (solution_.steadyState())
109 evolveCloud(
cloud, td);
111 if (solution_.coupled())
120 evolveCloud(
cloud, td);
122 if (solution_.coupled())
124 cloud.scaleSources();
130 cloud.postEvolve(td);
132 if (solution_.steadyState())
134 cloud.restoreState();
139 template<
class CloudType>
142 if (cellOccupancyPtr_.empty())
144 cellOccupancyPtr_.reset
149 else if (cellOccupancyPtr_().size() != mesh_.nCells())
154 cellOccupancyPtr_().setSize(mesh_.nCells());
171 template<
class CloudType>
177 if (cellOccupancyPtr_.valid())
179 buildCellOccupancy();
184 template<
class CloudType>
185 template<
class TrackCloudType>
188 TrackCloudType&
cloud,
192 if (solution_.coupled())
194 cloud.resetSourceTerms();
197 if (solution_.transient())
199 label preInjectionSize = this->size();
205 if (preInjectionSize != this->size())
207 updateCellOccupancy();
208 preInjectionSize = this->size();
211 injectors_.inject(
cloud, td);
218 stochasticCollision().update(td, solution_.trackTime());
224 injectors_.injectSteadyState(
cloud, td, solution_.trackTime());
226 td.part() = parcelType::trackingData::tpLinearTrack;
227 CloudType::move(
cloud, td, solution_.trackTime());
232 template<
class CloudType>
242 this->writePositions();
245 this->dispersion().cacheFields(
false);
247 forces_.cacheFields(
false);
249 functions_.postEvolve(td);
251 solution_.nextIter();
253 if (this->db().time().writeTime())
255 outputProperties_.writeObject
260 this->db().time().writeCompression()
268 template<
class CloudType>
271 CloudType::cloudReset(
c);
275 forces_.transfer(
c.forces_);
277 functions_.transfer(
c.functions_);
279 injectors_.transfer(
c.injectors_);
281 dispersionModel_.reset(
c.dispersionModel_.ptr());
282 patchInteractionModel_.reset(
c.patchInteractionModel_.ptr());
283 stochasticCollisionModel_.reset(
c.stochasticCollisionModel_.ptr());
284 surfaceFilmModel_.reset(
c.surfaceFilmModel_.ptr());
286 UIntegrator_.reset(
c.UIntegrator_.ptr());
292 template<
class CloudType>
305 cloudCopyPtr_(nullptr),
330 solution_(mesh_, particleProperties_.subDict(
"solution")),
331 constProps_(particleProperties_),
334 particleProperties_.subOrEmptyDict
343 cellLengthScale_(
mag(
cbrt(mesh_.V()))),
353 subModelProperties_.subOrEmptyDict
364 particleProperties_.subOrEmptyDict(
"cloudFunctions"),
369 subModelProperties_.subOrEmptyDict(
"injectionModels"),
372 dispersionModel_(nullptr),
373 patchInteractionModel_(nullptr),
374 stochasticCollisionModel_(nullptr),
375 surfaceFilmModel_(nullptr),
376 UIntegrator_(nullptr),
383 this->
name() +
":UTrans",
399 this->
name() +
":UCoeff",
410 if (solution_.active())
417 this->deleteLostParticles();
421 if (solution_.resetSourcesOnStartup())
428 template<
class CloudType>
437 cloudCopyPtr_(
nullptr),
439 particleProperties_(
c.particleProperties_),
440 outputProperties_(
c.outputProperties_),
441 solution_(
c.solution_),
442 constProps_(
c.constProps_),
443 subModelProperties_(
c.subModelProperties_),
444 rndGen_(
c.rndGen_,
true),
445 cellOccupancyPtr_(
nullptr),
446 cellLengthScale_(
c.cellLengthScale_),
451 pAmbient_(
c.pAmbient_),
453 functions_(
c.functions_),
454 injectors_(
c.injectors_),
455 dispersionModel_(
c.dispersionModel_->clone()),
456 patchInteractionModel_(
c.patchInteractionModel_->clone()),
457 stochasticCollisionModel_(
c.stochasticCollisionModel_->clone()),
458 surfaceFilmModel_(
c.surfaceFilmModel_->clone()),
459 UIntegrator_(
c.UIntegrator_->clone()),
466 this->
name() +
":UTrans",
495 template<
class CloudType>
505 cloudCopyPtr_(
nullptr),
512 mesh_.time().constant(),
523 name +
"OutputProperties",
524 mesh_.time().timeName(),
525 "uniform"/cloud::prefix/
name,
534 subModelProperties_(dictionary::null),
536 cellOccupancyPtr_(
nullptr),
537 cellLengthScale_(
c.cellLengthScale_),
542 pAmbient_(
c.pAmbient_),
543 forces_(*
this,
mesh),
546 dispersionModel_(
nullptr),
547 patchInteractionModel_(
nullptr),
548 stochasticCollisionModel_(
nullptr),
549 surfaceFilmModel_(
nullptr),
550 UIntegrator_(
nullptr),
558 template<
class CloudType>
562 const scalar lagrangianDt
565 parcel.rho() = constProps_.rho0();
569 template<
class CloudType>
573 const scalar lagrangianDt,
574 const bool fullyDescribed
577 const scalar carrierDt = mesh_.time().deltaTValue();
578 parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
580 if (parcel.typeId() == -1)
582 parcel.typeId() = constProps_.parcelTypeId();
587 template<
class CloudType>
594 clone(this->
name() +
"Copy").ptr()
600 template<
class CloudType>
603 cloudReset(cloudCopyPtr_());
604 cloudCopyPtr_.clear();
608 template<
class CloudType>
611 UTrans().field() =
Zero;
612 UCoeff().field() = 0.0;
616 template<
class CloudType>
625 const scalar coeff = solution_.relaxCoeff(
name);
630 template<
class CloudType>
638 const scalar coeff = solution_.relaxCoeff(
name);
643 template<
class CloudType>
649 this->
relax(UTrans_(), cloudOldTime.
UTrans(),
"U");
650 this->
relax(UCoeff_(), cloudOldTime.
UCoeff(),
"U");
654 template<
class CloudType>
657 this->scale(UTrans_(),
"U");
658 this->scale(UCoeff_(),
"U");
662 template<
class CloudType>
670 label nGeometricD = mesh_.nGeometricD();
672 Info<<
"\nSolving " << nGeometricD <<
"-D cloud " << this->
name() <<
endl;
674 this->dispersion().cacheFields(
true);
675 forces_.cacheFields(
true);
676 updateCellOccupancy();
678 pAmbient_ = constProps_.dict().template
679 getOrDefault<scalar>(
"pAmbient", pAmbient_);
681 functions_.preEvolve(td);
685 template<
class CloudType>
688 if (solution_.canEvolve())
697 template<
class CloudType>
698 template<
class TrackCloudType>
701 TrackCloudType&
cloud,
705 td.part() = parcelType::trackingData::tpLinearTrack;
706 CloudType::move(
cloud, td, solution_.trackTime());
708 updateCellOccupancy();
712 template<
class CloudType>
727 if (isA<wallPolyPatch>(pp))
729 const label patchi = pp.
index();
730 const label patchFacei = pp.
whichFace(
p.face());
736 if (U_.boundaryField()[patchi].fixesValue())
738 const vector Uw1 = U_.boundaryField()[patchi][patchFacei];
740 U_.oldTime().boundaryField()[patchi][patchFacei];
742 const scalar
f =
p.currentTimeFraction();
744 const vector Uw = Uw0 +
f*(Uw1 - Uw0);
748 Up = (nnw & Up) + Uw - (nnw & Uw);
754 template<
class CloudType>
757 updateCellOccupancy();
758 injectors_.updateMesh();
759 cellLengthScale_ =
mag(
cbrt(mesh_.V()));
763 template<
class CloudType>
772 template<
class CloudType>
775 const vector linearMomentum =
778 const scalar linearKineticEnergy =
783 const scalar particlePerParcel =
791 <<
" Current number of parcels = " << nTotParcel <<
nl
792 <<
" Current mass in system = "
794 <<
" Linear momentum = " << linearMomentum <<
nl
795 <<
" |Linear momentum| = " <<
mag(linearMomentum) <<
nl
796 <<
" Linear kinetic energy = " << linearKineticEnergy <<
nl
797 <<
" Average particle per parcel = " << particlePerParcel <<
nl;
799 injectors_.info(
Info);
801 this->patchInteraction().info(
Info);
805 template<
class CloudType>
808 parcelType::readObjects(*
this, obr);
812 template<
class CloudType>
815 parcelType::writeObjects(*
this, obr);
int debug
Static debugging option.
void patchData(const parcelType &p, const polyPatch &pp, vector &normal, vector &Up) const
Calculate the patch normal and velocity to interact with,.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void scaleSources()
Apply scaling to (transient) cloud sources.
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
void setModels()
Set cloud sub-models.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
const dimensionedScalar mu
Atomic mass unit.
Base class for dispersion modelling.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void relaxSources(const KinematicCloud< CloudType > &cloudOldTime)
Apply relaxation to (steady state) cloud sources.
volScalarField::Internal & UCoeff()
Return coefficient for carrier phase U equation.
void storeState()
Store the current cloud state.
Ostream & endl(Ostream &os)
Add newline and flush stream.
volVectorField::Internal & UTrans()
Return reference to momentum source.
InfoProxy< IOobject > info() const
Return info proxy.
virtual void readObjects(const objectRegistry &obr)
Read particle fields from objects in the obr registry.
Registry of regIOobjects.
A class for handling keywords in dictionaries.
Virtual abstract base class for templated KinematicCloud.
void evolve()
Evolve the cloud.
Templated base class for kinematic cloud.
Templated patch interaction model class.
Templated stochastic collision model class.
const List< DynamicList< molecule * > > & cellOccupancy
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Templated wall surface film model class.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
regionModels::surfaceFilmModel & surfaceFilm
Wrapper around kinematic parcel types to add collision modelling.
The IOstreamOption is a simple container for options an IOstream can normally have.
DSMCCloud< dsmcParcel > CloudType
Templated base class for dsmc cloud.
Template class for intrusive linked lists.
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
void preEvolve(const typename parcelType::trackingData &td)
Pre-evolve.
Mesh data needed to do the Finite Volume discretisation.
const uniformDimensionedVectorField & g
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
void resetSourceTerms()
Reset the cloud source terms.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
A cloud is a registry collection of lagrangian particles.
void solve(TrackCloudType &cloud, typename parcelType::trackingData &td)
Solve the cloud - calls all evolution functions.
label whichFace(const label l) const
Return label of face in patch from global face label.
void cloudReset(KinematicCloud< CloudType > &c)
Reset state of cloud.
Inter-processor communications stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void updateMesh()
Update mesh.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
ParcelType::trackingData trackingData
Use base tracking data.
void relax(DimensionedField< Type, volMesh > &field, const DimensionedField< Type, volMesh > &field0, const word &name) const
Relax field.
Base cloud calls templated on particle type.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const dimensionedScalar c
Speed of light in a vacuum.
void restoreState()
Reset the current cloud to the previously stored state.
void updateCellOccupancy()
Update (i.e. build) the cellOccupancy if it has.
void info()
Print cloud information.
void buildCellOccupancy()
Build the cellOccupancy.
dimensionedScalar cbrt(const dimensionedScalar &ds)
void evolveCloud(TrackCloudType &cloud, typename parcelType::trackingData &td)
Evolve the cloud.
constant condensation/saturation model.
label index() const
The index of this patch in the boundaryMesh.
void scale(DimensionedField< Type, volMesh > &field, const word &name) const
Scale field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void postEvolve(const typename parcelType::trackingData &td)
Post-evolve.