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].
|
typedef CloudType::parcelType parcelType [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.
~InjectionModel | ( | ) | [virtual]
|
Destructor.
Definition at line 342 of file InjectionModel.C.
virtual label parcelsToInject | ( | const scalar | time0, |
const scalar | time1 | ||
) | const [protected, pure virtual]
|
Number of parcels to introduce over the time step relative to SOI.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
virtual scalar volumeToInject | ( | const scalar | time0, |
const scalar | time1 | ||
) | const [protected, pure virtual]
|
Volume of parcels to introduce over the time step relative to SOI.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
virtual bool validInjection | ( | const label | parcelI ) | [protected, pure virtual]
|
Additional flag to identify whether or not injection of parcelI is.
permitted
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
void prepareForNextTimeStep | ( | const scalar | time, |
label & | newParcels, | ||
scalar & | newVolume | ||
) | [protected, virtual]
|
Determine properties for next time step/injection interval.
Definition at line 89 of file InjectionModel.C.
void findCellAtPosition | ( | label & | cellI, |
vector & | position | ||
) | [protected, virtual]
|
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().
Foam::scalar setNumberOfParticles | ( | const label | parcels, |
const scalar | volume, | ||
const scalar | diameter, | ||
const scalar | rho | ||
) | [protected, virtual]
|
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().
void postInjectCheck | ( | const label | parcelsAdded, |
const scalar | massAdded | ||
) | [protected, virtual]
|
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.
Foam::autoPtr< Foam::InjectionModel< CloudType > > New | ( | const dictionary & | dict, |
CloudType & | owner | ||
) | [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.
const Foam::dictionary & dict | ( | ) | const [inline]
|
Return the owner cloud dictionary.
Definition at line 29 of file InjectionModelI.H.
const CloudType & owner | ( | ) | const [inline]
|
Return const access the owner cloud object.
Definition at line 36 of file InjectionModelI.H.
CloudType & owner | ( | ) | [inline]
|
Return non-const access the owner cloud object for manipulation.
Definition at line 43 of file InjectionModelI.H.
const Foam::dictionary & coeffDict | ( | ) | const [inline]
|
Return the coefficients dictionary.
Definition at line 50 of file InjectionModelI.H.
virtual bool active | ( | ) | const [pure virtual]
|
Flag to indicate whether model activates injection model.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
Foam::scalar timeStart | ( | ) | const [inline]
|
Return the start-of-injection time.
Definition at line 57 of file InjectionModelI.H.
Foam::scalar volumeTotal | ( | ) | const [inline]
|
Return the total volume to be injected across the event.
Definition at line 64 of file InjectionModelI.H.
Foam::scalar massTotal | ( | ) | const [inline]
|
Return mass of particles to introduce.
Definition at line 71 of file InjectionModelI.H.
Foam::scalar massInjected | ( | ) | const [inline]
|
Return mass of particles injected (cumulative)
Definition at line 78 of file InjectionModelI.H.
virtual scalar timeEnd | ( | ) | const [pure virtual]
|
Return the end-of-injection time.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
Foam::label nInjections | ( | ) | const [inline]
|
Return the number of injections.
Definition at line 85 of file InjectionModelI.H.
Foam::label parcelsAddedTotal | ( | ) | const [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< Cmpt >::zero.
virtual void setPositionAndCell | ( | const label | parcelI, |
const label | nParcels, | ||
const scalar | time, | ||
vector & | position, | ||
label & | cellOwner | ||
) | [pure virtual]
|
Set the injection position and owner cell.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
virtual void setProperties | ( | const label | parcelI, |
const label | nParcels, | ||
const scalar | time, | ||
typename CloudType::parcelType & | parcel | ||
) | [pure virtual]
|
Set the parcel properties.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
virtual bool fullyDescribed | ( | ) | const [pure virtual]
|
Flag to identify whether model fully describes the parcel.
Implemented in ConeInjection< CloudType >, ConeInjectionMP< CloudType >, FieldActivatedInjection< CloudType >, KinematicLookupTableInjection< CloudType >, ManualInjection< CloudType >, NoInjection< CloudType >, PatchInjection< CloudType >, ReactingLookupTableInjection< CloudType >, ReactingMultiphaseLookupTableInjection< CloudType >, and ThermoLookupTableInjection< CloudType >.
const scalar SOI_ [protected]
|
Start of injection [s].
Definition at line 113 of file InjectionModel.H.
scalar volumeTotal_ [protected]
|
Total volume of particles introduced by this injector [m^3].
Definition at line 117 of file InjectionModel.H.
scalar massTotal_ [protected]
|
Total mass to inject [kg].
Definition at line 120 of file InjectionModel.H.
scalar massInjected_ [protected]
|
Total mass injected to date [kg].
Definition at line 123 of file InjectionModel.H.
label nInjections_ [protected]
|
Number of injections counter.
Definition at line 129 of file InjectionModel.H.
label parcelsAddedTotal_ [protected]
|
Running counter of total number of parcels added.
Definition at line 132 of file InjectionModel.H.
parcelBasis parcelBasis_ [protected]
|
Parcel basis enumeration.
Definition at line 138 of file InjectionModel.H.
scalar time0_ [protected]
|
Continuous phase time at start of injection time step [s].
Definition at line 141 of file InjectionModel.H.
scalar timeStep0_ [protected]
|
Time at start of injection time step [s].
Definition at line 144 of file InjectionModel.H.