pimpleControlI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2017 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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
27 
29 {
30  return nCorrPIMPLE_;
31 }
32 
33 
35 {
36  return nCorrPISO_;
37 }
38 
39 
41 {
42  return corrPISO_;
43 }
44 
45 
46 inline bool Foam::pimpleControl::SIMPLErho() const
47 {
48  return SIMPLErho_;
49 }
50 
51 
53 {
54  corrPISO_++;
55 
56  if (debug)
57  {
58  Info<< algorithmName_ << " correct: corrPISO = " << corrPISO_ << endl;
59  }
60 
61  if (corrPISO_ <= nCorrPISO_)
62  {
63  return true;
64  }
65  else
66  {
67  corrPISO_ = 0;
68  return false;
69  }
70 }
71 
72 
74 {
75  // Start from second PIMPLE iteration
76  return (corr_ == 2) && (corrPISO_ == 0) && (corrNonOrtho_ == 0);
77 }
78 
79 
80 inline bool Foam::pimpleControl::firstIter() const
81 {
82  return corr_ == 1;
83 }
84 
85 
86 inline bool Foam::pimpleControl::finalIter() const
87 {
88  return converged_ || (corr_ == nCorrPIMPLE_);
89 }
90 
91 
93 {
94  return
96  && corrNonOrtho_ == nNonOrthCorr_ + 1;
97 }
98 
99 
101 {
102  return solveFlow_;
103 }
104 
105 
106 inline bool Foam::pimpleControl::turbCorr() const
107 {
108  return !turbOnFinalIterOnly_ || finalIter();
109 }
110 
111 
112 // ************************************************************************* //
bool correct()
Pressure corrector loop control.
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
label nCorrPISO_
Maximum number of PISO correctors.
Definition: pimpleControl.H:78
label nCorrPISO() const
Maximum number of PISO correctors.
bool solveFlow_
Flag to indicate whether to solve for the flow.
Definition: pimpleControl.H:72
bool finalInnerIter() const
Return true for final inner iteration.
label nNonOrthCorr_
Maximum number of non-orthogonal correctors.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
bool turbCorr() const
Return true to solve for turbulence.
bool SIMPLErho() const
Flag to indicate whether to update density in SIMPLE.
bool solveFlow() const
Return true to solve for flow.
label corrPISO_
Current PISO corrector.
Definition: pimpleControl.H:81
bool storeInitialResiduals() const
Return true to store the intial residuals.
bool SIMPLErho_
Flag to indicate whether to update density in SIMPLE.
Definition: pimpleControl.H:85
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
Definition: pimpleControl.H:75
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
Definition: pimpleControl.H:88
label corr_
Current corrector loop index.
label nCorrPIMPLE() const
Maximum number of PIMPLE correctors.
bool firstIter() const
Return true for first PIMPLE (outer) iteration.
label corrPISO() const
Current PISO corrector index.
label corrNonOrtho_
Current non-orthogonal corrector loop index.
messageStream Info
bool finalIter() const
Return true fore final PIMPLE (outer) iteration.
bool converged_
Converged flag.
Definition: pimpleControl.H:91