Index of Jupyter Notebook Examples
Cantera examples in the form of Jupyter notebooks. To see the rendered notebooks, browse the files below.
Existing Cantera users: If you have Cantera and the Jupyter Notebook server installed on your local machine, simply download any Jupyter notebook by clicking the "Source" link at the top of each example page and you should be able to run it. For some examples, you will also need to download the additional data files listed below the "Source" link. These data files should either be placed in a subdirectory named "data" one level up from the directory containing the notebook file, or the notebook can be modified to point to the location of these data files on your computer. Alternatively, you can download all of these examples and their accompanying data files by cloning the cantera-jupyter repository from GitHub.
New Cantera Users: If you don't have an existing Cantera installation and you just want to experiment, you can give Cantera a test drive in the cloud. Click on the Binder link below to launch an interactive environment where you can run these examples. For this, there is no installation required, but you cannot save and resume your work.
Non-ideal equations of state
This example demonstrates a comparison between ideal and non-ideal equations of state (EoS) using Cantera and CoolProp.
This example demonstrates calculation of the adiabatic flame temperature for a methane/air mixture, comparing calculations which assume either complete or incomplete combustion.
Use Cantera's thermodynamic data to calculate the lower heating value (LHV) and higher heating value (HHV) of methane and other fuels.
Reactor Networks ¶
One-dimensional packed-bed, catalytic-membrane reactor model without streamwise diffusion
The present model simulates heterogeneous catalytic processes inside packed-bed, catalytic membrane reactors. The gas-phase and surface-phase species conservation equations are derived and the system of differential-algebraic equations (DAE) is solved using the scikits.odes.dae IDA solver.
1D Plug Flow Reactor Model with Surface Chemistry
In this model, we will illustrate the derivation of the governing differential equations and algebraic constraints, calculation of the initial conditions of the variables and their spatial derivatives and use the IDA solver to solve this system of differential algebraic equations (DAE).
Ignition delay computation
In this example, we will illustrate how to setup and use a constant volume batch reactor. This reactor will then be used to compute the ignition delay of a gas at any temperature and pressure.
Interactive Path Diagrams
This example uses `ipywidgets` to create interactive displays of path diagrams from Cantera simulations.
Non-Ideal Shock Tube Example
In this example we will illustrate how to setup and use a constant volume, adiabatic reactor to simulate reflected shock tube experiments. This reactor will then be used to compute the ignition delay of a gas at any temperature and pressure.
In this example we will illustrate how Cantera can be used to simulate a Continuously Stirred Tank Reactor (CSTR), also interchangeably referred to as a Perfectly Stirred Reactor or a Well Stirred Reactor, a Jet Stirred Reactor or a Longwell Reactor (there may well be more "aliases").
One-Dimensional Flames ¶
Flame Speed with Convergence Analysis
In this example we simulate a freely-propagating, adiabatic, 1-D flame and * Calculate its laminar burning velocity * Estimate the uncertainty in the laminar burning velocity calculation, due to grid size.
Flame Speed with Sensitivity Analysis
In this example we simulate a freely-propagating, adiabatic, 1-D flame, calculate its laminar burning velocity and perform a sensitivity analysis of its kinetics.
Twin Premixed Counter-Flow Flame
This example documents how to simulate two identical, axisymmetric, premixed jets of reactants shooting into each other.
Lithium Ion Battery
In this example, we will illustrate how to calculate the open circuit voltage (voltage when the external applied current is 0) for a lithium ion battery as a function of anode and cathode lithium content.
Input Files ¶
Conversion of CHEMKIN Data
This notebook illustrates the conversion of CHEMKIN input files to Cantera YAML input files. The conversion utility `ck2yaml` is run as a shell command (using the exclamation mark `!` magic shortcut).