Go to the documentation of this file.
40 const vector& targetPosition,
44 const label transmissiveId
47 particle(
mesh, position, cellI),
53 transmissiveId_(transmissiveId)
65 const vector& targetPosition,
68 const label transmissiveId
77 transmissiveId_(transmissiveId)
89 transmissiveId_(
p.transmissiveId_)
96 Cloud<DTRMParticle>& spc,
98 const scalar trackTime
101 td.switchProcessor =
false;
102 td.keepParticle =
true;
108 const label cell1 =
cell();
117 scalar ds =
mag(dsv);
138 label reflectedZoneId = td.relfectedCells()[cell1];
142 (reflectedZoneId > -1)
144 (transmissiveId_ == -1)
145 || (transmissiveId_ != reflectedZoneId)
153 if (I_ > 0.01*I0_ && ds > 0)
158 vector nHat = td.nHatInterp().interpolate(cpw);
160 nHat /= (
mag(nHat) + ROOTSMALL);
161 scalar cosTheta(-pDir & nHat);
164 if (cosTheta > SMALL)
169 td.relfectedCells()[cell1]
180 td.relfectedCells()[cell1]
188 scalar delaM =
cbrt(
mesh().cellVolumes()[cell1]);
199 insertP + newDir*
mesh().bounds().
mag(),
207 spc.addParticle(pPtr);
213 transmissiveId_ = reflectedZoneId;
215 scalar a = td.aInterp().interpolate(
pos0, cell1);
216 scalar
e = td.eInterp().interpolate(
pos0, cell1);
217 scalar E = td.EInterp().interpolate(
pos0, cell1);
218 scalar
T = td.TInterp().interpolate(
pos0, cell1);
222 const scalar Itran = I_*(1.0 -
rho);
229 td.Q(cell1) += (Itran -
max(I1, 0.0))*dA_;
241 scalar a = td.aInterp().interpolate(
pos0, cell1);
242 scalar
e = td.eInterp().interpolate(
pos0, cell1);
243 scalar E = td.EInterp().interpolate(
pos0, cell1);
244 scalar
T = td.TInterp().interpolate(
pos0, cell1);
252 td.Q(cell1) += (I_ -
max(I1, 0.0))*dA_;
256 if ((I_ <= 0.01*I0_))
263 }
while (td.keepParticle && !td.switchProcessor &&
stepFraction() < 1);
265 return td.keepParticle;
271 Cloud<DTRMParticle>&,
275 td.switchProcessor =
true;
281 Cloud<DTRMParticle>&,
285 td.keepParticle =
false;
291 Cloud<DTRMParticle>&,
const point & p1() const
Return const access to the target position.
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))
void hitWallPatch(Cloud< DTRMParticle > &, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
scalar stepFraction() const
Return the fraction of time-step completed.
Different types of constants.
void hitProcessorPatch(Cloud< DTRMParticle > &, trackingData &td)
Overridable function to handle the particle hitting a processorPatch.
DTRMParticle(const polyMesh &mesh, const vector &position, const vector &targetPosition, const scalar I, const label cellI, const scalar dA, const label transmissiveId)
Construct from components, with searching for tetFace and.
tetIndices currentTetIndices() const
Return the indices of the current tet that the.
dimensionedScalar pos0(const dimensionedScalar &ds)
bool move(Cloud< DTRMParticle > &, trackingData &, const scalar)
Move.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar pow4(const dimensionedScalar &ds)
void trackToAndHitFace(const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
const point & p0() const
Return const access to the initial position.
PtrList< coordinateSystem > coordinates(solidRegions.size())
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
vector position() const
Return current particle position.
bool hitPatch(Cloud< DTRMParticle > &, trackingData &td)
const polyMesh & mesh() const
Return the mesh database.
vector deviationFromMeshCentre() const
Get the displacement from the mesh centre. Used to correct the.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Vector< scalar > vector
A scalar version of the templated Vector.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
constexpr scalar pi(M_PI)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar e
Elementary charge.
label cell() const
Return current cell particle is in.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
vector point
Point is a vector.
dimensionedScalar cbrt(const dimensionedScalar &ds)
label face() const
Return current face particle is on otherwise -1.
static const Identity< scalar > I