uw-comphys / opencmp

OpenCMP is a computational multiphysics software package based on the finite element method. It is primarily intended for physicochemical processes involving significant convective flow.
https://opencmp.io/
GNU Lesser General Public License v2.1
25 stars 15 forks source link

Non-linear iterations and oscillatory error #49

Closed Alex-Vasile closed 1 year ago

Alex-Vasile commented 1 year ago

Currently, for non-linear iteration, the non-linear iterations are stopped if the newest error is below the tolerance. However this leads to bad results in the case of oscillatory behaviour.

If the error in the non-linear iterations oscillate between two extremes (and worst case these two extremes diverge), the iterations will be stopped and the result accepted as soon as the minimum of these oscillations meet the tolerance. This result however is often nonesense, even visually looking at the result is enough to see this.

I think that instead of looking at only the last iteration, the last N iterations should all stay below the tolerance in order for the final result to be accepted. Further handling and identifying of osculatory behaviour may also be beneficial.

nasserma commented 1 year ago

This issue is associated with issue #51, convergence of a linear or nonlinear solver does not need to be monotonic, but there should not be significant (order-of-magnitude) changes in the error norm from iteration to iteration (from my understanding). Bounding the initial scalar Jacobian estimate seems to solve this, in practice, so the solution to issue #51 will address this.