lcpp-org / crane

A MOOSE application dedicated to general Chemical ReAction NEtworks for plasma chemistry and thermochemistry problems.
https://crane-plasma-chemistry.readthedocs.io/
GNU Lesser General Public License v2.1
21 stars 20 forks source link

Add jacobian contributions from parsed function rate coefficients #53

Open keniley1 opened 4 years ago

keniley1 commented 4 years ago

Many rate coefficients are given in functional forms, often in terms of electron and/or gas temperature. Occasionally other species are also included. Automatic differentiation does not work with parsed materials at the moment, so these need to be added manually.

Parsed rate coefficients are already using the DerivativeParsedMaterial class so the groundwork is in place. The actual derivative calculations need to be added and a new class of Kernels should be included to handle the parsed function jacobian contributions.

dcurreli commented 4 years ago

Automatic differentiation would be really useful here.

keniley1 commented 4 years ago

It would, but it's unfortunately just not possible at the moment. See this thread if you want a bit more detail:

https://groups.google.com/forum/#!topic/moose-users/UtXfmsN4cqU

That said, this really shouldn't be too complicated to implement. The DerivativeParsedMaterial class in Moose can compute the derivative of a function with respect to nonlinear variables already. I just need to make sure the derivatives are specified and added automatically in the Action, and then create another class of Kernels that accepts those derivatives as input. (All of this will be completely hidden from the end user, of course.)

I've been getting away with not having this because the preconditioned jacobian-free solver doesn't require perfect jacobians. I've been using that for air discharge simulations. Only a few rate coefficients are given in terms of electron temperature anyway so the jacobian contribution is negligible. If we add gas temperature to the mix we might run into some issues though.

keniley1 commented 4 years ago

My last comment is rendered obsolete by PR #58, which is related to a recent MOOSE update that allows for automatic differentiation with parsed functions. Cool stuff!

I'll leave this issue open until I add ADParsedMaterials to the Crane action.