Choosing model options, adding modules and parameter #3718
-
Hi everyone, Within the pybamm framework there are multiple combination of options that can be chosen for a model.
model = pybamm.lithium_ion.DFN(build=False, options = {
def De(c_e, T): Hypothetically, let us say I want to modify the dependance of the electrolyte diffusivity to include the solid phase Li concentration as well. def modified_De(c_e, c_s, T): Apart from defining above function and changing to parameter. How do I make such a change in the code? Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@brosaplanella @tinosulzer @DrSOKane @rtimms Any help would be greatly appreciated. TIA! |
Beta Was this translation helpful? Give feedback.
-
To add to @ChaddKiggins great answer I worked on a similar problem a few years ago now and published some papers on coupling pybamm models with thermal models for jellyrolls and extended the work to packs which became liionpack . https://iopscience.iop.org/article/10.1149/1945-7111/aba44b/meta My method was similar to Chad's where I step and solve the electrochemistry then update the temperature distribution then feed that back and calculate new heat sources. I got the solving parallelized so that I was running a CC 1C discharge with about 1300 models around a 2D jellyroll on my desktop with 12 cores in about 10 minutes. I was taking steps of about 30 s I think. The code hasn't been updated for a while but it's getting more interest now and I will be updating it soon. Currently I haven't particularly advertised that it's out there and open source as I don't have much time to support it. Also I think the solving speed could be greatly improved by doing away with the step solve and the long term plan is to actually migrate all the solving including the thermal to PyBaMM proper and just use this package to generate the meshes. |
Beta Was this translation helpful? Give feedback.
To help with a few of the questions:
Avilable model options can be found here: https://docs.pybamm.org/en/latest/source/api/models/base_models/base_battery_model.html
PyBaMM has a few thermal model options. This link has a description of the available thermal submodels:
https://docs.pybamm.org/en/stable/source/examples/notebooks/models/thermal-models.html
For spatial models, the options above work with pouch cells in certain dimensions. If you have another format, say cylindrical, you may need to use an external model. For example, to solve the spatial temperture distribution in a cylindrical cell, I used PyBaMM to calculate the total heating of the DFN model. I then took this heati…