Loading...
Searching...
No Matches
objectiveFlowRatePartition.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-2022 PCOpt/NTUA
9 Copyright (C) 2013-2022 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::objectiveFlowRatePartition
30
31Description
32 Split inlet flow rate to given percentages at the prescribed outlet patches.
33
34SourceFiles
35 objectiveFlowRatePartition.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef objectiveFlowRatePartition_H
40#define objectiveFlowRatePartition_H
41
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49namespace objectives
50{
52/*---------------------------------------------------------------------------*\
53 Class objectiveFlowRatePartition Declaration
54\*---------------------------------------------------------------------------*/
55
57:
58 public objectiveIncompressible
59{
60 // Private data
61
62 labelList inletPatches_;
63 labelList outletPatches_;
64 scalarList targetFlowRateFraction_;
65 scalarList currentFlowRateFraction_;
66 scalar inletFlowRate_;
67 scalarList flowRateDifference_;
68
69
70public:
71
72 //- Runtime type information
73 TypeName("flowRatePartition");
74
75
76 // Constructors
77
78 //- from components
80 (
81 const fvMesh& mesh,
82 const dictionary& dict,
83 const word& adjointSolverName,
84 const word& primalSolverName
85 );
86
87
88 //- Destructor
89 virtual ~objectiveFlowRatePartition() = default;
91
92 // Member Functions
93
94 //- Return the objective function value
95 virtual scalar J();
96
97 //- Update values to be added to the adjoint outlet velocity
98 virtual void update_boundarydJdv();
99
100 //- Update values to be added to the adjoint outlet pressure
101 virtual void update_boundarydJdvn();
102
103 // Helper write functions
104
105 //- Write any information that needs to go the header of the file
106 // (e.g. targets, directions, etc)
107 virtual void addHeaderInfo() const;
108
109 //- Write headers for additional columns
110 virtual void addHeaderColumns() const;
111
112 //- Write information to additional columns
113 virtual void addColumnValues() const;
114};
115
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119} // End namespace objectives
120} // End namespace Foam
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124#endif
125
126// ************************************************************************* //
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
objectiveFlowRatePartition(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
TypeName("flowRatePartition")
Runtime type information.
virtual void addHeaderColumns() const
Write headers for additional columns.
virtual void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
virtual scalar J()
Return the objective function value.
virtual void addHeaderInfo() const
Write any information that needs to go the header of the file.
virtual void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
virtual ~objectiveFlowRatePartition()=default
Destructor.
virtual void addColumnValues() const
Write information to additional columns.
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
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68