PatchFlowRateInjection< CloudType > Class Template Reference

Patch injection, by using patch flow rate to determine concentration and velocity. More...

Inheritance diagram for PatchFlowRateInjection< CloudType >:
Collaboration diagram for PatchFlowRateInjection< CloudType >:

Public Member Functions

 TypeName ("patchFlowRateInjection")
 Runtime type information. More...
 
 PatchFlowRateInjection (const dictionary &dict, CloudType &owner, const word &modelName)
 Construct from dictionary. More...
 
 PatchFlowRateInjection (const PatchFlowRateInjection< CloudType > &im)
 Construct copy. More...
 
virtual autoPtr< InjectionModel< CloudType > > clone () const
 Construct and return a clone. More...
 
virtual ~PatchFlowRateInjection ()
 Destructor. More...
 
virtual void topoChange ()
 Set injector locations when mesh is updated. More...
 
virtual scalar timeEnd () const
 Return the end-of-injection time. More...
 
scalar flowRate () const
 Return the total volumetric flow rate across the patch [m^3/s]. More...
 
virtual label nParcelsToInject (const scalar time0, const scalar time1)
 Number of parcels to introduce relative to SOI. More...
 
virtual scalar massToInject (const scalar time0, const scalar time1)
 Parcel mass to introduce relative to SOI. More...
 
