RecycleInteraction< CloudType > Class Template Reference

Patch interaction model to perform parcel transfer and recycle from one patch to another. More...

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

Public Member Functions

 TypeName ("recycleInteraction")
 Runtime type information. More...
 
 RecycleInteraction (const dictionary &dict, CloudType &cloud)
 Construct from dictionary. More...
 
 RecycleInteraction (const RecycleInteraction< CloudType > &pim)
 Construct copy from owner cloud and patch interaction model. More...
 
virtual autoPtr< PatchInteractionModel< CloudType > > clone () const
 Construct and return a clone using supplied owner cloud. More...
 
virtual ~RecycleInteraction ()=default
 Destructor. More...
 
virtual bool correct (typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)
 Apply velocity correction. More...
 
virtual void postEvolve ()
 Post-evolve hook. More...
 
virtual void info (Ostream &os)
 Write patch interaction info to stream. More...
 
- Public Member Functions inherited from PatchInteractionModel< CloudType >
 TypeName ("patchInteractionModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, PatchInteractionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
 Declare runtime constructor selection table. More...
 
 PatchInteractionModel (CloudType &owner)
 Construct null from owner. More...
 
 PatchInteractionModel (const dictionary &dict, CloudType &owner, const word &type)
 Construct from components. More...
 
 PatchInteractionModel (const PatchInteractionModel< CloudType > &pim)
 Construct copy. More...
 
virtual autoPtr< PatchInteractionModel< CloudType > > clone () const =0
 Construct and return a clone. More...
 
virtual ~PatchInteractionModel ()=default
 Destructor. More...
 
const wordUName () const
 Return name of velocity field. More...
 
const scalar & Urmax () const
 Return Urmax. More...
 
virtual bool correct (typename CloudType::parcelType &p, const polyPatch &pp, bool &keepParticle)=0
 Apply velocity correction. More...
 
virtual void addToEscapedParcels (const scalar mass)
 Add to escaped parcels. More...
 
virtual void postEvolve ()
 Post-evolve hook. More...
 
virtual void info (Ostream &os)
 Write patch interaction 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 writeFile
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true)
 Construct from objectRegistry, prefix, fileName. More...
 
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true)
 
 writeFile (const writeFile &wf)
 Construct copy. More...
 
virtual ~writeFile ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read. More...
 
virtual OFstreamfile ()
 Return access to the file (if only 1) More...
 
virtual bool writeToFile () const
 Flag to allow writing to file. More...
 
virtual bool canWriteHeader () const
 Flag to allow writing the header. More...
 
virtual label charWidth () const
 Return width of character stream output. More...
 
virtual void writeCommented (Ostream &os, const string &str) const
 Write a commented string to stream. More...
 
virtual void writeTabbed (Ostream &os, const string &str) const
 Write a tabbed string to stream. More...
 
virtual void writeHeader (Ostream &os, const string &str) const
 Write a commented header to stream. More...
 
virtual void writeCurrentTime (Ostream &os) const
 Write the current time to stream. More...
 
virtual void writeBreak (Ostream &os) const
 Write a break marker to the stream. More...
 
template<class Type >
void writeHeaderValue (Ostream &os, const string &property, const Type &value) const
 Write a (commented) header property and value pair. More...
 
template<class Type >
void writeValue (Ostream &os, const Type &val) const
 Write a given value to stream with the space delimiter. More...
 

Protected Types

typedef CloudType::parcelType parcelType
 

Protected Member Functions

virtual void writeFileHeader (Ostream &os)
 Output file header information. More...
 
virtual void writeFileHeader (Ostream &os)
 Output file header information. More...
 
- Protected Member Functions inherited from subModelBase
bool inLine () const
 Flag to indicate whether data is/was read in-line. More...
 
- Protected Member Functions inherited from writeFile
void initStream (Ostream &os) const
 Initialise the output stream for writing. More...
 
fileName baseFileDir () const
 Return the base directory for output. More...
 
fileName baseTimeDir () const
 Return the base directory for the current time value. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Return autoPtr to a new file using the simulation start time. More...
 
virtual void resetFile (const word &name)
 Reset internal file pointer to new file with new name. More...
 
Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. More...
 
void operator= (const writeFile &)=delete
 No copy assignment. More...
 

Protected Attributes

