/pybamm-tea

A package for performing Techno Economic Analysis using PyBaMM

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

PyBaMM-TEA-logo

PyBaMM-TEA

This repository contains the work of the "Google Summer of Code" project on a techno-economic analysis library for battery cells, which can be combined with PyBaMM's functionality. So far, there is a method to visualize mass- and volume- loadings of an electrode stack and to estimate energy densities without simulation. The project further aims to estimate cell metrics with simulations (e.g. a Ragone plot) and manufacturing metrics with a Process-based Cost Model.

Installation

We recommend installing within a virtual environment in order to not alter any python distribution files on your machine.

PyBaMM is available on GNU/Linux, MacOS and Windows. For more detailed instructions on how to install PyBaMM, see the PyBaMM documentation.

Linux/Mac OS

  1. Clone the repository using git
git clone https://github.com/pybamm-team/PyBaMM-TEA.git

or download (and extract) the ZIP file by clicking the green button on the top right of the page or use GitHub Desktop. 2. Change into the pybamm-tea directory

cd pybamm-tea
  1. Create a virtual environment
virtualenv env
  1. Activate the virtual environment
source env/bin/activate
  1. Install the package
pip install .

To install the project in editable mode use pip install -e .

Windows To install the package from the local project path on Windows use the following commands:

  1. Clone the repository using git
git clone https://github.com/pybamm-team/PyBaMM-TEA.git

or download (and extract) the ZIP file by clicking the green button on the top right of the page or use GitHub Desktop. 2. Change into the pybamm-tea directory

cd pybamm-tea
  1. Create a virtual environment
virtualenv env
  1. Activate the virtual environment
\path\to\env\Scripts\activate

where \path\to\env is the path to the environment created in step 3 (e.g. C:\Users\'Username'\env\Scripts\activate.bat). 5. Install the package

pip install .

To install the project in editable mode use pip install -e .

As an alternative, you can set up Windows Subsystem for Linux. This allows you to run a full Linux distribution within Windows.

Example usage

Create a script - e.g. to plot a mass- and volume-breakdown of an electrode stack - as below or as in the example notebook.

from pybamm_tea import TEA
import pybamm

# Load a base parameter set from PyBaMM
param_nco = pybamm.ParameterValues("Ecker2015")

# Provide additional input data for the TEA model
nco_input_data = {
    "Electrolyte density [kg.m-3]": 1276,  # EC:EMC
    "Negative electrode active material density [kg.m-3]": 2266,  # Graphite
    "Positive electrode active material density [kg.m-3]": 4750,  # NCO
}

# Create a TEA object, passing in the parameter set and input data
tea_nco = TEA(param_nco, nco_input_data)

# Plot a mass- and volume-loading breakdown for an electrode stack
tea_nco.plot_stack_breakdown()

# Print a dataframe with values of the mass- and volume-loading breakdown for an
# electrode stack
print(tea_nco.stack_breakdown_dataframe)

Documentation

API documentation for the pybamm_tea package can be built locally using Sphinx. To build the documentation first clone the repository, then run the following command:

sphinx-build docs docs/_build/html  

This will generate a number of html files in the docs/_build/html directory. To view the documentation, open the file docs/_build/html/index.html in a web browser, e.g. by running

open docs/_build/html/index.html