CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Convergence check on forces (

andrea.pasquali March 13, 2011 17:43

Convergence check on forces
I'm trying to add the convergence check on forces function following the residuals convergence check in simpleFoam.
For example, for the forces pressure, I added those lines:

scalar eqnResidualFF = 1, maxResidualFF = 0;

eqnResidualFF = solve
fm.first().first() += sum(fN)

maxResidualFF = max(eqnResidualFF, maxResidualFF);
After compilation I got the error:

error: invalid use of void expression
What I'm wronging? I think it does not like the expression:

Could anyone help me to go ahead?



andrea.pasquali March 16, 2011 06:24

3 Attachment(s)
I solved my problems and I did the new lib to check the error on the forces / moments.
At now I calculate the increment between it i and it i-1:

err = || (force)[i] - (forces)[i-1] ||

I attached the plots for increment, residuals and force.

I'd like to stop the calculation when the force becomes more or less constant (2000-3000 its) without waiting for residuals convergence check (because it is possible my Ux Uy Uz residuals don't decrease under the convergence declared in fvSolution).

I hoped to do that checking the increment but as you can see it is very dispersive.
Is it possible to do what I want to do?

Thanks in advance for any help and suggestion


All times are GMT -4. The time now is 18:52.