FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Templated injection model class. More...

#include <lagrangianIntermediate/InjectionModel.H>


Detailed Description

template<class CloudType>
class Foam::InjectionModel< CloudType >

Templated injection model class.

The injection model nominally describes the parcel:

  • position
  • diameter
  • velocity In this case, the fullyDescribed() flag should be set to 0 (false). When the parcel is then added to the cloud, the remaining properties are populated using values supplied in the constant properties.

If, however, all of a parcel's properties are described in the model, the fullDescribed() flag should be set to 1 (true).

Source files

Definition at line 65 of file InjectionModel.H.

Inheritance diagram for InjectionModel< CloudType >:
Collaboration diagram for InjectionModel< CloudType >:

List of all members.

Public Types

enum  parcelBasis { pbNumber, pbMass }
 

Parcel basis representation options.

More...

Public Member Functions

 TypeName ("InjectionModel")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
 Declare runtime constructor selection table.
 InjectionModel (CloudType &owner)
 Construct null from owner.
 InjectionModel (const dictionary &dict, CloudType &owner, const word &type)
 Construct from dictionary.
virtual  ~InjectionModel ()
 Destructor.
const dictionary &  dict () const
 Return the owner cloud dictionary.
const CloudType &  owner () const
 Return const access the owner cloud object.
CloudType &  owner ()
 Return non-const access the owner cloud object for manipulation.
const dictionary &  coeffDict () const
 Return the coefficients dictionary.
virtual bool  active () const =0
 Flag to indicate whether model activates injection model.
scalar  timeStart () const
 Return the start-of-injection time.
scalar  volumeTotal () const
 Return the total volume to be injected across the event.
scalar  massTotal () const
 Return mass of particles to introduce.
scalar  massInjected () const
 Return mass of particles injected (cumulative)
virtual scalar  timeEnd () const =0
 Return the end-of-injection time.
label  nInjections () const
 Return the number of injections.
label  parcelsAddedTotal () const
 Return the total number parcels added.
template<class TrackData >
void  inject (TrackData &td)
 Main injection loop.
virtual void  setPositionAndCell (const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner)=0
 Set the injection position and owner cell.
virtual void  setProperties (const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)=0
 Set the parcel properties.
virtual bool  fullyDescribed () const =0
 Flag to identify whether model fully describes the parcel.

Static Public Member Functions

static autoPtr< InjectionModel
< CloudType > >  
New (const dictionary &dict, CloudType &owner)
 Selector.

Protected Types

typedef CloudType::parcelType  parcelType
 Convenience typedef for parcel type.

Protected Member Functions

virtual label  parcelsToInject (const scalar time0, const scalar time1) const =0
 Number of parcels to introduce over the time step relative to SOI.
virtual scalar  volumeToInject (const scalar time0, const scalar time1) const =0
 Volume of parcels to introduce over the time step relative to SOI.
virtual bool  validInjection (const label parcelI)=0
 Additional flag to identify whether or not injection of parcelI is.
virtual void  prepareForNextTimeStep (const scalar time, label &newParcels, scalar &newVolume)
 Determine properties for next time step/injection interval.
virtual void  findCellAtPosition (label &cellI, vector &position)
 Find the cell that contains the supplied position.
virtual scalar  setNumberOfParticles (const label parcels, const scalar volume, const scalar diameter, const scalar rho)
 Set number of particles to inject given parcel properties.
virtual void  postInjectCheck (const label parcelsAdded, const scalar massAdded)
 Post injection checks.

Protected Attributes

const scalar  SOI_
 Start of injection [s].
scalar  volumeTotal_
 Total volume of particles introduced by this injector [m^3].
scalar  massTotal_
 Total mass to inject [kg].
scalar  massInjected_
 Total mass injected to date [kg].
label  nInjections_
 Number of injections counter.
label  parcelsAddedTotal_
 Running counter of total number of parcels added.
parcelBasis  parcelBasis_
 Parcel basis enumeration.
scalar  time0_
 Continuous phase time at start of injection time step [s].
scalar  timeStep0_
 Time at start of injection time step [s].

Member Typedef Documentation

typedef CloudType::parcelType parcelType [protected]

Convenience typedef for parcel type.

Definition at line 108 of file InjectionModel.H.


Member Enumeration Documentation

Parcel basis representation options.

i.e constant number of particles OR constant mass per parcel

Enumerator:
pbNumber 
pbMass 

Definition at line 73 of file InjectionModel.H.


Constructor & Destructor Documentation

InjectionModel ( CloudType &   owner  )

Construct null from owner.

Definition at line 266 of file InjectionModel.C.

InjectionModel ( const dictionary &   dict,
CloudType &   owner,
const word &   type  
)

Construct from dictionary.

Definition at line 287 of file InjectionModel.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, and Foam::nl.

