Calculation of adjoint based sensitivities at wall points. More...
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... | |
![]() | |
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 scalarField & | calculateSensitivities () |
Calculates and returns sensitivity fields. More... | |
const scalarField & | getSensitivities () const |
Returns the sensitivity fields. More... | |
tmp< volTensorField > | computeGradDxDbMultiplier () |
tmp< volVectorField > | adjointMeshMovementSource () |
Compute source term for adjoint mesh movement equation. More... | |
![]() | |
TypeName ("sensitivity") | |
Runtime type information. More... | |
sensitivity (const fvMesh &mesh, const dictionary &dict) | |
Construct from components. More... | |
virtual | ~sensitivity ()=default |
Destructor. More... | |
const dictionary & | dict () 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< adjointEikonalSolver > | eikonalSolver_ |
autoPtr< adjointMeshMovementSolver > | meshMovementSolver_ |
autoPtr< boundaryVectorField > | wallFaceSens_ |
The face-based part of the sensitivities. More... | |
autoPtr< boundaryVectorField > | dSfdbMult_ |
Multipliers of d(Sf)/db and d(nf)/db. More... | |
autoPtr< boundaryVectorField > | dnfdbMult_ |
![]() | |
scalarField | derivatives_ |
incompressibleVars & | primalVars_ |
incompressibleAdjointVars & | adjointVars_ |
objectiveManager & | objectiveManager_ |
![]() | |
const fvMesh & | mesh_ |
dictionary | dict_ |
autoPtr< volScalarField > | fieldSensPtr_ |
Additional Inherited Members | |
![]() | |
static autoPtr< adjointSensitivity > | New (const fvMesh &mesh, const dictionary &dict, incompressibleVars &primalVars, incompressibleAdjointVars &adjointVars, objectiveManager &objectiveManager) |
Return a reference to the selected turbulence model. More... | |
Calculation of adjoint based sensitivities at wall points.
Definition at line 59 of file sensitivitySurfacePointsIncompressible.H.
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.
|
virtualdefault |
Destructor.
|
protected |
Read controls and update solver pointers if necessary.
Definition at line 54 of file sensitivitySurfacePointsIncompressible.C.
References incompressibleAdjointVars::adjointTurbulence(), adjointSensitivity::adjointVars_, sensitivity::dict(), sensitivitySurfacePoints::eikonalSolver_, dictionary::getOrDefault(), sensitivitySurfacePoints::includeDistance_, sensitivitySurfacePoints::includeDivTerm_, sensitivitySurfacePoints::includeGradStressTerm_, sensitivitySurfacePoints::includeMeshMovement_, sensitivitySurfacePoints::includeObjective_, sensitivitySurfacePoints::includePressureTerm_, sensitivitySurfacePoints::includeSurfaceArea_, sensitivitySurfacePoints::includeTransposeStresses_, sensitivity::mesh_, sensitivitySurfacePoints::meshMovementSolver_, adjointSensitivity::primalVars_, incompressibleVars::RASModelVariables(), and sensitivitySurfacePoints::useSnGradInTranposeStresses_.
|
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().
|
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().
|
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().
|
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().
TypeName | ( | "surfacePoints" | ) |
Runtime type information.
|
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().
|
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.
|
virtual |
Assemble sensitivities.
Implements adjointSensitivity.
Definition at line 617 of file sensitivitySurfacePointsIncompressible.C.
References polyMesh::boundaryMesh(), sensitivitySurfacePoints::constructGlobalPointNormalsAndAreas(), adjointSensitivity::derivatives_, sensitivitySurfacePoints::finaliseFaceMultiplier(), sensitivitySurfacePoints::finalisePointSensitivities(), forAll, Pstream::gatherList(), sensitivitySurfacePoints::includeSurfaceArea_, Foam::mag(), sensitivity::mesh_, UPstream::myProcNo(), primitiveMesh::nPoints(), UPstream::nProcs(), Foam::foamVersion::patch, Pstream::scatterList(), List< T >::setSize(), syncTools::syncPointList(), VectorSpace< Vector< scalar >, scalar, 3 >::zero, and Foam::Zero.
|
virtual |
Zero sensitivity fields and their constituents.
Reimplemented from adjointSensitivity.
Definition at line 735 of file sensitivitySurfacePointsIncompressible.C.
References adjointSensitivity::clearSensitivities(), shapeSensitivitiesBase::clearSensitivities(), sensitivitySurfacePoints::dnfdbMult_, sensitivitySurfacePoints::dSfdbMult_, sensitivitySurfacePoints::eikonalSolver_, sensitivitySurfacePoints::includeDistance_, sensitivitySurfacePoints::includeMeshMovement_, sensitivitySurfacePoints::meshMovementSolver_, sensitivitySurfacePoints::wallFaceSens_, and VectorSpace< Vector< scalar >, scalar, 3 >::zero.
|
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().
|
protected |
Include surface area in sens computation.
Definition at line 70 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::assembleSensitivities(), and sensitivitySurfacePoints::read().
|
protected |
Include the adjoint pressure term in sens computation.
Definition at line 73 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().
|
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().
|
protected |
Include the transpose part of the adjoint stresses.
Definition at line 79 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), and sensitivitySurfacePoints::read().
|
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().
|
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().
|
protected |
Include distance variation in sens computation.
Definition at line 88 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), sensitivitySurfacePoints::finaliseFaceMultiplier(), and sensitivitySurfacePoints::read().
|
protected |
Include mesh movement variation in sens computation.
Definition at line 91 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), sensitivitySurfacePoints::finaliseFaceMultiplier(), sensitivitySurfacePoints::read(), and sensitivitySurfacePoints::setSuffixName().
|
protected |
Include terms directly emerging from the objective function.
Definition at line 94 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::finalisePointSensitivities(), and sensitivitySurfacePoints::read().
|
protected |
Definition at line 96 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), sensitivitySurfacePoints::finaliseFaceMultiplier(), sensitivitySurfacePoints::read(), and sensitivitySurfacePoints::readDict().
|
protected |
Definition at line 98 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), sensitivitySurfacePoints::finaliseFaceMultiplier(), sensitivitySurfacePoints::read(), and sensitivitySurfacePoints::readDict().
|
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().
|
protected |
Multipliers of d(Sf)/db and d(nf)/db.
Definition at line 108 of file sensitivitySurfacePointsIncompressible.H.
Referenced by sensitivitySurfacePoints::accumulateIntegrand(), sensitivitySurfacePoints::clearSensitivities(), and sensitivitySurfacePoints::finalisePointSensitivities().
|
protected |