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

Converging-Diverging Nozzle

Converging-Diverging Nozzle

Equilibrium with charged species and multiple condensed phases

Equilibrium with charged species and multiple condensed phases

Rankine cycle

Rankine cycle

Rankine cycle (with units)

Rankine cycle (with units)

Adiabatic flame temperature including solid carbon formation

Adiabatic flame temperature including solid carbon formation

Sound speeds (with units)

Sound speeds (with units)

Sound speeds

Sound speeds

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

Growth of diamond film using CVD

Growth of diamond film using CVD

Shock-tube species profiles as a function of time

Shock-tube species profiles as a function of time

Extracting a sub-mechanism

Extracting a sub-mechanism

Mechanism reduction

Mechanism reduction

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

Continuously stirred tank reactor with periodic behavior

Continuously stirred tank reactor with periodic behavior

Combustor residence time

Combustor residence time

Constant-pressure, adiabatic kinetics simulation

Constant-pressure, adiabatic kinetics simulation

Plasma Reactor

Plasma Reactor

Reactors separated by a moving piston

Reactors separated by a moving piston

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

Acceleration of reactor integration using a sparse preconditioned solver

Acceleration of reactor integration using a sparse preconditioned solver

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

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#

Flame speed as a function of equivalence ratio

Flame speed as a function of equivalence ratio

Burner-stabilized flame including ionized species

Burner-stabilized flame including ionized species

Burner-stabilized flame

Burner-stabilized flame

Counterflow diffusion flame

Counterflow diffusion flame

Opposed-flow premixed strained flame

Opposed-flow premixed strained flame

Freely-propagating flame with charged species

Freely-propagating flame with charged species

Laminar flame speed sensitivity analysis

Laminar flame speed sensitivity analysis

Laminar flame speed calculation

Laminar flame speed calculation

Catalytic combustion of methane on platinum

Catalytic combustion of methane on platinum

Detached flat flame stabilized at a stagnation point

Detached flat flame stabilized at a stagnation point

Burner-stabilized flame with imposed temperature profile

Burner-stabilized flame with imposed temperature profile

Saving, loading, and restarting 1D calculations

Saving, loading, and restarting 1D calculations

Symmetric premixed twin flame

Symmetric premixed twin flame

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