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 valid =
c.size();
143 c.checkFieldIOobject(
c, d0);
150 c.checkFieldIOobject(
c, position0);
153 c.checkFieldIOobject(
c,
sigma);
156 c.checkFieldIOobject(
c,
mu);
163 c.checkFieldIOobject(
c, liquidCore);
170 c.checkFieldIOobject(
c, KHindex);
177 c.checkFieldIOobject(
c,
y);
184 c.checkFieldIOobject(
c, yDot);
191 c.checkFieldIOobject(
c, tc);
198 c.checkFieldIOobject(
c, ms);
205 c.checkFieldIOobject(
c, injector);
212 c.checkFieldIOobject(
c, tMom);
219 c.checkFieldIOobject(
c, user);
225 p.position0_ = position0[i];
228 p.liquidCore_ = liquidCore[i];
229 p.KHindex_ = KHindex[i];
234 p.injector_ = injector[i];
243 template<
class ParcelType>
244 template<
class CloudType>
251 template<
class ParcelType>
252 template<
class CloudType,
class CompositionType>
256 const CompositionType& compModel
261 const label np =
c.size();
262 const bool valid = np;
295 position0[i] =
p.position0_;
298 liquidCore[i] =
p.liquidCore_;
299 KHindex[i] =
p.KHindex_;
304 injector[i] =
p.injector_;
311 position0.write(valid);
314 liquidCore.write(valid);
315 KHindex.write(valid);
320 injector.write(valid);
326 template<
class ParcelType>
335 ParcelType::writeProperties(
os, filters, delim, namesOnly);
338 #define writeProp(Name, Value) \ 339 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters) 359 template<
class ParcelType>
360 template<
class CloudType>
367 ParcelType::readObjects(
c, obr);
371 template<
class ParcelType>
372 template<
class CloudType>
379 ParcelType::writeObjects(
c, obr);
383 template<
class ParcelType>
384 template<
class CloudType,
class CompositionType>
388 const CompositionType& compModel,
392 ParcelType::readObjects(
c, compModel, obr);
394 if (!
c.size())
return;
396 const auto& d0 = cloud::lookupIOField<scalar>(
"d0", obr);
397 const auto& position0 = cloud::lookupIOField<vector>(
"position0", obr);
398 const auto&
sigma = cloud::lookupIOField<scalar>(
"sigma", obr);
399 const auto&
mu = cloud::lookupIOField<scalar>(
"mu", obr);
400 const auto& liquidCore = cloud::lookupIOField<scalar>(
"liquidCore", obr);
401 const auto& KHindex = cloud::lookupIOField<scalar>(
"KHindex", obr);
402 const auto&
y = cloud::lookupIOField<scalar>(
"y", obr);
403 const auto& yDot = cloud::lookupIOField<scalar>(
"yDot", obr);
404 const auto& tc = cloud::lookupIOField<scalar>(
"tc", obr);
405 const auto& ms = cloud::lookupIOField<scalar>(
"ms", obr);
406 const auto& injector = cloud::lookupIOField<scalar>(
"injector", obr);
407 const auto& tMom = cloud::lookupIOField<scalar>(
"tMom", obr);
408 const auto& user = cloud::lookupIOField<scalar>(
"user", obr);
414 p.position0_ = position0[i];
417 p.liquidCore_ = liquidCore[i];
418 p.KHindex_ = KHindex[i];
423 p.injector_ = injector[i];
432 template<
class ParcelType>
433 template<
class CloudType,
class CompositionType>
437 const CompositionType& compModel,
441 ParcelType::writeObjects(
c, compModel, obr);
443 const label np =
c.size();
445 auto& d0 = cloud::createIOField<scalar>(
"d0", np, obr);
446 auto& position0 = cloud::createIOField<vector>(
"position0", np, obr);
447 auto&
sigma = cloud::createIOField<scalar>(
"sigma", np, obr);
448 auto&
mu = cloud::createIOField<scalar>(
"mu", np, obr);
449 auto& liquidCore = cloud::createIOField<scalar>(
"liquidCore", np, obr);
450 auto& KHindex = cloud::createIOField<scalar>(
"KHindex", np, obr);
451 auto&
y = cloud::createIOField<scalar>(
"y", np, obr);
452 auto& yDot= cloud::createIOField<scalar>(
"yDot", np, obr);
453 auto& tc = cloud::createIOField<scalar>(
"tc", np, obr);
454 auto& ms = cloud::createIOField<scalar>(
"ms", np, obr);
455 auto& injector = cloud::createIOField<scalar>(
"injector", np, obr);
456 auto& tMom = cloud::createIOField<scalar>(
"tMom", np, obr);
457 auto& user = cloud::createIOField<scalar>(
"user", np, obr);
460 for (
const SprayParcel<ParcelType>&
p :
c)
463 position0[i] =
p.position0_;
466 liquidCore[i] =
p.liquidCore_;
467 KHindex[i] =
p.KHindex_;
472 injector[i] =
p.injector_;
483 template<
class ParcelType>
487 const SprayParcel<ParcelType>&
p 492 os << static_cast<const ParcelType&>(
p)
509 os << static_cast<const ParcelType&>(
p);
512 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.
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].
virtual bool write(const bool valid=true) const
Write using setting from DB.
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)