Solver Error when ionic conductivity < 0.05 S/m in custom model #5043
Unanswered
AtishaySinghai
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm encountering a SolverError when running a custom PyBaMM model with ionic conductivity set below 0.05 S/m. The solver fails to find a consistent state during experiment initialization.
Here, is the code. Can anyone help
import pybamm
class BaseModel(pybamm.BaseBatteryModel):
"""
Overwrites default parameters from Base Model with default parameters for
lithium-ion models
class BasicDFN(BaseModel):
"""Doyle-Fuller-Newman (DFN) model of a lithium-ion battery, from
:footcite:t:
Marquis2019
.model =BasicDFN()
param = pybamm.ParameterValues("Chen2020")
import numpy as np
def a(sto):
u_eq = (
13.4905 - 10.96038 * sto +
8.203617 * sto1.358699 -
3.10758e-6 * np.exp(127.1216 * sto - 114.2593) -
7.033556 * sto(-0.03362749)
)
def b(sto):
def c(c_e, c_s_surf, c_s_max, T):
m_ref = 6 * 10 ** (-7) # (A/m2)(m3/mol)**1.5 - includes ref concentrations
E_r = 39570
arrhenius = np.exp(E_r / pybamm.constants.R * (1 / 298.15 - 1 / T))
def d(c_e, c_s_surf, c_s_max, T):
m_ref = 6 * 10 ** (-7) # (A/m2)(m3/mol)**1.5 - includes ref concentrations
E_r = 39570
arrhenius = np.exp(E_r / pybamm.constants.R * (1 / 298.15 - 1 / T))
param.update(
{
"Negative electrode OCP [V]": b,
"Negative electrode exchange-current density [A.m-2]": d,
"Positive electrode OCP [V]": a,
"Positive electrode exchange-current density [A.m-2]": c,
# cell
"Separator thickness [m]": 4e-05,
"Positive electrode thickness [m]": 7e-05,
"Positive current collector thickness [m]": 1.6e-05,
"Electrode height [m]": 0.02,
"Electrode width [m]": 1,
"Cell cooling surface area [m2]": 0.00531,
"Cell volume [m3]": 2.42e-5,
"Cell thermal expansion coefficient [m.K-1]": 1.1e-06,
"Negative current collector conductivity [S.m-1]": 58411000.0,
"Maximum concentration in negative electrode [mol.m-3]": 33133.0,
"Maximum concentration in positive electrode [mol.m-3]": 52500.0,
"Positive current collector conductivity [S.m-1]": 36914000.0,
"Negative current collector density [kg.m-3]": 8960.0,
"Positive current collector density [kg.m-3]": 2700.0,
"Negative current collector specific heat capacity [J.kg-1.K-1]": 385.0,
"Positive current collector specific heat capacity [J.kg-1.K-1]": 897.0,
"Negative current collector thermal conductivity [W.m-1.K-1]": 401.0,
"Positive current collector thermal conductivity [W.m-1.K-1]": 237.0,
"Nominal cell capacity [A.h]": 1,
"Current function [A]": 0.65,
"Contact resistance [Ohm]": 0,
# negative electrode
"Negative electrode conductivity [S.m-1]": 215.0,
"Negative particle diffusivity [m2.s-1]": 3.3e-14,
"Negative electrode porosity": 0.25,
"Negative electrode active material volume fraction": 0.8,
"Negative particle radius [m]": 5.86e-06,
"Negative electrode Bruggeman coefficient (electrolyte)": 1.5,
"Negative electrode Bruggeman coefficient (electrode)": 0,
"Negative electrode charge transfer coefficient": 0.5,
"Negative electrode double-layer capacity [F.m-2]": 0.2,
"Negative electrode density [kg.m-3]": 1657.0,
"Negative electrode specific heat capacity [J.kg-1.K-1]": 700.0,
"Negative electrode thermal conductivity [W.m-1.K-1]": 1.7,
"Negative electrode OCP entropic change [V.K-1]": 0.0,
# positive electrode
"Positive electrode conductivity [S.m-1]": 0.18,
"Positive particle diffusivity [m2.s-1]": 4e-15,
"Positive electrode porosity": 0.335,
"Positive electrode active material volume fraction": 0.6,
"Positive particle radius [m]": 5e-06,
"Positive electrode Bruggeman coefficient (electrolyte)": 1.5,
"Positive electrode Bruggeman coefficient (electrode)": 0,
"Positive electrode charge transfer coefficient": 0.5,
"Positive electrode double-layer capacity [F.m-2]": 0.2,
"Positive electrode density [kg.m-3]": 3262.0,
"Positive electrode specific heat capacity [J.kg-1.K-1]": 700.0,
"Positive electrode thermal conductivity [W.m-1.K-1]": 2.1,
"Positive electrode OCP entropic change [V.K-1]": 0.0,
# separator
"Separator porosity": 0.47,
"Separator Bruggeman coefficient (electrolyte)": 1.5,
"Separator density [kg.m-3]": 397.0,
"Separator specific heat capacity [J.kg-1.K-1]": 700.0,
"Separator thermal conductivity [W.m-1.K-1]": 0.16,
# electrolyte
"Initial concentration in electrolyte [mol.m-3]": 1000.0,
"Cation transference number": 0.5,
"Thermodynamic factor": 1.0, # experiment
"Reference temperature [K]": 298.15,
"Total heat transfer coefficient [W.m-2.K-1]": 10.0,
"Ambient temperature [K]": 298.15,
"Number of electrodes connected in parallel to make a cell": 1.0,
"Number of cells connected in series to make a battery": 1.0,
"Lower voltage cut-off [V]": 1,
"Upper voltage cut-off [V]": 4,
"Open-circuit voltage at 0% SOC [V]": 1,
"Open-circuit voltage at 100% SOC [V]": 4,
"Initial concentration in negative electrode [mol.m-3]": 29866.0,
"Initial concentration in positive electrode [mol.m-3]": 0.35*52500,
"Initial temperature [K]": 298.15,
"Lower voltage cut-off [V]": 1,
"Open-circuit voltage at 0% SOC [V]": 1
}
)
experiment = pybamm.Experiment(
[
("Discharge at 1.4 A until 2.2 V")
]
)
sim = pybamm.Simulation(model, experiment=experiment, parameter_values=param)
sim.solve()
sim.plot()
Beta Was this translation helpful? Give feedback.
All reactions