SIMPLEControl.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::SIMPLEControl
31
32Description
33 SIMPLE control class to supply convergence information/checks for
34 the SIMPLE loop.
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef SIMPLEControl_H
39#define SIMPLEControl_H
40
41#include "solverControl.H"
42#include "simpleControl.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class SIMPLEControl Declaration
51\*---------------------------------------------------------------------------*/
53class SIMPLEControl
54:
55 public solverControl,
56 public simpleControl
57{
58
59protected:
60
61 // Protected Data
62
63 //- Optimisation type
64 const word& managerType_;
65
66 //- Number of SIMPLE iterations
67 label nIters_;
68
69 //- Pressure reference cell
70 label pRefCell_;
71 //
72 //- Pressure reference value
73 scalar pRefValue_;
74
75
76private:
77
78 //- No copy construct
79 SIMPLEControl(const SIMPLEControl&) = delete;
80
81 //- No copy assignment
82 void operator=(const SIMPLEControl&) = delete;
83
84
85public:
86
87
88 // Static Data Members
89
90 //- Run-time type information
91 TypeName("SIMPLEControl");
92
93
94 // Declare run-time constructor selection table
97 (
98 autoPtr,
101 (
102 fvMesh& mesh,
103 const word& managerType,
104 const solver& solver
105 ),
106 (mesh, managerType, solver)
107 );
108
109
110 // Constructors
111
112 //- Construct from mesh
114 (
115 fvMesh& mesh,
116 const word& managerType,
117 const solver& solver
118 );
119
120
121 //- Destructor
122 virtual ~SIMPLEControl() = default;
123
124
125 // Selectors
126
127 //- Return a reference to the selected turbulence model
129 (
130 fvMesh& mesh,
131 const word& managerType,
132 const solver& solver
133 );
134
135
136 // Member Functions
137
138 virtual bool read();
139
140 virtual void readIters();
141
142 void checkMeanSolution() const;
143
144 // Access
145
146 //- Return the solution dictionary
147 inline virtual const dictionary dict() const;
148
149 //- Return pressure reference cell
150 inline label& pRefCell();
151
152 //- Return pressure reference value
153 inline scalar& pRefValue();
154
155 // Solution control
156
157 //- Whether to call time.write() or not
158 virtual bool write(const bool valid = true) const = 0;
159
160 // Evolution
161
162 //- Loop
163 virtual bool loop() = 0;
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171#include "SIMPLEControlI.H"
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
Definition: SIMPLEControl.H:56
label pRefCell_
Pressure reference cell.
Definition: SIMPLEControl.H:69
declareRunTimeSelectionTable(autoPtr, SIMPLEControl, dictionary,(fvMesh &mesh, const word &managerType, const solver &solver),(mesh, managerType, solver))
static autoPtr< SIMPLEControl > New(fvMesh &mesh, const word &managerType, const solver &solver)
Return a reference to the selected turbulence model.
Definition: SIMPLEControl.C:64
virtual void readIters()
label nIters_
Number of SIMPLE iterations.
Definition: SIMPLEControl.H:66
TypeName("SIMPLEControl")
Run-time type information.
label & pRefCell()
Return pressure reference cell.
scalar & pRefValue()
Return pressure reference value.
virtual bool write(const bool valid=true) const =0
Whether to call time.write() or not.
virtual const dictionary dict() const
Return the solution dictionary.
const word & managerType_
Optimisation type.
Definition: SIMPLEControl.H:63
scalar pRefValue_
Pressure reference value.
Definition: SIMPLEControl.H:72
void checkMeanSolution() const
virtual ~SIMPLEControl()=default
Destructor.
virtual bool loop()=0
Loop.
virtual bool read()
Read controls from fvSolution dictionary.
Definition: SIMPLEControl.C:86
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
Definition: simpleControl.H:55
Base class for solver control classes.
Definition: solverControl.H:52
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 declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73