sensitivitySurfacePoints Class Reference

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

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

Public Member Functions

 TypeName ("surfacePoints")
 Runtime type information. More...
 
 sensitivitySurfacePoints (const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager)
 Construct from components. More...
 
virtual ~sensitivitySurfacePoints ()=default
 Destructor. More...
 
virtual bool readDict (const dictionary &dict)
 Read dict if changed. More...
 
virtual void accumulateIntegrand (const scalar dt)
 Accumulate sensitivity integrands. More...
 
virtual void assembleSensitivities ()
 Assemble sensitivities. More...
 
virtual void clearSensitivities ()
 Zero sensitivity fields and their constituents. More...
 
virtual void write (const word &baseName=word::null)
 Write sensitivity fields. More...
 
- Public Member Functions inherited from adjointSensitivity
 TypeName ("adjointSensitivity")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, adjointSensitivity, dictionary,(const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager),(mesh, dict, primalVars, adjointVars, objectiveManager))
 
 adjointSensitivity (const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager)
 Construct from components. More...
 
virtual ~adjointSensitivity ()=default
 Destructor. More...
 
virtual const scalarFieldcalculateSensitivities ()
 Calculates and returns sensitivity fields. More...
 
const scalarFieldgetSensitivities () const
 Returns the 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 void computeDerivativesSize ()
 Compute design variables number. Does nothing in the base. More...
 

Protected Member Functions

void read ()
 Read controls and update solver pointers if necessary. More...
 
void finaliseFaceMultiplier ()
 
void finalisePointSensitivities ()
 
void constructGlobalPointNormalsAndAreas (vectorField &pointNormals, scalarField &pointMagSf)
 Construct globally correct point normals and point areas. More...
 
void setSuffixName ()
 Set suffix name for sensitivity fields. More...
 

Protected Attributes

bool includeSurfaceArea_
 Include surface area in sens computation. More...
 
bool includePressureTerm_
 Include the adjoint pressure term in sens computation. More...
 
bool includeGradStressTerm_
 Include the term containing the grad of the stress at the boundary. More...
 
bool includeTransposeStresses_
 Include the transpose part of the adjoint stresses. More...
 
bool useSnGradInTranposeStresses_
 Use snGrad in the transpose part of the adjoint stresses. More...
 
bool includeDivTerm_
 Include the term from the deviatoric part of the stresses. More...
 
bool includeDistance_
 Include distance variation in sens computation. More...
 
bool includeMeshMovement_
 Include mesh movement variation in sens computation. More...
 
bool includeObjective_
 Include terms directly emerging from the objective function. More...
 
autoPtr< adjointEikonalSolvereikonalSolver_
 
autoPtr< adjointMeshMovementSolvermeshMovementSolver_
 
autoPtr< boundaryVectorFieldwallFaceSens_
 The face-based part of the sensitivities. More...
 
autoPtr< boundaryVectorFielddSfdbMult_
 Multipliers of d(Sf)/db and d(nf)/db. More...
 
autoPtr< boundaryVectorFielddnfdbMult_
 
- Protected Attributes inherited from adjointSensitivity
scalarField derivatives_
 
incompressibleVarsprimalVars_
 
incompressibleAdjointVarsadjointVars_
 
objectiveManagerobjectiveManager_
 
- Protected Attributes inherited from sensitivity
const fvMeshmesh_
 
dictionary dict_
 
autoPtr< volScalarFieldfieldSensPtr_
 

Additional Inherited Members

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

Detailed Description

Calculation of adjoint based sensitivities at wall points.

Source files

Definition at line 59 of file sensitivitySurfacePointsIncompressible.H.

Constructor & Destructor Documentation

◆ sensitivitySurfacePoints()

sensitivitySurfacePoints ( const fvMesh mesh,
const dictionary dict,
incompressibleVars primalVars,
incompressibleAdjointVars adjointVars,
objectiveManager objectiveManager 
)

Construct from components.

Definition at line 333 of file sensitivitySurfacePointsIncompressible.C.

References nPoints, Foam::read(), Foam::returnReduce(), and Foam::Zero.

Here is the call graph for this function:

◆ ~sensitivitySurfacePoints()

virtual ~sensitivitySurfacePoints ( )
virtualdefault

Destructor.

Member Function Documentation

◆ read()

◆ finaliseFaceMultiplier()

void finaliseFaceMultiplier ( )
protected

Add terms related to post-processing PDEs (i.e. adjoint Eikonal, adjoint mesh movement) and add local face area

Definition at line 112 of file sensitivitySurfacePointsIncompressible.C.

References fvMesh::boundary(), sensitivitySurfacePoints::dnfdbMult_, sensitivitySurfacePoints::eikonalSolver_, sensitivitySurfacePoints::includeDistance_, sensitivitySurfacePoints::includeMeshMovement_, sensitivity::mesh_, sensitivitySurfacePoints::meshMovementSolver_, Foam::foamVersion::patch, autoPtr< T >::reset(), and sensitivitySurfacePoints::wallFaceSens_.

Referenced by sensitivitySurfacePoints::assembleSensitivities().

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

◆ finalisePointSensitivities()

void finalisePointSensitivities ( )
protected

Converts face sensitivities to point sensitivities and adds the ones directly computed in points (i.e. dSf/db and dnf/db).

Definition at line 173 of file sensitivitySurfacePointsIncompressible.C.