const fvMeshmesh_
 Reference to mesh. More...
 
List< Pair< word > > recyclePatches_
 Outlet-inlet patch pair to apply parcel recycling. More...
 
List< Pair< label > > recyclePatchesIds_
 Patch IDs of recyclePatches. More...
 
List< IDLList< parcelType > > recycledParcels_
 Parcel IDs of recycled parcels. More...
 
List< List< label > > nRemoved_
 Number of parcels removed. More...
 
List< List< scalar > > massRemoved_
 Mass of parcels removed. More...
 
List< List< label > > nInjected_
 Number of parcels injected. More...
 
List< List< scalar > > massInjected_
 Mass of parcels injected. More...
 
Map< label > injIdToIndex_
 Injector ID to local index map. More...
 
PtrList< patchInjectionBaseinjectionPatchPtr_
 Injection patch pointer. More...
 
const scalar recycleFraction_
 Parcel fraction to be recycled from outlet to inlet. More...
 
bool outputByInjectorId_
 Flag to output escaped/mass particles sorted by injectorID. More...
 
- Protected Attributes inherited from PatchInteractionModel< CloudType >
const word UName_
 Name of velocity field - default = "U". More...
 
label escapedParcels_
 Number of parcels escaped. More...
 
scalar escapedMass_
 Mass of parcels escaped. More...
 
scalar Urmax_
 Maximum relative U with patch for particle to be removed. 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 writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const fileName prefix_
 Prefix. More...
 
word fileName_
 Name of file. More...
 
autoPtr< OFstreamfilePtr_
 File pointer. More...
 
label writePrecision_
 Write precision. More...
 
bool writeToFile_
 Flag to enable/disable writing to file. More...
 
bool updateHeader_
 
bool writtenHeader_
 Flag to identify whether the header has been written. More...
 
bool useUserTime_
 
scalar startTime_
 Start time value. More...
 

Additional Inherited Members

- Public Types inherited from PatchInteractionModel< CloudType >
enum  interactionType {
  itNone , itRebound , itStick , itEscape ,
  itOther
}
 
- Public Types inherited from CloudSubModelBase< CloudType >
typedef CloudType cloudType
 Type of cloud this model was instantiated for. More...
 
- Static Public Member Functions inherited from PatchInteractionModel< CloudType >
static autoPtr< PatchInteractionModel< CloudType > > New (const dictionary &dict, CloudType &owner)
 Selector. More...
 
static word interactionTypeToWord (const interactionType &itEnum)
 Convert interaction result to word. More...
 
static interactionType wordToInteractionType (const word &itWord)
 Convert word to interaction result. More...
 
- Static Public Attributes inherited from PatchInteractionModel< CloudType >
static wordList interactionTypeNames_
 
- Static Public Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing. More...
 

Detailed Description

template<class CloudType>
class Foam::RecycleInteraction< CloudType >

Patch interaction model to perform parcel transfer and recycle from one patch to another.

Parcels that hit a given 'outflow' patch are recycled to a given 'inflow' patch, with optional:

  • recycle fraction [0-1]
Usage
Minimal example by using constant/reactingCloud1Properties.subModels.multiInteractionCoeffs
multiInteractionCoeffs
{
    ...

    model1
    {
        // Mandatory entries (unmodifiable)
        patchInteractionModel    recycleInteraction;

        recycleInteractionCoeffs
        {
            recyclePatches
            (
                (<outletPatch1> <inletPatch1>)
                (<outletPatch2> <inletPatch2>)
                ...
            );

            recycleFraction      0.8; // [0-1]

            // Optional entries (unmodifiable)
            outputByInjectorId   false;
        }
    }

    ...
}

where the entries mean:

Property Description Type Reqd Dflt
patchInteractionModel

Type name: recycleInteraction

word yes -
recyclePatches

Names of outlet-inlet patch pairs

(word word) yes -
recycleFraction

Fraction of parcels recycled from

outlet to inlet

scalar yes -
outputByInjectorId

Flag to output escaped/mass

particles sorted by injectorID

bool no false
Source files

Definition at line 145 of file RecycleInteraction.H.

Member Typedef Documentation

◆ parcelType

typedef CloudType::parcelType parcelType
protected

Definition at line 151 of file RecycleInteraction.H.

Constructor & Destructor Documentation

◆ RecycleInteraction() [1/2]

