pimpleMultiRegionControl.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 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::pimpleMultiRegionControl
26 
27 Description
28  Pimple multi-region control class. As Foam::pimpleControl, but for a multi-
29  region simulation comprising pimple and solid regions. More region types
30  could be added.
31 
32 SourceFiles
33  pimpleMultiRegionControlI.H
34  pimpleMultiRegionControl.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pimpleMultiRegionControl_H
39 #define pimpleMultiRegionControl_H
40 
42 #include "pimpleLoop.H"
43 #include "convergenceControl.H"
45 #include "pimpleNoLoopControl.H"
46 #include "solidNoLoopControl.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class pimpleMultiRegionControl Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
60  public pimpleLoop,
61  public convergenceControl,
63 {
64 protected:
65 
66  // Protected data
67 
68  //- The per-region pimple controls
70 
71  //- The per-region solid controls
73 
74 
75  // Protected Static Functions
76 
77  //- Get the time from the region meshes
78  static const Time& time
79  (
80  const PtrList<fvMesh>& pimpleMeshes,
81  const PtrList<fvMesh>& solidMeshes
82  );
83 
84 
85 public:
86 
87  // Static data members
88 
89  //- Run-time type information
90  TypeName("pimpleMultiRegionControl");
91 
92 
93  // Constructors
94 
95  //- Construct from meshes and the algorithm name
97  (
98  PtrList<fvMesh>& pimpleMeshes,
99  PtrList<fvMesh>& solidMeshes,
100  const word& algorithmName="PIMPLE"
101  );
102 
103 
104  //- Destructor
105  virtual ~pimpleMultiRegionControl();
106 
107 
108  // Member Functions
109 
110  // IO
111 
112  //- Read controls
113  virtual bool read();
114 
115  // Access
116 
117  //- Access the i-th pimple control
118  inline pimpleNoLoopControl& pimple(const label i);
119 
120  //- Access the i-th solid control
121  inline solidNoLoopControl& solid(const label i);
122 
123  //- Flag to indicate whether to solve the turbulence
124  inline bool pimpleTurbCorr(const label i) const;
125 
126  // Evolution
127 
128  //- Return true if residual controls are present
129  virtual bool hasResidualControls() const;
130 
131  //- Return true if corrector residual controls are present
132  virtual bool hasCorrResidualControls() const;
133 
134  //- Return true if all convergence checks are satisfied
135  virtual bool criteriaSatisfied() const;
136 
137  //- Return true if all correction convergence checks are satisfied
138  virtual bool corrCriteriaSatisfied() const;
139 
140  //- Reset the solve index in the correction residual control data
141  virtual void resetCorrSolveIndex();
142 
143  //- Update the solve index in the correction residual control data
144  virtual void updateCorrSolveIndex();
145 
146  //- Pimple loop
147  bool loop();
148 
149  //- Time run loop
150  bool run(Time& time);
151 
152  //- Time loop loop
153  bool loop(Time& time);
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Multi-region-specific derivation of the solution control class.
Solid no-loop control class. Implements non-orthogonal and convergence controls, but leaves loop cont...
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
virtual ~pimpleMultiRegionControl()
Destructor.
virtual void updateCorrSolveIndex()
Update the solve index in the correction residual control data.
TypeName("pimpleMultiRegionControl")
Run-time type information.
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Definition: pimpleLoop.H:51
PtrList< solidNoLoopControl > solidControls_
The per-region solid controls.
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool read()
Read controls.
Pimple multi-region control class. As Foam::pimpleControl, but for a multi- region simulation compris...
bool pimpleTurbCorr(const label i) const
Flag to indicate whether to solve the turbulence.
PtrList< pimpleNoLoopControl > pimpleControls_
The per-region pimple controls.
solidNoLoopControl & solid(const label i)
Access the i-th solid control.
A class for handling words, derived from string.
Definition: word.H:59
pimpleNoLoopControl & pimple(const label i)
Access the i-th pimple control.
Convergence control class. Provides methods to check the convergence of the time loop against an abso...
bool run(Time &time)
Time run loop.
virtual bool hasResidualControls() const
Return true if residual controls are present.
const Time & time() const
Return the time.
pimpleMultiRegionControl(PtrList< fvMesh > &pimpleMeshes, PtrList< fvMesh > &solidMeshes, const word &algorithmName="PIMPLE")
Construct from meshes and the algorithm name.
virtual bool criteriaSatisfied() const
Return true if all convergence checks are satisfied.
virtual void resetCorrSolveIndex()
Reset the solve index in the correction residual control data.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:63
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
virtual bool corrCriteriaSatisfied() const
Return true if all correction convergence checks are satisfied.
const word & algorithmName() const
Return the name of the algorithm.
virtual bool hasCorrResidualControls() const
Return true if corrector residual controls are present.
Namespace for OpenFOAM.