sandialabs / Spitfire

Spitfire is a Python/C++ library for constructing tabulated chemistry models and solving differential equations.
Other
36 stars 8 forks source link

Improve continuation methods for flamelets #4

Open michael-a-hansen opened 4 years ago

michael-a-hansen commented 4 years ago
gpavanb1 commented 1 year ago

Hi Michael,

Great work. I've written an arc-length continuation based on Spitfire at this link

michael-a-hansen commented 1 year ago

@gpavanb1 that's great, thank you for showing me. I'm always happy to see somebody new using Spitfire, please don't hesitate to let me know if you would like to see any changes or have any ideas.

Something you could look into for your code is using Spitfire's BTDDOD ("Block TriDiagonal with Diagonal Off-Diagonal blocks") linear solver. It is hand-coded in C++ with LAPACK for block factorizations and is significantly faster than SuperLU or any other sparse solvers in SciPy and you shouldn't have to do any work to get the Jacobian in the right form. It is the default linear solver and provides factorization and back-solve steps (which Spitfire splits as much as possible but with pacopy's interface you probably just have to always do both at once).

I'll definitely look into using pacopy with Spitfire. I've delved into continuation methods enough to make progress but just haven't had time to add all the methods I'm curious about. In case you're curious here's a SIAM article on the GESAT method in Spitfire (minus a correction for flamelets) which has mostly found use here for initializing a flamelet series. It is exceptionally robust but scales poorly for very large mechanisms (you can really feel it being slow with the full Cal Tech mech, about 200 species). My first hope for pacopy would be that it would provide something that can initialize the low-dissipation point on the extinction branch.