InjectedParticleDistributionInjection< CloudType > Class Template Reference

Interrogates an injectedParticleCloud to convert the raw particle data into a set of 'binned' injectors. More...

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

Public Member Functions

 TypeName ("injectedParticleDistributionInjection")
 Runtime type information. More...
 
 InjectedParticleDistributionInjection (const dictionary &dict, CloudType &owner, const word &modelName)
 Construct from dictionary. More...
 
 InjectedParticleDistributionInjection (const InjectedParticleDistributionInjection< CloudType > &im)
 Construct copy. More...
 
virtual autoPtr< InjectionModel< CloudType > > clone () const
 Construct and return a clone. More...
 
virtual ~InjectedParticleDistributionInjection ()
 Destructor. More...
 
virtual void updateMesh ()
 Set injector locations when mesh is updated. More...
 
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...
 
void info (Ostream &os)
 Write injection info to stream. 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...
 

Protected Member Functions

void initialise ()
 Initialise injectors. 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

const word cloudName_
 Name of cloud used to seed the new particles. More...
 
scalarList startTime_
 List of start time per injector. More...
 
scalarList endTime_
 List of end time per injector. More...
 
List< vectorListposition_
 List of position per injector. More...
 
vector positionOffset_
 Position offset to apply to input positions. More...
 
scalarList volumeFlowRate_
 List of volume flow rate per injector [m3/s]. More...
 
List< vectorListU_
 List of parcel velocity per injector. More...
 
scalar binWidth_
 Bin width when generating particle distributions. More...
 
PtrList< distributionModels::generalsizeDistribution_
 List of size distribution model per injector. More...
 
scalar parcelsPerInjector_
 Target number of parcels to inject per injector. More...
 
label resampleSize_
 Resample size. More...
 
bool applyDistributionMassTotal_
 Flag to apply mass calculated from distribution instead of. More...
 
Switch ignoreOutOfBounds_
 Flag to suppress errors if particle injection site is out-of-bounds. More...
 
label nParcelsInjected_
 Running total of number of parcels injected. More...
 
label nParcelsInjected0_
 Number of parcels injected in last step (local proc only) More...
 
label currentInjectori_
 Current injector. More...
 
label currentSamplei_
 Current sample. 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...
 

Additional Inherited Members

- 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...
 
- 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...
 

Detailed Description

template<class CloudType>
class Foam::InjectedParticleDistributionInjection< CloudType >

Interrogates an injectedParticleCloud to convert the raw particle data into a set of 'binned' injectors.

The bins are set according to the particle tag property, from which:

  • diameters are converted into general distributions with a user-specified bin width
  • raw velocity and diameter data are resampled and stored to provide variations per injector

The mass to inject can be set according to the raw input data mass total by using the applyDistributionMassTotal switch

Usage
model1
{
    type            injectedParticleDistributionInjection;
    SOI             0;
    parcelBasisType mass;
    cloud           eulerianParticleCloud;
    positionOffset  (-0.025 2 -0.025);
    binWidth        0.1e-3;
    parcelsPerInjector 500;
    resampleSize    100;                    // optional
    applyDistributionMassTotal yes;

    // Placeholder only when using applyDistributionMassTotal
    massTotal       0;
}
Note
The each injector location is assumed to be operating under steady conditions, i.e. using a constant flow rate profile
Source files
See also
Foam::injectedParticle Foam::injectedParticleCloud Foam::functionObjects::extractEulerianParticles Foam::distributionModels::general

Definition at line 94 of file InjectedParticleDistributionInjection.H.

Constructor & Destructor Documentation

◆ InjectedParticleDistributionInjection() [1/2]

◆ InjectedParticleDistributionInjection() [2/2]

◆ ~InjectedParticleDistributionInjection()

Destructor.

Definition at line 356 of file InjectedParticleDistributionInjection.C.

Member Function Documentation

◆ initialise()

void initialise
protected

Initialise injectors.

Definition at line 38 of file InjectedParticleDistributionInjection.C.

References List< T >::append(), Foam::endl(), forAll, Random::globalPosition(), Foam::Info, max(), mesh, Foam::min(), p, Foam::constant::mathematical::pi(), Foam::pow3(), rndGen, List< T >::set(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), UList< T >::size(), List< T >::transfer(), and U.

Referenced by InjectedParticleDistributionInjection< CloudType >::InjectedParticleDistributionInjection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TypeName()

TypeName ( "injectedParticleDistributionInjection"  )

Runtime type information.

