CASL / Futility

VERA Fortran Utilities
Other
44 stars 20 forks source link

Improve implicit solve in BDF ode stepper #272

Closed wgurecky closed 3 years ago

wgurecky commented 4 years ago

The current BDF stepper only updates the jacobian once every 20 steps: https://github.com/CASL/Futility/blob/9dc98226cf1cf6d3c3e2d1355f7f7a3bb696ba04/src/ODESolverTypes.f90#L638

This is not adequate for some very stiff problems. it is in this situation where one would apply the BDF family of methods over explicit marching methods. This could also be seen as a deficiency in the current implementation because a user of the BDF stepper will expect the algorithm to handle stiff systems without issue.

The proposed enhancement is to update the jacobian via the approximate Broyden's method after each nonlinear iteration is performed in the implicit solve. This approximate method is recommended since the expense of updating the jacobian via finite difference precludes this from being viable when embedded in the innermost nonlinear iteration loop.

This should improve overall roubustness of the BDF ode stepper.

wgurecky commented 4 years ago

The branch located at https://github.com/wgurecky/Futility/tree/fallback_ode_impl_solve implements an expensive fallback strategy for implicit_solve in the bdf ode step.