modsim / CADET

A modular, fast, and accurate simulation framework for (column) liquid chromatography
GNU General Public License v3.0
49 stars 24 forks source link

Switch from full Newton to modified Newton method in SUNDIALS #196

Closed sleweke-bayer closed 1 week ago

sleweke-bayer commented 1 month ago

Changes from full Newton to modified Newton in the time integrator. The Jacobian is only updated when SUNDIALS requests us to. This enables us to reuse the factorized Jacobian for multiple linear solves.

TODO

sleweke-bayer commented 1 month ago

Maybe we could figure out how to do that on the unit-operation level. Then, finite volume discretizations can still do the full Newton.

jbreue16 commented 1 month ago

Update:

As it is right now, we need to make the modified/full Newton optional, with default to the latter if sensitivities are involved.

sleweke commented 1 month ago
  • Sensitivities might work better with the full Newton method.

I've noticed that the Jacobian was not evaluated when residualSens() was called. This is now fixed, please test again.