option Class Reference

Finite volume options abstract base class. Provides a base set of controls, e.g.: More...

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

Classes

class  iNew
 Return pointer to new fvOption object created. More...
 

Public Member Functions

 TypeName ("option")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, option, dictionary,(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh),(name, modelType, dict, mesh))
 
 option (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 Construct from components. More...
 
autoPtr< optionclone () const
 Return clone. More...
 
virtual ~option ()=default
 Destructor. More...
 
const wordname () const
 Return const access to the source name. More...
 
const fvMeshmesh () const
 Return const access to the mesh database. More...
 
const dictionarycoeffs () const
 Return dictionary. More...
 
bool active () const
 Return const access to the source active flag. More...
 
void setApplied (const label fieldi)
 Set the applied flag to true for field index fieldi. More...
 
Switchactive ()
 Return access to the source active flag. More...
 
virtual bool isActive ()
 Is the source active? More...
 
virtual label applyToField (const word &fieldName) const
 Return index of field name if found in fieldNames list. More...
 
virtual void checkApplied () const
 Check that the source has been applied. More...
 
virtual void addSup (fvMatrix< scalar > &eqn, const label fieldi)
 
virtual void addSup (fvMatrix< vector > &eqn, const label fieldi)
 
virtual void addSup (fvMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void addSup (fvMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void addSup (fvMatrix< tensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &rho, fvMatrix< vector > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &rho, fvMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &rho, fvMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &rho, fvMatrix< tensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &alpha, const volScalarField &rho, fvMatrix< vector > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &alpha, const volScalarField &rho, fvMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &alpha, const volScalarField &rho, fvMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void addSup (const volScalarField &alpha, const volScalarField &rho, fvMatrix< tensor > &eqn, const label fieldi)
 
virtual void constrain (fvMatrix< scalar > &eqn, const label fieldi)
 
virtual void constrain (fvMatrix< vector > &eqn, const label fieldi)
 
virtual void constrain (fvMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void constrain (fvMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void constrain (fvMatrix< tensor > &eqn, const label fieldi)
 
virtual void correct (volScalarField &field)
 
virtual void correct (volVectorField &field)
 
virtual void correct (volSphericalTensorField &field)
 
virtual void correct (volSymmTensorField &field)
 
virtual void correct (volTensorField &field)
 
virtual void writeHeader (Ostream &) const
 Write the source header information. More...
 
virtual void writeFooter (Ostream &) const
 Write the source footer information. More...
 
virtual void writeData (Ostream &) const
 Write the source properties. More...
 
virtual bool read (const dictionary &dict)
 Read source dictionary. More...
 

Static Public Member Functions

static autoPtr< optionNew (const word &name, const dictionary &dict, const fvMesh &mesh)
 Return a reference to the selected fvOption model. More...
 

Public Attributes

bool log
 Switch write log to Info. More...
 

Protected Attributes

const word name_
 Source name. More...
 
const word modelType_
 Model type. More...
 
const fvMeshmesh_
 Reference to the mesh database. More...
 
dictionary dict_
 Top level source dictionary. More...
 
dictionary coeffs_
 Dictionary containing source coefficients. More...
 
Switch active_
 Source active flag. More...
 
wordList fieldNames_
 Field names to apply source to - populated by derived models. More...
 
List< boolapplied_
 Applied flag list - corresponds to each fieldNames_ entry. More...
 

Detailed Description

Finite volume options abstract base class. Provides a base set of controls, e.g.:

    type            scalarExplicitSource    // source type
    active          on;                     // on/off switch
Note
On evaluation, source/sink options are to be added to the equation R.H.S.
Source files

Definition at line 69 of file fvOption.H.

Constructor & Destructor Documentation

◆ option()

option ( const word name,
const word modelType,
const dictionary dict,
const fvMesh mesh 
)

Construct from components.

Definition at line 47 of file fvOption.C.

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

Here is the call graph for this function:

◆ ~option()

virtual ~option ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "option"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
option  ,
dictionary  ,
(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh ,
(name, modelType, dict, mesh  
)

◆ clone()

autoPtr<option> clone ( ) const
inline

Return clone.

Definition at line 137 of file fvOption.H.

References NotImplemented.

◆ New()

Foam::autoPtr< Foam::fv::option > New ( const word name,
const dictionary dict,
const fvMesh mesh 
)
static

Return a reference to the selected fvOption model.

Definition at line 71 of file fvOption.C.

References HashTable< T, Key, Hash >::cfind(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), Foam::indent(), Foam::Info, mesh, and Foam::name().

Referenced by option::iNew::operator()(), and optionList::reset().

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

◆ name()

const Foam::word & name ( ) const
inline

Return const access to the source name.

Definition at line 30 of file fvOptionI.H.

References option::name_.

Referenced by optionAdjointList::constrain(), optionAdjointList::correct(), atmNutSource::correct(), multiphaseStabilizedTurbulence::correct(), optionList::correct(), optionAdjointList::operator()(), optionList::operator()(), optionAdjointList::readOptionAdjoints(), optionList::readOptions(), interRegionHeatTransferModel::setNbrModel(), and optionList::source().

Here is the caller graph for this function:

◆ mesh()

const Foam::fvMesh & mesh ( ) const
inline

Return const access to the mesh database.

Definition at line 36 of file fvOptionI.H.

◆ coeffs()

const Foam::dictionary & coeffs ( ) const
inline

Return dictionary.

Definition at line 42 of file fvOptionI.H.

◆ active() [1/2]

bool active ( ) const
inline

Return const access to the source active flag.

Definition at line 48 of file fvOptionI.H.

◆ setApplied()

void setApplied ( const label  fieldi)
inline

Set the applied flag to true for field index fieldi.

Definition at line 54 of file fvOptionI.H.

Referenced by optionAdjointList::constrain(), optionAdjointList::correct(), optionList::correct(), optionAdjointList::operator()(), optionList::operator()(), and optionList::source().

Here is the caller graph for this function:

◆ active() [2/2]

Foam::Switch & active ( )
inline

Return access to the source active flag.

Definition at line 60 of file fvOptionI.H.

◆ isActive()

bool isActive ( )
virtual

Is the source active?

Reimplemented in cellSetOption.

Definition at line 108 of file fvOption.C.

References option::active_.

Referenced by optionAdjointList::constrain(), optionAdjointList::correct(), optionList::correct(), cellSetOption::isActive(), optionAdjointList::operator()(), optionList::operator()(), and optionList::source().

Here is the caller graph for this function:

◆ applyToField()

Foam::label applyToField ( const word fieldName) const
virtual

Return index of field name if found in fieldNames list.

Definition at line 114 of file fvOption.C.

Referenced by optionList::appliesToField(), optionAdjointList::constrain(), optionAdjointList::correct(), optionList::correct(), optionAdjointList::operator()(), optionList::operator()(), and optionList::source().

Here is the caller graph for this function:

◆ checkApplied()

void checkApplied ( ) const
virtual

Check that the source has been applied.

Definition at line 120 of file fvOption.C.

References Foam::endl(), forAll, and WarningInFunction.

Referenced by optionList::checkApplied(), and optionAdjointList::checkApplied().

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

◆ addSup() [1/15]

void addSup ( fvMatrix< scalar > &  eqn,
const label  fieldi 
)
virtual

◆ addSup() [2/15]

◆ addSup() [3/15]

void addSup ( fvMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 159 of file fvOption.C.

◆ addSup() [4/15]

void addSup ( fvMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 151 of file fvOption.C.

◆ addSup() [5/15]

void addSup ( fvMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 167 of file fvOption.C.

◆ addSup() [6/15]

◆ addSup() [7/15]

◆ addSup() [8/15]

void addSup ( const volScalarField rho,
fvMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 202 of file fvOption.C.

◆ addSup() [9/15]

void addSup ( const volScalarField rho,
fvMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 193 of file fvOption.C.

◆ addSup() [10/15]

void addSup ( const volScalarField rho,
fvMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 211 of file fvOption.C.

◆ addSup() [11/15]

void addSup ( const volScalarField alpha,
const volScalarField rho,
fvMatrix< scalar > &  eqn,
const label  fieldi 
)
virtual

◆ addSup() [12/15]

void addSup ( const volScalarField alpha,
const volScalarField rho,
fvMatrix< vector > &  eqn,
const label  fieldi 
)
virtual

◆ addSup() [13/15]

void addSup ( const volScalarField alpha,
const volScalarField rho,
fvMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 256 of file fvOption.C.

References Foam::constant::atomic::alpha, and rho.

◆ addSup() [14/15]

void addSup ( const volScalarField alpha,
const volScalarField rho,
fvMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 244 of file fvOption.C.

References Foam::constant::atomic::alpha, and rho.

◆ addSup() [15/15]

void addSup ( const volScalarField alpha,
const volScalarField rho,
fvMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 268 of file fvOption.C.

References Foam::constant::atomic::alpha, and rho.

◆ constrain() [1/5]

void constrain ( fvMatrix< scalar > &  eqn,
const label  fieldi 
)
virtual

Reimplemented in fixedTemperatureConstraint.

Definition at line 279 of file fvOption.C.

Referenced by optionAdjointList::constrain().

Here is the caller graph for this function:

◆ constrain() [2/5]

void constrain ( fvMatrix< vector > &  eqn,
const label  fieldi 
)
virtual

◆ constrain() [3/5]

void constrain ( fvMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 288 of file fvOption.C.

◆ constrain() [4/5]

void constrain ( fvMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 296 of file fvOption.C.

◆ constrain() [5/5]

void constrain ( fvMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 303 of file fvOption.C.

◆ correct() [1/5]

void correct ( volScalarField field)
virtual

Reimplemented in limitTemperature, multiphaseStabilizedTurbulence, and atmNutSource.

Definition at line 307 of file fvOption.C.

Referenced by optionAdjointList::correct(), and optionList::correct().

Here is the caller graph for this function:

◆ correct() [2/5]

void correct ( volVectorField field)
virtual

Reimplemented in directionalPressureGradientExplicitSource, meanVelocityForce, and limitVelocity.

Definition at line 311 of file fvOption.C.

◆ correct() [3/5]

void correct ( volSphericalTensorField field)
virtual

Definition at line 315 of file fvOption.C.

◆ correct() [4/5]

void correct ( volSymmTensorField field)
virtual

Definition at line 319 of file fvOption.C.

◆ correct() [5/5]

void correct ( volTensorField field)
virtual

Definition at line 323 of file fvOption.C.

◆ writeHeader()

void writeHeader ( Ostream os) const
virtual

Write the source header information.

Definition at line 33 of file fvOptionIO.C.

References Ostream::beginBlock(), and option::name_.

Here is the call graph for this function:

◆ writeFooter()

void writeFooter ( Ostream os) const
virtual

Write the source footer information.

Definition at line 39 of file fvOptionIO.C.

References Ostream::endBlock().

Here is the call graph for this function:

◆ writeData()

void writeData ( Ostream os) const
virtual

Write the source properties.

Reimplemented in directionalPressureGradientExplicitSource, and velocityDampingConstraint.

Definition at line 45 of file fvOptionIO.C.

References Foam::nl, Foam::type(), and Ostream::writeEntry().

Here is the call graph for this function:

◆ read()

bool read ( const dictionary dict)
virtual

Read source dictionary.

Reimplemented in actuationDiskSource, effectivenessHeatExchangerSource, solidificationMeltingSource, rotorDiskSource, atmBuoyancyTurbSource, atmLengthScaleTurbSource, atmAmbientTurbSource, jouleHeatingSource, atmCoriolisUSource, directionalPressureGradientExplicitSource, atmPlantCanopyTurbSource, VoFSolidificationMeltingSource, radialActuationDiskSource, CodedSource< Type >, tabulatedNTUHeatTransfer, atmPlantCanopyTSource, atmPlantCanopyUSource, interRegionHeatTransferModel, cellSetOption, multiphaseStabilizedTurbulence, acousticDampingSource, interRegionExplicitPorositySource, meanVelocityForce, multiphaseMangrovesTurbulenceModel, atmNutSource, explicitPorositySource, multiphaseMangrovesSource, fixedTemperatureConstraint, velocityDampingConstraint, tabulatedAccelerationSource, PhaseLimitStabilization< Type >, viscousDissipation, limitTemperature, buoyancyForce, variableHeatTransfer, limitVelocity, radiation, tabulatedHeatTransfer, interRegionOption, buoyancyEnergy, FixedValueConstraint< Type >, and constantHeatTransfer.

Definition at line 55 of file fvOptionIO.C.

References dict, and Foam::log().

Referenced by interRegionOption::read(), radiation::read(), tabulatedAccelerationSource::read(), multiphaseMangrovesSource::read(), multiphaseMangrovesTurbulenceModel::read(), cellSetOption::read(), tabulatedNTUHeatTransfer::read(), jouleHeatingSource::read(), optionAdjointList::readOptionAdjoints(), and optionList::readOptions().

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

Member Data Documentation

◆ name_

const word name_
protected

◆ modelType_

const word modelType_
protected

Model type.

Definition at line 79 of file fvOption.H.

◆ mesh_

◆ dict_

dictionary dict_
protected

Top level source dictionary.

Definition at line 85 of file fvOption.H.

◆ coeffs_

◆ active_

Switch active_
protected

Source active flag.

Definition at line 91 of file fvOption.H.

Referenced by option::isActive().

◆ fieldNames_

wordList fieldNames_
protected

Field names to apply source to - populated by derived models.

Definition at line 94 of file fvOption.H.

Referenced by multiphaseStabilizedTurbulence::correct(), explicitPorositySource::read(), and multiphaseMangrovesTurbulenceModel::read().

◆ applied_

List<bool> applied_
protected

Applied flag list - corresponds to each fieldNames_ entry.

Definition at line 97 of file fvOption.H.

Referenced by explicitPorositySource::read(), and multiphaseMangrovesTurbulenceModel::read().

◆ log

bool log

Switch write log to Info.

Definition at line 106 of file fvOption.H.


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