~InjectionModel (  ) [virtual]

Destructor.

Definition at line 342 of file InjectionModel.C.


Member Function Documentation

void prepareForNextTimeStep ( const scalar   time,
label &   newParcels,
scalar &   newVolume  
) [protected, virtual]

Determine properties for next time step/injection interval.

Definition at line 89 of file InjectionModel.C.

void findCellAtPosition ( label &   cellI,
vector &   position  
) [protected, virtual]

Find the cell that contains the supplied position.

Will modify position slightly towards the owner cell centroid to ensure that it lies in a cell and not edge/face

Definition at line 131 of file InjectionModel.C.

References Foam::abort(), C::C(), Foam::FatalError, FatalErrorIn, Foam::nl, and reduce().

Foam::scalar setNumberOfParticles ( const label   parcels,
const scalar   volume,
const scalar   diameter,
const scalar   rho  
) [protected, virtual]

Set number of particles to inject given parcel properties.

Definition at line 185 of file InjectionModel.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::nl, Foam::mathematicalConstant::pi(), and pow3().

void postInjectCheck ( const label   parcelsAdded,
const scalar   massAdded  
) [protected, virtual]

Post injection checks.

Definition at line 232 of file InjectionModel.C.

References Foam::endl(), Foam::Info, Foam::nl, and Foam::returnReduce().

TypeName ( "InjectionModel< CloudType >"    )

Runtime type information.

declareRunTimeSelectionTable ( autoPtr   ,
InjectionModel< CloudType >   ,
dictionary   ,
(const dictionary &dict, CloudType &owner)   ,
(dict, owner)    
)

Declare runtime constructor selection table.

Foam::autoPtr< Foam::InjectionModel< CloudType > > New ( const dictionary &   dict,
CloudType &   owner  
) [static]
const Foam::dictionary & dict (  ) const [inline]

Return the owner cloud dictionary.

Definition at line 29 of file InjectionModelI.H.

const CloudType & owner (  ) const [inline]

Return const access the owner cloud object.

Definition at line 36 of file InjectionModelI.H.

CloudType & owner (  ) [inline]

Return non-const access the owner cloud object for manipulation.

Definition at line 43 of file InjectionModelI.H.

const Foam::dictionary & coeffDict (  ) const [inline]

Return the coefficients dictionary.

Definition at line 50 of file InjectionModelI.H.

Foam::scalar timeStart (  ) const [inline]

Return the start-of-injection time.

Definition at line 57 of file InjectionModelI.H.

Foam::scalar volumeTotal (  ) const [inline]

Return the total volume to be injected across the event.

Definition at line 64 of file InjectionModelI.H.

Foam::scalar massTotal (  ) const [inline]

Return mass of particles to introduce.

Definition at line 71 of file InjectionModelI.H.

Foam::scalar massInjected (  ) const [inline]

Return mass of particles injected (cumulative)

Definition at line 78 of file InjectionModelI.H.

Foam::label nInjections (  ) const [inline]

Return the number of injections.

Definition at line 85 of file InjectionModelI.H.

Foam::label parcelsAddedTotal (  ) const [inline]

Return the total number parcels added.

Definition at line 92 of file InjectionModelI.H.

void inject ( TrackData &   td  )
virtual void setPositionAndCell ( const label   parcelI,
const label   nParcels,
const scalar   time,
vector &   position,
label &   cellOwner  
) [pure virtual]
virtual void setProperties ( const label   parcelI,
const label   nParcels,
const scalar   time,
typename CloudType::parcelType &   parcel  
) [pure virtual]

Member Data Documentation

const scalar SOI_ [protected]

Start of injection [s].

Definition at line 113 of file InjectionModel.H.

scalar volumeTotal_ [protected]

Total volume of particles introduced by this injector [m^3].

  • scaled to ensure massTotal is achieved

Definition at line 117 of file InjectionModel.H.

scalar massTotal_ [protected]

Total mass to inject [kg].

Definition at line 120 of file InjectionModel.H.

scalar massInjected_ [protected]

Total mass injected to date [kg].

Definition at line 123 of file InjectionModel.H.

label nInjections_ [protected]

Number of injections counter.

Definition at line 129 of file InjectionModel.H.

label parcelsAddedTotal_ [protected]

Running counter of total number of parcels added.

Definition at line 132 of file InjectionModel.H.

Parcel basis enumeration.

Definition at line 138 of file InjectionModel.H.

scalar time0_ [protected]

Continuous phase time at start of injection time step [s].

Definition at line 141 of file InjectionModel.H.

scalar timeStep0_ [protected]

Time at start of injection time step [s].

Definition at line 144 of file InjectionModel.H.


The documentation for this class was generated from the following files:
  • src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H
  • src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
  • src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelI.H
  • src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/NewInjectionModel.C