Closed michael-a-hansen closed 7 years ago
@michael-a-hansen I would guess that the issue here is that pyJac moves a user-specified species to the end of the model to use for explicit mass conservation.
If the user doesn't specify a last species explicitly it will in this case choose N2
(followed by He and Ar, IIRC).
We do some mapping of species dydt's in our functional tester to get around this problem, but there's an easier way, e.g.:
import cantera as ct
gas = ct.Solution('methanol-zabetta.xml')
n2_ind = gas.species_index('N2')
specs = gas.species()[:]
gas2 = ct.Solution(thermo='IdealGas', kinetics='GasKinetics', species=specs[:n2_ind] + specs[n2_ind + 1:] + [specs[n2_ind]], reactions=gas.reactions())
I'll add it to the list of "things that need to be documented"
I don't think that's it, because I specified the last species to match that in the input file. I saw some of the species mapping stuff and wanted to avoid any issues there, so I compiled pyJac with HE as the last species, matching the input file. I talked with @kyleniemeyer about SRI last Spring, I remember it being an issue or not implemented yet or something like that.
We certainly support SRI, and in fact made sure to include a kinetic model with SRI falloff reactions in the validation of our paper.
We did fix a bug related to SRI recently (#12), so it's possibly you found another one. Are you used the most recent version, or did you download from PyPI? We haven't pushed the latest version there yet...
I pulled from GitHub yesterday
OK, sounds like you identified a new bug!
The XML file you provided actually ends with AR as the last species.
I'm in the process of trying to recreate this, I'll report back soon with an update!
Whoops, you are correct, it's AR. Don't know how I got HE in there. I regenerated my pyJac/pyWrap module and now it works as expected. Sorry for the false alarm!
Hah, no worries!
Thanks for pointing out the hole in our documentation / examples. Definitely appreciated!
When I compare
dydt
from cantera and pyJac for a mechanism including an SRI falloff reaction, I get huge differences. This shows up immediately in a time integration problem.The mechanism of interest is Zabetta et al. for methanol (see paper and mechanism below). It only has a single SRI reaction but that causes major problems.
Coda Zabetta, Hupa_2008.pdf methanol-zabetta.xml.zip