Tip
An interactive online version of this notebook is available, which can be
accessed via
Alternatively, you may download this notebook and run it offline.
Simulating graded electrodes#
In this notebook we explore how to simulate the effect of graded electrodes in the performance of a battery. Graded electrodes have a composition that varies along the thickness of the electrode, typically active material volume fraction and particle size. This variation can be used to improve the performance of the battery, for example, by increasing the power density.
As usual, we start by importing PyBaMM.
[1]:
%pip install "pybamm[plot,cite]" -q # install PyBaMM if it is not installed
import pybamm
Note: you may need to restart the kernel to use updated packages.
We use the DFN model for the simulations and the Chen2020 parameter set. Note that we will need to modify the default Chen2020 parameter set to describe graded electrodes.
[2]:
model = pybamm.lithium_ion.DFN()
parameter_values = pybamm.ParameterValues("Chen2020")
We will vary the porosity in both electrodes and we will try three different scenarios: constant porosity, one where lower porosity occurs near the separator and one where lower porosity occurs near the current collector. The varying porosity is defined to be linear centered around the default value and with a variation of \(\pm\) 10%.
Porosity, active material volume fraction and inactive material (binder and conductive additive) volume fraction must add up to one at every point in the electrode, so we cannot change the porosity on its own. Here we keep the inactive material volume fraction constant, which means that the active material volume fraction has to decrease by the same amount the porosity increases, i.e. \(\epsilon_\mathrm{s}(x) = \epsilon_{\mathrm{s},0} + \epsilon_0 - \epsilon(x)\), where \(\epsilon(x)\) is the graded porosity and \(\epsilon_0\) and \(\epsilon_{\mathrm{s},0}\) are the default porosity and active material volume fraction. For Chen2020 the inactive material volume fraction is zero, so this is simply \(\epsilon_\mathrm{s} = 1 - \epsilon\). All other parameters are kept constant.
We define the varying porosities and active material volume fractions and store them in lists so we can loop over when solving the model. Note that they must be specified as functions of x, y, and z, even if y and z are not present in the model and not referred to at any other point, as in this example.
[3]:
L_n = parameter_values["Negative electrode thickness [m]"]
L_s = parameter_values["Separator thickness [m]"]
L_p = parameter_values["Positive electrode thickness [m]"]
eps_n_0 = parameter_values["Negative electrode porosity"]
eps_p_0 = parameter_values["Positive electrode porosity"]
eps_s_n_0 = parameter_values["Negative electrode active material volume fraction"]
eps_s_p_0 = parameter_values["Positive electrode active material volume fraction"]
eps_ns = [
eps_n_0,
lambda x, y, z: eps_n_0 * (1.1 - 0.2 * (x / L_n)),
lambda x, y, z: eps_n_0 * (0.9 + 0.2 * (x / L_n)),
]
eps_ps = [
eps_p_0,
lambda x, y, z: eps_p_0 * (0.9 - 0.2 / L_p * (L_n + L_s) + 0.2 * (x / L_p)),
lambda x, y, z: eps_p_0 * (1.1 + 0.2 / L_p * (L_n + L_s) - 0.2 * (x / L_p)),
]
eps_s_ns = [
eps_s_n_0,
lambda x, y, z: eps_s_n_0 + eps_n_0 - eps_ns[1](x, y, z),
lambda x, y, z: eps_s_n_0 + eps_n_0 - eps_ns[2](x, y, z),
]
eps_s_ps = [
eps_s_p_0,
lambda x, y, z: eps_s_p_0 + eps_p_0 - eps_ps[1](x, y, z),
lambda x, y, z: eps_s_p_0 + eps_p_0 - eps_ps[2](x, y, z),
]
Note that the distance through the electrode is computed from the negative electrode, so parameter need to be defined accordingly. Next, we can just solve the models for the various parameter sets. We apply a fairly high C-rate to see the effect of the graded electrodes on the discharge capacity.
[4]:
solutions = []
experiment = pybamm.Experiment(["Discharge at 3C until 2.5 V"])
for eps_n, eps_p, eps_s_n, eps_s_p in zip(
eps_ns, eps_ps, eps_s_ns, eps_s_ps, strict=False
):
parameter_values["Negative electrode porosity"] = eps_n
parameter_values["Positive electrode porosity"] = eps_p
parameter_values["Negative electrode active material volume fraction"] = eps_s_n
parameter_values["Positive electrode active material volume fraction"] = eps_s_p
sim = pybamm.Simulation(
model,
parameter_values=parameter_values,
experiment=experiment,
)
sol = sim.solve()
solutions.append(sol)
And plot the results:
[5]:
pybamm.dynamic_plot(
solutions,
labels=[
"Constant porosity",
"Low porosity at separator",
"High porosity at separator",
],
)
[5]:
<pybamm.plotting.quick_plot.QuickPlot at 0x117a56a50>
We observe that, even though the average porosity and active material volume fraction are the same for the three cases, the discharge capacity is much higher with the graded electrode where porosity is higher near the separator. This is because the higher porosity near the separator facilitates the ion transport and the better utilisation of the active material.
As a sanity check we can plot the porosity and active material volume fraction profiles for the three cases and see they match what we intended.
[6]:
pybamm.dynamic_plot(
solutions,
output_variables=[
"Negative electrode porosity",
"Positive electrode porosity",
"Negative electrode active material volume fraction",
"Positive electrode active material volume fraction",
],
labels=[
"Constant porosity",
"Low porosity at separator",
"High porosity at separator",
],
)
[6]:
<pybamm.plotting.quick_plot.QuickPlot at 0x119b2e5d0>
[7]:
pybamm.print_citations()
[1] Joel A. E. Andersson, Joris Gillis, Greg Horn, James B. Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi:10.1007/s12532-018-0139-4.
[2] Von DAG Bruggeman. Berechnung verschiedener physikalischer konstanten von heterogenen substanzen. i. dielektrizitätskonstanten und leitfähigkeiten der mischkörper aus isotropen substanzen. Annalen der physik, 416(7):636–664, 1935.
[3] Chang-Hui Chen, Ferran Brosa Planella, Kieran O'Regan, Dominika Gastol, W. Dhammika Widanage, and Emma Kendrick. Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models. Journal of The Electrochemical Society, 167(8):080534, 2020. doi:10.1149/1945-7111/ab9050.
[4] Marc Doyle, Thomas F. Fuller, and John Newman. Modeling of galvanostatic charge and discharge of the lithium/polymer/insertion cell. Journal of the Electrochemical society, 140(6):1526–1533, 1993. doi:10.1149/1.2221597.
[5] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.
[6] Alan C. Hindmarsh. The PVODE and IDA algorithms. Technical Report, Lawrence Livermore National Lab., CA (US), 2000. doi:10.2172/802599.
[7] Alan C. Hindmarsh, Peter N. Brown, Keith E. Grant, Steven L. Lee, Radu Serban, Dan E. Shumaker, and Carol S. Woodward. SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers. ACM Transactions on Mathematical Software (TOMS), 31(3):363–396, 2005. doi:10.1145/1089014.1089020.
[8] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). Journal of Open Research Software, 9(1):14, 2021. doi:10.5334/jors.309.
[ ]: