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 19 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
Sponsor Member

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

Copy link
Sponsor 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 (e4eb82a) to head (53351c8).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4394      +/-   ##
===========================================
- Coverage    99.42%   99.38%   -0.04%     
===========================================
  Files          299      299              
  Lines        22739    22758      +19     
===========================================
+ Hits         22608    22619      +11     
- Misses         131      139       +8     

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

@brosaplanella
Copy link
Sponsor 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
Sponsor 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 brosaplanella marked this pull request as ready for review October 10, 2024 14:30
@brosaplanella
Copy link
Sponsor Member

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

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.

3 participants