Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytical Jacobian for Cantera #19

Closed
mbkumar opened this issue Jan 7, 2020 · 5 comments
Closed

Analytical Jacobian for Cantera #19

mbkumar opened this issue Jan 7, 2020 · 5 comments
Labels
work-in-progress An enhancement that someone is currently working on

Comments

@mbkumar
Copy link

mbkumar commented Jan 7, 2020

Abstract

I am working on implementing analytical Jacobian for Cantera to replace the finite difference Jacobian computed internally by SUNDIALS.

Motivation

Jacobian matrix can be computed analytically for chemical kinetics. Analytical Jacobian improves the accuracy when compared to the finite difference Jacobian computed with forward difference scheme especially for stiff kinetics. With a good implementation, it can also reduce the computational expense when compared to the finite difference Jacobian.

Description

To obtain the analytical Jacobian, derivatives of the production rates w.r.t. species mass fractions and state variables are computed. Based on the governing equations of a reactor model, derivatives corresponding to the Jacobian can be computed from the computed derivatives of the production rates. An API for the end user to enable/disable analytical Jacobian is added.

Alternatives

Analytical Jacobian can also be obtained by using auto-differentiation packages. Such packages introduce additional dependencies and the fundamental classes of Cantera need to rewritten to account for auto-differentiation. Instead, the current implementation adds additional member variables and methods to the existing classes to compute the required derivatives without touching existing methods.

References

https://github.com/mbkumar/cantera/tree/derivative

@mbkumar mbkumar added the work-in-progress An enhancement that someone is currently working on label Jan 7, 2020
@12Chao
Copy link

12Chao commented Aug 5, 2021

Hi @mbkumar, I think this feature is very helpful, I was wondering is this improvement still in progress?

@mbkumar
Copy link
Author

mbkumar commented Aug 5, 2021 via email

@ischoegl
Copy link
Member

ischoegl commented Aug 5, 2021

I am currently looking at implementing this in the core - there have already been quite a few changes in reaction rate evaluators in 2.6 already, so previous work won't map cleanly. Also, I have not looked at temperature derivatives beyond Arrhenius. The new PR Cantera/cantera#1081 should get species derivatives; there also is some overlap with Cantera/cantera#1010, so hopefully this will be available in 2.6.

@mbkumar ... once I get to temperature derivatives, it may be great if I could recycle your code if you don't mind (and would certainly give credit).

@mbkumar
Copy link
Author

mbkumar commented Aug 6, 2021

@ischoegl
Feel free to use the code in anyway you see fit.

@ischoegl
Copy link
Member

Closed via Cantera/cantera#1089.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress An enhancement that someone is currently working on
Projects
None yet
Development

No branches or pull requests

3 participants