# Reference example: compact current-syntax MKX input.
#
# Use this file as a quick syntax reference for a transient simulation with
# standard sensitivity analyses.

# Reusable constants for the reaction models.
let A_site = 1e-20
let arr_base = {Vf=1e13, Vb=1e13}

# Species in the mechanism.
# `CO2` is the key product, and `tdrc` tags opt surface species into TDRC.
components {
  CO  {phase=gas, init=2.0, role=reactant},
  O2  {phase=gas, init=1.0, role=reactant},
  CO2 {phase=gas, init=0.0, role=product, tags=[key], label="Carbon dioxide"},
  CO* {phase=surface, init=0.0, tags=["tdrc"]},
  O*  {phase=surface, init=0.0, tags=["tdrc"]},
  CO2*{phase=surface, init=0.0, tags=["tdrc"]},
  *   {phase=surface, init=1.0, tags=["emptysite"]},
}

# Elementary reaction steps.
reactions {
  {CO}+{*}=>{CO*} @ HertzKnudsenDefault(Asite=A_site, m=28, theta=2.8, sigma=1, S=1, Edes=71e3) {tags=[drc]},
  {O2}+2{*}=>2{O*} @ HertzKnudsenDefault(Asite=A_site, m=32, theta=2.08, sigma=2, S=1, Edes=264e3) {tags=[drc]},
  {CO*}+{O*}=>{CO2*}+{*} @ ArrheniusDefault(*arr_base, Eaf=133e3, Eab=213e3) {tags=[drc]},
}

# Transient solve across a small temperature sweep.
simulation {
  baseline @ transient_solve(
    model = thermal,
    solver = {method = cvode_bdf, atol = 1e-10, rtol = 1e-10, t_end = 1e8},
    analyses = [
      {type = reaction_orders, enabled = true},
      {type = drc, enabled = true},
      {type = eapp, enabled = true},
    ],
    conditions = [{T = 550}, {T = 600}, {T = 650}, {T = 700}, {T = 750}, {T = 800}]
  ),
}

# Output written for easy inspection in tables or HDF5.
output {
  formats = [excel, tabdelim, hdf5],
  folder = "results_basic"
}
