34 template<
class ParcelType>
39 template<
class ParcelType>
48 template<
class ParcelType>
75 readRawScalar(is, &
mass0_);
93 template<
class ParcelType>
94 template<
class CloudType>
101 template<
class ParcelType>
102 template<
class CloudType,
class CompositionType>
106 const CompositionType& compModel
109 bool valid =
c.size();
118 c.checkFieldIOobject(
c, mass0);
129 const wordList& phaseTypes = compModel.phaseTypes();
130 const label nPhases = phaseTypes.
size();
132 if (compModel.nPhase() == 1)
134 stateLabels = compModel.stateLabels()[0];
139 for (ReactingParcel<ParcelType>&
p :
c)
151 "Y" + phaseTypes[j] + stateLabels[j],
158 for (ReactingParcel<ParcelType>&
p :
c)
168 template<
class ParcelType>
169 template<
class CloudType>
176 template<
class ParcelType>
177 template<
class CloudType,
class CompositionType>
181 const CompositionType& compModel
186 const label np =
c.size();
201 const wordList& phaseTypes = compModel.phaseTypes();
202 wordList stateLabels(phaseTypes.size(),
"");
203 if (compModel.nPhase() == 1)
205 stateLabels = compModel.stateLabels()[0];
214 "Y" + phaseTypes[j] + stateLabels[j],
221 for (
const ReactingParcel<ParcelType>&
p :
c)
234 template<
class ParcelType>
238 const wordRes& filters,
243 ParcelType::writeProperties(
os, filters, delim, namesOnly);
246 #define writeProp(Name, Value) \ 247 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 256 template<
class ParcelType>
257 template<
class CloudType>
264 ParcelType::readObjects(
c, obr);
268 template<
class ParcelType>
269 template<
class CloudType>
276 ParcelType::writeObjects(
c, obr);
280 template<
class ParcelType>
281 template<
class CloudType,
class CompositionType>
285 const CompositionType& compModel,
289 ParcelType::readObjects(
c, obr);
291 if (!
c.size())
return;
294 auto& mass0 = cloud::lookupIOField<scalar>(
"mass0", obr);
305 const wordList& phaseTypes = compModel.phaseTypes();
306 wordList stateLabels(phaseTypes.size(),
"");
307 if (compModel.nPhase() == 1)
309 stateLabels = compModel.stateLabels()[0];
314 const word fieldName =
"Y" + phaseTypes[j] + stateLabels[j];
315 auto&
Y = cloud::lookupIOField<scalar>(fieldName, obr);
318 for (ReactingParcel<ParcelType>&
p :
c)
328 template<
class ParcelType>
329 template<
class CloudType,
class CompositionType>
333 const CompositionType& compModel,
337 ParcelType::writeObjects(
c, obr);
339 const label np =
c.size();
343 auto& mass0 = cloud::createIOField<scalar>(
"mass0", np, obr);
346 for (
const ReactingParcel<ParcelType>&
p :
c)
354 const wordList& phaseTypes = compModel.phaseTypes();
355 wordList stateLabels(phaseTypes.size(),
"");
356 if (compModel.nPhase() == 1)
358 stateLabels = compModel.stateLabels()[0];
363 const word fieldName =
"Y" + phaseTypes[j] + stateLabels[j];
364 auto&
Y = cloud::createIOField<scalar>(fieldName, np, obr);
367 for (
const ReactingParcel<ParcelType>&
p :
c)
380 template<
class ParcelType>
384 const ReactingParcel<ParcelType>&
p 389 os << static_cast<const ParcelType&>(
p)
395 os << static_cast<const ParcelType&>(
p);
398 reinterpret_cast<const char*>(&
p.mass0_),
virtual Ostream & write(const char c)
Write character.
void size(const label n)
Older name for setAddressableSize.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
DSMCCloud< dsmcParcel > CloudType
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
Check if the scalar byte-size associated with the stream is the same as the given type...
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.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalarField Y_
Mass fractions of mixture [].
ReactingParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
virtual bool endRawRead()=0
End of low-level raw binary read.
static void writeFields(const CloudType &c, const CompositionType &compModel)
Write - composition supplied.
#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.
void setSize(const label n)
Alias for resize()
virtual Istream & read(token &)=0
Return next token from stream.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
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...
OBJstream os(runTime.globalPath()/outputName)
static const std::size_t sizeofFields
Size in bytes of the fields.
List< word > wordList
A List of words.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
PtrList< volScalarField > & Y
const dimensionedScalar c
Speed of light in a vacuum.
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
Check if the label byte-size associated with the stream is the same as the given type.
#define writeProp(Name, Value)
Mesh consisting of general polyhedral cells.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
Reacting parcel class with one/two-way coupling with the continuous phase.
Registry of regIOobjects.
scalar mass0_
Initial mass [kg].
virtual bool write(const bool valid=true) const
Write using setting from DB.
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.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.