PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Composite porosity

Open DrSOKane opened this issue 1 year ago • 6 comments

Description

Modified reaction_driven_porosity.py so that porosity change still works for composite electrodes

Fixes # (issue)

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)

DrSOKane avatar Sep 05 '24 11:09 DrSOKane

Codecov Report

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

Project coverage is 98.66%. Comparing base (a7253b8) to head (07c6ff6). Report is 141 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4417      +/-   ##
===========================================
- Coverage    99.22%   98.66%   -0.56%     
===========================================
  Files          303      303              
  Lines        23070    23225     +155     
===========================================
+ Hits         22891    22915      +24     
- Misses         179      310     +131     

: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 Sep 05 '24 11:09 codecov[bot]

Hi Simon! The PR looks nice, just the tests need addressing. Note that once the unit tests are updated to increase coverage, it will also have the same parameter issues as the integration tests.

That's odd. My working example ran just fine 10 days ago before I went on holiday, but it's now throwing the same parameter error as the automated tests. Was there a recent change to how phase parameters are handled?

DrSOKane avatar Sep 06 '24 16:09 DrSOKane

@parkec3 has also been working on some changes to make composite electrodes compatible with more cases

valentinsulzer avatar Sep 06 '24 16:09 valentinsulzer

It looks like the degradation parameters need to be updated to be defined by phase. I'm finishing up work getting the LAM submodel compatible with composite electrodes. I had to make a custom parameter set from Chen2020 composite and Ai2020 for my own local testing. The default parameter set doesn't have those defined.

parkec3 avatar Sep 06 '24 16:09 parkec3

The SEI parameters are defined by phase, but not by domain, which was the underlying cause of the bug. I rewrote the code with if statements to cover three possibilities:

  • Both electrodes have only one phase, in which case phase_name and pref are empty strings
  • domain has only one phase, in which case phase_name is empty but pref = "Primary: "
  • domain has more than one phase, in which case phase_name and pref are different for each phase

There is still a potential error if the electrode with SEI has one phase and the other has two. This can be fixed by giving all the SEI parameter domains, but that would be a separate PR...

DrSOKane avatar Sep 07 '24 22:09 DrSOKane

UPDATE: I've simply set it so that L_sei_0 is zero if there is no SEI on that domain. Much more elegant and means the code will run in some edge cases that would have caused an error before.

DrSOKane avatar Sep 09 '24 16:09 DrSOKane

Labelled this as skip release, given that we need to wait for #3457

brosaplanella avatar Oct 30 '24 11:10 brosaplanella

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@aabills might be good for you to review this one since you've been looking at the composite code a lot recently

rtimms avatar Jan 13 '25 10:01 rtimms

@aabills might be good for you to review this one since you've been looking at the composite code a lot recently

I'm going to review this after a meeting this morning

aabills avatar Jan 13 '25 16:01 aabills