Example catalog#

Pinned upstream: https://github.com/Cantera/cantera samples/python/reactors @ main.

See STONE Configuration Format for the STONE YAML format and Cantera upstream Python examples for solver mapping from upstream Cantera scripts. Networks are simulated with cantera.ReactorNet.

Steady combustor residence time#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/combustor.html

Status:

adapted

STONE:

examples/combustor.yaml

Mechanism:

gri30.yaml

Upstream sweeps residence time down from 0.1 s in 0.9x steps until the combustor extinguishes (T <= 500 K). The points must be solved sequentially, each warm-started from the previous solve, because this walks the combustor down its extinction branch – re-solving each point independently would find the ignited solution instead – and the run-set length is only known once extinction happens. Neither fits a declarative axis, so the YAML declares sweep.runner: boulder_examples.sweeps:combustor, which Boulder resolves and calls in-process. It writes one scenario per residence time with residence_time_s/final_temperature_K/heat_release_rate_w_m3 attrs – pick Residence Time S / Heat Release Rate in the Sweep results pane’s axis selectors for the same plot upstream’s script produces.

_images/combustor.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/combustor.yaml --no-open

Piston reactor with heat transfer#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/reactor2.html

Status:

adapted

STONE:

examples/reactor2.yaml

Mechanism:

gri30.yaml

Transient advance-grid example. The piston wall’s expansion_rate_coeff (K) and heat_transfer_coeff (U) are both captured in STONE, so Boulder reproduces upstream’s pressure-driven piston motion and heat exchange together; plots focus on reactor temperature and pressure evolution.

_images/reactor2.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/reactor2.yaml --no-open

Nanosecond pulse discharge#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/nanosecond_pulse_discharge.html

Status:

adapted

STONE:

examples/nanosecond_pulse_discharge.yaml

Mechanism:

example_data/methane-plasma-pavan-2023.yaml

Plasma micro-step example with Gaussian reduced-electric-field signal. Upstream runs with energy: “on” so plasma heating feeds back into gas temperature and accelerates the discharge; this adapter uses energy: “off” because Cantera 3.2’s PlasmaPhase has no cp_mole() implementation, so energy: “on” raises “NotImplementedError: PlasmaPhase::cp_mole” the moment the reactor’s energy equation needs a heat capacity. Without that thermal feedback the discharge never reaches upstream’s self-sustaining avalanche regime, so temperature and product-species mole fractions stay many orders of magnitude below upstream’s plot – a genuine, currently open Cantera limitation (not a Boulder conversion defect). Re-check once PlasmaPhase::cp_mole is implemented upstream.

_images/nanosecond_pulse_discharge.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/nanosecond_pulse_discharge.yaml --no-open

Mixer with two inlet streams#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/mix1.html

Status:

adapted

STONE:

examples/mix1.yaml

Mechanism:

gri30.yaml

Dual-mechanism steady mixer with MFC and valve; uses solve_steady and OutletSink for the downstream boundary.

_images/mix1.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/mix1.yaml --no-open

Constant-pressure ignition#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/reactor1.html

Status:

adapted

STONE:

examples/reactor1.yaml

Mechanism:

h2o2.yaml

Single IdealGasConstPressureReactor with temperature advance limit and advance_grid transient integration.

_images/reactor1.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/reactor1.yaml --no-open

Periodic CSTR#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/periodic_cstr.html

Status:

adapted

STONE:

examples/periodic_cstr.yaml

Mechanism:

h2o2.yaml

CSTR with MFC, valve, and heat-transfer wall.

_images/periodic_cstr.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/periodic_cstr.yaml --no-open

Fuel injection with Gaussian pulse#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/fuel_injection.html

Status:

adapted

STONE:

examples/fuel_injection.yaml

Mechanism:

nDodecane_Reitz.yaml

Transient fuel pulse; Gaussian MFC signal when AST detection succeeds.

_images/fuel_injection.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/fuel_injection.yaml --no-open

Preconditioned single-reactor integration#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/preconditioned_integration.html

Status:

unsupported

Reason:

Compares integration wall-clock time with vs. without a sparse preconditioner across two full re-runs of the same network – a solver-performance A/B benchmark, not a single network solve, so it has no STONE representation (same class of issue as preconditioned_network below). The n-heptane-NUIG-2016.yaml mechanism it needs is already vendored under upstream/cantera/example_data/.

1D packed bed (DAE)#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/1D_packed_bed.html

Status:

unsupported

Reason:

Custom scikits.odes DAE packed-bed model; no global ReactorNet.

1D PFR surface chemistry#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/1D_pfr_surfchem.html

Status:

unsupported

Reason:

