pimpleNoLoopControl.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::pimpleNoLoopControl
26 
27 Description
28  Pimple no-loop control class. Implements various option flags, but leaves
29  loop controls to the derivation or owner. Can be derived into a "full"
30  pimple control or can be owned by a multi-region pimple class.
31 
32 SourceFiles
33  pimpleNoLoopControlI.H
34  pimpleNoLoopControl.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pimpleNoLoopControl_H
39 #define pimpleNoLoopControl_H
40 
41 #include "pisoControl.H"
44 
45 #undef PISO_CONTROL
46 #define PIMPLE_CONTROL
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 class pimpleLoop;
54 
55 /*---------------------------------------------------------------------------*\
56  Class pimpleNoLoopControl Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
61  public pisoControl,
64 {
66  friend class pimpleMultiRegionControl;
67 
68  // Private data
69 
70  pimpleLoop* pimpleLoopPtr_;
71 
72 
73 protected:
74 
75  // Protected data
76 
77  //- Switch to move the mesh at the start of every PIMPLE outer corrector
78  // rather than the first corrector only which is the default
80 
81  //- Switch to indicate whether to update the density in SIMPLE mode
82  // rather than PISO mode
83  bool simpleRho_;
84 
85  //- Switch to control whether transport models are predicted
86  // just on the first pimple iteration, or on every pimple iteration
88 
89  //- Switch to control whether transport models are corrected
90  // just on the final pimple iteration, or on every pimple iteration
92 
93 
94 public:
95 
96  // Static Data Members
97 
98  //- Run-time type information
99  TypeName("pimpleNoLoopControl");
100 
101 
102  // Constructors
103 
104  //- Construct from a mesh, the name of the algorithm, and a reference
105  // to the pimple loop
106  pimpleNoLoopControl(fvMesh& mesh, const word& algorithmName="PIMPLE");
107 
108 
109  //- Destructor
110  virtual ~pimpleNoLoopControl();
111 
112 
113  // Member Functions
114 
115  // IO
116 
117  //- Read controls
118  virtual bool read();
119 
120  // Access
121 
122  //- Switch to move the mesh at the start of every PIMPLE
123  // outer corrected rather than the first corrector only
124  // which is the default
125  inline bool moveMeshOuterCorrectors() const;
126 
127  //- Switch to indicate whether to update the density in simple mode
128  inline bool simpleRho() const;
129 
130  //- Flag to indicate whether to predict the transport models
131  inline bool predictTransport() const;
132 
133  //- Flag to indicate whether to correct the transport models
134  inline bool correctTransport() const;
135 
136  //- Flag to indicate the first iteration
137  inline bool firstIter() const;
138 
139  //- Flag to indicate the final iteration
140  inline bool finalIter() const;
141 
142 
143  // Evolution
144 
145  //- Piso loop within outer loop
146  bool correct();
147 
148  //- Non-orthogonal corrector loop
149  bool correctNonOrthogonal();
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #include "pimpleNoLoopControlI.H"
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:52
Pimple multi-region control class. As Foam::pimpleControl, but for a multi- region simulation compris...
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
bool simpleRho() const
Switch to indicate whether to update the density in simple mode.
bool correctTransport() const
Flag to indicate whether to correct the transport models.
bool simpleRho_
Switch to indicate whether to update the density in SIMPLE mode.
bool finalIter() const
Flag to indicate the final iteration.
virtual ~pimpleNoLoopControl()
Destructor.
bool transportCorrectionFinal_
Switch to control whether transport models are corrected.
bool transportPredictionFirst_
Switch to control whether transport models are predicted.
bool correct()
Piso loop within outer loop.
pimpleNoLoopControl(fvMesh &mesh, const word &algorithmName="PIMPLE")
Construct from a mesh, the name of the algorithm, and a reference.
bool correctNonOrthogonal()
Non-orthogonal corrector loop.
bool moveMeshOuterCorrectors() const
Switch to move the mesh at the start of every PIMPLE.
bool moveMeshOuterCorrectors_
Switch to move the mesh at the start of every PIMPLE outer corrector.
bool firstIter() const
Flag to indicate the first iteration.
TypeName("pimpleNoLoopControl")
Run-time type information.
virtual bool read()
Read controls.
bool predictTransport() const
Flag to indicate whether to predict the transport models.
Pimple single region control class. Provides time-loop control methods which exit the simulation once...
Piso control class. Provides time-loop and piso-loop control methods. No convergence checking is done...
Definition: pisoControl.H:55
Single-region-specific derivation of the convergence control class.
Single-region-specific derivation of the corrector convergence control class.
const fvMesh & mesh() const
Return the mesh.
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.