PyBaMM
PyBaMM copied to clipboard
Error when running DFN half-cell without a lithium plating parameter set
- PyBaMM version -
$ python -m pip show pybamm: 21.9 - Python version -
$ python --version: any
Describe the bug At the moment, if you try to use the PyBaMM half-cell model with a parameter set that doesn't include lithium plating (like the default one) it throws a rather non-informative error:
KeyError: KeyError("'Typical plated lithium concentration [mol.m-3]' not found. Best matches are ['Typical electrolyte concentration [mol.m-3]', 'Bulk solvent concentration [mol.m-3]', 'Lithium interstitial reference concentration [mol.m-3]']")
It would be good if the error was more informative.
This was identified by @sklein-ise in #1717.
Because of where this is in the code this is quite hard tbh without just putting in that one special case. What did you have in mind?
Nothing in particular. Then, it might be easier to include the plating to the default parameters so, at least, if people run the default model, won't get the error.
Yeah we should definitely do that
Then this would be a very good first issue. @sklein-ise let us know if you want to give it a go as well.
Default parameter set for a half-cell model is now "Xu2019"
Hello,
Could you please revisit to this issue? what should we do for half cell when we have customized parameter sets?
Either copy any missing parameters from Xu2019 or use very high values so that the overpotential from the lithium metal anode is zero
{
"Negative electrode OCP [V]": 0.0,
"Negative electrode conductivity [S.m-1]": 1e7,
"Typical plated lithium concentration [mol.m-3]": 76900.0,
"Exchange-current density for plating [A.m-2]": 1000,
"Negative electrode thickness [m]": 1e-5,
}