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 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 i.e constant number of particles OR constant mass per parcel...
scalar massTotal_
Total mass to inject [kg].
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.
scalar minParticlesPerParcel_
Minimum number of particles used to represent each parcel default = 1.
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...
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Templated injection model class.
CloudType::parcelType parcelType
Convenience typedef for parcelType.
label parcelsAddedTotal_
Running counter of total number of parcels added.
virtual ~InjectionModel()=default
Destructor.
scalar SOI_
Start of injection [s].
Base class for cloud sub-models.
bool ignoreOutOfBounds_
Optional flag to indicate that injections attempted outside the mesh should be ignored.
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.
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 is selected
label nInjections_
Number of injections counter.
A class for handling words, derived from Foam::string.
A cloud is a registry 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.
virtual void info()
Write injection info.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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].
autoPtr< Function1< scalar > > massFlowRate_
Mass flow rate profile for steady calculations.
label injectorID_
Optional injector ID.
scalar timeStep0_
Time at start of injection time step [s].
label nInjections() const
Return the number of injections.
scalar delayedVolume_
Volume that should have been injected, but would lead to less than minParticlesPerParcel_ particle pe...
virtual bool fullyDescribed() const =0
Flag to identify whether model fully describes the parcel.
label injectorID() const
Return injectorID.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
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] Note: scaled to ensure massTotal is achie...
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.