PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

save variables for individual lithium plating terms

Open valentinsulzer opened this issue 2 years ago • 6 comments

Description

Add some variables for each term in the lithium plating equation to see different contributions

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.

  • [ ] 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:

  • [ ] No style issues: $ pre-commit run (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • [ ] All tests pass: $ python run-tests.py --all
  • [ ] The documentation builds: $ python run-tests.py --doctest

You can run unit and doctests together at once, using $ python run-tests.py --quick.

Further checks:

  • [ ] Code is commented, particularly in hard-to-understand areas
  • [ ] Tests added that prove fix is effective or that feature works

valentinsulzer avatar May 19 '23 16:05 valentinsulzer

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 99.71%. Comparing base (d9c22c2) to head (978e978). :warning: Report is 3488 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2970   +/-   ##
========================================
  Coverage    99.71%   99.71%           
========================================
  Files          273      273           
  Lines        19002    19021   +19     
========================================
+ Hits         18947    18966   +19     
  Misses          55       55           

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

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 19 '23 16:05 codecov[bot]

@tinosulzer Correct.

Note that the code is agnostic as to the mechanism by which reversible lithium become dead lithium, and I intend to keep it that way for now. If the mechanism is mechanical isolation of Li metal, than no electrons are transferred at all. If it's a chemical mechanism (e.g. 2Li + C3H4O3 -> Li2CO3 + C2H4), two electrons are transferred but they come from the Li itself and not the external circuit. So either way there is no current.

Do you think it's also worth changing the irreversible model to make dead Li instead of plated Li? I'm working on an example notebook for coupled degradation and it may be helpful to define separate variables for irreversible and reversibel capacity loss.

DrSOKane avatar May 23 '23 10:05 DrSOKane

I think we should keep the irreversible notebook as is, since it might confuse people why the plated lithium concentration is not changing

valentinsulzer avatar May 24 '23 19:05 valentinsulzer

One way around it could be to define a dead lithium flux [mol.m-3] instead:

dead_lithium_flux = -dead_lithium_decay_rate * c_plated_Li / a

i.e. the same as j_dead_lithium but without multiplying by F

DrSOKane avatar May 31 '23 16:05 DrSOKane

Is this still relevant or can this PR be closed?

kratman avatar Jul 08 '24 16:07 kratman