34template<
class ParcelType>
39template<
class ParcelType>
48template<
class ParcelType>
80template<
class ParcelType>
81template<
class CloudType>
84 ParcelType::readFields(c);
88template<
class ParcelType>
89template<
class CloudType,
class CompositionType>
93 const CompositionType& compModel
96 const bool readOnProc = c.size();
98 ParcelType::readFields(c, compModel);
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();
112 p.YGas_.setSize(gasNames.
size(), 0.0);
113 p.YLiquid_.setSize(liquidNames.
size(), 0.0);
124 "Y" + gasNames[j] + stateLabels[idGas],
131 for (ReactingMultiphaseParcel<ParcelType>&
p : c)
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>
184 ParcelType::writeFields(c);
188template<
class ParcelType>
189template<
class CloudType,
class CompositionType>
193 const CompositionType& compModel
196 ParcelType::writeFields(c, compModel);
198 const label np = c.size();
199 const bool writeOnProc = c.size();
203 const wordList& stateLabels = compModel.stateLabels();
205 const label idGas = compModel.idGas();
206 const wordList& gasNames = compModel.componentNames(idGas);
213 "Y" + gasNames[j] + stateLabels[idGas],
222 YGas[i] =
p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL);
226 YGas.write(writeOnProc);
229 const label idLiquid = compModel.idLiquid();
230 const wordList& liquidNames = compModel.componentNames(idLiquid);
237 "Y" + liquidNames[j] + stateLabels[idLiquid],
246 YLiquid[i] =
p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL);
250 YLiquid.write(writeOnProc);
253 const label idSolid = compModel.idSolid();
270 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
280template<
class ParcelType>
289 ParcelType::writeProperties(
os, filters, delim, namesOnly);
292 #define writeProp(Name, Value) \
293 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
304template<
class ParcelType>
305template<
class CloudType>
312 ParcelType::readObjects(c, obr);
316template<
class ParcelType>
317template<
class CloudType>
324 ParcelType::writeObjects(c, obr);
328template<
class ParcelType>
329template<
class CloudType,
class CompositionType>
333 const CompositionType& compModel,
337 ParcelType::readObjects(c, obr);
340 const bool readOnProc = c.size();
345 const wordList& stateLabels = compModel.stateLabels();
347 const label idGas = compModel.idGas();
348 const wordList& gasNames = compModel.componentNames(idGas);
351 const word fieldName =
"Y" + gasNames[j] + stateLabels[idGas];
357 p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL) = YGas[i];
362 const label idLiquid = compModel.idLiquid();
363 const wordList& liquidNames = compModel.componentNames(idLiquid);
366 const word fieldName =
"Y" + liquidNames[j] + stateLabels[idLiquid];
372 p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL) = YLiquid[i];
377 const label idSolid = compModel.idSolid();
381 const word fieldName =
"Y" +
solidNames[j] + stateLabels[idSolid];
387 p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL) = YSolid[i];
395template<
class ParcelType>
396template<
class CloudType,
class CompositionType>
400 const CompositionType& compModel,
404 ParcelType::writeObjects(
c, obr);
406 const label np =
c.size();
407 const bool writeOnProc =
c.size();
412 const wordList& stateLabels = compModel.stateLabels();
414 const label idGas = compModel.idGas();
415 const wordList& gasNames = compModel.componentNames(idGas);
418 const word fieldName =
"Y" + gasNames[j] + stateLabels[idGas];
424 YGas[i] =
p0.YGas()[j]*
max(
p0.Y()[GAS], SMALL);
429 const label idLiquid = compModel.idLiquid();
430 const wordList& liquidNames = compModel.componentNames(idLiquid);
433 const word fieldName =
"Y" + liquidNames[j] + stateLabels[idLiquid];
439 YLiquid[i] =
p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL);
444 const label idSolid = compModel.idSolid();
448 const word fieldName =
"Y" +
solidNames[j] + stateLabels[idSolid];
454 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
464template<
class ParcelType>
465Foam::Ostream& Foam::operator<<
485 os << YGasLoc << YLiquidLoc << YSolidLoc;
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
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.
@ NO_READ
Nothing to be read.
@ MUST_READ
Reading required.
streamFormat format() const noexcept
Get the current stream format.
@ ASCII
"ascii" (normal default)
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)....
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 [].
label canCombust_
Flag to identify if the particle can devolatilise and combust.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
static const std::size_t sizeofFields
Size in bytes of the fields.
static void writeFields(const CloudType &c, const CompositionType &compModel)
Write - composition supplied.
scalarField YGas_
Mass fractions of gases [].
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
const scalarField & YGas() const
Return const access to mass fractions of gases.
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, position and topology.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
const scalarField & YSolid() const
Return const access to mass fractions of solids.
const scalarField & YLiquid() const
Return const access to mass fractions of liquids.
static void readFields(CloudType &c, const CompositionType &compModel)
Read - composition supplied.
void size(const label n)
Older name for setAddressableSize.
static const IOField< Type > & lookupIOField(const word &fieldName, const objectRegistry &obr)
Lookup an IOField within object registry.
static IOField< Type > & createIOField(const word &fieldName, const label nParticle, objectRegistry &obr)
Helper to construct IOField on a supplied object registry.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
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)
const dimensionedScalar c
Speed of light in a vacuum.
List< word > wordList
List of word.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
DSMCCloud< dsmcParcel > CloudType
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define forAll(list, i)
Loop across all elements in list.