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-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::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  // Protected Member Functions
95 
96  //- Read controls
97  virtual bool read();
98 
99 
100 public:
101 
102  // Static Data Members
103 
104  //- Run-time type information
105  TypeName("pimpleNoLoopControl");
106 
107 
108  // Constructors
109 
110  //- Construct from a mesh, the name of the algorithm, and a reference
111  // to the pimple loop
112  pimpleNoLoopControl(fvMesh& mesh, const word& algorithmName="PIMPLE");
113 
114 
115  //- Destructor
116  virtual ~pimpleNoLoopControl();
117 
118 
119  // Member Functions
120 
121  // Access
122 
123  //- Switch to move the mesh at the start of every PIMPLE
124  // outer corrected rather than the first corrector only
125  // which is the default
126  inline bool moveMeshOuterCorrectors() const;
127 
128  //- Switch to indicate whether to update the density in simple mode
129  inline bool simpleRho() const;
130 
131  //- Flag to indicate whether to predict the transport models
132  inline bool predictTransport() const;
133 
134  //- Flag to indicate whether to correct the transport models
135  inline bool correctTransport() const;
136 
137  //- Flag to indicate the first iteration
138  inline bool firstIter() const;
139 
140  //- Flag to indicate the final iteration
141  inline bool finalIter() const;
142 
143 
144  // Evolution
145 
146  //- Piso loop within outer loop
147  bool correct();
148 
149  //- Non-orthogonal corrector loop
150  bool correctNonOrthogonal();
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "pimpleNoLoopControlI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
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.