Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I3769 kolzenberg2020 (Another option for the SEI growth) #4394

Draft
wants to merge 42 commits into
base: develop
Choose a base branch
from

Conversation

kawaMANMI
Copy link
Contributor

@kawaMANMI kawaMANMI commented Aug 29, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Another option for the SEI gowth has been added based on teh model of von Kolzenberg et al.
spefically equation (19) has been implemented. Tunilening distance and lithoum ion conductivity in teh SEI as parameters need to be defined here is example to run a case

import pybamm
import numpy as np
import matplotlib.pyplot as plt


no_cycles = 1
exp = pybamm.Experiment(
    [("Charge at C/10 until 4.2 V",
      "Rest for 5 hours",
      "Discharge at C/10 until 2.5 V",
      "Rest for 5 hours",
      )]* no_cycles )

param=pybamm.ParameterValues("Chen2020")
param.update({
  'tunneling distance for electrons [m]': 4e-9,
  'SEI lithium ion conductivity [S.m-1]': 1.0e-3,}, check_already_exists=False) 


sei_option = "Kolzenberg2020"
model = pybamm.lithium_ion.SPM({"particle": "uniform profile",
                                  "SEI": sei_option}) 
solver = pybamm.CasadiSolver(mode="safe")
sim = pybamm.Simulation(model, parameter_values=param,
                          experiment=exp, solver=solver) 
sol = sim.solve(initial_soc=0) 
plt.plot(sol["Time [h]"].entries, sol["X-averaged negative total SEI thickness [m]"].entries)

Fixes # (issue) #3769

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 (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)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • 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

@brosaplanella
Copy link
Member

Great, thanks @kawaMANMI! Will take a look later :)

Copy link
Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kawa! Nice work, getting there. I have made some suggestions, including one that will hopefully make tests pass. We can address coverage once tests pass.

.gitignore Outdated Show resolved Hide resolved
src/pybamm/CITATIONS.bib Outdated Show resolved Hide resolved
src/pybamm/models/submodels/interface/sei/sei_growth.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.38%. Comparing base (e52a406) to head (fe824df).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4394      +/-   ##
===========================================
- Coverage    99.42%   99.38%   -0.04%     
===========================================
  Files          299      299              
  Lines        22717    22668      -49     
===========================================
- Hits         22586    22529      -57     
- Misses         131      139       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brosaplanella
Copy link
Member

Hi Kawa! The tests pass now, well done. The last thing is to improve the coverage. You can see which lines need tests in Codecov. Basically, you want to add some tests to base_lithium_ion_tests.py (in the unit tests folder), around line 283 (you can copy some of the previous tests and add the new model options you created. Similarly, on the base_lithium_ion_tests.py in the integration tests folder. You will also need to test the citations, see test_citations.py. Note you didn't register a citation for the tunnelling model, it would be good to do so.

@brosaplanella brosaplanella mentioned this pull request Sep 26, 2024
8 tasks
@agriyakhetarpal agriyakhetarpal changed the title I3769 kolzenberg2020 (Another option for the SEI gowth) I3769 kolzenberg2020 (Another option for the SEI growth) Oct 4, 2024
@brosaplanella
Copy link
Member

@pipliggins the integration failing test (test_DFN.py, in particular the test_sei_VonKolzenberg2020 is failing because the Sign symbol does not have a _from_json method. I am happy to skip the output tests for this one, but I wanted to check first if that is an easy fix.

@brosaplanella
Copy link
Member

Apologies, marked it as ready by accident. Need to wait for #4470 to be merged first.

@pipliggins
Copy link
Contributor

@pipliggins the integration failing test (test_DFN.py, in particular the test_sei_VonKolzenberg2020 is failing because the Sign symbol does not have a _from_json method. I am happy to skip the output tests for this one, but I wanted to check first if that is an easy fix.

@brosaplanella Sorry it took a while to get to this - Sign doesn't have a _from_json method because my understanding was that all Sign classes should be converted to scalar/array values after discretisation (and as only discretised models can be serialised, there was no need for the function). I'm taking a look to see why that doesn't seem to be happening here, but if that assumption was just incorrect it should be a relatively quick fix to implement the method. Alternatively can be left as-is if the logic operation introduced in bfab8a0 is sufficient.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@brosaplanella
Copy link
Member

This PR includes the changes in #4470 so that one needs merging before this one can be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants