Calculation of adjoint based sensitivities at wall faces. More...
#include <sensitivitySurface.H>


Public Member Functions | |
| TypeName ("surface") | |
| Runtime type information. | |
| sensitivitySurface (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) | |
| Construct from components. | |
| virtual | ~sensitivitySurface ()=default |
| Destructor. | |
| void | read () |
| Read controls and update solver pointers if necessary. | |
| virtual void | assembleSensitivities (autoPtr< designVariables > &designVars) |
| Assemble sensitivities. | |
| Public Member Functions inherited from sensitivitySurfacePoints | |
| TypeName ("surfacePoints") | |
| Runtime type information. | |
| sensitivitySurfacePoints (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) | |
| Construct from components. | |
| virtual | ~sensitivitySurfacePoints ()=default |
| Destructor. | |
| void | read () |
| Read controls and update solver pointers if necessary. | |
| virtual bool | readDict (const dictionary &dict) |
| Read dict if changed. | |
| virtual const labelHashSet & | geometryVariationIntegrationPatches () const |
| Return set of patches on which to compute direct sensitivities. | |
| virtual void | write (const word &baseName=word::null) |
| Write sensitivity fields. | |
| Public Member Functions inherited from sensitivityShapeESI | |
| TypeName ("shapeESI") | |
| Runtime type information. | |
| sensitivityShapeESI (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) | |
| Construct from components. | |
| virtual | ~sensitivityShapeESI ()=default |
| Destructor. | |
| Public Member Functions inherited from ShapeSensitivitiesBase | |
| TypeName ("ShapeSensitivitiesBase") | |
| Runtime type information. | |
| ShapeSensitivitiesBase (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) | |
| Construct from components. | |
| virtual | ~ShapeSensitivitiesBase ()=default |
| Destructor. | |
| const labelHashSet & | sensitivityPatchIDs () const |
| Get patch IDs on which sensitivities are computed. | |
| void | setSensitivityPatchIDs (const labelHashSet &sensPatchIDs) |
| Overwrite sensitivityPatchIDs. | |
| virtual void | accumulateIntegrand (const scalar dt) |
| Accumulate sensitivity integrands. | |
| void | clearSensitivities () |
| Zero sensitivity fields and their constituents. | |
| tmp< volVectorField > | getWallFaceSensVec () |
| Get wall face sensitivity vectors field. | |
| tmp< volScalarField > | getWallFaceSensNormal () |
| Get wall face sensitivity projected to normal field. | |
| tmp< volVectorField > | getWallFaceSensNormalVec () |
| Get wall face normal sens as vectors field. | |
| tmp< pointVectorField > | getWallPointSensVec () |
| Get wall point sensitivity vectors field. | |
| tmp< pointScalarField > | getWallPointSensNormal () |
| Get wall point sensitivity projected to normal field. | |
| tmp< pointVectorField > | getWallPointSensNormalVec () |
| Get wall point sens as vectors field. | |
| virtual const boundaryVectorField & | getWallFaceSensVecBoundary () const |
| Get wall face sensitivity vectors field. | |
| virtual const boundaryScalarField & | getWallFaceSensNormalBoundary () const |
| Get wall face sensitivity projected to normal field. | |
| virtual const boundaryVectorField & | getWallFaceSensNormalVecBoundary () const |
| Get wall face normal sens as vectors field. | |
| Public Member Functions inherited from adjointSensitivity | |
| TypeName ("adjointSensitivity") | |
| Runtime type information. | |
| 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. | |
| virtual | ~adjointSensitivity ()=default |
| Destructor. | |
| const adjointSolver & | getAdjointSolver () const |
| Const access to adjoint solver. | |
| adjointSolver & | getAdjointSolver () |
| Non-const access to adjoint solver. | |
| bool | includeDistance () const |
| Should the adjoint eikonal PDE should be solved. | |
| autoPtr< adjointEikonalSolver > & | getAdjointEikonalSolver () |
| Return the adjoint eikonal solver. | |
| autoPtr< adjointMeshMovementSolver > & | getAdjointMeshMovementSolver () |
| Return the adjoint eikonal solver. | |
| void | setSuffix (const word &suffix) |
| Set suffix. | |
| const word & | getSuffix () const |
| Get suffix. | |
| virtual bool | computeDxDbInternalField () const |
| Should the parameterization compute the internalField of dxdb. | |
| virtual const scalarField & | calculateSensitivities (autoPtr< designVariables > &designVars) |
| Calculates and returns sensitivity fields. | |
| const scalarField & | getSensitivities () const |
| Returns the sensitivity fields. | |
| 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. | |
| sensitivity (const fvMesh &mesh, const dictionary &dict) | |
| Construct from components. | |
| virtual | ~sensitivity ()=default |
| Destructor. | |
| const fvMesh & | mesh () const |
| Return reference to mesh. | |
| const dictionary & | dict () const |
| Return the construction dictionary. | |
| const autoPtr< volScalarField > & | fieldSensPtr () const |
| Get the fieldSensPtr. | |
Protected Member Functions | |
| label | computeFaceDerivativesSize (const bool computeVectorFieldSize) |
| Compute the size of the return field. | |
| void | smoothSensitivities () |
| Smooth sensitivity derivatives based on the computation of the 'Sobolev gradient'. | |
| scalar | computeRadius (const faMesh &aMesh) |
| Compute the physical smoothing radius based on the average boundary face 'length'. | |
| Protected Member Functions inherited from sensitivitySurfacePoints | |
| labelHashSet | populateExtendedIDs () const |
| Set suffix name for sensitivity fields. | |
| void | finalisePointSensitivities () |
| Converts face sensitivities to point sensitivities and adds the ones directly computed in points (i.e. dSf/db and dnf/db). | |
| void | constructGlobalPointNormalsAndAreas (vectorField &pointNormals, scalarField &pointMagSf) |
| Construct globally correct point normals and point areas. | |
| void | setSuffixName () |
| Set suffix name for sensitivity fields. | |
| void | computePointDerivativesSize () |
| Allocate the proper size for the point-based sensitivities. | |
| Protected Member Functions inherited from sensitivityShapeESI | |
| void | computeDxDbMult () |
| Compute dxdbMult from its various components. | |
| Protected Member Functions inherited from ShapeSensitivitiesBase | |
| void | allocateEikonalSolver () |
| Allocate the adjoint eikonal solver. | |
| bool | hasMultiplier (bool(objective::*hasFunction)() const) |
| Check if any of the available objective has a certain multiplier, provided through a function object. | |
| 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. | |
| template<class Type> | |
| void | constructAndWriteSensitivtyPointField (const autoPtr< List< Field< Type > > > &sensFieldPtr, const word &name) const |
| Constructs pointField based on boundaryField and writes it. | |
| 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. | |
| void | writeFaceBasedSens () const |
| Write face-based sensitivities, if present. | |
| void | writePointBasedSens () const |
| Write point-based sensitivities, if present. | |
| void | clearSurfaceFields () |
| Clear surface/point fields. | |
| void | allocateMultipliers () |
| Allocate multiplier fields. | |
| void | clearMultipliers () |
| Clear multipliers. | |
Protected Attributes | |
| bool | smoothSensitivities_ |
| Smooth sensitivity derivatives based on a surface Laplace solver. | |
| bool | returnVectorField_ |
| Return the complete vector of sensitivities. | |
| Protected Attributes inherited from sensitivitySurfacePoints | |
| bool | writeGeometricInfo_ |
| Write geometric info for use by external programs. | |
| bool | includeSurfaceArea_ |
| Include surface area in sens computation. | |
| boolList | isSymmetryPoint_ |
| Is point belonging to a symmetry{Plane}. | |
| vectorField | symmPointNormal_ |
| Local point normal per symmetry point. | |
| labelHashSet | extendedPatchIDs_ |
| Extended patchIDs. | |
| Protected Attributes inherited from ShapeSensitivitiesBase | |
| labelHashSet | sensitivityPatchIDs_ |
| Patches on which to compute shape sensitivities. | |
| bool | writeAllSurfaceFiles_ |
| Whether to write all surface sensitivity fields. | |
| autoPtr< boundaryVectorField > | wallFaceSensVecPtr_ |
| Wall face sens w.r.t. (x,y.z). | |
| autoPtr< boundaryScalarField > | wallFaceSensNormalPtr_ |
| Wall face sens projected to normal. | |
| autoPtr< boundaryVectorField > | wallFaceSensNormalVecPtr_ |
| Normal sens as vectors. | |
| autoPtr< pointBoundaryVectorField > | wallPointSensVecPtr_ |
| Wall point sens w.r.t. (x,y.z). | |
| autoPtr< pointBoundaryScalarField > | wallPointSensNormalPtr_ |
| Wall point sens projected to normal. | |
| autoPtr< pointBoundaryVectorField > | wallPointSensNormalVecPtr_ |
| Normal sens as vectors. | |
| Protected Attributes inherited from adjointSensitivity | |
| adjointSolver & | adjointSolver_ |
| Reference to the underlaying adjoint solver. | |
| scalarField | derivatives_ |
| The sensitivity derivative values. | |
| word | suffix_ |
| Append this word to files related to the sensitivities. | |
| bool | includeDistance_ |
| Include distance variation in sensitivity computations. | |
| autoPtr< adjointEikonalSolver > | eikonalSolver_ |
| Adjoint eikonal equation solver. | |
| autoPtr< adjointMeshMovementSolver > | adjointMeshMovementSolver_ |
| Adjoint grid displacement solver. | |
| autoPtr< volTensorField > | gradDxDbMult_ |
| Multiplier of grad(dx/b). | |
| autoPtr< scalarField > | divDxDbMult_ |
| Multiplier of div(dx/db). | |
| autoPtr< boundaryVectorField > | dxdbMult_ |
| Multiplier of face dx/db. | |
| autoPtr< boundaryVectorField > | dSfdbMult_ |
| Multiplier of dSf/db. | |
| autoPtr< boundaryVectorField > | dnfdbMult_ |
| Multiplier of dnf/db. | |
| autoPtr< boundaryVectorField > | dxdbDirectMult_ |
| Multiplier of dCf/db, found in the objective function. | |
| autoPtr< pointBoundaryVectorField > | pointDxDbDirectMult_ |
| Multiplier of dx/db computed at points, found in the objective function. | |
| autoPtr< boundaryVectorField > | bcDxDbMult_ |
| Multiplier of dx/db, coming from boundary conditions that depend on the geometry, like rotatingWallVelocity. | |
| autoPtr< vectorField > | optionsDxDbMult_ |
| dx/db multiplier coming from fvOptions | |
| Protected Attributes inherited from sensitivity | |
| const fvMesh & | mesh_ |
| dictionary | dict_ |
| bool | writeFieldSens_ |
| autoPtr< volScalarField > | fieldSensPtr_ |
Additional Inherited Members | |
| Static Public Member Functions inherited from adjointSensitivity | |
| static autoPtr< adjointSensitivity > | New (const fvMesh &mesh, const dictionary &dict, adjointSolver &adjointSolver) |
| Return a reference to the selected turbulence model. | |
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.
Definition at line 70 of file sensitivitySurface.H.
| sensitivitySurface | ( | const fvMesh & | mesh, |
| const dictionary & | dict, | ||
| adjointSolver & | adjointSolver ) |
Construct from components.
Definition at line 265 of file sensitivitySurface.C.
References computeFaceDerivativesSize(), Foam::createZeroBoundaryPtr(), adjointSensitivity::derivatives_, dict, mesh, sensitivity::mesh_, returnVectorField_, smoothSensitivities_, ShapeSensitivitiesBase::wallFaceSensNormalPtr_, ShapeSensitivitiesBase::wallFaceSensNormalVecPtr_, ShapeSensitivitiesBase::wallFaceSensVecPtr_, and Foam::Zero.

