48 #ifndef InjectionModel_H 49 #define InjectionModel_H 67 template<
class CloudType>
153 scalar& newVolumeFraction
165 bool errorOnNotFound =
true 172 const scalar volumeFraction,
173 const scalar diameter,
180 const label parcelsAdded,
181 const scalar massAdded
201 (dict, owner, modelType)
216 const word& modelType
244 const word& modelType,
272 virtual scalar
timeEnd()
const = 0;
304 template<
class TrackData>
305 void inject(TrackData& td);
308 template<
class TrackData>
318 const label nParcels,
330 const label nParcels,
352 #define makeInjectionModel(CloudType) \ 354 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ 355 defineNamedTemplateTypeNameAndDebug \ 357 Foam::InjectionModel<kinematicCloudType>, \ 363 defineTemplateRunTimeSelectionTable \ 365 InjectionModel<kinematicCloudType>, \ 371 #define makeInjectionModelType(SS, CloudType) \ 373 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \ 374 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \ 376 Foam::InjectionModel<kinematicCloudType>:: \ 377 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \ 378 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
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 massTotal_
Total mass to inject [kg].
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void inject(TrackData &td)
Main injection loop.
scalar time0_
Continuous phase time at start of injection time step [s].
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...
Templated injection model class.
CloudType::parcelType parcelType
Convenience typedef for parcelType.
label parcelsAddedTotal_
Running counter of total number of parcels added.
scalar SOI_
Start of injection [s].
Base class for cloud sub-models.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
Set the parcel properties.
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.
scalar volumeTotal() const
Return the total volume to be injected across the event.
const word & modelName() const
Return const access to the name of the sub-model.
const dictionary & dict() const
Return const access to the cloud dictionary.
virtual ~InjectionModel()
Destructor.
static autoPtr< InjectionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector with lookup from dictionary.
parcelBasis parcelBasis_
Parcel basis enumeration.
const CloudType & owner() const
Return const access to the owner cloud.
void injectSteadyState(TrackData &td, const scalar trackTime)
Main injection loop - steady-state.
TypeName("injectionModel")
Runtime type information.
scalar nParticleFixed_
nParticle to assign to parcels when the 'fixed' basis
label nInjections_
Number of injections counter.
A class for handling words, derived from string.
virtual void info(Ostream &os)
Write injection info to stream.
virtual bool validInjection(const label parcelI)=0
Additional flag to identify whether or not injection of parcelI is.
label parcelsAddedTotal() const
Return the total number parcels added.
scalar massTotal() const
Return mass of particles to introduce.
virtual bool findCellAtPosition(label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
InjectionModel(CloudType &owner)
Construct null from owner.
virtual void updateMesh()
Update mesh.
const word & modelType() const
Return const access to the sub-model type.
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.
virtual bool prepareForNextTimeStep(const scalar time, label &newParcels, scalar &newVolumeFraction)
Determine properties for next time step/injection interval.
virtual scalar setNumberOfParticles(const label parcels, const scalar volumeFraction, const scalar diameter, const scalar rho)
Set number of particles to inject given parcel properties.
scalar massInjected_
Total mass injected to date [kg].
scalar timeStep0_
Time at start of injection time step [s].
label nInjections() const
Return the number of injections.
TimeFunction1< scalar > massFlowRate_
Mass flow rate profile for steady calculations.
scalar delayedVolume_
Volume that should have been injected, but would lead to.
virtual bool fullyDescribed() const =0
Flag to identify whether model fully describes the parcel.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual label parcelsToInject(const scalar time0, const scalar time1)=0
Number of parcels to introduce relative to SOI.
scalar volumeTotal_
Total volume of particles introduced by this injector [m^3].
Macros to ease declaration of run-time selection tables.
scalar timeStart() const
Return the start-of-injection time.
Templated base class for dsmc cloud.
virtual scalar volumeToInject(const scalar time0, const scalar time1)=0
Volume of parcels to introduce relative to SOI.