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-2023 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 
80 public:
81 
82  // Static Data Members
83 
84  //- Run-time type information
85  TypeName("pimpleSingleRegionControl");
86 
87 
88  // Constructors
89 
90  //- Construct from single region pimple
92 
93  //- Disallow default bitwise copy construction
95 
96 
97  //- Destructor
99 
100 
101  // Member Functions
102 
103  //- Read controls
104  virtual bool read();
105 
106 
107  // Evolution
108 
109  //- Pimple loop
110  bool loop();
111 
112  //- Time run loop
113  bool run(Time& time);
114 
115  //- Time loop loop
116  bool loop(Time& time);
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
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.