34template<
class ParcelType>
39template<
class ParcelType>
48template<
class ParcelType>
80template<
class ParcelType>
81template<
class CloudType>
88template<
class ParcelType>
89template<
class CloudType,
class CompositionType>
93 const CompositionType& compModel
96 bool valid = c.size();
101 const label idGas = compModel.idGas();
102 const wordList& gasNames = compModel.componentNames(idGas);
103 const label idLiquid = compModel.idLiquid();
104 const wordList& liquidNames = compModel.componentNames(idLiquid);
105 const label idSolid = compModel.idSolid();
107 const wordList& stateLabels = compModel.stateLabels();
124 "Y" + gasNames[j] + stateLabels[idGas],
133 p.YGas_[j] = YGas[i]/(
max(
p.Y()[GAS], SMALL));
144 "Y" + liquidNames[j] + stateLabels[idLiquid],
153 p.YLiquid_[j] = YLiquid[i]/(
max(
p.Y()[LIQ], SMALL));
173 p.YSolid_[j] = YSolid[i]/(
max(
p.Y()[SLD], SMALL));
180template<
class ParcelType>
181template<
class CloudType>
188template<
class ParcelType>
189template<
class CloudType,
class CompositionType>
193 const CompositionType& compModel
202 const wordList& stateLabels = compModel.stateLabels();
204 const label idGas = compModel.idGas();
205 const wordList& gasNames = compModel.componentNames(idGas);
212 "Y" + gasNames[j] + stateLabels[idGas],
221 YGas[i] =
p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL);
228 const label idLiquid = compModel.idLiquid();
229 const wordList& liquidNames = compModel.componentNames(idLiquid);
236 "Y" + liquidNames[j] + stateLabels[idLiquid],
245 YLiquid[i] =
p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL);
249 YLiquid.
write(np > 0);
252 const label idSolid = compModel.idSolid();
269 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
273 YSolid.
write(np > 0);
279template<
class ParcelType>
291 #define writeProp(Name, Value) \
292 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
303template<
class ParcelType>
304template<
class CloudType>
315template<
class ParcelType>
316template<
class CloudType>
327template<
class ParcelType>
328template<
class CloudType,
class CompositionType>
332 const CompositionType& compModel,
338 const label np = c.size();
343 const wordList& stateLabels = compModel.stateLabels();
345 const label idGas = compModel.idGas();
346 const wordList& gasNames = compModel.componentNames(idGas);
349 const word fieldName =
"Y" + gasNames[j] + stateLabels[idGas];
350 const auto& YGas = cloud::lookupIOField<scalar>(fieldName, obr);
355 p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL) = YGas[i];
360 const label idLiquid = compModel.idLiquid();
361 const wordList& liquidNames = compModel.componentNames(idLiquid);
364 const word fieldName =
"Y" + liquidNames[j] + stateLabels[idLiquid];
365 const auto& YLiquid = cloud::lookupIOField<scalar>(fieldName, obr);
370 p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL) = YLiquid[i];
375 const label idSolid = compModel.idSolid();
379 const word fieldName =
"Y" +
solidNames[j] + stateLabels[idSolid];
380 const auto& YSolid = cloud::lookupIOField<scalar>(fieldName, obr);
385 p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL) = YSolid[i];
393template<
class ParcelType>
394template<
class CloudType,
class CompositionType>
398 const CompositionType& compModel,
404 const label np = c.size();
409 const wordList& stateLabels = compModel.stateLabels();
411 const label idGas = compModel.idGas();
412 const wordList& gasNames = compModel.componentNames(idGas);
415 const word fieldName =
"Y" + gasNames[j] + stateLabels[idGas];
416 auto& YGas = cloud::createIOField<scalar>(fieldName, np, obr);
421 YGas[i] =
p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL);
426 const label idLiquid = compModel.idLiquid();
427 const wordList& liquidNames = compModel.componentNames(idLiquid);
430 const word fieldName =
"Y" + liquidNames[j] + stateLabels[idLiquid];
431 auto& YLiquid = cloud::createIOField<scalar>(fieldName, np, obr);
436 YLiquid[i] =
p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL);
441 const label idSolid = compModel.idSolid();
445 const word fieldName =
"Y" +
solidNames[j] + stateLabels[idSolid];
446 auto& YSolid = cloud::createIOField<scalar>(fieldName, np, obr);
451 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
461template<
class ParcelType>
474 os << static_cast<const ParcelType&>(
p)
481 os << static_cast<const ParcelType&>(
p);
482 os << YGasLoc << YLiquidLoc << YSolidLoc;
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Templated base class for dsmc cloud.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A primitive field of type <T> with automated input and output.
streamFormat format() const noexcept
Get the current stream format.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Multiphase variant of the reacting parcel class with one/two-way coupling with the continuous phase.
scalarField YLiquid_
Mass fractions of liquids [].
scalarField YSolid_
Mass fractions of solids [].
static const std::size_t sizeofFields
Size in bytes of the fields.
scalarField YGas_
Mass fractions of gases [].
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
static void readFields(CloudType &c, const CompositionType &compModel)
Read - composition supplied.
void size(const label n)
Older name for setAddressableSize.
void writeFields() const
Write fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Allows specification of different writing frequency of objects registered to the database.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
Registry of regIOobjects.
static string propertyList()
Mesh consisting of general polyhedral cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for handling character strings derived from std::string.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
const volScalarField & p0
const wordList solidNames(rp["solid"])
OBJstream os(runTime.globalPath()/outputName)
#define writeProp(Name, Value)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
#define forAll(list, i)
Loop across all elements in list.