Loading...
Searching...
No Matches
faceSetOption Class Reference

Intermediate abstract class for handling face-set options for the derived faOptions. More...

#include <faceSetOption.H>

Inheritance diagram for faceSetOption:
Collaboration diagram for faceSetOption:

Public Types

enum  selectionModeType { smAll , smFaceSet , smFaceZone , smPatch }
 Enumeration for selection mode types. More...

Public Member Functions

 TypeName ("faceSetOption")
 Runtime type information.
 faceSetOption (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
 Construct from components.
virtual ~faceSetOption ()=default
 Destructor.
scalar timeStart () const noexcept
 Return const access to the time start.
scalar duration () const noexcept
 Return const access to the duration.
bool inTimeLimits (const scalar timeValue) const
 Return true if within time limits.
bool useSubMesh () const noexcept
 True if sub-selection should be used.
selectionModeType selectionMode () const noexcept
 Return the face selection mode.
const wordResselectionNames () const noexcept
 Return const access to the selection names (set, zone or patch selection).
const wordRezoneName () const
 Return const access to the first set/zone/patch name.
scalar A () const noexcept
 Return const access to the total face area.
const labelListfaces () const noexcept
 Return const access to the local finite-area face selection.
scalar timeStart (scalar val) noexcept
 Adjust the time start, return the old value.
scalar duration (scalar val) noexcept
 Adjust the duration, return the old value.
virtual bool isActive ()
 Is the source active?
virtual bool read (const dictionary &dict)
 Read source dictionary.
Public Member Functions inherited from option
 TypeName ("option")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, option, dictionary,(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &areaName),(name, modelType, dict, mesh, areaName))
 option (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
 Construct from components.
autoPtr< optionclone () const
 Return clone.
virtual ~option ()=default
 Destructor.
const wordname () const noexcept
 The source name.
const fvMeshmesh () const noexcept
 Return const access to the volume mesh.
const dictionarycoeffs () const noexcept
 Return dictionary.
bool active () const noexcept
 True if source is active.
void setApplied (const label fieldi)
 Set the applied flag to true for field index fieldi.
const wordareaName () const noexcept
 The finite-area mesh name.
const wordregionName () const noexcept
 The model region name.
const faMeshregionMesh () const
 Return the region mesh database (demand-driven).
const volSurfaceMappingvsm () const
 Return volSurfaceMapping (demand-driven).
bool active (bool on) noexcept
 Change source active flag, return previous value.
const wordsuffixHint () const noexcept
 The suffix hint when generating variable names.
word suffixed (const char *base) const
 Return the concatenation of base and the suffix hint.
word suffixed (const std::string &base) const
 Return the concatenation of base and the suffix hint.
virtual label applyToField (const word &fieldName) const
 Return index of field name if found in fieldNames list.
virtual void checkApplied () const
 Check that the source has been applied.
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.
virtual void writeFooter (Ostream &) const
 Write the source footer information.
virtual void writeData (Ostream &) const
 Write the source properties.

Static Public Attributes

static const Enum< selectionModeTypeselectionModeTypeNames_
 List of selection mode type names.

Protected Member Functions

void setSelection (const dictionary &dict)
 Set face selection name from dictionary input.
void setFaceSelection ()
 Set face selection based on user input selection mode.
void setArea ()
 Recalculate the area.
template<class Type>
void subsetFilter (List< Type > &field) const
 Zero all non-selected locations within field.
Protected Member Functions inherited from option
void resetApplied ()
 Resize/reset applied flag list for all fieldNames_ entries.

Protected Attributes

scalar timeStart_
 Time start.
scalar duration_
 Duration.
selectionModeType selectionMode_
 Face selection mode.
wordRes selectionNames_
 Face selection names (for set, zone or patch selections).
labelList faces_
 Set of faces to apply source to.
scalar A_
 Sum of face area.
Protected Attributes inherited from option
const word name_
 Source name.
const word modelType_
 Model type.
const fvMeshmesh_
 Reference to the mesh database.
dictionary dict_
 Top level source dictionary.
dictionary coeffs_
 Dictionary containing source coefficients.
wordList fieldNames_
 Field names to apply source to - populated by derived models.
List< bool > applied_
 Applied flag list - corresponds to each fieldNames_ entry.
word areaName_
 The finite-area mesh name.
word regionName_
 The model region name (finite-area).
word suffixHint_
 Suffix hint for variable names (default: "").

Additional Inherited Members

Static Public Member Functions inherited from option
static autoPtr< optionNew (const word &name, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
 Return a reference to the selected faOption model.
static bool sameRegionNames (const word &name1, const word &name2)
 Compare the region names.
Public Attributes inherited from option
bool log
 Switch write log to Info.

Detailed Description

Intermediate abstract class for handling face-set options for the derived faOptions.

Usage
Minimal example by using constant/faOptions:
<userDefinedName1>
{
    // Mandatory/Optional (inherited) entries
    ...

    // Mandatory entries (unmodifiable)
    selectionMode   all;

    // Optional entries (runtime modifiable)
    timeStart       1.0;

    // Conditional mandatory entries (runtime modifiable)

    // when timeStart entry is present
    duration        1.4;

    // when selectionMode=faceZone
    faceZones       (<name> ...);
    //or: faceZone  <name>;

    // when selectionMode=patch
    patches         (<name> ...)
    //or: patch     <name>;
}

where the entries mean:

Property Description Type Reqd Dflt
selectionMode Mode of face selection - see below word yes -
timeStart Start time of faOption scalar no -1
duration Duration of faOption execution starting from timeStart scalar cndtnl 0
faceSet Name of operand faceSet word cndtnl -
faceZone Name of operand faceZone(s) wordRe cndtnl -
faceZones Names of operand faceZones wordRescndtnl -
patch Name of operand poly patch(s) wordRe cndtnl -
patches Names of operand poly patches wordRescndtnl -

Options for the selectionMode entry:

      all       | Use all faces in the computational domain
      faceSet   | Use subset corresponding to specified (volume) faceSet
      faceZones | Use subset corresponding to specified (volume) faceZones
      faceZone  | Use subset corresponding to specified (volume) faceZones
      patch     | Use subset corresponding of specified volume patches
      patches   | Use subset corresponding of specified volume patches

The inherited entries are elaborated in:

Note
  • Source/sink options are to be added to the right-hand side of equations.
Source files

Definition at line 167 of file faceSetOption.H.

Member Enumeration Documentation

◆ selectionModeType

Enumeration for selection mode types.

Enumerator
smAll 

"all" finite-area faces

smFaceSet 

"faceSet" : subset with (volume) face set

smFaceZone 

"faceZone" : subset with (volume) zone faces

smPatch 

"patch" : subset with (volume) patches

Definition at line 178 of file faceSetOption.H.

Constructor & Destructor Documentation

◆ faceSetOption()

faceSetOption ( const word & name,
const word & modelType,
const dictionary & dict,
const fvMesh & mesh,
const word & defaultAreaName = word() )

◆ ~faceSetOption()

virtual ~faceSetOption ( )
virtualdefault

Destructor.

References A(), dict, duration(), faces(), inTimeLimits(), isActive(), Foam::noexcept, read(), selectionMode(), selectionNames(), timeStart(), useSubMesh(), and zoneName().

Here is the call graph for this function:

Member Function Documentation

◆ setSelection()

void setSelection ( const dictionary & dict)
protected

Set face selection name from dictionary input.

Definition at line 52 of file faceSetOption.C.

References dict, Foam::exit(), Foam::FatalError, FatalErrorInFunction, selectionMode_, selectionModeTypeNames_, selectionNames_, smAll, smFaceSet, smFaceZone, and smPatch.

Referenced by faceSetOption().

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

◆ setFaceSelection()

void setFaceSelection ( )
protected

◆ setArea()

void setArea ( )
protected

Recalculate the area.

Definition at line 107 of file faceSetOption.C.

References A_, IOstream::defaultPrecision(), Foam::endl(), faces_, Foam::indent(), Foam::Info, Foam::reduce(), option::regionMesh(), Foam::returnReduce(), and Time::timeName().

Referenced by faceSetOption(), and isActive().

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

◆ subsetFilter()

template<class Type>
void subsetFilter ( List< Type > & field) const
inlineprotected

Zero all non-selected locations within field.

Definition at line 24 of file faceSetOptionI.H.

References faces_, field(), selectionMode_, smAll, and Foam::Zero.

Referenced by externalHeatFluxSource::addSup().

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

◆ TypeName()

TypeName ( "faceSetOption" )

Runtime type information.

References dict, option::mesh(), and option::name().

Here is the call graph for this function:

◆ timeStart() [1/2]

Foam::scalar timeStart ( ) const
inlinenoexcept

Return const access to the time start.

Definition at line 42 of file faceSetOptionI.H.

References Foam::noexcept, and timeStart_.

Referenced by ~faceSetOption().

Here is the caller graph for this function:

◆ duration() [1/2]

Foam::scalar duration ( ) const
inlinenoexcept

Return const access to the duration.

Definition at line 48 of file faceSetOptionI.H.

References duration_, and Foam::noexcept.

Referenced by ~faceSetOption().

Here is the caller graph for this function:

◆ inTimeLimits()

bool inTimeLimits ( const scalar timeValue) const
inline

Return true if within time limits.

Definition at line 54 of file faceSetOptionI.H.

References duration_, option::mesh_, and timeStart_.

Referenced by isActive(), and ~faceSetOption().

Here is the caller graph for this function:

◆ useSubMesh()

bool useSubMesh ( ) const
inlinenoexcept

True if sub-selection should be used.

Definition at line 88 of file faceSetOptionI.H.

References Foam::noexcept, selectionMode_, and smAll.

Referenced by externalHeatFluxSource::addSup(), limitHeight::correct(), limitVelocity::correct(), and ~faceSetOption().

Here is the caller graph for this function:

◆ selectionMode()

Foam::fa::faceSetOption::selectionModeType selectionMode ( ) const
inlinenoexcept

Return the face selection mode.

Definition at line 69 of file faceSetOptionI.H.

References Foam::noexcept, and selectionMode_.

Referenced by ~faceSetOption().

Here is the caller graph for this function:

◆ selectionNames()

const Foam::wordRes & selectionNames ( ) const
inlinenoexcept

Return const access to the selection names (set, zone or patch selection).

Definition at line 76 of file faceSetOptionI.H.

References Foam::noexcept, and selectionNames_.

Referenced by ~faceSetOption().

Here is the caller graph for this function:

◆ zoneName()

const Foam::wordRe & zoneName ( ) const
inline

Return const access to the first set/zone/patch name.

Definition at line 82 of file faceSetOptionI.H.

References wordRe::null, and selectionNames_.

Referenced by setFaceSelection(), and ~faceSetOption().

Here is the caller graph for this function:

◆ A()

Foam::scalar A ( ) const
inlinenoexcept

Return const access to the total face area.

Definition at line 94 of file faceSetOptionI.H.

References A_, and Foam::noexcept.

Referenced by externalHeatFluxSource::addSup(), and ~faceSetOption().

Here is the caller graph for this function:

◆ faces()

const Foam::labelList & faces ( ) const
inlinenoexcept

Return const access to the local finite-area face selection.

Definition at line 100 of file faceSetOptionI.H.

References faces_, and Foam::noexcept.

Referenced by externalHeatFluxSource::addSup(), and ~faceSetOption().

Here is the caller graph for this function:

◆ timeStart() [2/2]

Foam::scalar timeStart ( scalar val)
inlinenoexcept

Adjust the time start, return the old value.

Definition at line 106 of file faceSetOptionI.H.

References timeStart_.

◆ duration() [2/2]

Foam::scalar duration ( scalar val)
inlinenoexcept

Adjust the duration, return the old value.

Definition at line 114 of file faceSetOptionI.H.

References duration_.

◆ isActive()

bool isActive ( )
virtual

Is the source active?

Reimplemented from option.

Definition at line 316 of file faceSetOption.C.

References A_, inTimeLimits(), option::isActive(), option::mesh_, and setArea().

Referenced by contactHeatFluxSource::addSup(), externalFileSource::addSup(), externalHeatFluxSource::addSup(), faceSetOption(), and ~faceSetOption().

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

◆ read()

bool read ( const dictionary & dict)
virtual

Read source dictionary.

Reimplemented from option.

Reimplemented in contactHeatFluxSource, externalFileSource, externalHeatFluxSource, jouleHeatingSource, limitHeight, and limitVelocity.

Definition at line 341 of file faceSetOption.C.

References option::coeffs_, dict, duration_, option::read(), and timeStart_.

Referenced by faceSetOption(), limitHeight::read(), limitVelocity::read(), and ~faceSetOption().

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

Member Data Documentation

◆ selectionModeTypeNames_

const Foam::Enum< Foam::fa::faceSetOption::selectionModeType > selectionModeTypeNames_
static

List of selection mode type names.

Definition at line 189 of file faceSetOption.H.

Referenced by faceSetOption(), setFaceSelection(), and setSelection().

◆ timeStart_

scalar timeStart_
protected

Time start.

Definition at line 199 of file faceSetOption.H.

Referenced by faceSetOption(), inTimeLimits(), read(), timeStart(), and timeStart().

◆ duration_

scalar duration_
protected

Duration.

Definition at line 204 of file faceSetOption.H.

Referenced by duration(), duration(), faceSetOption(), inTimeLimits(), and read().

◆ selectionMode_

selectionModeType selectionMode_
protected

Face selection mode.

Definition at line 209 of file faceSetOption.H.

Referenced by faceSetOption(), selectionMode(), setFaceSelection(), setSelection(), subsetFilter(), and useSubMesh().

◆ selectionNames_

wordRes selectionNames_
protected

Face selection names (for set, zone or patch selections).

Definition at line 214 of file faceSetOption.H.

Referenced by faceSetOption(), selectionNames(), setFaceSelection(), setSelection(), and zoneName().

◆ faces_

labelList faces_
protected

Set of faces to apply source to.

Definition at line 219 of file faceSetOption.H.

Referenced by limitHeight::correct(), limitVelocity::correct(), faces(), setArea(), setFaceSelection(), and subsetFilter().

◆ A_

scalar A_
protected

Sum of face area.

Definition at line 224 of file faceSetOption.H.

Referenced by A(), faceSetOption(), isActive(), and setArea().


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