pisoControl.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-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::pisoControl
26 
27 Description
28  Piso control class. Provides time-loop and piso-loop control methods. No
29  convergence checking is done.
30 
31 SourceFiles
32  pisoControlI.H
33  pisoControl.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pisoControl_H
38 #define pisoControl_H
39 
40 #include "fluidSolutionControl.H"
41 
42 #define PISO_CONTROL
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pisoControl Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class pisoControl
54 :
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Maximum number of piso correctors
63 
64  //- Current piso corrector
66 
67 
68 public:
69 
70  // Static Data Members
71 
72  //- Run-time type information
73  TypeName("pisoControl");
74 
75 
76  // Constructors
77 
78  //- Construct from a mesh and the name of the algorithm
79  pisoControl(fvMesh& mesh, const word& algorithmName="PISO");
80 
81 
82  //- Destructor
83  virtual ~pisoControl();
84 
85 
86  // Member Functions
87 
88  // IO
89 
90  //- Read controls
91  virtual bool read();
92 
93 
94  // Access
95 
96  //- Maximum number of piso correctors
97  inline label nCorrPiso() const;
98 
99  //- Flag to indicate any piso iteration
100  inline bool anyPisoIter() const;
101 
102  //- Flag to indicate the first piso iteration
103  inline bool firstPisoIter() const;
104 
105  //- Flag to indicate the last piso iteration
106  inline bool finalPisoIter() const;
107 
108  //- Flag to indicate the last inner iteration (last piso and last
109  // non-orthogonal)
110  inline bool finalInnerIter() const;
111 
112  //- Flag to indicate whether in final state
113  bool isFinal(const bool finalIter) const;
114 
115 
116  // Evolution
117 
118  //- Piso loop within outer loop
119  bool correct(const bool finalIter = false);
120 
121  //- Non-orthogonal corrector loop
122  bool correctNonOrthogonal(const bool finalIter = true);
123 
124  //- Time run loop
125  bool run(Time& time);
126 
127  //- Time loop loop
128  bool loop(Time& time);
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #include "pisoControlI.H"
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Fluid solution control class. Holds flags specific to the solution of fluids.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Piso control class. Provides time-loop and piso-loop control methods. No convergence checking is done...
Definition: pisoControl.H:55
virtual ~pisoControl()
Destructor.
Definition: pisoControl.C:50
pisoControl(fvMesh &mesh, const word &algorithmName="PISO")
Construct from a mesh and the name of the algorithm.
Definition: pisoControl.C:38
label nCorrPiso_
Maximum number of piso correctors.
Definition: pisoControl.H:61
bool firstPisoIter() const
Flag to indicate the first piso iteration.
Definition: pisoControlI.H:40
bool isFinal(const bool finalIter) const
Flag to indicate whether in final state.
Definition: pisoControl.C:71
bool anyPisoIter() const
Flag to indicate any piso iteration.
Definition: pisoControlI.H:34
label corrPiso_
Current piso corrector.
Definition: pisoControl.H:64
bool run(Time &time)
Time run loop.
Definition: pisoControl.C:107
bool finalInnerIter() const
Flag to indicate the last inner iteration (last piso and last.
Definition: pisoControlI.H:52
bool correct(const bool finalIter=false)
Piso loop within outer loop.
Definition: pisoControl.C:77
bool finalPisoIter() const
Flag to indicate the last piso iteration.
Definition: pisoControlI.H:46
label nCorrPiso() const
Maximum number of piso correctors.
Definition: pisoControlI.H:28
TypeName("pisoControl")
Run-time type information.
bool correctNonOrthogonal(const bool finalIter=true)
Non-orthogonal corrector loop.
Definition: pisoControl.C:98
bool loop(Time &time)
Time loop loop.
Definition: pisoControl.C:113
virtual bool read()
Read controls.
Definition: pisoControl.C:56
const fvMesh & mesh() const
Return the mesh.
const Time & time() const
Return the time.
const word & algorithmName() const
Return the name of the algorithm.
A class for handling words, derived from string.
Definition: word.H:62
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