boundaryAdjointContribution.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::boundaryAdjointContribution
31
32Description
33 Abstract base class for computing contributions of the objective functions
34 to the adjoint boundary conditions
35
36SourceFiles
37 boundaryAdjointContribution.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef boundaryAdjointContribution_H
42#define boundaryAdjointContribution_H
43
44#include "IOdictionary.H"
45#include "autoPtr.H"
47#include "fvPatchFields.H"
48#include "fvsPatchFields.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class boundaryAdjointContribution Declaration
57\*---------------------------------------------------------------------------*/
60{
61private:
62
63 // Private Member Functions
64
65 //- No copy construct
67 (
69 ) = delete;
70
71 //- No copy assignment
72 void operator=(const boundaryAdjointContribution&) = delete;
73
74
75protected:
76
77 // Protected data
79 const fvPatch& patch_;
80
81
82public:
83
84 //- Runtime type information
85 TypeName("boundaryAdjointContribution");
86
87
88 // Declare run-time constructor selection table
91 (
92 autoPtr,
95 (
96 const word& managerName,
98 const word& simulationType,
99 const fvPatch& patch
100 ),
101 (managerName, adjointSolverName, simulationType, patch)
102 );
103
104 // Constructors
105
106 //- Construct from components
108 (
109 const word& managerName,
110 const word& adjointSolverName,
111 const word& simulationType,
112 const fvPatch& patch
113 );
114
115
116 // Selectors
117
118 //- Return a reference to the selected turbulence model
120 (
121 const word& managerName,
122 const word& adjointSolverName,
123 const word& simulationType,
124 const fvPatch& patch
125 );
126
127
128 //- Destructor
129 virtual ~boundaryAdjointContribution() = default;
130
131
132 // Member Functions
133
134 // Contribution to surface sensitivities for a specific patch
141 virtual tmp<scalarField> dJdnut();
143 virtual tmp<scalarField> energySource() = 0;
148 virtual tmp<scalarField> wallDistance() = 0;
149
154
155 // References to primal and adjoint fields for the specific patch
156 virtual const fvPatchVectorField& Ub() const = 0;
157 virtual const fvPatchScalarField& pb() const = 0;
158 virtual const fvsPatchScalarField& phib() const = 0;
159 virtual const fvPatchScalarField& turbulentDiffusivity() const = 0;
160 virtual const fvPatchVectorField& Uab() const = 0;
161 virtual const fvPatchScalarField& pab() const = 0;
162 virtual const fvsPatchScalarField& phiab() const = 0;
163
164 // Field suffixes for primal and adjoint fields
165 virtual const word primalSolverName() const = 0;
166 virtual const word adjointSolverName() const = 0;
167};
168
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172} // End namespace Foam
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176#endif
177
178// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
virtual tmp< scalarField > TMVariable2Diffusion()
virtual tmp< scalarField > thermalDiffusion()=0
virtual const fvPatchScalarField & turbulentDiffusivity() const =0
virtual tmp< scalarField > adjointTMVariable1Source()
virtual tmp< scalarField > energySource()=0
virtual tmp< scalarField > momentumDiffusion()=0
virtual ~boundaryAdjointContribution()=default
Destructor.
virtual tmp< vectorField > velocitySource()=0
virtual tmp< scalarField > adjointTMVariable2Source()
virtual tmp< scalarField > wallDistance()=0
virtual const fvPatchScalarField & pab() const =0
virtual tmp< scalarField > TMVariable1Diffusion()
declareRunTimeSelectionTable(autoPtr, boundaryAdjointContribution, dictionary,(const word &managerName, const word &adjointSolverName, const word &simulationType, const fvPatch &patch),(managerName, adjointSolverName, simulationType, patch))
virtual tmp< vectorField > tangentVelocitySource()=0
virtual const word primalSolverName() const =0
virtual const word adjointSolverName() const =0
TypeName("boundaryAdjointContribution")
Runtime type information.
virtual const fvPatchVectorField & Ub() const =0
virtual const fvPatchScalarField & pb() const =0
virtual const fvsPatchScalarField & phiab() const =0
virtual const fvPatchVectorField & Uab() const =0
virtual tmp< scalarField > laminarDiffusivity()=0
static autoPtr< boundaryAdjointContribution > New(const word &managerName, const word &adjointSolverName, const word &simulationType, const fvPatch &patch)
Return a reference to the selected turbulence model.
virtual const fvsPatchScalarField & phib() const =0
virtual tmp< vectorField > normalVelocitySource()=0
virtual tmp< scalarField > pressureSource()=0
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73