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-2013 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 
47 {
48  corrPISO_++;
49 
50  if (debug)
51  {
52  Info<< algorithmName_ << " correct: corrPISO = " << corrPISO_ << endl;
53  }
54 
55  if (corrPISO_ <= nCorrPISO_)
56  {
57  return true;
58  }
59  else
60  {
61  corrPISO_ = 0;
62  return false;
63  }
64 }
65 
66 
68 {
69  // Start from second PIMPLE iteration
70  return (corr_ == 2) && (corrPISO_ == 0) && (corrNonOrtho_ == 0);
71 }
72 
73 
74 inline bool Foam::pimpleControl::firstIter() const
75 {
76  return corr_ == 1;
77 }
78 
79 
80 inline bool Foam::pimpleControl::finalIter() const
81 {
82  return converged_ || (corr_ == nCorrPIMPLE_);
83 }
84 
85 
87 {
88  return
89  finalIter()
90  && corrPISO_ == nCorrPISO_
91  && corrNonOrtho_ == nNonOrthCorr_ + 1;
92 }
93 
94 
95 inline bool Foam::pimpleControl::turbCorr() const
96 {
97  return !turbOnFinalIterOnly_ || finalIter();
98 }
99 
100 
101 // ************************************************************************* //
Foam::pimpleControl::corrPISO
label corrPISO() const
Current PISO corrector index.
Definition: pimpleControlI.H:40
Foam::pimpleControl::storeInitialResiduals
bool storeInitialResiduals() const
Helper function to identify when to store the intial residuals.
Definition: pimpleControlI.H:67
Foam::pimpleControl::nCorrPIMPLE_
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
Definition: pimpleControl.H:69
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::label
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
Foam::Info
messageStream Info
Foam::pimpleControl::finalIter
bool finalIter() const
Helper function to identify final PIMPLE (outer) iteration.
Definition: pimpleControlI.H:80
Foam::pimpleControl::nCorrPISO
label nCorrPISO() const
Maximum number of PISO correctors.
Definition: pimpleControlI.H:34
Foam::pimpleControl::correct
bool correct()
Pressure corrector loop.
Definition: pimpleControlI.H:46
Foam::pimpleControl::firstIter
bool firstIter() const
Helper function to identify first PIMPLE (outer) iteration.
Definition: pimpleControlI.H:74
Foam::pimpleControl::finalInnerIter
bool finalInnerIter() const
Helper function to identify final inner iteration.
Definition: pimpleControlI.H:86
Foam::pimpleControl::turbCorr
bool turbCorr() const
Helper function to identify whether to solve for turbulence.
Definition: pimpleControlI.H:95
Foam::pimpleControl::nCorrPIMPLE
label nCorrPIMPLE() const
Maximum number of PIMPLE correctors.
Definition: pimpleControlI.H:28