|
virtualdefault |
Destructor.
|
protected |
Compute the size of the return field.
Definition at line 49 of file sensitivitySurface.C.
References sensitivity::mesh_, and ShapeSensitivitiesBase::sensitivityPatchIDs_.
Referenced by assembleSensitivities(), and sensitivitySurface().

|
protected |
Smooth sensitivity derivatives based on the computation of the 'Sobolev gradient'.
Definition at line 65 of file sensitivitySurface.C.
References dictionary::add(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), computeRadius(), DebugInfo, dict, Foam::dimArea, Foam::dimless, DLListBase::empty(), Foam::endl(), faMesh::faceAreaNormals(), Foam::gMax(), Foam::Info, SolverPerformance< Type >::initialResidual(), io, iters(), Foam::fam::laplacian(), Foam::mag(), sensitivity::mesh_, IOobjectOption::MUST_READ, objectRegistry::newIOobject(), Foam::nl, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, GeometricField< Type, PatchField, GeoMesh >::normalise(), patchID, faMesh::prefix(), faMatrix< Type >::relax(), autoPtr< T >::reset(), ShapeSensitivitiesBase::sensitivityPatchIDs_, faMatrix< Type >::solve(), Foam::fam::Sp(), Foam::sqr(), Foam::sqrt(), dictionary::subDictOrAdd(), adjointSensitivity::suffix_, faMesh::TryNew(), vsm(), ShapeSensitivitiesBase::wallFaceSensVecPtr_, regIOobject::write(), dictionary::writeEntry(), Foam::Zero, and faPatchFieldBase::zeroGradientType().
Referenced by assembleSensitivities().


