-
-
Notifications
You must be signed in to change notification settings - Fork 537
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
Negative half-cell models #3198
Negative half-cell models #3198
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #3198 +/- ##
=========================================
Coverage 99.58% 99.58%
=========================================
Files 254 256 +2
Lines 19821 19998 +177
=========================================
+ Hits 19738 19915 +177
Misses 83 83
☔ View full report in Codecov by Sentry. |
…issue-2730-graphite-halfcell
This reverts commit 4e49668.
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 Simon!
CHANGELOG.md
Outdated
- Option `working electrode` has been replaced with `half-cell`, which can only be `true` or `false`. The positive electrode is always considered to be the working electrode. For negative half-cells, lithium metal is now considered the negative electrode and the negative electrode material to be the positive electrode. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | ||
- If `options["half-cell"] == "false"` and either `SEI`, `SEI on cracks` or `lithium plating` are not provided as tuples, they are automatically made into tuples. This directly modifies `extra_options`, not `default_options` to ensure the other changes `default_options` still happen when required. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | ||
- Added option to use an empirical hysteresis model for the diffusivity and exchange-current density ([#3194](https://github.com/pybamm-team/PyBaMM/pull/3194)) | ||
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044)) | ||
- Double-layer capacity can now be provided as a function of temperature ([#3174](https://github.com/pybamm-team/PyBaMM/pull/3174)) | ||
- `pybamm_install_jax` is deprecated. It is now replaced with `pip install pybamm[jax]` ([#3163](https://github.com/pybamm-team/PyBaMM/pull/3163)) | ||
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044)) |
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.
- Option `working electrode` has been replaced with `half-cell`, which can only be `true` or `false`. The positive electrode is always considered to be the working electrode. For negative half-cells, lithium metal is now considered the negative electrode and the negative electrode material to be the positive electrode. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | |
- If `options["half-cell"] == "false"` and either `SEI`, `SEI on cracks` or `lithium plating` are not provided as tuples, they are automatically made into tuples. This directly modifies `extra_options`, not `default_options` to ensure the other changes `default_options` still happen when required. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | |
- Added option to use an empirical hysteresis model for the diffusivity and exchange-current density ([#3194](https://github.com/pybamm-team/PyBaMM/pull/3194)) | |
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044)) | |
- Double-layer capacity can now be provided as a function of temperature ([#3174](https://github.com/pybamm-team/PyBaMM/pull/3174)) | |
- `pybamm_install_jax` is deprecated. It is now replaced with `pip install pybamm[jax]` ([#3163](https://github.com/pybamm-team/PyBaMM/pull/3163)) | |
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044)) | |
- Option `working electrode` has been replaced with `half-cell`, which can only be `true` or `false`. The positive electrode is always considered to be the working electrode. For negative half-cells, lithium metal is now considered the negative electrode and the negative electrode material to be the positive electrode. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | |
- If `options["half-cell"] == "false"` and either `SEI`, `SEI on cracks` or `lithium plating` are not provided as tuples, they are automatically made into tuples. This directly modifies `extra_options`, not `default_options` to ensure the other changes `default_options` still happen when required. ([#3198](https://github.com/pybamm-team/PyBaMM/pull/3198)) | |
- Added option to use an empirical hysteresis model for the diffusivity and exchange-current density ([#3194](https://github.com/pybamm-team/PyBaMM/pull/3194)) | |
- Double-layer capacity can now be provided as a function of temperature ([#3174](https://github.com/pybamm-team/PyBaMM/pull/3174)) | |
- `pybamm_install_jax` is deprecated. It is now replaced with `pip install pybamm[jax]` ([#3163](https://github.com/pybamm-team/PyBaMM/pull/3163)) | |
- PyBaMM now has optional dependencies that can be installed with the pattern `pip install pybamm[option]` e.g. `pybamm[plot]` ([#3044](https://github.com/pybamm-team/PyBaMM/pull/3044)) |
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, thanks @DrSOKane !
A couple of comments:
- Is a helpful error raised if the user tries to do
{"working electrode": "positive"}
? - It looks like the SEI variables now require a domain ("Negative electrode SEI thickness [m]" instead of "SEI thickness [m]"). Does that mean previous scripts with "SEI thickness [m]" will break?
thanks @DrSOKane ! would be great to get this merged before the next release if you have time to respond to valentin's comments above |
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.
Upon further considering I think we should keep "working electrode": "positive" to avoid unnecessarily breaking people's code, and just error with "working electrode": "negative" with an error message that explains you always have to use "positive" and change the parameters. In future if we have a symmetric cell that can be "working electrode": "none"
Hi @tinosulzer and @rtimms, I'm back from holiday and made this a priority. All variables pertaining to the Having thought about it, I agree that changing back to the Finally, I've added an example notebook to show how to use the half-cell models. |
Happy to merge once the notebook conflicts are resolved |
@agriyakhetarpal do you know why the doc test is failing? |
Yes, I think this is a bug that I have noted earlier (#3389). We should mark it at a higher priority now I guess Edit: sorry, I read the logs too quickly. It looks like a different warning, I will debug and leave a review below. |
The underline in parameter_sets.rst is to short to accommodate the name of the new parameter set, so I extended the underline. Should work now. |
Fantastic work @DrSOKane! |
Thank you so much! This means a lot! |
Description
This pull request introduced negative half-cell models to PyBaMM, by means of three major changes:
"working electrode": ["both", "negative", "positive"]
has been replaced with"half-cell": ["false", "true]
. The positive electrode is always considered to be the working electrode, which has always been the case but is now made explicit.Ecker2015_graphite_halfcell
andOKane2022_negative_halfcell
- have been added to work with the new option.SEI
,SEI on cracks
andlithium plating
can now be used on either electrode by specifying them as a 2-tuple, in the same way as is already done for some other options. Unlike for other options, however, passing only a single string instead of a tuple will put that behaviour on the negative electrode only.Fixes #2730
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: