PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Change fundamental SEI variable from thickness to concentration: attempt 2

Open DrSOKane opened this issue 10 months ago • 7 comments

Description

Previously, lithium was not conserved if both SEI growth and loss of active material were enabled. To fix this, the fundamental variable to be solved for is now SEI concentration, not thickness. This has the added bonus of simplifying the SEI on cracks model.

I closed #3171 and made a new one simply because PyBaMM has changed so much since then!

One major difference between #3171 and this PR is that this time around, I also deleted the parameter "Initial SEI thickness [m]" and replaced it with "Initial SEI concentration [mol.m-3]". I did this partly to make the initial conditions less complicated, and partly because it's easier to measure the amount of lithium consumed by formation than it is to measure or even estimate the initial thickness. I assumed a value of 38.34 [mol.m-3], based on Ramadass et al. (2004) and Safari et al. (2009). The exception is "OKane2022", for which I used the exact value (to 4 significant figures anyway!)

Fixes #3006

DrSOKane avatar Feb 21 '25 19:02 DrSOKane

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

The reason the tests are failing is because none of the half-cell parameter sets have a value for "Initial SEI concentration [mol.m-2]" on the lithium metal electrode. Liu and Lu (2017) propose values for this and other SEI parameters on Li metal electrodes. I went ahead using those and added a citation for Liu and Lu to all half-cell parameter sets.

DrSOKane avatar Feb 27 '25 13:02 DrSOKane

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 98.79%. Comparing base (d03d648) to head (69475fa). :warning: Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4869      +/-   ##
===========================================
+ Coverage    98.77%   98.79%   +0.02%     
===========================================
  Files          320      321       +1     
  Lines        27111    27123      +12     
===========================================
+ Hits         26779    26797      +18     
+ Misses         332      326       -6     

: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 Feb 27 '25 21:02 codecov[bot]

In general, I am against adding parameters that aren't in the original paper, but since we already added a bunch of extra degradation parameters in these files it is OK to add this once too. Going forward we should be more strict on this.

rtimms avatar Feb 28 '25 09:02 rtimms

In general, I am against adding parameters that aren't in the original paper, but since we already added a bunch of extra degradation parameters in these files it is OK to add this once too. Going forward we should be more strict on this.

The only difference is that Liu and Lu use an initial thickness of 10 nm as opposed to 5 nm for Safari et al. I wanted to check if the initial thickness was substantially different for planar electrodes, and it turns out it's not. So I could calculate an interfacial concentration from 5 nm instead of 10 nm, then remove the extra reference.

I don't know why the notebook is failing, it works fine when I run it!

DrSOKane avatar Feb 28 '25 12:02 DrSOKane

@DrSOKane is this ready to be reviewed?

rtimms avatar Apr 02 '25 13:04 rtimms

@DrSOKane is this ready to be reviewed?

Yes please! All the commits since removing the reference to Liu and Lu are just updated from develop branch

DrSOKane avatar Apr 02 '25 14:04 DrSOKane

Hi everyone,

I tried using the new framework with composite parameter sets and found a problem: how do you distribute the SEI between the two phases? Most PyBaMM models tend towards the two phases having equal SEI thickness in the long term, so I decided that it makes more sense to revert to giving the initial condition as thickness, but keep concentration as the fundamental variable on the back end.

To make up for this, I added a notebook that explains how to update PyBaMM parameter sets to account for any formation or storage losses a user may have measured.

DrSOKane avatar Oct 19 '25 16:10 DrSOKane