-
-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some standard battery models from papers #1356
Comments
Doing this for the @weilongai and @DrSOKane papers should be fairly easy as a first issue. Can you comment here exactly which options and parameters are needed for this? |
Hi @tinosulzer , this sounds to be a good idea, and I would suggest the following class. Are you going to make the DFN by default? class Ai2020(DFN):
def __init__(self):
options = { "particle": "Fickian diffusion", "particle cracking": "both" }
super().__init__(self, options=options, name="Ai 2020 model")
@property
def default_parameter_values(self):
return pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Ai2020) |
Thanks
I guess whichever model the paper uses as the underlying model |
I actually used the Ecker et al. parameter set in my 2020 paper, not Chen et al. I used Chen et al. in the example because I was unable to implement the model in my paper, for two reasons:
Implementing full nonlinear diffusion in PyBaMM is #1 on my list of long-term goals but I urgently need to get another paper out before I can work on this. |
don't we all 😅 |
I am working on implementing the nonlinear diffusion coefficients for the LG M50, if that helps :) |
Hi everyone, I am Kenneth Nwanoro. I joined the Lancaster energy storage group couple of months ago. |
Thanks @KennethNwanoro . When you have the {"sei": "ec reaction", "sei film resistance": "distributed", "sei porosity change": "true", "lithium plating": "irreversible"} We might just need to add an option for porosity change due to plating |
Thanks @tinosulzer. I have already started creating the Yang2017 model as you can see below. I will now include the "sei film resistance" option as suggested. class Yang2017(DFN): @Property |
thanks, would be awesome if you could also help us double check the equations are indeed the same btw, you can write code in github by enclosing it in a block with |
Thanks @tinosulzer. I don't know if this is the right place to post this. I have compared the degradation (SEI and irreversible Li plating) model equations from Yang2017 and the irreversible Li-plating model currently in PyBaMM. There are some slight differences:
Many thanks. |
Hi @KennethNwanoro ,
|
Hi@tinosulzer, What is your suggestion regarding the electrolyte concentration term
|
Yes, the import pybamm
c = pybamm.Variable("c")
f = pybamm.FunctionParameter("f", {"c": c})
# Processing with a scalar behaves like a normal parameter
param1 = pybamm.ParameterValues({"f": 2})
param1.process_symbol(f) # returns a Scalar with value 2
# Processing with a function behaves like a function
param2 = pybamm.ParameterValues({"f": lambda x: x ** 2})
param2.process_symbol(f) # returns c ** 2 |
Hi @tinosulzer, Could you please check this function out and see if it is what you have in mind. The function will return both exchange current density scale and c_e_n values suitable for both Yang2017 (with constant lithium plating exchange current density that is independent of concentrations) and concentration dependent exchange current density (e.g. OKane2020). def C_plating(self, c_e_n):
""" Exchnage current density scale and
# also returns correct electrolyte concentration value for Lithium plating model type"""
inputs = {"electrolyte concentration":c_e_n, }
fun_Li_pating= pybamm.FunctionParameter("electrolyte concentration", inputs)
if self.options["lithium plating exchange current density value"] != "constant":
c_plating = self.j_scale_n / self.j0_plating_dimensional
plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": lambda x: x})
plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns true value of c_e_n
else:
c_plating = (self.j_scale_n / self.m_plating_dimensional) * pybamm.exp(
-self.F * self.U_n_ref) / (2 * self.R * self.T_ref)
plating_c_e_n_param = pybamm.ParameterValues({"electrolyte concentration": 1})
plating_c_e_n = plating_c_e_n_param.process_symbol(fun_Li_pating) # returns electrolyte concentration a Scalar with value 1
return (c_plating , plating_c_e_n)
return (c_plating , plating_c_e_n) |
Kind of but not quite - just need to put the code in different places. I'll open a branch with the main changes required and you can look at the diff on github |
Great, please let me know when this is done. |
Here you go: https://github.com/pybamm-team/PyBaMM/compare/yang-model Now for the Yang model you just need to update the |
Great, got that now. |
I have couple of questions regarding the porosity change submodel:
Or would you rather prefer separate class for each of the two additional options listed above? |
The
Yes, I also prefer this way to adding separate classes. You can make the code a little bit cleaner as follows def get_coupled_variables(self, variables):
j_n = variables["Negative electrode interfacial current density"]
j_p = variables["Positive electrode interfacial current density"]
deps_n_dt = -self.param.beta_surf_n * j_n
if self.options["sei porosity change"] == "true":
j_sei_n = variables["Negative electrode sei interfacial current density"]
beta_sei_n = self.param.beta_sei_n
deps_n_dt += beta_sei_n * j_sei_n
elif self.options["lithium plating porosity change"] == "true":
j_plating = variables[
"Negative electrode lithium plating interfacial current density"
]
beta_plating = self.param.beta_plating
deps_n_dt += beta_plating * j_plating
deps_s_dt = pybamm.FullBroadcast(
0, "separator", auxiliary_domains={"secondary": "current collector"}
)
deps_p_dt = -self.param.beta_surf_p * j_p |
The Yang2017 model is ready. The initial test results looks reasonable. I was wondering if there is any kind of standard benchmark tests for the SEI and lithium plating models for comparison before creating pull request? |
We don't have benchmark tests, only the |
Closing as too broad an issue |
We are now at the stage where it might be useful to add some standard "full" battery models from the literature with exactly the degradation models (model options) and parameter set used in that model.
Something like
Then the model can be used as
pybamm.lithium_ion.OKane2020()
.To start with:
The text was updated successfully, but these errors were encountered: