Loading...
Searching...
No Matches
objectivePowerDissipation.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-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 FOSS GP
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27
28Class
29 Foam::objectives::objectivePowerDissipation
30
31Description
32 Computes and minimizes the power dissipation within given cellZones.
33 In the absence of significant viscous stresses on the "inlet" and "outlet"
34 of the cellZones, this value is equal to the volume flow rate-weigthed
35 total pressure losses (see also objectivePtLosses) within th cellZones
36
37SourceFiles
38 objectivePowerDissipation.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef objectivePowerDissipation_H
43#define objectivePowerDissipation_H
44
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52namespace objectives
53{
55/*---------------------------------------------------------------------------*\
56 Class objectivePowerDissipation Declaration
57\*---------------------------------------------------------------------------*/
58
60:
61 public objectiveIncompressible
62{
63 // Private data
64
65 //- Where to define the objective
66 labelList zones_;
67
68
69 // Private Member Functions
70
71 //- Populate fieldNames
72 void populateFieldNames();
73
74
75public:
76
77 //- Runtime type information
78 TypeName("powerDissipation");
80
81 // Constructors
82
83 //- Construct 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 ~objectivePowerDissipation() = 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 outlet velocity
103 virtual void update_dJdv();
104
105 //- Update field to be added to the first adjoint turbulence model PDE
106 virtual void update_dJdTMvar1();
107
108 //- Update field to be added to the second adjoint turbulence model PDE
109 virtual void update_dJdTMvar2();
110
111 //- Update div(dx/db multiplier). Volume-based sensitivity term
112 virtual void update_divDxDbMultiplier();
113
114 //- Update grad(dx/db multiplier). Volume-based sensitivity term
115 virtual void update_gradDxDbMultiplier();
116
117 //- Contribution to field sensitivities
118 virtual void update_dJdb();
119
120 //- Add source terms to the adjoint turbulence model equations
121 virtual void addSource(fvScalarMatrix& matrix);
122};
123
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127} // End namespace objectives
128} // End namespace Foam
129
130// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132#endif
133
134// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
const dictionary & dict() const
Return objective dictionary.
Definition objective.C:91
virtual ~objectivePowerDissipation()=default
Destructor.
virtual void update_dJdb()
Contribution to field sensitivities.
virtual void update_gradDxDbMultiplier()
Update grad(dx/db multiplier). Volume-based sensitivity term.
objectivePowerDissipation(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Construct from components.
virtual void update_dJdTMvar2()
Update field to be added to the second adjoint turbulence model PDE.
virtual void addSource(fvScalarMatrix &matrix)
Add source terms to the adjoint turbulence model equations.
virtual scalar J()
Return the objective function value.
virtual void update_dJdTMvar1()
Update field to be added to the first adjoint turbulence model PDE.
TypeName("powerDissipation")
Runtime type information.
virtual void update_divDxDbMultiplier()
Update div(dx/db multiplier). Volume-based sensitivity term.
virtual void update_dJdv()
Update values to be added to the adjoint outlet velocity.
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
fvMatrix< scalar > fvScalarMatrix
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68