.. _sec-cython-examples: .. py:currentmodule:: cantera Index of Python Examples ======================== This is an index of the examples included with the Cantera Python module. They can be found in the `examples` subdirectory of the Cantera Python module's installation directory. To determine the location of this directory, run the following in your Python interpreter:: import cantera.examples print(cantera.examples.__path__) Thermodynamics -------------- :doc:`critical_properties.py `: Print the critical state properties for the fluids for which Cantera has built-in liquid/vapor equations of state. :doc:`isentropic.py `: Isentropic, adiabatic flow example - calculate area ratio vs. Mach number curve :doc:`mixing.py `: Mixing two streams using `Quantity` objects. :doc:`rankine.py `: A Rankine vapor power cycle :doc:`sound_speed.py `: Compute the "equilibrium" and "frozen" sound speeds for a gas Kinetics -------- :doc:`extract_submechanism.py `: An example demonstrating how to use Species and Reaction objects to programmatically extract a reaction submechanism. In this example, the CO/H2 oxidation reactions are extracted from the GRI 3.0 mechanism. :doc:`mechanism_reduction.py `: A simplistic approach to mechanism reduction which demonstrates Cantera's features for dynamically manipulating chemical mechanisms. :doc:`reaction_path.py `: Viewing a reaction path diagram. Transport --------- :doc:`dusty_gas.py `: Dusty Gas transport model. :doc:`multiprocessing_viscosity.py `: This example demonstrates how Cantera can be used with the 'multiprocessing' module. Reactor Networks ---------------- :doc:`combustor.py `: A 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 and burn. :doc:`custom.py `: Solve a constant pressure ignition problem where the governing equations are implemented in Python. :doc:`ic_engine.py `: Simulation of a (gaseous) Diesel-type internal combustion engine. :doc:`mix1.py `: Mixing two streams. :doc:`periodic_cstr.py `: This example illustrates a continuously stirred tank reactor (CSTR) with steady inputs but periodic interior state. :doc:`pfr.py `: This example solves a plug-flow reactor problem of hydrogen-oxygen combustion. The PFR is computed by two approaches: The simulation of a Lagrangian fluid particle, and the simulation of a chain of reactors. :doc:`piston.py `: Two reactors separated by a piston :doc:`reactor1.py `: Constant-pressure, adiabatic kinetics simulation. :doc:`reactor2.py `: Two reactors connected with a piston, with heat loss to the environment :doc:`sensitivity1.py `: Constant-pressure, adiabatic kinetics simulation with sensitivity analysis :doc:`surf_pfr.py `: This example solves a plug flow reactor problem, where the chemistry is surface chemistry. The specific problem simulated is the partial oxidation of methane over a platinum catalyst in a packed bed reactor. One-dimensional Flames ---------------------- :doc:`adiabatic_flame.py `: A freely-propagating, premixed hydrogen flat flame with multicomponent transport properties. :doc:`burner_flame.py `: A burner-stabilized lean premixed hydrogen-oxygen flame at low pressure. :doc:`diffusion_flame.py `: An opposed-flow ethane/air diffusion flame :doc:`diffusion_flame_batch.py `: This example creates two batches of counterflow diffusion flame simulations. The first batch computes counterflow flames at increasing pressure, the second at increasing strain rates. :doc:`diffusion_flame_extinction.py `: This example computes the extinction point of a counterflow diffusion flame. A hydrogen-oxygen diffusion flame at 1 bar is studied. :doc:`flame_fixed_T.py `: A burner-stabilized, premixed methane/air flat flame with multicomponent transport properties and a specified temperature profile. :doc:`flamespeed_sensitivity.py `: Sensitivity analysis for a freely-propagating, premixed methane-air flame. Computes the sensitivity of the laminar flame speed with respect to each reaction rate constant. :doc:`premixed_counterflow_flame.py `: An opposed-flow premixed strained flame :doc:`premixed_counterflow_twin_flame.py `: Simulate two counter-flow jets of reactants shooting into each other. This simulation differs from the similar premixed_counterflow_flame.py example as the latter simulates a jet of reactants shooting into products. :doc:`stagnation_flame.py `: A detached flat flame stabilized at a stagnation point Multiphase Mixtures ------------------- :doc:`adiabatic.py `: Adiabatic flame temperature and equilibrium composition for a fuel/air mixture as a function of equivalence ratio, including formation of solid carbon. :doc:`plasma_equilibrium.py `: An equilibrium example with charged species in the gas phase and multiple condensed phases. Surface Chemistry ----------------- :doc:`catalytic_combustion.py `: CATCOMB -- Catalytic combustion of methane on platinum. :doc:`diamond_cvd.py `: A CVD example simulating growth of a diamond film :doc:`sofc.py `: A simple model of a solid oxide fuel cell.