residualControlsFluid.H
Go to the documentation of this file.
1 // Residual control used
3 {
4  bool UConv = false;
5  bool p_rghConv = false;
6  bool EConv = false;
7 
8  // Check which field is not used for control
9  {
10  if (UTol == -1 || !momentumPredictor)
11  {
12  UConv = true;
13  }
14 
15  if (p_rghTol == -1)
16  {
17  p_rghConv = true;
18  }
19 
20  if (ETol == -1)
21  {
22  EConv = true;
23  }
24  }
25 
26  // Get the last initial residual of the solvers
27  if (momentumPredictor && !UConv)
28  {
29  if (UTol > cmptMax(solvPerfU.initialResidual()))
30  {
31  UConv = true;
32  }
33  }
34 
35  if (!p_rghConv)
36  {
37  if (p_rghTol > solvPerfp_rgh.initialResidual())
38  {
39  p_rghConv = true;
40  }
41  }
42 
43  if (!EConv)
44  {
45  if (ETol > solvPerfE.initialResidual())
46  {
47  EConv = true;
48  }
49  }
50 
51  // Check if each field is converged
52  if (UConv && p_rghConv && EConv)
53  {
54  resReachedFluid = true;
55  }
56 }
const bool momentumPredictor
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
bool & residualControlUsed
SolverPerformance< vector > solvPerfU
Definition: createFields.H:4
bool & resReachedFluid
solvPerfE
Definition: EEqn.H:23
SolverPerformance< scalar > solvPerfp_rgh
Definition: createFields.H:7