pimpleLoop.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2020 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::pimpleLoop
26 
27 Description
28  Pimple loop class. Implements the logic which controls the pimple loop
29  generically for a given corrector convergence control. Can therefore be
30  used be either single- or multi-region control classes.
31 
32 SourceFiles
33  pimpleLoopI.H
34  pimpleLoop.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pimpleLoop_H
39 #define pimpleLoop_H
40 
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class pimpleLoop Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class pimpleLoop
53 {
54 protected:
55 
56  // Protected data
57 
58  //- Reference to the solution control
60 
61  //- Maximum number of pimple correctors
63 
64  //- Current pimple corrector
66 
67  //- Flag to indicate convergence of the pimple loop
68  bool converged_;
69 
70 
71  // Protected Member Functions
72 
73  //- Read controls
74  virtual bool read();
75 
76 
77 public:
78 
79  // Static Data Members
80 
81  //- Run-time type information
82  TypeName("pimpleLoop");
83 
84 
85  // Constructors
86 
87  //- Construct from a solution control
88  pimpleLoop(const solutionControl& control);
89 
90 
91  //- Destructor
92  virtual ~pimpleLoop();
93 
94 
95  // Member Functions
96 
97  // Access
98 
99  //- Maximum number of pimple correctors
100  inline label nCorrPimple() const;
101 
102  //- Flag to indicate any pimple iteration
103  inline bool anyPimpleIter() const;
104 
105  //- Flag to indicate the first pimple iteration
106  inline bool firstPimpleIter() const;
107 
108  //- Flag to indicate the last pimple iteration
109  inline bool finalPimpleIter() const;
110 
111 
112  // Evolution
113 
114  //- Pimple loop
115  bool loop(correctorConvergenceControl& convergence);
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #include "pimpleLoopI.H"
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
label nCorrPimple() const
Maximum number of pimple correctors.
Definition: pimpleLoopI.H:28
bool loop(correctorConvergenceControl &convergence)
Pimple loop.
Definition: pimpleLoop.C:66
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
const solutionControl & control_
Reference to the solution control.
Definition: pimpleLoop.H:58
Solution control class.
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:51
bool anyPimpleIter() const
Flag to indicate any pimple iteration.
Definition: pimpleLoopI.H:34
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
label corrPimple_
Current pimple corrector.
Definition: pimpleLoop.H:64
virtual ~pimpleLoop()
Destructor.
Definition: pimpleLoop.C:60
bool finalPimpleIter() const
Flag to indicate the last pimple iteration.
Definition: pimpleLoopI.H:46
virtual bool read()
Read controls.
Definition: pimpleLoop.C:38
bool firstPimpleIter() const
Flag to indicate the first pimple iteration.
Definition: pimpleLoopI.H:40
pimpleLoop(const solutionControl &control)
Construct from a solution control.
Definition: pimpleLoop.C:49
label nCorrPimple_
Maximum number of pimple correctors.
Definition: pimpleLoop.H:61
TypeName("pimpleLoop")
Run-time type information.
Namespace for OpenFOAM.
bool converged_
Flag to indicate convergence of the pimple loop.
Definition: pimpleLoop.H:67