34 template<
class ParcelType>
39 template<
class ParcelType>
48 template<
class ParcelType>
80 template<
class ParcelType>
81 template<
class CloudType>
88 template<
class ParcelType>
89 template<
class CloudType,
class CompositionType>
93 const CompositionType& compModel
96 const bool readOnProc =
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],
131 for (ReactingMultiphaseParcel<ParcelType>&
p :
c)
133 p.YGas_[j] = YGas[i]/(
max(
p.Y()[GAS], SMALL));
140 IOField<scalar> YLiquid
144 "Y" + liquidNames[j] + stateLabels[idLiquid],
151 for (ReactingMultiphaseParcel<ParcelType>&
p :
c)
153 p.YLiquid_[j] = YLiquid[i]/(
max(
p.Y()[LIQ], SMALL));
160 IOField<scalar> YSolid
171 for (ReactingMultiphaseParcel<ParcelType>&
p :
c)
173 p.YSolid_[j] = YSolid[i]/(
max(
p.Y()[SLD], SMALL));
180 template<
class ParcelType>
181 template<
class CloudType>
188 template<
class ParcelType>
189 template<
class CloudType,
class CompositionType>
193 const CompositionType& 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);
233 IOField<scalar> YLiquid
237 "Y" + liquidNames[j] + stateLabels[idLiquid],
244 for (
const ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
246 YLiquid[i] =
p0.YLiquid()[j]*
max(
p0.Y()[LIQ], SMALL);
250 YLiquid.write(writeOnProc);
253 const label idSolid = compModel.idSolid();
257 IOField<scalar> YSolid
268 for (
const ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
270 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
274 YSolid.write(writeOnProc);
280 template<
class ParcelType>
284 const wordRes& filters,
289 ParcelType::writeProperties(
os, filters, delim, namesOnly);
292 #define writeProp(Name, Value) \ 293 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 304 template<
class ParcelType>
305 template<
class CloudType>
312 ParcelType::readObjects(
c, obr);
316 template<
class ParcelType>
317 template<
class CloudType>
324 ParcelType::writeObjects(
c, obr);
328 template<
class ParcelType>
329 template<
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];
352 const auto& YGas = cloud::lookupIOField<scalar>(fieldName, obr);
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];
367 const auto& YLiquid = cloud::lookupIOField<scalar>(fieldName, obr);
370 for (ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
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];
382 const auto& YSolid = cloud::lookupIOField<scalar>(fieldName, obr);
385 for (ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
387 p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL) = YSolid[i];
395 template<
class ParcelType>
396 template<
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];
419 auto& YGas = cloud::createIOField<scalar>(fieldName, np, obr);
422 for (
const ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
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];
434 auto& YLiquid = cloud::createIOField<scalar>(fieldName, np, obr);
437 for (
const ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
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];
449 auto& YSolid = cloud::createIOField<scalar>(fieldName, np, obr);
452 for (
const ReactingMultiphaseParcel<ParcelType>&
p0 :
c)
454 YSolid[i] =
p0.YSolid()[j]*
max(
p0.Y()[SLD], SMALL);
464 template<
class ParcelType>
468 const ReactingMultiphaseParcel<ParcelType>&
p 477 os << static_cast<const ParcelType&>(
p)
484 os << static_cast<const ParcelType&>(
p);
485 os << YGasLoc << YLiquidLoc << YSolidLoc;
void size(const label n)
Older name for setAddressableSize.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
DSMCCloud< dsmcParcel > CloudType
static void writeFields(const CloudType &c, const CompositionType &compModel)
Write - composition supplied.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
const wordList solidNames(rp["solid"])
#define writeProp(Name, Value)
#define forAll(list, i)
Loop across all elements in list.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static void readFields(CloudType &c, const CompositionType &compModel)
Read - composition supplied.
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, position and topology.
scalarField YGas_
Mass fractions of gases [].
void setSize(const label n)
Alias for resize()
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.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
void writeFields(const fvMesh &mesh, const wordHashSet &selectedFields, const bool writeFaceFields)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
scalarField YSolid_
Mass fractions of solids [].
OBJstream os(runTime.globalPath()/outputName)
static const std::size_t sizeofFields
Size in bytes of the fields.
scalarField YLiquid_
Mass fractions of liquids [].
List< word > wordList
List of word.
const dimensionedScalar c
Speed of light in a vacuum.
Multiphase variant of the reacting parcel class with one/two-way coupling with the continuous phase...
Mesh consisting of general polyhedral cells.
Registry of regIOobjects.
A class for handling character strings derived from std::string.
Templated base class for dsmc cloud.
A primitive field of type <T> with automated input and output.
streamFormat format() const noexcept
Get the current stream format.
const volScalarField & p0
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.