Templated injection model class. More...


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. 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 ()=default |
| 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... | |
| label | injectorID () const |
| Return injectorID. 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 () |
| Write injection info. 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) | |
| Construct as copy. More... | |
| virtual | ~CloudSubModelBase ()=default |
| Destructor. More... | |
| const CloudType & | owner () const |
| Return const access to the owner cloud. More... | |
| virtual bool | writeTime () const |
| Flag to indicate when to write a property. More... | |
| virtual fileName | localPath () const |
| Output directory. More... | |
| CloudType & | owner () |
| Return non-const access to the owner cloud for manipulation. More... | |
| virtual void | write (Ostream &os) const |
| Write to os. 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) | |
| Construct as copy. More... | |
| virtual | ~subModelBase ()=default |
| Destructor. More... | |
| const word & | modelName () const |
| Return const access to the name of the sub-model. More... | |
| const dictionary & | dict () const |
| Return const access to the cloud dictionary. More... | |
| const word & | baseName () const |
| Return const access to the base name of the sub-model. More... | |
| const word & | modelType () const |
| Return const access to the sub-model type. More... | |
| const dictionary & | coeffDict () const |
| Return const access to the coefficients dictionary. More... | |
| const dictionary & | properties () 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 bool | active () const |
| Return the model 'active' status - default active = true. More... | |
| virtual void | cacheFields (const bool store) |
| Cache dependent sub-model fields. More... | |
| template<class Type > | |
| Type | getBaseProperty (const word &entryName, const Type &defaultValue=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... | |
| bool | getModelDict (const word &entryName, dictionary &dict) const |
| Retrieve dictionary, return true if set. More... | |
| template<class Type > | |
| bool | 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=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... | |
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] Note: scaled to ensure massTotal is achieved. More... | |
| scalar | massTotal_ |
| Total mass to inject [kg]. More... | |
| autoPtr< Function1< 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 is selected 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... | |
| scalar | minParticlesPerParcel_ |
| Minimum number of particles used to represent each parcel default = 1. More... | |
| scalar | delayedVolume_ |
| Volume that should have been injected, but would lead to less than minParticlesPerParcel_ particle per parcel. More... | |
| label | injectorID_ |
| Optional injector ID. More... | |
| bool | ignoreOutOfBounds_ |
| Optional flag to indicate that injections attempted outside the mesh should be ignored. More... | |
Protected Attributes inherited from CloudSubModelBase< CloudType > | |
| CloudType & | owner_ |
| Reference to the cloud. More... | |
Protected Attributes inherited from subModelBase | |
| const word | modelName_ |
| Name of the sub-model. More... | |
| dictionary & | properties_ |
| 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... | |
Additional Inherited Members | |
Public Attributes inherited from subModelBase | |
| bool | log |
| Flag to write log into Info. More... | |
Templated injection model class.
The injection model nominally describes the parcel:
If, however, all of a parcel's properties are described in the model, the fullDescribed() flag should be set to 1 (true).
Definition at line 69 of file InjectionModel.H.
| typedef CloudType::parcelType parcelType |
Convenience typedef for parcelType.
Definition at line 78 of file InjectionModel.H.
| 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.
| InjectionModel | ( | CloudType & | owner | ) |
Construct null from owner.
Definition at line 256 of file InjectionModel.C.
| InjectionModel | ( | const dictionary & | dict, |
| CloudType & | owner, | ||
| const word & | modelName, | ||
| const word & | modelType | ||
| ) |
Construct from dictionary.
Definition at line 282 of file InjectionModel.C.
References subModelBase::active(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::nl.

| InjectionModel | ( | const InjectionModel< CloudType > & | im | ) |
Construct copy.
Definition at line 382 of file InjectionModel.C.
|
virtualdefault |
Destructor.
|
protectedpure virtual |
Additional flag to identify whether or not injection of parcelI is.
permitted
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchFlowRateInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
protectedvirtual |
Determine properties for next time step/injection interval.
Definition at line 32 of file InjectionModel.C.
|
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 88 of file InjectionModel.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, DimensionedField< Type, GeoMesh >::mesh(), UPstream::myProcNo(), Foam::nl, p0, and Foam::reduce().

|
protectedvirtual |
Set number of particles to inject given parcel properties.
Definition at line 181 of file InjectionModel.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, Foam::constant::mathematical::pi(), Foam::pow3(), and rho.

|
protectedvirtual |
Post injection checks.
Definition at line 224 of file InjectionModel.C.
References Foam::endl(), Log_, Foam::nl, and Foam::returnReduce().

| TypeName | ( | "injectionModel" | ) |
Runtime type information.
| declareRunTimeSelectionTable | ( | autoPtr | , |
| InjectionModel< CloudType > | , | ||
| dictionary | , | ||
| (const dictionary &dict, CloudType &owner, const word &modelType) | , | ||
| (dict, owner, modelType) | |||
| ) |
Declare runtime constructor selection table.
|
pure virtual |
Construct and return a clone.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, KinematicLookupTableInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ManualInjection< CloudType >, PatchFlowRateInjection< CloudType >, and NoInjection< CloudType >.
|
static |
Selector with lookup from dictionary.
Definition at line 29 of file InjectionModelNew.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and Foam::Info.

|
static |
Selector with name and type.
Definition at line 58 of file InjectionModelNew.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and Foam::Info.

|
virtual |
Update mesh.
Reimplemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ManualInjection< CloudType >, and PatchFlowRateInjection< CloudType >.
Definition at line 408 of file InjectionModel.C.
|
inline |
Return the start-of-injection time.
Definition at line 27 of file InjectionModelI.H.
|
inline |
Return the total volume to be injected across the event.
Definition at line 34 of file InjectionModelI.H.
|
inline |
Return mass of particles to introduce.
Definition at line 41 of file InjectionModelI.H.
|
inline |
Return mass of particles injected (cumulative)
Definition at line 48 of file InjectionModelI.H.
|
inline |
Return injectorID.
Definition at line 55 of file InjectionModelI.H.
|
pure virtual |
Return the end-of-injection time.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ManualInjection< CloudType >, PatchFlowRateInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Number of parcels to introduce relative to SOI.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ManualInjection< CloudType >, PatchFlowRateInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Volume of parcels to introduce relative to SOI.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ManualInjection< CloudType >, PatchFlowRateInjection< CloudType >, and NoInjection< CloudType >.
|
virtual |
Return the average parcel mass over the injection period.
Definition at line 413 of file InjectionModel.C.
|
inline |
Return the number of injections.
Definition at line 62 of file InjectionModelI.H.
|
inline |
Return the total number parcels added.
Definition at line 69 of file InjectionModelI.H.
| void inject | ( | TrackCloudType & | cloud, |
| typename CloudType::parcelType::trackingData & | td | ||
| ) |
Main injection loop.
Definition at line 432 of file InjectionModel.C.
References Foam::meshTools::constrainDirection(), Foam::meshTools::constrainToMeshCentre(), Foam::max(), mesh, Foam::min(), Foam::pos(), Foam::returnReduce(), polyMesh::solutionD(), and Foam::Zero.

| void injectSteadyState | ( | TrackCloudType & | cloud, |
| typename CloudType::parcelType::trackingData & | td, | ||
| const scalar | trackTime | ||
| ) |
Main injection loop - steady-state.
Definition at line 562 of file InjectionModel.C.
References Foam::meshTools::constrainDirection(), Foam::meshTools::constrainToMeshCentre(), mesh, Foam::pos(), polyMesh::solutionD(), fvMesh::time(), dimensioned< Type >::value(), and Foam::Zero.

|
pure virtual |
Set the injection position and owner cell, tetFace and tetPt.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, PatchInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchFlowRateInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Set the parcel properties.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchFlowRateInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Flag to identify whether model fully describes the parcel.
Implemented in ConeNozzleInjection< CloudType >, InjectedParticleDistributionInjection< CloudType >, InjectedParticleInjection< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, InflationInjection< CloudType >, PatchInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, CellZoneInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchFlowRateInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
virtual |
Write injection info.
Reimplemented from CloudSubModelBase< CloudType >.
Reimplemented in InjectedParticleDistributionInjection< CloudType >, and InjectedParticleInjection< CloudType >.
Definition at line 662 of file InjectionModel.C.
References CloudSubModelBase< CloudType >::info(), Log_, and Foam::nl.
Referenced by InjectedParticleInjection< CloudType >::info(), and InjectedParticleDistributionInjection< CloudType >::info().


|
protected |
Start of injection [s].
Definition at line 104 of file InjectionModel.H.
|
protected |
Total volume of particles introduced by this injector [m^3] Note: scaled to ensure massTotal is achieved.
Definition at line 110 of file InjectionModel.H.
|
protected |
Total mass to inject [kg].
Definition at line 115 of file InjectionModel.H.
Mass flow rate profile for steady calculations.
Definition at line 120 of file InjectionModel.H.
|
protected |
Total mass injected to date [kg].
Definition at line 125 of file InjectionModel.H.
|
protected |
Number of injections counter.
Definition at line 133 of file InjectionModel.H.
|
protected |
Running counter of total number of parcels added.
Definition at line 138 of file InjectionModel.H.
|
protected |
Parcel basis enumeration.
Definition at line 146 of file InjectionModel.H.
|
protected |
nParticle to assign to parcels when the 'fixed' basis is selected
Definition at line 152 of file InjectionModel.H.
|
protected |
Continuous phase time at start of injection time step [s].
Definition at line 157 of file InjectionModel.H.
|
protected |
Time at start of injection time step [s].
Definition at line 162 of file InjectionModel.H.
|
protected |
Minimum number of particles used to represent each parcel default = 1.
Definition at line 168 of file InjectionModel.H.
|
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.
|
protected |
Optional injector ID.
Definition at line 179 of file InjectionModel.H.
|
protected |
Optional flag to indicate that injections attempted outside the mesh should be ignored.
Definition at line 185 of file InjectionModel.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.