|
protected |
Compute the physical smoothing radius based on the average boundary face 'length'.
Definition at line 245 of file sensitivitySurface.C.
References dict, forAll, Foam::gAverage(), sensitivity::mesh_, Foam::pow(), and faMesh::S().
Referenced by smoothSensitivities().


| void read | ( | ) |
Read controls and update solver pointers if necessary.
Definition at line 290 of file sensitivitySurface.C.
References dict, sensitivitySurfacePoints::read(), returnVectorField_, and smoothSensitivities_.

|
virtual |
Assemble sensitivities.
Reimplemented from sensitivitySurfacePoints.
Definition at line 301 of file sensitivitySurface.C.
References sensitivitySurfacePoints::assembleSensitivities(), computeFaceDerivativesSize(), adjointSensitivity::derivatives_, forAll, sensitivity::mesh_, pp(), returnVectorField_, ShapeSensitivitiesBase::sensitivityPatchIDs_, smoothSensitivities(), smoothSensitivities_, ShapeSensitivitiesBase::wallFaceSensNormalPtr_, ShapeSensitivitiesBase::wallFaceSensNormalVecPtr_, ShapeSensitivitiesBase::wallFaceSensVecPtr_, ShapeSensitivitiesBase::wallPointSensVecPtr_, write(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), Vector< Cmpt >::z(), and Foam::Zero.

|
protected |
Smooth sensitivity derivatives based on a surface Laplace solver.
Definition at line 81 of file sensitivitySurface.H.
Referenced by assembleSensitivities(), read(), and sensitivitySurface().
|
protected |
Return the complete vector of sensitivities.
Definition at line 86 of file sensitivitySurface.H.
Referenced by assembleSensitivities(), read(), and sensitivitySurface().