35template<
class ParcelType>
39template<
class ParcelType>
42 offsetof(CollidingParcel<ParcelType>, collisionRecords_)
43 - offsetof(CollidingParcel<ParcelType>, f_)
49template<
class ParcelType>
60 angularMomentum_(Zero),
96template<
class ParcelType>
97template<
class CloudType>
100 const bool valid = c.size();
105 c.checkFieldIOobject(c,
f);
112 c.checkFieldIOobject(c, angularMomentum);
119 c.checkFieldIOobject(c, torque);
126 c.checkFieldFieldIOobject(c, collisionRecordsPairAccessed);
132 "collisionRecordsPairOrigProcOfOther",
137 c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
143 "collisionRecordsPairOrigIdOfOther",
148 c.checkFieldFieldIOobject(c, collisionRecordsPairOrigProcOfOther);
155 c.checkFieldFieldIOobject(c, collisionRecordsPairData);
162 c.checkFieldFieldIOobject(c, collisionRecordsWallAccessed);
169 c.checkFieldFieldIOobject(c, collisionRecordsWallPRel);
176 c.checkFieldFieldIOobject(c, collisionRecordsWallData);
183 p.angularMomentum_ = angularMomentum[i];
184 p.torque_ = torque[i];
188 collisionRecordsPairAccessed[i],
189 collisionRecordsPairOrigProcOfOther[i],
190 collisionRecordsPairOrigIdOfOther[i],
191 collisionRecordsPairData[i],
192 collisionRecordsWallAccessed[i],
193 collisionRecordsWallPRel[i],
194 collisionRecordsWallData[i]
202template<
class ParcelType>
203template<
class CloudType>
208 const label np = c.size();
209 const bool valid = np;
229 "collisionRecordsPairOrigProcOfOther",
264 angMom[i] =
p.angularMomentum();
265 torque[i] =
p.torque();
267 collisionRecordsPairAccessed[i] =
p.collisionRecords().pairAccessed();
268 collisionRecordsPairOrigProcOfOther[i] =
269 p.collisionRecords().pairOrigProcOfOther();
270 collisionRecordsPairOrigIdOfOther[i] =
271 p.collisionRecords().pairOrigIdOfOther();
272 collisionRecordsPairData[i] =
p.collisionRecords().pairData();
273 collisionRecordsWallAccessed[i] =
p.collisionRecords().wallAccessed();
274 collisionRecordsWallPRel[i] =
p.collisionRecords().wallPRel();
275 collisionRecordsWallData[i] =
p.collisionRecords().wallData();
284 collisionRecordsPairAccessed.
write(valid);
285 collisionRecordsPairOrigProcOfOther.
write(valid);
286 collisionRecordsPairOrigIdOfOther.
write(valid);
287 collisionRecordsPairData.
write(valid);
288 collisionRecordsWallAccessed.
write(valid);
289 collisionRecordsWallPRel.
write(valid);
290 collisionRecordsWallData.
write(valid);
294template<
class ParcelType>
306 #define writeProp(Name, Value) \
307 ParcelType::writeProperty(os, Name, Value, namesOnly, delim, filters)
310 writeProp(
"angularMomentum", angularMomentum_);
318template<
class ParcelType>
319template<
class CloudType>
328 if (!c.size())
return;
330 const auto&
f = cloud::lookupIOField<vector>(
"f", obr);
331 const auto& angMom = cloud::lookupIOField<vector>(
"angularMomentum", obr);
332 const auto& torque = cloud::lookupIOField<vector>(
"torque", obr);
338 p.angularMomentum_ = angMom[i];
339 p.torque_ = torque[i];
346template<
class ParcelType>
347template<
class CloudType>
356 const label np = c.size();
358 auto&
f = cloud::createIOField<vector>(
"f", np, obr);
359 auto& angMom = cloud::createIOField<vector>(
"angularMomentum", np, obr);
360 auto& torque = cloud::createIOField<vector>(
"torque", np, obr);
366 angMom[i] =
p.angularMomentum();
367 torque[i] =
p.torque();
376template<
class ParcelType>
385 os << static_cast<const ParcelType&>(
p)
393 os << static_cast<const ParcelType&>(
p);
396 reinterpret_cast<const char*
>(&
p.f_),
399 os <<
p.collisionRecords();
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Wrapper around kinematic parcel types to add collision modelling.
static const std::size_t sizeofFields
Size in bytes of the fields.
vector f_
Force on particle due to collisions [N].
static void readObjects(CloudType &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
collisionRecordList collisionRecords_
Particle collision records.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
vector angularMomentum_
Angular momentum of Parcel in global reference frame [kg m2/s].
static void readFields(CloudType &c)
Read.
vector torque_
Torque on particle due to collisions in global.
A Field of objects of type <T> with automated input and output using a compact storage....
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.
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize() const noexcept
virtual bool check(const char *operation) const
Check IOstream status for given operation.
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize() const noexcept
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.
virtual bool beginRawRead()=0
Start of low-level raw binary read.
virtual Istream & read(token &)=0
Return next token from stream.
virtual Ostream & write(const char c)
Write character.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void writeFields() const
Write fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Allows specification of different writing frequency of objects registered to the database.
static void readObjects(Cloud< injectedParticle > &c, const objectRegistry &obr)
Read particle fields as objects from the obr registry.
void writeProperties(Ostream &os, const wordRes &filters, const word &delim, const bool namesOnly) const
Write individual parcel properties to stream.
Registry of regIOobjects.
static constexpr direction nComponents
Number of components in bool is 1.
static string propertyList()
Mesh consisting of general polyhedral cells.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A class for handling character strings derived from std::string.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
#define writeProp(Name, Value)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
CollisionRecordList< vector, vector > collisionRecordList