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-2016 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  //- Maximum number of PIMPLE correctors
74 
75  //- Maximum number of PISO correctors
77 
78  //- Current PISO corrector
80 
81  //- Flag to indicate whether to only solve turbulence on final iter
83 
84  //- Converged flag
85  bool converged_;
86 
87 
88  // Protected Member Functions
89 
90  //- Read controls from fvSolution dictionary
91  virtual void read();
92 
93  //- Return true if all convergence checks are satisfied
94  virtual bool criteriaSatisfied();
95 
96 
97 public:
98 
99  // Static Data Members
100 
101  //- Run-time type information
102  TypeName("pimpleControl");
103 
104 
105  // Constructors
106 
107  //- Construct from mesh and the name of control sub-dictionary
108  pimpleControl(fvMesh& mesh, const word& dictName="PIMPLE");
109 
110 
111  //- Destructor
112  virtual ~pimpleControl();
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  //- Maximum number of PIMPLE correctors
120  inline label nCorrPIMPLE() const;
121 
122  //- Maximum number of PISO correctors
123  inline label nCorrPISO() const;
124 
125  //- Current PISO corrector index
126  inline label corrPISO() const;
127 
128 
129  // Solution control
130 
131  //- PIMPLE loop
132  virtual bool loop();
133 
134  //- Pressure corrector loop
135  inline bool correct();
136 
137  //- Helper function to identify when to store the intial residuals
138  inline bool storeInitialResiduals() const;
139 
140  //- Helper function to identify first PIMPLE (outer) iteration
141  inline bool firstIter() const;
142 
143  //- Helper function to identify final PIMPLE (outer) iteration
144  inline bool finalIter() const;
145 
146  //- Helper function to identify final inner iteration
147  inline bool finalInnerIter() const;
148 
149  //- Helper function to identify whether to solve for turbulence
150  inline bool turbCorr() const;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "pimpleControlI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
bool correct()
Pressure corrector loop.
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:75
bool storeInitialResiduals() const
Helper function to identify when to store the intial residuals.
Base class for solution control classes.
bool finalInnerIter() const
Helper function to identify final inner iteration.
label nCorrPISO() const
Maximum number of PISO correctors.
bool turbCorr() const
Helper function to identify whether to solve for turbulence.
label corrPISO_
Current PISO corrector.
Definition: pimpleControl.H:78
dynamicFvMesh & mesh
virtual void read()
Read controls from fvSolution dictionary.
Definition: pimpleControl.C:39
A class for handling words, derived from string.
Definition: word.H:59
virtual bool loop()
PIMPLE loop.
label corrPISO() const
Current PISO corrector index.
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
Definition: pimpleControl.H:72
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
Definition: pimpleControl.H:81
TypeName("pimpleControl")
Run-time type information.
bool firstIter() const
Helper function to identify first PIMPLE (outer) iteration.
word dictName("noiseDict")
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 nCorrPIMPLE() const
Maximum number of PIMPLE correctors.
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
Definition: pimpleControl.C:52
virtual ~pimpleControl()
Destructor.
Namespace for OpenFOAM.
bool converged_
Converged flag.
Definition: pimpleControl.H:84
bool finalIter() const
Helper function to identify final PIMPLE (outer) iteration.