Templated injection model class. More...
Public Types | |
typedef CloudType::parcelType | parcelType |
Convenience typedef for parcelType. More... | |
Public Types inherited from injectionModel | |
enum class | uniformParcelSize { nParticle , surfaceArea , volume } |
Enumeration for the parcels' uniform size. 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 | topoChange () |
Update mesh. More... | |
scalar | timeStart () const |
Return the start-of-injection time. 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 | nParcelsToInject (const scalar time0, const scalar time1)=0 |
Number of parcels to introduce relative to SOI. More... | |
virtual scalar | massToInject (const scalar time0, const scalar time1)=0 |
Parcel mass to introduce relative to SOI. More... | |
scalar | averageParcelMass () |
Return the average injected parcel mass. 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) |
Main injection loop - steady-state. More... | |
virtual void | setPositionAndCell (const label parcelI, const label nParcels, const scalar time, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)=0 |
Set the injection position and owner cell, tetFace and tetPt. More... | |
virtual void | setProperties (const label parcelI, const label nParcels, const scalar time, typename parcelType::trackingData &td, 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 CloudType & | owner () const |
Return const access to the owner cloud. More... | |
virtual bool | writeTime () const |
Flag to indicate when to write a property. More... | |
CloudType & | owner () |
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 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 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... | |
Static Public Member Functions inherited from injectionModel | |
static scalar | globalScalar01 (randomGenerator &rndGen) |
Return a scalar uniformly distributed between zero and one. Samples. More... | |
Protected Member Functions | |
scalar | readMassTotal (const dictionary &dict, CloudType &owner) |
Read the total mass value for instantaneous injections. More... | |
scalar | readDuration (const dictionary &dict, CloudType &owner) |
Read the duration for continuous injections. More... | |
autoPtr< Function1< scalar > > | readMassFlowRate (const dictionary &dict, CloudType &owner, const scalar duration) |
Read the mass flow rate function for continuous injections. More... | |
autoPtr< Function1< scalar > > | readParcelsPerSecond (const dictionary &dict, CloudType &owner) |
Read the number of parcels injected per second for continuous. More... | |
label | index () const |
Get the index of this injector. More... | |
bool | findCellAtPosition (const point &position, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, bool errorOnNotFound=true) |
Find the cell that contains the supplied position. More... | |
void | constrainPosition (typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel) |
Constrain a parcel's position appropriately to the geometric. More... | |
label | sizeSampleQ () const |
Return the sampling moment to be used by the size distribution. More... | |
void | setNumberOfParticles (PtrList< parcelType > &parcelPtrs, const scalar mass) const |
Set number of particles to inject given parcel properties. More... | |
virtual void | preInject (typename parcelType::trackingData &td) |
Pre injection hook. More... | |
virtual void | postInject (const label parcelsAdded, const scalar massAdded, typename parcelType::trackingData &td) |
Post injection hook. 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 | 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... | |
scalar | nParticleFixed_ |
Fixed nParticle to assign to parcels. Only valid if. More... | |
uniformParcelSize | uniformParcelSize_ |
Size uniform to all parcels. 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 > | |
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 | |
Static Public Attributes inherited from injectionModel | |
static const NamedEnum< uniformParcelSize, 3 > | uniformParcelSizeNames_ |
Names of the parcels' uniform size. 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 fullyDescribed() flag should be set to 1 (true).
Definition at line 65 of file InjectionModel.H.
typedef CloudType::parcelType parcelType |
Convenience typedef for parcelType.
Definition at line 73 of file InjectionModel.H.
InjectionModel | ( | CloudType & | owner | ) |
Construct null from owner.
Definition at line 476 of file InjectionModel.C.
InjectionModel | ( | const dictionary & | dict, |
CloudType & | owner, | ||
const word & | modelName, | ||
const word & | modelType | ||
) |
Construct from dictionary.
Definition at line 494 of file InjectionModel.C.
References IOobject::db(), subModelBase::dict(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::Info, dictionary::lookup(), DSMCCloud< ParcelType >::mesh(), polyMesh::nGeometricD(), injectionModel::nParticle, InjectionModel< CloudType >::nParticleFixed_, CloudSubModelBase< CloudType >::owner(), InjectionModel< CloudType >::SOI_, objectRegistry::time(), InjectionModel< CloudType >::uniformParcelSize_, injectionModel::uniformParcelSizeNames_, and Time::userUnits().
InjectionModel | ( | const InjectionModel< CloudType > & | im | ) |
Construct copy.
Definition at line 553 of file InjectionModel.C.
|
virtual |
Destructor.
Definition at line 573 of file InjectionModel.C.
|
protected |
Read the total mass value for instantaneous injections.
Definition at line 34 of file InjectionModel.C.
References dict, Foam::dimMass, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, IOWarningInFunction, and Foam::type().
|
protected |
Read the duration for continuous injections.
Definition at line 67 of file InjectionModel.C.
References IOobject::db(), dict, objectRegistry::time(), and Time::userUnits().
|
protected |
Read the mass flow rate function for continuous injections.
Definition at line 84 of file InjectionModel.C.
References dict, Foam::dimless, Foam::dimMass, Foam::dimTime, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOWarningInFunction, and Foam::compressible::New().
|
protected |
Read the number of parcels injected per second for continuous.
injections
Definition at line 180 of file InjectionModel.C.
References dict, Foam::dimless, Foam::dimTime, and Foam::compressible::New().
|
protected |
|
protected |
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 213 of file InjectionModel.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Pair< Type >::first(), Foam::nl, p, Foam::pos(), Foam::reduce(), Pair< Type >::second(), and WarningInFunction.
|
protected |
Constrain a parcel's position appropriately to the geometric.
dimensions of the mesh
Definition at line 297 of file InjectionModel.C.
|
protected |
Return the sampling moment to be used by the size distribution.
Definition at line 336 of file InjectionModel.C.
References Foam::labelMax.
|
protected |
Set number of particles to inject given parcel properties.
Definition at line 353 of file InjectionModel.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), Foam::max(), Foam::min(), p, Foam::reduce(), and PtrList< T >::set().
|
protectedvirtual |
Pre injection hook.
Definition at line 434 of file InjectionModel.C.
|
protectedvirtual |
Post injection hook.
Definition at line 442 of file InjectionModel.C.
References Foam::endl(), Foam::Info, 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 ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
|
static |
Selector with lookup from dictionary.
Definition at line 32 of file InjectionModelNew.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::nl.
|
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.
|
virtual |
Update mesh.
Reimplemented in PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
Definition at line 580 of file InjectionModel.C.
|
inline |
Return the start-of-injection time.
Definition at line 31 of file InjectionModelI.H.
|
inline |
Return mass of particles injected (cumulative)
Definition at line 38 of file InjectionModelI.H.
|
pure virtual |
Return the end-of-injection time.
Implemented in ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
|
pure virtual |
Number of parcels to introduce relative to SOI.
Implemented in ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
|
pure virtual |
Parcel mass to introduce relative to SOI.
Implemented in ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
Foam::scalar averageParcelMass |
Return the average injected parcel mass.
Definition at line 585 of file InjectionModel.C.
|
inline |
Return the number of injections.
Definition at line 45 of file InjectionModelI.H.
|
inline |
Return the total number parcels added.
Definition at line 52 of file InjectionModelI.H.
void inject | ( | TrackCloudType & | cloud, |
typename CloudType::parcelType::trackingData & | td | ||
) |
Main injection loop.
Definition at line 596 of file InjectionModel.C.
References Foam::meshTools::constrainDirection(), IOobject::db(), forAll, Foam::max(), Foam::min(), p, PtrList< T >::set(), polyMesh::solutionD(), objectRegistry::time(), VectorSpace< Form, Cmpt, Ncmpts >::uniform(), and dimensioned< Type >::value().
void injectSteadyState | ( | TrackCloudType & | cloud, |
typename CloudType::parcelType::trackingData & | td | ||
) |
Main injection loop - steady-state.
Definition at line 775 of file InjectionModel.C.
References Foam::meshTools::constrainDirection(), forAll, p, PtrList< T >::set(), polyMesh::solutionD(), and VectorSpace< Form, Cmpt, Ncmpts >::uniform().
|
pure virtual |
Set the injection position and owner cell, tetFace and tetPt.
Implemented in ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
|
pure virtual |
Set the parcel properties.
|
pure virtual |
Flag to identify whether model fully describes the parcel.
Implemented in ThermoLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, PatchInjection< CloudType >, PatchFlowRateInjection< CloudType >, NoInjection< CloudType >, MomentumLookupTableInjection< CloudType >, ManualInjection< CloudType >, FieldActivatedInjection< CloudType >, ConeInjection< CloudType >, and CellZoneInjection< CloudType >.
|
virtual |
Write injection info to stream.
Definition at line 882 of file InjectionModel.C.
References Foam::nl.
|
protected |
Start of injection [s].
Definition at line 83 of file InjectionModel.H.
Referenced by InjectionModel< CloudType >::InjectionModel().
|
protected |
Total mass injected to date [kg].
Definition at line 86 of file InjectionModel.H.
|
protected |
Number of injections counter.
Definition at line 92 of file InjectionModel.H.
|
protected |
Running counter of total number of parcels added.
Definition at line 95 of file InjectionModel.H.
|
protected |
Fixed nParticle to assign to parcels. Only valid if.
uniformParcelSize is nParticle.
Definition at line 102 of file InjectionModel.H.
Referenced by InjectionModel< CloudType >::InjectionModel().
|
protected |
Size uniform to all parcels.
Definition at line 105 of file InjectionModel.H.
Referenced by InjectionModel< CloudType >::InjectionModel().
|
protected |
Continuous phase time at start of injection time step [s].
Definition at line 108 of file InjectionModel.H.
|
protected |
Time at start of injection time step [s].
Definition at line 111 of file InjectionModel.H.