Skip to content
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

Form factors #24

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 52 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,61 @@

![PyBaMM-TEA-logo](https://github.com/pybamm-team/pybamm-tea/blob/main/docs/_static/pybamm_tea_logo.PNG)

#

<div align="center">

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pybamm-team/PyBaMM/blob/main/)


</div>


# 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.
This repository contains the work of the "Google Summer of Code" project for a techno-economic analysis library, that can be combined with PyBaMM - as for creating a Ragone plot. By now, the package can be used to estimate metrics at the electrode stack level.

## Example usage

After setting up a TEA class from an input- and/or PyBaMM parameter-set, dataframes with cell metrics and different plots can be created.

```python3
import pybamm
import pybamm_tea

# create an input dictionary
input["Electrolyte density [kg.m-3]"] = 1276

# create a base parameter set
base = pybamm.ParameterValues("Chen2020")

# create a TEA class
tea_class = pybamm_tea.TEA(base, input)

# print the stack energy
print(tea_class.stack_energy_dataframe)

# print the capacities and potentials
print(tea_class.capacities_and_potentials_dataframe)

# print the mass and volume loadings as a dataframe
print(tea_class.masses_and_volumes_dataframe)

# print the electrolyte metrics
print(tea_class.electrolyte_dataframe)

# plot the mass and volume loadings
tea_class.plot_masses_and_volumes(show_plot=True)

# plot the lithiation plot
tea_class.plot_lithiation(show_plot=True)

# plot the differential lithiation plot
tea_class.differential_lithiation_plot(show_plot=True)

# plot a Ragone plot
pybamm_tea.plot_ragone([tea_class], C_rates = [0.1,1,2,3,5], plot_capacities_and_potentials=True, show_plot=True)
```

## Installation
We recommend installing within a [virtual environment](https://docs.python.org/3/tutorial/venv.html) in order to not alter any python distribution files on your machine.
Expand Down Expand Up @@ -64,35 +115,6 @@ To install the project in editable mode use `pip install -e .`

As an alternative, you can set up [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about). 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.

```python3
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](https://www.sphinx-doc.org/en/master/). To build the documentation first [clone the repository](https://github.com/git-guides/git-clone), then run the following command:
```bash
Expand Down
2,452 changes: 2,452 additions & 0 deletions examples/capacities_and_potentials.ipynb

Large diffs are not rendered by default.

1,207 changes: 1,207 additions & 0 deletions examples/masses_and_volumes.ipynb

Large diffs are not rendered by default.

1,000 changes: 1,000 additions & 0 deletions examples/ragone.ipynb

Large diffs are not rendered by default.

45 changes: 29 additions & 16 deletions examples/stack_breakdown.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
from pybamm_tea import TEA
import pybamm
import pybamm_tea

# Load a base parameter set from PyBaMM
param_nco = pybamm.ParameterValues("Ecker2015")
# create an input dictionary
input["Electrolyte density [kg.m-3]"] = 1276

# 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 base parameter set
base = pybamm.ParameterValues("Chen2020")

# Create a TEA object, passing in the parameter set and input data
tea_nco = TEA(param_nco, nco_input_data)
# create a TEA class
tea_class = pybamm_tea.TEA(base, input)

# Plot a mass- and volume-loading breakdown for an electrode stack
tea_nco.plot_stack_breakdown()
# print the stack energy
print(tea_class.stack_energy_dataframe)

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

# print the mass and volume loadings as a dataframe
print(tea_class.masses_and_volumes_dataframe)

# print the electrolyte metrics
print(tea_class.electrolyte_dataframe)

# plot the mass and volume loadings
tea_class.plot_masses_and_volumes(show_plot=True)

# plot the lithiation plot
tea_class.plot_lithiation(show_plot=True)

# plot the differential lithiation plot
tea_class.differential_lithiation_plot(show_plot=True)

# plot a Ragone plot
pybamm_tea.plot_ragone([tea_class], C_rates = [0.1,1,2,3,5], plot_capacities_and_potentials=True, show_plot=True)
1,031 changes: 0 additions & 1,031 deletions examples/stackbreakdown.ipynb

This file was deleted.

1 change: 1 addition & 0 deletions pybamm_tea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
__version__ = "0.0.0"

from .tea import TEA
from .tea import ragone_plot
Loading