34 template<
class ParcelType>
39 template<
class ParcelType>
42 sizeof(SprayParcel<ParcelType>) -
sizeof(ParcelType)
48 template<
class ParcelType>
96 readRawScalar(is, &
d0_);
97 readRawScalar(is,
position0_.data(), vector::nComponents);
98 readRawScalar(is, &
sigma_);
99 readRawScalar(is, &
mu_);
102 readRawScalar(is, &
y_);
103 readRawScalar(is, &
yDot_);
104 readRawScalar(is, &
tc_);
105 readRawScalar(is, &
ms_);
107 readRawScalar(is, &
tMom_);
108 readRawScalar(is, &
user_);
122 template<
class ParcelType>
123 template<
class CloudType>
130 template<
class ParcelType>
131 template<
class CloudType,
class CompositionType>
135 const CompositionType& compModel
138 const bool readOnProc =
c.size();
143 c.checkFieldIOobject(
c, d0);
150 c.checkFieldIOobject(
c, position0);
157 c.checkFieldIOobject(
c,
sigma);
160 c.checkFieldIOobject(
c,
mu);
167 c.checkFieldIOobject(
c, liquidCore);
174 c.checkFieldIOobject(
c, KHindex);
181 c.checkFieldIOobject(
c,
y);
188 c.checkFieldIOobject(
c, yDot);
195 c.checkFieldIOobject(
c, tc);
202 c.checkFieldIOobject(
c, ms);
209 c.checkFieldIOobject(
c, injector);
216 c.checkFieldIOobject(
c, tMom);
223 c.checkFieldIOobject(
c, user);
229 p.position0_ = position0[i];
232 p.liquidCore_ = liquidCore[i];
233 p.KHindex_ = KHindex[i];
238 p.injector_ = injector[i];
247 template<
class ParcelType>
248 template<
class CloudType>
255 template<
class ParcelType>
256 template<
class CloudType,
class CompositionType>
260 const CompositionType& compModel
265 const label np =
c.size();
266 const bool writeOnProc =
c.size();
298 position0[i] =
p.position0_;
301 liquidCore[i] =
p.liquidCore_;
302 KHindex[i] =
p.KHindex_;
307 injector[i] =
p.injector_;
313 d0.
write(writeOnProc);
314 position0.write(writeOnProc);
315 sigma.write(writeOnProc);
316 mu.write(writeOnProc);
317 liquidCore.write(writeOnProc);
318 KHindex.write(writeOnProc);
319 y.write(writeOnProc);
320 yDot.write(writeOnProc);
321 tc.write(writeOnProc);
322 ms.write(writeOnProc);
323 injector.write(writeOnProc);
324 tMom.write(writeOnProc);
325 user.write(writeOnProc);
329 template<
class ParcelType>
338 ParcelType::writeProperties(
os, filters, delim, namesOnly);
341 #define writeProp(Name, Value) \ 342 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 362 template<
class ParcelType>
363 template<
class CloudType>
370 ParcelType::readObjects(
c, obr);
374 template<
class ParcelType>
375 template<
class CloudType>
382 ParcelType::writeObjects(
c, obr);
386 template<
class ParcelType>
387 template<
class CloudType,
class CompositionType>
391 const CompositionType& compModel,
395 ParcelType::readObjects(
c, compModel, obr);
397 if (!
c.size())
return;
399 const auto& d0 = cloud::lookupIOField<scalar>(
"d0", obr);
400 const auto& position0 = cloud::lookupIOField<vector>(
"position0", obr);
401 const auto&
sigma = cloud::lookupIOField<scalar>(
"sigma", obr);
402 const auto&
mu = cloud::lookupIOField<scalar>(
"mu", obr);
403 const auto& liquidCore = cloud::lookupIOField<scalar>(
"liquidCore", obr);
404 const auto& KHindex = cloud::lookupIOField<scalar>(
"KHindex", obr);
405 const auto&
y = cloud::lookupIOField<scalar>(
"y", obr);
406 const auto& yDot = cloud::lookupIOField<scalar>(
"yDot", obr);
407 const auto& tc = cloud::lookupIOField<scalar>(
"tc", obr);
408 const auto& ms = cloud::lookupIOField<scalar>(
"ms", obr);
409 const auto& injector = cloud::lookupIOField<scalar>(
"injector", obr);
410 const auto& tMom = cloud::lookupIOField<scalar>(
"tMom", obr);
411 const auto& user = cloud::lookupIOField<scalar>(
"user", obr);
417 p.position0_ = position0[i];
420 p.liquidCore_ = liquidCore[i];
421 p.KHindex_ = KHindex[i];
426 p.injector_ = injector[i];
435 template<
class ParcelType>
436 template<
class CloudType,
class CompositionType>
440 const CompositionType& compModel,
444 ParcelType::writeObjects(
c, compModel, obr);
446 const label np =
c.size();
448 auto& d0 = cloud::createIOField<scalar>(
"d0", np, obr);
449 auto& position0 = cloud::createIOField<vector>(
"position0", np, obr);
450 auto&
sigma = cloud::createIOField<scalar>(
"sigma", np, obr);
451 auto&
mu = cloud::createIOField<scalar>(
"mu", np, obr);
452 auto& liquidCore = cloud::createIOField<scalar>(
"liquidCore", np, obr);
453 auto& KHindex = cloud::createIOField<scalar>(
"KHindex", np, obr);
454 auto&
y = cloud::createIOField<scalar>(
"y", np, obr);
455 auto& yDot= cloud::createIOField<scalar>(
"yDot", np, obr);
456 auto& tc = cloud::createIOField<scalar>(
"tc", np, obr);
457 auto& ms = cloud::createIOField<scalar>(
"ms", np, obr);
458 auto& injector = cloud::createIOField<scalar>(
"injector", np, obr);
459 auto& tMom = cloud::createIOField<scalar>(
"tMom", np, obr);
460 auto& user = cloud::createIOField<scalar>(
"user", np, obr);
463 for (
const SprayParcel<ParcelType>&
p :
c)
466 position0[i] =
p.position0_;
469 liquidCore[i] =
p.liquidCore_;
470 KHindex[i] =
p.KHindex_;
475 injector[i] =
p.injector_;
486 template<
class ParcelType>
490 const SprayParcel<ParcelType>&
p 495 os << static_cast<const ParcelType&>(
p)
512 os << static_cast<const ParcelType&>(
p);
515 reinterpret_cast<const char*>(&
p.d0_),
virtual Ostream & write(const char c)
Write character.
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 bool check(const char *operation) const
Check IOstream status for given operation.
scalar tMom_
Momentum relaxation time (needed for calculating parcel acc.)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
virtual bool endRawRead()=0
End of low-level raw binary read.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
scalar liquidCore_
Part of liquid core ( >0.5=liquid, <0.5=droplet )
SprayParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static const std::size_t sizeofFields
Size in bytes of the fields.
virtual Istream & read(token &)=0
Return next token from stream.
static void writeObjects(const CloudType &c, objectRegistry &obr)
Write particle fields as objects into the obr registry.
A class for handling words, derived from Foam::string.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
A List of wordRe with additional matching capabilities.
scalar injector_
Injected from injector (needed e.g. for calculating distance.
scalar user_
Passive scalar (extra variable to be defined by user)
static void readFields(CloudType &c, const CompositionType &compModel)
Read.
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)
scalar sigma_
Liquid surface tension [N/m].
static void writeFields(const CloudType &c, const CompositionType &compModel)
Write.
const dimensionedScalar mu
Atomic mass unit.
vector position0_
Injection position.
#define writeProp(Name, Value)
scalar yDot_
Rate of change of spherical deviation.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
const dimensionedScalar c
Speed of light in a vacuum.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
scalar ms_
Stripped parcel mass due to breakup.
scalar d0_
Initial droplet diameter.
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.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
scalar tc_
Characteristic time (used in atomization and/or breakup model)
Registry of regIOobjects.
scalar mu_
Liquid dynamic viscosity [Pa.s].
scalar y_
Spherical deviation.
scalar KHindex_
Index for KH Breakup.
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.
Reacting spray parcel, with added functionality for atomization and breakup.
static constexpr const zero Zero
Global zero (0)