Calculation of adjoint-based sensitivities at wall points using the E-SI formulation. More...
Public Member Functions | |
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 labelHashSet & | geometryVariationIntegrationPatches () const |
Return set of patches on which to compute direct sensitivities. More... | |
virtual void | assembleSensitivities (autoPtr< designVariables > &designVars) |
Assemble 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 labelHashSet & | sensitivityPatchIDs () 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< volVectorField > | getWallFaceSensVec () |
Get wall face sensitivity vectors field. More... | |
tmp< volScalarField > | getWallFaceSensNormal () |
Get wall face sensitivity projected to normal field. More... | |
tmp< volVectorField > | getWallFaceSensNormalVec () |
Get wall face normal sens as vectors field. More... | |
tmp< pointVectorField > | getWallPointSensVec () |
Get wall point sensitivity vectors field. More... | |
tmp< pointScalarField > | getWallPointSensNormal () |
Get wall point sensitivity projected to normal field. More... | |
tmp< pointVectorField > | getWallPointSensNormalVec () |
Get wall point sens as vectors field. More... | |
virtual const boundaryVectorField & | getWallFaceSensVecBoundary () const |
Get wall face sensitivity vectors field. More... | |
virtual const boundaryScalarField & | getWallFaceSensNormalBoundary () const |
Get wall face sensitivity projected to normal field. More... | |
virtual const boundaryVectorField & | getWallFaceSensNormalVecBoundary () 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 adjointSolver & | getAdjointSolver () const |
Const access to adjoint solver. More... | |
adjointSolver & | getAdjointSolver () |
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 word & | getSuffix () const |
Get suffix. More... | |
virtual bool | computeDxDbInternalField () const |
Should the parameterization compute the internalField of dxdb. More... | |
virtual const scalarField & | calculateSensitivities (autoPtr< designVariables > &designVars) |
Calculates and returns sensitivity fields. More... | |
const scalarField & | getSensitivities () 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 fvMesh & | mesh () const |
Return reference to mesh. More... | |
const dictionary & | dict () const |
Return the construction dictionary. More... | |
const autoPtr< volScalarField > & | fieldSensPtr () const |
Get the fieldSensPtr. More... | |
Protected Member Functions | |
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 | 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< boundaryVectorField > | wallFaceSensVecPtr_ |
Wall face sens w.r.t. (x,y.z) More... | |
autoPtr< boundaryScalarField > | wallFaceSensNormalPtr_ |
Wall face sens projected to normal. More... | |
autoPtr< boundaryVectorField > | wallFaceSensNormalVecPtr_ |
Normal sens as vectors. More... | |
autoPtr< pointBoundaryVectorField > | wallPointSensVecPtr_ |
Wall point sens w.r.t. (x,y.z) More... | |
autoPtr< pointBoundaryScalarField > | wallPointSensNormalPtr_ |
Wall point sens projected to normal. More... | |
autoPtr< pointBoundaryVectorField > | wallPointSensNormalVecPtr_ |
Normal sens as vectors. More... | |
Protected Attributes inherited from adjointSensitivity | |
adjointSolver & | adjointSolver_ |
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< adjointEikonalSolver > | eikonalSolver_ |
Adjoint eikonal equation solver. More... | |
autoPtr< adjointMeshMovementSolver > | adjointMeshMovementSolver_ |
Adjoint grid displacement solver. More... | |
autoPtr< volTensorField > | gradDxDbMult_ |
Multiplier of grad(dx/b) More... | |
autoPtr< scalarField > | divDxDbMult_ |
Multiplier of div(dx/db) More... | |
autoPtr< boundaryVectorField > | dxdbMult_ |
Multiplier of face dx/db. More... | |
autoPtr< boundaryVectorField > | dSfdbMult_ |
Multiplier of dSf/db. More... | |
autoPtr< boundaryVectorField > | dnfdbMult_ |
Multiplier of dnf/db. More... | |
autoPtr< boundaryVectorField > | dxdbDirectMult_ |
Multiplier of dCf/db, found in the objective function. More... | |
autoPtr< pointBoundaryVectorField > | pointDxDbDirectMult_ |
Multiplier of dx/db computed at points, found in the objective function. More... | |
autoPtr< boundaryVectorField > | bcDxDbMult_ |
Multiplier of dx/db, coming from boundary conditions that depend on the geometry, like rotatingWallVelocity. More... | |
autoPtr< vectorField > | optionsDxDbMult_ |
dx/db multiplier coming from fvOptions More... | |
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. More... | |
Calculation of adjoint-based sensitivities at wall points using the E-SI formulation.
Definition at line 49 of file sensitivitySurfacePoints.H.
sensitivitySurfacePoints | ( | const fvMesh & | mesh, |
const dictionary & | dict, | ||
adjointSolver & | adjointSolver | ||
) |
Construct from components.
Definition at line 277 of file sensitivitySurfacePoints.C.
References Foam::ensightOutput::debug, Foam::endl(), forAll, Foam::Info, PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::nl, PrimitivePatch< FaceList, PointField >::pointNormals(), pp(), and Foam::read().
|
virtualdefault |
Destructor.
|
protected |
Set suffix name for sensitivity fields.
Definition at line 48 of file sensitivitySurfacePoints.C.
References fvMesh::boundary(), forAll, sensitivity::mesh_, pp(), and UPtrList< T >::size().
|
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 76 of file sensitivitySurfacePoints.C.
References adjointSensitivity::bcDxDbMult_, fvMesh::boundary(), adjointSensitivity::dnfdbMult_, adjointSensitivity::dSfdbMult_, adjointSensitivity::dxdbDirectMult_, adjointSensitivity::dxdbMult_, sensitivitySurfacePoints::extendedPatchIDs_, polyMesh::faces(), forAll, Foam::I, sensitivitySurfacePoints::isSymmetryPoint_, deltaBoundary::makeFaceCentresAndAreas_d(), sensitivity::mesh_, n, p, Foam::foamVersion::patch, face::points(), polyMesh::points(), UList< T >::size(), Foam::sqr(), sensitivitySurfacePoints::symmPointNormal_, Foam::transform(), ShapeSensitivitiesBase::wallPointSensVecPtr_, and Foam::Zero.
|
protected |
Construct globally correct point normals and point areas.
Definition at line 175 of file sensitivitySurfacePoints.C.
References Foam::dimless, forAll, MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, Field< Type >::normalise(), Foam::foamVersion::patch, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), syncTools::syncPointList(), and Foam::Zero.
|
protected |
Set suffix name for sensitivity fields.
Definition at line 68 of file sensitivitySurfacePoints.C.
References adjointSensitivity::adjointMeshMovementSolver_, adjointSensitivity::adjointSolver_, sensitivity::dict(), word::null, adjointSensitivity::setSuffix(), and solver::solverName().
|
protected |
Allocate the proper size for the point-based sensitivities.
Definition at line 260 of file sensitivitySurfacePoints.C.
References polyMesh::boundaryMesh(), adjointSensitivity::derivatives_, sensitivity::mesh_, ShapeSensitivitiesBase::sensitivityPatchIDs_, and Foam::Zero.
TypeName | ( | "surfacePoints" | ) |
Runtime type information.
void read | ( | ) |
Read controls and update solver pointers if necessary.
Definition at line 337 of file sensitivitySurfacePoints.C.
References sensitivity::dict(), dictionary::getOrDefault(), sensitivitySurfacePoints::includeSurfaceArea_, and sensitivitySurfacePoints::writeGeometricInfo_.
Referenced by sensitivitySurface::read(), and sensitivitySurfacePoints::readDict().
|
virtual |
Read dict if changed.
Reimplemented from sensitivityShapeESI.
Definition at line 347 of file sensitivitySurfacePoints.C.
References sensitivity::dict(), sensitivitySurfacePoints::read(), and sensitivityShapeESI::readDict().
|
virtual |
Return set of patches on which to compute direct sensitivities.
Reimplemented from ShapeSensitivitiesBase.
Definition at line 360 of file sensitivitySurfacePoints.C.
|
virtual |
Assemble sensitivities.
Reimplemented from sensitivityShapeESI.
Reimplemented in sensitivitySurface.
Definition at line 367 of file sensitivitySurfacePoints.C.
References adjointSensitivity::assembleSensitivities(), forAll, Field< Type >::normalise(), Foam::foamVersion::patch, Foam::constant::mathematical::pi(), syncTools::syncPointList(), Foam::vtk::write(), and Foam::Zero.
Referenced by sensitivitySurface::assembleSensitivities().
|
virtual |
Write sensitivity fields.
If valid, copies boundaryFields to pointFields and writes them.
Reimplemented from ShapeSensitivitiesBase.
Definition at line 490 of file sensitivitySurfacePoints.C.
References IOobjectOption::AUTO_WRITE, fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), sensitivity::mesh_, IOobjectOption::NO_READ, Foam::foamVersion::patch, ShapeSensitivitiesBase::sensitivityPatchIDs_, fvMesh::time(), Time::timeName(), ShapeSensitivitiesBase::write(), adjointSensitivity::write(), sensitivitySurfacePoints::writeGeometricInfo_, and Foam::Zero.
|
protected |
Write geometric info for use by external programs.
Definition at line 60 of file sensitivitySurfacePoints.H.
Referenced by sensitivitySurfacePoints::read(), and sensitivitySurfacePoints::write().
|
protected |
Include surface area in sens computation.
Definition at line 65 of file sensitivitySurfacePoints.H.
Referenced by sensitivitySurfacePoints::read().
|
protected |
Is point belonging to a symmetry{Plane}.
Definition at line 70 of file sensitivitySurfacePoints.H.
Referenced by sensitivitySurfacePoints::finalisePointSensitivities().
|
protected |
Local point normal per symmetry point.
Definition at line 75 of file sensitivitySurfacePoints.H.
Referenced by sensitivitySurfacePoints::finalisePointSensitivities().
|
protected |
Extended patchIDs.
Sensitivities from patches adjacent to the sensitivityPatchIDs_ should also be taken into consideration in order to compute the correct values at points in their interfaces
Definition at line 75 of file sensitivitySurfacePoints.H.
Referenced by sensitivitySurfacePoints::finalisePointSensitivities().