37 template<
class CloudType>
44 this->subModelProperties(),
52 this->subModelProperties(),
60 this->subModelProperties(),
69 template<
class CloudType>
81 packingModel_(nullptr),
82 dampingModel_(nullptr),
83 isotropyModel_(nullptr)
90 <<
"MPPIC modelling not available for steady state calculations" 99 this->deleteLostParticles();
105 template<
class CloudType>
108 MPPICCloud<CloudType>&
c,
113 packingModel_(
c.packingModel_->clone()),
114 dampingModel_(
c.dampingModel_->clone()),
115 isotropyModel_(
c.isotropyModel_->clone())
119 template<
class CloudType>
128 packingModel_(nullptr),
129 dampingModel_(nullptr),
130 isotropyModel_(nullptr)
136 template<
class CloudType>
143 template<
class CloudType>
150 clone(this->
name() +
"Copy").ptr()
156 template<
class CloudType>
159 this->cloudReset(cloudCopyPtr_());
160 cloudCopyPtr_.clear();
164 template<
class CloudType>
169 typename parcelType::trackingData td(*
this);
171 this->
solve(*
this, td);
176 template<
class CloudType>
177 template<
class TrackCloudType>
180 TrackCloudType& cloud,
181 typename parcelType::trackingData& td
188 td.part() = parcelType::trackingData::tpLinearTrack;
189 CloudType::move(cloud, td, this->db().time().deltaTValue());
196 this->forces().setCalcNonCoupled(
false);
197 this->forces().setCalcCoupled(
false);
203 if (dampingModel_->active())
205 if (this->
mesh().moving())
208 <<
"MPPIC damping modelling does not support moving meshes." 213 td.updateAverages(cloud);
216 dampingModel_->cacheFields(
true);
219 td.part() = parcelType::trackingData::tpDampingNoTrack;
220 CloudType::move(cloud, td, this->db().time().deltaTValue());
223 td.part() = parcelType::trackingData::tpCorrectTrack;
224 CloudType::move(cloud, td, this->db().time().deltaTValue());
227 dampingModel_->cacheFields(
false);
234 if (packingModel_->active())
236 if (this->
mesh().moving())
239 <<
"MPPIC packing modelling does not support moving meshes." 244 td.updateAverages(cloud);
245 packingModel_->cacheFields(
true);
246 td.part() = parcelType::trackingData::tpPackingNoTrack;
247 CloudType::move(cloud, td, this->db().time().deltaTValue());
248 td.part() = parcelType::trackingData::tpCorrectTrack;
249 CloudType::move(cloud, td, this->db().time().deltaTValue());
250 packingModel_->cacheFields(
false);
257 if (isotropyModel_->active())
260 td.updateAverages(cloud);
263 isotropyModel_->calculate();
271 this->updateCellOccupancy();
274 this->forces().setCalcNonCoupled(
true);
279 template<
class CloudType>
286 const scalar alphaMin =
gMin(
alpha().primitiveField());
289 Log_ <<
" Min cell volume fraction = " << alphaMin <<
nl 314 reduce(nMin, minOp<scalar>());
316 Log_<<
" Min dense number of parcels = " << nMin <<
endl;
virtual ~MPPICCloud()
Destructor.
DSMCCloud< dsmcParcel > CloudType
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
void storeState()
Store the current cloud state.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Base class for packing models.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar alphaMax("alphaMax", dimless/dimTime, laminarTransport)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
#define Log_
Report write to Foam::Info if the class log switch is true.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
const uniformDimensionedVectorField & g
Type gMax(const FieldField< Field, Type > &f)
Adds MPPIC modelling to kinematic clouds.
const dimensionedScalar mu
Atomic mass unit.
Base class for collisional return-to-isotropy models.
const List< DynamicList< molecule * > > & cellOccupancy
void setModels()
Set cloud sub-models.
Mesh data needed to do the Finite Volume discretisation.
const dimensionedScalar c
Speed of light in a vacuum.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
Selector class for relaxation factors, solver type and solution.
void evolve()
Evolve the cloud.
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Templated base class for dsmc cloud.
Base class for collisional damping models.
void restoreState()
Reset the current cloud to the previously stored state.