sensitivitySurface Class Reference

Calculation of adjoint based sensitivities at wall faces. More...

Inheritance diagram for sensitivitySurface:
Collaboration diagram for sensitivitySurface:

Public Member Functions

 TypeName ("surface")
 Runtime type information. More...
 
 sensitivitySurface (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~sensitivitySurface ()=default
 Destructor. More...
 
void read ()
 Read controls and update solver pointers if necessary. More...
 
virtual void assembleSensitivities (autoPtr< designVariables > &designVars)
 Assemble sensitivities. More...
 
- Public Member Functions inherited from sensitivitySurfacePoints
 TypeName ("surfacePoints")
 Runtime type information. More...
 
 sensitivitySurfacePoints (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~sensitivitySurfacePoints ()=default
 Destructor. More...
 
void read ()
 Read controls and update solver pointers if necessary. More...
 
virtual bool readDict (const dictionary &dict)
 Read dict if changed. More...
 
virtual const labelHashSetgeometryVariationIntegrationPatches () const
 Return set of patches on which to compute direct sensitivities. More...
 
virtual void write (const word &baseName=word::null)
 Write sensitivity fields. More...
 
- Public Member Functions inherited from sensitivityShapeESI
 TypeName ("shapeESI")
 Runtime type information. More...
 
 sensitivityShapeESI (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~sensitivityShapeESI ()=default
 Destructor. More...
 
- Public Member Functions inherited from ShapeSensitivitiesBase
 TypeName ("ShapeSensitivitiesBase")
 Runtime type information. More...
 
 ShapeSensitivitiesBase (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~ShapeSensitivitiesBase ()=default
 Destructor. More...
 
const labelHashSetsensitivityPatchIDs () const
 Get patch IDs on which sensitivities are computed. More...
 
void setSensitivityPatchIDs (const labelHashSet &sensPatchIDs)
 Overwrite sensitivityPatchIDs. More...
 
virtual void accumulateIntegrand (const scalar dt)
 Accumulate sensitivity integrands. More...
 
void clearSensitivities ()
 Zero sensitivity fields and their constituents. More...
 
tmp< volVectorFieldgetWallFaceSensVec ()
 Get wall face sensitivity vectors field. More...
 
tmp< volScalarFieldgetWallFaceSensNormal ()
 Get wall face sensitivity projected to normal field. More...
 
tmp< volVectorFieldgetWallFaceSensNormalVec ()
 Get wall face normal sens as vectors field. More...
 
tmp< pointVectorFieldgetWallPointSensVec ()
 Get wall point sensitivity vectors field. More...
 
tmp< pointScalarFieldgetWallPointSensNormal ()
 Get wall point sensitivity projected to normal field. More...
 
tmp< pointVectorFieldgetWallPointSensNormalVec ()
 Get wall point sens as vectors field. More...
 
virtual const boundaryVectorFieldgetWallFaceSensVecBoundary () const
 Get wall face sensitivity vectors field. More...
 
virtual const boundaryScalarFieldgetWallFaceSensNormalBoundary () const
 Get wall face sensitivity projected to normal field. More...
 
virtual const boundaryVectorFieldgetWallFaceSensNormalVecBoundary () const
 Get wall face normal sens as vectors field. More...
 
- Public Member Functions inherited from adjointSensitivity
 TypeName ("adjointSensitivity")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, adjointSensitivity, dictionary,(const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver),(mesh, dict, adjointSolver))
 
 adjointSensitivity (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~adjointSensitivity ()=default
 Destructor. More...
 
const adjointSolvergetAdjointSolver () const
 Const access to adjoint solver. More...
 
adjointSolvergetAdjointSolver ()
 Non-const access to adjoint solver. More...
 
bool includeDistance () const
 Should the adjoint eikonal PDE should be solved. More...
 
autoPtr< adjointEikonalSolver > & getAdjointEikonalSolver ()
 Return the adjoint eikonal solver. More...
 
autoPtr< adjointMeshMovementSolver > & getAdjointMeshMovementSolver ()
 Return the adjoint eikonal solver. More...
 
void setSuffix (const word &suffix)
 Set suffix. More...
 
const wordgetSuffix () const
 Get suffix. More...
 
virtual bool computeDxDbInternalField () const
 Should the parameterization compute the internalField of dxdb. More...
 
virtual const scalarFieldcalculateSensitivities (autoPtr< designVariables > &designVars)
 Calculates and returns sensitivity fields. More...
 
const scalarFieldgetSensitivities () const
 Returns the sensitivity fields. More...
 
const autoPtr< volTensorField > & gradDxDbMult () const
 
autoPtr< volTensorField > & gradDxDbMult ()
 
const autoPtr< scalarField > & divDxDbMult () const
 
const autoPtr< boundaryVectorField > & dxdbMult () const
 
const autoPtr< boundaryVectorField > & dSfdbMult () const
 
const autoPtr< boundaryVectorField > & dnfdbMult () const
 
const autoPtr< boundaryVectorField > & dxdbDirectMult () const
 
const autoPtr< pointBoundaryVectorField > & pointDxDbDirectMult () const
 
const autoPtr< boundaryVectorField > & bcDxDbMult () const
 
const autoPtr< vectorField > & optionsDxDbMult () const
 
- 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 fvMeshmesh () const
 Return reference to mesh. More...
 
const dictionarydict () const
 Return the construction dictionary. More...
 
const autoPtr< volScalarField > & fieldSensPtr () const
 Get the fieldSensPtr. More...
 

Protected Member Functions

label computeFaceDerivativesSize (const bool computeVectorFieldSize)
 Compute the size of the return field. More...
 
void smoothSensitivities ()
 Smooth sensitivity derivatives based on the computation of the 'Sobolev gradient'. More...
 
scalar computeRadius (const faMesh &aMesh)
 Compute the physical smoothing radius based on the average boundary face 'length'. More...
 
- Protected Member Functions inherited from sensitivitySurfacePoints
labelHashSet populateExtendedIDs () const
 Set suffix name for sensitivity fields. More...
 
void finalisePointSensitivities ()
 Converts face sensitivities to point sensitivities and adds the ones directly computed in points (i.e. dSf/db and dnf/db). More...
 
void constructGlobalPointNormalsAndAreas (vectorField &pointNormals, scalarField &pointMagSf)
 Construct globally correct point normals and point areas. More...
 
void setSuffixName ()
 Set suffix name for sensitivity fields. More...
 
void computePointDerivativesSize ()
 Allocate the proper size for the point-based sensitivities. More...
 
- Protected Member Functions inherited from sensitivityShapeESI
void computeDxDbMult ()
 Compute dxdbMult from its various components. More...
 
- Protected Member Functions inherited from ShapeSensitivitiesBase
void allocateEikonalSolver ()
 Allocate the adjoint eikonal solver. More...
 
bool hasMultiplier (bool(objective::*hasFunction)() const)
 Check if any of the available objective has a certain multiplier, provided through a function object. More...
 
template<class Type >
void constructAndWriteSensitivityField (const autoPtr< typename GeometricField< Type, fvPatchField, volMesh >::Boundary > &sensFieldPtr, const word &name) const
 Constructs volField based on boundaryField and writes it. More...
 
template<class Type >
void constructAndWriteSensitivtyPointField (const autoPtr< List< Field< Type >>> &sensFieldPtr, const word &name) const
 Constructs pointField based on boundaryField and writes it. More...
 
template<class Type >
tmp< GeometricField< Type, fvPatchField, volMesh > > constructVolSensitivtyField (const autoPtr< typename GeometricField< Type, fvPatchField, volMesh >::Boundary > &sensFieldPtr, const word &name) const
 Constructs volField based on boundaryField and writes it. More...
 
void writeFaceBasedSens () const
 Write face-based sensitivities, if present. More...
 
void writePointBasedSens () const
 Write point-based sensitivities, if present. More...
 
void clearSurfaceFields ()
 Clear surface/point fields. More...
 
void allocateMultipliers ()
 Allocate multiplier fields. More...
 
void clearMultipliers ()
 Clear multipliers. More...
 

Protected Attributes

bool smoothSensitivities_
 Smooth sensitivity derivatives based on a surface Laplace solver. More...
 
bool returnVectorField_
 Return the complete vector of sensitivities. More...
 
- Protected Attributes inherited from sensitivitySurfacePoints
bool writeGeometricInfo_
 Write geometric info for use by external programs. More...
 
bool includeSurfaceArea_
 Include surface area in sens computation. More...
 
boolList isSymmetryPoint_
 Is point belonging to a symmetry{Plane}. More...
 
vectorField symmPointNormal_
 Local point normal per symmetry point. More...
 
labelHashSet extendedPatchIDs_
 Extended patchIDs. More...
 
- Protected Attributes inherited from ShapeSensitivitiesBase
labelHashSet sensitivityPatchIDs_
 Patches on which to compute shape sensitivities. More...
 
bool writeAllSurfaceFiles_
 Whether to write all surface sensitivity fields. More...
 
autoPtr< boundaryVectorFieldwallFaceSensVecPtr_
 Wall face sens w.r.t. (x,y.z) More...
 
autoPtr< boundaryScalarFieldwallFaceSensNormalPtr_
 Wall face sens projected to normal. More...
 
autoPtr< boundaryVectorFieldwallFaceSensNormalVecPtr_
 Normal sens as vectors. More...
 
autoPtr< pointBoundaryVectorFieldwallPointSensVecPtr_
 Wall point sens w.r.t. (x,y.z) More...
 
autoPtr< pointBoundaryScalarFieldwallPointSensNormalPtr_
 Wall point sens projected to normal. More...
 
autoPtr< pointBoundaryVectorFieldwallPointSensNormalVecPtr_
 Normal sens as vectors. More...
 
- Protected Attributes inherited from adjointSensitivity
adjointSolveradjointSolver_
 Reference to the underlaying adjoint solver. More...
 
scalarField derivatives_
 The sensitivity derivative values. More...
 
word suffix_
 Append this word to files related to the sensitivities. More...
 
bool includeDistance_
 Include distance variation in sensitivity computations. More...
 
autoPtr< adjointEikonalSolvereikonalSolver_
 Adjoint eikonal equation solver. More...
 
autoPtr< adjointMeshMovementSolveradjointMeshMovementSolver_
 Adjoint grid displacement solver. More...
 
autoPtr< volTensorFieldgradDxDbMult_
 Multiplier of grad(dx/b) More...
 
autoPtr< scalarFielddivDxDbMult_
 Multiplier of div(dx/db) More...
 
autoPtr< boundaryVectorFielddxdbMult_
 Multiplier of face dx/db. More...
 
autoPtr< boundaryVectorFielddSfdbMult_
 Multiplier of dSf/db. More...
 
autoPtr< boundaryVectorFielddnfdbMult_
 Multiplier of dnf/db. More...
 
autoPtr< boundaryVectorFielddxdbDirectMult_
 Multiplier of dCf/db, found in the objective function. More...
 
autoPtr< pointBoundaryVectorFieldpointDxDbDirectMult_
 Multiplier of dx/db computed at points, found in the objective function. More...
 
autoPtr< boundaryVectorFieldbcDxDbMult_
 Multiplier of dx/db, coming from boundary conditions that depend on the geometry, like rotatingWallVelocity. More...
 
autoPtr< vectorFieldoptionsDxDbMult_
 dx/db multiplier coming from fvOptions More...
 
- Protected Attributes inherited from sensitivity
const fvMeshmesh_
 
dictionary dict_
 
bool writeFieldSens_
 
autoPtr< volScalarFieldfieldSensPtr_
 

Additional Inherited Members

- Static Public Member Functions inherited from adjointSensitivity
static autoPtr< adjointSensitivityNew (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver)
 Return a reference to the selected turbulence model. More...
 

Detailed Description

Calculation of adjoint based sensitivities at wall faces.

Reference:

    The computation of the sensitivity derivatives  follows the (E-)SI
    formulation of

        Kavvadias, I. S., Papoutsis-Kiachagias, E. M.,
        Giannakoglou, K. C. (2015).
        On the proper treatment of grid sensitivities in continuous adjoint
        methods for shape optimization.
        Journal of computational physics, 301, 1-18.
        https://doi.org/10.1016/j.jcp.2015.08.012

    whereas their smoothing based on the computation of the 'Sobolev
    gradient' is derived from

        Vassberg J. C., Jameson A. (2006).
        Aerodynamic Shape Optimization Part I: Theoretical Background.
        VKI Lecture Series, Introduction to Optimization and
        Multidisciplinary Design, Brussels, Belgium, 8 March, 2006.
Source files

Definition at line 70 of file sensitivitySurface.H.

Constructor & Destructor Documentation

◆ sensitivitySurface()

sensitivitySurface ( const fvMesh mesh,
const dictionary dict,
adjointSolver adjointSolver 
)

Construct from components.

Definition at line 256 of file sensitivitySurface.C.

References Foam::Zero.

◆ ~sensitivitySurface()

virtual ~sensitivitySurface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ computeFaceDerivativesSize()

label computeFaceDerivativesSize ( const bool  computeVectorFieldSize)
protected

Compute the size of the return field.

Definition at line 50 of file sensitivitySurface.C.

References Foam::foamVersion::patch.

◆ smoothSensitivities()

◆ computeRadius()

scalar computeRadius ( const faMesh aMesh)
protected

Compute the physical smoothing radius based on the average boundary face 'length'.

Definition at line 235 of file sensitivitySurface.C.

References polyMesh::bounds(), sensitivity::dict(), forAll, Foam::gAverage(), polyMesh::geometricD(), dictionary::getOrDefault(), sensitivity::mesh_, polyMesh::nGeometricD(), Foam::pow(), faMesh::S(), and boundBox::span().

Referenced by sensitivitySurface::smoothSensitivities().

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

◆ TypeName()

TypeName ( "surface"  )

Runtime type information.

◆ read()

void read ( )

Read controls and update solver pointers if necessary.

Definition at line 280 of file sensitivitySurface.C.

References sensitivity::dict(), dictionary::getOrDefault(), sensitivitySurfacePoints::read(), sensitivitySurface::returnVectorField_, and sensitivitySurface::smoothSensitivities_.

Here is the call graph for this function:

◆ assembleSensitivities()

void assembleSensitivities ( autoPtr< designVariables > &  designVars)
virtual

Assemble sensitivities.

Reimplemented from sensitivitySurfacePoints.

Definition at line 292 of file sensitivitySurface.C.

References sensitivitySurfacePoints::assembleSensitivities(), forAll, PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::foamVersion::patch, pp(), Foam::vtk::write(), and Foam::Zero.

Here is the call graph for this function:

Member Data Documentation

◆ smoothSensitivities_

bool smoothSensitivities_
protected

Smooth sensitivity derivatives based on a surface Laplace solver.

Definition at line 81 of file sensitivitySurface.H.

Referenced by sensitivitySurface::read().

◆ returnVectorField_

bool returnVectorField_
protected

Return the complete vector of sensitivities.

Definition at line 86 of file sensitivitySurface.H.

Referenced by sensitivitySurface::read().


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