Loading...
Searching...
No Matches
topOSource Class Reference

Implements Brinkman penalisation terms for topology optimisation. Looks up the indicator field (beta) from the registry, through topOVariablesBase. More...

#include <topOSource.H>

Inheritance diagram for topOSource:
Collaboration diagram for topOSource:

Public Member Functions

 TypeName ("topOSource")
 Runtime type information.
 topOSource (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 Construct from components.
virtual ~topOSource ()=default
 Destructor.
virtual void addSup (fvMatrix< vector > &eqn, const label fieldi)
 Add implicit contribution to momentum equation.
virtual void addSup (fvMatrix< scalar > &eqn, const label fieldi)
 Add implicit contribution to scalar equations (e.g. turbulence model).
virtual void addSup (const volScalarField &rho, fvMatrix< vector > &eqn, const label fieldi)
 Add implicit contribution to compressible momentum equation.
virtual void addSup (const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
 Add implicit contribution to compressible scalar equation.
virtual void postProcessSens (scalarField &sensField, const word &fieldName=word::null, const word &designValue=word::null)
 Multiply sensitivities with the derivative of the interpolation function.
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),(name, modelType, dict, mesh))
 option (const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
 Construct from components.
autoPtr< optionclone () const
 Return clone.
virtual ~option ()=default
 Destructor.
const wordname () const noexcept
 Return const access to the source name.
const fvMeshmesh () const noexcept
 Return const access to the mesh database.
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.
bool active (const bool on) noexcept
 Change source active flag, return previous value.
virtual bool isActive ()
 Is the source active?
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 (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< 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 correct (surfaceScalarField &field)
virtual void correct (surfaceVectorField &field)
virtual void correct (surfaceTensorField &field)
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 postProcessAuxSens (const volScalarField &primalField, const volScalarField &adjointField, scalarField &sensField, const word &fieldName=word::null)
virtual void postProcessAuxSens (const volVectorField &primalField, const volVectorField &adjointField, scalarField &sensField, const word &fieldName=word::null)
virtual void postProcessAuxSens (const volTensorField &primalField, const volTensorField &adjointField, scalarField &sensField, const word &fieldName=word::null)
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.

Protected Member Functions

virtual tmp< DimensionedField< scalar, volMesh > > getSource ()
 Compute the source term based on the indicator field.
Protected Member Functions inherited from option
void resetApplied ()
 Resize/reset applied flag list for all fieldNames_ entries.

Protected Attributes

autoPtr< topOInterpolationFunctioninterpolation_
 Interpolation function.
word interpolationFieldName_
 Interpolation field name.
scalar betaMax_
 Optional betaMax.
bool darcyFlow_
 Does this option apply to a Darcy flow model.
autoPtr< scalar > Da_
 Dimensionless Darcy number.
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.
bool active_
 Source active flag.

Additional Inherited Members

Static Public Member Functions inherited from option
static autoPtr< optionNew (const word &name, const dictionary &dict, const fvMesh &mesh)
 Return a reference to the selected fvOption model.
Public Attributes inherited from option
bool log
 Switch write log to Info.

Detailed Description

Implements Brinkman penalisation terms for topology optimisation. Looks up the indicator field (beta) from the registry, through topOVariablesBase.

Source files

Definition at line 57 of file topOSource.H.

Constructor & Destructor Documentation

◆ topOSource()

topOSource ( const word & name,
const word & modelType,
const dictionary & dict,
const fvMesh & mesh )

Construct from components.

Definition at line 88 of file topOSource.C.

References betaMax_, Da_, darcyFlow_, dict, interpolation_, interpolationFieldName_, option::mesh(), option::name(), option::New(), option::option(), and read().

Here is the call graph for this function:

◆ ~topOSource()

virtual ~topOSource ( )
virtualdefault

Destructor.

References dict, word::null, and rho.

Member Function Documentation

◆ getSource()

Foam::tmp< Foam::DimensionedField< Foam::scalar, Foam::volMesh > > getSource ( )
protectedvirtual

Compute the source term based on the indicator field.

Definition at line 48 of file topOSource.C.

References betaMax_, Da_, darcyFlow_, Foam::dimless, Foam::dimTime, DimensionedField< Type, GeoMesh >::field(), interpolation_, interpolationFieldName_, option::mesh_, option::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, topOVariablesBase::sourceTerm(), and Foam::Zero.

Referenced by addSup(), addSup(), addSup(), and addSup().

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

◆ TypeName()

TypeName ( "topOSource" )

Runtime type information.

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

Here is the call graph for this function:

◆ addSup() [1/4]

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

Add implicit contribution to momentum equation.

Reimplemented from option.

Definition at line 109 of file topOSource.C.

References DebugInfo, Foam::endl(), getSource(), IOobject::name(), fvMatrix< Type >::psi(), and Foam::fvm::Sp().

Here is the call graph for this function:

◆ addSup() [2/4]

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

Add implicit contribution to scalar equations (e.g. turbulence model).

Reimplemented from option.

Definition at line 122 of file topOSource.C.

References DebugInfo, Foam::endl(), getSource(), IOobject::name(), fvMatrix< Type >::psi(), and Foam::fvm::Sp().

Here is the call graph for this function:

◆ addSup() [3/4]

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

Add implicit contribution to compressible momentum equation.

Reimplemented from option.

Definition at line 135 of file topOSource.C.

References DebugInfo, Foam::endl(), getSource(), IOobject::name(), fvMatrix< Type >::psi(), rho, and Foam::fvm::Sp().

Here is the call graph for this function:

◆ addSup() [4/4]

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

Add implicit contribution to compressible scalar equation.

Reimplemented from option.

Definition at line 149 of file topOSource.C.

References DebugInfo, Foam::endl(), getSource(), IOobject::name(), fvMatrix< Type >::psi(), rho, and Foam::fvm::Sp().

Here is the call graph for this function:

◆ postProcessSens()

void postProcessSens ( scalarField & sensField,
const word & fieldName = word::null,
const word & designValue = word::null )
virtual

Multiply sensitivities with the derivative of the interpolation function.

Reimplemented from option.

Definition at line 163 of file topOSource.C.

References option::applyToField(), betaMax_, DebugInfo, Foam::endl(), interpolation_, interpolationFieldName_, option::mesh_, and topOVariablesBase::sourceTermSensitivities().

Here is the call graph for this function:

◆ read()

bool read ( const dictionary & dict)
virtual

Read source dictionary.

Reimplemented from option.

Definition at line 194 of file topOSource.C.

References option::applied_, betaMax_, option::coeffs_, Da_, darcyFlow_, dict, option::fieldNames_, topOVariablesBase::getBetaMax(), interpolationFieldName_, option::mesh_, and option::read().

Referenced by topOSource().

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

Member Data Documentation

◆ interpolation_

autoPtr<topOInterpolationFunction> interpolation_
protected

Interpolation function.

Definition at line 69 of file topOSource.H.

Referenced by getSource(), postProcessSens(), and topOSource().

◆ interpolationFieldName_

word interpolationFieldName_
protected

Interpolation field name.

Definition at line 74 of file topOSource.H.

Referenced by getSource(), postProcessSens(), read(), and topOSource().

◆ betaMax_

scalar betaMax_
protected

Optional betaMax.

If not found, the one known by topOVariablesBase will be used.

Definition at line 81 of file topOSource.H.

Referenced by getSource(), postProcessSens(), read(), and topOSource().

◆ darcyFlow_

bool darcyFlow_
protected

Does this option apply to a Darcy flow model.

Definition at line 86 of file topOSource.H.

Referenced by getSource(), read(), and topOSource().

◆ Da_

autoPtr<scalar> Da_
protected

Dimensionless Darcy number.

Definition at line 91 of file topOSource.H.

Referenced by getSource(), read(), and topOSource().


The documentation for this class was generated from the following files:
  • src/optimisation/adjointOptimisation/adjoint/fvOptions/sources/TopO/topOSource/topOSource.H
  • src/optimisation/adjointOptimisation/adjoint/fvOptions/sources/TopO/topOSource/topOSource.C