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 -------------------------------------------------------------------------------
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::objectives::objectivePtLosses
31 
32 Description
33 
34 SourceFiles
35  objectivePtLosses.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef objectivePtLosses_H
40 #define objectivePtLosses_H
41 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace objectives
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class objectivePtLosses Declaration
54 \*---------------------------------------------------------------------------*/
55 
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 
69  // Private Member Functions
70 
71  //- Return the objectiveReportPatches
72  void initialize();
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("PtLosses");
79 
80 
81  // Constructors
82 
83  //- from components
85  (
86  const fvMesh& mesh,
87  const dictionary& dict,
88  const word& adjointSolverName,
89  const word& primalSolverName
90  );
91 
92 
93  //- Destructor
94  virtual ~objectivePtLosses() = default;
95 
96 
97  // Member Functions
98 
99  //- Return the objective function value
100  virtual scalar J();
101 
102  //- Update values to be added to the adjoint inlet velocity
103  virtual void update_boundarydJdp();
104 
105  //- Update values to be added to the adjoint outlet velocity
106  virtual void update_boundarydJdv();
107 
108  //- Update values to be added to the adjoint outlet pressure
109  virtual void update_boundarydJdvn();
110 
111  //- Update values to be added to the adjoint outlet tangential velocity
112  virtual void update_boundarydJdvt();
113 
114  // Helper write functions
115 
116  //- Write headers for additional columns
117  virtual void addHeaderColumns() const;
118 
119  //- Write information to additional columns
120  virtual void addColumnValues() const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace objectives
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
const dictionary & dict() const
Return objective dictionary.
Definition: objective.C:91
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void update_boundarydJdp()
Update values to be added to the adjoint inlet velocity.
virtual void update_boundarydJdvt()
Update values to be added to the adjoint outlet tangential velocity.
virtual void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
dynamicFvMesh & mesh
TypeName("PtLosses")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~objectivePtLosses()=default
Destructor.
objectivePtLosses(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
virtual void addHeaderColumns() const
Write headers for additional columns.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual scalar J()
Return the objective function value.
virtual void addColumnValues() const
Write information to additional columns.
Abstract base class for objective functions in incompressible flows.
virtual void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
Namespace for OpenFOAM.