objectivePtLosses.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-2020 PCOpt/NTUA
9 Copyright (C) 2013-2020 FOSS GP
10 Copyright (C) 2019-2020 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::objectives::objectivePtLosses
31
32Description
33
34SourceFiles
35 objectivePtLosses.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef objectivePtLosses_H
40#define objectivePtLosses_H
41
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49namespace objectives
50{
51
52/*---------------------------------------------------------------------------*\
53 Class objectivePtLosses Declaration
54\*---------------------------------------------------------------------------*/
57:
59{
60 // Private data
61
62 //- Patches on which to compute losses
63 labelList patches_;
64
65 //- Total pressure per patch on patches_
66 scalarField patchPt_;
67
68
69public:
70
71 //- Runtime type information
72 TypeName("PtLosses");
73
74
75 // Constructors
76
77 //- from components
79 (
80 const fvMesh& mesh,
81 const dictionary& dict,
82 const word& adjointSolverName,
83 const word& primalSolverName
84 );
85
86
87 //- Destructor
88 virtual ~objectivePtLosses() = default;
89
90
91 // Member Functions
92
93 //- Return the objectiveReportPatches
94 void initialize();
95
96 //- Return the objective function value
97 scalar J();
98
99 //- Update values to be added to the adjoint inlet velocity
100 void update_boundarydJdp();
101
102 //- Update values to be added to the adjoint outlet velocity
103 void update_boundarydJdv();
104
105 //- Update values to be added to the adjoint outlet pressure
107
108 //- Update values to be added to the adjoint outlet tangential velocity
110
111 // Helper write functions
112
113 //- Write headers for additional columns
114 virtual void addHeaderColumns() const;
115
116 //- Write information to additional columns
117 virtual void addColumnValues() const;
118};
119
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123} // End namespace objectives
124} // End namespace Foam
125
126// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
128#endif
129
130// ************************************************************************* //
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
Abstract base class for objective functions in incompressible flows.
const dictionary & dict() const
Return objective dictionary.
Definition: objective.C:94
void initialize()
Return the objectiveReportPatches.
virtual void addHeaderColumns() const
Write headers for additional columns.
TypeName("PtLosses")
Runtime type information.
void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
scalar J()
Return the objective function value.
virtual ~objectivePtLosses()=default
Destructor.
void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
virtual void addColumnValues() const
Write information to additional columns.
void update_boundarydJdp()
Update values to be added to the adjoint inlet velocity.
void update_boundarydJdvt()
Update values to be added to the adjoint outlet tangential velocity.
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73