Go to the documentation of this file.
48 #ifndef InjectionModel_H
49 #define InjectionModel_H
67 template<
class CloudType>
156 scalar& newVolumeFraction
168 bool errorOnNotFound =
true
175 const scalar volumeFraction,
176 const scalar diameter,
183 const label parcelsAdded,
184 const scalar massAdded
275 virtual scalar
timeEnd()
const = 0;
307 template<
class TrackData>
308 void inject(TrackData& td);
311 template<
class TrackData>
321 const label nParcels,
333 const label nParcels,
355 #define makeInjectionModel(CloudType) \
357 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
358 defineNamedTemplateTypeNameAndDebug \
360 Foam::InjectionModel<kinematicCloudType>, \
366 defineTemplateRunTimeSelectionTable \
368 InjectionModel<kinematicCloudType>, \
374 #define makeInjectionModelType(SS, CloudType) \
376 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
377 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
379 Foam::InjectionModel<kinematicCloudType>:: \
380 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType> > \
381 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
virtual bool validInjection(const label parcelI)=0
Additional flag to identify whether or not injection of parcelI is.
scalar massTotal() const
Return mass of particles to introduce.
virtual void info(Ostream &os)
Write injection info to stream.
A class for handling words, derived from string.
label parcelsAddedTotal() const
Return the total number parcels added.
InjectionModel(CloudType &owner)
Construct null from owner.
virtual void updateMesh()
Update mesh.
Templated injection model class.
Base class for cloud sub-models.
virtual bool prepareForNextTimeStep(const scalar time, label &newParcels, scalar &newVolumeFraction)
Determine properties for next time step/injection interval.
const CloudType & owner() const
Return const access to the owner cloud.
scalar massInjected_
Total mass injected to date [kg].
virtual label parcelsToInject(const scalar time0, const scalar time1)=0
Number of parcels to introduce relative to SOI.
virtual scalar setNumberOfParticles(const label parcels, const scalar volumeFraction, const scalar diameter, const scalar rho)
Set number of particles to inject given parcel properties.
const word & modelName() const
Return const access to the name of the sub-model.
scalar delayedVolume_
Volume that should have been injected, but would lead to.
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3].
scalar timeStep0_
Time at start of injection time step [s].
label injectorID_
Optional injector ID.
label nInjections() const
Return the number of injections.
scalar timeStart() const
Return the start-of-injection time.
TimeDataEntry< scalar > massFlowRate_
Mass flow rate profile for steady calculations.
virtual bool fullyDescribed() const =0
Flag to identify whether model fully describes the parcel.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dictionary & dict() const
Return const access to the cloud dictionary.
virtual autoPtr< InjectionModel< CloudType > > clone() const =0
Construct and return a clone.
scalar massInjected() const
Return mass of particles injected (cumulative)
parcelBasis
Parcel basis representation options.
scalar time0_
Continuous phase time at start of injection time step [s].
virtual scalar volumeToInject(const scalar time0, const scalar time1)=0
Volume of parcels to introduce relative to SOI.
Templated base class for dsmc cloud.
virtual void postInjectCheck(const label parcelsAdded, const scalar massAdded)
Post injection checks.
virtual scalar averageParcelMass()
Return the average parcel mass over the injection period.
A list of keyword definitions, which are a keyword followed by any number of values (e....
scalar massTotal_
Total mass to inject [kg].
void inject(TrackData &td)
Main injection loop.
label parcelsAddedTotal_
Running counter of total number of parcels added.
const word & modelType() const
Return const access to the sub-model type.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual bool findCellAtPosition(label &cellI, label &tetFaceI, label &tetPtI, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
Macros to ease declaration of run-time selection tables.
CloudType::parcelType parcelType
Convenience typedef for parcelType.
virtual ~InjectionModel()
Destructor.
scalar SOI_
Start of injection [s].
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
Set the parcel properties.
scalar volumeTotal() const
Return the total volume to be injected across the event.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
declareRunTimeSelectionTable(autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner, const word &modelType),(dict, owner, modelType))
Declare runtime constructor selection table.
virtual scalar timeEnd() const =0
Return the end-of-injection time.
TypeName("injectionModel")
Runtime type information.
label nInjections_
Number of injections counter.
static autoPtr< InjectionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector with lookup from dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
parcelBasis parcelBasis_
Parcel basis enumeration.
void injectSteadyState(TrackData &td, const scalar trackTime)
Main injection loop - steady-state.
scalar nParticleFixed_
nParticle to assign to parcels when the 'fixed' basis
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.