◆ RecycleInteraction() [2/2]

Construct copy from owner cloud and patch interaction model.

Definition at line 133 of file RecycleInteraction.C.

◆ ~RecycleInteraction()

virtual ~RecycleInteraction ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeFileHeader()

void writeFileHeader ( Ostream os)
protectedvirtual

Output file header information.

Reimplemented from PatchInteractionModel< CloudType >.

Definition at line 33 of file RecycleInteraction.C.

References forAll, Foam::name(), and os().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "recycleInteraction"  )

Runtime type information.

◆ clone()

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

Construct and return a clone using supplied owner cloud.

Implements PatchInteractionModel< CloudType >.

Definition at line 217 of file RecycleInteraction.H.

◆ correct()

bool correct ( typename CloudType::parcelType p,
const polyPatch pp,
bool keepParticle 
)
virtual

Apply velocity correction.

Returns true if particle remains in same cell

Implements PatchInteractionModel< CloudType >.

Definition at line 156 of file RecycleInteraction.C.

References GeometricField< Type, PatchField, GeoMesh >::clone(), forAll, patchIdentifier::index(), and p.

Here is the call graph for this function:

◆ postEvolve()

void postEvolve
virtual

Post-evolve hook.

Reimplemented from PatchInteractionModel< CloudType >.

Definition at line 204 of file RecycleInteraction.C.

References PstreamBuffers::allProcs(), IOstream::eof(), PstreamBuffers::finishedSends(), forAll, UPtrList< T >::get(), PstreamBuffers::hasRecvData(), mesh, UPstream::nonBlocking, PstreamBuffers::nProcs(), p, UPstream::parRun(), PstreamBuffers::recvDataCount(), Foam::returnReduce(), rndGen, and PtrList< T >::set().

Here is the call graph for this function:

◆ info()

void info ( Ostream os)
virtual

Write patch interaction info to stream.

Reimplemented from PatchInteractionModel< CloudType >.

Definition at line 352 of file RecycleInteraction.C.

References Foam::endl(), forAll, forAllConstIters, ensightCells::info(), Pstream::listCombineGather(), Foam::nl, os(), List< T >::setSize(), Foam::tab, and Foam::Zero.

Here is the call graph for this function:

Member Data Documentation

◆ mesh_

const fvMesh& mesh_
protected

Reference to mesh.

Definition at line 156 of file RecycleInteraction.H.

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

◆ recyclePatches_

List<Pair<word> > recyclePatches_
protected

Outlet-inlet patch pair to apply parcel recycling.

Definition at line 159 of file RecycleInteraction.H.

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

◆ recyclePatchesIds_

List<Pair<label> > recyclePatchesIds_
protected

Patch IDs of recyclePatches.

Definition at line 162 of file RecycleInteraction.H.

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

◆ recycledParcels_

List<IDLList<parcelType> > recycledParcels_
protected

Parcel IDs of recycled parcels.

Definition at line 165 of file RecycleInteraction.H.

◆ nRemoved_

List<List<label> > nRemoved_
protected

Number of parcels removed.

Definition at line 171 of file RecycleInteraction.H.

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

◆ massRemoved_

List<List<scalar> > massRemoved_
protected

Mass of parcels removed.

Definition at line 174 of file RecycleInteraction.H.

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

◆ nInjected_

List<List<label> > nInjected_
protected

Number of parcels injected.

Definition at line 177 of file RecycleInteraction.H.

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

◆ massInjected_

List<List<scalar> > massInjected_
protected

Mass of parcels injected.

Definition at line 180 of file RecycleInteraction.H.

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

◆ injIdToIndex_

Map<label> injIdToIndex_
protected

Injector ID to local index map.

Definition at line 184 of file RecycleInteraction.H.

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

◆ injectionPatchPtr_

PtrList<patchInjectionBase> injectionPatchPtr_
protected

Injection patch pointer.

Definition at line 187 of file RecycleInteraction.H.

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

◆ recycleFraction_

const scalar recycleFraction_
protected

Parcel fraction to be recycled from outlet to inlet.

Definition at line 190 of file RecycleInteraction.H.

◆ outputByInjectorId_

bool outputByInjectorId_
protected

Flag to output escaped/mass particles sorted by injectorID.

Definition at line 193 of file RecycleInteraction.H.

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


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