Skip to content

Commit

Permalink
#834 added solvent diffusion limited growth
Browse files Browse the repository at this point in the history
  • Loading branch information
Scottmar93 committed Mar 13, 2020
1 parent 17edb36 commit b0dda1c
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 33 deletions.
54 changes: 29 additions & 25 deletions examples/scripts/sei_growth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# pb.settings.debug_mode = True

options = {"sei": "reaction limited"}
options = {"sei": "solvent-diffusion limited"}
# options = {"sei": None}
model = pb.lithium_ion.DFN(options)

Expand Down Expand Up @@ -41,27 +42,33 @@
# }
# )

parameter_values.update(
{
"Inner SEI reaction proportion": 0.5,
"Inner SEI partial molar volume [m3.mol-1]": 34.76e-6,
"Outer SEI partial molar volume [m3.mol-1]": 34.76e-6,
"SEI reaction exchange current density [A.m-2]": 1.5e-9,
"SEI resistance per unit thickness [Ohm.m-1]": 0,
"Outer SEI solvent diffusivity [m2.s-1]": 2.5e-22,
"Bulk solvent concentration [mol.m-3]": 2.636e3,
"Ratio of inner and outer SEI exchange current densities": 1,
"Inner SEI open-circuit potential [V]": 0.1,
"Outer SEI open-circuit potential [V]": 0.8,
"Inner SEI electron conducticity [S.m-1]": 8.95e-14,
"Inner SEI lithium interstitial diffusivity [m2.s-1]": 1e-15,
"Lithium interstitial reference concentration [mol.m-3]": 15,
"Initial inner SEI thickness [m]": 7.5e-9,
"Initial outer SEI thickness [m]": 7.5e-9,
}
)
# parameter_values.update(
# {
# "Inner SEI reaction proportion": 0.5,
# "Inner SEI partial molar volume [m3.mol-1]": 34.76e-7,
# "Outer SEI partial molar volume [m3.mol-1]": 34.76e-7,
# "SEI reaction exchange current density [A.m-2]": 1.5e-7,
# "SEI resistance per unit thickness [Ohm.m-1]": 1,
# "Outer SEI solvent diffusivity [m2.s-1]": 2.5e-22,
# "Bulk solvent concentration [mol.m-3]": 2.636e3,
# "Ratio of inner and outer SEI exchange current densities": 1,
# "Inner SEI open-circuit potential [V]": 0.1,
# "Outer SEI open-circuit potential [V]": 0.8,
# "Inner SEI electron conducticity [S.m-1]": 8.95e-14,
# "Inner SEI lithium interstitial diffusivity [m2.s-1]": 1e-15,
# "Lithium interstitial reference concentration [mol.m-3]": 15,
# "Initial inner SEI thickness [m]": 7.5e-9,
# "Initial outer SEI thickness [m]": 7.5e-9,
# }
# )

# parameter_values.update({"Current function [A]": 0})


def my_sin(t):
return pb.sin(0.01 * t)


parameter_values["Current function [A]"] = "[current data]US06"
parameter_values["Current function [A]"] = 0

Expand All @@ -76,10 +83,11 @@
hours = days * 24
minutes = hours * 60
seconds = minutes * 60

t_eval = np.linspace(0, seconds, 100)

# sim.solve(solver=solver)
sim.solve(solver=solver, t_eval=t_eval)
sim.solve(t_eval=t_eval, solver=solver)
# sim.solve(solver=solver, t_eval=t_eval)
sim.plot(
[
"Terminal voltage [V]",
Expand All @@ -99,9 +107,5 @@
"X-averaged negative electrode sei interfacial current density [A.m-2]",
"X-averaged negative electrode interfacial current density [A.m-2]",
],
[
"Negative electrode interfacial current density",
"Scaled negative electrode sei interfacial current density",
],
]
)
6 changes: 3 additions & 3 deletions input/parameters/lithium-ion/seis/Example/parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Name [units],Value,Reference,Notes
,,,
# SEI properties,,,
Inner SEI reaction proportion,0.5,,
Inner SEI partial molar volume [m3.mol-1],34.76e-7, Ramadass (modified in pybamm),
Outer SEI partial molar volume [m3.mol-1],34.76e-7, Ramadass (modified in pybamm),
SEI reaction exchange current density [A.m-2],1.5E-7, Ramadass (modified in pybamm),
Inner SEI partial molar volume [m3.mol-1],3e-6, Guess,
Outer SEI partial molar volume [m3.mol-1],3e-6, Guess,
SEI reaction exchange current density [A.m-2],1.5E-7, Guess,
SEI resistance per unit thickness [Ohm.m-1],1, Ramadass,
Outer SEI solvent diffusivity [m2.s-1],2.5E-22, Single paper,
Bulk solvent concentration [mol.m-3],2.636E3, Ploehn paper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ def set_sei_submodel(self):
self.param, "Negative electrode"
)

elif self.options["sei"] == "solvent-diffusion limited":
self.submodels["negative sei"] = pybamm.sei.SolventDiffusionLimited(
self.param, "Negative electrode"
)

# positive electrode
self.submodels["positive sei"] = pybamm.sei.NoSEI(
self.param, "Positive electrode"
Expand Down
3 changes: 2 additions & 1 deletion pybamm/models/submodels/sei/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .base_sei import BaseModel
from .reaction_limited import ReactionLimited
from .no_sei import NoSEI
from .reaction_limited import ReactionLimited
from .solvent_diffusion_limited import SolventDiffusionLimited
69 changes: 69 additions & 0 deletions pybamm/models/submodels/sei/solvent_diffusion_limited.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Class for solvent-diffusion limited SEI growth
#
import pybamm
from .base_sei import BaseModel


class SolventDiffusionLimited(BaseModel):
"""Base class for solvent-diffusion limited SEI growth.
Parameters
----------
param : parameter class
The parameters to use for this submodel
domain : str
The domain of the model either 'Negative' or 'Positive'
**Extends:** :class:`pybamm.particle.BaseParticle`
"""

def __init__(self, param, domain):
super().__init__(param, domain)

def get_fundamental_variables(self):
L_inner = pybamm.standard_variables.L_inner
L_outer = pybamm.standard_variables.L_outer

variables = self._get_standard_thickness_variables(L_inner, L_outer)

return variables

def get_coupled_variables(self, variables):
L_sei_outer = variables["Outer negative electrode sei thickness"]

C_sei = pybamm.sei_parameters.C_sei_solvent

j_sei = -1 / (C_sei * L_sei_outer)

alpha = 0.5
j_inner = alpha * j_sei
j_outer = (1 - alpha) * j_sei

variables.update(self._get_standard_reaction_variables(j_inner, j_outer))

return variables

def set_rhs(self, variables):
L_inner = variables["Inner " + self.domain.lower() + " sei thickness"]
L_outer = variables["Outer " + self.domain.lower() + " sei thickness"]
j_inner = variables[
"Inner " + self.domain.lower() + " sei interfacial current density"
]
j_outer = variables[
"Outer " + self.domain.lower() + " sei interfacial current density"
]

v_bar = pybamm.sei_parameters.v_bar

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

def set_initial_conditions(self, variables):
L_inner = variables["Inner " + self.domain.lower() + " sei thickness"]
L_outer = variables["Outer " + self.domain.lower() + " sei thickness"]

L_inner_0 = pybamm.sei_parameters.L_inner_0
L_outer_0 = pybamm.sei_parameters.L_outer_0

self.initial_conditions = {L_inner: L_inner_0, L_outer: L_outer_0}
12 changes: 8 additions & 4 deletions pybamm/parameters/sei_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ def alpha(m_ratio, phi_s, phi_e, U_inner, U_outer):
a_p = pybamm.standard_parameters_lithium_ion.a_p_dim
L_x = pybamm.standard_parameters_lithium_ion.L_x

I_typ = pybamm.electrical_parameters.I_typ
i_typ = pybamm.electrical_parameters.i_typ

C_sei_reaction = (
F * L_sei_0_dim / (m_sei_dimensional * tau_discharge * V_bar_inner_dimensional)
) * pybamm.exp(-(F * U_n_ref / (2 * R * T_ref)))

R_sei = F * I_typ * R_sei_dimensional * L_sei_0_dim / (a_n * L_x)
C_sei_solvent = L_sei_0_dim ** 2 / (
c_sol_dimensional * V_bar_inner_dimensional * D_sol_dimensional * tau_discharge
)

R_sei = F * i_typ * R_sei_dimensional * L_sei_0_dim / (a_n * L_x)

v_bar = V_bar_outer_dimensional / V_bar_inner_dimensional

Expand All @@ -72,9 +76,9 @@ def alpha(m_ratio, phi_s, phi_e, U_inner, U_outer):

# ratio of SEI reaction scale to intercalation reaction
Gamma_SEI_n = (F * L_sei_0_dim * a_n * L_x) / (
V_bar_inner_dimensional * I_typ * tau_discharge
V_bar_inner_dimensional * i_typ * tau_discharge
)

Gamma_SEI_p = (F * L_sei_0_dim * a_p * L_x) / (
V_bar_inner_dimensional * I_typ * tau_discharge
V_bar_inner_dimensional * i_typ * tau_discharge
)

0 comments on commit b0dda1c

Please sign in to comment.