FreeFOAM The Cross-Platform CFD Toolkit
DsmcParcel< ParcelType > Class Template Reference

DSMC parcel class. More...

#include <dsmc/DsmcParcel_.H>


Detailed Description

template<class ParcelType>
class Foam::DsmcParcel< ParcelType >

DSMC parcel class.

Source files

Definition at line 69 of file DsmcParcel_.H.

+ Inheritance diagram for DsmcParcel< ParcelType >:
+ Collaboration diagram for DsmcParcel< ParcelType >:

List of all members.

Classes

class  constantProperties
 Class to hold DSMC particle constant properties. More...
class  trackData
 Class used to pass kinematic tracking data to the trackToFace function. More...

Public Member Functions

 TypeName ("DsmcParcel")
 Runtime type information.
 DsmcParcel (DsmcCloud< ParcelType > &owner, const vector &position, const vector &U, const scalar Ei, const label celli, const label typeId)
 Construct from components.
 DsmcParcel (const Cloud< ParcelType > &c, Istream &is, bool readFields=true)
 Construct from Istream.
autoPtr< ParcelType > clone () const
 Construct and return a clone.
label typeId () const
 Return type id.
const vectorU () const
 Return const access to velocity.
scalar Ei () const
 Return const access to internal energy.
vectorU ()
 Return access to velocity.
scalar & Ei ()
 Return access to internal energy.
template<class TrackData >
bool move (TrackData &td)
 Move the parcel.
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 hitProcessorPatch (const processorPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a.
void hitProcessorPatch (const processorPolyPatch &, int &)
 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.
void hitWallPatch (const wallPolyPatch &, int &)
 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 polyPatch.
void hitPatch (const polyPatch &, int &)
void transformProperties (const tensor &T)
 Transform the physical properties of the particle.
void transformProperties (const vector &separation)
 Transform the physical properties of the particle.
- Public Member Functions inherited from Particle< ParcelType >
 TypeName ("Particle")
 Runtime type information.
 Particle (const Cloud< ParcelType > &, const vector &position, const label celli)
 Construct from components.
 Particle (const Cloud< ParcelType > &, Istream &, bool readFields=true)
 Construct from Istream.
 Particle (const Particle &p)
 Construct as a copy.
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.
label & cell ()
 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< ParcelType > & 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.
scalar & stepFraction ()
 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.
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.
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< ParcelType > &c)
 Read the fields associated with the owner cloud.
static void writeFields (const Cloud< ParcelType > &c)
 Write the fields associated with the owner cloud.

Protected Attributes

vector U_
 Velocity of Parcel [m/s].
scalar Ei_
 Internal energy of the Parcel, covering all non-translational.
label typeId_
 Parcel type id.
- Protected Attributes inherited from Particle< ParcelType >
const Cloud< ParcelType > & 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< ParcelType >
Ostreamoperator (Ostream &, const DsmcParcel< ParcelType > &)

Additional Inherited Members

- Static Public Attributes inherited from Particle< ParcelType >
static string propHeader
 String representation of properties.
- Protected Member Functions inherited from Particle< ParcelType >
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.
void hitWedgePatch (const wedgePolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a wedgePatch.
void hitSymmetryPatch (const symmetryPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a.
void hitCyclicPatch (const cyclicPolyPatch &, TrackData &td)
 Overridable function to handle the particle hitting a cyclicPatch.
virtual void transformPosition (const tensor &T)
 Transform the position the particle.
void prepareForParallelTransfer (const label patchi, TrackData &td)
 Convert global addressing to the processor patch.
void correctAfterParallelTransfer (const label patchi, TrackData &td)
 Convert processor patch addressing to the global equivalents.

Constructor & Destructor Documentation

DsmcParcel ( DsmcCloud< ParcelType > &  owner,
const vector position,
const vector U,
const scalar  Ei,
const label  celli,
const label  typeId 
)
inline

Construct from components.

Definition at line 67 of file DsmcParcelI_.H.

DsmcParcel ( const Cloud< ParcelType > &  c,
Istream is,
bool  readFields = true 
)

Construct from Istream.

Definition at line 35 of file DsmcParcelIO.C.

References readScalar.


Member Function Documentation

TypeName ( "DsmcParcel< ParcelType >"  )

Runtime type information.

autoPtr<ParcelType> clone ( ) const
inline

Construct and return a clone.

Reimplemented from Particle< ParcelType >.

Reimplemented in dsmcParcel.

Definition at line 201 of file DsmcParcel_.H.

Foam::label typeId ( ) const
inline

Return type id.

Definition at line 139 of file DsmcParcelI_.H.

References DsmcParcel< ParcelType >::typeId_.

Referenced by DsmcParcel< ParcelType >::writeFields().

const Foam::vector & U ( ) const
inline

Return const access to velocity.

Definition at line 146 of file DsmcParcelI_.H.

References DsmcParcel< ParcelType >::U_.

Referenced by DsmcParcel< ParcelType >::writeFields().

Foam::scalar Ei ( ) const
inline

Return const access to internal energy.

Definition at line 153 of file DsmcParcelI_.H.

References DsmcParcel< ParcelType >::Ei_.

Referenced by DsmcParcel< ParcelType >::writeFields().

Foam::vector & U ( )
inline

Return access to velocity.

Definition at line 160 of file DsmcParcelI_.H.

References DsmcParcel< ParcelType >::U_.

Foam::scalar & Ei ( )
inline

Return access to internal energy.

Definition at line 167 of file DsmcParcelI_.H.

References DsmcParcel< ParcelType >::Ei_.

bool hitPatch ( const polyPatch ,
TrackData &  td,
const label  patchI 
)

Overridable function to handle the particle hitting a patch.

Executed before other patch-hitting functions

Reimplemented from Particle< ParcelType >.

Definition at line 92 of file DsmcParcel_.C.

void hitProcessorPatch ( const processorPolyPatch ,
TrackData &  td 
)

Overridable function to handle the particle hitting a.

processorPatch

Reimplemented from Particle< ParcelType >.

Definition at line 105 of file DsmcParcel_.C.

void hitProcessorPatch ( const processorPolyPatch ,
int &   
)

Overridable function to handle the particle hitting a.

processorPatch without trackData

Definition at line 116 of file DsmcParcel_.C.

void hitWallPatch ( const wallPolyPatch wpp,
TrackData &  td 
)

Overridable function to handle the particle hitting a wallPatch.

Reimplemented from Particle< ParcelType >.

Definition at line 126 of file DsmcParcel_.C.

References polyPatch::faceAreas(), patchIdentifier::index(), Foam::mag(), DsmcParcel< ParcelType >::constantProperties::mass(), Foam::max(), and polyPatch::whichFace().

void hitWallPatch ( const wallPolyPatch ,
int &   
)

Overridable function to handle the particle hitting a wallPatch.

without trackData

Definition at line 220 of file DsmcParcel_.C.

void hitPatch ( const polyPatch ,
TrackData &  td 
)

Overridable function to handle the particle hitting a polyPatch.

Reimplemented from Particle< ParcelType >.

Definition at line 230 of file DsmcParcel_.C.

void hitPatch ( const polyPatch ,
int &   
)

Overridable function to handle the particle hitting a polyPatch without trackData

Definition at line 241 of file DsmcParcel_.C.

void transformProperties ( const tensor T)
virtual

Transform the physical properties of the particle.

according to the given transformation tensor

Reimplemented from Particle< ParcelType >.

Definition at line 250 of file DsmcParcel_.C.

References Foam::transform().

void transformProperties ( const vector separation)
virtual

Transform the physical properties of the particle.

according to the given separation vector

Reimplemented from Particle< ParcelType >.

Definition at line 261 of file DsmcParcel_.C.

void readFields ( Cloud< ParcelType > &  c)
static

Read the fields associated with the owner cloud.

Reimplemented from Particle< ParcelType >.

Definition at line 76 of file DsmcParcelIO.C.

References Cloud< ParticleType >::checkFieldIOobject(), Cloud< ParticleType >::fieldIOobject(), forAllIter, p, Foam::readFields(), Cloud< ParticleType >::size(), and U.

void writeFields ( const Cloud< ParcelType > &  c)
static

Friends And Related Function Documentation

friend class Cloud< ParcelType >
friend

Definition at line 176 of file DsmcParcel_.H.

Ostream& operator ( Ostream ,
const DsmcParcel< ParcelType > &   
)
friend

Member Data Documentation

vector U_
protected

Velocity of Parcel [m/s].

Definition at line 161 of file DsmcParcel_.H.

Referenced by DsmcParcel< ParcelType >::U().

scalar Ei_
protected

Internal energy of the Parcel, covering all non-translational.

degrees of freedom [J]

Definition at line 165 of file DsmcParcel_.H.

Referenced by DsmcParcel< ParcelType >::Ei().

label typeId_
protected

Parcel type id.

Definition at line 168 of file DsmcParcel_.H.

Referenced by DsmcParcel< ParcelType >::typeId().


The documentation for this class was generated from the following files: