-
-
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
MSMR model #3116
MSMR model #3116
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #3116 +/- ##
===========================================
- Coverage 99.70% 99.55% -0.16%
===========================================
Files 248 253 +5
Lines 18899 19523 +624
===========================================
+ Hits 18844 19436 +592
- Misses 55 87 +32
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, will need some more testing for coverage. Let me know if you want me to review any equations in particular
pybamm/expression_tree/broadcasts.py
Outdated
""" | ||
Override :meth:`pybamm.SpatialOperator.diff()` to reinstate behaviour of | ||
:meth:`pybamm.Symbol.diff()`. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably cleaner to just get rid of the NotImplementedError for spatial operators
Thanks. Yep, tests and examples still to do but wanted another pair of eyes on the general implementation. |
The model and example are implemented. Remaining tasks:
|
To do:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks Rob! Just a few comments, happy to merge once tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Picky comment, can you delete the empty cells at the end of the notebook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This notebook has an error, can you rerun it and check if the error is still there of it is legacy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was old and is fixed by re-running
"none", | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5", | ||
"6", | ||
"7", | ||
"8", | ||
"9", | ||
"10", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably something for a future issue, but I wonder if we can have a way to not hard code when an option is an integer (similar issue occurs with the RC components in the ECM), as technically we could have as many as we wanted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, changed to check for positive integers
@@ -98,44 +98,63 @@ def _get_standard_concentration_variables( | |||
c_s_av = pybamm.r_average(c_s_xav) | |||
|
|||
variables = { | |||
f"{Domain} {phase_name}particle stoichiometry": c_s / c_scale, | |||
f"{Domain} {phase_name}particle concentration": c_s / c_scale, | |||
# Dimensional concentration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have stoichiometry and dimensionless concentration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a hangover from when we had dimensional and dimensionless concentration. now they are equivalent. maybe we should remove dimensionless concentration now?
# j0_j = ( | ||
# j0_ref_j | ||
# * xj ** (wj * aj) | ||
# * (Xj - xj) ** (wj * (1 - aj)) | ||
# * (c_e / c_e_ref) ** (1 - aj) | ||
# ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the comment to explain this is what the original formulation is in the paper
Description
Implements the MSMR model from Baker & Verbrugge, 2018.
In particular, this PR adds a new "particle" model that solves for the potential within the particles. Then OCP is then this potential evaluated at the surface. In order to use this model, users must write down the OCV for each reaction (in the form of Eq 3), which are inverted to give the fraction of occupied sites (Eq 5). These are summed to give an explicit expression for the inverse of the OCV (Eq 6).
Also updates the electrode State of Health models to work with the MSMR formulation.
Fixes # (issue)
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run
(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
$ python run-tests.py --doctest
You can run unit and doctests together at once, using
$ python run-tests.py --quick
.Further checks: