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-2024 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 correctors
62  label nCorr_;
63 
64  //- Current corrector
65  label corr_;
66 
67  //- Flag to indicate convergence of the pimple loop
68  bool converged_;
69 
70 
71 public:
72 
73  // Static Data Members
74 
75  //- Run-time type information
76  TypeName("pimpleLoop");
77 
78 
79  // Constructors
80 
81  //- Construct from a solution control
82  pimpleLoop(const solutionControl& control);
83 
84 
85  //- Destructor
86  virtual ~pimpleLoop();
87 
88 
89  // Member Functions
90 
91  // Access
92 
93  //- Maximum number of correctors
94  inline label nCorr() const;
95 
96  //- Flag to indicate the first iteration
97  inline bool firstIter() const;
98 
99  //- Flag to indicate the last iteration
100  inline bool finalIter() const;
101 
102 
103  // Evolution
104 
105  //- Pimple loop
106  bool loop(correctorConvergenceControl& convergence);
107 
108 
109  //- Read controls
110  virtual bool read();
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #include "pimpleLoopI.H"
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:52
bool finalIter() const
Flag to indicate the last iteration.
Definition: pimpleLoopI.H:40
bool loop(correctorConvergenceControl &convergence)
Pimple loop.
Definition: pimpleLoop.C:67
pimpleLoop(const solutionControl &control)
Construct from a solution control.
Definition: pimpleLoop.C:48
label corr_
Current corrector.
Definition: pimpleLoop.H:64
const solutionControl & control_
Reference to the solution control.
Definition: pimpleLoop.H:58
TypeName("pimpleLoop")
Run-time type information.
bool firstIter() const
Flag to indicate the first iteration.
Definition: pimpleLoopI.H:34
label nCorr_
Maximum number of correctors.
Definition: pimpleLoop.H:61
label nCorr() const
Maximum number of correctors.
Definition: pimpleLoopI.H:28
virtual ~pimpleLoop()
Destructor.
Definition: pimpleLoop.C:61
virtual bool read()
Read controls.
Definition: pimpleLoop.C:38
bool converged_
Flag to indicate convergence of the pimple loop.
Definition: pimpleLoop.H:67
Solution control class.
Namespace for OpenFOAM.
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