48 #ifndef InjectionModel_H 49 #define InjectionModel_H 67 template<
class CloudType>
149 scalar& newVolumeFraction
161 bool errorOnNotFound =
true 168 const scalar volumeFraction,
169 const scalar diameter,
176 const label parcelsAdded,
177 const scalar massAdded
197 (dict, owner, modelType)
212 const word& modelType
240 const word& modelType,
268 virtual scalar
timeEnd()
const = 0;
300 template<
class TrackCloudType>
303 TrackCloudType&
cloud,
304 typename CloudType::parcelType::trackingData& td
308 template<
class TrackCloudType>
311 TrackCloudType&
cloud,
312 typename CloudType::parcelType::trackingData& td,
313 const scalar trackTime
323 const label nParcels,
335 const label nParcels,
357 #define makeInjectionModel(CloudType) \ 359 typedef Foam::CloudType::momentumCloudType momentumCloudType; \ 360 defineNamedTemplateTypeNameAndDebug \ 362 Foam::InjectionModel<momentumCloudType>, \ 368 defineTemplateRunTimeSelectionTable \ 370 InjectionModel<momentumCloudType>, \ 376 #define makeInjectionModelType(SS, CloudType) \ 378 typedef Foam::CloudType::momentumCloudType momentumCloudType; \ 379 defineNamedTemplateTypeNameAndDebug(Foam::SS<momentumCloudType>, 0); \ 381 Foam::InjectionModel<momentumCloudType>:: \ 382 adddictionaryConstructorToTable<Foam::SS<momentumCloudType>> \ 383 add##SS##CloudType##momentumCloudType##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 injectSteadyState(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
Main injection loop - steady-state.
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.
void inject(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
Main injection loop.
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.
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.
A cloud is a collection of lagrangian particles.
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.
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.