Open ischoegl opened 3 years ago
Hi @ischoegl, @anthony-walker is working on something extremely relevant to this already
@ischoegl @kyleniemeyer my work should be easily adaptable to this. I will consider it moving forward while I am validating my current pull request.
@anthony-walker and @kyleniemeyer ... great! I typed this up as I was under the impression that work on Cantera/cantera#951 was for preconditioning.
PS: As an aside, I am currently looking at simplifying the reaction / reaction rate framework in Cantera/cantera#982. At the moment, Cantera/cantera#951 has not really touched this corner extensively?
@ischoegl Preconditioning is the main focus but the parts of the code affected are the same. I think I have an idea for how to easily adapt what I have.
Sounds great - looking forward to seeing more of this! As noted above (my 'PS'), I am currently looking into some of the innermost functions (related to reaction rate evaluations). I am interested in 'inner' derivatives for a different reason, but there are obvious connections to what's needed for a composite formulation that's ultimately fed to Sundials.
PS: I guess I found what I was looking for in Cantera/cantera#951. You indeed calculate the Jacobian, but use a finite difference version (at least in void AdaptivePreconditioner::TemperatureDerivatives
)
Abstract
By default, CVODES uses an internal difference quotient function for dense and band matrices. Per user guide:
Sparse Jacobian formulations are supported.
Motivation
Performance of 0D calculations.
Possible Solutions
Implement analytical derivatives for reaction rates, create user-defined
CVLsJacFn
to populate Jacobian and link to solver viaCVodeSetJacFn
.References
19 - analytical jacobians
80 - automatic differentiation