Why we think this is better when runTimeControl in openfoam and residuals
This functionObject runs every iteration, it pulls force data and it stores the total force which is later used for the gradient calculation.
If simulation does not converge start forced averging at 4000 iterations
If simulation does not converge within 4000 iterations run 2000 averaging iterations so in total simulation will have 6000 iterations
Minimum number of iterations in case simulation converges before 200 iterations
Minimum number of averaging iterations in case simulation converges at iterationMinConvergence
In case forces explode this factor is used to check if forces are 2 times higher or lower when the converged value and in case of that it stops the simulation. If this happens it means your mesh is not good enough.
Original Python implementation by João Miranda
OpenFoam C++ Implementation by Nikola Majksner