pimpleControlIDF.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  This file is modified from OpenFOAM's source code
7  src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.C
8 
9  OpenFOAM: The Open Source CFD Toolbox
10 
11  Copyright (C): 2011-2016 OpenFOAM Foundation
12 
13  OpenFOAM License:
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 
32 inline Foam::label Foam::pimpleControlDF::nCorrPIMPLE() const
33 {
34  return nCorrPIMPLE_;
35 }
36 
37 inline Foam::label Foam::pimpleControlDF::nCorrPISO() const
38 {
39  return nCorrPISO_;
40 }
41 
42 inline Foam::label Foam::pimpleControlDF::corrPISO() const
43 {
44  return corrPISO_;
45 }
46 
48 {
49  return SIMPLErho_;
50 }
51 
53 {
54  setFirstIterFlag();
55 
56  ++corrPISO_;
57 
58  if (debug)
59  {
60  Info << algorithmName_ << " correct: corrPISO = " << corrPISO_ << endl;
61  }
62 
63  if (corrPISO_ <= nCorrPISO_)
64  {
65  return true;
66  }
67 
68  corrPISO_ = 0;
69 
70  setFirstIterFlag();
71 
72  return false;
73 }
74 
76 {
77  // Start from second PIMPLE iteration
78  return (corr_ == 2) && (corrPISO_ == 0) && (corrNonOrtho_ == 0);
79 }
80 
82 {
83  return corr_ == 1;
84 }
85 
87 {
88  return converged_ || (corr_ == nCorrPIMPLE_);
89 }
90 
92 {
93  return corrPISO_ == nCorrPISO_
94  && corrNonOrtho_ == nNonOrthCorr_ + 1;
95 }
96 
98 {
99  return solveFlow_;
100 }
101 
103 {
104  if (turbOnFinalIterOnly_)
105  {
106  if (finalIter())
107  {
108  setFirstIterFlag(true, true);
109  }
110  }
111  else
112  {
113  if (firstIter())
114  {
115  setFirstIterFlag(true, true);
116  }
117  else
118  {
119  setFirstIterFlag();
120  }
121  }
122 
123  return !turbOnFinalIterOnly_ || finalIter();
124 }
125 
126 // ************************************************************************* //
Foam::pimpleControlDF::firstIter
bool firstIter() const
Definition: pimpleControlIDF.H:81
Foam::pimpleControlDF::nCorrPIMPLE
label nCorrPIMPLE() const
Definition: pimpleControlIDF.H:32
Foam::pimpleControlDF::nCorrPIMPLE_
label nCorrPIMPLE_
Definition: pimpleControlDF.H:71
Foam::pimpleControlDF::finalIter
bool finalIter() const
Definition: pimpleControlIDF.H:86
Foam::pimpleControlDF::SIMPLErho
bool SIMPLErho() const
Definition: pimpleControlIDF.H:47
Foam::pimpleControlDF::nCorrPISO
label nCorrPISO() const
Definition: pimpleControlIDF.H:37
Foam::pimpleControlDF::storeInitialResiduals
bool storeInitialResiduals() const
Definition: pimpleControlIDF.H:75
Foam::pimpleControlDF::corrPISO
label corrPISO() const
Definition: pimpleControlIDF.H:42
Foam::pimpleControlDF::solveFlow
bool solveFlow() const
Definition: pimpleControlIDF.H:97
Foam::pimpleControlDF::correct
bool correct()
Definition: pimpleControlIDF.H:52
Foam::pimpleControlDF::finalInnerIter
bool finalInnerIter() const
Definition: pimpleControlIDF.H:91
Foam::pimpleControlDF::turbCorr
bool turbCorr()
Definition: pimpleControlIDF.H:102