subModelBase Class Reference

Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read and write properties from a dictionary to enable clean re-starts. Used by, e.g. clou dsub-models. More...

Inheritance diagram for subModelBase:
[legend]
Collaboration diagram for subModelBase:
[legend]

Public Member Functions

 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

bool inLine () const
 Flag to indicate whether data is/was read in-line. More...
 

Protected Attributes

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

Detailed Description

Base class for generic sub-models requiring to be read from dictionary. Provides a mechanism to read and write properties from a dictionary to enable clean re-starts. Used by, e.g. clou dsub-models.

Source files

Definition at line 54 of file subModelBase.H.

Constructor & Destructor Documentation

◆ subModelBase() [1/4]

subModelBase ( dictionary properties)

Construct null.

Definition at line 41 of file subModelBase.C.

◆ subModelBase() [2/4]

subModelBase ( dictionary properties,
const dictionary dict,
const word baseName,
const word modelType,
const word dictExt = "Coeffs" 
)

Construct from components without name.

Definition at line 52 of file subModelBase.C.

◆ subModelBase() [3/4]

subModelBase ( const word modelName,
dictionary properties,
const dictionary dict,
const word baseName,
const word modelType 
)

Construct from components with name.

Definition at line 70 of file subModelBase.C.

◆ subModelBase() [4/4]

subModelBase ( const subModelBase smb)

Construct as copy.

Definition at line 88 of file subModelBase.C.

◆ ~subModelBase()

~subModelBase ( )
virtual

Destructor.

Definition at line 101 of file subModelBase.C.

Member Function Documentation

◆ inLine()

bool inLine ( ) const
protected

Flag to indicate whether data is/was read in-line.

Definition at line 33 of file subModelBase.C.

References subModelBase::modelName_.

◆ modelName()

const Foam::word & modelName ( ) const

Return const access to the name of the sub-model.

Definition at line 107 of file subModelBase.C.

Referenced by InjectedParticleInjection< CloudType >::InjectedParticleInjection(), and waveModel::lookupOrCreate().

Here is the caller graph for this function:

◆ dict()

◆ baseName()

const Foam::word & baseName ( ) const

Return const access to the base name of the sub-model.

Definition at line 119 of file subModelBase.C.

◆ modelType()

const Foam::word & modelType ( ) const

Return const access to the sub-model type.

Definition at line 125 of file subModelBase.C.

Referenced by filmSubModelBase::filmType(), injectionModel::New(), force::New(), filmThermoModel::New(), filmTurbulenceModel::New(), filmRadiationModel::New(), heatTransferModel::New(), phaseChangeModel::New(), transferModel::New(), and filmViscosityModel::New().

Here is the caller graph for this function:

◆ coeffDict()

◆ properties()

const Foam::dictionary & properties ( ) const

Return const access to the properties dictionary.

Definition at line 137 of file subModelBase.C.

Referenced by LiquidEvapFuchsKnudsen< CloudType >::dh(), LiquidEvaporation< CloudType >::dh(), and LiquidEvaporationBoil< CloudType >::dh().

Here is the caller graph for this function:

◆ defaultCoeffs()

bool defaultCoeffs ( const bool  printMsg) const
virtual

Returns true if defaultCoeffs is true and outputs on printMsg.

Definition at line 143 of file subModelBase.C.

References Foam::decrIndent(), Foam::endl(), Foam::incrIndent(), Foam::indent(), and Foam::Info.

Referenced by ETAB< CloudType >::ETAB(), PilchErdman< CloudType >::PilchErdman(), ReitzDiwakar< CloudType >::ReitzDiwakar(), and ReitzKHRT< CloudType >::ReitzKHRT().

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

◆ active()

◆ cacheFields()

void cacheFields ( const bool  store)
virtual

◆ writeTime()

◆ localPath()

◆ getBaseProperty() [1/2]

Type getBaseProperty ( const word entryName,
const Type &  defaultValue = Type(Zero) 
) const

Retrieve generic property from the base model.

Definition at line 31 of file subModelBaseTemplates.C.

References subModelBase::baseName_, dictionary::found(), subModelBase::properties_, dictionary::readIfPresent(), and dictionary::subDict().

Referenced by injectionModelList::info(), and transferModelList::info().

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

◆ getBaseProperty() [2/2]

void getBaseProperty ( const word entryName,
Type &  value 
) const

Retrieve generic property from the base model.

Definition at line 50 of file subModelBaseTemplates.C.

References dictionary::readIfPresent(), and dictionary::subDict().

Here is the call graph for this function:

◆ setBaseProperty()

void setBaseProperty ( const word entryName,
const Type &  value 
)

Add generic property to the base model.

Definition at line 65 of file subModelBaseTemplates.C.

References dictionary::add(), and dictionary::subDict().

Referenced by injectionModelList::info(), and transferModelList::info().

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

◆ getModelDict()

bool getModelDict ( const word entryName,
dictionary dict 
) const

Retrieve dictionary, return true if set.

Definition at line 184 of file subModelBase.C.

References dict, dictionary::found(), dictionary::subDict(), and dictionary::subOrEmptyDict().

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

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

◆ getModelProperty() [1/2]

bool getModelProperty ( const word entryName,
Type &  value 
) const

Retrieve generic property from the sub-model.

Return true if found

Definition at line 85 of file subModelBaseTemplates.C.

References dictionary::found(), dictionary::readIfPresent(), and dictionary::subDict().

Referenced by ParticleZoneInfo< CloudType >::ParticleZoneInfo(), and RemoveParcels< CloudType >::RemoveParcels().

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

◆ getModelProperty() [2/2]

Type getModelProperty ( const word entryName,
const Type &  defaultValue = Type(Zero) 
) const

Retrieve generic property from the sub-model.

Definition at line 110 of file subModelBaseTemplates.C.

◆ setModelProperty()

void setModelProperty ( const word entryName,
const Type &  value 
)

Add generic property to the sub-model.

Definition at line 123 of file subModelBaseTemplates.C.

References dictionary::add(), dictionary::found(), and dictionary::subDict().

Here is the call graph for this function:

◆ write()

Member Data Documentation

◆ modelName_

const word modelName_
protected

Name of the sub-model.

Definition at line 67 of file subModelBase.H.

Referenced by subModelBase::inLine().

◆ properties_

dictionary& properties_
protected

Reference to properties dictionary e.g. for restart.

Definition at line 70 of file subModelBase.H.

Referenced by subModelBase::getBaseProperty().

◆ dict_

const dictionary dict_
protected

Copy of dictionary used during construction.

Definition at line 73 of file subModelBase.H.

◆ baseName_

const word baseName_
protected

Name of the sub-model base class.

Definition at line 76 of file subModelBase.H.

Referenced by subModelBase::getBaseProperty().

◆ modelType_

const word modelType_
protected

Type of the sub-model.

Definition at line 79 of file subModelBase.H.

◆ coeffDict_


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