"""
Isothermal model extended with lithium plating
"""
import dolfin as fem
import ufl # type: ignore
from mtnlion.formula import Formula
from mtnlion.formulas.dfn import CapacityLoss, FilmResistance, FilmThickness
from mtnlion.models.isothermal import Isothermal
from mtnlion.variable import Variable
# pylint: disable=invalid-name
[docs]class LithiumPlating(Isothermal):
"""
Lithium plating often occurs when the manufacturer-specified upper voltage on the cell is not observed, which can
cause a cell to become inoperable within a few overcharge events.
"""
def __init__(self, Ns):
super(LithiumPlating, self).__init__(Ns)
self.variables += [Variable("j_s", ["anode"]), Variable("delta_film", ["anode"]), Variable("Q", ["anode"])]
self.formulas += [
self.SideReactionFlux(),
self.SideReactionExchangeCurrentDensity(),
self.SideReactionOverpotential(),
FilmThickness(),
FilmResistance(),
CapacityLoss(),
]
[docs] class Overpotential(Formula): # Override
"""
Voltage difference between a reduction potential and the potential of the redox event.
"""
def __init__(self):
super(LithiumPlating.Overpotential, self).__init__(name="eta", domains=["anode", "cathode"])
self.Variables = self.typedef("Variables", "phi_s, phi_e, j")
self.Parameters = self.typedef("Parameters", "F, Uocp, Rfilm")
[docs] class SideReactionFlux(Formula):
"""
Describes how the electrical current on an electrode depends on the electrode potential due to the side
reaction.
"""
def __init__(self):
super(LithiumPlating.SideReactionFlux, self).__init__(domains=["anode"])
self.Variables = self.typedef("Variables", "j_s")
self.Parameters = self.typedef("Parameters", "alpha_s, F, R, T, eta_s, io_s")
[docs] class SideReactionExchangeCurrentDensity(Formula):
"""
The current in the absence of net electrolysis and at zero overpotential in the side reaction.
"""
def __init__(self):
super(LithiumPlating.SideReactionExchangeCurrentDensity, self).__init__(name="io_s", domains=["anode"])
self.Variables = self.typedef("Variables", "c_e")
self.Parameters = self.typedef("Parameters", "alpha_s, k_norm_ref")
[docs] class SideReactionOverpotential(Formula):
"""
Voltage difference between a reduction potential and the potential of the redox event in the side reaction.
"""
def __init__(self):
super(LithiumPlating.SideReactionOverpotential, self).__init__(name="eta_s", domains=["anode"])
self.Variables = self.typedef("Variables", "phi_s, phi_e, j_s")
self.Parameters = self.typedef("Parameters", "Uref_s, F, Rfilm")