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-2026 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  // private autoPtr<printDictionary>,
62  public pisoControl,
65 {
67  friend class pimpleMultiRegionControl;
68 
69  // Private data
70 
71  pimpleLoop* pimpleLoopPtr_;
72 
73 
74 protected:
75 
76  // Protected data
77 
78  //- Switch to move the mesh at the start of every PIMPLE outer corrector
79  // rather than the first corrector only which is the default
81 
82  //- Switch to indicate whether to update the density in SIMPLE mode
83  // rather than PISO mode
84  bool simpleRho_;
85 
86  //- Switch to control whether transport models are predicted
87  // just on the first pimple iteration, or on every pimple iteration
89 
90  //- Switch to control whether transport models are corrected
91  // just on the final pimple iteration, or on every pimple iteration
93 
94 
95  // Protected Member Functions
96 
97  //- Read controls
98  virtual bool read();
99 
100 
101 public:
102 
103  // Static Data Members
104 
105  //- Run-time type information
106  TypeName("pimpleNoLoopControl");
107 
108 
109  // Constructors
110 
111  //- Construct from a mesh, the name of the algorithm, and a reference
112  // to the pimple loop
114  (
115  const fvMesh& mesh,
116  const word& algorithmName="PIMPLE"
117  );
118 
119 
120  //- Destructor
121  virtual ~pimpleNoLoopControl();
122 
123 
124  // Member Functions
125 
126  // Access
127 
129 
130  //- Return the solution dictionary
131  static const dictionary& dict
132  (
133  const fvMesh& mesh,
134  const word& algorithmName="PIMPLE"
135  );
136 
137  //- Switch to move the mesh at the start of every PIMPLE
138  // outer corrected rather than the first corrector only
139  // which is the default
140  inline bool moveMeshOuterCorrectors() const;
141 
142  //- Switch to indicate whether to update the density in simple mode
143  inline bool simpleRho() const;
144 
145  //- Flag to indicate whether to predict the transport models
146  inline bool predictTransport() const;
147 
148  //- Flag to indicate whether to correct the transport models
149  inline bool correctTransport() const;
150 
151  //- Maximum number of correctors
152  inline label nCorr() const;
153 
154  //- Flag to indicate the first iteration
155  inline bool firstIter() const;
156 
157  //- Flag to indicate the final iteration
158  inline bool finalIter() const;
159 
160 
161  // Evolution
162 
163  //- Piso loop within outer loop
164  bool correct();
165 
166  //- Non-orthogonal corrector loop
167  bool correctNonOrthogonal();
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #include "pimpleNoLoopControlI.H"
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
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.
pimpleNoLoopControl(const fvMesh &mesh, const word &algorithmName="PIMPLE")
Construct from a mesh, the name of the algorithm, and a reference.
bool correct()
Piso loop within outer loop.
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.
static const dictionary & dict(const fvMesh &mesh, const word &algorithmName)
Return the solution dictionary.
label nCorr() const
Maximum number of correctors.
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.
virtual const dictionary & dict() const
Return the solution dictionary.
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:63
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