Skip to content
Preview.yaml@modelscript/cantera 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica, DAE
Live ExampleHydrogenAirMechanism.cti

Cantera H2/O2 Elementary Reaction Mechanism

Gas-phase chemical kinetics mechanism with NASA-7 thermodynamic polynomials and modified Arrhenius rate coefficients.

Playground
Source (13 lines)
1units(length="cm", time="s", quantity="mol", act_energy="cal/mol")
2 
3ideal_gas(
4    name="h2_air_mix",
5    elements="H O N Ar",
6    species="H2 O2 H O OH H2O N2",
7    reactions="all",
8    initial_state=state(temperature=1200.0, pressure=101325.0, mole_fractions="H2:2.0, O2:1.0, N2:3.76")
9)
10 
11reaction("H + O2 <=> O + OH", [3.547e15, -0.406, 16599.0])
12reaction("O + H2 <=> H + OH", [5.080e04,  2.670,  6290.0])
13reaction("H2 + OH <=> H2O + H", [2.160e08, 1.510, 3430.0])
Cantera Gas-Phase Reaction Network
NASA-7 thermo net production «ideal_gas» h2_air_mix «parameters» T = 1200 K P = 101325 Pa «arrhenius network» ElementaryRxns «model» H + O2 <=> O + OH O + H2 <=> H + OH «ode integrator» IgnitionDelay «verification» species = 7 reactions = 3
Drag to pan · Click % to reset

Cantera Chemical Kinetics & Thermochemistry (.yaml, .cti) ​

@modelscript/cantera (languages/cantera) provides native WebAssembly parsing, NASA-7 polynomial thermodynamic evaluation (Cp∘(T), H∘(T), S∘(T), G∘(T)), modified Arrhenius and Troe falloff reaction rate calculation, non-isothermal batch reactor ODE integration, DAEBuilder lowering, and SBML / Modelica projections for Cantera gas-phase combustion, catalysis, and chemical kinetics mechanisms.


Supported Extensions & Standards ​

ExtensionFormatDescription
.yamlCantera YAMLModern Cantera 2.5+ / 3.x YAML mechanism format (phases, species, reactions, thermo: NASA7)
.ctiLegacy Cantera CTIClassic Cantera ideal_gas, species, and reaction mechanism definitions

Key Capabilities ​

1. NASA-7 Thermochemical Polynomials ​

  • Evaluates two-range (low-T / high-T) 7-coefficient NASA polynomials for every species:Cp∘(T)R=a0+a1T+a2T2+a3T3+a4T4H∘(T)RT=a0+a12T+a23T2+a34T3+a45T4+a5TS∘(T)R=a0ln⁡T+a1T+a22T2+a33T3+a44T4+a6
  • Verifies continuity of Cp∘, H∘, and S∘ across the midpoint splitting temperature Tmid.

2. Elementary, Three-Body & Troe Falloff Kinetics ​

  • Computes forward and reverse rate constants via modified Arrhenius expressions and thermodynamic equilibrium constants Kc(T)=exp⁡(−ΔG∘/RT):kf(T)=ATβexp(−EaRT)
  • Supports third-body collision efficiencies (+ M) and pressure-dependent Lindemann / Troe falloff formulations.

3. Batch Reactor ODE Solver & DAE Lowering ​

  • Integrates constant-volume or constant-pressure gas-phase reactor species and temperature evolution and lowers the kinetic network into @modelscript/runtime's DAEBuilder arena, Modelica 3.x, or SBML.

Pre-Flight Diagnostics ​

10 rules7 error3 warning

CodeRuleSeverityMessage
M9201element-balance-violationerrorReaction '<equation>' is not elementally balanced for element '<element>' (reactants: <reactantCount>, products: <productCount>).
M9202charge-balance-violationerrorReaction '<equation>' violates net electrical charge conservation (reactants: <reactantCharge>, products: <productCharge>).
M9203undeclared-phase-specieserrorReaction or phase '<equationOrPhase>' references species '<speciesName>' not declared in the mechanism species list.
M9204nasa7-temperature-discontinuitywarningSpecies '<speciesName>' NASA-7 polynomial has a '<propName>' discontinuity (<value>) at midpoint temperature '<Tmid>' K.
M9205invalid-nasa7-temperature-boundserrorSpecies '<speciesName>' specifies invalid NASA-7 temperature bounds [<Tmin>, <Tmid>, <Tmax>] K.
M9206negative-pre-exponential-factorerrorReaction '<equation>' specifies a non-positive pre-exponential factor '<A>'.
M9207missing-falloff-low-pressure-limiterrorFalloff reaction '<equation>' is missing required 'low-P-rate-constant' definition.
M9208duplicate-reaction-declarationwarningIdentical non-duplicate reaction '<equation>' is declared multiple times without 'duplicate: true'.
M9209negative-third-body-efficiencyerrorThird-body efficiency for '<speciesName>' in reaction '<equation>' is negative (<efficiency>).
M9210missing-species-thermowarningSpecies '<speciesName>' is missing a 'thermo' polynomial definition.

Generated from languages/cantera/src/errors.ts. All languages →


CLI Usage ​

bash
# Validate elemental balance, NASA-7 continuity, and Arrhenius parameters
msx lint H2Combustion.yaml

# Parse and inspect the Cantera mechanism structure
msx parse H2Combustion.yaml

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Pricing • Trademark Policy