Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sensitivitySurfacePoints Class Reference

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

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

Public Member Functions

 TypeName ("surfacePoints")
 Runtime type information. More...
 
 sensitivitySurfacePoints (const fvMesh &mesh, const dictionary &dict, incompressibleAdjointSolver &adjointSolver)
 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, incompressibleAdjointSolver &adjointSolver),(mesh, dict, adjointSolver))
 
 adjointSensitivity (const fvMesh &mesh, const dictionary &dict, incompressibleAdjointSolver &adjointSolver)
 Construct from components. More...
 
virtual ~adjointSensitivity ()=default
 Destructor. More...
 
const incompressibleVarsprimalVars () const
 Get primal variables. More...
 
const incompressibleAdjointVarsadjointVars () const
 Get adjoint variables. More...
 
const incompressibleAdjointSolveradjointSolver () const
 Get adjoint solver. More...
 
virtual const scalarFieldcalculateSensitivities ()
 Calculates and returns sensitivity fields. More...
 
const scalarFieldgetSensitivities () const
 Returns the sensitivity fields. More...
 
tmp< volTensorFieldcomputeGradDxDbMultiplier ()
 Compute the volTensorField multiplying grad(dxdb) for the volume-based approach to compute shape sensitivity derivatives. More...
 
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 ()
 Add terms related to post-processing PDEs (i.e. adjoint Eikonal, adjoint mesh movement) and add local face area. 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...
 

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_
 
incompressibleAdjointSolveradjointSolver_
 
const 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, incompressibleAdjointSolver &adjointSolver)
 Return a reference to the selected turbulence model. More...
 

Detailed Description

Calculation of adjoint based sensitivities at wall points.

Source files

Definition at line 55 of file sensitivitySurfacePointsIncompressible.H.

Constructor & Destructor Documentation

◆ sensitivitySurfacePoints()

sensitivitySurfacePoints ( const fvMesh mesh,
const dictionary dict,
incompressibleAdjointSolver adjointSolver 
)

Construct from components.

Definition at line 327 of file sensitivitySurfacePointsIncompressible.C.

References Foam::read(), Foam::reduce(), and Foam::Zero.

Here is the call graph for this function:

◆ ~sensitivitySurfacePoints()

virtual ~sensitivitySurfacePoints ( )
virtualdefault

Destructor.

Member Function Documentation

◆ read()

void read ( )
protected

◆ 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 106 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 167 of file sensitivitySurfacePointsIncompressible.C.

References fvMesh::boundary(), sensitivitySurfacePoints::dnfdbMult_, sensitivitySurfacePoints::dSfdbMult_, polyMesh::faces(), forAll, Foam::I, sensitivitySurfacePoints::includeObjective_, deltaBoundary::makeFaceCentresAndAreas_d(), sensitivity::mesh_, p, Foam::foamVersion::patch, face::points(), polyMesh::points(), UList< T >::size(), 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 253 of file sensitivitySurfacePointsIncompressible.C.

References forAll, Foam::foamVersion::patch, and syncTools::syncPointList().

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 303 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 379 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 400 of file sensitivitySurfacePointsIncompressible.C.

References incompressibleAdjointSolver::additionalSensitivityMapTerms(), adjointSensitivity::adjointSolver_, incompressibleAdjointVars::adjointTurbulence(), adjointSensitivity::adjointVars_, fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), tmp< T >::clear(), Field< Type >::component(), tmp< T >::cref(), DebugInfo, Foam::dimVelocity, 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_, GeometricField< tensor, fvPatchField, volMesh >::New(), adjointSensitivity::objectiveManager_, p, incompressibleVars::p(), incompressibleAdjointMeanFlowVars::pa(), Foam::foamVersion::patch, adjointSensitivity::primalVars_, autoPtr< T >::ref(), tmp< T >::ref(), Foam::sqr(), Foam::twoSymm(), U, incompressibleVars::U(), incompressibleAdjointMeanFlowVars::Ua(), Foam::unzipRow(), sensitivitySurfacePoints::useSnGradInTranposeStresses_, sensitivitySurfacePoints::wallFaceSens_, and Foam::Zero.

Here is the call graph for this function:

◆ assembleSensitivities()

void assembleSensitivities ( )
virtual

◆ clearSensitivities()

void clearSensitivities ( )
virtual

◆ 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 753 of file sensitivitySurfacePointsIncompressible.C.

References sensitivitySurfacePoints::setSuffixName(), shapeSensitivitiesBase::write(), and adjointSensitivity::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 68 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 78 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 83 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 88 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 93 of file sensitivitySurfacePointsIncompressible.H.

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

◆ includeDistance_

bool includeDistance_
protected

◆ includeMeshMovement_

bool includeMeshMovement_
protected

◆ includeObjective_

bool includeObjective_
protected

◆ eikonalSolver_

autoPtr<adjointEikonalSolver> eikonalSolver_
protected

◆ meshMovementSolver_

autoPtr<adjointMeshMovementSolver> meshMovementSolver_
protected

◆ 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 122 of file sensitivitySurfacePointsIncompressible.H.

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

◆ dSfdbMult_

autoPtr<boundaryVectorField> dSfdbMult_
protected

◆ dnfdbMult_

autoPtr<boundaryVectorField> dnfdbMult_
protected

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