Index of C++ Examples

This is an index of the C++ examples included with Cantera.

Examples

Blasius BVP Solver

This example solves the Blasius boundary value problem for the velocity profile of a laminar boundary layer over a flat plate. It defines class BoundaryValueProblem, which provides a simplified interface to the boundary value problem capabilities of Cantera.

Adiabatic Combustor

Two separate stream - one pure methane and the other air, both at 300 K and 1 atm flow into an adiabatic combustor where they mix. We are interested in the steady-state burning solution. Since at 300 K no reaction will occur between methane and air, we need to use an 'igniter' to initiate the chemistry. A simple igniter is a pulsed flow of atomic hydrogen. After the igniter is turned off, the system approaches the steady burning solution.

Custom Reactor

Solve a closed-system constant pressure ignition problem where the governing equations are custom-implemented, using Cantera's interface to CVODES to integrate the equations.

Property Calculation Demo

This demonstration program builds an object representing a reacting gas mixture, and uses it to compute thermodynamic properties, chemical equilibrium, and transport properties.

Freely-propagating flame

C++ demo program to compute flame speeds using GRI-Mech.

Gas phase transport properties

Construct a gas phase Solution object and use it to compute viscosity, thermal conductivity, mixture-averaged diffusion coefficients, and thermal diffusivities for a range of temperatures.

Benchmark derivative evaluations

Calculate derivatives of reaction rates of progress and species production and destruction rates with respect to temperature, pressure, molar concentration, and mole fractions. Time evaluation for different chemical mechanisms.

Zero-dimensional kinetics

This example simulates autoignition of hydrogen in a constant pressure reactor and saves the time history to files that can be used for plotting.

LiC6 Electrode

Calculate the open-circuit potential of an LiC6 electrode and activity coefficients of each species as a function of the mole fraction of intercalated lithium.

Ignition delay calculation with OpenMP

This example shows how to use OpenMP to run multiple reactor network calculations in parallel by using separate Cantera objects for each thread.

Open Rankine Cycle

Calculate the thermodynamic states and efficiency of an open Rankine cycle using a pure substance model for water.