39 template<
class CloudType>
42 dispersionModel_.reset
51 patchInteractionModel_.reset
60 stochasticCollisionModel_.reset
69 surfaceFilmModel_.reset
83 solution_.integrationSchemes()
89 template<
class CloudType>
90 template<
class TrackCloudType>
93 TrackCloudType& cloud,
94 typename parcelType::trackingData& td
97 if (solution_.steadyState())
103 evolveCloud(cloud, td);
105 if (solution_.coupled())
107 cloud.relaxSources(cloud.cloudCopy());
114 evolveCloud(cloud, td);
116 if (solution_.coupled())
118 cloud.scaleSources();
126 if (solution_.steadyState())
128 cloud.restoreState();
133 template<
class CloudType>
136 if (cellOccupancyPtr_.empty())
138 cellOccupancyPtr_.reset
143 else if (cellOccupancyPtr_().size() != mesh_.nCells())
148 cellOccupancyPtr_().setSize(mesh_.nCells());
155 cellOccupancy[cO].
clear();
160 cellOccupancy[iter().cell()].
append(&iter());
165 template<
class CloudType>
171 if (cellOccupancyPtr_.valid())
173 buildCellOccupancy();
178 template<
class CloudType>
179 template<
class TrackCloudType>
182 TrackCloudType& cloud,
183 typename parcelType::trackingData& td
186 if (solution_.coupled())
188 cloud.resetSourceTerms();
191 if (solution_.transient())
193 label preInjectionSize = this->size();
199 if (preInjectionSize != this->size())
201 updateCellOccupancy();
202 preInjectionSize = this->size();
205 injectors_.inject(cloud, td);
210 cloud.motion(cloud, td);
212 stochasticCollision().update(td, solution_.trackTime());
218 injectors_.injectSteadyState(cloud, td, solution_.trackTime());
220 td.part() = parcelType::trackingData::tpLinearTrack;
221 CloudType::move(cloud, td, solution_.trackTime());
226 template<
class CloudType>
233 this->writePositions();
236 this->dispersion().cacheFields(
false);
238 forces_.cacheFields(
false);
240 functions_.postEvolve();
242 solution_.nextIter();
244 if (this->db().time().writeTime())
246 outputProperties_.writeObject
249 IOstream::currentVersion,
250 this->db().time().writeCompression(),
257 template<
class CloudType>
260 CloudType::cloudReset(c);
281 template<
class CloudType>
284 const word& cloudName,
294 cloudCopyPtr_(
nullptr),
300 cloudName +
"Properties",
301 rho.
mesh().time().constant(),
303 IOobject::MUST_READ_IF_MODIFIED,
311 cloudName +
"OutputProperties",
312 mesh_.time().timeName(),
315 IOobject::READ_IF_PRESENT,
319 solution_(mesh_, particleProperties_.subDict(
"solution")),
320 constProps_(particleProperties_),
323 particleProperties_.subOrEmptyDict(
"subModels", solution_.active())
327 cellLengthScale_(
mag(
cbrt(mesh_.V()))),
337 subModelProperties_.subOrEmptyDict
347 particleProperties_.subOrEmptyDict(
"cloudFunctions"),
352 subModelProperties_.subOrEmptyDict(
"injectionModels"),
355 dispersionModel_(
nullptr),
356 patchInteractionModel_(
nullptr),
357 stochasticCollisionModel_(
nullptr),
358 surfaceFilmModel_(
nullptr),
359 UIntegrator_(
nullptr),
366 this->
name() +
":UTrans",
369 IOobject::READ_IF_PRESENT,
382 this->
name() +
":UCoeff",
385 IOobject::READ_IF_PRESENT,
393 if (solution_.active())
400 this->deleteLostParticles();
404 if (solution_.resetSourcesOnStartup())
411 template<
class CloudType>
420 cloudCopyPtr_(
nullptr),
428 cellOccupancyPtr_(
nullptr),
449 this->
name() +
":UTrans",
478 template<
class CloudType>
488 cloudCopyPtr_(
nullptr),
506 name +
"OutputProperties",
507 mesh_.time().timeName(),
508 "uniform"/cloud::prefix/
name,
517 subModelProperties_(dictionary::null),
519 cellOccupancyPtr_(
nullptr),
526 forces_(*
this, mesh),
529 dispersionModel_(
nullptr),
530 patchInteractionModel_(
nullptr),
531 stochasticCollisionModel_(
nullptr),
532 surfaceFilmModel_(
nullptr),
533 UIntegrator_(
nullptr),
541 template<
class CloudType>
548 template<
class CloudType>
552 const scalar lagrangianDt
555 parcel.rho() = constProps_.rho0();
559 template<
class CloudType>
563 const scalar lagrangianDt,
564 const bool fullyDescribed
567 const scalar carrierDt = mesh_.time().deltaTValue();
568 parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
570 if (parcel.typeId() == -1)
572 parcel.typeId() = constProps_.parcelTypeId();
577 template<
class CloudType>
584 clone(this->
name() +
"Copy").ptr()
590 template<
class CloudType>
593 cloudReset(cloudCopyPtr_());
594 cloudCopyPtr_.clear();
598 template<
class CloudType>
601 UTrans().field() =
Zero;
602 UCoeff().field() = 0.0;
606 template<
class CloudType>
615 const scalar coeff = solution_.relaxCoeff(name);
616 field = field0 + coeff*(field - field0);
620 template<
class CloudType>
628 const scalar coeff = solution_.relaxCoeff(name);
633 template<
class CloudType>
639 this->
relax(UTrans_(), cloudOldTime.
UTrans(),
"U");
640 this->
relax(UCoeff_(), cloudOldTime.
UCoeff(),
"U");
644 template<
class CloudType>
647 this->scale(UTrans_(),
"U");
648 this->scale(UCoeff_(),
"U");
652 template<
class CloudType>
657 label nGeometricD = mesh_.nGeometricD();
659 Info<<
"\nSolving " << nGeometricD <<
"-D cloud " << this->
name() <<
endl;
661 this->dispersion().cacheFields(
true);
662 forces_.cacheFields(
true);
663 updateCellOccupancy();
665 pAmbient_ = constProps_.dict().template
666 lookupOrDefault<scalar>(
"pAmbient", pAmbient_);
668 functions_.preEvolve();
672 template<
class CloudType>
675 if (solution_.canEvolve())
677 typename parcelType::trackingData td(*
this);
684 template<
class CloudType>
685 template<
class TrackCloudType>
688 TrackCloudType& cloud,
689 typename parcelType::trackingData& td
692 td.part() = parcelType::trackingData::tpLinearTrack;
693 CloudType::move(cloud, td, solution_.trackTime());
695 updateCellOccupancy();
699 template<
class CloudType>
714 if (isA<wallPolyPatch>(pp))
723 if (U_.boundaryField()[
patchi].fixesValue())
725 const vector Uw1 = U_.boundaryField()[
patchi][patchFacei];
727 U_.oldTime().boundaryField()[
patchi][patchFacei];
729 const scalar
f = p.currentTimeFraction();
731 const vector Uw = Uw0 + f*(Uw1 - Uw0);
735 Up = (nnw & Up) + Uw - (nnw & Uw);
741 template<
class CloudType>
744 updateCellOccupancy();
745 injectors_.updateMesh();
746 cellLengthScale_ =
mag(
cbrt(mesh_.V()));
750 template<
class CloudType>
759 template<
class CloudType>
762 vector linearMomentum = linearMomentumOfSystem();
765 scalar linearKineticEnergy = linearKineticEnergyOfSystem();
769 <<
" Current number of parcels = " 771 <<
" Current mass in system = " 773 <<
" Linear momentum = " 774 << linearMomentum <<
nl 775 <<
" |Linear momentum| = " 776 <<
mag(linearMomentum) <<
nl 777 <<
" Linear kinetic energy = " 778 << linearKineticEnergy <<
nl;
780 injectors_.info(
Info);
782 this->patchInteraction().info(
Info);
Template class for intrusive linked lists.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DSMCCloud< dsmcParcel > CloudType
void scaleSources()
Apply scaling to (transient) cloud sources.
void setModels()
Set cloud sub-models.
const volVectorField & U_
Velocity [m/s].
void relaxSources(const KinematicCloud< CloudType > &cloudOldTime)
Apply relaxation to (steady state) cloud sources.
void storeState()
Store the current cloud state.
autoPtr< PatchInteractionModel< KinematicCloud< CloudType > > > patchInteractionModel_
Patch interaction model.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
InjectionModelList< KinematicCloud< CloudType > > injectors_
Injector models.
Cloud< basicKinematicCollidingParcel > ::particleType parcelType
Type of parcel the cloud was instantiated for.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual ~KinematicCloud()
Destructor.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
void evolveCloud(TrackCloudType &cloud, typename parcelType::trackingData &td)
Evolve the cloud.
autoPtr< volVectorField::Internal > UTrans_
Momentum.
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void relax(DimensionedField< Type, volMesh > &field, const DimensionedField< Type, volMesh > &field0, const word &name) const
Relax field.
volVectorField::Internal & UTrans()
Return reference to momentum source.
void postEvolve()
Post-evolve.
const Time & time() const
Return the top-level database.
autoPtr< SurfaceFilmModel< KinematicCloud< CloudType > > > surfaceFilmModel_
Surface film model.
Random rndGen_
Random number generator - used by some injection routines.
void updateCellOccupancy()
Update (i.e. build) the cellOccupancy if it has.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void buildCellOccupancy()
Build the cellOccupancy.
const volScalarField & rho_
Density [kg/m3].
Templated patch interaction model class.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
void updateMesh()
Update mesh.
const volScalarField & mu_
Dynamic viscosity [Pa.s].
volScalarField::Internal & UCoeff()
Return coefficient for carrier phase U equation.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void resetSourceTerms()
Reset the cloud source terms.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
void append(const T &)
Append an element at the end of the list.
dimensionedScalar cbrt(const dimensionedScalar &ds)
scalar pAmbient_
Averaged ambient domain pressure.
const word & constant() const
Return constant name.
parcelType::constantProperties constProps_
Parcel constant properties.
const fvMesh & mesh_
References to the mesh and time databases.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
const dictionary subModelProperties_
Sub-models dictionary.
Base cloud calls templated on particle type.
regionModels::surfaceFilmModel & surfaceFilm
const Mesh & mesh() const
Return mesh.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
Virtual abstract base class for templated KinematicCloud.
cloudSolution solution_
Solution properties.
Templated base class for kinematic cloud.
void patchData(const parcelType &p, const polyPatch &pp, vector &normal, vector &Up) const
Calculate the patch normal and velocity to interact with,.
const List< DynamicList< molecule * > > & cellOccupancy
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void evolve()
Evolve the cloud.
IOdictionary particleProperties_
Dictionary of particle properties.
autoPtr< volScalarField::Internal > UCoeff_
Coefficient for carrier phase U equation.
Templated stochastic collision model class.
Mesh data needed to do the Finite Volume discretisation.
label index() const
Return the index of this patch in the boundaryMesh.
void info()
Print cloud information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
forceType forces_
Optional particle forces.
void restoreState()
Reset the current cloud to the previously stored state.
dimensioned< scalar > mag(const dimensioned< Type > &)
functionType functions_
Optional cloud function objects.
autoPtr< integrationScheme > UIntegrator_
Velocity integration.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void scale(DimensionedField< Type, volMesh > &field, const word &name) const
Scale field.
const word cloudName(propsDict.lookup("cloudName"))
void cloudReset(KinematicCloud< CloudType > &c)
Reset state of cloud.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
A patch is a list of labels that address the faces in the global face list.
autoPtr< DispersionModel< KinematicCloud< CloudType > > > dispersionModel_
Dispersion model.
IOdictionary outputProperties_
Dictionary of output properties.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionedVector & g_
Gravity.
void preEvolve()
Pre-evolve.
void solve(TrackCloudType &cloud, typename parcelType::trackingData &td)
Solve the cloud - calls all evolution functions.
autoPtr< StochasticCollisionModel< KinematicCloud< CloudType > > > stochasticCollisionModel_
Stochastic collision model.
label whichFace(const label l) const
Return label of face in patch from global face label.
const dimensionSet dimVelocity
scalarField cellLengthScale_
Cell length scale.