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

Issue 3339 dead lithium #3485

Merged
merged 17 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Bug fixes

- The irreversible plating model now increments `f"{Domain} dead lithium concentration [mol.m-3]"`, not `f"{Domain} lithium plating concentration [mol.m-3]"` as it did previously. ([#3485](https://github.com/pybamm-team/PyBaMM/pull/3485))
- Fixed a bug where the JaxSolver would fails when using GPU support with no input parameters ([#3423](https://github.com/pybamm-team/PyBaMM/pull/3423))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Fixed a bug where the JaxSolver would fails when using GPU support with no input parameters ([#3423](https://github.com/pybamm-team/PyBaMM/pull/3423))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How is this a dupicate?

Copy link
Member

Choose a reason for hiding this comment

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

That one made it in the release, see line 29 of the CHANGELOG


# [v23.9rc0](https://github.com/pybamm-team/PyBaMM/tree/v23.9rc0) - 2023-10-31
Expand Down
32 changes: 11 additions & 21 deletions docs/source/examples/notebooks/models/lithium-plating.ipynb

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions pybamm/models/submodels/interface/lithium_plating/plating.py
Copy link
Member

Choose a reason for hiding this comment

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

I have noticed that both Plated lithium capacity and Intercalated lithium capacity have units of Ah rather than A.h (that's a legacy thing, not introduced in this issue). Could you change it to A.h so it is consistent with the other variable names?

Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,26 @@ def set_rhs(self, variables):
]
L_sei = variables[f"{Domain} total SEI thickness [m]"]

# In the partially reversible plating model, coupling term turns reversible
# lithium into dead lithium. In other plating models, it is zero.
lithium_plating_option = getattr(self.options, domain)["lithium plating"]
if lithium_plating_option == "partially reversible":
if lithium_plating_option == "reversible":
# In the reversible plating model, there is no dead lithium
dc_plated_Li = -a_j_stripping / self.param.F
dc_dead_Li = pybamm.Scalar(0)
elif lithium_plating_option == "irreversible":
# In the irreversible plating model, all plated lithium is dead lithium
dc_plated_Li = pybamm.Scalar(0)
dc_dead_Li = -a_j_stripping / self.param.F
elif lithium_plating_option == "partially reversible":
# In the partially reversible plating model, the coupling term turns
# reversible lithium into dead lithium over time.
dead_lithium_decay_rate = self.param.dead_lithium_decay_rate(L_sei)
coupling_term = dead_lithium_decay_rate * c_plated_Li
else:
coupling_term = pybamm.Scalar(0)
dc_plated_Li = -a_j_stripping / self.param.F - coupling_term
dc_dead_Li = coupling_term

self.rhs = {
c_plated_Li: -a_j_stripping / self.param.F - coupling_term,
c_dead_Li: coupling_term,
c_plated_Li: dc_plated_Li,
c_dead_Li: dc_dead_Li,
}

def set_initial_conditions(self, variables):
Expand Down
Loading