PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

Ensure stress-induced diffusion is only enabled on electrodes that have particle mechanics

Open DrSOKane opened this issue 8 months ago • 3 comments

Description

If particle mechanics is enabled on one electrode, stress-induced diffusion is enabled on both by default. I added some code to base_battery_model to catch most instances where this might happen.

Fixes #4943

DrSOKane avatar Mar 31 '25 11:03 DrSOKane

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.70%. Comparing base (2e38ac4) to head (9cf0213). Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...m/models/full_battery_models/base_battery_model.py 66.66% 2 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4944      +/-   ##
===========================================
- Coverage    98.71%   98.70%   -0.01%     
===========================================
  Files          304      304              
  Lines        23478    23484       +6     
===========================================
+ Hits         23176    23180       +4     
- Misses         302      304       +2     

: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 Mar 31 '25 11:03 codecov[bot]

My opinion is that we should remove all of these default options that change based on other options and instead users should explicitly choose all the options they want. If any options require other options to be enabled then we should catch that and raise an error. This would be breaking, but I think options silently changing has a lot of potential to introduce error.

rtimms avatar Mar 31 '25 13:03 rtimms

My opinion is that we should remove all of these default options that change based on other options and instead users should explicitly choose all the options they want. If any options require other options to be enabled then we should catch that and raise an error. This would be breaking, but I think options silently changing has a lot of potential to introduce error.

I agree, it's always bugged me that stress automatically turns on stress-enhanced diffusion. I think most parameterizations are done assuming that this isn't true, so I don't think it should be the default.

aabills avatar Mar 31 '25 22:03 aabills