adjointSensitivity Class Referenceabstract

Abstract base class for adjoint-based sensitivities in incompressible flows. More...

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

Public Member Functions

 TypeName ("adjointSensitivity")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, adjointSensitivity, dictionary,(const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager, fv::optionAdjointList &fvOptionsAdjoint),(mesh, dict, primalVars, adjointVars, objectiveManager, fvOptionsAdjoint))
 
 adjointSensitivity (const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager, fv::optionAdjointList &fvOptionsAdjoint)
 Construct from components. More...
 
virtual ~adjointSensitivity ()=default
 Destructor. More...
 
virtual void accumulateIntegrand (const scalar dt)=0
 Accumulate sensitivity integrands. More...
 
virtual void assembleSensitivities ()=0
 Assemble sensitivities. More...
 
virtual const scalarFieldcalculateSensitivities ()
 Calculates and returns sensitivity fields. More...
 
const scalarFieldgetSensitivities () const
 Returns the sensitivity fields. More...
 
virtual void clearSensitivities ()
 Zero sensitivity fields and their constituents. More...
 
virtual void write (const word &baseName=word::null)
 Write sensitivity fields. More...
 
tmp< volTensorFieldcomputeGradDxDbMultiplier ()
 
tmp< volVectorFieldadjointMeshMovementSource ()
 Compute source term for adjoint mesh movement equation. More...
 
- Public Member Functions inherited from sensitivity
 TypeName ("sensitivity")
 Runtime type information. More...
 
 sensitivity (const fvMesh &mesh, const dictionary &dict)
 Construct from components. More...
 
virtual ~sensitivity ()=default
 Destructor. More...
 
const dictionarydict () const
 Return the construction dictionary. More...
 
virtual bool readDict (const dictionary &dict)
 Read dictionary if changed. More...
 
virtual void computeDerivativesSize ()
 Compute design variables number. Does nothing in the base. More...
 

Static Public Member Functions

static autoPtr< adjointSensitivityNew (const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager, fv::optionAdjointList &fvOptionsAdjoint)
 Return a reference to the selected turbulence model. More...
 

Protected Attributes

scalarField derivatives_
 
incompressibleVarsprimalVars_
 
incompressibleAdjointVarsadjointVars_
 
objectiveManagerobjectiveManager_
 
fv::optionAdjointListfvOptionsAdjoint_
 
- Protected Attributes inherited from sensitivity
const fvMeshmesh_
 
dictionary dict_
 
autoPtr< volScalarFieldfieldSensPtr_
 

Detailed Description

Abstract base class for adjoint-based sensitivities in incompressible flows.

Reference:

    For the FI and ESI formulations
        Kavvadias, I., Papoutsis-Kiachagias, E., & Giannakoglou, K. (2015).
        On the proper treatment of grid sensitivities in continuous adjoint
        methods for shape optimization.
        Journal of Computational Physics, 301, 1–18.
        http://doi.org/10.1016/j.jcp.2015.08.012

    For the SI formulation
        Papoutsis-Kiachagias, E. M., & Giannakoglou, K. C. (2014).
        Continuous Adjoint Methods for Turbulent Flows, Applied to Shape
        and Topology Optimization: Industrial Applications.
        Archives of Computational Methods in Engineering, 23(2), 255–299.
        http://doi.org/10.1007/s11831-014-9141-9
Source files

Definition at line 76 of file adjointSensitivityIncompressible.H.

Constructor & Destructor Documentation

◆ adjointSensitivity()

adjointSensitivity ( const fvMesh mesh,
const dictionary dict,
incompressibleVars primalVars,
incompressibleAdjointVars adjointVars,
objectiveManager objectiveManager,
fv::optionAdjointList fvOptionsAdjoint 
)

Construct from components.

Definition at line 52 of file adjointSensitivityIncompressible.C.

◆ ~adjointSensitivity()

