35 template<
class CloudType>
38 compositionModel_.reset
42 this->subModelProperties(),
47 phaseChangeModel_.reset
51 this->subModelProperties(),
58 template<
class CloudType>
66 if (YSupplied.
size() !=
Y.size())
69 << YName <<
" supplied, but size is not compatible with " 70 <<
"parcel composition: " <<
nl <<
" " 71 << YName <<
"(" << YSupplied.
size() <<
") vs required composition " 72 << YName <<
"(" <<
Y.size() <<
")" <<
nl 78 template<
class CloudType>
81 CloudType::cloudReset(
c);
83 compositionModel_.reset(
c.compositionModel_.ptr());
84 phaseChangeModel_.reset(
c.phaseChangeModel_.ptr());
90 template<
class CloudType>
103 cloudCopyPtr_(nullptr),
104 constProps_(this->particleProperties()),
105 compositionModel_(nullptr),
106 phaseChangeModel_(nullptr),
107 rhoTrans_(
thermo.carrier().species().size())
116 this->deleteLostParticles();
123 const word& specieName =
thermo.carrier().species()[i];
131 this->
name() +
":rhoTrans_" + specieName,
134 IOobject::READ_IF_PRESENT,
143 if (this->solution().resetSourcesOnStartup())
150 template<
class CloudType>
153 ReactingCloud<CloudType>&
c,
159 cloudCopyPtr_(nullptr),
160 constProps_(
c.constProps_),
161 compositionModel_(
c.compositionModel_->clone()),
162 phaseChangeModel_(
c.phaseChangeModel_->clone()),
163 rhoTrans_(
c.rhoTrans_.size())
167 const word& specieName = this->
thermo().carrier().species()[i];
175 this->
name() +
":rhoTrans_" + specieName,
180 IOobject::NO_REGISTER
189 template<
class CloudType>
194 const ReactingCloud<CloudType>&
c 199 cloudCopyPtr_(nullptr),
201 compositionModel_(
c.compositionModel_->clone()),
202 phaseChangeModel_(nullptr),
209 template<
class CloudType>
213 const scalar lagrangianDt
216 CloudType::setParcelThermoProperties(parcel, lagrangianDt);
222 template<
class CloudType>
226 const scalar lagrangianDt,
227 const bool fullyDescribed
230 CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
234 checkSuppliedComposition
243 parcel.mass0() = parcel.mass();
247 template<
class CloudType>
254 clone(this->
name() +
"Copy").ptr()
260 template<
class CloudType>
263 cloudReset(cloudCopyPtr_());
264 cloudCopyPtr_.clear();
268 template<
class CloudType>
271 CloudType::resetSourceTerms();
274 rhoTrans_[i].field() = 0.0;
279 template<
class CloudType>
282 const ReactingCloud<CloudType>& cloudOldTime
285 CloudType::relaxSources(cloudOldTime);
291 dsfType& rhoT = rhoTrans_[fieldi];
292 const dsfType& rhoT0 = cloudOldTime.rhoTrans()[fieldi];
293 this->
relax(rhoT, rhoT0,
"rho");
298 template<
class CloudType>
301 CloudType::scaleSources();
307 dsfType& rhoT = rhoTrans_[fieldi];
308 this->scale(rhoT,
"rho");
313 template<
class CloudType>
316 if (this->solution().canEvolve())
318 typename parcelType::trackingData td(*
this);
320 this->
solve(*
this, td);
325 template<
class CloudType>
334 template<
class CloudType>
339 this->phaseChange().info();
343 template<
class CloudType>
346 if (compositionModel_)
353 template<
class CloudType>
356 CloudType::particleType::writeObjects(*
this, this->
composition(), obr);
void resetSourceTerms()
Reset the cloud source terms.
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
void size(const label n)
Older name for setAddressableSize.
DSMCCloud< dsmcParcel > CloudType
Templated phase change model class.
void storeState()
Store the current cloud state.
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.
basicSpecieMixture & composition
constexpr char nl
The newline '\n' character (0x0a)
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
void restoreState()
Reset the current cloud to the previously stored state.
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.
Virtual abstract base class for templated ReactingCloud.
void setModels()
Set cloud sub-models.
virtual void writeFields() const
Write the field data for the cloud.
#define forAll(list, i)
Loop across all elements in list.
void evolve()
Evolve the cloud.
psiReactionThermo & thermo
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
errorManip< error > abort(error &err)
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Base cloud calls templated on particle type.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
const uniformDimensionedVectorField & g
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
void scaleSources()
Apply scaling to (transient) cloud sources.
Templated base class for reacting cloud.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
PtrList< volScalarField > & Y
const dimensionedScalar c
Speed of light in a vacuum.
void info()
Print cloud information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
void cloudReset(ReactingCloud< CloudType > &c)
Reset state of cloud.
void checkSuppliedComposition(const scalarField &YSupplied, const scalarField &Y, const word &YName)
Check that size of a composition field is valid.
Selector class for relaxation factors, solver type and solution.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Templated reacting parcel composition model class Consists of carrier species (via thermo package)...
Templated base class for dsmc cloud.
void relaxSources(const ReactingCloud< CloudType > &cloudOldTime)
Apply relaxation to (steady state) cloud sources.
static constexpr const zero Zero
Global zero (0)