Loading...
Searching...
No Matches
objectiveUniformityCellZone.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::objectiveUniformityCellZone
30
31Description
32 Computes and minimizes (half) the variance of the velocity distribution in
33 a given set of cellZones
34
35SourceFiles
36 objectiveUniformityCellZone.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef objectiveUniformityCellZone_H
41#define objectiveUniformityCellZone_H
42
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50namespace objectives
51{
53/*---------------------------------------------------------------------------*\
54 Class objectiveUniformityCellZone Declaration
55\*---------------------------------------------------------------------------*/
56
58:
59 public objectiveIncompressible
60{
61 // Private data
62
63 //- Where to define the objective
64 labelList zones_;
65
66 //- Mean velocity value per objective zone
67 vectorField UMean_;
68
69 //- Velocity variance per objective zone
70 scalarField UVar_;
71
72 //- Volume integral per objective zone
73 scalarField volZone_;
74
75
76public:
77
78 //- Runtime type information
79 TypeName("uniformityCellZone");
80
81
82 // Constructors
83
84 //- from components
86 (
87 const fvMesh& mesh,
88 const dictionary& dict,
89 const word& adjointSolverName,
90 const word& primalSolverName
91 );
92
93
94 //- Destructor
95 virtual ~objectiveUniformityCellZone() = default;
96
97
98 // Member Functions
99
100 //- Return the objective function value
101 virtual scalar J();
102
103 //- Update values to be added to the adjoint outlet velocity
104 virtual void update_dJdv();
105
106 //- Update div( dx/db multiplier). Volume-based sensitivity term
107 virtual void update_divDxDbMultiplier();
108
109 // Helper write functions
110
111 //- Write headers for additional columns
112 virtual void addHeaderColumns() const;
113
114 //- Write information to additional columns
115 virtual void addColumnValues() const;
116};
117
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121} // End namespace objectives
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
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 void addHeaderColumns() const
Write headers for additional columns.
TypeName("uniformityCellZone")
Runtime type information.
virtual scalar J()
Return the objective function value.
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.
objectiveUniformityCellZone(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
virtual void addColumnValues() const
Write information to additional columns.
virtual ~objectiveUniformityCellZone()=default
Destructor.
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
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68