adjointMeshMovementSolverIncompressible.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-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
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
29Class
30 Foam::incompressible::adjointMeshMovementSolver
31
32Description
33 Solver of the adjoint to the Laplace grid displacement equation
34
35 Reference:
36 \verbatim
37 Kavvadias, I., Papoutsis-Kiachagias, E., & Giannakoglou, K. (2015).
38 On the proper treatment of grid sensitivities in continuous adjoint
39 methods for shape optimization.
40 Journal of Computational Physics, 301, 1–18.
41 http://doi.org/10.1016/j.jcp.2015.08.012
42 \endverbatim
43
44SourceFiles
45 adjointMeshMovementSolver.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef adjointMeshMovementSolverIncompressible_H
50#define adjointMeshMovementSolverIncompressible_H
51
54#include "createZeroField.H"
55#include "boundaryFieldsFwd.H"
56
57// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58
59namespace Foam
60{
61
62namespace incompressible
63{
64
65/*---------------------------------------------------------------------------*\
66 Class adjointMeshMovementSolver Declaration
67\*---------------------------------------------------------------------------*/
70{
71protected:
72
73 // Protected data
75 const fvMesh& mesh_;
80 scalar tolerance_;
83
84 //- Wall face sens w.r.t.(x, y.z) //wall face sens w.r.t. (x,y.z)
87
88 //- Read options each time a new solution is found
89 void read();
90
91
92private:
93
94 // Private Member Functions
95
96 //- No copy construct
98
99 //- No copy assignment
100 void operator=(const adjointMeshMovementSolver&) = delete;
101
102
103public:
104
105 //- Runtime type information
106 TypeName("adjointMeshMovementSolver");
107
108
109 // Constructors
110
111 //- Construct from components
113 (
114 const fvMesh& mesh,
115 const dictionary& dict,
117 const labelHashSet& sensitivityPatchIDs,
118 const autoPtr<adjointEikonalSolver>& adjointEikonalSolverPtr
119 );
120
121 //- Destructor
122 virtual ~adjointMeshMovementSolver() = default;
123
124
125 // Member Functions
126
127 //- Read dict if changed
128 virtual bool readDict(const dictionary& dict);
129
130 //- Accumulate source term
131 void accumulateIntegrand(const scalar dt);
132
133 //- Calculate the adjoint distance field
134 void solve();
135
136 //- Reset source term
137 void reset();
138
139 //- Return the sensitivity term depending on da
141
142 //- Return the adjoint distance field
143 const volVectorField& ma();
144};
145
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149} // End namespace incompressible
150} // End namespace Foam
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
Useful typenames for fields defined only at the boundaries.
Generic GeometricBoundaryField class.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Solver of the adjoint to the Laplace grid displacement equation.
autoPtr< boundaryVectorField > meshMovementSensPtr_
Wall face sens w.r.t.(x, y.z) //wall face sens w.r.t. (x,y.z)
virtual bool readDict(const dictionary &dict)
Read dict if changed.
TypeName("adjointMeshMovementSolver")
Runtime type information.
virtual ~adjointMeshMovementSolver()=default
Destructor.
boundaryVectorField & meshMovementSensitivities()
Return the sensitivity term depending on da.
void read()
Read options each time a new solution is found.
void accumulateIntegrand(const scalar dt)
Accumulate source term.
const volVectorField & ma()
Return the adjoint distance field.
Abstract base class for adjoint-based sensitivities in incompressible flows.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73