Python Examples#

See also

To find examples covering a specific topic, see the index of example tags.

If you’re just getting started with Cantera, see our Python Tutorial for an introduction to the Cantera Python interface.

Thermodynamics#

Mixing using Quantity objects

Mixing using Quantity objects

Critical state properties

Critical state properties

Equilibrium with charged species and multiple condensed phases

Equilibrium with charged species and multiple condensed phases

Sound speeds

Sound speeds

Adiabatic flame temperature including solid carbon formation

Adiabatic flame temperature including solid carbon formation

Rankine cycle

Rankine cycle

Isentropic, adiabatic flow

Isentropic, adiabatic flow

Rankine cycle (with units)

Rankine cycle (with units)

Sound speeds (with units)

Sound speeds (with units)

Isentropic, adiabatic flow (with units)

Isentropic, adiabatic flow (with units)

Vapor Dome

Vapor Dome

Equivalence ratio

Equivalence ratio

Surface with coverage-dependent thermo

Surface with coverage-dependent thermo

Non-ideal equations of state

Non-ideal equations of state

Kinetics#

Viewing a reaction path diagram

Viewing a reaction path diagram

Shock-tube species profiles as a function of time

Shock-tube species profiles as a function of time

Growth of diamond film using CVD

Growth of diamond film using CVD

Mechanism reduction

Mechanism reduction

Extracting a sub-mechanism

Extracting a sub-mechanism

Blowers-Masel reaction rates

Blowers-Masel reaction rates

Jet-stirred reactor temperature and species profiles

Jet-stirred reactor temperature and species profiles

Lithium Ion Battery Discharge Curve

Lithium Ion Battery Discharge Curve

Custom reaction rates

Custom reaction rates

Solid oxide fuel cell using elementary kinetics

Solid oxide fuel cell using elementary kinetics

Interactive Reaction Path Diagrams

Interactive Reaction Path Diagrams

Transport#

Porous media transport using the dusty gas model

Porous media transport using the dusty gas model

Parallelizing transport property calculations

Parallelizing transport property calculations

Reactor networks#

Mixing two streams

Mixing two streams

Constant-pressure, adiabatic kinetics simulation

Constant-pressure, adiabatic kinetics simulation

Plasma Reactor

Plasma Reactor

Integrating constant pressure ignition using SciPy

Integrating constant pressure ignition using SciPy

Constant-pressure, adiabatic kinetics simulation with sensitivity analysis

Constant-pressure, adiabatic kinetics simulation with sensitivity analysis

Plug flow reactor with surface chemistry

Plug flow reactor with surface chemistry

Reactors separated by a moving piston

Reactors separated by a moving piston

Acceleration of reactor integration using a sparse preconditioned solver

Acceleration of reactor integration using a sparse preconditioned solver

Continuously stirred tank reactor with periodic behavior

Continuously stirred tank reactor with periodic behavior

Soot precursor formation with time-varying mass flow rate

Soot precursor formation with time-varying mass flow rate

Reactors with walls and heat transfer

Reactors with walls and heat transfer

Combustor residence time

Combustor residence time

Using ExtensibleReactor to implement wall inertia

Using ExtensibleReactor to implement wall inertia

Plug flow reactor modeled as a chain of well stirred reactors

Plug flow reactor modeled as a chain of well stirred reactors

Plug flow reactor: silicon nitride deposition

Plug flow reactor: silicon nitride deposition

Plug flow reactor modeling approaches

Plug flow reactor modeling approaches

Continuously Stirred Tank Reactor

Continuously Stirred Tank Reactor

Diesel-type internal combustion engine simulation with gaseous fuel

Diesel-type internal combustion engine simulation with gaseous fuel

Ignition delay time using the Redlich-Kwong real gas model

Ignition delay time using the Redlich-Kwong real gas model

One-dimensional packed-bed, catalytic-membrane reactor

One-dimensional packed-bed, catalytic-membrane reactor

Reactor cascade model for reactive flows in inert porous media

Reactor cascade model for reactive flows in inert porous media

1D reacting flows#

Burner-stabilized flame including ionized species

Burner-stabilized flame including ionized species

Burner-stabilized flame

Burner-stabilized flame

Freely-propagating flame with charged species

Freely-propagating flame with charged species

Opposed-flow premixed strained flame

Opposed-flow premixed strained flame

Laminar flame speed calculation

Laminar flame speed calculation

Flame speed as a function of equivalence ratio

Flame speed as a function of equivalence ratio

Detached flat flame stabilized at a stagnation point

Detached flat flame stabilized at a stagnation point

Counterflow diffusion flame

Counterflow diffusion flame

Laminar flame speed sensitivity analysis

Laminar flame speed sensitivity analysis

Burner-stabilized flame with imposed temperature profile

Burner-stabilized flame with imposed temperature profile

Catalytic combustion of methane on platinum

Catalytic combustion of methane on platinum

Symmetric premixed twin flame

Symmetric premixed twin flame

Saving, loading, and restarting 1D calculations

Saving, loading, and restarting 1D calculations

Diffusion flame unstable branch

Diffusion flame unstable branch

Diffusion flame extinction strain rate

Diffusion flame extinction strain rate

Scaling of diffusion flames with pressure and strain rate

Scaling of diffusion flames with pressure and strain rate

Flame Speed with Convergence Analysis

Flame Speed with Convergence Analysis

Gallery generated by Sphinx-Gallery