Skip to content

Commit

Permalink
Merge pull request pybamm-team#1073 from pybamm-team/issue-836-add-li…
Browse files Browse the repository at this point in the history
…thium-plating

Issue 836 add lithium plating
  • Loading branch information
valentinsulzer authored Jun 24, 2020
2 parents 7da7414 + 64f89ba commit cc5d9f1
Show file tree
Hide file tree
Showing 72 changed files with 1,131 additions and 229 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Added some new solvers for algebraic models ([#1059](https://github.com/pybamm-team/PyBaMM/pull/1059))
- Added `length_scales` attribute to models ([#1058](https://github.com/pybamm-team/PyBaMM/pull/1058))
- Added averaging in secondary dimensions ([#1057](https://github.com/pybamm-team/PyBaMM/pull/1057))
- Added SEI reaction based on Yang et. al. 2017 and reduction in porosity ([#1009](https://github.com/pybamm-team/PyBaMM/issues/1009))

## Optimizations

Expand Down
3 changes: 3 additions & 0 deletions docs/source/models/submodels/interface/sei.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ SEI models
:members:

.. autoclass:: pybamm.sei.SolventDiffusionLimited
:members:

.. autoclass:: pybamm.sei.EcReactionLimited
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm"
Expand Down Expand Up @@ -93,12 +101,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2237d34280454f28ba40140a92f7504d",
"model_id": "4a4e0be8318b453ea00394c0f5dbdea5",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=3599.9999999999995, step=35.99999999999999),"
"interactive(children=(FloatSlider(value=0.0, description='t', max=1.0, step=0.01), Output()), _dom_classes=('w"
]
},
"metadata": {},
Expand Down Expand Up @@ -201,12 +209,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cbf8ad0de78e47f982f27d1e7e64c9c3",
"model_id": "fb29cf7606614252a6a459832fc76c6a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(FloatSlider(value=0.0, description='t', max=1747.0357219251337, step=17.470357219251337)…"
"interactive(children=(FloatSlider(value=0.0, description='t', max=1747.0357219251334, step=17.470357219251333)…"
]
},
"metadata": {},
Expand Down Expand Up @@ -254,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -265,22 +273,26 @@
" 'Bulk solvent concentration [mol.m-3]': 2636.0,\n",
" 'Cation transference number': 0.4,\n",
" 'Cell capacity [A.h]': 0.680616,\n",
" 'Cell cooling surface area [m2]': 0.0569,\n",
" 'Cell volume [m3]': 7.8e-06,\n",
" 'Current function [A]': 1.36,\n",
" 'EC diffusivity [m2.s-1]': 2e-18,\n",
" 'EC initial concentration in electrolyte [mol.m-3]': 4541.0,\n",
" 'Edge heat transfer coefficient [W.m-2.K-1]': 0.3,\n",
" 'Electrode height [m]': 0.13699999999999998,\n",
" 'Electrode width [m]': 0.207,\n",
" 'Electrolyte conductivity [S.m-1]': <function electrolyte_conductivity_Capiglia1999 at 0x7f7dd1166400>,\n",
" 'Electrolyte diffusivity [m2.s-1]': <function electrolyte_diffusivity_Capiglia1999 at 0x7f7dd1166378>,\n",
" 'Electrolyte conductivity [S.m-1]': <function electrolyte_conductivity_Capiglia1999 at 0x1334bf560>,\n",
" 'Electrolyte diffusivity [m2.s-1]': <function electrolyte_diffusivity_Capiglia1999 at 0x1334bf3b0>,\n",
" 'Initial concentration in electrolyte [mol.m-3]': 1000.0,\n",
" 'Initial concentration in negative electrode [mol.m-3]': 19986.609595075,\n",
" 'Initial concentration in positive electrode [mol.m-3]': 30730.755438556498,\n",
" 'Initial inner SEI thickness [m]': 7.5e-09,\n",
" 'Initial outer SEI thickness [m]': 7.5e-09,\n",
" 'Initial inner SEI thickness [m]': 2.5e-09,\n",
" 'Initial outer SEI thickness [m]': 2.5e-09,\n",
" 'Initial temperature [K]': 298.15,\n",
" 'Inner SEI electron conductivity [S.m-1]': 8.95e-14,\n",
" 'Inner SEI lithium interstitial diffusivity [m2.s-1]': 1.0000000000000001e-20,\n",
" 'Inner SEI open-circuit potential [V]': 0.1,\n",
" 'Inner SEI partial molar volume [m3.mol-1]': 3e-06,\n",
" 'Inner SEI partial molar volume [m3.mol-1]': 9.585e-05,\n",
" 'Inner SEI reaction proportion': 0.5,\n",
" 'Lithium interstitial reference concentration [mol.m-3]': 15.0,\n",
" 'Lower voltage cut-off [V]': 3.105,\n",
Expand All @@ -294,17 +306,17 @@
" 'Negative current collector thickness [m]': 2.5e-05,\n",
" 'Negative electrode Bruggeman coefficient (electrode)': 1.5,\n",
" 'Negative electrode Bruggeman coefficient (electrolyte)': 1.5,\n",
" 'Negative electrode OCP [V]': <function graphite_mcmb2528_ocp_Dualfoil1998 at 0x7f7dd1160d90>,\n",
" 'Negative electrode OCP entropic change [V.K-1]': <function graphite_entropic_change_Moura2016 at 0x7f7e28275d08>,\n",
" 'Negative electrode OCP [V]': <function graphite_mcmb2528_ocp_Dualfoil1998 at 0x1332dab90>,\n",
" 'Negative electrode OCP entropic change [V.K-1]': <function graphite_entropic_change_Moura2016 at 0x1332dae60>,\n",
" 'Negative electrode active material volume fraction': 0.7,\n",
" 'Negative electrode cation signed stoichiometry': -1.0,\n",
" 'Negative electrode charge transfer coefficient': 0.5,\n",
" 'Negative electrode conductivity [S.m-1]': 100.0,\n",
" 'Negative electrode density [kg.m-3]': 1657.0,\n",
" 'Negative electrode diffusivity [m2.s-1]': <function graphite_mcmb2528_diffusivity_Dualfoil1998 at 0x7f7e29bc4510>,\n",
" 'Negative electrode diffusivity [m2.s-1]': <function graphite_mcmb2528_diffusivity_Dualfoil1998 at 0x1332aa170>,\n",
" 'Negative electrode double-layer capacity [F.m-2]': 0.2,\n",
" 'Negative electrode electrons in reaction': 1.0,\n",
" 'Negative electrode exchange-current density [A.m-2]': <function graphite_electrolyte_exchange_current_density_Dualfoil1998 at 0x7f7e28275bf8>,\n",
" 'Negative electrode exchange-current density [A.m-2]': <function graphite_electrolyte_exchange_current_density_Dualfoil1998 at 0x1332dad40>,\n",
" 'Negative electrode porosity': 0.3,\n",
" 'Negative electrode specific heat capacity [J.kg-1.K-1]': 700.0,\n",
" 'Negative electrode surface area to volume ratio [m-1]': 180000.0,\n",
Expand All @@ -319,7 +331,7 @@
" 'Number of cells connected in series to make a battery': 1.0,\n",
" 'Number of electrodes connected in parallel to make a cell': 1.0,\n",
" 'Outer SEI open-circuit potential [V]': 0.8,\n",
" 'Outer SEI partial molar volume [m3.mol-1]': 3e-06,\n",
" 'Outer SEI partial molar volume [m3.mol-1]': 9.585e-05,\n",
" 'Outer SEI solvent diffusivity [m2.s-1]': 2.5000000000000002e-22,\n",
" 'Positive current collector conductivity [S.m-1]': 35500000.0,\n",
" 'Positive current collector density [kg.m-3]': 2707.0,\n",
Expand All @@ -329,17 +341,17 @@
" 'Positive current collector thickness [m]': 2.5e-05,\n",
" 'Positive electrode Bruggeman coefficient (electrode)': 1.5,\n",
" 'Positive electrode Bruggeman coefficient (electrolyte)': 1.5,\n",
" 'Positive electrode OCP [V]': <function lico2_ocp_Dualfoil1998 at 0x7f7dd11661e0>,\n",
" 'Positive electrode OCP entropic change [V.K-1]': <function lico2_entropic_change_Moura2016 at 0x7f7dd1166268>,\n",
" 'Positive electrode OCP [V]': <function lico2_ocp_Dualfoil1998 at 0x1334bf050>,\n",
" 'Positive electrode OCP entropic change [V.K-1]': <function lico2_entropic_change_Moura2016 at 0x1334bf320>,\n",
" 'Positive electrode active material volume fraction': 0.7,\n",
" 'Positive electrode cation signed stoichiometry': -1.0,\n",
" 'Positive electrode charge transfer coefficient': 0.5,\n",
" 'Positive electrode conductivity [S.m-1]': 10.0,\n",
" 'Positive electrode density [kg.m-3]': 3262.0,\n",
" 'Positive electrode diffusivity [m2.s-1]': <function lico2_diffusivity_Dualfoil1998 at 0x7f7e30e82268>,\n",
" 'Positive electrode diffusivity [m2.s-1]': <function lico2_diffusivity_Dualfoil1998 at 0x1332daf80>,\n",
" 'Positive electrode double-layer capacity [F.m-2]': 0.2,\n",
" 'Positive electrode electrons in reaction': 1.0,\n",
" 'Positive electrode exchange-current density [A.m-2]': <function lico2_electrolyte_exchange_current_density_Dualfoil1998 at 0x7f7dd1166158>,\n",
" 'Positive electrode exchange-current density [A.m-2]': <function lico2_electrolyte_exchange_current_density_Dualfoil1998 at 0x1334bf200>,\n",
" 'Positive electrode porosity': 0.3,\n",
" 'Positive electrode specific heat capacity [J.kg-1.K-1]': 700.0,\n",
" 'Positive electrode surface area to volume ratio [m-1]': 150000.0,\n",
Expand All @@ -355,21 +367,24 @@
" 'Reference OCP vs SHE in the negative electrode [V]': nan,\n",
" 'Reference OCP vs SHE in the positive electrode [V]': nan,\n",
" 'Reference temperature [K]': 298.15,\n",
" 'SEI kinetic rate constant [m.s-1]': 1e-12,\n",
" 'SEI open-circuit potential [V]': 0.4,\n",
" 'SEI reaction exchange current density [A.m-2]': 1.5e-07,\n",
" 'SEI resistivity [Ohm.m]': 1000000.0,\n",
" 'SEI resistivity [Ohm.m]': 5000000.0,\n",
" 'Separator Bruggeman coefficient (electrode)': 1.5,\n",
" 'Separator Bruggeman coefficient (electrolyte)': 1.5,\n",
" 'Separator density [kg.m-3]': 397.0,\n",
" 'Separator porosity': 1.0,\n",
" 'Separator specific heat capacity [J.kg-1.K-1]': 700.0,\n",
" 'Separator thermal conductivity [W.m-1.K-1]': 0.16,\n",
" 'Separator thickness [m]': 2.5e-05,\n",
" 'Total heat transfer coefficient [W.m-2.K-1]': 10.0,\n",
" 'Typical current [A]': 0.680616,\n",
" 'Typical electrolyte concentration [mol.m-3]': 1000.0,\n",
" 'Upper voltage cut-off [V]': 4.7}"
]
},
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -387,15 +402,16 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Electrolyte conductivity [S.m-1]\t<function electrolyte_conductivity_Capiglia1999 at 0x7f7dd1166400>\n",
"Electrolyte diffusivity [m2.s-1]\t<function electrolyte_diffusivity_Capiglia1999 at 0x7f7dd1166378>\n",
"EC initial concentration in electrolyte [mol.m-3]\t4541.0\n",
"Electrolyte conductivity [S.m-1]\t<function electrolyte_conductivity_Capiglia1999 at 0x1334bf560>\n",
"Electrolyte diffusivity [m2.s-1]\t<function electrolyte_diffusivity_Capiglia1999 at 0x1334bf3b0>\n",
"Initial concentration in electrolyte [mol.m-3]\t1000.0\n",
"Negative electrode Bruggeman coefficient (electrolyte)\t1.5\n",
"Positive electrode Bruggeman coefficient (electrolyte)\t1.5\n",
Expand Down Expand Up @@ -432,7 +448,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/models/lead-acid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"source": [
"We compare a standard porous-electrode model for lead-acid batteries with two asymptotic reductions. For a more in-depth introduction to PyBaMM models, see the [SPM notebook](./SPM.ipynb). Further details on the models can be found in [[1]](#ref)\n",
"\n",
"<a name=\"ref\">[1]</a> Sulzer, Valentin, S. Jon Chapman, Colin P. Please, David A. Howey, and Charles W. Monroe. \"Faster Lead-Acid Battery Simulations from Porous-Electrode Theory: II. Asymptotic Analysis.\" arXiv preprint arXiv:1902.01774 (2019)."
"<a name=\"ref\">[1]</a> Sulzer, V., Chapman, S. J., Please, C. P., Howey, D. A., & Monroe, C. W. (2019). “Faster Lead-Acid Battery Simulations from Porous Electrode Theory: II. Asymptotic Analysis”. Journal of The Electrochemical Society, 166(12), A2372-A2382."
]
},
{
Expand Down Expand Up @@ -430,4 +430,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
4 changes: 2 additions & 2 deletions examples/notebooks/using-model-options_thermal-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"metadata": {},
"source": [
"## References\n",
"[1] SG Marquis, V Sulzer, R Timms, CP Please and SJ Chapman. “An asymptotic derivation of a single particle model with electrolyte”. In: arXiv preprint arXiv:1905.12553 (2019)."
"[1] Marquis, S. G., Sulzer, V., Timms, R., Please, C. P., & Chapman, S. J. (2019). “An asymptotic derivation of a single particle model with electrolyte”. [Journal of The Electrochemical Society](https://doi.org/10.1149/2.0341915jes), 166(15), A3693-A3706. "
]
},
{
Expand Down Expand Up @@ -218,4 +218,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
4 changes: 2 additions & 2 deletions examples/notebooks/using-submodels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
"metadata": {},
"source": [
"## References\n",
"[1] SG Marquis, V Sulzer, R Timms, CP Please and SJ Chapman. “An asymptotion derivation of a single particle model with electrolyte”. In: arXiv preprint arXiv:1905.12553 (2019).\n",
"[1] Marquis, S. G., Sulzer, V., Timms, R., Please, C. P., & Chapman, S. J. (2019). “An asymptotic derivation of a single particle model with electrolyte”. [Journal of The Electrochemical Society](https://doi.org/10.1149/2.0341915jes), 166(15), A3693-A3706.\n",
"\n",
"[2] M Doyle, TF Fuller and J Newman. \"Modeling of galvanostatic charge and discharge of the lithium/polymer/insertion cell.\" Journal of the Electrochemical Society 140.6 (1993): 1526-1533."
]
Expand Down Expand Up @@ -624,4 +624,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
51 changes: 51 additions & 0 deletions examples/scripts/cycling_ageing_yang.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import pybamm as pb

pb.set_logging_level("INFO")
options = {"sei": "ec reaction limited", "sei porosity change": True}
param = pb.ParameterValues(chemistry=pb.parameter_sets.Ramadass2004)
model = pb.lithium_ion.DFN(options)
experiment = pb.Experiment(
[
"Charge at 1 C until 4.2 V",
"Hold at 4.2 V until C/10",
"Rest for 5 minutes",
"Discharge at 2 C until 2.8 V",
"Rest for 5 minutes",
]
* 2
+ [
"Charge at 1 C until 4.2 V",
"Hold at 4.2 V until C/20",
"Rest for 30 minutes",
"Discharge at C/3 until 2.8 V",
"Charge at 1 C until 4.2 V",
"Hold at 4.2 V until C/20",
"Rest for 30 minutes",
"Discharge at 1 C until 2.8 V",
"Charge at 1 C until 4.2 V",
"Hold at 4.2 V until C/20",
"Rest for 30 minutes",
"Discharge at 2 C until 2.8 V",
"Charge at 1 C until 4.2 V",
"Hold at 4.2 V until C/20",
"Rest for 30 minutes",
"Discharge at 3 C until 2.8 V",
]
)
sim = pb.Simulation(model, experiment=experiment, parameter_values=param)
sim.solve(solver=pb.CasadiSolver(mode="safe", dt_max=120))
sim.plot(
[
"Current [A]",
"Total current density [A.m-2]",
"Terminal voltage [V]",
"Discharge capacity [A.h]",
"Electrolyte potential [V]",
"Electrolyte concentration [mol.m-3]",
"Total negative electrode sei thickness",
"Negative electrode porosity",
"X-averaged negative electrode porosity",
"Negative electrode sei interfacial current density [A.m-2]",
"X-averaged total negative electrode sei thickness [m]",
]
)
1 change: 0 additions & 1 deletion pybamm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def version(formatted=False):
from .parameters import electrical_parameters
from .parameters import thermal_parameters
from .parameters import standard_parameters_lithium_ion, standard_parameters_lead_acid
from .parameters import sei_parameters
from .parameters import parameter_sets


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Graphite anode parameters

Parameters for a graphite anode, from the paper

> Marquis, S. G., Sulzer, V., Timms, R., Please, C. P., & Chapman, S. J. (2019). “An asymptotic derivation of a single particle model with electrolyte”. [Journal of The Electrochemical Society](https://doi.org/10.1149/2.0341915jes), 166(15), A3693-A3706.
> P. Ramadass, Bala Haran, Parthasarathy M. Gomadam, Ralph White, and Branko N. Popov.["Development of First Principles Capacity Fade Model for Li-Ion Cells."](https://scholarcommons.sc.edu/cgi/viewcontent.cgi?article=1161&context=eche_facpub) (2004)
and references therein.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from pybamm import exp, constants, standard_parameters_lithium_ion


def graphite_electrolyte_exchange_current_density_Ramadass2004(c_e, c_s_surf, T):
"""
Exchange-current density for Butler-Volmer reactions between graphite and LiPF6 in
EC:DMC.
References
----------
.. [1] P. Ramadass, Bala Haran, Parthasarathy M. Gomadam, Ralph White, and Branko
N. Popov. "Development of First Principles Capacity Fade Model for Li-Ion Cells."
(2004)
Parameters
----------
c_e : :class:`pybamm.Symbol`
Electrolyte concentration [mol.m-3]
c_s_surf : :class:`pybamm.Symbol`
Particle concentration [mol.m-3]
T : :class:`pybamm.Symbol`
Temperature [K]
Returns
-------
:class:`pybamm.Symbol`
Exchange-current density [A.m-2]
"""
m_ref = 4.854 * 10 ** (-6) # (A/m2)(mol/m3)**1.5
E_r = 37480
arrhenius = exp(E_r / constants.R * (1 / 298.15 - 1 / T))

c_n_max = standard_parameters_lithium_ion.c_n_max

return (
m_ref * arrhenius * c_e ** 0.5 * c_s_surf ** 0.5 * (c_n_max - c_s_surf) ** 0.5
)
Loading

0 comments on commit cc5d9f1

Please sign in to comment.