pimpleSingleRegionControl.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) 2022 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::pimpleSingleRegionControl
26 
27 Description
28  Pimple single region control class. Provides time-loop control methods
29  which exit the simulation once convergence criteria have been reached. Also
30  provides Pimple-loop control methods which exit the iteration once corrector
31  convergence criteria have been met. Example usage:
32 
33  \verbatim
34  pimpleSingleRegionControl pimple(mesh);
35 
36  while (pimple.run(runTime))
37  {
38  // pre-time-increment operations ...
39 
40  runTime ++;
41  Info<< "Time = " << runTime.userTimeName() << nl << endl;
42 
43  while (pimple.loop())
44  {
45  // solve ...
46  }
47 
48  // post-solve operations ...
49  }
50  \endverbatim
51 
52 SourceFiles
53  pimpleSingleRegionControlI.H
54  pimpleSingleRegionControl.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef pimpleSingleRegionControl_H
59 #define pimpleSingleRegionControl_H
60 
61 #include "pimpleLoop.H"
62 #include "pimpleNoLoopControl.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class pimpleSingleRegionControl Declaration
71 \*---------------------------------------------------------------------------*/
72 
74 :
75  public pimpleLoop
76 {
77  pimpleNoLoopControl& pimple_;
78 
79 public:
80 
81  // Static Data Members
82 
83  //- Run-time type information
84  TypeName("pimpleSingleRegionControl");
85 
86 
87  // Constructors
88 
89  //- Construct from single region pimple
91 
92  //- Disallow default bitwise copy construction
94 
95 
96  //- Destructor
98 
99 
100  // Member Functions
101 
102  // IO
103 
104  //- Read controls
105  virtual bool read();
106 
107 
108  // Evolution
109 
110  //- Pimple loop
111  bool loop();
112 
113  //- Time run loop
114  bool run(Time& time);
115 
116  //- Time loop loop
117  bool loop(Time& time);
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:52
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
Pimple single region control class. Provides time-loop control methods which exit the simulation once...
bool run(Time &time)
Time run loop.
TypeName("pimpleSingleRegionControl")
Run-time type information.
pimpleSingleRegionControl(pimpleNoLoopControl &pimple)
Construct from single region pimple.
virtual bool read()
Read controls.
pimpleControl pimple(mesh)
Namespace for OpenFOAM.