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-2015 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class pimpleControl Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class pimpleControl
51 :
52  public solutionControl
53 {
54  // Private member functions
55 
56  //- Disallow default bitwise copy construct
58 
59  //- Disallow default bitwise assignment
60  void operator=(const pimpleControl&);
61 
62 
63 protected:
64 
65  // Protected data
66 
67  // Solution controls
68 
69  //- Maximum number of PIMPLE correctors
71 
72  //- Maximum number of PISO correctors
74 
75  //- Current PISO corrector
77 
78  //- Flag to indicate whether to only solve turbulence on final iter
80 
81  //- Converged flag
82  bool converged_;
83 
84 
85  // Protected Member Functions
86 
87  //- Read controls from fvSolution dictionary
88  virtual void read();
89 
90  //- Return true if all convergence checks are satisfied
91  virtual bool criteriaSatisfied();
92 
93 
94 public:
95 
96  // Static Data Members
97 
98  //- Run-time type information
99  TypeName("pimpleControl");
100 
101 
102  // Constructors
103 
104  //- Construct from mesh and the name of control sub-dictionary
105  pimpleControl(fvMesh& mesh, const word& dictName="PIMPLE");
106 
107 
108  //- Destructor
109  virtual ~pimpleControl();
110 
111 
112  // Member Functions
113 
114  // Access
115 
116  //- Maximum number of PIMPLE correctors
117  inline label nCorrPIMPLE() const;
118 
119  //- Maximum number of PISO correctors
120  inline label nCorrPISO() const;
121 
122  //- Current PISO corrector index
123  inline label corrPISO() const;
124 
125 
126  // Solution control
127 
128  //- PIMPLE loop
129  virtual bool loop();
130 
131  //- Pressure corrector loop
132  inline bool correct();
133 
134  //- Helper function to identify when to store the intial residuals
135  inline bool storeInitialResiduals() const;
136 
137  //- Helper function to identify first PIMPLE (outer) iteration
138  inline bool firstIter() const;
139 
140  //- Helper function to identify final PIMPLE (outer) iteration
141  inline bool finalIter() const;
142 
143  //- Helper function to identify final inner iteration
144  inline bool finalInnerIter() const;
145 
146  //- Helper function to identify whether to solve for turbulence
147  inline bool turbCorr() const;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "pimpleControlI.H"
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
Foam::pimpleControl::corrPISO
label corrPISO() const
Current PISO corrector index.
Definition: pimpleControlI.H:40
Foam::pimpleControl
PIMPLE control class to supply convergence information/checks for the PIMPLE loop.
Definition: pimpleControl.H:49
Foam::pimpleControl::storeInitialResiduals
bool storeInitialResiduals() const
Helper function to identify when to store the intial residuals.
Definition: pimpleControlI.H:67
Foam::pimpleControl::nCorrPIMPLE_
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
Definition: pimpleControl.H:69
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::pimpleControl::pimpleControl
pimpleControl(const pimpleControl &)
Disallow default bitwise copy construct.
Foam::solutionControl
Base class for solution control classes.
Definition: solutionControl.H:45
Foam::pimpleControl::turbOnFinalIterOnly_
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
Definition: pimpleControl.H:78
Foam::pimpleControl::converged_
bool converged_
Converged flag.
Definition: pimpleControl.H:81
Foam::pimpleControl::operator=
void operator=(const pimpleControl &)
Disallow default bitwise assignment.
Foam::pimpleControl::TypeName
TypeName("pimpleControl")
Run-time type information.
solutionControl.H
Foam::pimpleControl::criteriaSatisfied
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
Definition: pimpleControl.C:52
dictName
const word dictName("particleTrackDict")
Foam::label
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
Foam::pimpleControl::corrPISO_
label corrPISO_
Current PISO corrector.
Definition: pimpleControl.H:75
Foam::pimpleControl::~pimpleControl
virtual ~pimpleControl()
Destructor.
Definition: pimpleControl.C:167
Foam::pimpleControl::read
virtual void read()
Read controls from fvSolution dictionary.
Definition: pimpleControl.C:39
Foam::pimpleControl::finalIter
bool finalIter() const
Helper function to identify final PIMPLE (outer) iteration.
Definition: pimpleControlI.H:80
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::pimpleControl::loop
virtual bool loop()
PIMPLE loop.
Definition: pimpleControl.C:173
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pimpleControl::nCorrPISO
label nCorrPISO() const
Maximum number of PISO correctors.
Definition: pimpleControlI.H:34
Foam::pimpleControl::correct
bool correct()
Pressure corrector loop.
Definition: pimpleControlI.H:46
Foam::pimpleControl::firstIter
bool firstIter() const
Helper function to identify first PIMPLE (outer) iteration.
Definition: pimpleControlI.H:74
Foam::pimpleControl::finalInnerIter
bool finalInnerIter() const
Helper function to identify final inner iteration.
Definition: pimpleControlI.H:86
Foam::pimpleControl::turbCorr
bool turbCorr() const
Helper function to identify whether to solve for turbulence.
Definition: pimpleControlI.H:95
pimpleControlI.H
Foam::pimpleControl::nCorrPIMPLE
label nCorrPIMPLE() const
Maximum number of PIMPLE correctors.
Definition: pimpleControlI.H:28
Foam::pimpleControl::nCorrPISO_
label nCorrPISO_
Maximum number of PISO correctors.
Definition: pimpleControl.H:72