Templated injection model class. More...
#include <lagrangianIntermediate/InjectionModel.H>
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 65 of file InjectionModel.H.
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]. |
|
protected |
Convenience typedef for parcel type.
Definition at line 108 of file InjectionModel.H.
enum parcelBasis |
Parcel basis representation options.
i.e constant number of particles OR constant mass per parcel
Definition at line 73 of file InjectionModel.H.
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.
|
virtual |
Destructor.
Definition at line 342 of file InjectionModel.C.
|
protectedpure virtual |
Number of parcels to introduce over the time step relative to SOI.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
protectedpure virtual |
Volume of parcels to introduce over the time step relative to SOI.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
protectedpure virtual |
Additional flag to identify whether or not injection of parcelI is.
permitted
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
protectedvirtual |
Determine properties for next time step/injection interval.
Definition at line 89 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 131 of file InjectionModel.C.
References Foam::abort(), C::C(), Foam::FatalError, FatalErrorIn, Foam::nl, and reduce().
|
protectedvirtual |
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().
|
protectedvirtual |
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.
|
static |
Selector.
Definition at line 33 of file NewInjectionModel.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, dictionary::lookup(), and Foam::nl.
|
inline |
Return the owner cloud dictionary.
Definition at line 29 of file InjectionModelI.H.
|
inline |
Return const access the owner cloud object.
Definition at line 36 of file InjectionModelI.H.
|
inline |
Return non-const access the owner cloud object for manipulation.
Definition at line 43 of file InjectionModelI.H.
|
inline |
Return the coefficients dictionary.
Definition at line 50 of file InjectionModelI.H.
|
pure virtual |
Flag to indicate whether model activates injection model.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
inline |
Return the start-of-injection time.
Definition at line 57 of file InjectionModelI.H.
|
inline |
Return the total volume to be injected across the event.
Definition at line 64 of file InjectionModelI.H.
|
inline |
Return mass of particles to introduce.
Definition at line 71 of file InjectionModelI.H.
|
inline |
Return mass of particles injected (cumulative)
Definition at line 78 of file InjectionModelI.H.
|
pure virtual |
Return the end-of-injection time.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
inline |
Return the number of injections.
Definition at line 85 of file InjectionModelI.H.
|
inline |
Return the total number parcels added.
Definition at line 92 of file InjectionModelI.H.
void inject | ( | TrackData & | td | ) |
Main injection loop.
Definition at line 350 of file InjectionModel.C.
References Foam::meshTools::constrainDirection(), Foam::meshTools::constrainToMeshCentre(), Foam::max(), mesh, Foam::min(), Foam::pos(), polyMesh::solutionD(), and Vector< scalar >::zero.
|
pure virtual |
Set the injection position and owner cell.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Set the parcel properties.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
pure virtual |
Flag to identify whether model fully describes the parcel.
Implemented in ConeInjectionMP< CloudType >, ConeInjection< CloudType >, FieldActivatedInjection< CloudType >, PatchInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ThermoLookupTableInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, and NoInjection< CloudType >.
|
protected |
Start of injection [s].
Definition at line 113 of file InjectionModel.H.
|
protected |
Total volume of particles introduced by this injector [m^3].
Definition at line 117 of file InjectionModel.H.
|
protected |
Total mass to inject [kg].
Definition at line 120 of file InjectionModel.H.
|
protected |
Total mass injected to date [kg].
Definition at line 123 of file InjectionModel.H.
|
protected |
Number of injections counter.
Definition at line 129 of file InjectionModel.H.
|
protected |
Running counter of total number of parcels added.
Definition at line 132 of file InjectionModel.H.
|
protected |
Parcel basis enumeration.
Definition at line 138 of file InjectionModel.H.
|
protected |
Continuous phase time at start of injection time step [s].
Definition at line 141 of file InjectionModel.H.
|
protected |
Time at start of injection time step [s].
Definition at line 144 of file InjectionModel.H.