PatchInjection< CloudType > Class Template Reference

Patch injection. More...

Inheritance diagram for PatchInjection< CloudType >:
[legend]
Collaboration diagram for PatchInjection< CloudType >:
[legend]

Public Types

enum  velocityType { vtFixedValue , vtPatchValue , vtZeroGradient }
 Velocity type enumeration. More...
 
- Public Types inherited from InjectionModel< CloudType >
enum  parcelBasis { pbNumber , pbMass , pbFixed }
 
typedef CloudType::parcelType parcelType
 Convenience typedef for parcelType. More...
 
- Public Types inherited from CloudSubModelBase< CloudType >
typedef CloudType cloudType
 Type of cloud this model was instantiated for. More...
 

Public Member Functions

 TypeName ("patchInjection")
 Runtime type information. More...
 
 PatchInjection (const dictionary &dict, CloudType &owner, const word &modelName)
 Construct from dictionary. More...
 
 PatchInjection (const PatchInjection< CloudType > &im)
 Construct copy. More...
 
virtual autoPtr< InjectionModel< CloudType > > clone () const
 Construct and return a clone. More...
 
virtual ~PatchInjection ()=default
 Destructor. More...
 
virtual void updateMesh ()
 Set injector locations when mesh is updated. More...
 
virtual scalar timeEnd () const
 Return the end-of-injection time. More...
 
virtual label parcelsToInject (const scalar time0, const scalar time1)
 Number of parcels to introduce relative to SOI. More...
 
virtual scalar volumeToInject (const scalar time0, const scalar time1)
 Volume of parcels to introduce relative to SOI. More...
 
virtual void setPositionAndCell (const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
 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 &parcel)
 Set the parcel properties. More...
 
virtual bool fullyDescribed () const
 Flag to identify whether model fully describes the parcel. More...
 
virtual bool validInjection (const label parcelI)
 Return flag to identify whether or not injection of parcelI is. More...
 
virtual void updateMesh (const polyMesh &mesh)
 Inherit updateMesh from patchInjectionBase. More...
 
label setPositionAndCell (const fvMesh &mesh, const scalar fraction01, Random &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
 Inherit setPositionAndCell from patchInjectionBase. More...
 
virtual label setPositionAndCell (const fvMesh &mesh, Random &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
 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 autoPtr< InjectionModel< CloudType > > clone () const =0
 Construct and return a clone. More...
 
virtual ~InjectionModel ()=default
 Destructor. More...
 
virtual void updateMesh ()
 Update mesh. More...
 
scalar timeStart () const
 Return the start-of-injection time. More...
 
scalar volumeTotal () const
 Return the total volume to be injected across the event. More...
 
scalar massTotal () const
 Return mass of particles to introduce. More...
 
scalar massInjected () const
 Return mass of particles injected (cumulative) More...
 
label injectorID () const
 Return injectorID. More...
 
virtual scalar timeEnd () const =0
 Return the end-of-injection time. More...
 
virtual label parcelsToInject (const scalar time0, const scalar time1)=0
 Number of parcels to introduce relative to SOI. More...
 
virtual scalar volumeToInject (const scalar time0, const scalar time1)=0
 Volume of parcels to introduce relative to SOI. More...
 
virtual scalar averageParcelMass ()
 Return the average parcel mass over the injection period. 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, const scalar trackTime)
 Main injection loop - steady-state. More...
 
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. More...
 
virtual void setProperties (const label parcelI, const label nParcels, const scalar time, parcelType &parcel)=0
 Set the parcel properties. More...
 
virtual bool fullyDescribed () const =0
 Flag to identify whether model fully describes the parcel. 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)
 Construct as copy. 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...
 
virtual fileName localPath () const
 Output directory. 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)
 Construct as copy. 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 bool active () const
 Return the model 'active' status - default active = true. More...
 
virtual void cacheFields (const bool store)
 Cache dependent sub-model fields. More...
 
virtual bool writeTime () const
 Flag to indicate when to write a property. More...
 
virtual fileName localPath () const
 Output directory. More...
 
