Skip to content

Commit

Permalink
Merge pull request #1444 from DrSOKane/LithiumPlating
Browse files Browse the repository at this point in the history
Lithium plating
  • Loading branch information
valentinsulzer authored Mar 26, 2021
2 parents 42486f8 + 5cecb0a commit 64c6aad
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 88 deletions.
78 changes: 14 additions & 64 deletions examples/notebooks/lithium-plating.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Name [units],Value,Reference,Notes
,,,
# Lithium plating parameters,,,
Lithium metal partial molar volume [m3.mol-1],1.30E-05,Yang2017,
Lithium plating kinetic rate constant [m.s-1],1E-10,,
Exchange-current density for plating [A.m-2],[function]plating_exchange_current_density_OKane2020,,
Exchange-current density for stripping [A.m-2],[function]stripping_exchange_current_density_OKane2020,,
Initial plated lithium concentration [mol.m-3],0.00E+00,,
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pybamm import constants
from pybamm import constants, Parameter


def plating_exchange_current_density_OKane2020(c_e, c_Li, T):
Expand All @@ -24,6 +24,6 @@ def plating_exchange_current_density_OKane2020(c_e, c_Li, T):
Exchange-current density [A.m-2]
"""

k_plating = 1e-10
k_plating = Parameter("Lithium plating kinetic rate constant [m.s-1]")

return constants.F * k_plating * c_e
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pybamm import constants
from pybamm import constants, Parameter


def stripping_exchange_current_density_OKane2020(c_e, c_Li, T):
Expand Down Expand Up @@ -30,6 +30,6 @@ def stripping_exchange_current_density_OKane2020(c_e, c_Li, T):
Exchange-current density [A.m-2]
"""

k_plating = 1e-10
k_plating = Parameter("Lithium plating kinetic rate constant [m.s-1]")

return constants.F * k_plating * c_Li
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,19 @@ def get_fundamental_variables(self):

def get_coupled_variables(self, variables):
param = self.param
phi_s_n = variables[f"{self.domain} electrode potential"]
phi_e_n = variables[f"{self.domain} electrolyte potential"]
delta_phi = variables[f"{self.domain} electrode surface potential difference"]
c_e_n = variables[f"{self.domain} electrolyte concentration"]
T = variables[f"{self.domain} electrode temperature"]
eta_sei = variables[f"{self.domain} electrode SEI film overpotential"]
c_plated_Li = variables[
f"{self.domain} electrode lithium plating concentration"
]
j0_plating = param.j0_plating(c_e_n, c_plated_Li, T)

eta_sei = variables[f"{self.domain} electrode SEI film overpotential"]

phi_ref = param.U_n_ref / param.potential_scale

# need to revise for thermal case
eta_plating = -(delta_phi + phi_ref + eta_sei)
prefactor = 1 / (2 * (1 + self.param.Theta * T))
# j_stripping is always negative, because there is no stripping, only plating
j_stripping = -j0_plating * (
pybamm.exp(-0.5 * (phi_s_n - phi_e_n + phi_ref + eta_sei))
)
j_stripping = -j0_plating * pybamm.exp(prefactor * eta_plating)

variables.update(self._get_standard_reaction_variables(j_stripping))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def get_fundamental_variables(self):

def get_coupled_variables(self, variables):
param = self.param
phi_s_n = variables[f"{self.domain} electrode potential"]
phi_e_n = variables[f"{self.domain} electrolyte potential"]
delta_phi = variables[f"{self.domain} electrode surface potential difference"]
c_e_n = variables[f"{self.domain} electrolyte concentration"]
T = variables[f"{self.domain} electrode temperature"]
eta_sei = variables[f"{self.domain} electrode SEI film overpotential"]
Expand All @@ -50,11 +49,12 @@ def get_coupled_variables(self, variables):
j0_stripping = param.j0_stripping(c_e_n, c_plated_Li, T)
j0_plating = param.j0_plating(c_e_n, c_plated_Li, T)
phi_ref = param.U_n_ref / param.potential_scale

# need to revise for thermal case
eta_stripping = delta_phi + phi_ref + eta_sei
eta_plating = -eta_stripping
prefactor = 1 / (2 * (1 + self.param.Theta * T))
j_stripping = j0_stripping * pybamm.exp(
0.5 * (phi_s_n - phi_e_n + phi_ref + eta_sei)
) - j0_plating * pybamm.exp(-0.5 * (phi_s_n - phi_e_n + phi_ref + eta_sei))
prefactor * eta_stripping
) - j0_plating * pybamm.exp(prefactor * eta_plating)

variables.update(self._get_standard_reaction_variables(j_stripping))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def test_public_functions(self):
pybamm.Scalar(0), ["negative electrode"], "current collector"
)
variables = {
"Negative electrode potential": a_n,
"Negative electrolyte potential": a_n,
"Negative electrode surface potential difference": a_n,
"Negative electrolyte concentration": a_n,
"Negative electrode temperature": a_n,
"Negative electrode SEI film overpotential": a_n,
"Negative electrode lithium plating concentration": a_n
}
submodel = pybamm.lithium_plating.IrreversiblePlating(param, "Negative")
std_tests = tests.StandardSubModelTests(submodel, variables)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ def test_public_functions(self):
pybamm.Scalar(0), ["negative electrode"], "current collector"
)
variables = {
"Negative electrode potential": a_n,
"Negative electrode surface potential difference": a_n,
"Negative electrode temperature": a_n,
"Negative electrolyte potential": a_n,
"Negative electrolyte concentration": a_n,
"Negative electrode lithium plating concentration": a_n,
"Negative electrode SEI film overpotential": a_n,
Expand Down

0 comments on commit 64c6aad

Please sign in to comment.