boundaryAdjointContributionIncompressible.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 
29 Class
30  Foam::boundaryAdjointContributionIncompressible
31 
32 Description
33  Contributions of objective function differentiation to adjoint
34  boundary conditions for incompressible flows
35 
36 
37 SourceFiles
38  boundaryAdjointContributionIncompressible.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef boundaryAdjointContributionIncompressible_H
43 #define boundaryAdjointContributionIncompressible_H
44 
46 #include "IOdictionary.H"
47 #include "autoPtr.H"
48 #include "runTimeSelectionTables.H"
49 #include "objectiveManager.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class boundaryAdjointContributionIncompressible Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
65 {
66 private:
67 
68  // Private Member Functions
69 
70  //- No copy construct
72  (
74  ) = delete;
75 
76  //- No copy assignment
77  void operator=
78  (
80  ) = delete;
81 
82 
83 protected:
84 
85  // Protected data
86 
88 
90 
91  //- Note: getting a reference to the adjoint vars in the constructor of
92  //- boundaryAdjointContributionIncompressible is dangerous since the
93  //- autoPtr that holds them has not been completed yet. Instead, get
94  //- a reference to the solver and grab the adjoint vars from there,
95  //- when necessary
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("incompressible");
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& managerName,
111  const word& adjointSolverName,
112  const word& simulationType,
113  const fvPatch& patch
114  );
115 
116 
117  //- Destructor
118  virtual ~boundaryAdjointContributionIncompressible() = default;
119 
120 
121  // Member Functions
122 
123 // tmp<vectorField> boundarydJtotdv();
133 
138 
143 
144  const fvPatchVectorField& Ub() const;
145  const fvPatchScalarField& pb() const;
146  const fvsPatchScalarField& phib() const;
148  const fvPatchVectorField& Uab() const;
149  const fvPatchScalarField& pab() const;
150  const fvsPatchScalarField& phiab() const;
151 
152  const word primalSolverName() const;
153  const word adjointSolverName() const;
154 
155  const incompressibleVars& primalVars() const;
156  const incompressibleAdjointVars& adjointVars() const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Class for managing objective functions.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
Class including all adjoint fields for incompressible flows.
Base class for incompressibleAdjoint solvers.
virtual ~boundaryAdjointContributionIncompressible()=default
Destructor.
Base class for solution control classes.
Contributions of objective function differentiation to adjoint boundary conditions for incompressible...
A class for handling words, derived from Foam::string.
Definition: word.H:63
const incompressibleAdjointSolver & adjointSolver_
Note: getting a reference to the adjoint vars in the constructor of boundaryAdjointContributionIncomp...
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
TypeName("incompressible")
Runtime type information.
const std::string patch
OpenFOAM patch number as a std::string.
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Namespace for OpenFOAM.