Starting with Cantera 3.1, all of these examples have been migrated into the main repository as pure Python scripts that are then rendered by Sphinx Gallery. You can see the gallery of Python examples for the current version of Cantera at https://cantera.org/stable/examples/python/index.html.
If you would like to contribute a new Cantera example, please write it as a pure Python example like those in https://github.com/Cantera/cantera/tree/main/samples/python and open a Pull Request to the main Cantera repository (https://github.com/Cantera/cantera).
Freely Propagating Flame |
Strained Flames |
Continuous Stirred Tank Reactor |
Batch Reactor |
Li+ Battery OCV Calculation |
-
Basic Thermodynamics Calculations
-
Flame Simulations
-
Reactor Models
-
Electrochemistry
If you don't already have Cantera installed, refer to the instructions on the Cantera website.
If you used Conda to install Cantera (the recommended method), you will need to install Jupyter Lab into the same environment where you installed Cantera.
-
Activate the environment with the Cantera package (called
cantera
here):conda activate cantera
-
Install Jupyter Notebook into that environment
conda install jupyterlab
-
Run Jupyter Lab, which will open a browser window
jupyter lab
Otherwise, use pip
to install the Jupyter Notebook:
python -m pip install jupyterlab
Option 1: Download the zip file from GitHub and extract it to a convenient location on your computer.
Option 2: Use Git to clone this repository to a convenient location on your computer
git clone https://github.com/Cantera/cantera-jupyter.git
This repository follows the same code of conduct as the main Cantera repository. Cantera adheres to a code of conduct adapted from the Contributor Covenant code of conduct.
How do I use Cantera with Python?
An introduction to the Cantera Python interface is available here. For more advanced uses of Cantera, the complete documentation can be found here.
Can I forgo installing Cantera locally and just use Cantera in the cloud every time?
The problem with using Cantera with MyBinder is that there is no way for you to save your work. You can upload/download files in a session, but once the session is over (you close your browser window), you lose all your work. You thus cannot save your modified Jupyter notebooks.
I still can't figure something out. Who do I ask?
If you have more questions, need help with something, or have any suggestions, please visit the Cantera Google Groups Page and create a post.