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();
142 IOobject::READ_IF_PRESENT,
143 IOobject::AUTO_WRITE,
152 if (this->solution().resetSourcesOnStartup())
159 template<
class CloudType>
162 ReactingCloud<CloudType>&
c,
168 cloudCopyPtr_(nullptr),
169 constProps_(
c.constProps_),
170 compositionModel_(
c.compositionModel_->clone()),
171 phaseChangeModel_(
c.phaseChangeModel_->clone()),
172 rhoTrans_(
c.rhoTrans_.size())
181 "rhoTrans_" + this->
thermo().carrier().species()[i]
197 IOobject::NO_REGISTER
206 template<
class CloudType>
211 const ReactingCloud<CloudType>&
c 216 cloudCopyPtr_(nullptr),
218 compositionModel_(
c.compositionModel_->clone()),
219 phaseChangeModel_(nullptr),
226 template<
class CloudType>
230 const scalar lagrangianDt
233 CloudType::setParcelThermoProperties(parcel, lagrangianDt);
239 template<
class CloudType>
243 const scalar lagrangianDt,
244 const bool fullyDescribed
247 CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
251 checkSuppliedComposition
260 parcel.mass0() = parcel.mass();
264 template<
class CloudType>
271 clone(this->
name() +
"Copy").ptr()
277 template<
class CloudType>
280 cloudReset(cloudCopyPtr_());
281 cloudCopyPtr_.clear();
285 template<
class CloudType>
288 CloudType::resetSourceTerms();
291 rhoTrans_[i].field() = 0.0;
296 template<
class CloudType>
299 const ReactingCloud<CloudType>& cloudOldTime
302 CloudType::relaxSources(cloudOldTime);
308 dsfType& rhoT = rhoTrans_[fieldi];
309 const dsfType& rhoT0 = cloudOldTime.rhoTrans()[fieldi];
310 this->
relax(rhoT, rhoT0,
"rho");
315 template<
class CloudType>
318 CloudType::scaleSources();
324 dsfType& rhoT = rhoTrans_[fieldi];
325 this->scale(rhoT,
"rho");
330 template<
class CloudType>
333 if (this->solution().canEvolve())
335 typename parcelType::trackingData
td(*
this);
342 template<
class CloudType>
351 template<
class CloudType>
356 this->phaseChange().info();
360 template<
class CloudType>
363 if (compositionModel_)
370 template<
class CloudType>
373 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
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
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.
const speciesTable & species() const
Return the table of species.
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 expressions::valueTypeCode::INVALID.
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.
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.
const basicSpecieMixture & carrier() const
Return reference to the gaseous components.
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.
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)