sensitivitySurface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2023 PCOpt/NTUA
9  Copyright (C) 2013-2023 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::sensitivitySurface
30 
31 Description
32  Calculation of adjoint based sensitivities at wall faces
33 
34  Reference:
35  \verbatim
36  The computation of the sensitivity derivatives follows the (E-)SI
37  formulation of
38 
39  Kavvadias, I. S., Papoutsis-Kiachagias, E. M.,
40  Giannakoglou, K. C. (2015).
41  On the proper treatment of grid sensitivities in continuous adjoint
42  methods for shape optimization.
43  Journal of computational physics, 301, 1-18.
44  https://doi.org/10.1016/j.jcp.2015.08.012
45 
46  whereas their smoothing based on the computation of the 'Sobolev
47  gradient' is derived from
48 
49  Vassberg J. C., Jameson A. (2006).
50  Aerodynamic Shape Optimization Part I: Theoretical Background.
51  VKI Lecture Series, Introduction to Optimization and
52  Multidisciplinary Design, Brussels, Belgium, 8 March, 2006.
53  \endverbatim
54 
55 SourceFiles
56  sensitivitySurface.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef sensitivitySurfaceIncompressible_H
61 #define sensitivitySurfaceIncompressible_H
62 
64 #include "faMesh.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class sensitivitySurface Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 :
78 {
79 protected:
80 
81  // Protected data
82 
83  //- Smooth sensitivity derivatives based on a surface Laplace solver
85 
86  //- Return the complete vector of sensitivities
87  bool returnVectorField_;
88 
89  //bool finalResultIncludesArea_;
90 
91 
92  // Protected Member Functions
93 
94  //- Compute the size of the return field
95  label computeFaceDerivativesSize(const bool computeVectorFieldSize);
96 
97  //- Smooth sensitivity derivatives based on the computation of the
98  //- 'Sobolev gradient'
99  void smoothSensitivities();
100 
101  //- Compute the physical smoothing radius based on the average boundary
102  //- face 'length'
103  scalar computeRadius(const faMesh& aMesh);
104 
105 
106 private:
107 
108  // Private Member Functions
109 
110  //- No copy construct
111  sensitivitySurface(const sensitivitySurface&) = delete;
112 
113  //- No copy assignment
114  void operator=(const sensitivitySurface&) = delete;
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("surface");
121 
122 
123  // Constructors
124 
125  //- Construct from components
127  (
128  const fvMesh& mesh,
129  const dictionary& dict,
131  );
132 
133 
134  //- Destructor
135  virtual ~sensitivitySurface() = default;
136 
137 
138  // Member Functions
139 
140  //- Read controls and update solver pointers if necessary
141  void read();
142 
143  //- Assemble sensitivities
144  virtual void assembleSensitivities
145  (
146  autoPtr<designVariables>& designVars
147  );
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:87
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("surface")
Runtime type information.
Base class for adjoint solvers.
Definition: adjointSolver.H:53
void read()
Read controls and update solver pointers if necessary.
const fvMesh & mesh() const
Return reference to mesh.
Definition: sensitivity.H:121
virtual void assembleSensitivities(autoPtr< designVariables > &designVars)
Assemble sensitivities.
void smoothSensitivities()
Smooth sensitivity derivatives based on the computation of the &#39;Sobolev gradient&#39;.
scalar computeRadius(const faMesh &aMesh)
Compute the physical smoothing radius based on the average boundary face &#39;length&#39;.
virtual ~sensitivitySurface()=default
Destructor.
bool smoothSensitivities_
Smooth sensitivity derivatives based on a surface Laplace solver.
const dictionary & dict() const
Return the construction dictionary.
Definition: sensitivity.H:129
Calculation of adjoint based sensitivities at wall faces.
label computeFaceDerivativesSize(const bool computeVectorFieldSize)
Compute the size of the return field.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
bool returnVectorField_
Return the complete vector of sensitivities.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Calculation of adjoint-based sensitivities at wall points using the E-SI formulation.
Namespace for OpenFOAM.