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();
116 scalar ds =
mag(dsv);
137 label reflectedZoneId = td.relfectedCells()[cell1];
141 (reflectedZoneId > -1)
143 (transmissiveId_ == -1)
144 || (transmissiveId_ != reflectedZoneId)
152 if (I_ > 0.01*I0_ && ds > 0)
157 vector nHat = td.nHatInterp().interpolate(cpw);
159 nHat /= (
mag(nHat) + ROOTSMALL);
160 scalar cosTheta(-pDir & nHat);
163 if (cosTheta > SMALL)
168 td.relfectedCells()[cell1]
179 td.relfectedCells()[cell1]
187 scalar delaM =
cbrt(
mesh().cellVolumes()[cell1]);
198 insertP + newDir*
mesh().bounds().
mag(),
206 spc.addParticle(pPtr);
212 transmissiveId_ = reflectedZoneId;
214 scalar a = td.aInterp().interpolate(
pos0, cell1);
215 scalar
e = td.eInterp().interpolate(
pos0, cell1);
216 scalar E = td.EInterp().interpolate(
pos0, cell1);
217 scalar
T = td.TInterp().interpolate(
pos0, cell1);
221 const scalar Itran = I_*(1.0 -
rho);
228 td.Q(cell1) += (Itran -
max(I1, 0.0))*dA_;
240 scalar a = td.aInterp().interpolate(
pos0, cell1);
241 scalar
e = td.eInterp().interpolate(
pos0, cell1);
242 scalar E = td.EInterp().interpolate(
pos0, cell1);
243 scalar
T = td.TInterp().interpolate(
pos0, cell1);
251 td.Q(cell1) += (I_ -
max(I1, 0.0))*dA_;
255 if ((I_ <= 0.01*I0_))
262 }
while (td.keepParticle && !td.switchProcessor &&
stepFraction() < 1);
264 return td.keepParticle;
270 Cloud<DTRMParticle>&,
274 td.switchProcessor =
true;
280 Cloud<DTRMParticle>&,
284 td.keepParticle =
false;
290 Cloud<DTRMParticle>&,
Different types of constants.
void hitProcessorPatch(Cloud< DTRMParticle > &, trackingData &td)
Overridable function to handle the particle hitting a processorPatch.
vector deviationFromMeshCentre() const
Get the displacement from the mesh centre. Used to correct the.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool move(Cloud< DTRMParticle > &, trackingData &, const scalar)
Move.
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.
void hitWallPatch(Cloud< DTRMParticle > &, trackingData &td)
Overridable function to handle the particle hitting a wallPatch.
const point & p1() const noexcept
Return const access to the target position.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
const dimensionedScalar e
Elementary charge.
static const Identity< scalar > I
dimensionedScalar cbrt(const dimensionedScalar &ds)
bool hitPatch(Cloud< DTRMParticle > &, trackingData &td)
constexpr scalar pi(M_PI)
const point & p0() const noexcept
Return const access to the initial position.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
scalar stepFraction() const noexcept
Return the fraction of time-step completed.
dimensionedScalar pos0(const dimensionedScalar &ds)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label cell() const noexcept
Return current cell particle is in.
const polyMesh & mesh() const noexcept
Return the mesh database.
PtrList< coordinateSystem > coordinates(solidRegions.size())
vector point
Point is a vector.
dimensionedScalar pow4(const dimensionedScalar &ds)
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
void trackToAndHitFace(const vector &direction, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
label face() const noexcept
Return current face particle is on otherwise -1.
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))
vector position() const
Return current particle position.