virtual ~adjointSensitivity ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "adjointSensitivity"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
adjointSensitivity  ,
dictionary  ,
(const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager, fv::optionAdjointList &fvOptionsAdjoint ,
(mesh, dict, primalVars, adjointVars, objectiveManager, fvOptionsAdjoint  
)

◆ New()

autoPtr< adjointSensitivity > New ( const fvMesh mesh,
const dictionary dict,
incompressibleVars primalVars,
incompressibleAdjointVars adjointVars,
objectiveManager objectiveManager,
fv::optionAdjointList fvOptionsAdjoint 
)
static

Return a reference to the selected turbulence model.

Definition at line 73 of file adjointSensitivityIncompressible.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, fvOptionsAdjoint(), Foam::Info, and mesh.

Referenced by adjointSimple::adjointSimple(), and sensitivityMultiple::sensitivityMultiple().

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

◆ accumulateIntegrand()

virtual void accumulateIntegrand ( const scalar  dt)
pure virtual

Accumulate sensitivity integrands.

Corresponds to the flow and adjoint part of the sensitivities

Implemented in shapeSensitivities, sensitivitySurfacePoints, sensitivitySurface, FIBase, SIBase, and sensitivityMultiple.

◆ assembleSensitivities()

virtual void assembleSensitivities ( )
pure virtual

Assemble sensitivities.

Adds the geometric part of the sensitivities

Implemented in FIBase, SIBase, shapeSensitivities, sensitivitySurfacePoints, sensitivitySurface, sensitivityBezierFI, sensitivityVolBSplinesFI, sensitivityVolBSplines, sensitivityBezier, and sensitivityMultiple.

Referenced by adjointSensitivity::calculateSensitivities().

Here is the caller graph for this function:

◆ calculateSensitivities()

const scalarField & calculateSensitivities ( )
virtual

Calculates and returns sensitivity fields.

Used with optimisation libraries

Implements sensitivity.

Reimplemented in sensitivityMultiple.

Definition at line 116 of file adjointSensitivityIncompressible.C.

References adjointSensitivity::assembleSensitivities(), adjointSensitivity::derivatives_, Foam::type(), and adjointSensitivity::write().

Here is the call graph for this function:

◆ getSensitivities()

const scalarField & getSensitivities ( ) const

Returns the sensitivity fields.

Assumes it has already been updated/computed

Definition at line 124 of file adjointSensitivityIncompressible.C.

References adjointSensitivity::derivatives_.

◆ clearSensitivities()

void clearSensitivities ( )
virtual

Zero sensitivity fields and their constituents.

Reimplemented in sensitivitySurfacePoints, sensitivitySurface, sensitivityBezierFI, sensitivityVolBSplinesFI, FIBase, sensitivityVolBSplines, SIBase, shapeSensitivities, sensitivityBezier, and sensitivityMultiple.

Definition at line 130 of file adjointSensitivityIncompressible.C.

References adjointSensitivity::derivatives_, and sensitivity::fieldSensPtr_.

Referenced by shapeSensitivities::clearSensitivities(), sensitivitySurface::clearSensitivities(), and sensitivitySurfacePoints::clearSensitivities().

Here is the caller graph for this function:

◆ write()

void write ( const word baseName = word::null)
virtual

Write sensitivity fields.

If valid, copies boundaryFields to volFields and writes them. Virtual to be reimplemented by control points-based methods (Bezier, RBF) which do not need to write fields

Reimplemented from sensitivity.

Reimplemented in sensitivitySurfacePoints, sensitivitySurface, sensitivityBezierFI, sensitivityVolBSplinesFI, sensitivityVolBSplines, SIBase, shapeSensitivities, sensitivityBezier, and sensitivityMultiple.

Definition at line 140 of file adjointSensitivityIncompressible.C.

References sensitivity::write().

Referenced by adjointSensitivity::calculateSensitivities(), shapeSensitivities::write(), sensitivitySurface::write(), and sensitivitySurfacePoints::write().

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

◆ computeGradDxDbMultiplier()

tmp< volTensorField > computeGradDxDbMultiplier ( )

Compute the volTensorField multiplying grad(dxdb) for the volume-based approach to compute shape sensitivity derivatives

Definition at line 146 of file adjointSensitivityIncompressible.C.

References objectiveManager::adjointSolverName(), incompressibleAdjointVars::adjointTurbulence(), adjointSensitivity::adjointVars_, fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::component(), Foam::dimLength, Foam::dimTime, forAll, ATCModel::getFISensitivityTerm(), objectiveManager::getObjectiveFunctions(), Foam::fvc::grad(), objectRegistry::lookupObject(), sensitivity::mesh_, IOobject::NO_READ, IOobject::NO_WRITE, adjointSensitivity::objectiveManager_, p, incompressibleVars::p(), incompressibleAdjointMeanFlowVars::pa(), Foam::foamVersion::patch, Foam::pow3(), adjointSensitivity::primalVars_, GeometricField< Type, PatchField, GeoMesh >::ref(), Foam::sqr(), Foam::T(), fvMesh::time(), Time::timeName(), U, incompressibleVars::U(), incompressibleAdjointMeanFlowVars::Ua(), and Foam::Zero.

Referenced by FIBase::accumulateIntegrand(), and adjointSensitivity::adjointMeshMovementSource().

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

◆ adjointMeshMovementSource()

tmp< volVectorField > adjointMeshMovementSource ( )

Compute source term for adjoint mesh movement equation.

Definition at line 310 of file adjointSensitivityIncompressible.C.

References adjointSensitivity::adjointVars_, adjointSensitivity::computeGradDxDbMultiplier(), Foam::dimLength, Foam::fvc::div(), forAll, adjointSensitivity::fvOptionsAdjoint_, sensitivity::mesh_, IOobject::NO_READ, IOobject::NO_WRITE, tmp< T >::ref(), GeometricField< Type, PatchField, GeoMesh >::ref(), GeometricField< Type, PatchField, GeoMesh >::T(), fvMesh::time(), Time::timeName(), and Foam::Zero.

Referenced by adjointMeshMovementSolver::accumulateIntegrand().

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

Member Data Documentation

◆ derivatives_

◆ primalVars_

◆ adjointVars_

◆ objectiveManager_

◆ fvOptionsAdjoint_


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