OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

Particle< ParticleType > Class Template Reference

Inheritance diagram for Particle< ParticleType >:
Collaboration diagram for Particle< ParticleType >:

List of all members.


Classes

class  iNew
 Factory class to read-construct particles used for. More...
class  trackData
 Class used to pass tracking data to the trackToFace function. More...

Public Member Functions

 TypeName ("Particle")
 Runtime type information.
 Particle (const Cloud< ParticleType > &, const vector &position, const label celli)
 Construct from components.
 Particle (const Cloud< ParticleType > &, Istream &, bool readFields=true)
 Construct from Istream.
 Particle (const Particle &p)
 Construct as a copy.
autoPtr< ParticleType > clone () const
 Construct a clone.
virtual ~Particle ()
 Destructor.
bool inCell () const
 Return true if particle is in cell.
bool inCell (const vector &position, const label celli, const scalar stepFraction) const
 Return true if position is in cell i.
const vectorposition () const
 Return current particle position.
vectorposition ()
 Return current particle position.
labelcell ()
 Return current cell particle is in.
label cell () const
 Return current cell particle is in.
label face () const
 Return current face particle is on otherwise -1.
const Cloud< ParticleType > & cloud () const
 Return reference to the particle cloud.
bool softImpact () const
 Return the impact model to be used, soft or hard (default).
scalar currentTime () const
 Return the particle current time.
bool onBoundary () const
 Is the particle on the boundary/(or outside the domain)?
label patch (const label facei) const
 Which patch is particle on.
label patchFace (const label patchi, const label facei) const
 Which face of this patch is this particle on.
scalar wallImpactDistance (const vector &n) const
 The nearest distance to a wall that.
scalarstepFraction ()
 Return the fraction of time-step completed.
scalar stepFraction () const
 Return the fraction of time-step completed.
label origProc () const
 Return the originating processor id.
label origId () const
 Return the particle id on originating processor.
template<class TrackData >
label track (const vector &endPosition, TrackData &td)
 Track particle to end of trajectory.
label track (const vector &endPosition)
 Calls the templated track with dummy TrackData.
template<class TrackData >
scalar trackToFace (const vector &endPosition, TrackData &td)
 Track particle to a given position and returns 1.0 if the.
scalar trackToFace (const vector &endPosition)
 Calls the templated trackToFace with dummy TrackData.
label faceInterpolation () const
 Return the index of the face to be used in the interpolation.
void write (Ostream &os, bool writeFields) const
 Write the particle data.

Static Public Member Functions

static void readFields (Cloud< ParticleType > &c)
 Read the fields associated with the owner cloud.
static void writeFields (const Cloud< ParticleType > &c)
 Write the fields associated with the owner cloud.

Static Public Attributes

static string propHeader
 String representation of properties.

Protected Member Functions

scalar lambda (const vector &from, const vector &to, const label facei, const scalar stepFraction) const
 Return the 'lambda' value for the position, p, on the face,.
scalar lambda (const vector &from, const vector &to, const label facei) const
 Return the 'lambda' value for the position, p, on the face,.
void findFaces (const vector &position, DynamicList< label > &faceList) const
 Find the faces between position and cell centre.
void findFaces (const vector &position, const label celli, const scalar stepFraction, DynamicList< label > &faceList) const
 Find the faces between position and cell centre.
template<class TrackData >
bool hitPatch (const polyPatch &, TrackData &td, const label patchI)
 Overridable function to handle the particle hitting a patch.
