Skip to content

Couple pybamm and openpnm to solve a thermal battery problem

License

Notifications You must be signed in to change notification settings

TomTranter/JellyBaMM

Repository files navigation

Scheduled Documentation Status

Logo

Welcome to JellyBamm

The lithium-ion battery cell simulator powered by PyBaMM. JellyBamm allows you to specify cyclindrical jellyroll cell designs parametrically or extract them from images.

Leverage the experiments and parameter sets from PyBaMM and scale up your simulations from 1D representations to detailed 2D (and 3D - in future) cell simulations. Include thermal effects and account for inhomogenteities introduced by tabs or variable inputs for heat transfer.

Include statistical distributions in the battery parameters for sections of the cell.

Installing

Execute the following command to install JellyBamm with pip after navigating to the root folder:

pip install -e .

Getting Started

Example notebooks can be found in the docs\examples folder. Example scripts can be found in the run_scripts folder. Here is an example:

import openpnm as op
import matplotlib.pyplot as plt
import jellybamm
import liionpack as lp
import pybamm


plt.close("all")

# pybamm.set_logging_level("INFO")
wrk = op.Workspace()
wrk.clear()


if __name__ == "__main__":
    # Geometry of 1D mesh
    Nunit = 10
    spacing = 0.1
    pos_tabs = [-1]
    neg_tabs = [0]
    length_3d = 1.0

    # Experiment
    I_app = 1.0
    dt = 30
    Nsteps = 12
    hours = dt * Nsteps / 3600
    experiment = pybamm.Experiment(
        [
            f"Discharge at {I_app} A for {hours} hours",
        ],
        period=f"{dt} seconds",
    )

    # OpenPNM project
    project, arc_edges = jellybamm.make_1D_net(Nunit, spacing, pos_tabs, neg_tabs)

    # Parameter set
    param = pybamm.ParameterValues("Chen2020")
    # JellyBaMM discretises the spiral using the electrode height for spiral length
    # This parameter set has the longer length set to the Electrode width
    # We want to swap this round
    param["Electrode width [m]"] = length_3d
    initial_soc = None

    # Run simulation
    project, output = jellybamm.run_simulation_lp(
        parameter_values=param,
        experiment=experiment,
        initial_soc=initial_soc,
        project=project,
    )
    lp.plot_output(output)

Running the tests

pytest

Contributing

Please read the docs for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the BSD-3-Clause license - see the LICENSE file for details

Acknowledgments

  • Great thanks to the PyBaMM and OpenPNM teams

About

Couple pybamm and openpnm to solve a thermal battery problem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages