74 const scalar trackTime
77 td.switchProcessor =
false;
78 td.keepParticle =
true;
80 const constantProperties& constProps(
cloud.constProps(id_));
87 v_ += 0.5*trackTime*a_;
89 pi_ += 0.5*trackTime*tau_;
91 else if (
td.part() == 1)
95 while (
td.keepParticle && !
td.switchProcessor && stepFraction() < 1)
97 const scalar
f = 1 - stepFraction();
98 trackToAndHitFace(
f*trackTime*v_,
f, cloud,
td);
101 else if (
td.part() == 2)
107 if (!constProps.pointMolecule())
109 const diagTensor& momentOfInertia(constProps.momentOfInertia());
113 if (!constProps.linearMolecule())
115 R = rotationTensorX(0.5*trackTime*pi_.x()/momentOfInertia.xx());
120 R = rotationTensorY(0.5*trackTime*pi_.y()/momentOfInertia.yy());
124 R = rotationTensorZ(trackTime*pi_.z()/momentOfInertia.zz());
128 R = rotationTensorY(0.5*trackTime*pi_.y()/momentOfInertia.yy());
132 if (!constProps.linearMolecule())
134 R = rotationTensorX(0.5*trackTime*pi_.x()/momentOfInertia.xx());
140 setSitePositions(constProps);
142 else if (
td.part() == 3)
147 scalar m = constProps.mass();
159 tau_ += (constProps.siteReferencePositions()[
s] ^ (Q_.T() &
f));
162 v_ += 0.5*trackTime*a_;
164 pi_ += 0.5*trackTime*tau_;
166 if (constProps.pointMolecule())
173 if (constProps.linearMolecule())
183 <<
td.part() <<
" is an invalid part of the integration method." 187 return td.keepParticle;
207 sitePositions_ = position() + (
T & (sitePositions_ - position()));
209 siteForces_ =
T & siteForces_;
217 if (special_ == SPECIAL_TETHERED)
219 specialPosition_ += separation;
222 sitePositions_ = sitePositions_ + separation;
234 sitePositions_.setSize(size);
236 siteForces_.setSize(size);
248 td.switchProcessor =
true;
254 const vector nw = normal();
256 const scalar vn = v_ & nw;
DiagTensor< scalar > diagTensor
DiagTensor of scalars, i.e. DiagTensor<scalar>.
Class to hold molecule constant properties.
void setSitePositions(const constantProperties &constProps)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool hitPatch(moleculeCloud &cloud, trackingData &td)
Overridable function to handle the particle hitting a patch.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
void hitProcessorPatch(moleculeCloud &cloud, trackingData &td)
Overridable function to handle the particle hitting a processorPatch.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
bool move(moleculeCloud &, trackingData &, const scalar trackTime)
#define forAll(list, i)
Loop across all elements in list.
const Field< vector > & siteReferencePositions() const
dimensionedScalar cos(const dimensionedScalar &ds)
A cloud is a registry collection of lagrangian particles.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
errorManip< error > abort(error &err)
void hitWallPatch(moleculeCloud &cloud, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define R(A, B, C, D, E, F, K, M)
Class used to pass tracking data to the trackToFace function.
void setSiteSizes(label size)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Tensor of scalars, i.e. Tensor<scalar>.
static constexpr const zero Zero
Global zero (0)