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-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 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  // Protected Member Functions
100 
101  template<class returnType, class sourceType, class castType>
103  (
104  PtrList<sourceType>& sourceList,
105  const fvPatchField<returnType>&(castType::*boundaryFunction)
106  (const label)
107  );
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("incompressible");
114 
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const word& managerName,
122  const word& adjointSolverName,
123  const word& simulationType,
124  const fvPatch& patch
125  );
126 
127 
128  //- Destructor
129  virtual ~boundaryAdjointContributionIncompressible() = default;
130 
131 
132  // Member Functions
133 
134 // tmp<vectorField> boundarydJtotdv();
142 
147 
152 
153  const fvPatchVectorField& Ub() const;
154  const fvPatchScalarField& pb() const;
155  const fvsPatchScalarField& phib() const;
157  const fvPatchVectorField& Uab() const;
158  const fvPatchScalarField& pab() const;
159  const fvsPatchScalarField& phiab() const;
160 
161  const word primalSolverName() const;
162  const word adjointSolverName() const;
163 
164  const incompressibleVars& primalVars() const;
165  const incompressibleAdjointVars& adjointVars() const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
Foam::objectiveManager
class for managing incompressible objective functions.
Definition: objectiveManager.H:54
Foam::incompressibleAdjointSolver
Base class for incompressibleAdjoint solvers.
Definition: incompressibleAdjointSolver.H:54
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::boundaryAdjointContributionIncompressible::laminarDiffusivity
tmp< scalarField > laminarDiffusivity()
Definition: boundaryAdjointContributionIncompressible.C:240
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::boundaryAdjointContributionIncompressible
Contributions of objective function differentiation to adjoint boundary conditions for incompressible...
Definition: boundaryAdjointContributionIncompressible.H:61
boundaryAdjointContribution.H
Foam::boundaryAdjointContributionIncompressible::velocitySource
tmp< vectorField > velocitySource()
Definition: boundaryAdjointContributionIncompressible.C:89
Foam::boundaryAdjointContributionIncompressible::phiab
const fvsPatchScalarField & phiab() const
Definition: boundaryAdjointContributionIncompressible.C:379
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:68
Foam::boundaryAdjointContributionIncompressible::adjointTMVariable1Source
tmp< scalarField > adjointTMVariable1Source()
Definition: boundaryAdjointContributionIncompressible.C:197
objectiveManager.H
Foam::incompressibleAdjointVars
Class including all adjoint fields for incompressible flows.
Definition: incompressibleAdjointVars.H:52
Foam::boundaryAdjointContributionIncompressible::normalVelocitySource
tmp< vectorField > normalVelocitySource()
Definition: boundaryAdjointContributionIncompressible.C:168
Foam::boundaryAdjointContributionIncompressible::Ub
const fvPatchVectorField & Ub() const
Definition: boundaryAdjointContributionIncompressible.C:336
incompressibleAdjointSolver.H
boundaryAdjointContributionIncompressibleTemplates.C
Foam::boundaryAdjointContributionIncompressible::energySource
tmp< scalarField > energySource()
Definition: boundaryAdjointContributionIncompressible.C:182
Foam::boundaryAdjointContributionIncompressible::pab
const fvPatchScalarField & pab() const
Definition: boundaryAdjointContributionIncompressible.C:372
Foam::boundaryAdjointContributionIncompressible::adjointSolverName
const word adjointSolverName() const
Definition: boundaryAdjointContributionIncompressible.C:391
Foam::boundaryAdjointContributionIncompressible::wallDistance
tmp< scalarField > wallDistance()
Definition: boundaryAdjointContributionIncompressible.C:273
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::boundaryAdjointContributionIncompressible::phib
const fvsPatchScalarField & phib() const
Definition: boundaryAdjointContributionIncompressible.C:349
Foam::boundaryAdjointContributionIncompressible::~boundaryAdjointContributionIncompressible
virtual ~boundaryAdjointContributionIncompressible()=default
Destructor.
Foam::boundaryAdjointContributionIncompressible::Uab
const fvPatchVectorField & Uab() const
Definition: boundaryAdjointContributionIncompressible.C:366
objectiveIncompressible.H
Foam::boundaryAdjointContributionIncompressible::TMVariable1Diffusion
tmp< scalarField > TMVariable1Diffusion()
Definition: boundaryAdjointContributionIncompressible.C:285
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::boundaryAdjointContributionIncompressible::TypeName
TypeName("incompressible")
Runtime type information.
Foam::boundaryAdjointContributionIncompressible::adjointTMVariable2Source
tmp< scalarField > adjointTMVariable2Source()
Definition: boundaryAdjointContributionIncompressible.C:212
IOdictionary.H
Foam::boundaryAdjointContribution
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
Definition: boundaryAdjointContribution.H:58
Foam::boundaryAdjointContributionIncompressible::adjointSolver_
const incompressibleAdjointSolver & adjointSolver_
Definition: boundaryAdjointContributionIncompressible.H:95
Foam::boundaryAdjointContributionIncompressible::momentumDiffusion
tmp< scalarField > momentumDiffusion()
Definition: boundaryAdjointContributionIncompressible.C:226
Foam::boundaryAdjointContributionIncompressible::TMVariable1
tmp< scalarField > TMVariable1()
Definition: boundaryAdjointContributionIncompressible.C:310
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::boundaryAdjointContributionIncompressible::pb
const fvPatchScalarField & pb() const
Definition: boundaryAdjointContributionIncompressible.C:342
Foam::boundaryAdjointContributionIncompressible::pressureSource
tmp< scalarField > pressureSource()
Definition: boundaryAdjointContributionIncompressible.C:110
Foam::boundaryAdjointContributionIncompressible::TMVariable2
tmp< scalarField > TMVariable2()
Definition: boundaryAdjointContributionIncompressible.C:323
Foam::boundaryAdjointContributionIncompressible::adjointVars
const incompressibleAdjointVars & adjointVars() const
Definition: boundaryAdjointContributionIncompressible.C:405
Foam::boundaryAdjointContributionIncompressible::primalVars
const incompressibleVars & primalVars() const
Definition: boundaryAdjointContributionIncompressible.C:398
Foam::boundaryAdjointContributionIncompressible::sumContributions
tmp< Field< returnType > > sumContributions(PtrList< sourceType > &sourceList, const fvPatchField< returnType > &(castType::*boundaryFunction)(const label))
Foam::boundaryAdjointContributionIncompressible::tangentVelocitySource
tmp< vectorField > tangentVelocitySource()
Definition: boundaryAdjointContributionIncompressible.C:139
Foam::boundaryAdjointContributionIncompressible::turbulentDiffusivity
const fvPatchScalarField & turbulentDiffusivity() const
Definition: boundaryAdjointContributionIncompressible.C:356
Foam::boundaryAdjointContributionIncompressible::getObjectiveManager
objectiveManager & getObjectiveManager()
Definition: boundaryAdjointContributionIncompressible.C:412
Foam::boundaryAdjointContributionIncompressible::objectiveManager_
objectiveManager & objectiveManager_
Definition: boundaryAdjointContributionIncompressible.H:86
Foam::boundaryAdjointContributionIncompressible::primalVars_
const incompressibleVars & primalVars_
Definition: boundaryAdjointContributionIncompressible.H:88
Foam::boundaryAdjointContributionIncompressible::TMVariable2Diffusion
tmp< scalarField > TMVariable2Diffusion()
Definition: boundaryAdjointContributionIncompressible.C:298
Foam::boundaryAdjointContributionIncompressible::thermalDiffusion
tmp< scalarField > thermalDiffusion()
Definition: boundaryAdjointContributionIncompressible.C:254
Foam::boundaryAdjointContributionIncompressible::primalSolverName
const word primalSolverName() const
Definition: boundaryAdjointContributionIncompressible.C:385
Foam::incompressibleVars
Base class for solution control classes.
Definition: incompressibleVars.H:54
autoPtr.H