template<class Type >
Type getBaseProperty (const word &entryName, const Type &defaultValue=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...
 
bool getModelDict (const word &entryName, dictionary &dict) const
 Retrieve dictionary, return true if set. More...
 
template<class Type >
bool 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=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...
 
virtual void write (Ostream &os) const
 Write. 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 ()=default
 Destructor. More...
 
virtual void updateMesh (const polyMesh &mesh)
 Update patch geometry and derived info for injection locations. More...
 
label setPositionAndCell (const fvMesh &mesh, const scalar fraction01, Random &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
 Set the injection position and owner cell, tetFace and tetPt. More...
 
virtual label setPositionAndCell (const fvMesh &mesh, Random &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPti)
 Set the injection position and owner cell, tetFace and tetPt. More...
 
label whichProc (const scalar fraction01) const
 Return the processor that has the location specified by the fraction. More...
 

Static Public Attributes

static const Enum< velocityTypevelocityTypeNames_
 Velocity type names. More...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from InjectionModel< CloudType >
virtual bool validInjection (const label parcelI)=0
 Additional flag to identify whether or not injection of parcelI is. More...
 
virtual bool prepareForNextTimeStep (const scalar time, label &newParcels, scalar &newVolumeFraction)
 Determine properties for next time step/injection interval. More...
 
virtual bool findCellAtPosition (label &celli, label &tetFacei, label &tetPti, vector &position, bool errorOnNotFound=true)
 Find the cell that contains the supplied position. More...
 
virtual scalar setNumberOfParticles (const label parcels, const scalar volumeFraction, const scalar diameter, const scalar rho)
 Set number of particles to inject given parcel properties. More...
 
virtual void postInjectCheck (const label parcelsAdded, const scalar massAdded)
 Post injection checks. 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 volumeTotal_
 
scalar massTotal_
 Total mass to inject [kg]. More...
 
autoPtr< Function1< scalar > > massFlowRate_
 Mass flow rate profile for steady calculations. 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...
 
parcelBasis parcelBasis_
 Parcel basis enumeration. More...
 
scalar nParticleFixed_
 
scalar time0_
 Continuous phase time at start of injection time step [s]. More...
 
scalar timeStep0_
 Time at start of injection time step [s]. More...
 
scalar minParticlesPerParcel_
 
scalar delayedVolume_
 
label injectorID_
 Optional injector ID. More...
 
bool ignoreOutOfBounds_
 
- 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...
 
scalar patchArea_
 Patch area - total across all processors. More...
 
vectorList patchNormal_
 Patch face normal directions. More...
 
labelList cellOwners_
 List of cell labels corresponding to injector positions. More...
 
faceList triFace_
 Decomposed patch faces as a list of triangles. More...
 
labelList triToFace_
 Addressing from per triangle to patch face. More...
 
scalarList triCumulativeMagSf_
 Cumulative triangle area per triangle face. More...
 
scalarList sumTriMagSf_
 Cumulative area fractions per processor. More...
 

Detailed Description

template<class CloudType>
class Foam::PatchInjection< CloudType >

Patch injection.

User specifies:

  • Total mass to inject
  • Name of patch
  • Injection duration
  • Initial parcel velocity
  • Injection volume flow rate

Properties:

  • Parcel diameters obtained by distribution model
  • Parcels injected randomly across the patch
Source files

Definition at line 69 of file PatchInjection.H.

Member Enumeration Documentation

◆ velocityType

Velocity type enumeration.

Enumerator
vtFixedValue 

User supplied fixed value.

vtPatchValue 

Patch face values.

vtZeroGradient 

Patch internal cell values.

Definition at line 79 of file PatchInjection.H.

Constructor & Destructor Documentation

◆ PatchInjection() [1/2]

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

Construct from dictionary.

Definition at line 46 of file PatchInjection.C.

References IOobject::db(), DSMCCloud< ParcelType >::mesh(), Foam::New(), CloudSubModelBase< CloudType >::owner(), objectRegistry::time(), motionSmootherAlgo::updateMesh(), TimeState::userTimeToTime(), and InjectionModel< CloudType >::volumeTotal_.

Here is the call graph for this function:

◆ PatchInjection() [2/2]

Construct copy.

Definition at line 108 of file PatchInjection.C.

◆ ~PatchInjection()

virtual ~PatchInjection ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "patchInjection"  )

Runtime type information.

◆ clone()

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

Construct and return a clone.

Implements InjectionModel< CloudType >.

Definition at line 140 of file PatchInjection.H.

◆ updateMesh() [1/2]

void updateMesh
virtual

Set injector locations when mesh is updated.

Reimplemented from InjectionModel< CloudType >.

Definition at line 129 of file PatchInjection.C.

References mesh, and motionSmootherAlgo::updateMesh().

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 136 of file PatchInjection.C.

◆ parcelsToInject()

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

Number of parcels to introduce relative to SOI.

Implements InjectionModel< CloudType >.

Definition at line 143 of file PatchInjection.C.

References Random::globalPosition().

Here is the call graph for this function:

◆ volumeToInject()

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

Volume of parcels to introduce relative to SOI.

Implements InjectionModel< CloudType >.

Definition at line 175 of file PatchInjection.C.

◆ setPositionAndCell() [1/3]

void setPositionAndCell ( const label  parcelI,
const label  nParcels,
const scalar  time,
vector position,
label &  cellOwner,
label &  tetFacei,
label &  tetPti 
)
virtual

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

Implements InjectionModel< CloudType >.

Definition at line 191 of file PatchInjection.C.

References mesh, 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 parcel 
)
virtual

Set the parcel properties.

Implements InjectionModel< CloudType >.

Definition at line 217 of file PatchInjection.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, U, and WarningInFunction.

Here is the call graph for this function:

◆ fullyDescribed()

bool fullyDescribed
virtual

Flag to identify whether model fully describes the parcel.

Implements InjectionModel< CloudType >.

Definition at line 292 of file PatchInjection.C.

◆ validInjection()

bool validInjection ( const label  parcelI)
virtual

Return flag to identify whether or not injection of parcelI is.

permitted

Implements InjectionModel< CloudType >.

Definition at line 299 of file PatchInjection.C.

◆ updateMesh() [2/2]

void updateMesh ( const polyMesh mesh)
virtual

Inherit updateMesh from patchInjectionBase.

Reimplemented from patchInjectionBase.

Definition at line 116 of file patchInjectionBase.C.

◆ setPositionAndCell() [2/3]

Foam::label setPositionAndCell ( const fvMesh mesh,
const scalar  fraction01,
Random rnd,
vector position,
label &  cellOwner,
label &  tetFacei,
label &  tetPti 
)

Inherit setPositionAndCell from patchInjectionBase.

Definition at line 121 of file patchInjectionBase.C.

◆ setPositionAndCell() [3/3]

Foam::label setPositionAndCell ( const fvMesh mesh,
Random rnd,
vector position,
label &  cellOwner,
label &  tetFacei,
label &  tetPti 
)
virtual

Inherit setPositionAndCell from patchInjectionBase.

Reimplemented from patchInjectionBase.

Definition at line 134 of file patchInjectionBase.C.

Member Data Documentation

◆ velocityTypeNames_

const Foam::Enum< typename Foam::PatchInjection< CloudType >::velocityType > velocityTypeNames_
static

Velocity type names.

Definition at line 87 of file PatchInjection.H.


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