checkResidualControls.H
Go to the documentation of this file.
1 // Residual control used?
2 bool resControlUsed = false;
4 int nSolidControlled = solidRegions.size();
5 
6 // Check wheater there is a single regions that uses residual control
8 {
10  {
11  resControlUsed = true;
12  }
13 }
14 
16 {
18  {
19  resControlUsed = true;
20  }
21 }
22 
23 if (resControlUsed)
24 {
25  int nFluidConv = 0;
26  int nSolidConv = 0;
27 
28  // Sum of all converged regions (Note: if no residual control is used
29  // the residualReached* flag is already set to true)
31  {
32  if (residualReachedFluid[i])
33  {
34  nFluidConv++;
35  }
36  }
37 
39  {
40  if (residualReachedSolid[i])
41  {
42  nSolidConv++;
43  }
44  }
45 
46  if (nFluidConv == nFluidControlled && nSolidConv == nSolidControlled)
47  {
48  // Activate flag to go to the 'Final' loop using the 'Final'
49  // relaxation factors
50  allRegionsConverged = true;
51  }
52 }
53 
54 if (finalIter && resControlUsed && !allRegionsConverged)
55 {
56  Info<< "\nRegions not converged after " << nOuterCorr
57  << " outer correctors" << endl;
58 }
59 else if (finalIter && resControlUsed && allRegionsConverged)
60 {
61  Info<< "\nRegions converged after " << oCorr
62  << " outer correctors" << endl;
63 
64  // Leave PIMPLE loop
65  break;
66 }
bool resControlUsed
List< bool > residualReachedSolid(solidRegions.size(), true)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
List< bool > residualControlUsedSolid(solidRegions.size(), false)
int nFluidControlled
const int nOuterCorr
List< bool > residualControlUsedFluid(fluidRegions.size(), false)
PtrList< fvMesh > solidRegions(solidsNames.size())
forAll(fluidRegions, i)
messageStream Info
PtrList< fvMesh > fluidRegions(fluidNames.size())
List< bool > residualReachedFluid(fluidRegions.size(), true)