PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Lithium plating upgrades

Open DrSOKane opened this issue 1 year ago • 5 comments

Description

  • Lithium plating model now works on composite electrodes
  • Added plating parameters to Ecker2015, Ecker2015_graphite_halfcell and Chen2020_composite parameter sets
  • Fixed bug where the dead lithium concentration variable had no scale

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)
  • [x] 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

DrSOKane avatar Mar 22 '24 11:03 DrSOKane

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.59%. Comparing base (96ba50c) to head (4e6b16f). Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3919   +/-   ##
========================================
  Coverage    99.59%   99.59%           
========================================
  Files          258      259    +1     
  Lines        21310    21353   +43     
========================================
+ Hits         21223    21266   +43     
  Misses          87       87           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 22 '24 12:03 codecov[bot]

Submodel code looks good to me, but I am now against adding new parameters to existing parameter sets from the literature (e.g. adding lithium plating parameters to Ecker). In an ideal world, PyBaMM parameter sets would be based only on peer-reviewed papers, and only contain the parameters included in those papers. I know it's not the case now (lots of parameter sets contain extra parameters not in the main paper), but we should strive to move towards that, not away from it.

If you want to add a parameter set based on Ecker with your own plating parameters, can you put it in a separate public repository, with entry points? I assume you're working on a paper related to this, once that is published we can add the full parameter set under "OKane2024" or whatever

The O'Kane2020 paper did in fact use the Ecker2015 parameter set, but it was in COMSOL, not PyBaMM. The charging protocol used to validate the 2020 model is not supported by PyBaMM, for reasons we have previously discussed.

I agree that technically the Chen2020_composite model should not technically have any plating parameters. There is another paper with a composite lithium plating model, and I could add that paper instead.

DrSOKane avatar Mar 22 '24 14:03 DrSOKane

The charging protocol used to validate the 2020 model is not supported by PyBaMM

Is this the SOC-based cutoff? That should now be possible using custom events

If you have parameter sets that follow existing references then please add those. It just needs to be easy for future PyBaMM maintainers to point to a peer-reviewed reference to justify the parameter set, rather than trying to chase down old maintainers

valentinsulzer avatar Mar 22 '24 14:03 valentinsulzer

I decided to just not have a parameter set for the composite plating. We plan to make one in the future, but this is a necessary first step.

DrSOKane avatar Apr 19 '24 17:04 DrSOKane

The Linux failures are unrelated and are coming from https://github.com/awalsh128/cache-apt-pkgs-action/issues/131 and https://github.com/orgs/community/discussions/120966. Edit: they have been resolved now, I triggered the failed runs again.

agriyakhetarpal avatar Apr 24 '24 12:04 agriyakhetarpal