pybamm-team / PyBaMM

Fast and flexible physics-based battery models in Python
https://www.pybamm.org/
BSD 3-Clause "New" or "Revised" License
1.09k stars 537 forks source link

Simplified electrolyte model #1275

Closed Malipour14 closed 3 years ago

Malipour14 commented 3 years ago

Summary Adding a new model to PyBaMM.

Motivation Hello, I want to develope a new lumped-electrochemical model (an electrochemical model with lumped parameters) reusing the pybamm. Before starting, I wanted to now if it is doable. Thanks a lot.

valentinsulzer commented 3 years ago

Hopefully. What is the model? Do you have a reference?

Malipour14 commented 3 years ago

It is a kind of 0-order model that variables are only time-dependent which is so called "Lumped-electrochemical model"

https://doi.org/10.3182/20100712-3-DE-2013.00010

valentinsulzer commented 3 years ago

That looks interesting, thanks. We already have those particle, potential, and temperature submodels implemented. It would be great if you could add the electrolyte model in Section 3.2 as a new submodel, then you can reuse the other parts of the code. Let me know if you are interested in doing that and I can help you get started

Malipour14 commented 3 years ago

Thank you for your response. Yes, I'm totally interested to do it. I'll be grateful if you help me with the procedure. How the sub-models are coupled then?

valentinsulzer commented 3 years ago

Unfortunately we don't yet have good documentation explaining how the submodels are coupled. Basically, you need to add a new file to this folder, using for example the "full diffusion" file to get you started. Once you set it all up properly, you can add an option to call your new submodel from one of the model classes, e.g. SPMe. Then, all of the other submodels will use the electrolyte concentration that is defined by your new submodel, and you don't need to change anything else. If you're not familiar with defining equations in the pybamm format, I recommend these tutorials

Malipour14 commented 3 years ago

Thanks for the information. Is it possible to collect all the supermodels in one full model and use it as a new model?

Malipour14 commented 3 years ago

The reason why I want to develop the full model form the beginning is that the existing sub-models for SPMe or SPM models are not developed based on the lumped-parameters. For example, in the lumped-model, Fick's law for diffusion is not valid since the concentration in the solid phase is a function of time only and not location (x or r)! therefore, the whole model should be written from the beginning.

valentinsulzer commented 3 years ago

In the case of the particles you can use the various polynomial approximation models from Subramaniam 2005 that we have already implemented, for example here. If you really want to make a full model yourself, check out the BasicSPM for a template, but we don't want to add too many of these as there are exponentially many different combinations of submodels possible, and it becomes hard to maintain.

valentinsulzer commented 3 years ago

@Malipour14 any update on this?