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

#1489 add surface area to volume ratio factor #1790

Merged
merged 4 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Features

- Half-cell SPM and SPMe have been implemented ( [#1731](https://github.com/pybamm-team/PyBaMM/pull/1731))
- Added surface area to volume ratio as a factor to the SEI equations ([#1790](https://github.com/pybamm-team/PyBaMM/pull/1790))
- Half-cell SPM and SPMe have been implemented ([#1731](https://github.com/pybamm-team/PyBaMM/pull/1731))

## Bug fixes

- Fixed `sympy` operators for `Arctan` and `Exponential` ([#1786](https://github.com/pybamm-team/PyBaMM/pull/1786))
Expand All @@ -11,6 +13,7 @@
## Breaking changes

- Raise error if `Concatenation` is used directly with `Variable` objects (`concatenation` should be used instead) ([#1789](https://github.com/pybamm-team/PyBaMM/pull/1789))

# [v21.10](https://github.com/pybamm-team/PyBaMM/tree/v21.9) - 2021-10-31

## Features
Expand Down
12 changes: 9 additions & 3 deletions examples/scripts/compare_lithium_ion_half_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@

# load models
models = [
pybamm.lithium_ion.SPM({"working electrode": "positive"}),
pybamm.lithium_ion.SPMe({"working electrode": "positive"}),
pybamm.lithium_ion.DFN({"working electrode": "positive"}),
pybamm.lithium_ion.SPM(
{"working electrode": "positive", "SEI": "ec reaction limited"}
),
pybamm.lithium_ion.SPMe(
{"working electrode": "positive", "SEI": "ec reaction limited"}
),
pybamm.lithium_ion.DFN(
{"working electrode": "positive", "SEI": "ec reaction limited"}
),
]

chemistry = pybamm.parameter_sets.Xu2019
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ def set_rhs(self, variables):
j_stripping = variables[
"X-averaged lithium plating interfacial current density"
]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
c_plated_Li = variables["Lithium plating concentration"]
j_stripping = variables["Lithium plating interfacial current density"]
a = variables["Negative electrode surface area to volume ratio"]

Gamma_plating = self.param.Gamma_plating
self.rhs = {c_plated_Li: -Gamma_plating * j_stripping}

self.rhs = {c_plated_Li: -Gamma_plating * a * j_stripping}

def set_initial_conditions(self, variables):
if self.x_average is True:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ def set_rhs(self, variables):
j_stripping = variables[
"X-averaged lithium plating interfacial current density"
]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
c_plated_Li = variables["Lithium plating concentration"]
j_stripping = variables["Lithium plating interfacial current density"]
a = variables["Negative electrode surface area to volume ratio"]

Gamma_plating = self.param.Gamma_plating
self.rhs = {c_plated_Li: -Gamma_plating * j_stripping}

self.rhs = {c_plated_Li: -Gamma_plating * a * j_stripping}

def set_initial_conditions(self, variables):
if self.x_average is True:
Expand Down
9 changes: 8 additions & 1 deletion pybamm/models/submodels/interface/sei/ec_reaction_limited.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,20 @@ def set_rhs(self, variables):
if self.reaction_loc == "x-average":
L_sei = variables["X-averaged outer SEI thickness"]
j_sei = variables["X-averaged outer SEI interfacial current density"]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
L_sei = variables["Outer SEI thickness"]
j_sei = variables["Outer SEI interfacial current density"]
if self.reaction_loc == "interface":
a = 1
else:
a = variables["Negative electrode surface area to volume ratio"]

Gamma_SEI = self.param.Gamma_SEI

self.rhs = {L_sei: -Gamma_SEI * j_sei / 2}
self.rhs = {L_sei: -Gamma_SEI * a * j_sei / 2}

def set_initial_conditions(self, variables):
if self.reaction_loc == "x-average":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,25 @@ def set_rhs(self, variables):
L_outer = variables["X-averaged outer SEI thickness"]
j_inner = variables["X-averaged inner SEI interfacial current density"]
j_outer = variables["X-averaged outer SEI interfacial current density"]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
L_inner = variables["Inner SEI thickness"]
L_outer = variables["Outer SEI thickness"]
j_inner = variables["Inner SEI interfacial current density"]
j_outer = variables["Outer SEI interfacial current density"]
if self.reaction_loc == "interface":
a = 1
else:
a = variables["Negative electrode surface area to volume ratio"]

v_bar = self.param.v_bar
Gamma_SEI = self.param.Gamma_SEI

self.rhs = {
L_inner: -Gamma_SEI * j_inner,
L_outer: -v_bar * Gamma_SEI * j_outer,
L_inner: -Gamma_SEI * a * j_inner,
L_outer: -v_bar * Gamma_SEI * a * j_outer,
}

def set_initial_conditions(self, variables):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,25 @@ def set_rhs(self, variables):
L_outer = variables["X-averaged outer SEI thickness"]
j_inner = variables["X-averaged inner SEI interfacial current density"]
j_outer = variables["X-averaged outer SEI interfacial current density"]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
L_inner = variables["Inner SEI thickness"]
L_outer = variables["Outer SEI thickness"]
j_inner = variables["Inner SEI interfacial current density"]
j_outer = variables["Outer SEI interfacial current density"]
if self.reaction_loc == "interface":
a = 1
else:
a = variables["Negative electrode surface area to volume ratio"]

v_bar = self.param.v_bar

Gamma_SEI = self.param.Gamma_SEI

self.rhs = {
L_inner: -Gamma_SEI * j_inner,
L_outer: -v_bar * Gamma_SEI * j_outer,
L_inner: -Gamma_SEI * a * j_inner,
L_outer: -v_bar * Gamma_SEI * a * j_outer,
}

def set_initial_conditions(self, variables):
Expand Down
11 changes: 9 additions & 2 deletions pybamm/models/submodels/interface/sei/reaction_limited.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,25 @@ def set_rhs(self, variables):
L_outer = variables["X-averaged outer SEI thickness"]
j_inner = variables["X-averaged inner SEI interfacial current density"]
j_outer = variables["X-averaged outer SEI interfacial current density"]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
L_inner = variables["Inner SEI thickness"]
L_outer = variables["Outer SEI thickness"]
j_inner = variables["Inner SEI interfacial current density"]
j_outer = variables["Outer SEI interfacial current density"]
if self.reaction_loc == "interface":
a = 1
else:
a = variables["Negative electrode surface area to volume ratio"]

v_bar = self.param.v_bar
Gamma_SEI = self.param.Gamma_SEI

self.rhs = {
L_inner: -Gamma_SEI * j_inner,
L_outer: -v_bar * Gamma_SEI * j_outer,
L_inner: -Gamma_SEI * a * j_inner,
L_outer: -v_bar * Gamma_SEI * a * j_outer,
}

def set_initial_conditions(self, variables):
Expand Down
13 changes: 10 additions & 3 deletions pybamm/models/submodels/interface/sei/solvent_diffusion_limited.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,25 @@ def set_rhs(self, variables):
L_outer = variables["X-averaged outer SEI thickness"]
j_inner = variables["X-averaged inner SEI interfacial current density"]
j_outer = variables["X-averaged outer SEI interfacial current density"]
# Note a is dimensionless (has a constant value of 1 if the surface
# area does not change)
a = variables["X-averaged negative electrode surface area to volume ratio"]
else:
L_inner = variables["Inner SEI thickness"]
L_outer = variables["Outer SEI thickness"]
j_inner = variables["Inner SEI interfacial current density"]
j_outer = variables["Outer SEI interfacial current density"]
v_bar = self.param.v_bar
if self.reaction_loc == "interface":
a = 1
else:
a = variables["Negative electrode surface area to volume ratio"]

v_bar = self.param.v_bar
Gamma_SEI = self.param.Gamma_SEI

self.rhs = {
L_inner: -Gamma_SEI * j_inner,
L_outer: -v_bar * Gamma_SEI * j_outer,
L_inner: -Gamma_SEI * a * j_inner,
L_outer: -v_bar * Gamma_SEI * a * j_outer,
}

def set_initial_conditions(self, variables):
Expand Down