incompressibleAdjointVars.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::incompressibleAdjointVars
31 
32 Description
33  Class including all adjoint fields for incompressible flows
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef incompressibleAdjointVars_H
38 #define incompressibleAdjointVars_H
39 
41 #include "objectiveManager.H"
42 #include "adjointRASModel.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class incompressibleAdjointVars Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Reference to the objectiveManager
63 
64  //- Adjoint to the turbulence model
66 
67 
68  // Protected Member Functions
69 
70  //- No copy construct
72 
73  //- No copy assignment
74  void operator=(const incompressibleAdjointVars&) = delete;
75 
76 
77 public:
78 
79 
80  // Static Data Members
81 
82  //- Run-time type information
83  TypeName("incompressibleAdjointVars");
84 
85 
86  // Constructors
87 
88  //- Construct from mesh
90  (
91  fvMesh& mesh,
92  solverControl& SolverControl,
93  objectiveManager& objManager,
95  );
96 
97 
98  //- Destructor
99  virtual ~incompressibleAdjointVars() = default;
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return const reference to the adjointRASModel
108  adjointTurbulence() const;
109 
110  //- Return non-const reference to the adjointRASModel
113 
114  //- Restore field values to the initial ones
115  void restoreInitValues();
116 
117  //- Reset mean fields to zero
118  void resetMeanFields();
119 
120  //- Compute mean fields on the fly
121  void computeMeanFields();
122 
123  //- Nullify all adjoint fields
124  virtual void nullify();
125 
126  //- Update primal based quantities of the adjoint boundary
127  // conditions
128  virtual void updatePrimalBasedQuantities();
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Class for managing objective functions.
void operator=(const incompressibleAdjointVars &)=delete
No copy assignment.
incompressibleAdjointVars(const incompressibleAdjointVars &)=delete
No copy construct.
TypeName("incompressibleAdjointVars")
Run-time type information.
objectiveManager & objectiveManager_
Reference to the objectiveManager.
Class including all adjoint fields for incompressible flows.
virtual void nullify()
Nullify all adjoint fields.
Base class for solution control classes.
dynamicFvMesh & mesh
virtual ~incompressibleAdjointVars()=default
Destructor.
Base class for solver control classes.
Definition: solverControl.H:45
const autoPtr< incompressibleAdjoint::adjointRASModel > & adjointTurbulence() const
Return const reference to the adjointRASModel.
Manages the adjoint mean flow fields and their mean values.
void computeMeanFields()
Compute mean fields on the fly.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual void updatePrimalBasedQuantities()
Update primal based quantities of the adjoint boundary.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
void restoreInitValues()
Restore field values to the initial ones.
void resetMeanFields()
Reset mean fields to zero.
Namespace for OpenFOAM.
autoPtr< incompressibleAdjoint::adjointRASModel > adjointTurbulence_
Adjoint to the turbulence model.