Plett OCP Hysteresis Model
Description
Adds the hysteresis model as outlined in Wycisk 2022, and as mentioned in #3375 and as discussed in #3376 .
This will allow for hysteresis switching to depend not on the current, but on the differential capacity change.
Fixes #3375
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.
- [x] New feature (non-breaking change which adds functionality)
- [ ] Optimization (back-end change that speeds up the code)
- [ ] Bug fix (non-breaking change which fixes an issue)
Key checklist:
- [x] No style issues:
$ pre-commit run(or$ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code) - [x] All tests pass:
$ python run-tests.py --all(or$ nox -s tests) - [x] The documentation builds:
$ python run-tests.py --doctest(or$ nox -s doctests)
You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).
Further checks:
- [ ] Code is commented, particularly in hard-to-understand areas
- [ ] Tests added that prove fix is effective or that feature works
@tinosulzer just bumping this comment again to see if you had any ideas
On Thu, Dec 21, 2023, 1:57 PM Tanner Leo @.***> wrote:
@.**** commented on this pull request.
In pybamm/models/submodels/interface/open_circuit_potential/plett_ocp.py https://urldefense.com/v3/__https://github.com/pybamm-team/PyBaMM/pull/3593*discussion_r1434544378__;Iw!!AT_l0aBtzg!x3qeLaE3zT60iD8EYTIecj026S4nMsCDsWLbNxYnZOaxmcjc3D57li60JuItOpydhv2T4F2G_Lk32Sfwyq7eOQ$ :
if domain_options["particle size"] == "distribution":
if sto_surf.domains['primary'] == f"{domain} electrode":ocp_surf = ocp_surf_eq + H * helse:ocp_surf = ocp_surf_eq + H_x_av * h_x_avelse:ocp_surf = ocp_surf_eq + H * hSo I have been able to get the DFN tests to pass and MPM tests to pass, although I realized I needed to x_average the h and H variables for the MPM, but not for the DFN with a psd. Is there any variable where I can have that logic execute automatically?
— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/pybamm-team/PyBaMM/pull/3593*pullrequestreview-1793720164__;Iw!!AT_l0aBtzg!x3qeLaE3zT60iD8EYTIecj026S4nMsCDsWLbNxYnZOaxmcjc3D57li60JuItOpydhv2T4F2G_Lk32ScE0juZ-A$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/BBQPXVIOAN7D3URF3EVUNIDYKSWEFAVCNFSM6AAAAABAII3LR2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJTG4ZDAMJWGQ__;!!AT_l0aBtzg!x3qeLaE3zT60iD8EYTIecj026S4nMsCDsWLbNxYnZOaxmcjc3D57li60JuItOpydhv2T4F2G_Lk32SeB9kzSwg$ . You are receiving this because you authored the thread.Message ID: @.***>
@rtimms Okay I believe everything here is in working order. Is an example notebook necessary? What else do I need to do before it can be merged into develop?
Check out this pull request on ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.57%. Comparing base (
fd7d1fd) to head (d8f451e). Report is 2 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #3593 +/- ##
===========================================
- Coverage 99.58% 99.57% -0.02%
===========================================
Files 260 261 +1
Lines 21358 21454 +96
===========================================
+ Hits 21270 21363 +93
- Misses 88 91 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for walking me through it! Hopefully the next one goes smoother!
@all-contributors please add @mleot for code and tests
Nice addition 👍. The heat generation due to OCP hysteresis still isn't accounted for, is it?
I don't think so. Do you know any references on how this should be accounted for?
Only using terminal voltage & energy balance like in https://doi.org/10.1038/s41560-019-0410-6 ... @rtimms might be able to answer better 🙂