-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
[Bug]: create_from_bpx(): reaction rate activation energies are always zero #3225
Comments
Thanks for pointing this out. I think the best solution is to correct the name lookups in For #3051 we should just use distinct names, as suggested. We clearly need a better test for @ejfdickinson it seems like you may have some code snippets like the one above for testing specific parameters (especially those embedded within functions, like activation energies). Do you think you could have a go at providing a fix plus updating the test? |
@rtimms I think that @darryl-ad may be able to take on this issue and #3051, not least since we have a self-interest in the fixes being ready for the next release. For a test, I think probably the most appropriate method would be to use the |
Thanks, sounds good. I guess for "equivalence" I was thinking let's at least check all the scalar values we can read directly or calculate (e.g. by evaluating functions at some fixed values, like in your above example) are correct. @darryl-ad let me know if you need any help. |
@all-contributors please add @ejfdickinson for ideas and bug reports |
I've put up a pull request to add @ejfdickinson! 🎉 |
No problem I'll take this and #3051 |
@rtimms @ejfdickinson I've fixed both of the discussed issues in PR #3242. I tackled both issues in a single PR to prevent merge conflicts. @rtimms certain parameters are both scalar values in the parameter dictionary, and also hard-coded into other functional parameters during their creation in Is it possible to replace the hard-coded values inside the functional parameters, with references using |
Yeah, I agree, for BPX the values that already appear as scalars in |
@all-contributors please add @darryl-ad for ideas |
I've put up a pull request to add @darryl-ad! 🎉 |
PyBaMM Version
23.4
Python Version
3.9.16
Describe the bug
Issue
The effective values of reaction rate constant activation energies specified in a BPX JSON file are always zero after processing by
create_from_bpx()
.Note: identified in 23.4 but no relevant code changes in latest version. See also #3051 which reports other out-of-specification behaviour of the same function.
Cause:
This is because BPX specifies that these have the name
Reaction rate constant activation energy [J.mol-1]
which is rendered by_bpx_to_domain_param_dict()
intoHowever,
_bpx_to_param_dict()
checks as follows when recreating exchange current density functions:Because the word
"constant"
is missing from the lookup key, the dict entries are not found, and the imported reaction rate constant activation energies are always replaced with thevalue
field0.0
in the resulting exchange current density function in theParameterValues
object.Proposed fix:
Either:
_bpx_to_param_dict()
, or"constant "
when processing these fields in_bpx_to_domain_param_dict()
.Steps to Reproduce
Using
nmc_pouch_cell_BPX.json
from the BPX example download:The text was updated successfully, but these errors were encountered: