39 template<
class TrackData>
47 facei_ = mesh_.boundaryMesh()[
patchi].whichFace(facei_);
51 template<
class TrackData>
59 refCast<const coupledPolyPatch>(mesh_.boundaryMesh()[
patchi]);
69 transformProperties(T);
79 transformProperties(-s);
84 facei_ += ppp.
start();
89 tetPti_ = mesh_.faces()[tetFacei_].size() - 1 - tetPti_;
103 template<
class CloudType>
106 bool valid = c.
size();
126 p.origProc_ = origProcId[i];
133 template<
class CloudType>
156 origId[i] = iter().origId_;
165 template<
class TrackData>
168 const vector& displacement,
169 const scalar fraction,
183 typedef typename TrackData::cloudType::particleType particleType;
184 particleType&
p =
static_cast<particleType&
>(*this);
192 label origFacei = facei_;
198 const tetIndices faceHitTetIs(celli_, tetFacei_, tetPti_);
213 if (facei_ != origFacei)
220 if (isA<wedgePolyPatch>(patch))
224 static_cast<const wedgePolyPatch&>(patch), td
227 else if (isA<symmetryPlanePolyPatch>(patch))
229 p.hitSymmetryPlanePatch
231 static_cast<const symmetryPlanePolyPatch&>(patch), td
234 else if (isA<symmetryPolyPatch>(patch))
238 static_cast<const symmetryPolyPatch&>(patch), td
241 else if (isA<cyclicPolyPatch>(patch))
245 static_cast<const cyclicPolyPatch&>(patch), td
248 else if (isA<cyclicAMIPolyPatch>(patch))
252 static_cast<const cyclicAMIPolyPatch&>(patch),
257 else if (isA<processorPolyPatch>(patch))
261 static_cast<const processorPolyPatch&>(patch), td
264 else if (isA<wallPolyPatch>(patch))
268 static_cast<const wallPolyPatch&>(patch), td, faceHitTetIs
273 p.hitPatch(patch, td);
280 template<
class TrackData>
285 template<
class TrackData>
299 template<
class TrackData>
307 <<
"Hitting a wedge patch should not be possible." 317 template<
class TrackData>
331 template<
class TrackData>
345 template<
class TrackData>
359 tetPti_ = mesh_.
faces()[tetFacei_].
size() - 1 - tetPti_;
371 : receiveCpp.
forwardT()[receiveFacei]
388 template<
class TrackData>
400 const label receiveFacei = cpp.
pointFace(sendFacei, direction, pos);
402 if (receiveFacei < 0)
406 td.keepParticle =
false;
408 <<
"Particle lost across " << cyclicAMIPolyPatch::typeName
409 <<
" patches " << cpp.
name() <<
" and " << receiveCpp.
name()
410 <<
" at position " << pos <<
endl;
414 facei_ = tetFacei_ = receiveFacei + receiveCpp.
start();
425 "Particle crossed between " + cyclicAMIPolyPatch::typeName +
426 " patches " + cpp.
name() +
" and " + receiveCpp.
name() +
427 " to a location outside of the mesh." 441 : receiveCpp.
forwardT()[receiveFacei]
458 template<
class TrackData>
463 template<
class TrackData>
473 template<
class TrackData>
Symmetry patch for non-planar or multi-plane patches.
void hitSymmetryPlanePatch(const symmetryPlanePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label origProc() const
Return the originating processor ID.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
void prepareForParallelTransfer(const label patchi, TrackData &td)
Convert global addressing to the processor patch.
virtual bool separated() const
Are the planes separated.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void hitWallPatch(const wallPolyPatch &, TrackData &td, const tetIndices &tetIs)
Overridable function to handle the particle hitting a wallPatch.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but also stops on internal faces.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
virtual void reverseTransformDirection(vector &d, const label facei) const
Transform a patch-based direction from this side to nbr side.
static void readFields(CloudType &c)
Read the fields associated with the owner cloud.
virtual void transformProperties(const tensor &T)
Transform the physical properties of the particle.
bool hitPatch(const polyPatch &, TrackData &td, const label patchi, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a.
void hitCyclicAMIPatch(const cyclicAMIPolyPatch &, TrackData &td, const vector &direction)
Overridable function to handle the particle hitting a cyclicAMIPatch.
virtual const vectorField & separation() const
If the planes are separated the separation vector.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Neighbour processor patch.
vector normal() const
Return the normal of the tri on tetFacei_ for the.
virtual bool parallel() const
Are the cyclic planes parallel.
dimensionedScalar pos(const dimensionedScalar &ds)
void hitProcessorPatch(const processorPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
static void writeFields(const CloudType &c)
Write the fields associated with the owner cloud.
const labelUList & faceCells() const
Return face-cell addressing.
static const Identity< scalar > I
Wedge front and back plane patch.
virtual const labelList & faceOwner() const
Return face owner.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
Cyclic patch for Arbitrary Mesh Interface (AMI)
virtual const faceList & faces() const
Return raw faces.
void hitWedgePatch(const wedgePolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a wedgePatch.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
void hitFace(TrackData &td)
Overridable function to handle the particle hitting a face.
label origId() const
Return the particle ID on the originating processor.
virtual bool write(const bool valid=true) const
Write using setting from DB.
bool onFace() const
Is the particle on a face?
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar stepFraction() const
Return the fraction of time-step completed.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual const cyclicAMIPolyPatch & neighbPatch() const
Return a reference to the neighbour patch.
const dimensionedScalar c
Speed of light in a vacuum.
label start() const
Return start label of this patch in the polyMesh face list.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
dimensioned< scalar > mag(const dimensioned< Type > &)
bool onInternalFace() const
Is the particle on an internal face?
void correctAfterParallelTransfer(const label patchi, TrackData &td)
Convert processor patch addressing to the global equivalents.
label transformGlobalFace(const label facei) const
Helper IO class to read and write particle positions.
const cyclicPolyPatch & neighbPatch() const
A patch is a list of labels that address the faces in the global face list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
A primitive field of type <T> with automated input and output.
vector position() const
Return current particle position.
void hitCyclicPatch(const cyclicPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a cyclicPatch.
label pointFace(const label facei, const vector &n, point &p) const
Return face index on neighbour patch which shares point p.
label patch() const
Return the index of patch that the particle is on.
void hitSymmetryPatch(const symmetryPolyPatch &, TrackData &td)
Overridable function to handle the particle hitting a.
label whichFace(const label l) const
Return label of face in patch from global face label.