SIMPLEControlOpt.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-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
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
29Class
30 Foam::SIMPLEControlOpt
31
32Description
33 SIMPLE control class for optimisation runs. Each time is sub-cycled and
34 corresponds to one optimisation cycle
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef SIMPLEControlOpt_H
39#define SIMPLEControlOpt_H
40
41#include "SIMPLEControl.H"
42#include "subCycleTime.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class SIMPLEControlOpt Declaration
51\*---------------------------------------------------------------------------*/
54:
55 public SIMPLEControl
56{
57protected:
58
59 // Protected Data
60
61 //- Number of iterations for the first optimisation cycle
62 label nInitialIters_;
63
64 //- Subcycled time
66
67 //- deltaT of the sub-cycled time
68 scalar deltaTSubSycle_;
69
70
71 // Protected Member Functions
72
73 //- Read controls from optimisationDict
74 virtual bool read();
75
76 //- Return true if all convergence checks are satisfied
77 virtual bool criteriaSatisfied();
78
79 //- Maximum number of solver iterations
80 const label& nIters() const;
81
82 //- Reset deltaT in case controlDict has been re-written at run-time
83 void resetDeltaT();
84
85
86private:
87
88 //- No copy construct
89 SIMPLEControlOpt(const SIMPLEControlOpt&) = delete;
90
91 //- No copy assignment
92 void operator=(const SIMPLEControlOpt&) = delete;
93
94
95public:
96
97
98 // Static Data Members
99
100 //- Run-time type information
101 TypeName("steadyOptimisation");
102
103
104 // Constructors
105
106 //- Construct from mesh
108 (
109 fvMesh& mesh,
110 const word& managerType,
111 const solver& solver
112 );
113
114
115 //- Destructor
116 virtual ~SIMPLEControlOpt() = default;
117
118
119 // Member Functions
120
121 // Solution control
122
123 //- Whether to call time.write() or not
124 virtual bool write(const bool valid = true) const;
125
126 // Evolution
127
128 //- Loop
129 virtual bool loop();
130};
131
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135} // End namespace Foam
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
SIMPLE control class for optimisation runs. Each time is sub-cycled and corresponds to one optimisati...
autoPtr< subCycleTime > subCycledTimePtr_
Subcycled time.
label nInitialIters_
Number of iterations for the first optimisation cycle.
scalar deltaTSubSycle_
deltaT of the sub-cycled time
const label & nIters() const
Maximum number of solver iterations.
TypeName("steadyOptimisation")
Run-time type information.
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
void resetDeltaT()
Reset deltaT in case controlDict has been re-written at run-time.
virtual ~SIMPLEControlOpt()=default
Destructor.
virtual bool loop()
Loop.
virtual bool read()
Read controls from optimisationDict.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
Definition: SIMPLEControl.H:56
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for solution control classes.
Definition: solver.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73