All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pimpleControl.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::pimpleControl
26 
27 Description
28  Pimple control class. Provides time-loop control methods which exit the
29  simulation once convergence criteria have been reached. Also provides
30  Pimple-loop control methods which exit the iteration once corrector
31  convergence criteria have been met. Example usage:
32 
33  \verbatim
34  pimpleControl pimple(mesh);
35 
36  while (pimple.run(runTime))
37  {
38  // pre-time-increment operations ...
39 
40  runTime ++;
41  Info<< "Time = " << runTime.timeName() << nl << endl;
42 
43  while (pimple.loop())
44  {
45  // solve ...
46  }
47 
48  // post-solve operations ...
49  }
50  \endverbatim
51 
52 SourceFiles
53  pimpleControlI.H
54  pimpleControl.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef pimpleControl_H
59 #define pimpleControl_H
60 
61 #include "pimpleNoLoopControl.H"
62 #include "pimpleLoop.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class pimpleControl Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class pimpleControl
76 :
77  public pimpleNoLoopControl,
78  public pimpleLoop
79 {
80 public:
81 
82  // Static Data Members
83 
84  //- Run-time type information
85  TypeName("pimpleControl");
86 
87 
88  // Constructors
89 
90  //- Construct from a mesh and the name of the algorithm
91  pimpleControl(fvMesh& mesh, const word& algorithmName="PIMPLE");
92 
93 
94  //- Destructor
95  virtual ~pimpleControl();
96 
97 
98  // Member Functions
99 
100  // IO
101 
102  //- Read controls
103  virtual bool read();
104 
105  // Access
106 
107  //- Flag to indicate whether to solve the turbulence
108  inline bool turbCorr() const;
109 
110  // Evolution
111 
112  //- Pimple loop
113  bool loop();
114 
115  //- Time run loop
116  bool run(Time& time);
117 
118  //- Time loop loop
119  bool loop(Time& time);
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #include "pimpleControlI.H"
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
pimpleControl(fvMesh &mesh, const word &algorithmName="PIMPLE")
Construct from a mesh and the name of the algorithm.
Definition: pimpleControl.C:38
virtual bool read()
Read controls.
Definition: pimpleControl.C:75
bool run(Time &time)
Time run loop.
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:51
bool turbCorr() const
Flag to indicate whether to solve the turbulence.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
A class for handling words, derived from string.
Definition: word.H:59
bool loop()
Pimple loop.
Definition: pimpleControl.C:81
const fvMesh & mesh() const
Return the mesh.
const Time & time() const
Return the time.
TypeName("pimpleControl")
Run-time type information.
Pimple control class. Provides time-loop control methods which exit the simulation once convergence c...
Definition: pimpleControl.H:74
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
const word & algorithmName() const
Return the name of the algorithm.
virtual ~pimpleControl()
Destructor.
Definition: pimpleControl.C:69
Namespace for OpenFOAM.