Loading...
Searching...
No Matches
InjectionModel< CloudType > Class Template Referenceabstract

Templated injection model class. More...

#include <InjectionModel.H>

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

Public Types

enum  parcelBasis { pbNumber , pbMass , pbFixed }
 Parcel basis representation options i.e constant number of particles OR constant mass per parcel. More...
typedef CloudType::parcelType parcelType
 Convenience typedef for parcelType.
Public Types inherited from CloudSubModelBase< CloudType >
typedef CloudType cloudType
 Type of cloud this model was instantiated for.

Public Member Functions

 TypeName ("injectionModel")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner, const word &modelType),(dict, owner, modelType))
 Declare runtime constructor selection table.
 InjectionModel (CloudType &owner)
 Construct null from owner.
 InjectionModel (const dictionary &dict, CloudType &owner, const word &modelName, const word &modelType)
 Construct from dictionary.
 InjectionModel (const InjectionModel< CloudType > &im)
 Construct copy.
virtual autoPtr< InjectionModel< CloudType > > clone () const =0
 Construct and return a clone.
virtual ~InjectionModel ()=default
 Destructor.
virtual void updateMesh ()
 Update mesh.
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).
label injectorID () const
 Return injectorID.
virtual scalar timeEnd () const =0
 Return the end-of-injection time.
virtual label parcelsToInject (const scalar time0, const scalar time1)=0
 Number of parcels to introduce relative to SOI.
virtual scalar volumeToInject (const scalar time0, const scalar time1)=0
 Volume of parcels to introduce relative to SOI.
virtual scalar averageParcelMass ()
 Return the average parcel mass over the injection period.
label nInjections () const
 Return the number of injections.
label parcelsAddedTotal () const
 Return the total number parcels added.
