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 public:
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
106  void update_boundarydJdvn();
107 
108  //- Update values to be added to the adjoint outlet tangential velocity
109  void update_boundarydJdvt();
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 // ************************************************************************* //
Foam::objectives::objectivePtLosses::initialize
void initialize()
Return the objectiveReportPatches.
Definition: objectivePtLosses.C:82
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::objectives::objectivePtLosses::addColumnValues
virtual void addColumnValues() const
Write information to additional columns.
Definition: objectivePtLosses.C:247
Foam::objectives::objectivePtLosses::update_boundarydJdv
void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
Definition: objectivePtLosses.C:180
Foam::objectives::objectivePtLosses
Definition: objectivePtLosses.H:55
Foam::objectives::objectivePtLosses::TypeName
TypeName("PtLosses")
Runtime type information.
Foam::Field< scalar >
Foam::objectiveIncompressible
Abstract base class for objective functions in incompressible flows.
Definition: objectiveIncompressible.H:54
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
objectiveIncompressible.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::objectives::objectivePtLosses::addHeaderColumns
virtual void addHeaderColumns() const
Write headers for additional columns.
Definition: objectivePtLosses.C:237
Foam::objectives::objectivePtLosses::J
scalar J()
Return the objective function value.
Definition: objectivePtLosses.C:135
Foam::objectives::objectivePtLosses::update_boundarydJdp
void update_boundarydJdp()
Update values to be added to the adjoint inlet velocity.
Definition: objectivePtLosses.C:164
Foam::List< label >
Foam::objectives::objectivePtLosses::~objectivePtLosses
virtual ~objectivePtLosses()=default
Destructor.
Foam::objectives::objectivePtLosses::objectivePtLosses
objectivePtLosses(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
Definition: objectivePtLosses.C:58
Foam::objectives::objectivePtLosses::update_boundarydJdvn
void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
Definition: objectivePtLosses.C:200
Foam::objectives::objectivePtLosses::update_boundarydJdvt
void update_boundarydJdvt()
Update values to be added to the adjoint outlet tangential velocity.
Definition: objectivePtLosses.C:220