34 template<
class ParcelType>
39 template<
class ParcelType>
42 sizeof(ThermoParcel<ParcelType>)
43 - offsetof(ThermoParcel<ParcelType>, T_)
49 template<
class ParcelType>
74 readRawScalar(is, &
T_);
75 readRawScalar(is, &
Cp_);
89 template<
class ParcelType>
90 template<
class CloudType>
93 const bool readOnProc =
c.size();
98 c.checkFieldIOobject(
c,
T);
101 c.checkFieldIOobject(
c,
Cp);
115 template<
class ParcelType>
116 template<
class CloudType>
121 const label np =
c.size();
122 const bool writeOnProc =
c.size();
128 for (
const ThermoParcel<ParcelType>&
p :
c)
136 T.write(writeOnProc);
141 template<
class ParcelType>
150 ParcelType::writeProperties(
os, filters, delim, namesOnly);
153 #define writeProp(Name, Value) \ 154 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 163 template<
class ParcelType>
164 template<
class CloudType>
173 if (!
c.size())
return;
175 auto&
T = cloud::lookupIOField<scalar>(
"T", obr);
176 auto&
Cp = cloud::lookupIOField<scalar>(
"Cp", obr);
189 template<
class ParcelType>
190 template<
class CloudType>
197 ParcelType::writeObjects(
c, obr);
199 const label np =
c.size();
201 auto&
T = cloud::createIOField<scalar>(
"T", np, obr);
202 auto&
Cp = cloud::createIOField<scalar>(
"Cp", np, obr);
205 for (
const ThermoParcel<ParcelType>&
p :
c)
217 template<
class ParcelType>
221 const ThermoParcel<ParcelType>&
p 226 os << static_cast<const ParcelType&>(
p)
232 os << static_cast<const ParcelType&>(
p);
235 reinterpret_cast<const char*>(&
p.T_),
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...
virtual Ostream & write(const char c) override
Write character.
scalar Cp_
Specific heat capacity [J/(kg.K)].
virtual bool check(const char *operation) const
Check IOstream status for given operation.
#define writeProp(Name, Value)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
static const std::size_t sizeofFields
Size in bytes of the fields.
ThermoParcel(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.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
scalar T_
Temperature [K].
virtual Istream & read(token &)=0
Return next token from stream.
static void readFields(CloudType &c)
Read.
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.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
A List of wordRe with additional matching capabilities.
static void writeFields(const CloudType &c)
Write.
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...
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
const volScalarField & Cp
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
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.
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.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly=false) const
Write individual parcel properties to stream.
Thermodynamic parcel class with one/two-way coupling with the continuous phase. Includes Kinematic pa...