References fvMesh::boundary(), sensitivitySurfacePoints::dnfdbMult_, sensitivitySurfacePoints::dSfdbMult_, polyMesh::faces(), forAll, Tensor< Cmpt >::I, sensitivitySurfacePoints::includeObjective_, deltaBoundary::makeFaceCentresAndAreas_d(), sensitivity::mesh_, p, Foam::foamVersion::patch, face::points(), polyMesh::points(), sensitivitySurfacePoints::wallFaceSens_, and Foam::Zero.

Referenced by sensitivitySurfacePoints::assembleSensitivities().

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

◆ constructGlobalPointNormalsAndAreas()

void constructGlobalPointNormalsAndAreas ( vectorField pointNormals,
scalarField pointMagSf 
)
protected

Construct globally correct point normals and point areas.

Definition at line 259 of file sensitivitySurfacePointsIncompressible.C.

References forAll, Foam::foamVersion::patch, syncTools::syncPointList(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.

Referenced by sensitivitySurfacePoints::assembleSensitivities().

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

◆ setSuffixName()

void setSuffixName ( )
protected

Set suffix name for sensitivity fields.

Definition at line 309 of file sensitivitySurfacePointsIncompressible.C.

References adjointSensitivity::adjointVars_, sensitivity::dict(), sensitivitySurfacePoints::includeMeshMovement_, word::null, shapeSensitivitiesBase::setSuffix(), and variablesSet::solverName().

Referenced by sensitivitySurfacePoints::write().

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

◆ TypeName()

TypeName ( "surfacePoints"  )

Runtime type information.

◆ readDict()

bool readDict ( const dictionary dict)
virtual

Read dict if changed.

Reimplemented from sensitivity.

Definition at line 394 of file sensitivitySurfacePointsIncompressible.C.

References sensitivity::dict(), sensitivitySurfacePoints::eikonalSolver_, sensitivitySurfacePoints::meshMovementSolver_, and sensitivity::readDict().

Here is the call graph for this function:

◆ accumulateIntegrand()

void accumulateIntegrand ( const scalar  dt)
virtual

Accumulate sensitivity integrands.

Implements adjointSensitivity.

Definition at line 415 of file sensitivitySurfacePointsIncompressible.C.

References incompressibleAdjointVars::adjointTurbulence(), adjointSensitivity::adjointVars_, fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), GeometricField< Type, PatchField, GeoMesh >::component(), DebugInfo, sensitivitySurfacePoints::dnfdbMult_, sensitivitySurfacePoints::dSfdbMult_, sensitivitySurfacePoints::eikonalSolver_, Foam::endl(), forAll, objectiveManager::getObjectiveFunctions(), Foam::fvc::grad(), sensitivitySurfacePoints::includeDistance_, sensitivitySurfacePoints::includeDivTerm_, sensitivitySurfacePoints::includeGradStressTerm_, sensitivitySurfacePoints::includeMeshMovement_, sensitivitySurfacePoints::includeObjective_, sensitivitySurfacePoints::includePressureTerm_, sensitivitySurfacePoints::includeTransposeStresses_, sensitivity::mesh_, sensitivitySurfacePoints::meshMovementSolver_, adjointSensitivity::objectiveManager_, p, incompressibleVars::p(), incompressibleAdjointMeanFlowVars::pa(), Foam::foamVersion::patch, adjointSensitivity::primalVars_, Foam::T(), U, incompressibleVars::U(), incompressibleAdjointMeanFlowVars::Ua(), sensitivitySurfacePoints::useSnGradInTranposeStresses_, sensitivitySurfacePoints::wallFaceSens_, and Foam::Zero.

Here is the call graph for this function:

◆ assembleSensitivities()

◆ clearSensitivities()

◆ 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 adjointSensitivity.

Definition at line 758 of file sensitivitySurfacePointsIncompressible.C.

References sensitivitySurfacePoints::setSuffixName(), adjointSensitivity::write(), and shapeSensitivitiesBase::write().

Here is the call graph for this function:

Member Data Documentation

◆ includeSurfaceArea_

bool includeSurfaceArea_
protected

Include surface area in sens computation.

Definition at line 70 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::assembleSensitivities(), and sensitivitySurfacePoints::read().

◆ includePressureTerm_

bool includePressureTerm_
protected

Include the adjoint pressure term in sens computation.

Definition at line 73 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().

◆ includeGradStressTerm_

bool includeGradStressTerm_
protected

Include the term containing the grad of the stress at the boundary.

Definition at line 76 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().

◆ includeTransposeStresses_

bool includeTransposeStresses_
protected

Include the transpose part of the adjoint stresses.

Definition at line 79 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().

◆ useSnGradInTranposeStresses_

bool useSnGradInTranposeStresses_
protected

Use snGrad in the transpose part of the adjoint stresses.

Definition at line 82 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().

◆ includeDivTerm_

bool includeDivTerm_
protected

Include the term from the deviatoric part of the stresses.

Definition at line 85 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().

◆ includeDistance_

◆ includeMeshMovement_

◆ includeObjective_

bool includeObjective_
protected

◆ eikonalSolver_

◆ meshMovementSolver_

◆ wallFaceSens_

autoPtr<boundaryVectorField> wallFaceSens_
protected

The face-based part of the sensitivities.

i.e. terms that multiply dxFace/dxPoint. Sensitivities DO include locale surface area, to get the correct weighting from the contributions of various faces. Normalized at the end.

Definition at line 105 of file sensitivitySurfacePointsIncompressible.H.

Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), sensitivitySurfacePoints::finaliseFaceMultiplier(), and sensitivitySurfacePoints::finalisePointSensitivities().

◆ dSfdbMult_

◆ dnfdbMult_


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