Go to the documentation of this file.
54 #ifndef InjectionModel_H
55 #define InjectionModel_H
73 template<
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,
328 typename CloudType::parcelType::trackingData& td
332 template<
class TrackCloudType>
335 TrackCloudType&
cloud,
336 typename CloudType::parcelType::trackingData& td,
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_;
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.
virtual bool findCellAtPosition(label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
Find the cell that contains the supplied position.
A class for handling words, derived from Foam::string.
label parcelsAddedTotal() const
Return the total number parcels added.
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.
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.
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.
autoPtr< Function1< scalar > > massFlowRate_
Mass flow rate profile for steady calculations.
const word & modelName() const
Return const access to the name of the sub-model.
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.
virtual bool fullyDescribed() const =0
Flag to identify whether model fully describes the parcel.
label injectorID() const
Return injectorID.
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)
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 scalar volumeToInject(const scalar time0, const scalar time1)=0
Volume of parcels to introduce relative to SOI.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
scalar minParticlesPerParcel_
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 a number of values (eg,...
scalar massTotal_
Total mass to inject [kg].
OBJstream os(runTime.globalPath()/outputName)
label parcelsAddedTotal_
Running counter of total number of parcels added.
const word & modelType() const
Return const access to the sub-model type.
virtual ~InjectionModel()=default
Destructor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A cloud is a registry collection of lagrangian particles.
Macros to ease declaration of run-time selection tables.
void inject(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
Main injection loop.
CloudType::parcelType parcelType
Convenience typedef for parcelType.
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.