32 template<
class ParcelType>
33 Foam::string Foam::CollidingParcel<ParcelType>::propertyList_ =
36 template<
class ParcelType>
39 offsetof(CollidingParcel<ParcelType>, collisionRecords_)
40 - offsetof(CollidingParcel<ParcelType>, f_)
46 template<
class ParcelType>
54 ParcelType(mesh, is, readFields),
56 angularMomentum_(
Zero),
62 if (is.
format() == IOstream::ASCII)
65 is >> angularMomentum_;
70 is.
read(reinterpret_cast<char*>(&f_), sizeofFields_);
73 is >> collisionRecords_;
79 "CollidingParcel<ParcelType>::Collisions" 80 "(const polyMesh&, Istream&, bool)" 85 template<
class ParcelType>
86 template<
class CloudType>
112 c.
fieldIOobject(
"collisionRecordsPairAccessed", IOobject::MUST_READ),
121 "collisionRecordsPairOrigProcOfOther",
132 "collisionRecordsPairOrigIdOfOther",
141 c.
fieldIOobject(
"collisionRecordsPairData", IOobject::MUST_READ),
148 c.
fieldIOobject(
"collisionRecordsWallAccessed", IOobject::MUST_READ),
155 c.
fieldIOobject(
"collisionRecordsWallPRel", IOobject::MUST_READ),
162 c.
fieldIOobject(
"collisionRecordsWallData", IOobject::MUST_READ),
179 collisionRecordsPairAccessed[i],
180 collisionRecordsPairOrigProcOfOther[i],
181 collisionRecordsPairOrigIdOfOther[i],
182 collisionRecordsPairData[i],
183 collisionRecordsWallAccessed[i],
184 collisionRecordsWallPRel[i],
185 collisionRecordsWallData[i]
193 template<
class ParcelType>
194 template<
class CloudType>
197 ParcelType::writeFields(c);
211 c.
fieldIOobject(
"collisionRecordsPairAccessed", IOobject::NO_READ),
218 "collisionRecordsPairOrigProcOfOther",
225 c.
fieldIOobject(
"collisionRecordsPairOrigIdOfOther", IOobject::NO_READ),
230 c.
fieldIOobject(
"collisionRecordsPairData", IOobject::NO_READ),
235 c.
fieldIOobject(
"collisionRecordsWallAccessed", IOobject::NO_READ),
240 c.
fieldIOobject(
"collisionRecordsWallPRel", IOobject::NO_READ),
245 c.
fieldIOobject(
"collisionRecordsWallData", IOobject::NO_READ),
260 collisionRecordsPairOrigProcOfOther[i] =
262 collisionRecordsPairOrigIdOfOther[i] =
272 const bool write = (np > 0);
275 angularMomentum.write(write);
278 collisionRecordsPairAccessed.write(write);
279 collisionRecordsPairOrigProcOfOther.write(write);
280 collisionRecordsPairOrigIdOfOther.write(write);
281 collisionRecordsPairData.write(write);
282 collisionRecordsWallAccessed.write(write);
283 collisionRecordsWallPRel.write(write);
284 collisionRecordsWallData.write(write);
290 template<
class ParcelType>
297 if (os.format() == IOstream::ASCII)
299 os << static_cast<const ParcelType&>(
p)
300 << token::SPACE <<
p.f_
301 << token::SPACE <<
p.angularMomentum_
302 << token::SPACE <<
p.torque_
303 << token::SPACE <<
p.collisionRecords_;
307 os << static_cast<const ParcelType&>(
p);
310 reinterpret_cast<const char*>(&
p.f_),
313 os <<
p.collisionRecords();
319 "Ostream& operator<<(Ostream&, const CollidingParcel<ParcelType>&)"
vector f_
Force on particle due to collisions [N].
CollisionRecordList< vector, vector > collisionRecordList
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Wrapper around parcel types to add collision modelling.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void checkFieldFieldIOobject(const Cloud< ParticleType > &c, const CompactIOField< Field< DataType >, DataType > &data) const
Check lagrangian data fieldfield.
const vector & f() const
Return const access to force.
static void writeFields(const CloudType &c)
Write.
label size() const
Return the number of particles in the cloud.
collisionRecordList collisionRecords_
Particle collision records.
const dimensionedScalar c
Speed of light in a vacuum.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual Istream & read(token &)=0
Return next token from stream.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
streamFormat format() const
Return current stream format.
const vector & torque() const
Return const access to torque.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const vector & angularMomentum() const
Return const access to angular momentum.
vector angularMomentum_
Angular momentum of Parcel in global reference frame [kg m2/s].
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. Behaves like IOField except when binary output in case it writes a CompactListList.
CollidingParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, coordinates and topology.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
Mesh consisting of general polyhedral cells.
const collisionRecordList & collisionRecords() const
Return const access to the collision records.
A class for handling character strings derived from std::string.
Templated base class for dsmc cloud.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
A primitive field of type <T> with automated input and output.
static void readFields(CloudType &c)
Read.