virtual void setPositionAndCell (const label parcelI, const label nParcels, const scalar time, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
 Set the injection position and owner cell, tetFace and tetPt. More...
 
virtual void setProperties (const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel)
 
virtual bool fullyDescribed () const
 Flag to identify whether model fully describes the parcel. More...
 
virtual void topoChange (const polyMesh &mesh)
 Inherit topoChange from patchInjectionBase. More...
 
virtual void setPositionAndCell (const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
 Inherit setPositionAndCell from patchInjectionBase. More...
 
- Public Member Functions inherited from InjectionModel< CloudType >
 TypeName ("injectionModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, InjectionModel, dictionary,(const dictionary &dict, CloudType &owner, const word &modelType),(dict, owner, modelType))
 Declare runtime constructor selection table. More...
 
 InjectionModel (CloudType &owner)
 Construct null from owner. More...
 
 InjectionModel (const dictionary &dict, CloudType &owner, const word &modelName, const word &modelType)
 Construct from dictionary. More...
 
 InjectionModel (const InjectionModel< CloudType > &im)
 Construct copy. More...
 
virtual ~InjectionModel ()
 Destructor. More...
 
scalar timeStart () const
 Return the start-of-injection time. More...
 
scalar massInjected () const
 Return mass of particles injected (cumulative) More...
 
scalar averageParcelMass ()
 Return the average injected parcel mass. More...
 
label nInjections () const
 Return the number of injections. More...
 
label parcelsAddedTotal () const
 Return the total number parcels added. More...
 
template<class TrackCloudType >
void inject (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
 Main injection loop. More...
 
template<class TrackCloudType >
void injectSteadyState (TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
 Main injection loop - steady-state. More...
 
virtual void setProperties (const label parcelI, const label nParcels, const scalar time, typename parcelType::trackingData &td, parcelType &parcel)=0
 Set the parcel properties. More...
 
virtual void info (Ostream &os)
 Write injection info to stream. More...
 
- Public Member Functions inherited from CloudSubModelBase< CloudType >
 CloudSubModelBase (CloudType &owner)
 Construct null from owner cloud. More...
 
 CloudSubModelBase (CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from owner cloud without name. More...
 
 CloudSubModelBase (const word &modelName, CloudType &owner, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from owner cloud with name. More...
 
 CloudSubModelBase (const CloudSubModelBase< CloudType > &smb)
 Copy constructor. More...
 
virtual ~CloudSubModelBase ()
 Destructor. More...
 
const CloudTypeowner () const
 Return const access to the owner cloud. More...
 
virtual bool writeTime () const
 Flag to indicate when to write a property. More...
 
CloudTypeowner ()
 Return non-const access to the owner cloud for manipulation. More...
 
virtual void write (Ostream &os) const
 Write. More...
 
- Public Member Functions inherited from subModelBase
 subModelBase (dictionary &properties)
 Construct null. More...
 
 subModelBase (dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType, const word &dictExt="Coeffs")
 Construct from components without name. More...
 
 subModelBase (const word &modelName, dictionary &properties, const dictionary &dict, const word &baseName, const word &modelType)
 Construct from components with name. More...
 
 subModelBase (const subModelBase &smb)
 Copy constructor. More...
 
virtual ~subModelBase ()
 Destructor. More...
 
const wordmodelName () const
 Return const access to the name of the sub-model. More...
 
const dictionarydict () const
 Return const access to the cloud dictionary. More...
 
const wordbaseName () const
 Return const access to the base name of the sub-model. More...
 
const wordmodelType () const
 Return const access to the sub-model type. More...
 
const dictionarycoeffDict () const
 Return const access to the coefficients dictionary. More...
 
const dictionaryproperties () const
 Return const access to the properties dictionary. More...
 
virtual bool defaultCoeffs (const bool printMsg) const
 Returns true if defaultCoeffs is true and outputs on printMsg. More...
 
virtual void cacheFields (const bool store)
 Cache dependent sub-model fields. More...
 
template<class Type >
Type getBaseProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from the base model. More...
 
template<class Type >
void getBaseProperty (const word &entryName, Type &value) const
 Retrieve generic property from the base model. More...
 
template<class Type >
void setBaseProperty (const word &entryName, const Type &value)
 Add generic property to the base model. More...
 
template<class Type >
void getModelProperty (const word &entryName, Type &value) const
 Retrieve generic property from the sub-model. More...
 
template<class Type >
Type getModelProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from the sub-model. More...
 
template<class Type >
void setModelProperty (const word &entryName, const Type &value)
 Add generic property to the sub-model. More...
 
void operator= (const subModelBase &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from patchInjectionBase
 patchInjectionBase (const polyMesh &mesh, const word &patchName)
 Construct from mesh and patch name. More...
 
 patchInjectionBase (const patchInjectionBase &pib)
 Copy constructor. More...
 
virtual ~patchInjectionBase ()
 Destructor. More...
 
virtual void topoChange (const polyMesh &mesh)
 Update patch geometry and derived info for injection locations. More...
 
virtual void setPositionAndCell (const fvMesh &mesh, randomGenerator &rndGen, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, label &facei)
 Set the injection position and owner cell, tetFace and tetPt. More...
 

Additional Inherited Members

- Public Types inherited from InjectionModel< CloudType >
typedef CloudType::parcelType parcelType
 Convenience typedef for parcelType. More...
 
- Public Types inherited from injectionModel
enum class  uniformParcelSize { nParticle , surfaceArea , volume }
 Enumeration for the parcels' uniform size. More...
 
- Public Types inherited from CloudSubModelBase< CloudType >
typedef CloudType cloudType
 Type of cloud this model was instantiated for. More...
 
- Static Public Member Functions inherited from InjectionModel< CloudType >
static autoPtr< InjectionModel< CloudType > > New (const dictionary &dict, CloudType &owner)
 Selector with lookup from dictionary. More...
 
static autoPtr< InjectionModel< CloudType > > New (const dictionary &dict, const word &modelName, const word &modelType, CloudType &owner)
 Selector with name and type. More...
 
- Static Public Member Functions inherited from injectionModel
static scalar globalScalar01 (randomGenerator &rndGen)
 Return a scalar uniformly distributed between zero and one. Samples. More...
 
- Static Public Attributes inherited from injectionModel
static const NamedEnum< uniformParcelSize, 3 > uniformParcelSizeNames_
 Names of the parcels' uniform size. More...
 
- Protected Member Functions inherited from InjectionModel< CloudType >
scalar readMassTotal (const dictionary &dict, CloudType &owner)
 Read the total mass value for instantaneous injections. More...
 
scalar readDuration (const dictionary &dict, CloudType &owner)
 Read the duration for continuous injections. More...
 
autoPtr< Function1< scalar > > readMassFlowRate (const dictionary &dict, CloudType &owner, const scalar duration)
 Read the mass flow rate function for continuous injections. More...
 
autoPtr< Function1< scalar > > readParcelsPerSecond (const dictionary &dict, CloudType &owner)
 Read the number of parcels injected per second for continuous. More...
 
label index () const
 Get the index of this injector. More...
 
bool findCellAtPosition (const point &position, barycentric &coordinates, label &celli, label &tetFacei, label &tetPti, bool errorOnNotFound=true)
 Find the cell that contains the supplied position. More...
 
void constrainPosition (typename CloudType::parcelType::trackingData &td, typename CloudType::parcelType &parcel)
 Constrain a parcel's position appropriately to the geometric. More...
 
label sizeSampleQ () const
 Return the sampling moment to be used by the size distribution. More...
 
void setNumberOfParticles (PtrList< parcelType > &parcelPtrs, const scalar mass) const
 Set number of particles to inject given parcel properties. More...
 
virtual void preInject (typename parcelType::trackingData &td)
 Pre injection hook. More...
 
virtual void postInject (const label parcelsAdded, const scalar massAdded, typename parcelType::trackingData &td)
 Post injection hook. More...
 
- Protected Member Functions inherited from subModelBase
bool inLine () const
 Flag to indicate whether data is/was read in-line. More...
 
- Protected Attributes inherited from InjectionModel< CloudType >
scalar SOI_
 Start of injection [s]. More...
 
scalar massInjected_
 Total mass injected to date [kg]. More...
 
label nInjections_
 Number of injections counter. More...
 
label parcelsAddedTotal_
 Running counter of total number of parcels added. More...
 
scalar nParticleFixed_
 Fixed nParticle to assign to parcels. Only valid if. More...
 
uniformParcelSize uniformParcelSize_
 Size uniform to all parcels. More...
 
scalar time0_
 Continuous phase time at start of injection time step [s]. More...
 
scalar timeStep0_
 Time at start of injection time step [s]. More...
 
- Protected Attributes inherited from CloudSubModelBase< CloudType >
CloudTypeowner_
 Reference to the cloud. More...
 
- Protected Attributes inherited from subModelBase
const word modelName_
 Name of the sub-model. More...
 
dictionaryproperties_
 Reference to properties dictionary e.g. for restart. More...
 
const dictionary dict_
 Copy of dictionary used during construction. More...
 
const word baseName_
 Name of the sub-model base class. More...
 
const word modelType_
 Type of the sub-model. More...
 
const dictionary coeffDict_
 Coefficients dictionary. More...
 
- Protected Attributes inherited from patchInjectionBase
const word patchName_
 Patch name. More...
 
const label patchId_
 Patch ID. More...
 
scalarList sumProcArea_
 Cumulative sum of the total patch areas in each process. More...
 
scalarList sumFaceArea_
 Cumulative sum of the face areas in the patch. More...
 
scalarListList sumFaceTriArea_
 Cumulative sum of the triangle areas in each patch face. More...
 

Detailed Description

template<class CloudType>
class Foam::PatchFlowRateInjection< CloudType >

Patch injection, by using patch flow rate to determine concentration and velocity.

User specifies:

  • Name of patch
  • Injection duration
  • Injection target concentration/carrier volume flow rate

Properties:

  • Initial parcel velocity given by local flow velocity
  • Parcel diameters obtained by distribution model
  • Parcels injected randomly across the patch
Source files

Definition at line 63 of file PatchFlowRateInjection.H.

Constructor & Destructor Documentation

◆ PatchFlowRateInjection() [1/2]

PatchFlowRateInjection ( const dictionary dict,
CloudType owner,
const word modelName 
)

Construct from dictionary.

Definition at line 34 of file PatchFlowRateInjection.C.

◆ PatchFlowRateInjection() [2/2]

Construct copy.

Definition at line 74 of file PatchFlowRateInjection.C.

◆ ~PatchFlowRateInjection()

Destructor.

Definition at line 93 of file PatchFlowRateInjection.C.

Member Function Documentation

◆ TypeName()

TypeName ( "patchFlowRateInjection"  )

Runtime type information.

◆ clone()

virtual autoPtr<InjectionModel<CloudType> > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements InjectionModel< CloudType >.

Definition at line 109 of file PatchFlowRateInjection.H.

◆ topoChange() [1/2]

void topoChange
virtual

Set injector locations when mesh is updated.

Reimplemented from InjectionModel< CloudType >.

Definition at line 100 of file PatchFlowRateInjection.C.

References patchInjectionBase::topoChange().

Here is the call graph for this function:

◆ timeEnd()

Foam::scalar timeEnd
virtual

Return the end-of-injection time.

Implements InjectionModel< CloudType >.

Definition at line 107 of file PatchFlowRateInjection.C.

◆ flowRate()

Foam::scalar flowRate

Return the total volumetric flow rate across the patch [m^3/s].

Definition at line 114 of file PatchFlowRateInjection.C.

References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::dimVolumetricFlux, objectRegistry::lookupObject(), Foam::max(), Foam::reduce(), rho, and Foam::sum().

Here is the call graph for this function:

◆ nParcelsToInject()

Foam::label nParcelsToInject ( const scalar  time0,
const scalar  time1 
)
virtual

Number of parcels to introduce relative to SOI.

Implements InjectionModel< CloudType >.

Definition at line 144 of file PatchFlowRateInjection.C.

References Foam::constant::universal::c, rndGen(), and dimensioned< Type >::value().

Here is the call graph for this function:

◆ massToInject()

Foam::scalar massToInject ( const scalar  time0,
const scalar  time1 
)
virtual

Parcel mass to introduce relative to SOI.

Implements InjectionModel< CloudType >.

Definition at line 179 of file PatchFlowRateInjection.C.

References Foam::constant::universal::c, and dimensioned< Type >::value().

Here is the call graph for this function:

◆ setPositionAndCell() [1/2]

void setPositionAndCell ( const label  parcelI,
const label  nParcels,
const scalar  time,
barycentric coordinates,
label celli,
label tetFacei,
label tetPti,
label facei 
)
virtual

Set the injection position and owner cell, tetFace and tetPt.

Implements InjectionModel< CloudType >.

Definition at line 199 of file PatchFlowRateInjection.C.

References rndGen(), and patchInjectionBase::setPositionAndCell().

Here is the call graph for this function:

◆ setProperties()

void setProperties ( const label  parcelI,
const label  nParcels,
const scalar  time,
typename CloudType::parcelType::trackingData &  td,
typename CloudType::parcelType parcel 
)
virtual

Definition at line 225 of file PatchFlowRateInjection.C.

◆ fullyDescribed()

bool fullyDescribed
virtual

Flag to identify whether model fully describes the parcel.

Implements InjectionModel< CloudType >.

Definition at line 243 of file PatchFlowRateInjection.C.

◆ topoChange() [2/2]

void topoChange
virtual

Inherit topoChange from patchInjectionBase.

Reimplemented from InjectionModel< CloudType >.

Definition at line 104 of file patchInjectionBase.C.

◆ setPositionAndCell() [2/2]

void setPositionAndCell

Inherit setPositionAndCell from patchInjectionBase.

Definition at line 107 of file patchInjectionBase.C.

References tetIndices::faceTri(), and triangle< Point, PointRef >::mag().

Here is the call graph for this function:

The documentation for this class was generated from the following files: