option Class Reference

Base abstract class for handling finite area options (i.e. faOption). More...

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

Classes

class  iNew
 

Public Member Functions

 TypeName ("option")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, option, dictionary,(const word &name, const word &modelType, const dictionary &dict, const fvPatch &patch),(name, modelType, dict, patch))
 
 option (const word &name, const word &modelType, const dictionary &dict, const fvPatch &patch)
 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 fvPatchpatch () const
 Return const access to fvPatch. 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...
 
const faMeshregionMesh () const
 Return the region mesh database. More...
 
const volSurfaceMappingvsm () const
 Return volSurfaceMapping. More...
 
const wordregionName () const
 Region name. 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 (const areaScalarField &h, faMatrix< scalar > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, faMatrix< vector > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, faMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, faMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, faMatrix< tensor > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< scalar > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< vector > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void addSup (const areaScalarField &h, const areaScalarField &rho, faMatrix< tensor > &eqn, const label fieldi)
 
virtual void constrain (faMatrix< scalar > &eqn, const label fieldi)
 
virtual void constrain (faMatrix< vector > &eqn, const label fieldi)
 
virtual void constrain (faMatrix< sphericalTensor > &eqn, const label fieldi)
 
virtual void constrain (faMatrix< symmTensor > &eqn, const label fieldi)
 
virtual void constrain (faMatrix< tensor > &eqn, const label fieldi)
 
virtual void correct (areaScalarField &field)
 
virtual void correct (areaVectorField &field)
 
virtual void correct (areaSphericalTensorField &field)
 
virtual void correct (areaSymmTensorField &field)
 
virtual void correct (areaTensorField &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 fvPatch &patch)
 Return a reference to the selected faOption model. More...
 

Protected Attributes

const word name_
 Source name. More...
 
const word modelType_
 Model type. More...
 
const fvMeshmesh_
 Reference to the mesh database. More...
 
const fvPatchpatch_
 Reference to the patch. 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...
 
word regionName_
 Region name. More...
 
autoPtr< faMeshregionMeshPtr_
 Pointer to the region mesh database. More...
 
autoPtr< volSurfaceMappingvsmPtr_
 Volume-to surface mapping. More...
 

Detailed Description

Base abstract class for handling finite area options (i.e. faOption).

Usage
Minimal example by using constant/faOptions:
<userDefinedName1>
{
    // Mandatory entries (unmodifiable)
    type              <faOptionName>;

    // Mandatory entries (runtime modifiable)
    region            <regionName>;

    // Optional entries (unmodifiable/runtime modifiable)
    <faOption>Coeffs
    {
        // subdictionary entries
    }

    // Optional entries (runtime modifiable)
    active            true;
    log               true;
}

where the entries mean:

Property Description Type Reqd Dflt
type Name of operand faOption word yes -
region Name of operand region word yes -
<faOption>Coeffs Dictionary containing settings of the selected faOption settings dictionary no -
active Flag to (de)activate faOption bool no true
log Flag to log faOption-related info bool no true
Note
  • Source/sink options are to be added to the right-hand side of equations.
Source files

Definition at line 134 of file faOption.H.

Constructor & Destructor Documentation

◆ option()

option ( const word name,
const word modelType,
const dictionary dict,
const fvPatch patch 
)

Construct from components.

Definition at line 57 of file faOption.C.

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

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 fvPatch &patch ,
(name, modelType, dict, patch  
)

◆ clone()

autoPtr<option> clone ( ) const
inline

Return clone.

Definition at line 218 of file faOption.H.

References NotImplemented.

◆ New()

Foam::autoPtr< Foam::fa::option > New ( const word name,
const dictionary dict,
const fvPatch patch 
)
static

Return a reference to the selected faOption model.

Definition at line 86 of file faOption.C.

References HashTable< T, Key, Hash >::cfind(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::get(), Foam::indent(), Foam::Info, Foam::name(), Foam::nl, and Foam::foamVersion::patch.

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

References option::name_.

Referenced by optionList::correct(), optionList::operator()(), optionList::readOptions(), 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 faOptionI.H.

◆ patch()

const Foam::fvPatch & patch ( ) const
inline

Return const access to fvPatch.

Definition at line 42 of file faOptionI.H.

◆ coeffs()

const Foam::dictionary & coeffs ( ) const
inline

Return dictionary.

Definition at line 48 of file faOptionI.H.

◆ active() [1/2]

bool active ( ) const
inline

Return const access to the source active flag.

Definition at line 54 of file faOptionI.H.

◆ setApplied()

void setApplied ( const label  fieldi)
inline

Set the applied flag to true for field index fieldi.

Definition at line 60 of file faOptionI.H.

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

Here is the caller graph for this function:

◆ regionMesh()

const Foam::faMesh & regionMesh ( ) const
inline

Return the region mesh database.

Definition at line 78 of file faOptionI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ vsm()

const Foam::volSurfaceMapping & vsm ( ) const
inline

Return volSurfaceMapping.

Definition at line 93 of file faOptionI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ regionName()

const Foam::word & regionName ( ) const
inline

Region name.

Definition at line 72 of file faOptionI.H.

◆ active() [2/2]

Foam::Switch & active ( )
inline

Return access to the source active flag.

Definition at line 66 of file faOptionI.H.

◆ isActive()

bool isActive ( )
virtual

Is the source active?

Reimplemented in faceSetOption.

Definition at line 122 of file faOption.C.

Referenced by optionList::correct(), faceSetOption::isActive(), 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 128 of file faOption.C.

Referenced by optionList::correct(), 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 134 of file faOption.C.

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

Referenced by optionList::checkApplied().

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

◆ addSup() [1/10]

void addSup ( const areaScalarField h,
faMatrix< scalar > &  eqn,
const label  fieldi 
)
virtual

Reimplemented in externalFileSource.

Definition at line 149 of file faOption.C.

Referenced by optionList::operator()(), and optionList::source().

Here is the caller graph for this function:

◆ addSup() [2/10]

void addSup ( const areaScalarField h,
faMatrix< vector > &  eqn,
const label  fieldi 
)
virtual

Definition at line 158 of file faOption.C.

◆ addSup() [3/10]

void addSup ( const areaScalarField h,
faMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 176 of file faOption.C.

◆ addSup() [4/10]

void addSup ( const areaScalarField h,
faMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 167 of file faOption.C.

◆ addSup() [5/10]

void addSup ( const areaScalarField h,
faMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 185 of file faOption.C.

◆ addSup() [6/10]

void addSup ( const areaScalarField h,
const areaScalarField rho,
faMatrix< scalar > &  eqn,
const label  fieldi 
)
virtual

Reimplemented in externalHeatFluxSource, jouleHeatingSource, and contactHeatFluxSource.

Definition at line 194 of file faOption.C.

◆ addSup() [7/10]

void addSup ( const areaScalarField h,
const areaScalarField rho,
faMatrix< vector > &  eqn,
const label  fieldi 
)
virtual

Definition at line 204 of file faOption.C.

◆ addSup() [8/10]

void addSup ( const areaScalarField h,
const areaScalarField rho,
faMatrix< symmTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 224 of file faOption.C.

◆ addSup() [9/10]

void addSup ( const areaScalarField h,
const areaScalarField rho,
faMatrix< sphericalTensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 214 of file faOption.C.

◆ addSup() [10/10]

void addSup ( const areaScalarField h,
const areaScalarField rho,
faMatrix< tensor > &  eqn,
const label  fieldi 
)
virtual

Definition at line 234 of file faOption.C.

◆ constrain() [1/5]

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

Definition at line 243 of file faOption.C.

◆ constrain() [2/5]

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

Definition at line 247 of file faOption.C.

◆ constrain() [3/5]

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

Definition at line 252 of file faOption.C.

◆ constrain() [4/5]

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

Definition at line 260 of file faOption.C.

◆ constrain() [5/5]

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

Definition at line 267 of file faOption.C.

◆ correct() [1/5]

void correct ( areaScalarField field)
virtual

Definition at line 271 of file faOption.C.

Referenced by optionList::correct().

Here is the caller graph for this function:

◆ correct() [2/5]

void correct ( areaVectorField field)
virtual

Definition at line 275 of file faOption.C.

◆ correct() [3/5]

void correct ( areaSphericalTensorField field)
virtual

Definition at line 279 of file faOption.C.

◆ correct() [4/5]

void correct ( areaSymmTensorField field)
virtual

Definition at line 283 of file faOption.C.

◆ correct() [5/5]

void correct ( areaTensorField field)
virtual

Definition at line 287 of file faOption.C.

◆ writeHeader()

void writeHeader ( Ostream os) const
virtual

Write the source header information.

Definition at line 32 of file faOptionIO.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 38 of file faOptionIO.C.

References Ostream::endBlock().

Here is the call graph for this function:

◆ writeData()

void writeData ( Ostream os) const
virtual

Write the source properties.

Definition at line 44 of file faOptionIO.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 externalHeatFluxSource, jouleHeatingSource, faceSetOption, contactHeatFluxSource, and externalFileSource.

Definition at line 54 of file faOptionIO.C.

References dict.

Referenced by externalFileSource::read(), contactHeatFluxSource::read(), faceSetOption::read(), jouleHeatingSource::read(), externalHeatFluxSource::read(), and optionList::readOptions().

Here is the caller graph for this function:

Member Data Documentation

◆ name_

const word name_
protected

Source name.

Definition at line 147 of file faOption.H.

Referenced by option::name(), and option::writeHeader().

◆ modelType_

const word modelType_
protected

Model type.

Definition at line 150 of file faOption.H.

◆ mesh_

const fvMesh& mesh_
protected

Reference to the mesh database.

Definition at line 153 of file faOption.H.

◆ patch_

const fvPatch& patch_
protected

Reference to the patch.

Definition at line 156 of file faOption.H.

◆ dict_

dictionary dict_
protected

Top level source dictionary.

Definition at line 159 of file faOption.H.

◆ coeffs_

dictionary coeffs_
protected

Dictionary containing source coefficients.

Definition at line 162 of file faOption.H.

◆ active_

Switch active_
protected

Source active flag.

Definition at line 165 of file faOption.H.

◆ fieldNames_

wordList fieldNames_
protected

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

Definition at line 168 of file faOption.H.

◆ applied_

List<bool> applied_
protected

Applied flag list - corresponds to each fieldNames_ entry.

Definition at line 171 of file faOption.H.

◆ regionName_

word regionName_
protected

Region name.

Definition at line 174 of file faOption.H.

◆ regionMeshPtr_

autoPtr<faMesh> regionMeshPtr_
protected

Pointer to the region mesh database.

Definition at line 177 of file faOption.H.

◆ vsmPtr_

autoPtr<volSurfaceMapping> vsmPtr_
protected

Volume-to surface mapping.

Definition at line 180 of file faOption.H.


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