template<class TrackData >
void hitWedgePatch (const wedgePolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a wedgePatch.
template<class TrackData >
void hitSymmetryPatch (const symmetryPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a.
template<class TrackData >
void hitCyclicPatch (const cyclicPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a cyclicPatch.
template<class TrackData >
void hitProcessorPatch (const processorPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a.
template<class TrackData >
void hitWallPatch (const wallPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a wallPatch.
template<class TrackData >
void hitPatch (const polyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a.
virtual void transformPosition (const tensor &T)
 Transform the position the particle.
virtual void transformProperties (const tensor &T)
 Transform the physical properties of the particle.
virtual void transformProperties (const vector &separation)
 Transform the physical properties of the particle.
template<class TrackData >
void prepareForParallelTransfer (const label patchi, TrackData &td)
 Convert global addressing to the processor patch.
template<class TrackData >
void correctAfterParallelTransfer (const label patchi, TrackData &td)
 Convert processor patch addressing to the global equivalents.

Protected Attributes

const Cloud< ParticleType > & cloud_
 Reference to the particle cloud.
vector position_
 Position of particle.
label celli_
 Index of the cell it is in.
label facei_
 Face index if the particle is on a face otherwise -1.
scalar stepFraction_
 Fraction of time-step completed.
label origProc_
 Originating processor id.
label origId_
 Local particle id on originating processor.

Friends

class Cloud< ParticleType >
Ostreamoperator (Ostream &, const Particle< ParticleType > &)

Detailed Description

template<class ParticleType>
class Foam::Particle< ParticleType >

Definition at line 67 of file Particle.H.


Constructor & Destructor Documentation

Particle ( const Cloud< ParticleType > &  cloud,
const vector position,
const label  celli 
) [inline]

Construct from components.

Definition at line 160 of file Particle.C.

Particle ( const Particle< ParticleType > &  p  ) 

Construct as a copy.

virtual ~Particle (  )  [inline, virtual]

Destructor.

Definition at line 359 of file Particle.H.


Member Function Documentation

Foam::scalar lambda ( const vector from,
const vector to,
const label  facei,
const scalar  stepFraction 
) const [inline, protected]

Return the 'lambda' value for the position, p, on the face,.

where, p = from + lamda*(to - from) for non-static meshes

Definition at line 24 of file ParticleI.H.

References b, beta(), primitiveMesh::cellCentres(), cp, primitiveMesh::faceAreas(), primitiveMesh::faceCentres(), polyMesh::faces(), Foam::mag(), mesh, polyMesh::moving(), polyMesh::oldPoints(), and Foam::sqrt().

Here is the call graph for this function:

Foam::scalar lambda ( const vector from,
const vector to,
const label  facei 
) const [inline, protected]

Return the 'lambda' value for the position, p, on the face,.

where, p = from + lamda*(to - from) for static meshes

Definition at line 172 of file ParticleI.H.

void findFaces ( const vector position,
DynamicList< label > &  faceList 
) const [inline, protected]

Find the faces between position and cell centre.

Definition at line 31 of file Particle.C.

References primitiveMesh::cellCentres(), primitiveMesh::cells(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::clear(), forAll, and mesh.

Here is the call graph for this function:

void findFaces ( const vector position,
const label  celli,
const scalar  stepFraction,
DynamicList< label > &  faceList 
) const [inline, protected]

Find the faces between position and cell centre.

Definition at line 56 of file Particle.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append().

Here is the call graph for this function:

bool hitPatch ( const polyPatch ,
TrackData &  td,
const label  patchI 
) [inline, protected]

void hitWedgePatch ( const wedgePolyPatch wpp,
TrackData &  td 
) [inline, protected]

Overridable function to handle the particle hitting a wedgePatch.

Definition at line 434 of file Particle.C.

void hitSymmetryPatch ( const symmetryPolyPatch spp,
TrackData &  td 
) [inline, protected]

Overridable function to handle the particle hitting a.

symmetryPatch

Definition at line 449 of file Particle.C.

void hitCyclicPatch ( const cyclicPolyPatch cpp,
TrackData &  td 
) [inline, protected]

Overridable function to handle the particle hitting a cyclicPatch.

Definition at line 464 of file Particle.C.

void transformPosition ( const tensor T  )  [inline, protected, virtual]

Transform the position the particle.

according to the given transformation tensor

Definition at line 402 of file Particle.C.

void transformProperties ( const tensor T  )  [inline, protected, virtual]

void prepareForParallelTransfer ( const label  patchi,
TrackData &  td 
) [inline, protected]

Convert global addressing to the processor patch.

local equivalents

Definition at line 84 of file Particle.C.

void correctAfterParallelTransfer ( const label  patchi,
TrackData &  td 
) [inline, protected]

Convert processor patch addressing to the global equivalents.

and set the celli to the face-neighbour

Definition at line 97 of file Particle.C.

TypeName ( "Particle< ParticleType >"   ) 

Runtime type information.

bool inCell (  )  const [inline]

Return true if particle is in cell.

Definition at line 223 of file ParticleI.H.

bool inCell ( const vector position,
const label  celli,
const scalar  stepFraction 
) const [inline]

Return true if position is in cell i.

Definition at line 234 of file ParticleI.H.

const Foam::vector & position (  )  const [inline]

Return current particle position.

Definition at line 278 of file ParticleI.H.

References Particle< ParticleType >::cloud_.

Foam::vector & position (  )  [inline]

Return current particle position.

Definition at line 285 of file ParticleI.H.

References Particle< ParticleType >::position_.

Foam::label & cell (  )  [inline]

Return current cell particle is in.

Definition at line 299 of file ParticleI.H.

References Particle< ParticleType >::celli_.

Foam::label cell (  )  const [inline]

Return current cell particle is in.

Definition at line 292 of file ParticleI.H.

References Particle< ParticleType >::position_.

Foam::label face (  )  const [inline]

Return current face particle is on otherwise -1.

Definition at line 306 of file ParticleI.H.

References Particle< ParticleType >::celli_.

const Foam::Cloud< ParticleType > & cloud (  )  const [inline]

Return reference to the particle cloud.

Definition at line 271 of file ParticleI.H.

bool softImpact (  )  const [inline]

Return the impact model to be used, soft or hard (default).

Definition at line 348 of file ParticleI.H.

References Particle< ParticleType >::origId_.

Foam::scalar currentTime (  )  const [inline]

Return the particle current time.

Definition at line 355 of file ParticleI.H.

bool onBoundary (  )  const [inline]

Is the particle on the boundary/(or outside the domain)?

Definition at line 313 of file ParticleI.H.

References Particle< ParticleType >::facei_.

Foam::label patch ( const label  facei  )  const [inline]

Which patch is particle on.

Definition at line 364 of file ParticleI.H.

References Particle< ParticleType >::cloud_, and Particle< ParticleType >::stepFraction_.

Foam::label patchFace ( const label  patchi,
const label  facei 
) const [inline]

Which face of this patch is this particle on.

Definition at line 372 of file ParticleI.H.

References Particle< ParticleType >::cloud_.

Foam::scalar & stepFraction (  )  [inline]

Return the fraction of time-step completed.

Definition at line 320 of file ParticleI.H.

References Particle< ParticleType >::cloud_, and Particle< ParticleType >::facei_.

Referenced by spray::inject().

Here is the caller graph for this function:

Foam::scalar stepFraction (  )  const [inline]

Return the fraction of time-step completed.

Definition at line 327 of file ParticleI.H.

References Particle< ParticleType >::stepFraction_.

Foam::label origProc (  )  const [inline]

Return the originating processor id.

Definition at line 334 of file ParticleI.H.

References Particle< ParticleType >::stepFraction_.

Foam::label origId (  )  const [inline]

Return the particle id on originating processor.

Definition at line 341 of file ParticleI.H.

References Particle< ParticleType >::origProc_.

Foam::label track ( const vector endPosition,
TrackData &  td 
) [inline]

Track particle to end of trajectory.

or until it hits the boundary. On entry 'stepFraction()' should be set to the fraction of the time-step at which the tracking starts and on exit it contains the fraction of the time-step completed. Returns the boundary face index if the track stops at the boundary, -1 otherwise.

Definition at line 194 of file Particle.C.

Referenced by Particle< ParticleType >::trackToFace().

Here is the caller graph for this function:

Foam::label track ( const vector endPosition  )  [inline]

Calls the templated track with dummy TrackData.

Reimplemented in ExactParticle< ParticleType >, and ExactParticle< trackedParticle >.

Definition at line 213 of file Particle.C.

Foam::scalar trackToFace ( const vector endPosition,
TrackData &  td 
) [inline]

Track particle to a given position and returns 1.0 if the.

trajectory is completed without hitting a face otherwise stops at the face and returns the fraction of the trajectory completed. on entry 'stepFraction()' should be set to the fraction of the time-step at which the tracking starts.

Definition at line 222 of file Particle.C.

References Particle< ParticleType >::track().

Here is the call graph for this function:

Foam::scalar trackToFace ( const vector endPosition  )  [inline]

Calls the templated trackToFace with dummy TrackData.

Reimplemented in ExactParticle< ParticleType >, and ExactParticle< trackedParticle >.

Definition at line 393 of file Particle.C.

References primitiveMesh::cellCentres(), and Particle< ParticleType >::position_.

Here is the call graph for this function:

void readFields ( Cloud< ParticleType > &  c  )  [inline, static]

Read the fields associated with the owner cloud.

Reimplemented in parcel, and solidParticle.

Definition at line 101 of file ParticleIO.C.

void writeFields ( const Cloud< ParticleType > &  c  )  [inline, static]

Write the fields associated with the owner cloud.

Reimplemented in parcel, and solidParticle.

Definition at line 134 of file ParticleIO.C.

void write ( Ostream os,
bool  writeFields 
) const [inline]

Write the particle data.

Definition at line 169 of file ParticleIO.C.


Friends And Related Function Documentation

friend class Cloud< ParticleType > [friend]

Reimplemented in ExactParticle< ParticleType >, and ExactParticle< trackedParticle >.

Definition at line 284 of file Particle.H.

Ostream& operator ( Ostream ,
const Particle< ParticleType > &   
) [friend]


Member Data Documentation

label celli_ [protected]

Index of the cell it is in.

Definition at line 113 of file Particle.H.

Referenced by Particle< ParticleType >::cell(), Particle< ParticleType >::face(), and Particle< ParticleType >::Particle().

label facei_ [protected]

Face index if the particle is on a face otherwise -1.

Definition at line 116 of file Particle.H.

Referenced by Particle< ParticleType >::onBoundary(), Particle< ParticleType >::Particle(), and Particle< ParticleType >::stepFraction().

label origProc_ [protected]

Originating processor id.

Definition at line 122 of file Particle.H.

Referenced by Particle< ParticleType >::origId(), and Particle< ParticleType >::Particle().

label origId_ [protected]

Local particle id on originating processor.

Definition at line 125 of file Particle.H.

Referenced by Particle< ParticleType >::Particle(), and Particle< ParticleType >::softImpact().


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd