54#ifndef InjectionModel_H
55#define InjectionModel_H
73template<
class CloudType>
170 scalar& newVolumeFraction
182 bool errorOnNotFound =
true
189 const scalar volumeFraction,
190 const scalar diameter,
197 const label parcelsAdded,
198 const scalar massAdded
292 virtual scalar
timeEnd()
const = 0;
324 template<
class TrackCloudType>
327 TrackCloudType&
cloud,
332 template<
class TrackCloudType>
335 TrackCloudType&
cloud,
337 const scalar trackTime
347 const label nParcels,
359 const label nParcels,
381#define makeInjectionModel(CloudType) \
383 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
384 defineNamedTemplateTypeNameAndDebug \
386 Foam::InjectionModel<kinematicCloudType>, \
392 defineTemplateRunTimeSelectionTable \
394 InjectionModel<kinematicCloudType>, \
400#define makeInjectionModelType(SS, CloudType) \
402 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
403 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
405 Foam::InjectionModel<kinematicCloudType>:: \
406 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
407 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Templated injection model class.
virtual bool fullyDescribed() const =0
Flag to identify whether model fully describes the parcel.
virtual bool prepareForNextTimeStep(const scalar time, label &newParcels, scalar &newVolumeFraction)
Determine properties for next time step/injection interval.
scalar timeStep0_
Time at start of injection time step [s].
scalar massTotal() const
Return mass of particles to introduce.
virtual scalar timeEnd() const =0
Return the end-of-injection time.
void inject(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
Main injection loop.
parcelBasis parcelBasis_
Parcel basis enumeration.
label injectorID_
Optional injector ID.
TypeName("injectionModel")
Runtime type information.
virtual autoPtr< InjectionModel< CloudType > > clone() const =0
Construct and return a clone.
scalar minParticlesPerParcel_
virtual scalar volumeToInject(const scalar time0, const scalar time1)=0
Volume 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.
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 void info(Ostream &os)
Write injection info to stream.
scalar timeStart() const
Return the start-of-injection time.
virtual label parcelsToInject(const scalar time0, const scalar time1)=0
Number of parcels to introduce relative to SOI.
label injectorID() const
Return injectorID.
static autoPtr< InjectionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector with lookup from dictionary.
virtual scalar averageParcelMass()
Return the average parcel mass over the injection period.
declareRunTimeSelectionTable(autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner, const word &modelType),(dict, owner, modelType))
Declare runtime constructor selection table.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
Set the parcel properties.
void injectSteadyState(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
Main injection loop - steady-state.
virtual ~InjectionModel()=default
Destructor.
virtual bool validInjection(const label parcelI)=0
Additional flag to identify whether or not injection of parcelI is.
scalar volumeTotal() const
Return the total volume to be injected across the event.
label parcelsAddedTotal() const
Return the total number parcels added.
scalar massInjected() const
Return mass of particles injected (cumulative)
label nInjections_
Number of injections counter.
virtual void updateMesh()
Update mesh.
scalar massTotal_
Total mass to inject [kg].
virtual bool findCellAtPosition(label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
label parcelsAddedTotal_
Running counter of total number of parcels added.
CloudType::parcelType parcelType
Convenience typedef for parcelType.
scalar time0_
Continuous phase time at start of injection time step [s].
scalar SOI_
Start of injection [s].
label nInjections() const
Return the number of injections.
virtual void postInjectCheck(const label parcelsAdded, const scalar massAdded)
Post injection checks.
autoPtr< Function1< scalar > > massFlowRate_
Mass flow rate profile for steady calculations.
scalar massInjected_
Total mass injected to date [kg].
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A cloud is a registry collection of lagrangian particles.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Class used to pass data into container.
const dictionary & dict() const
Return const access to the cloud dictionary.
const word & modelName() const
Return const access to the name of the sub-model.
const word & modelType() const
Return const access to the sub-model type.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.