Public Member Functions | List of all members
FixedValueConstraint< Type > Class Template Reference

Constrain values of given fields of Type with a given maximum value within a specified region, where <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. More...

Inheritance diagram for FixedValueConstraint< Type >:
Inheritance graph
[legend]
Collaboration diagram for FixedValueConstraint< Type >:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("FixedValueConstraint")
 
 FixedValueConstraint (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 
 FixedValueConstraint (const FixedValueConstraint &)=delete
 
void operator= (const FixedValueConstraint &)=delete
 
virtual ~FixedValueConstraint ()=default
 
virtual bool read (const dictionary &dict)
 
virtual void constrain (fvMatrix< Type > &eqn, const label fieldi)
 
- Public Member Functions inherited from cellSetOption
 TypeName ("cellSetOption")
 
 cellSetOption (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 
virtual ~cellSetOption ()=default
 
scalar timeStart () const noexcept
 
scalar duration () const noexcept
 
bool inTimeLimits (const scalar timeValue) const
 
selectionModeType selectionMode () const noexcept
 
bool useSubMesh () const noexcept
 
const wordcellSetName () const noexcept
 
scalar V () const noexcept
 
const labelListcells () const noexcept
 
scalar timeStart (scalar val) noexcept
 
scalar duration (scalar val) noexcept
 
virtual bool isActive ()
 
- Public Member Functions inherited from option
 TypeName ("option")
 
 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)
 
autoPtr< optionclone () const
 
virtual ~option ()=default
 
const wordname () const noexcept
 
const fvMeshmesh () const noexcept
 
const dictionarycoeffs () const noexcept
 
bool active () const noexcept
 
void setApplied (const label fieldi)
 
bool active (const bool on) noexcept
 
virtual label applyToField (const word &fieldName) const
 
virtual void checkApplied () const
 
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 postProcessSens (scalarField &sensField, const word &fieldName=word::null, const word &designVariablesName=word::null)
 
virtual void postProcessSens (vectorField &sensField, const word &fieldName=word::null, const word &designVariablesName=word::null)
 
virtual void postProcessSens (tensorField &sensField, const word &fieldName=word::null, const word &designVariablesName=word::null)
 
virtual void writeHeader (Ostream &) const
 
virtual void writeFooter (Ostream &) const
 
virtual void writeData (Ostream &) const
 

Additional Inherited Members

- Public Types inherited from cellSetOption
enum  selectionModeType { smAll, smCellSet, smCellZone, smPoints }
 
- Static Public Member Functions inherited from option
static autoPtr< optionNew (const word &name, const dictionary &dict, const fvMesh &mesh)
 
- Public Attributes inherited from option
bool log
 
- Static Public Attributes inherited from cellSetOption
static const Enum< selectionModeTypeselectionModeTypeNames_
 
- Protected Member Functions inherited from cellSetOption
void setSelection (const dictionary &dict)
 
void setCellSelection ()
 
void setVol ()
 
- Protected Member Functions inherited from option
void resetApplied ()
 
- Protected Attributes inherited from cellSetOption
scalar timeStart_
 
scalar duration_
 
selectionModeType selectionMode_
 
word cellSetName_
 
List< pointpoints_
 
labelList cells_
 
scalar V_
 
- Protected Attributes inherited from option
const word name_
 
const word modelType_
 
const fvMeshmesh_
 
dictionary dict_
 
dictionary coeffs_
 
wordList fieldNames_
 
List< boolapplied_
 
bool active_
 

Detailed Description

template<class Type>
class Foam::fv::FixedValueConstraint< Type >

Constrain values of given fields of Type with a given maximum value within a specified region, where <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor.

Usage
Minimal example by using constant/fvOptions:
\<Type\>FixedValueConstraint1
{
    // Mandatory entries (unmodifiable)
    type            \<Type\>FixedValueConstraint;

    // Mandatory entries (runtime modifiable)
    fieldValues
    {
        \<fieldName1\>           \<value1\>;
        \<fieldName2\>           \<value2\>;
        ...
        \<fieldNameN\>           \<valueN\>;
    }

    // Mandatory/Optional (inherited) entries
    ...
}

where the entries mean:

Property Description Type Reqd Dflt
type Type name: <Type>FixedValueConstraint word yes -
fieldValues Dictionary containing pairs of names and maximum values of operand fields of <Type> dictionary yes -

The inherited entries are elaborated in:

For example to set the turbulence properties within a porous region:

    porosityTurbulence
    {
        type            scalarFixedValueConstraint;
        active          yes;

        selectionMode   cellZone;
        cellZone        porosity;
        fieldValues
        {
            k           1;
            epsilon     150;
        }
    }
See also
Source files

Definition at line 132 of file FixedValueConstraint.H.

Constructor & Destructor Documentation

◆ FixedValueConstraint() [1/2]

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

Definition at line 31 of file FixedValueConstraint.C.

References dict, and Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ FixedValueConstraint() [2/2]

FixedValueConstraint ( const FixedValueConstraint< Type > &  )
delete

◆ ~FixedValueConstraint()

virtual ~FixedValueConstraint ( )
virtualdefault

Member Function Documentation

◆ TypeName()

TypeName ( "FixedValueConstraint< Type >"  )

◆ operator=()

void operator= ( const FixedValueConstraint< Type > &  )
delete

◆ read()

bool read ( const dictionary dict)
virtual

Reimplemented from cellSetOption.

Definition at line 47 of file FixedValueConstraint.C.

References Foam::BitOps::count(), dict, Foam::blockMeshTools::read(), and dictionary::subDict().

Here is the call graph for this function:

◆ constrain()

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

Definition at line 78 of file FixedValueConstraint.C.

References DebugInfo, Foam::endl(), and fvMatrix::setValues().

Here is the call graph for this function:

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