Uses FlowReactor + ReactorSurface, now supported by Boulder (see surf_pfr below and parks4/boulder#112) – not yet adapted here: this script’s mechanism (SiF4_NH3_mec.yaml, silicon nitride deposition) and matplotlib-only diagnostics (deposition rate, surface site fractions) need their own STONE mapping, tracked separately from surf_pfr’s simpler single-species-output case.

Continuous reactor temperature sweep#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/continuous_reactor.html

Status:

adapted

STONE:

examples/continuous_reactor.yaml

Mechanism:

gri30.yaml

The outer temperature sweep is declared inline. One swept value must reach two nodes – the feed reservoir and the reactor’s own initial state, since the reactor runs energy: “off” – which a single-target axis could not express; a multi-target sweep path: list drives them in lockstep, so all eleven upstream temperatures run from the YAML with no script. Boulder records each point’s axis value as a t0_K scenario attr, giving the Sweep results pane its X axis. Mechanism substituted: upstream’s example_data/n-heptane-NUIG-2016.yaml (1268 species) is not bundled in Boulder CI’s Cantera distribution and is also impractically slow to clone through Boulder’s per-node solve pipeline; this repo vendors it under upstream/cantera/example_data/ for provenance, but the shipped example uses the bundled gri30.yaml (CH4/O2/N2) — same CSTR topology and sweep methodology, CH4/CO/O2 in place of NC7H16/CO/O2.

_images/continuous_reactor.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/continuous_reactor.yaml --no-open

Custom SciPy ODE#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/custom.html

Status:

unsupported

Reason:

No ReactorNet; integrates ODEs directly with SciPy.

Extensible inertial wall reactor#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/custom2.html

Status:

unsupported

Reason:

ExtensibleIdealGasReactor subclass with extra state is not rebuildable in Boulder.

Internal combustion engine cycle#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/ic_engine.html

Status:

unsupported

Reason:

Valves and MFCs use time_function lambdas and moving piston walls.

Non-ideal shock tube ignition delay sweep#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/non_ideal_shock_tube.html

Status:

unsupported

Reason:

Multi-temperature IDT sweep and real-gas phase switching are not static STONE.

Plug-flow reactor (two methods)#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/pfr.html

Status:

unsupported

Reason:

Multiple ReactorNet objects and chain/Lagrangian algorithms are not one static YAML.

Moving piston with velocity wall#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/piston.html

Status:

adapted

STONE:

examples/piston.yaml

Mechanism:

gri30.yaml

Dual-mechanism piston (h2o2.yaml left / gri30.yaml right) driven purely by a Wall velocity callable – no expansion_rate_coeff/heat_transfer_coeff at all. Wall velocity Func1s (Cantera 3.0+) always read back as the evaluated float at the network’s current time (same limitation as MassFlowController.mass_flow_rate), so sim2stone recovers the closure from source via AST detection instead: a {closure: pressure_proportional, coeff, start_time} spec matching upstream’s def v(t): if t < 0.1: return 0.0 else: return (r1.phase.P - r2.phase.P) * 1e-4. Dual-mechanism itself needed no new work – per-node mechanism overrides already existed (see reactor2.yaml).

_images/piston.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/piston.yaml --no-open

Isothermal plasma electron balance#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/plasma.html

Status:

unsupported

Reason:

No ReactorNet; SciPy ODE for electron density directly. Not representable as a static STONE network, but this class of custom-ODE model can be implemented in Boulder today via a plugin using boulder.CustomStageNetwork (https://parks4.github.io/boulder/_api/boulder/index.html#boulder.CustomStageNetwork), see the “Extending Boulder with plugins” section of usage.rst (parks4/boulder).

Porous media burner cascade#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/porous_media_burner.html

Status:

unsupported

Reason:

Custom ExtensibleIdealGasConstPressureReactor cascade with radiation.

Preconditioned multi-sector network#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/preconditioned_network.html

Status:

unsupported

Reason:

Multiple coupled networks and preconditioner benchmarking loops.

Sensitivity analysis#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/sensitivity1.html

Status:

unsupported

Reason:

ReactorNet sensitivity API is not represented in STONE.

Surface PFR (FlowReactor)#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/surf_pfr.html

Status:

adapted

STONE:

examples/surf_pfr.yaml

Mechanism:

methane_pox_on_pt.yaml

Real distance-marched ct.FlowReactor + ct.ReactorSurface (catalytic methane partial oxidation over Pt), not a chain-of-CSTRs approximation – solved via solver.axis: distance (parks4/boulder#112). The adapter stops before the distance-marching loop (kept under if False:, same convention as piston.py’s stepping guard) so sim2stone captures the true inlet state instead of the fully-converted outlet state. FlowReactor.mass_flow_rate is write-only in the Cantera 3.2 Python API; sim2stone recovers it from continuity (density x speed x area) instead of a direct read. Known gap: download_script_emitter.py doesn’t support FlowReactor yet (a separate reactor-dispatch pathway from create_reactor_from_node), so the –download native-script test is skipped for this example – YAML validation, normalization, and the real DualCanteraConverter solve all work correctly.

_images/surf_pfr.png

Launch in GitHub Codespaces — opens this example running in Boulder, forwarded port opens in your browser.

Or run locally:

boulder examples/surf_pfr.yaml --no-open

Surface PFR chain#

Upstream:

Cantera/cantera

Cantera docs:

https://cantera.org/dev/examples/python/reactors/surf_pfr_chain.html

Status:

unsupported

Reason:

Repeated steady march with a ReactorSurface chain (a chain-of-WSRs approximation, as opposed to surf_pfr’s real distance-marched FlowReactor, now supported – see parks4/boulder#112) is an algorithm, not static STONE: it re-solves the same WSR to steady state once per chain link, carrying the converged state forward as the next link’s inlet. Out of scope for a single STONE description.