Errors in aging model + discrepancy in OKane2022 beta parameter #3505
-
Hello PyBamm Team - I am running an aging model considering all aging mechanisms. I have extended the solvent diffusivity within the SEI to be temperature dependent with the arrhenius relationship and multiplied the LAM proportionality constant (beta) by 20 at the anode and by 1 at the cathode. When I perform this setup, I get an IDAconv fail error. Below is a working example of my code: #Import necessary libraries
import pybamm
import matplotlib.pyplot as plt
import numpy as np
from os import path
import pandas as pd
from tec_reduced_model.set_parameters import (
set_thermal_parameters,
set_experiment_parameters,
set_ambient_temperature,
)
from tec_reduced_model.process_experimental_data import import_thermal_data, get_idxs
from pybamm import Parameter, constants, exp
model = pybamm.lithium_ion.DFN(options = {
"thermal":"lumped",
"dimensionality":0,
"cell geometry": "arbitrary",
"SEI": "solvent-diffusion limited",
"SEI porosity change": "true",
"particle mechanics": ("swelling and cracking", "swelling and cracking"),
"SEI on cracks": "true",
"loss of active material": "stress-driven",
"calculate discharge energy": "true",
"lithium plating": "partially reversible",
"lithium plating porosity change": "true"
},
name="TDFN",
)
param = pybamm.ParameterValues("OKane2022")
param = set_thermal_parameters(param, 16, 2.32e6, temperature)
param["Ambient temperature [K]"] = 298.15
param["Initial temperature [K]"] = 298.15
param["Negative electrode LAM constant proportional term [s-1]"] = 20*2.7778e-07
param["Positive electrode LAM constant proportional term [s-1]"] = 2.7778e-07
T = model.variables["Volume-averaged cell temperature [K]"]
def solvent_diffusivity_sei(T):
Ea = 37000
arrhenius = exp(Ea / constants.R * (1 / 298.15 - 1 / T))
return 2.5000000000000002e-22 * arrhenius
param.update({"Outer SEI solvent diffusivity [m2.s-1]": solvent_diffusivity_sei(T)})
pybamm.set_logging_level("NOTICE")
#Simple cycling experiment
N=550
cccv_experiment = pybamm.Experiment([
("Charge at 1C until 4.2V",
"Hold at 4.2V until C/20",
"Discharge at 1C until 2.5V",
"Hold at 2.5V until C/20",
)
]*N
)
#Refine mesh
var_pts = {
"x_n" : 20, # x-direction, length, negative electrode
"x_s" : 20, # x-direction, length, separator
"x_p" : 20, # x-direction, length, positive electrode
"r_n" : 30, # number of volumes in the radial direction, negative particle
"r_p" : 30 # number of volumes in the radial direction, positive particle
}
#Run model
sim = pybamm.Simulation(model, experiment=cccv_experiment,parameter_values=param, var_pts=var_pts)
sol = sim.solve(save_at_cycles= 10) It is worth noting that without multiplying beta by 20, the simulation runs just fine. I also wanted to know what the actual value of beta is? In the OKane2022 paper it is 0.001 but in the paramater set it is 2.7778e-07. When I run with 0.001, the code fails after 20 cycles with a Linear solver did not converge error. FYI, here is the error code I am getting: As you can see, it fails at 307 cycles. @DrSOKane , @tinosulzer, @brosaplanella I would be truly grateful if you can suggest anything to help fix this problem I am having with my model. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
Update: I refined the mesh to have 30 pts for x_n, x_s and x_p as well and it ran till 449 cycles. However, it then failed with the same exact error as before. Any advice/suggestions on how I can fix this? |
Beta Was this translation helpful? Give feedback.
-
Hi @MirAbbasAli2A, I'm pleased to see you managed to resolve the problem on your own. Now I'm here, I can give you a detailed explanation of why that solution worked. There is no point using the The crack model solves Paris' Law of fatigue crack propagation. The solution to Paris' Law is the crack length grows exponentially with time. Exponential growth poses numerical difficulties, so Paris' Law should only be solved where necessary. The |
Beta Was this translation helpful? Give feedback.
Hi @MirAbbasAli2A, I'm pleased to see you managed to resolve the problem on your own. Now I'm here, I can give you a detailed explanation of why that solution worked.
There is no point using the
"swelling and cracking"
option in the positive electrode if you're modelling degradation, because there is no SEI to grow on the crack. The option is available if you're interested in studying how the crack propagates within the positive electrode particles, but it does not affect the degradation behaviour. (It also allows SEI on cracks to be enabled in graphite half-cells, where the graphite is the positive electrode, but you don't specify it as a tuple for that case anyway, because the particles…