pimpleControl.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 | Copyright (C) 2011-2017 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::pimpleControl
26 
27 Description
28  PIMPLE control class to supply convergence information/checks for
29  the PIMPLE loop.
30 
31  May also be used to for PISO-based algorithms as PISO controls are a
32  sub-set of PIMPLE controls.
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pimpleControl_H
37 #define pimpleControl_H
38 
39 #include "solutionControl.H"
40 
41 //- Declare that pimpleControl will be used
42 #define PIMPLE_CONTROL
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pimpleControl Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class pimpleControl
54 :
55  public solutionControl
56 {
57  // Private member functions
58 
59  //- Disallow default bitwise copy construct
61 
62  //- Disallow default bitwise assignment
63  void operator=(const pimpleControl&);
64 
65 
66 protected:
67 
68  // Protected data
69 
70  // Solution controls
71 
72  //- Flag to indicate whether to solve for the flow
73  bool solveFlow_;
74 
75  //- Maximum number of PIMPLE correctors
77 
78  //- Maximum number of PISO correctors
80 
81  //- Current PISO corrector
83 
84  //- Flag to indicate whether to update density in SIMPLE
85  // rather than PISO mode
86  bool SIMPLErho_;
87 
88  //- Flag to indicate whether to only solve turbulence on final iter
90 
91  //- Converged flag
92  bool converged_;
93 
94 
95  // Protected Member Functions
96 
97  //- Read controls from fvSolution dictionary
98  virtual void read();
99 
100  //- Return true if all convergence checks are satisfied
101  virtual bool criteriaSatisfied();
102 
103 
104 public:
105 
106  // Static Data Members
107 
108  //- Run-time type information
109  TypeName("pimpleControl");
110 
111 
112  // Constructors
113 
114  //- Construct from mesh and the name of control sub-dictionary
115  pimpleControl(fvMesh& mesh, const word& dictName="PIMPLE");
116 
117 
118  //- Destructor
119  virtual ~pimpleControl();
120 
121 
122  // Member Functions
123 
124  // Access
125 
126  //- Maximum number of PIMPLE correctors
127  inline label nCorrPIMPLE() const;
128 
129  //- Maximum number of PISO correctors
130  inline label nCorrPISO() const;
131 
132  //- Current PISO corrector index
133  inline label corrPISO() const;
134 
135  //- Flag to indicate whether to update density in SIMPLE
136  // rather than PISO mode
137  inline bool SIMPLErho() const;
138 
139 
140  // Solution control
141 
142  //- PIMPLE loop
143  virtual bool loop();
144 
145  //- Pressure corrector loop control
146  inline bool correct();
147 
148  //- Return true to store the intial residuals
149  inline bool storeInitialResiduals() const;
150 
151  //- Return true for first PIMPLE (outer) iteration
152  inline bool firstIter() const;
153 
154  //- Return true fore final PIMPLE (outer) iteration
155  inline bool finalIter() const;
156 
157  //- Return true for final inner iteration
158  inline bool finalInnerIter() const;
159 
160  //- Return true to solve for flow
161  inline bool solveFlow() const;
162 
163  //- Return true to solve for turbulence
164  inline bool turbCorr() const;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #include "pimpleControlI.H"
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
bool correct()
Pressure corrector loop control.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
label nCorrPISO_
Maximum number of PISO correctors.
Definition: pimpleControl.H:78
label nCorrPISO() const
Maximum number of PISO correctors.
Base class for solution control classes.
bool solveFlow_
Flag to indicate whether to solve for the flow.
Definition: pimpleControl.H:72
bool finalInnerIter() const
Return true for final inner iteration.
bool turbCorr() const
Return true to solve for turbulence.
bool SIMPLErho() const
Flag to indicate whether to update density in SIMPLE.
bool solveFlow() const
Return true to solve for flow.
label corrPISO_
Current PISO corrector.
Definition: pimpleControl.H:81
dynamicFvMesh & mesh
virtual void read()
Read controls from fvSolution dictionary.
Definition: pimpleControl.C:39
bool storeInitialResiduals() const
Return true to store the intial residuals.
A class for handling words, derived from string.
Definition: word.H:59
bool SIMPLErho_
Flag to indicate whether to update density in SIMPLE.
Definition: pimpleControl.H:85
virtual bool loop()
PIMPLE loop.
const word dictName("particleTrackDict")
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
Definition: pimpleControl.H:75
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
Definition: pimpleControl.H:88
TypeName("pimpleControl")
Run-time type information.
label nCorrPIMPLE() const
Maximum number of PIMPLE correctors.
bool firstIter() const
Return true for first PIMPLE (outer) iteration.
PIMPLE control class to supply convergence information/checks for the PIMPLE loop.
Definition: pimpleControl.H:52
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
label corrPISO() const
Current PISO corrector index.
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
Definition: pimpleControl.C:54
virtual ~pimpleControl()
Destructor.
bool finalIter() const
Return true fore final PIMPLE (outer) iteration.
Namespace for OpenFOAM.
bool converged_
Converged flag.
Definition: pimpleControl.H:91