InjectionModel< CloudType > Class Template Referenceabstract

Templated injection model class. More...

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

Public Types

enum  parcelBasis { pbNumber, pbMass, pbFixed }
 Parcel basis representation options. More...
 
typedef CloudType::parcelType parcelType
 Convenience typedef for parcelType. More...
 
- Public Types inherited from CloudSubModelBase< CloudType >
typedef CloudType cloudType
 Type of cloud this model was instantiated for. More...
 

Public Member Functions

 TypeName ("injectionModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner, const word &modelType),(dict, owner, modelType))
 Declare runtime constructor selection table. More...
 
 InjectionModel (CloudType &owner)
 Construct null from owner. More...
 
 InjectionModel (const dictionary &dict, CloudType &owner, const word &modelName, const word &modelType)
 Construct from dictionary. More...
 
 InjectionModel (const InjectionModel< CloudType > &im)
 Construct copy. More...
 
virtual autoPtr< InjectionModel< CloudType > > clone () const =0
 Construct and return a clone. More...
 
virtual ~InjectionModel ()
 Destructor. More...
 
virtual void updateMesh ()
 Update mesh. More...
 
scalar timeStart () const
 Return the start-of-injection time. More...
 
scalar volumeTotal () const
 Return the total volume to be injected across the event. More...
 
scalar massTotal () const
 Return mass of particles to introduce. More...
 
scalar massInjected () const
 Return mass of particles injected (cumulative) More...
 
virtual scalar timeEnd () const =0
 Return the end-of-injection time. More...
 
virtual label parcelsToInject (const scalar time0, const scalar time1)=0
 Number of parcels to introduce relative to SOI. More...
 
virtual scalar volumeToInject (const scalar time0, const scalar time1)=0
 Volume of parcels to introduce relative to SOI. More...
 
virtual scalar averageParcelMass ()
 Return the average parcel mass over the injection period. More...
 
label nInjections () const
 Return the number of injections. More...
 
label parcelsAddedTotal () const
 Return the total number parcels added. More...
 
template<class TrackCloudType >
void inject (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
 Main injection loop. More...
 
template<class TrackCloudType >
void injectSteadyState (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
 Main injection loop - steady-state. More...
 
virtual void setPositionAndCell (const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner, label &tetFacei, label &tetPti)=0
 Set the injection position and owner cell, tetFace and tetPt. More...
 
virtual void setProperties (const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
 Set the parcel properties. More...
 
virtual bool fullyDescribed () const =0
 Flag to identify whether model fully describes the parcel. More...
 
virtual void info (Ostream &os)
 Write injection info to stream. More...
 
- Public Member Functions inherited from CloudSubModelBase< CloudType >
 CloudSubModelBase (CloudType &owner)
 Construct null from owner cloud. More...
 
 CloudSubModelBase (CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from owner cloud without name. More...
 
 CloudSubModelBase (const word &modelName, CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from owner cloud with name. More...
 
 CloudSubModelBase (const CloudSubModelBase< CloudType > &smb)
 Copy constructor. More...
 
virtual ~CloudSubModelBase ()
 Destructor. More...
 
const CloudTypeowner () const
 Return const access to the owner cloud. More...
 
virtual bool writeTime () const
 Flag to indicate when to write a property. More...
 
CloudTypeowner ()
 Return non-const access to the owner cloud for manipulation. More...
 
virtual void write (Ostream &os) const
 Write. More...
 
- Public Member Functions inherited from subModelBase
 subModelBase (dictionary &properties)
 Construct null. More...
 
 subModelBase (dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from components without name. More...
 
 subModelBase (const word &modelName, dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from components with name. More...
 
 subModelBase (const subModelBase &smb)
 Copy constructor. More...
 
virtual ~subModelBase ()
 Destructor. More...
 
const wordmodelName () const
 Return const access to the name of the sub-model. More...
 
const dictionarydict () const
 Return const access to the cloud dictionary. More...
 
const wordbaseName () const
 Return const access to the base name of the sub-model. More...
 
const wordmodelType () const
 Return const access to the sub-model type. More...
 
const dictionarycoeffDict () const
 Return const access to the coefficients dictionary. More...
 
const dictionaryproperties () const
 Return const access to the properties dictionary. More...
 
virtual bool defaultCoeffs (const bool printMsg) const
 Returns true if defaultCoeffs is true and outputs on printMsg. More...
 
virtual void cacheFields (const bool store)
 Cache dependent sub-model fields. More...
 
template<class Type >
Type getBaseProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from the base model. More...
 
template<class Type >
void getBaseProperty (const word &entryName, Type &value) const
 Retrieve generic property from the base model. More...
 
template<class Type >
void setBaseProperty (const word &entryName, const Type &value)
 Add generic property to the base model. More...
 
template<class Type >
void getModelProperty (const word &entryName, Type &value) const
 Retrieve generic property from the sub-model. More...
 
template<class Type >
Type getModelProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from the sub-model. More...
 
template<class Type >
void setModelProperty (const word &entryName, const Type &value)
 Add generic property to the sub-model. More...
 
void operator= (const subModelBase &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static autoPtr< InjectionModel< CloudType > > New (const dictionary &dict, CloudType &owner)
 Selector with lookup from dictionary. More...
 
static autoPtr< InjectionModel< CloudType > > New (const dictionary &dict, const word &modelName, const word &modelType, CloudType &owner)
 Selector with name and type. More...
 

Protected Member Functions

virtual bool validInjection (const label parcelI)=0
 Additional flag to identify whether or not injection of parcelI is. More...
 
virtual bool prepareForNextTimeStep (const scalar time, label &newParcels, scalar &newVolumeFraction)
 Determine properties for next time step/injection interval. More...
 
virtual bool findCellAtPosition (label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
 Find the cell that contains the supplied position. More...
 
virtual scalar setNumberOfParticles (const label parcels, const scalar volumeFraction, const scalar diameter, const scalar rho)
 Set number of particles to inject given parcel properties. More...
 
virtual void postInjectCheck (const label parcelsAdded, const scalar massAdded)
 Post injection checks. More...
 
- Protected Member Functions inherited from subModelBase
bool inLine () const
 Flag to indicate whether data is/was read in-line. More...
 

Protected Attributes

scalar SOI_
 Start of injection [s]. More...
 
scalar volumeTotal_
 Total volume of particles introduced by this injector [m^3]. More...
 
scalar massTotal_
 Total mass to inject [kg]. More...
 
TimeFunction1< scalar > massFlowRate_
 Mass flow rate profile for steady calculations. More...
 
scalar massInjected_
 Total mass injected to date [kg]. More...
 
label nInjections_
 Number of injections counter. More...
 
label parcelsAddedTotal_
 Running counter of total number of parcels added. More...
 
parcelBasis parcelBasis_
 Parcel basis enumeration. More...
 
scalar nParticleFixed_
 nParticle to assign to parcels when the 'fixed' basis More...
 
scalar time0_
 Continuous phase time at start of injection time step [s]. More...
 
scalar timeStep0_
 Time at start of injection time step [s]. More...
 
- Protected Attributes inherited from CloudSubModelBase< CloudType >
CloudTypeowner_
 Reference to the cloud. More...
 
- Protected Attributes inherited from subModelBase
const word modelName_
 Name of the sub-model. More...
 
dictionaryproperties_
 Reference to properties dictionary e.g. for restart. More...
 
const dictionary dict_
 Copy of dictionary used during construction. More...
 
const word baseName_
 Name of the sub-model base class. More...
 
const word modelType_
 Type of the sub-model. More...
 
const dictionary coeffDict_
 Coefficients dictionary. More...
 

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 67 of file InjectionModel.H.

Member Typedef Documentation

◆ parcelType

Convenience typedef for parcelType.

Definition at line 74 of file InjectionModel.H.

Member Enumeration Documentation

◆ parcelBasis

Parcel basis representation options.

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

Enumerator
pbNumber 
pbMass 
pbFixed 

Definition at line 81 of file InjectionModel.H.

Constructor & Destructor Documentation

◆ InjectionModel() [1/3]

InjectionModel ( CloudType owner)

Construct null from owner.

Definition at line 261 of file InjectionModel.C.

Referenced by InjectionModel< CloudType >::InjectionModel().

Here is the caller graph for this function:

◆ InjectionModel() [2/3]

◆ InjectionModel() [3/3]

Construct copy.

Definition at line 356 of file InjectionModel.C.

◆ ~InjectionModel()

~InjectionModel ( )
virtual

Destructor.

Definition at line 378 of file InjectionModel.C.

Member Function Documentation

◆ validInjection()

◆ prepareForNextTimeStep()

bool prepareForNextTimeStep ( const scalar  time,
label newParcels,
scalar &  newVolumeFraction 
)
protectedvirtual

Determine properties for next time step/injection interval.

Definition at line 37 of file InjectionModel.C.

References InjectionModel< CloudType >::findCellAtPosition().

Referenced by InjectionModel< CloudType >::inject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCellAtPosition()

bool findCellAtPosition ( label celli,
label tetFacei,
label tetPti,
vector position,
bool  errorOnNotFound = true 
)
protectedvirtual

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 93 of file InjectionModel.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, DimensionedField< Type, GeoMesh >::mesh(), UPstream::myProcNo(), Foam::nl, Foam::reduce(), and InjectionModel< CloudType >::setNumberOfParticles().

Referenced by InjectionModel< CloudType >::prepareForNextTimeStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNumberOfParticles()

Foam::scalar setNumberOfParticles ( const label  parcels,
const scalar  volumeFraction,
const scalar  diameter,
const scalar  rho 
)
protectedvirtual

Set number of particles to inject given parcel properties.

Definition at line 186 of file InjectionModel.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, Foam::constant::mathematical::pi(), InjectionModel< CloudType >::postInjectCheck(), Foam::pow3(), and rho.

Referenced by InjectionModel< CloudType >::findCellAtPosition(), InjectionModel< CloudType >::inject(), and InjectionModel< CloudType >::injectSteadyState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ postInjectCheck()

void postInjectCheck ( const label  parcelsAdded,
const scalar  massAdded 
)
protectedvirtual

Post injection checks.

Definition at line 229 of file InjectionModel.C.

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

Referenced by InjectionModel< CloudType >::inject(), InjectionModel< CloudType >::injectSteadyState(), and InjectionModel< CloudType >::setNumberOfParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "injectionModel"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

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

Declare runtime constructor selection table.

◆ clone()

◆ New() [1/2]

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

Selector with lookup from dictionary.

Definition at line 33 of file InjectionModelNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, dictionary::lookup(), and Foam::nl.

Here is the call graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::InjectionModel< CloudType > > New ( const dictionary dict,
const word modelName,
const word modelType,
CloudType owner 
)
static

Selector with name and type.

Definition at line 61 of file InjectionModelNew.C.

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

Here is the call graph for this function:

◆ updateMesh()

◆ timeStart()

Foam::scalar timeStart ( ) const
inline

Return the start-of-injection time.

Definition at line 31 of file InjectionModelI.H.

Referenced by InjectionModel< CloudType >::averageParcelMass().

Here is the caller graph for this function:

◆ volumeTotal()

Foam::scalar volumeTotal ( ) const
inline

Return the total volume to be injected across the event.

Definition at line 38 of file InjectionModelI.H.

◆ massTotal()

Foam::scalar massTotal ( ) const
inline

Return mass of particles to introduce.

Definition at line 45 of file InjectionModelI.H.

◆ massInjected()

Foam::scalar massInjected ( ) const
inline

Return mass of particles injected (cumulative)

Definition at line 52 of file InjectionModelI.H.

◆ timeEnd()

◆ parcelsToInject()

◆ volumeToInject()

◆ averageParcelMass()

Foam::scalar averageParcelMass ( )
virtual

◆ nInjections()

Foam::label nInjections ( ) const
inline

Return the number of injections.

Definition at line 59 of file InjectionModelI.H.

◆ parcelsAddedTotal()

Foam::label parcelsAddedTotal ( ) const
inline

Return the total number parcels added.

Definition at line 66 of file InjectionModelI.H.

◆ inject()

◆ injectSteadyState()

◆ setPositionAndCell()

◆ setProperties()

◆ fullyDescribed()

◆ info()

Member Data Documentation

◆ SOI_

scalar SOI_
protected

Start of injection [s].

Definition at line 96 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::inject(), and InjectionModel< CloudType >::InjectionModel().

◆ volumeTotal_

scalar volumeTotal_
protected

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

  • scaled to ensure massTotal is achieved

Definition at line 100 of file InjectionModel.H.

◆ massTotal_

scalar massTotal_
protected

◆ massFlowRate_

TimeFunction1<scalar> massFlowRate_
protected

Mass flow rate profile for steady calculations.

Definition at line 106 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::InjectionModel(), and InjectionModel< CloudType >::injectSteadyState().

◆ massInjected_

scalar massInjected_
protected

Total mass injected to date [kg].

Definition at line 109 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::info().

◆ nInjections_

label nInjections_
protected

Number of injections counter.

Definition at line 115 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::info().

◆ parcelsAddedTotal_

label parcelsAddedTotal_
protected

Running counter of total number of parcels added.

Definition at line 118 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::info().

◆ parcelBasis_

parcelBasis parcelBasis_
protected

Parcel basis enumeration.

Definition at line 124 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::InjectionModel().

◆ nParticleFixed_

scalar nParticleFixed_
protected

nParticle to assign to parcels when the 'fixed' basis

is selected

Definition at line 128 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::InjectionModel().

◆ time0_

scalar time0_
protected

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

Definition at line 131 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::inject(), and InjectionModel< CloudType >::injectSteadyState().

◆ timeStep0_

scalar timeStep0_
protected

Time at start of injection time step [s].

Definition at line 134 of file InjectionModel.H.

Referenced by InjectionModel< CloudType >::info().


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