template<class TrackCloudType>
void inject (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
 Main injection loop.
template<class TrackCloudType>
void injectSteadyState (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
 Main injection loop - steady-state.
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.
virtual void setProperties (const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
 Set the parcel properties.
virtual bool fullyDescribed () const =0
 Flag to identify whether model fully describes the parcel.
virtual void info ()
 Write injection info.
Public Member Functions inherited from CloudSubModelBase< CloudType >
 CloudSubModelBase (CloudType &owner)
 Construct null from owner cloud.
 CloudSubModelBase (CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from owner cloud without name.
 CloudSubModelBase (const word &modelName, CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from owner cloud with name.
 CloudSubModelBase (const CloudSubModelBase< CloudType > &smb)
 Construct as copy.
virtual ~CloudSubModelBase ()=default
 Destructor.
const CloudTypeowner () const
 Return const access to the owner cloud.
virtual bool writeTime () const
 Flag to indicate when to write a property.
virtual fileName localPath () const
 Output directory.
CloudTypeowner ()
 Return non-const access to the owner cloud for manipulation.
virtual void write (Ostream &os) const
 Write to os.
Public Member Functions inherited from subModelBase
 subModelBase (dictionary &properties)
 Construct null.
 subModelBase (dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from components without name.
 subModelBase (const word &modelName, dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from components with name.
 subModelBase (const subModelBase &smb)
 Construct as copy.
virtual ~subModelBase ()=default
 Destructor.
const wordmodelName () const
 Return const access to the name of the sub-model.
const dictionarydict () const
 Return const access to the cloud dictionary.
const wordbaseName () const
 Return const access to the base name of the sub-model.
const wordmodelType () const
 Return const access to the sub-model type.
const dictionarycoeffDict () const
 Return const access to the coefficients dictionary.
const dictionaryproperties () const
 Return const access to the properties dictionary.
virtual bool defaultCoeffs (const bool printMsg) const
 Returns true if defaultCoeffs is true and outputs on printMsg.
virtual bool active () const
 Return the model 'active' status - default active = true.
virtual void cacheFields (const bool store)
 Cache dependent sub-model fields.
template<class Type>
Type getBaseProperty (const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve generic property from the base model.
template<class Type>
void getBaseProperty (const word &entryName, Type &value) const
 Retrieve generic property from the base model.
template<class Type>
void setBaseProperty (const word &entryName, const Type &value)
 Add generic property to the base model.
bool getModelDict (const word &entryName, dictionary &dict) const
 Retrieve dictionary, return true if set.
template<class Type>
bool getModelProperty (const word &entryName, Type &value) const
 Retrieve generic property from the sub-model.
template<class Type>
Type getModelProperty (const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve generic property from the sub-model.
template<class Type>
void setModelProperty (const word &entryName, const Type &value)
 Add generic property to the sub-model.

Static Public Member Functions

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

Protected Member Functions

virtual bool validInjection (const label parcelI)=0
 Additional flag to identify whether or not injection of parcelI is.
virtual bool prepareForNextTimeStep (const scalar time, label &newParcels, scalar &newVolumeFraction)
 Determine properties for next time step/injection interval.
virtual bool findCellAtPosition (label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
 Find the cell that contains the supplied position.
virtual scalar setNumberOfParticles (const label parcels, const scalar volumeFraction, 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 Member Functions inherited from subModelBase
bool inLine () const
 Flag to indicate whether data is/was read in-line.

Protected Attributes

scalar SOI_
 Start of injection [s].
scalar volumeTotal_
 Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achieved.
scalar massTotal_
 Total mass to inject [kg].
autoPtr< Function1< scalar > > massFlowRate_
 Mass flow rate profile for steady calculations.
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 nParticleFixed_
 nParticle to assign to parcels when the 'fixed' basis is selected
scalar time0_
 Continuous phase time at start of injection time step [s].
scalar timeStep0_
 Time at start of injection time step [s].
scalar minParticlesPerParcel_
 Minimum number of particles used to represent each parcel default = 1.
scalar delayedVolume_
 Volume that should have been injected, but would lead to less than minParticlesPerParcel_ particle per parcel.
label injectorID_
 Optional injector ID.
bool ignoreOutOfBounds_
 Optional flag to indicate that injections attempted outside the mesh should be ignored.
Protected Attributes inherited from CloudSubModelBase< CloudType >
CloudTypeowner_
 Reference to the cloud.
Protected Attributes inherited from subModelBase
const word modelName_
 Name of the sub-model.
dictionaryproperties_
 Reference to properties dictionary e.g. for restart.
const dictionary dict_
 Copy of dictionary used during construction.
const word baseName_
 Name of the sub-model base class.
const word modelType_
 Type of the sub-model.
const dictionary coeffDict_
 Coefficients dictionary.

Additional Inherited Members

Public Attributes inherited from subModelBase
bool log
 Flag to write log into Info.

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

Member Typedef Documentation

◆ parcelType

template<class CloudType>
typedef CloudType::parcelType parcelType

Convenience typedef for parcelType.

Definition at line 78 of file InjectionModel.H.

Member Enumeration Documentation

◆ parcelBasis

template<class CloudType>
enum parcelBasis

Parcel basis representation options i.e constant number of particles OR constant mass per parcel.

Enumerator
pbNumber 
pbMass 
pbFixed 

Definition at line 87 of file InjectionModel.H.

Constructor & Destructor Documentation

◆ InjectionModel() [1/3]

template<class CloudType>
InjectionModel ( CloudType & owner)

Construct null from owner.

Definition at line 256 of file InjectionModel.C.

References CloudSubModelBase< CloudType >::CloudSubModelBase(), subModelBase::getModelProperty(), massFlowRate_, massInjected_, massTotal_, nInjections_, nParticleFixed_, CloudSubModelBase< CloudType >::owner(), parcelBasis_, parcelsAddedTotal_, pbNumber, SOI_, time0_, and volumeTotal_.

Referenced by CellZoneInjection< CloudType >::CellZoneInjection(), CellZoneInjection< CloudType >::CellZoneInjection(), ConeInjection< CloudType >::ConeInjection(), ConeInjection< CloudType >::ConeInjection(), ConeNozzleInjection< CloudType >::ConeNozzleInjection(), ConeNozzleInjection< CloudType >::ConeNozzleInjection(), declareRunTimeSelectionTable(), FieldActivatedInjection< CloudType >::FieldActivatedInjection(), FieldActivatedInjection< CloudType >::FieldActivatedInjection(), InflationInjection< CloudType >::InflationInjection(), InflationInjection< CloudType >::InflationInjection(), InjectedParticleDistributionInjection< CloudType >::InjectedParticleDistributionInjection(), InjectedParticleDistributionInjection< CloudType >::InjectedParticleDistributionInjection(), InjectedParticleInjection< CloudType >::InjectedParticleInjection(), InjectedParticleInjection< CloudType >::InjectedParticleInjection(), InjectionModel(), KinematicLookupTableInjection< CloudType >::KinematicLookupTableInjection(), KinematicLookupTableInjection< CloudType >::KinematicLookupTableInjection(), ManualInjection< CloudType >::ManualInjection(), ManualInjection< CloudType >::ManualInjection(), NoInjection< CloudType >::NoInjection(), NoInjection< CloudType >::NoInjection(), PatchFlowRateInjection< CloudType >::PatchFlowRateInjection(), PatchFlowRateInjection< CloudType >::PatchFlowRateInjection(), PatchInjection< CloudType >::PatchInjection(), PatchInjection< CloudType >::PatchInjection(), ReactingLookupTableInjection< CloudType >::ReactingLookupTableInjection(), ReactingLookupTableInjection< CloudType >::ReactingLookupTableInjection(), ReactingMultiphaseLookupTableInjection< CloudType >::ReactingMultiphaseLookupTableInjection(), ReactingMultiphaseLookupTableInjection< CloudType >::ReactingMultiphaseLookupTableInjection(), and ThermoLookupTableInjection< CloudType >::ThermoLookupTableInjection().

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

◆ InjectionModel() [2/3]

◆ InjectionModel() [3/3]

template<class CloudType>
InjectionModel ( const InjectionModel< CloudType > & im)

Construct copy.

Definition at line 381 of file InjectionModel.C.

References CloudSubModelBase< CloudType >::CloudSubModelBase(), InjectionModel(), and SOI_.

Here is the call graph for this function:

◆ ~InjectionModel()

template<class CloudType>
virtual ~InjectionModel ( )
virtualdefault

Destructor.

References subModelBase::dict(), subModelBase::modelName(), subModelBase::modelType(), and CloudSubModelBase< CloudType >::owner().

Here is the call graph for this function:

Member Function Documentation

◆ validInjection()

◆ prepareForNextTimeStep()

template<class CloudType>
bool prepareForNextTimeStep ( const scalar time,
label & newParcels,
scalar & newVolumeFraction )
protectedvirtual

Determine properties for next time step/injection interval.

Definition at line 31 of file InjectionModel.C.

References parcelsToInject(), SOI_, timeStep0_, validInjection(), volumeToInject(), and volumeTotal_.

Referenced by inject().

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

◆ findCellAtPosition()

◆ setNumberOfParticles()

template<class CloudType>
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 180 of file InjectionModel.C.

References delayedVolume_, massTotal_, parcelBasis_, pbMass, pbNumber, Foam::constant::mathematical::pi(), Foam::pow3(), and rho.

Referenced by injectSteadyState().

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

◆ postInjectCheck()

template<class CloudType>
void postInjectCheck ( const label parcelsAdded,
const scalar massAdded )
protectedvirtual

Post injection checks.

Definition at line 223 of file InjectionModel.C.

Referenced by injectSteadyState().

Here is the caller graph for this function:

◆ TypeName()

template<class CloudType>
TypeName ( "injectionModel" )

Runtime type information.

◆ declareRunTimeSelectionTable()

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

Declare runtime constructor selection table.

References subModelBase::dict(), InjectionModel(), subModelBase::modelName(), subModelBase::modelType(), and CloudSubModelBase< CloudType >::owner().

Here is the call graph for this function:

◆ clone()

◆ New() [1/2]

◆ New() [2/2]

template<class CloudType>
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 57 of file InjectionModelNew.C.

References subModelBase::dict(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, Foam::Info, subModelBase::modelName(), subModelBase::modelType(), and CloudSubModelBase< CloudType >::owner().

Here is the call graph for this function:

◆ updateMesh()

◆ timeStart()

template<class CloudType>
Foam::scalar timeStart ( ) const
inline

Return the start-of-injection time.

Definition at line 27 of file InjectionModelI.H.

References SOI_.

Referenced by averageParcelMass().

Here is the caller graph for this function:

◆ volumeTotal()

template<class CloudType>
Foam::scalar volumeTotal ( ) const
inline

Return the total volume to be injected across the event.

Definition at line 34 of file InjectionModelI.H.

References volumeTotal_.

Referenced by ConeNozzleInjection< CloudType >::setProperties().

Here is the caller graph for this function:

◆ massTotal()

template<class CloudType>
Foam::scalar massTotal ( ) const
inline

Return mass of particles to introduce.

Definition at line 41 of file InjectionModelI.H.

References massTotal_.

Referenced by ConeNozzleInjection< CloudType >::setProperties().

Here is the caller graph for this function:

◆ massInjected()

template<class CloudType>
Foam::scalar massInjected ( ) const
inline

Return mass of particles injected (cumulative).

Definition at line 48 of file InjectionModelI.H.

References massInjected_.

◆ injectorID()

template<class CloudType>
Foam::label injectorID ( ) const
inline

Return injectorID.

Definition at line 55 of file InjectionModelI.H.

References injectorID_.

◆ timeEnd()

◆ parcelsToInject()

◆ volumeToInject()

◆ averageParcelMass()

template<class CloudType>
Foam::scalar averageParcelMass ( )
virtual

Return the average parcel mass over the injection period.

Definition at line 413 of file InjectionModel.C.

References CloudSubModelBase< CloudType >::owner(), parcelsToInject(), timeEnd(), and timeStart().

Here is the call graph for this function:

◆ nInjections()

template<class CloudType>
Foam::label nInjections ( ) const
inline

Return the number of injections.

Definition at line 62 of file InjectionModelI.H.

References nInjections_.

◆ parcelsAddedTotal()

template<class CloudType>
Foam::label parcelsAddedTotal ( ) const
inline

Return the total number parcels added.

Definition at line 69 of file InjectionModelI.H.

References parcelsAddedTotal_.

Referenced by ConeInjection< CloudType >::ConeInjection(), and InjectedParticleDistributionInjection< CloudType >::InjectedParticleDistributionInjection().

Here is the caller graph for this function:

◆ inject()

template<class CloudType>
template<class TrackCloudType>
void inject ( TrackCloudType & cloud,
typename CloudType::parcelType::trackingData & td )

Main injection loop.

Definition at line 431 of file InjectionModel.C.

References subModelBase::active(), Foam::max(), mesh, Foam::min(), CloudSubModelBase< CloudType >::owner(), prepareForNextTimeStep(), SOI_, td(), time0_, and timeEnd().

Here is the call graph for this function:

◆ injectSteadyState()

template<class CloudType>
template<class TrackCloudType>
void injectSteadyState ( TrackCloudType & cloud,
typename CloudType::parcelType::trackingData & td,
const scalar trackTime )

◆ setPositionAndCell()

◆ setProperties()

◆ fullyDescribed()

◆ info()

Member Data Documentation

◆ SOI_

◆ volumeTotal_

template<class CloudType>
scalar volumeTotal_
protected

◆ massTotal_

◆ massFlowRate_

template<class CloudType>
autoPtr<Function1<scalar> > massFlowRate_
protected

Mass flow rate profile for steady calculations.

Definition at line 120 of file InjectionModel.H.

Referenced by InjectionModel(), InjectionModel(), and injectSteadyState().

◆ massInjected_

template<class CloudType>
scalar massInjected_
protected

Total mass injected to date [kg].

Definition at line 125 of file InjectionModel.H.

Referenced by info(), InjectionModel(), InjectionModel(), and massInjected().

◆ nInjections_

template<class CloudType>
label nInjections_
protected

Number of injections counter.

Definition at line 133 of file InjectionModel.H.

Referenced by info(), InjectionModel(), InjectionModel(), and nInjections().

◆ parcelsAddedTotal_

template<class CloudType>
label parcelsAddedTotal_
protected

Running counter of total number of parcels added.

Definition at line 138 of file InjectionModel.H.

Referenced by info(), InjectionModel(), InjectionModel(), and parcelsAddedTotal().

◆ parcelBasis_

template<class CloudType>
parcelBasis parcelBasis_
protected

◆ nParticleFixed_

template<class CloudType>
scalar nParticleFixed_
protected

nParticle to assign to parcels when the 'fixed' basis is selected

Definition at line 152 of file InjectionModel.H.

Referenced by InjectionModel(), and InjectionModel().

◆ time0_

template<class CloudType>
scalar time0_
protected

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

Definition at line 157 of file InjectionModel.H.

Referenced by inject(), InjectionModel(), InjectionModel(), and injectSteadyState().

◆ timeStep0_

template<class CloudType>
scalar timeStep0_
protected

Time at start of injection time step [s].

Definition at line 162 of file InjectionModel.H.

Referenced by info(), InjectionModel(), and prepareForNextTimeStep().

◆ minParticlesPerParcel_

template<class CloudType>
scalar minParticlesPerParcel_
protected

Minimum number of particles used to represent each parcel default = 1.

Definition at line 168 of file InjectionModel.H.

Referenced by InjectionModel().

◆ delayedVolume_

template<class CloudType>
scalar delayedVolume_
protected

Volume that should have been injected, but would lead to less than minParticlesPerParcel_ particle per parcel.

Definition at line 174 of file InjectionModel.H.

Referenced by InjectionModel(), and setNumberOfParticles().

◆ injectorID_

template<class CloudType>
label injectorID_
protected

Optional injector ID.

Definition at line 179 of file InjectionModel.H.

Referenced by InjectionModel(), injectorID(), and injectSteadyState().

◆ ignoreOutOfBounds_


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/InjectionModelNew.C