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  break;
13  }
14 }
15 
17 {
19  {
20  resControlUsed = true;
21  break;
22  }
23 }
24 
25 if (resControlUsed)
26 {
27  int nFluidConv = 0;
28  int nSolidConv = 0;
29 
30  // Sum of all converged regions (Note: if no residual control is used
31  // the residualReached* flag is already set to true)
33  {
34  if (residualReachedFluid[i])
35  {
36  nFluidConv++;
37  }
38  }
39 
41  {
42  if (residualReachedSolid[i])
43  {
44  nSolidConv++;
45  }
46  }
47 
48  if (nFluidConv == nFluidControlled && nSolidConv == nSolidControlled)
49  {
50  // Activate flag to go to the 'Final' loop using the 'Final'
51  // relaxation factors
52  allRegionsConverged = true;
53  }
54 }
55 
56 if (!runTime.run())
57 {
58  Info<< "\nRegions not converged after " << runTime.timeName()
59  << " iterations" << endl;
60 }
61 else if (runTime.run() && resControlUsed && allRegionsConverged)
62 {
63  Info<< "\nRegions converged after " << runTime.timeName()
64  << " iterations" << endl;
65 
66  // Leave SIMPLE loop
67  break;
68 }
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
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)