◆ clone()

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

Construct and return a clone.

Implements InjectionModel< CloudType >.

Definition at line 184 of file InjectedParticleDistributionInjection.H.

◆ updateMesh()

void updateMesh
virtual

Set injector locations when mesh is updated.

Reimplemented from InjectionModel< CloudType >.

Definition at line 364 of file InjectedParticleDistributionInjection.C.

◆ timeEnd()

Foam::scalar timeEnd
virtual

Return the end-of-injection time.

Implements InjectionModel< CloudType >.

Definition at line 370 of file InjectedParticleDistributionInjection.C.

References Foam::max().

Here is the call graph for this function:

◆ 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 378 of file InjectedParticleDistributionInjection.C.

References forAll, Foam::min(), and Foam::returnReduce().

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 420 of file InjectedParticleDistributionInjection.C.

References forAll, and Foam::min().

Here is the call graph for this function:

◆ setPositionAndCell()

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 441 of file InjectedParticleDistributionInjection.C.

References Random::globalPosition().

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 470 of file InjectedParticleDistributionInjection.C.

◆ fullyDescribed()

bool fullyDescribed
virtual

Flag to identify whether model fully describes the parcel.

Implements InjectionModel< CloudType >.

Definition at line 492 of file InjectedParticleDistributionInjection.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 499 of file InjectedParticleDistributionInjection.C.

◆ info()

void info ( Ostream os)
virtual

Write injection info to stream.

Reimplemented from InjectionModel< CloudType >.

Definition at line 509 of file InjectedParticleDistributionInjection.C.

References dict, dictName(), forAll, ensightCells::info(), Foam::name(), os(), and general::writeDict().

Here is the call graph for this function:

Member Data Documentation

◆ cloudName_

const word cloudName_
protected

Name of cloud used to seed the new particles.

Definition at line 103 of file InjectedParticleDistributionInjection.H.

◆ startTime_

scalarList startTime_
protected

◆ endTime_

scalarList endTime_
protected

List of end time per injector.

Definition at line 109 of file InjectedParticleDistributionInjection.H.

◆ position_

List<vectorList> position_
protected

List of position per injector.

Definition at line 112 of file InjectedParticleDistributionInjection.H.

◆ positionOffset_

vector positionOffset_
protected

Position offset to apply to input positions.

Definition at line 115 of file InjectedParticleDistributionInjection.H.

◆ volumeFlowRate_

scalarList volumeFlowRate_
protected

List of volume flow rate per injector [m3/s].

Definition at line 118 of file InjectedParticleDistributionInjection.H.

◆ U_

List<vectorList> U_
protected

List of parcel velocity per injector.

Definition at line 121 of file InjectedParticleDistributionInjection.H.

◆ binWidth_

scalar binWidth_
protected

Bin width when generating particle distributions.

Definition at line 124 of file InjectedParticleDistributionInjection.H.

◆ sizeDistribution_

PtrList<distributionModels::general> sizeDistribution_
protected

◆ parcelsPerInjector_

scalar parcelsPerInjector_
protected

Target number of parcels to inject per injector.

Definition at line 130 of file InjectedParticleDistributionInjection.H.

◆ resampleSize_

label resampleSize_
protected

Resample size.

Definition at line 133 of file InjectedParticleDistributionInjection.H.

◆ applyDistributionMassTotal_

bool applyDistributionMassTotal_
protected

Flag to apply mass calculated from distribution instead of.

InjectionModel massTotal_

Definition at line 137 of file InjectedParticleDistributionInjection.H.

Referenced by InjectedParticleDistributionInjection< CloudType >::InjectedParticleDistributionInjection().

◆ ignoreOutOfBounds_

Switch ignoreOutOfBounds_
protected

Flag to suppress errors if particle injection site is out-of-bounds.

Definition at line 140 of file InjectedParticleDistributionInjection.H.

◆ nParcelsInjected_

label nParcelsInjected_
protected

Running total of number of parcels injected.

Definition at line 143 of file InjectedParticleDistributionInjection.H.

◆ nParcelsInjected0_

label nParcelsInjected0_
protected

Number of parcels injected in last step (local proc only)

Definition at line 146 of file InjectedParticleDistributionInjection.H.

◆ currentInjectori_

label currentInjectori_
protected

Current injector.

Definition at line 149 of file InjectedParticleDistributionInjection.H.

◆ currentSamplei_

label currentSamplei_
protected

Current sample.

Definition at line 152 of file InjectedParticleDistributionInjection.H.


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