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

Composite sei #2290

Merged
merged 13 commits into from
Sep 15, 2022
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Features

- Added function `pybamm.get_git_commit_info()`, which returns information about the last git commit, useful for reproducibility ([#2293](https://github.com/pybamm-team/PyBaMM/pull/2293))
- Added SEI model for composite electrodes ([#2290](https://github.com/pybamm-team/PyBaMM/pull/2290))
- For experiments, the simulation now automatically checks and skips steps that cannot be performed (e.g. "Charge at 1C until 4.2V" from 100% SOC) ([#2212](https://github.com/pybamm-team/PyBaMM/pull/2212))

## Bug fixes
Expand Down
6 changes: 3 additions & 3 deletions examples/notebooks/models/using-submodels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@
"model.submodels[\n",
" \"Positive particle mechanics\"\n",
"] = pybamm.particle_mechanics.NoMechanics(model.param, \"Positive\", model.options)\n",
"model.submodels[\"sei\"] = pybamm.sei.NoSEI(model.param)\n",
"model.submodels[\"sei on cracks\"] = pybamm.sei.NoSEI(model.param, cracks=True)\n",
"model.submodels[\"sei\"] = pybamm.sei.NoSEI(model.param, model.options)\n",
"model.submodels[\"sei on cracks\"] = pybamm.sei.NoSEI(model.param, model.options, cracks=True)\n",
"model.submodels[\"lithium plating\"] = pybamm.lithium_plating.NoPlating(model.param)"
]
},
Expand Down Expand Up @@ -632,7 +632,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.13"
},
"toc": {
"base_numbering": 1,
Expand Down
6 changes: 4 additions & 2 deletions examples/scripts/custom_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@
model.submodels["Positive particle mechanics"] = pybamm.particle_mechanics.NoMechanics(
model.param, "Positive", model.options
)
model.submodels["sei"] = pybamm.sei.NoSEI(model.param)
model.submodels["sei on cracks"] = pybamm.sei.NoSEI(model.param, cracks=True)
model.submodels["sei"] = pybamm.sei.NoSEI(model.param, model.options)
model.submodels["sei on cracks"] = pybamm.sei.NoSEI(
model.param, model.options, cracks=True
)
model.submodels["lithium plating"] = pybamm.lithium_plating.NoPlating(model.param)

# build model
Expand Down
2 changes: 1 addition & 1 deletion pybamm/input/discharge_data/Ecker2015/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Experimental data (Time [s], Terminal voltage [V]) for a 1C and 5C constant current discharge of a Kokam SLPB 75106100 cell at a temperature of 25°C from

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.

The data were collected from Figure 8 of

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Parameters for a Kokam SLPB 75106100 cell, from the papers

> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery I. determination of parameters." Journal of the Electrochemical Society 162.9 (2015): A1836-A1848.

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.

The tab placement parameters are taken from measurements in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

Discharge lithium-ion battery from full charge at 1C, using the initial conditions from the paper

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857..
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857..

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Parameters for a graphite negative electrode, from the papers:

> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery I. determination of parameters." Journal of the Electrochemical Society 162.9 (2015): A1836-A1848.

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.

The fits to data for the electrode and electrolyte properties are those provided
by Dr. Simon O’Kane in the paper:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Parameters for a Lithium Nickel Cobalt Oxide positive electrode, from the papers

> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery i. determination of parameters." Journal of the Electrochemical Society 162.9 (2015): A1836-A1848.

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.

The fits to data for the electrode and electrolyte properties are those provided
by Dr. Simon O’Kane in the paper:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SEI parameters

Example parameters for composite SEI on silicon/graphite. Both phases use the same values, from the paper

> Yang, X., Leng, Y., Zhang, G., Ge, S., Wang, C. (2017). Modeling of lithium plating induced aging of lithium-ion batteries: Transition from linear to nonlinear aging. Journal of Power Sources, 360, 28-40.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Name [units],Value,Reference,Notes
# Empty rows and rows starting with ‘#’ will be ignored,,,
,,,
# SEI properties,,,
Primary: Ratio of lithium moles to SEI moles,2,,Assume SEI made of LEDC and/or Li2CO3
Primary: Inner SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper,
Primary: Outer SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper,
Primary: SEI resistivity [Ohm.m],2e5, Safari paper,
Primary: Initial inner SEI thickness [m], 2.5E-9, 2.5E-9 1/2 of initial thickness in Safari paper,
Primary: Initial outer SEI thickness [m], 2.5E-9, 1/2 of initial thickness in Safari paper,
Primary: EC initial concentration in electrolyte [mol.m-3], 4.541E3, Safari paper,
Primary: EC diffusivity [m2.s-1], 2E-18, adjusted parameter in Yang paper,
Primary: SEI kinetic rate constant [m.s-1], 1e-12, adjusted parameter in Yang paper,
Primary: SEI open-circuit potential [V], 0.4, Safari paper,
Primary: SEI growth activation energy [J.mol-1], 0,,
,,,
Secondary: Ratio of lithium moles to SEI moles,2,,Assume SEI made of LEDC and/or Li2CO3
Secondary: Inner SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper,
Secondary: Outer SEI partial molar volume [m3.mol-1],9.585e-5, Safari paper,
Secondary: SEI resistivity [Ohm.m],2e5, Safari paper,
Secondary: Initial inner SEI thickness [m], 2.5E-9, 2.5E-9 1/2 of initial thickness in Safari paper,
Secondary: Initial outer SEI thickness [m], 2.5E-9, 1/2 of initial thickness in Safari paper,
Secondary: EC initial concentration in electrolyte [mol.m-3], 4.541E3, Safari paper,
Secondary: EC diffusivity [m2.s-1], 2E-18, adjusted parameter in Yang paper,
Secondary: SEI kinetic rate constant [m.s-1], 1e-12, adjusted parameter in Yang paper,
Secondary: SEI open-circuit potential [V], 0.4, Safari paper,
Secondary: SEI growth activation energy [J.mol-1], 0,,
,,,
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Parameters for the separator from the papers

> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery i. determination of parameters." Journal of the Electrochemical Society 162.9 (2015): A1836-A1848.

>Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.
> Ecker, Madeleine, et al. "Parameterization of a physico-chemical model of a lithium-ion battery II. Model validation." Journal of The Electrochemical Society 162.9 (2015): A1849-A1857.

The thermal material properties are for a 5 Ah power pouch cell by Kokam. The data are extracted from

Expand Down
9 changes: 5 additions & 4 deletions pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ def __init__(self, extra_options):
options["surface form"] != "false"
and options["particle size"] == "single"
and options["particle"] == "Fickian diffusion"
and options["SEI"] == "none"
and options["particle mechanics"] == "none"
and options["loss of active material"] == "none"
and options["lithium plating"] == "none"
Expand All @@ -519,7 +518,7 @@ def __init__(self, extra_options):
"If there are multiple particle phases: 'surface form' cannot be "
"'false', 'particle size' must be 'false', 'particle' must be "
"'Fickian diffusion'. Also the following must "
"be 'none': 'SEI', 'particle mechanics', "
"be 'none': 'particle mechanics', "
"'loss of active material', 'lithium plating'"
)

Expand Down Expand Up @@ -1256,8 +1255,10 @@ def set_voltage_variables(self):
eta_sei_av = self.variables["SEI film overpotential"]
eta_sei_av_dim = self.variables["SEI film overpotential [V]"]
else:
eta_sei_av = self.variables["X-averaged SEI film overpotential"]
eta_sei_av_dim = self.variables["X-averaged SEI film overpotential [V]"]
eta_sei_av = self.variables[f"X-averaged {phase_n}SEI film overpotential"]
eta_sei_av_dim = self.variables[
f"X-averaged {phase_n}SEI film overpotential [V]"
]

# TODO: add current collector losses to the voltage in 3D

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def set_active_material_submodel(self):

def set_sei_submodel(self):

self.submodels["sei"] = pybamm.sei.NoSEI(self.param)
self.submodels["sei"] = pybamm.sei.NoSEI(self.param, self.options)

def set_lithium_plating_submodel(self):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,28 +269,38 @@ def set_sei_submodel(self):
else:
reaction_loc = "full electrode"

if self.options["SEI"] == "none":
self.submodels["sei"] = pybamm.sei.NoSEI(self.param, self.options)
elif self.options["SEI"] == "constant":
self.submodels["sei"] = pybamm.sei.ConstantSEI(self.param, self.options)
else:
self.submodels["sei"] = pybamm.sei.SEIGrowth(
self.param, reaction_loc, self.options, cracks=False
)
# Do not set "sei on cracks" submodel for half-cells
# For full cells, "sei on cracks" submodel must be set, even if it is zero
if reaction_loc != "interface":
if (
self.options["SEI"] in ["none", "constant"]
or self.options["SEI on cracks"] == "false"
):
self.submodels["sei on cracks"] = pybamm.sei.NoSEI(
self.param, self.options, cracks=True
)
phases = self.options.phases["negative"]
for phase in phases:
if self.options["SEI"] == "none":
submodel = pybamm.sei.NoSEI(self.param, self.options, phase)
elif self.options["SEI"] == "constant":
submodel = pybamm.sei.ConstantSEI(self.param, self.options, phase)
else:
self.submodels["sei on cracks"] = pybamm.sei.SEIGrowth(
self.param, reaction_loc, self.options, cracks=True
submodel = pybamm.sei.SEIGrowth(
self.param, reaction_loc, self.options, phase, cracks=False
)
self.submodels[f"{phase} sei"] = submodel
# Do not set "sei on cracks" submodel for half-cells
# For full cells, "sei on cracks" submodel must be set, even if it is zero
if reaction_loc != "interface":
if (
self.options["SEI"] in ["none", "constant"]
or self.options["SEI on cracks"] == "false"
):
submodel = pybamm.sei.NoSEI(
self.param, self.options, phase, cracks=True
)
else:
submodel = pybamm.sei.SEIGrowth(
self.param, reaction_loc, self.options, phase, cracks=True
)
self.submodels[f"{phase} sei on cracks"] = submodel

if len(phases) > 1:
self.submodels["total sei"] = pybamm.sei.TotalSEI(self.param, self.options)
self.submodels["total sei on cracks"] = pybamm.sei.TotalSEI(
self.param, self.options, cracks=True
)

def set_lithium_plating_submodel(self):
if self.options["lithium plating"] == "none":
Expand Down
14 changes: 8 additions & 6 deletions pybamm/models/full_battery_models/lithium_ion/dfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,19 @@ def set_convection_submodel(self):
def set_intercalation_kinetics_submodel(self):
for domain in ["negative", "positive"]:
intercalation_kinetics = self.get_intercalation_kinetics(domain)
for phase in self.options.phases[domain]:
phases = self.options.phases[domain]
for phase in phases:
submod = intercalation_kinetics(
self.param, domain, "lithium-ion main", self.options, phase
)
self.submodels[f"{domain.lower()} {phase} interface"] = submod

self.submodels[
f"total {domain} interface"
] = pybamm.kinetics.TotalMainKinetics(
self.param, domain, "lithium-ion main", self.options
)
if len(phases) > 1:
self.submodels[
f"total {domain} interface"
] = pybamm.kinetics.TotalMainKinetics(
self.param, domain, "lithium-ion main", self.options
)

def set_particle_submodel(self):
for domain in ["negative", "positive"]:
Expand Down
14 changes: 8 additions & 6 deletions pybamm/models/full_battery_models/lithium_ion/spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ def set_intercalation_kinetics_submodel(self):
)
else:
intercalation_kinetics = self.get_intercalation_kinetics(domain)
for phase in self.options.phases[domain]:
phases = self.options.phases[domain]
for phase in phases:
submod = intercalation_kinetics(
self.param, domain, "lithium-ion main", self.options, phase
)
self.submodels[f"{domain} {phase} interface"] = submod
self.submodels[
f"total {domain} interface"
] = pybamm.kinetics.TotalMainKinetics(
self.param, domain, "lithium-ion main", self.options
)
if len(phases) > 1:
self.submodels[
f"total {domain} interface"
] = pybamm.kinetics.TotalMainKinetics(
self.param, domain, "lithium-ion main", self.options
)

def set_particle_submodel(self):
for domain in ["negative", "positive"]:
Expand Down
29 changes: 0 additions & 29 deletions pybamm/models/standard_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,35 +199,6 @@ def __init__(self):
)
self.T_vol_av = pybamm.Variable("Volume-averaged cell temperature")

# SEI variables
self.L_inner_av = pybamm.Variable(
"X-averaged inner SEI thickness",
domain="current collector",
)
self.L_inner = pybamm.Variable(
"Inner SEI thickness",
domain=["negative electrode"],
auxiliary_domains={"secondary": "current collector"},
)
self.L_outer_av = pybamm.Variable(
"X-averaged outer SEI thickness",
domain="current collector",
)
self.L_outer = pybamm.Variable(
"Outer SEI thickness",
domain=["negative electrode"],
auxiliary_domains={"secondary": "current collector"},
)
# For SEI reaction at the li metal/separator interface in a li metal model
self.L_inner_interface = pybamm.Variable(
"Inner SEI thickness",
domain=["current collector"],
)
self.L_outer_interface = pybamm.Variable(
"Outer SEI thickness",
domain=["current collector"],
)

# Interface utilisation
self.u_n = pybamm.Variable(
"Negative electrode interface utilisation",
Expand Down
52 changes: 13 additions & 39 deletions pybamm/models/submodels/active_material/total_active_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,25 @@ def get_coupled_variables(self, variables):
domain = Domain.lower()

phases = self.options.phases[domain]
eps_solid = sum(
variables[f"{Domain} electrode {phase} active material volume fraction"]
for phase in phases
)
eps_solid_av = sum(
variables[
f"X-averaged {domain} electrode {phase} active material volume fraction"
]
for phase in phases
)
variables.update(
{
f"{Domain} electrode active material volume fraction": eps_solid,
f"X-averaged {domain} electrode active material volume fraction"
"": eps_solid_av,
}
)
# For each of the variables, the variable name without the phase name
# is constructed by summing all of the variable names with the phases
for variable_template in [
valentinsulzer marked this conversation as resolved.
Show resolved Hide resolved
f"{Domain} electrode {{}}active material volume fraction",
f"X-averaged {domain} electrode {{}}active material volume fraction",
f"{Domain} electrode {{}}active material volume fraction change",
f"X-averaged {domain} electrode {{}}active material volume fraction change",
]:
sumvar = sum(
variables[variable_template.format(phase + " ")] for phase in phases
)
variables[variable_template.format("")] = sumvar

if self.options["particle shape"] != "no particles":
# capacity doesn't fit the template so needs to be done separately
C = sum(
variables[f"{Domain} electrode {phase} phase capacity [A.h]"]
for phase in phases
)
variables.update({f"{Domain} electrode capacity [A.h]": C})

deps_solid_dt = sum(
variables[
f"{Domain} electrode {phase} active material volume fraction change"
]
for phase in phases
)
deps_solid_dt_av = sum(
variables[
f"X-averaged {domain} electrode {phase} active material "
"volume fraction change"
]
for phase in phases
)
variables.update(
{
f"{Domain} electrode active material volume fraction change"
"": deps_solid_dt,
f"X-averaged {domain} electrode active material volume fraction change"
"": deps_solid_dt_av,
}
)

return variables
Loading