PyTeCK: A Python-based
automatic testing package for
chemical kinetic models
Kyle Niemeyer
Oregon State University
SciPy 2016
12 July 2016
Kyle.Niemeyer@oregonstate.edu
@kyleniemeyer
kyleniemeyer.com
PyTeCK: Python-based
testing of chemical kinetic
models
2
PyTeCK: Python-based
testing of chemical kinetic
models
2
Why Study Combustion?
3
Why Study Combustion?
Combustion
85% of the world’s power comes from combustion
3
4
4
5
5
What can we do?
6
What can we do?
Improve
Efficiency:
6
What can we do?
Improve
Efficiency:
30 mpg
6
What can we do?
Improve
Efficiency:
54.5 mpg30 mpg
6
What can we do?
Improve
Efficiency:
54.5 mpg30 mpg
Cleaner: CO NOx Soot
6
What can we do?
Improve
Efficiency:
54.5 mpg30 mpg
Cleaner: CO NOx Soot
6
Modeling drives design
7
8
H2
Hydrogen Oxidation
O2 H2O+
9
H22
Hydrogen Oxidation
O2 H2O+ 2
9
H + O2 O + OH
H2 + O H + OH
H2 + OH H2O + H
2OH H2O + O
H2 + M 2H + M
O2 + M 2O + M
O + H + M OH + M
H2O+ MH + OH + M
2H2O H + OH + H2O
H + O2 HO2
HO2 + HH2 + O2
HO2 + H 2OH
HO2 + O O2 + OH
HO2 + OH H2O + O2
2HO2 H2O2 + O2
H2O2 2OH
H2O2 + H H2O + OH
H2O2 + H HO2 + H2
H2O2 + O OH + HO2
H2O2 + OH HO2 + H2O
H2
Hydrogen Oxidation
O2
H2O
9
Validation, schmalidation.
10
Validation, schmalidation.
10
Shock tube1
Validation, schmalidation.
10
Shock tube1 Rapid compression machine2
Validation, schmalidation.
10
Shock tube1
Counterflow flame3
Rapid compression machine2
Validation, schmalidation.
10
Shock tube1
Counterflow flame3
and for the study of the cracking kinetics of biomass pyrolysis vapours (Baumlin et al. 2005).
8.2 Jet-Stirred Reactor Construction Rules
The basis for the design of spherical jet-stirred reactors was proposed by the team of Profe
Nancy (France) in the seventies (Matras and Villermaux 1973; David and Matras 1975). A
(1969) proposed rules for the construction for cylindrical jet-stirred reactors. Although both d
for gas phase kinetic studies, spherical jet-stirred reactors are preferred to minimize dead vol
ter we focus on the design of spherical jet-stirred reactors.
The jet-stirred reactor designed by the team of Villermaux is composed of a sphere in whic
place. The fresh gases enter the reactor through an injection cross located at the center of th
posed of four nozzles providing the jets ensuring the mixing of the gas phase. Fig. 8.2 displ
jet-stirred reactor which is still in use at the Laboratoire Réactions et Génie des Procédés (N
which was developed from the rules of construction proposed by the team of professor Villerm
Fig. 8.2 Picture of the jet-stirred reactor used in Nancy (France) and which was developed from the rules of c
by the group of professor Villermaux
Jet-stirred reactor4
Rapid compression machine2
Validation, schmalidation.
10
Shock tube1 Rapid compression machine2
11
Autoignition
The problem: 

experimental data
12
The problem: 

experimental data
12
PDF table5
The problem: 

experimental data
12
PDF table5
t [ms3 ~- metric benzene-air mixture.
region the dependence of the ignition delay
time upon temperature can be expressed ap-
proximately by straight lines in the Arrhenius
plot. The corresponding global activation ener-
gies decrease with increasing pressure.
For Ps around 13.5 bar the dependence be-
comes strongly nonlinear in a temperature
range between 950 and 700 K. In this interme-
diate temperature region a decrease in ignition
delay time is observed with decreasing temper-
atures. This leads to an S-shaped curve with a
maximum and a minimum. Between both ex-
termal values the dependence possesses a neg-
ative temperature coefficient. The position of
this transition region shifts to higher tempera-
tures with increasing pressures Ps- In the low-
temperature region--below approximately 700
K--the dependence of the ignition delay time
upon temperature can again be expressed by a
linear dependence. Because the measuring time
of the shock tube is limited, the delay times
could be determined only above 660 K, so that
only a short part of the low-temperature region
could be investigated in our experiments. The
influence of pressure on the ignition delay is
most pronounced in the transition region,
smallest for low temperatures and of varying
degree in the high-temperature region, where
with increasing temperature this dependence
becomes smaller.
"1~z
[ms]
101
100
1o-1
162
,, 3.2bar ,,./--~-~.~ /.-'~
o 6.s ,, ./  '---J.//
O I£3 " / ' / n []  ..~-/
30 ,,,, .o
,~_ D,,- x i<  3 bar 1 Comoufofion
~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " ,
t/~ / /" !.ine of /+0 " j el'. a[.
/.z~ ~/ ./ pressure variation
,/~// T=9/,0 K (Fig.11) T
/ 1200 1000 800 [K]
I I I i I I I I I l I
0:8 1.o 1.2 114 loooK
T
Fig. 3. Ignition delay times.
Figure6
The problem: 

experimental data
12
PDF table5
t [ms3 ~- metric benzene-air mixture.
region the dependence of the ignition delay
time upon temperature can be expressed ap-
proximately by straight lines in the Arrhenius
plot. The corresponding global activation ener-
gies decrease with increasing pressure.
For Ps around 13.5 bar the dependence be-
comes strongly nonlinear in a temperature
range between 950 and 700 K. In this interme-
diate temperature region a decrease in ignition
delay time is observed with decreasing temper-
atures. This leads to an S-shaped curve with a
maximum and a minimum. Between both ex-
termal values the dependence possesses a neg-
ative temperature coefficient. The position of
this transition region shifts to higher tempera-
tures with increasing pressures Ps- In the low-
temperature region--below approximately 700
K--the dependence of the ignition delay time
upon temperature can again be expressed by a
linear dependence. Because the measuring time
of the shock tube is limited, the delay times
could be determined only above 660 K, so that
only a short part of the low-temperature region
could be investigated in our experiments. The
influence of pressure on the ignition delay is
most pronounced in the transition region,
smallest for low temperatures and of varying
degree in the high-temperature region, where
with increasing temperature this dependence
becomes smaller.
"1~z
[ms]
101
100
1o-1
162
,, 3.2bar ,,./--~-~.~ /.-'~
o 6.s ,, ./  '---J.//
O I£3 " / ' / n []  ..~-/
30 ,,,, .o
,~_ D,,- x i<  3 bar 1 Comoufofion
~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " ,
t/~ / /" !.ine of /+0 " j el'. a[.
/.z~ ~/ ./ pressure variation
,/~// T=9/,0 K (Fig.11) T
/ 1200 1000 800 [K]
I I I i I I I I I l I
0:8 1.o 1.2 114 loooK
T
Fig. 3. Ignition delay times.
Figure6
# n-heptane ignition delay from Colket and Spadaccini 2001
# P (atm), T (K), Ignition Delay (µs)
# Mole Fraction nC7H16 O2 Ar : 0.00192 0.04224 0.95584
7.72 ,1393 ,85
7.78 ,1299 ,345
7.04 ,1235 ,631
6.38 ,1299 ,348
7.53 ,1372 ,134
6.08 ,1236 ,678
7.35 ,1340 ,148
6.63 ,1328 ,211
6.94 ,1395 ,89
CSV file7
The problem: 

experimental data
12
PDF table5
t [ms3 ~- metric benzene-air mixture.
region the dependence of the ignition delay
time upon temperature can be expressed ap-
proximately by straight lines in the Arrhenius
plot. The corresponding global activation ener-
gies decrease with increasing pressure.
For Ps around 13.5 bar the dependence be-
comes strongly nonlinear in a temperature
range between 950 and 700 K. In this interme-
diate temperature region a decrease in ignition
delay time is observed with decreasing temper-
atures. This leads to an S-shaped curve with a
maximum and a minimum. Between both ex-
termal values the dependence possesses a neg-
ative temperature coefficient. The position of
this transition region shifts to higher tempera-
tures with increasing pressures Ps- In the low-
temperature region--below approximately 700
K--the dependence of the ignition delay time
upon temperature can again be expressed by a
linear dependence. Because the measuring time
of the shock tube is limited, the delay times
could be determined only above 660 K, so that
only a short part of the low-temperature region
could be investigated in our experiments. The
influence of pressure on the ignition delay is
most pronounced in the transition region,
smallest for low temperatures and of varying
degree in the high-temperature region, where
with increasing temperature this dependence
becomes smaller.
"1~z
[ms]
101
100
1o-1
162
,, 3.2bar ,,./--~-~.~ /.-'~
o 6.s ,, ./  '---J.//
O I£3 " / ' / n []  ..~-/
30 ,,,, .o
,~_ D,,- x i<  3 bar 1 Comoufofion
~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " ,
t/~ / /" !.ine of /+0 " j el'. a[.
/.z~ ~/ ./ pressure variation
,/~// T=9/,0 K (Fig.11) T
/ 1200 1000 800 [K]
I I I i I I I I I l I
0:8 1.o 1.2 114 loooK
T
Fig. 3. Ignition delay times.
Figure6
# n-heptane ignition delay from Colket and Spadaccini 2001
# P (atm), T (K), Ignition Delay (µs)
# Mole Fraction nC7H16 O2 Ar : 0.00192 0.04224 0.95584
7.72 ,1393 ,85
7.78 ,1299 ,345
7.04 ,1235 ,631
6.38 ,1299 ,348
7.53 ,1372 ,134
6.08 ,1236 ,678
7.35 ,1340 ,148
6.63 ,1328 ,211
6.94 ,1395 ,89
CSV file7 Email plea
The problem: 

qualitative vs. quantitative
13
The problem: 

qualitative vs. quantitative
13
del
ne,
ne,
Re-
ng
ev-
he
an
ee-
ha-
ed
by sensitivity analysis [25–27], except for the small molecules
(i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component
fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu-
ene oxidation is formed and presented in Supplementary data A.
2.2. The sub-mechanism of DIB
A detailed mechanism considered two isomers of DIB, i.e. 2,4,
4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene
(IC8H16), was developed by Metcalfe et al. [28]. The detailed model
consists of 897 species and 3783 elementary reactions. However,
0.1
1
10
100
Toluene/N-heptane/air
Expt. Present
P = 5MPa
P = 3MPa
P = 1MPa
1000/T (1/K)
Ignitiondelaytime(ms)
(a) φ=1.0
0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
1
10
100
Expt. Present
P = 5MPa
P = 3MPa
Toluene/N-heptane/air
Ignitiondelaytime(ms)
The problem: 

qualitative vs. quantitative
13
del
ne,
ne,
Re-
ng
ev-
he
an
ee-
ha-
ed
by sensitivity analysis [25–27], except for the small molecules
(i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component
fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu-
ene oxidation is formed and presented in Supplementary data A.
2.2. The sub-mechanism of DIB
A detailed mechanism considered two isomers of DIB, i.e. 2,4,
4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene
(IC8H16), was developed by Metcalfe et al. [28]. The detailed model
consists of 897 species and 3783 elementary reactions. However,
0.1
1
10
100
Toluene/N-heptane/air
Expt. Present
P = 5MPa
P = 3MPa
P = 1MPa
1000/T (1/K)
Ignitiondelaytime(ms)
(a) φ=1.0
0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
1
10
100
Expt. Present
P = 5MPa
P = 3MPa
Toluene/N-heptane/air
Ignitiondelaytime(ms)
“…the calculations show
good agreements with
experiments…”8
The problem: 

qualitative vs. quantitative
13
del
ne,
ne,
Re-
ng
ev-
he
an
ee-
ha-
ed
by sensitivity analysis [25–27], except for the small molecules
(i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component
fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu-
ene oxidation is formed and presented in Supplementary data A.
2.2. The sub-mechanism of DIB
A detailed mechanism considered two isomers of DIB, i.e. 2,4,
4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene
(IC8H16), was developed by Metcalfe et al. [28]. The detailed model
consists of 897 species and 3783 elementary reactions. However,
0.1
1
10
100
Toluene/N-heptane/air
Expt. Present
P = 5MPa
P = 3MPa
P = 1MPa
1000/T (1/K)
Ignitiondelaytime(ms)
(a) φ=1.0
0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
1
10
100
Expt. Present
P = 5MPa
P = 3MPa
Toluene/N-heptane/air
Ignitiondelaytime(ms)
“…the calculations show
good agreements with
experiments…”8
“…although there is a
mismatch […] at […] T < 1000 K.”
The problem: 

qualitative vs. quantitative
13
del
ne,
ne,
Re-
ng
ev-
he
an
ee-
ha-
ed
by sensitivity analysis [25–27], except for the small molecules
(i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component
fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu-
ene oxidation is formed and presented in Supplementary data A.
2.2. The sub-mechanism of DIB
A detailed mechanism considered two isomers of DIB, i.e. 2,4,
4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene
(IC8H16), was developed by Metcalfe et al. [28]. The detailed model
consists of 897 species and 3783 elementary reactions. However,
0.1
1
10
100
Toluene/N-heptane/air
Expt. Present
P = 5MPa
P = 3MPa
P = 1MPa
1000/T (1/K)
Ignitiondelaytime(ms)
(a) φ=1.0
0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
1
10
100
Expt. Present
P = 5MPa
P = 3MPa
Toluene/N-heptane/air
Ignitiondelaytime(ms)
model. Figure 5 shows the comparison of the igni-
tion delay times of PRF/toluene mixtures at 25
and 50 atm [1]. The species mole fractions in the
oxidation of PRF/toluene at 12.5 atm obtained
by a flow reactor experiment [7] are compared in
Fig. 6. Those figures indicate that the present
model well predicts the reactivity of PRF/toluene
mixtures at wide range of temperature and pres-
(dashed
addition
reproduc
mixtures
of cross
Reac
perform
PRF/tol
10
0.6 0.7 0.8 0.9
T-1
(103
K-1
)
12 atm
50 atm
Fig. 2. Comparisons of measured and simulated ignition
delay times of toluene at the equivalence ratio of 0.5%
and 1.2% fuels diluted in Ar or air behind reflected shock
waves at 2 [33], 15 and 50 atm [34]. Solid curves: present
model, dashed curves: Pitz model.
10
100
1000
10000
0.75 0.80 0.85 0.90 0.95 1.00
T-1
(103
K-1
)
Ignitiondelaytimes(µs)
Fig. 3. Comparisons of measured and simulated ignition
delay times of toluene behind reflected shock waves at
50 atm [34]. Solid curves: present model, dashed curves:
Pitz model.
0.00
Fig. 4.
CO + CO
by the flo
of initial
dashed cu
1
10
70
Ignitiondelaytimes(µs)
Fig. 5. C
delay tim
heptane/i
shock wa
present m
“…the calculations show
good agreements with
experiments…”8
“…although there is a
mismatch […] at […] T < 1000 K.”
The problem: 

qualitative vs. quantitative
13
del
ne,
ne,
Re-
ng
ev-
he
an
ee-
ha-
ed
by sensitivity analysis [25–27], except for the small molecules
(i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component
fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu-
ene oxidation is formed and presented in Supplementary data A.
2.2. The sub-mechanism of DIB
A detailed mechanism considered two isomers of DIB, i.e. 2,4,
4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene
(IC8H16), was developed by Metcalfe et al. [28]. The detailed model
consists of 897 species and 3783 elementary reactions. However,
0.1
1
10
100
Toluene/N-heptane/air
Expt. Present
P = 5MPa
P = 3MPa
P = 1MPa
1000/T (1/K)
Ignitiondelaytime(ms)
(a) φ=1.0
0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5
1
10
100
Expt. Present
P = 5MPa
P = 3MPa
Toluene/N-heptane/air
Ignitiondelaytime(ms)
model. Figure 5 shows the comparison of the igni-
tion delay times of PRF/toluene mixtures at 25
and 50 atm [1]. The species mole fractions in the
oxidation of PRF/toluene at 12.5 atm obtained
by a flow reactor experiment [7] are compared in
Fig. 6. Those figures indicate that the present
model well predicts the reactivity of PRF/toluene
mixtures at wide range of temperature and pres-
(dashed
addition
reproduc
mixtures
of cross
Reac
perform
PRF/tol
10
0.6 0.7 0.8 0.9
T-1
(103
K-1
)
12 atm
50 atm
Fig. 2. Comparisons of measured and simulated ignition
delay times of toluene at the equivalence ratio of 0.5%
and 1.2% fuels diluted in Ar or air behind reflected shock
waves at 2 [33], 15 and 50 atm [34]. Solid curves: present
model, dashed curves: Pitz model.
10
100
1000
10000
0.75 0.80 0.85 0.90 0.95 1.00
T-1
(103
K-1
)
Ignitiondelaytimes(µs)
Fig. 3. Comparisons of measured and simulated ignition
delay times of toluene behind reflected shock waves at
50 atm [34]. Solid curves: present model, dashed curves:
Pitz model.
0.00
Fig. 4.
CO + CO
by the flo
of initial
dashed cu
1
10
70
Ignitiondelaytimes(µs)
Fig. 5. C
delay tim
heptane/i
shock wa
present m
“In general, the present
model predicts well the
reactivity of […] mixtures…”9
“…the calculations show
good agreements with
experiments…”8
“…although there is a
mismatch […] at […] T < 1000 K.”
The solution
14
The solution
14
(s)
The solution
14
(s)
ChemKED: Chemical Kinetics Experimental Data format
The solution
14
(s)
ChemKED: Chemical Kinetics Experimental Data format
+
The solution
14
(s)
PyTeCK: Python-based testing of chemical kinetic models
ChemKED: Chemical Kinetics Experimental Data format
+
ChemKED
15
ChemKED
Written in YAML
15
ChemKED
Written in YAML
Human- AND
machine-readable!
15
ChemKED
Written in YAML
Human- AND
machine-readable!
Parsers and libraries
for nearly every
language!
15
ChemKED components
16
ChemKED components (2)
17
ChemKED components (3)
18
PyTeCK
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
• Interpreting & coverting units: Pint (pint.readthedocs.org)
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
• Interpreting & coverting units: Pint (pint.readthedocs.org)
• HDF5 file manipulation: PyTables (pytables.org)
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
• Interpreting & coverting units: Pint (pint.readthedocs.org)
• HDF5 file manipulation: PyTables (pytables.org)
• Chemical kinetics work: Cantera (cantera.org)
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
• Interpreting & coverting units: Pint (pint.readthedocs.org)
• HDF5 file manipulation: PyTables (pytables.org)
• Chemical kinetics work: Cantera (cantera.org)
• Unit testing: pytest (docs.pytest.org)
19
PyTeCK
• Version control: git & GitHub (github.com/kyleniemeyer/PyTeCK)
• Manipulating arrays: NumPy
• Spline interpolation: SciPy
• Interpreting & coverting units: Pint (pint.readthedocs.org)
• HDF5 file manipulation: PyTables (pytables.org)
• Chemical kinetics work: Cantera (cantera.org)
• Unit testing: pytest (docs.pytest.org)
• Continuous integration: Travis-CI (travis-ci.org)
19
Handling units
20
Handling units
20
•Pint interprets units in
ChemKED files
(pint.readthedocs.org)
Handling units
20
•Pint interprets units in
ChemKED files
(pint.readthedocs.org)
•Checks quantity values
Handling units
20
•Pint interprets units in
ChemKED files
(pint.readthedocs.org)
•Checks quantity values
•Thanks Katy Huff!
(https://pyrk.github.io/)
PyTeCK components
21
PyTeCK components
21
• parse_files: read all necessary data to recreate experiment
from ChemKED YAML file, using PyYAML. Creates list of
Simulation objects from experiment properties.
PyTeCK components
21
• parse_files: read all necessary data to recreate experiment
from ChemKED YAML file, using PyYAML. Creates list of
Simulation objects from experiment properties.
• simulation: provides Simulation class, and associated
VolumeProfile and PressureRiseProfile classes.
PyTeCK components
21
• parse_files: read all necessary data to recreate experiment
from ChemKED YAML file, using PyYAML. Creates list of
Simulation objects from experiment properties.
• simulation: provides Simulation class, and associated
VolumeProfile and PressureRiseProfile classes.
• eval_model: runs the show. Uses multiprocessing module to
set up and run Simulation objects in parallel, then processes
results.
PyTeCK components
21
• parse_files: read all necessary data to recreate experiment
from ChemKED YAML file, using PyYAML. Creates list of
Simulation objects from experiment properties.
• simulation: provides Simulation class, and associated
VolumeProfile and PressureRiseProfile classes.
• eval_model: runs the show. Uses multiprocessing module to
set up and run Simulation objects in parallel, then processes
results.
Other modules: detect_peaks, exceptions, utils, validation
Simulation
22
dT
dt
=
1
cv
0
@
Nsp
X
i=1
ei
dYi
dt
+ p
dv
dt
1
A
dYi
dt
=
1
⇢
Wi ˙!i i = 1, . . . , Nspecies
Simulation
22
dT
dt
=
1
cv
0
@
Nsp
X
i=1
ei
dYi
dt
+ p
dv
dt
1
A
dYi
dt
=
1
⇢
Wi ˙!i i = 1, . . . , Nspecies
cantera.ReactorNet
cantera.IdealGasReactor
cantera.Wall
cantera.Reservior
Simulation (2)
23
Simulation (2)
23
Constant volume, adiabatic:
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
p(t) = p0 +
Z tend
0
dp
dt
dt
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
p(t) = p0 +
Z tend
0
dp
dt
dt v(t) = v0
⇢0
⇢(t) s0
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
Wall(…, velocity=PressureRiseProfile(…))
p(t) = p0 +
Z tend
0
dp
dt
dt v(t) = v0
⇢0
⇢(t) s0
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
Wall(…, velocity=PressureRiseProfile(…))
p(t) = p0 +
Z tend
0
dp
dt
dt v(t) = v0
⇢0
⇢(t) s0
Given volume history:
Simulation (2)
23
Constant volume, adiabatic:
dv
dt
= 0 Wall(…, velocity=0)
Constant pressure rise:
Wall(…, velocity=PressureRiseProfile(…))
p(t) = p0 +
Z tend
0
dp
dt
dt v(t) = v0
⇢0
⇢(t) s0
Given volume history: Wall(…, velocity=VolumeProfile(…))
Simulation.process_results()
24
Simulation.process_results()
24
• Have: time history
(HDF5)
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
• detect_peaks
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
• detect_peaks
• Options:
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
• detect_peaks
• Options:
• Max, d/dt max
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
• detect_peaks
• Options:
• Max, d/dt max
• P, T, OH, CH
Simulation.process_results()
24
• Have: time history
(HDF5)
• Need: ignition delay time
• detect_peaks
• Options:
• Max, d/dt max
• P, T, OH, CH
eval_model
25
eval_model
• parse_files.read_experiment()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
• estimate_std_dev()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
• estimate_std_dev()
• multiprocessing.Pool()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
• estimate_std_dev()
• multiprocessing.Pool()
• Simulation.setup_case()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
• estimate_std_dev()
• multiprocessing.Pool()
• Simulation.setup_case()
• Simulation.run_case()
25
eval_model
• parse_files.read_experiment()
• parse_files.create_simulations()
• estimate_std_dev()
• multiprocessing.Pool()
• Simulation.setup_case()
• Simulation.run_case()
• Calculate error function
25
Error function
26
Error function
26
Ei =
1
Ni
NiX
j=1
log ⌧exp
ij log ⌧sim
ij
(log ⌧exp
ij )
!2
Dataset error function:
Error function
26
Ei =
1
Ni
NiX
j=1
log ⌧exp
ij log ⌧sim
ij
(log ⌧exp
ij )
!2
Dataset error function:
Overall error function: E =
1
N
NX
i=1
Ei
The details: uncertainty
27
The details: uncertainty
Dataset standard
deviation σi:
27
The details: uncertainty
Dataset standard
deviation σi:
• Spline fit of
experimental data
27
The details: uncertainty
Dataset standard
deviation σi:
• Spline fit of
experimental data
• σi = standard deviation
of difference between
data and fit
27
The details: uncertainty
Dataset standard
deviation σi:
• Spline fit of
experimental data
• σi = standard deviation
of difference between
data and fit
• Minimum allowable: 10%
27
Example
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
• 14 publications, 54 data sets, 786 data points
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
• 14 publications, 54 data sets, 786 data points
• Original publications from 1958–2013
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
• 14 publications, 54 data sets, 786 data points
• Original publications from 1958–2013
• Also collected 12 models for hydrogen combustion

(doi:10.6084/m9.figshare.3482906.v1)
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
• 14 publications, 54 data sets, 786 data points
• Original publications from 1958–2013
• Also collected 12 models for hydrogen combustion

(doi:10.6084/m9.figshare.3482906.v1)
• Published 1999–2015
28
Example
• Collected hydrogen shock-tube ignition experimental
data from the literature

(doi:10.6084/m9.figshare.3482918.v1)
• 14 publications, 54 data sets, 786 data points
• Original publications from 1958–2013
• Also collected 12 models for hydrogen combustion

(doi:10.6084/m9.figshare.3482906.v1)
• Published 1999–2015
• Subset of study by Olm et al.10
28
Hydrogen model performance
29
Plans for PyTeCK
30
Plans for PyTeCK
• Better documentation with Sphinx, hosted on
Read The Docs
30
Plans for PyTeCK
• Better documentation with Sphinx, hosted on
Read The Docs
• Better functional testing, especially for rapid
compression machine simulations
30
Plans for PyTeCK
• Better documentation with Sphinx, hosted on
Read The Docs
• Better functional testing, especially for rapid
compression machine simulations
• Support other fundamental experimental
methods, such as laminar flames and jet-stirred
reactors
30
Plans for PyTeCK
• Better documentation with Sphinx, hosted on
Read The Docs
• Better functional testing, especially for rapid
compression machine simulations
• Support other fundamental experimental
methods, such as laminar flames and jet-stirred
reactors
• PyPI submission
30
Thank you! Questions?
31
Acknowledgements: Bryan Weber, Matt McCormick,
Erik Tollerud, & Katy Huff
Thank you! Questions?
31
?
Acknowledgements: Bryan Weber, Matt McCormick,
Erik Tollerud, & Katy Huff
Thank you! Questions?
31
?
Acknowledgements: Bryan Weber, Matt McCormick,
Erik Tollerud, & Katy Huff
https://github.com/
kyleniemeyer/PyTeCK
References
1. http://hanson.stanford.edu/index.php?loc=facilities_kst
2. http://combdiaglab.engr.uconn.edu/facilities/rapid-compression-machine/new-rapid-compression-
machine
3. http://combdiaglab.engr.uconn.edu/facilities/atmospheric-pressure-counterflow-setup-for-flame-studies
4. Olivier Herbinet, Dayma Guillaume. Jet-Stirred Reactors. F Battin-Leclerc, J M Simmie, E Blurock, eds.
Cleaner Combustion: Developing Detailed Chemical Kinetic Models, Springer, pp. 183–210, 2013, Green
Energy and Technology, 978-1-4471-5306-1. <10.1007/978-1-4471-5307-8>. <hal-00880195>
5. Burcat A, Farmer RF, Matula RA. Shock initiated ignition in heptane-oxygen-argon mixtures. 13th Int. Symp.
Shock Tubes Waves, 1981, 826–33.
6. Ciezki HK, Adomeit G. Shock-tube investigation of self-ignition of n-heptane–air mixtures under engine
relevant conditions. Combust Flame 1993;93:421–33. doi:10.1016/0010-2180(93)90142-P
7. Colket MB, Spadaccini LJ. Scramjet fuels autoignition study. J. Propul. Power 17 (2) (2001) 315–323. doi:
10.2514/2.5744
8. Zhong B-J, Zheng D. A chemical mechanism for ignition and oxidation of multi-component gasoline
surrogate fuels. Fuel 2014;128:458–66. doi:10.1016/j.fuel.2014.03.044.
9. Sakai Y, Miyoshi A, Koshi M, Pitz WJ, Pitz WJ. A kinetic modeling study on the oxidation of primary reference
fuel-toluene mixtures including cross reactions between aromatics and aliphatics. Proc Combust Inst
2009;32:411–8. doi:10.1016/j.proci.2008.06.154.
10. Olm C, Zsély IG, Pálvölgyi R, Varga T, Nagy T, Curran HJ, et al. Comparison of the performance of several
recent hydrogen combustion mechanisms. Combust Flame 2014;161:2219–34. doi:10.1016/j.combustflame.
2014.03.006.
32

PyTeCK: A Python-based automatic testing package for chemical kinetic models

  • 1.
    PyTeCK: A Python-based automatictesting package for chemical kinetic models Kyle Niemeyer Oregon State University SciPy 2016 12 July 2016 Kyle.Niemeyer@oregonstate.edu @kyleniemeyer kyleniemeyer.com
  • 2.
    PyTeCK: Python-based testing ofchemical kinetic models 2
  • 3.
    PyTeCK: Python-based testing ofchemical kinetic models 2
  • 4.
  • 5.
    Why Study Combustion? Combustion 85%of the world’s power comes from combustion 3
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
    What can wedo? Improve Efficiency: 6
  • 12.
    What can wedo? Improve Efficiency: 30 mpg 6
  • 13.
    What can wedo? Improve Efficiency: 54.5 mpg30 mpg 6
  • 14.
    What can wedo? Improve Efficiency: 54.5 mpg30 mpg Cleaner: CO NOx Soot 6
  • 15.
    What can wedo? Improve Efficiency: 54.5 mpg30 mpg Cleaner: CO NOx Soot 6
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
    H + O2O + OH H2 + O H + OH H2 + OH H2O + H 2OH H2O + O H2 + M 2H + M O2 + M 2O + M O + H + M OH + M H2O+ MH + OH + M 2H2O H + OH + H2O H + O2 HO2 HO2 + HH2 + O2 HO2 + H 2OH HO2 + O O2 + OH HO2 + OH H2O + O2 2HO2 H2O2 + O2 H2O2 2OH H2O2 + H H2O + OH H2O2 + H HO2 + H2 H2O2 + O OH + HO2 H2O2 + OH HO2 + H2O H2 Hydrogen Oxidation O2 H2O 9
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
    Validation, schmalidation. 10 Shock tube1 Counterflowflame3 and for the study of the cracking kinetics of biomass pyrolysis vapours (Baumlin et al. 2005). 8.2 Jet-Stirred Reactor Construction Rules The basis for the design of spherical jet-stirred reactors was proposed by the team of Profe Nancy (France) in the seventies (Matras and Villermaux 1973; David and Matras 1975). A (1969) proposed rules for the construction for cylindrical jet-stirred reactors. Although both d for gas phase kinetic studies, spherical jet-stirred reactors are preferred to minimize dead vol ter we focus on the design of spherical jet-stirred reactors. The jet-stirred reactor designed by the team of Villermaux is composed of a sphere in whic place. The fresh gases enter the reactor through an injection cross located at the center of th posed of four nozzles providing the jets ensuring the mixing of the gas phase. Fig. 8.2 displ jet-stirred reactor which is still in use at the Laboratoire Réactions et Génie des Procédés (N which was developed from the rules of construction proposed by the team of professor Villerm Fig. 8.2 Picture of the jet-stirred reactor used in Nancy (France) and which was developed from the rules of c by the group of professor Villermaux Jet-stirred reactor4 Rapid compression machine2
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
    The problem: 
 experimentaldata 12 PDF table5 t [ms3 ~- metric benzene-air mixture. region the dependence of the ignition delay time upon temperature can be expressed ap- proximately by straight lines in the Arrhenius plot. The corresponding global activation ener- gies decrease with increasing pressure. For Ps around 13.5 bar the dependence be- comes strongly nonlinear in a temperature range between 950 and 700 K. In this interme- diate temperature region a decrease in ignition delay time is observed with decreasing temper- atures. This leads to an S-shaped curve with a maximum and a minimum. Between both ex- termal values the dependence possesses a neg- ative temperature coefficient. The position of this transition region shifts to higher tempera- tures with increasing pressures Ps- In the low- temperature region--below approximately 700 K--the dependence of the ignition delay time upon temperature can again be expressed by a linear dependence. Because the measuring time of the shock tube is limited, the delay times could be determined only above 660 K, so that only a short part of the low-temperature region could be investigated in our experiments. The influence of pressure on the ignition delay is most pronounced in the transition region, smallest for low temperatures and of varying degree in the high-temperature region, where with increasing temperature this dependence becomes smaller. "1~z [ms] 101 100 1o-1 162 ,, 3.2bar ,,./--~-~.~ /.-'~ o 6.s ,, ./ '---J.// O I£3 " / ' / n [] ..~-/ 30 ,,,, .o ,~_ D,,- x i< 3 bar 1 Comoufofion ~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " , t/~ / /" !.ine of /+0 " j el'. a[. /.z~ ~/ ./ pressure variation ,/~// T=9/,0 K (Fig.11) T / 1200 1000 800 [K] I I I i I I I I I l I 0:8 1.o 1.2 114 loooK T Fig. 3. Ignition delay times. Figure6
  • 31.
    The problem: 
 experimentaldata 12 PDF table5 t [ms3 ~- metric benzene-air mixture. region the dependence of the ignition delay time upon temperature can be expressed ap- proximately by straight lines in the Arrhenius plot. The corresponding global activation ener- gies decrease with increasing pressure. For Ps around 13.5 bar the dependence be- comes strongly nonlinear in a temperature range between 950 and 700 K. In this interme- diate temperature region a decrease in ignition delay time is observed with decreasing temper- atures. This leads to an S-shaped curve with a maximum and a minimum. Between both ex- termal values the dependence possesses a neg- ative temperature coefficient. The position of this transition region shifts to higher tempera- tures with increasing pressures Ps- In the low- temperature region--below approximately 700 K--the dependence of the ignition delay time upon temperature can again be expressed by a linear dependence. Because the measuring time of the shock tube is limited, the delay times could be determined only above 660 K, so that only a short part of the low-temperature region could be investigated in our experiments. The influence of pressure on the ignition delay is most pronounced in the transition region, smallest for low temperatures and of varying degree in the high-temperature region, where with increasing temperature this dependence becomes smaller. "1~z [ms] 101 100 1o-1 162 ,, 3.2bar ,,./--~-~.~ /.-'~ o 6.s ,, ./ '---J.// O I£3 " / ' / n [] ..~-/ 30 ,,,, .o ,~_ D,,- x i< 3 bar 1 Comoufofion ~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " , t/~ / /" !.ine of /+0 " j el'. a[. /.z~ ~/ ./ pressure variation ,/~// T=9/,0 K (Fig.11) T / 1200 1000 800 [K] I I I i I I I I I l I 0:8 1.o 1.2 114 loooK T Fig. 3. Ignition delay times. Figure6 # n-heptane ignition delay from Colket and Spadaccini 2001 # P (atm), T (K), Ignition Delay (µs) # Mole Fraction nC7H16 O2 Ar : 0.00192 0.04224 0.95584 7.72 ,1393 ,85 7.78 ,1299 ,345 7.04 ,1235 ,631 6.38 ,1299 ,348 7.53 ,1372 ,134 6.08 ,1236 ,678 7.35 ,1340 ,148 6.63 ,1328 ,211 6.94 ,1395 ,89 CSV file7
  • 32.
    The problem: 
 experimentaldata 12 PDF table5 t [ms3 ~- metric benzene-air mixture. region the dependence of the ignition delay time upon temperature can be expressed ap- proximately by straight lines in the Arrhenius plot. The corresponding global activation ener- gies decrease with increasing pressure. For Ps around 13.5 bar the dependence be- comes strongly nonlinear in a temperature range between 950 and 700 K. In this interme- diate temperature region a decrease in ignition delay time is observed with decreasing temper- atures. This leads to an S-shaped curve with a maximum and a minimum. Between both ex- termal values the dependence possesses a neg- ative temperature coefficient. The position of this transition region shifts to higher tempera- tures with increasing pressures Ps- In the low- temperature region--below approximately 700 K--the dependence of the ignition delay time upon temperature can again be expressed by a linear dependence. Because the measuring time of the shock tube is limited, the delay times could be determined only above 660 K, so that only a short part of the low-temperature region could be investigated in our experiments. The influence of pressure on the ignition delay is most pronounced in the transition region, smallest for low temperatures and of varying degree in the high-temperature region, where with increasing temperature this dependence becomes smaller. "1~z [ms] 101 100 1o-1 162 ,, 3.2bar ,,./--~-~.~ /.-'~ o 6.s ,, ./ '---J.// O I£3 " / ' / n [] ..~-/ 30 ,,,, .o ,~_ D,,- x i< 3 bar 1 Comoufofion ~o/"°E~/" × ~+.---+-.---L_._.+_.~..~" ~ X13 " ,, [ , " , t/~ / /" !.ine of /+0 " j el'. a[. /.z~ ~/ ./ pressure variation ,/~// T=9/,0 K (Fig.11) T / 1200 1000 800 [K] I I I i I I I I I l I 0:8 1.o 1.2 114 loooK T Fig. 3. Ignition delay times. Figure6 # n-heptane ignition delay from Colket and Spadaccini 2001 # P (atm), T (K), Ignition Delay (µs) # Mole Fraction nC7H16 O2 Ar : 0.00192 0.04224 0.95584 7.72 ,1393 ,85 7.78 ,1299 ,345 7.04 ,1235 ,631 6.38 ,1299 ,348 7.53 ,1372 ,134 6.08 ,1236 ,678 7.35 ,1340 ,148 6.63 ,1328 ,211 6.94 ,1395 ,89 CSV file7 Email plea
  • 33.
    The problem: 
 qualitativevs. quantitative 13
  • 34.
    The problem: 
 qualitativevs. quantitative 13 del ne, ne, Re- ng ev- he an ee- ha- ed by sensitivity analysis [25–27], except for the small molecules (i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu- ene oxidation is formed and presented in Supplementary data A. 2.2. The sub-mechanism of DIB A detailed mechanism considered two isomers of DIB, i.e. 2,4, 4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene (IC8H16), was developed by Metcalfe et al. [28]. The detailed model consists of 897 species and 3783 elementary reactions. However, 0.1 1 10 100 Toluene/N-heptane/air Expt. Present P = 5MPa P = 3MPa P = 1MPa 1000/T (1/K) Ignitiondelaytime(ms) (a) φ=1.0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1 10 100 Expt. Present P = 5MPa P = 3MPa Toluene/N-heptane/air Ignitiondelaytime(ms)
  • 35.
    The problem: 
 qualitativevs. quantitative 13 del ne, ne, Re- ng ev- he an ee- ha- ed by sensitivity analysis [25–27], except for the small molecules (i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu- ene oxidation is formed and presented in Supplementary data A. 2.2. The sub-mechanism of DIB A detailed mechanism considered two isomers of DIB, i.e. 2,4, 4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene (IC8H16), was developed by Metcalfe et al. [28]. The detailed model consists of 897 species and 3783 elementary reactions. However, 0.1 1 10 100 Toluene/N-heptane/air Expt. Present P = 5MPa P = 3MPa P = 1MPa 1000/T (1/K) Ignitiondelaytime(ms) (a) φ=1.0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1 10 100 Expt. Present P = 5MPa P = 3MPa Toluene/N-heptane/air Ignitiondelaytime(ms) “…the calculations show good agreements with experiments…”8
  • 36.
    The problem: 
 qualitativevs. quantitative 13 del ne, ne, Re- ng ev- he an ee- ha- ed by sensitivity analysis [25–27], except for the small molecules (i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu- ene oxidation is formed and presented in Supplementary data A. 2.2. The sub-mechanism of DIB A detailed mechanism considered two isomers of DIB, i.e. 2,4, 4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene (IC8H16), was developed by Metcalfe et al. [28]. The detailed model consists of 897 species and 3783 elementary reactions. However, 0.1 1 10 100 Toluene/N-heptane/air Expt. Present P = 5MPa P = 3MPa P = 1MPa 1000/T (1/K) Ignitiondelaytime(ms) (a) φ=1.0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1 10 100 Expt. Present P = 5MPa P = 3MPa Toluene/N-heptane/air Ignitiondelaytime(ms) “…the calculations show good agreements with experiments…”8 “…although there is a mismatch […] at […] T < 1000 K.”
  • 37.
    The problem: 
 qualitativevs. quantitative 13 del ne, ne, Re- ng ev- he an ee- ha- ed by sensitivity analysis [25–27], except for the small molecules (i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu- ene oxidation is formed and presented in Supplementary data A. 2.2. The sub-mechanism of DIB A detailed mechanism considered two isomers of DIB, i.e. 2,4, 4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene (IC8H16), was developed by Metcalfe et al. [28]. The detailed model consists of 897 species and 3783 elementary reactions. However, 0.1 1 10 100 Toluene/N-heptane/air Expt. Present P = 5MPa P = 3MPa P = 1MPa 1000/T (1/K) Ignitiondelaytime(ms) (a) φ=1.0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1 10 100 Expt. Present P = 5MPa P = 3MPa Toluene/N-heptane/air Ignitiondelaytime(ms) model. Figure 5 shows the comparison of the igni- tion delay times of PRF/toluene mixtures at 25 and 50 atm [1]. The species mole fractions in the oxidation of PRF/toluene at 12.5 atm obtained by a flow reactor experiment [7] are compared in Fig. 6. Those figures indicate that the present model well predicts the reactivity of PRF/toluene mixtures at wide range of temperature and pres- (dashed addition reproduc mixtures of cross Reac perform PRF/tol 10 0.6 0.7 0.8 0.9 T-1 (103 K-1 ) 12 atm 50 atm Fig. 2. Comparisons of measured and simulated ignition delay times of toluene at the equivalence ratio of 0.5% and 1.2% fuels diluted in Ar or air behind reflected shock waves at 2 [33], 15 and 50 atm [34]. Solid curves: present model, dashed curves: Pitz model. 10 100 1000 10000 0.75 0.80 0.85 0.90 0.95 1.00 T-1 (103 K-1 ) Ignitiondelaytimes(µs) Fig. 3. Comparisons of measured and simulated ignition delay times of toluene behind reflected shock waves at 50 atm [34]. Solid curves: present model, dashed curves: Pitz model. 0.00 Fig. 4. CO + CO by the flo of initial dashed cu 1 10 70 Ignitiondelaytimes(µs) Fig. 5. C delay tim heptane/i shock wa present m “…the calculations show good agreements with experiments…”8 “…although there is a mismatch […] at […] T < 1000 K.”
  • 38.
    The problem: 
 qualitativevs. quantitative 13 del ne, ne, Re- ng ev- he an ee- ha- ed by sensitivity analysis [25–27], except for the small molecules (i.e., C2H2, C2H3, CH2CO, HCCO, et al.) included in three-component fuels mechanism [22]. Finally, a reduced sub-mechanism of tolu- ene oxidation is formed and presented in Supplementary data A. 2.2. The sub-mechanism of DIB A detailed mechanism considered two isomers of DIB, i.e. 2,4, 4-trimethyl-1-pentene (JC8H16) and 2,4,4-trimethyl-2-pentene (IC8H16), was developed by Metcalfe et al. [28]. The detailed model consists of 897 species and 3783 elementary reactions. However, 0.1 1 10 100 Toluene/N-heptane/air Expt. Present P = 5MPa P = 3MPa P = 1MPa 1000/T (1/K) Ignitiondelaytime(ms) (a) φ=1.0 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1 10 100 Expt. Present P = 5MPa P = 3MPa Toluene/N-heptane/air Ignitiondelaytime(ms) model. Figure 5 shows the comparison of the igni- tion delay times of PRF/toluene mixtures at 25 and 50 atm [1]. The species mole fractions in the oxidation of PRF/toluene at 12.5 atm obtained by a flow reactor experiment [7] are compared in Fig. 6. Those figures indicate that the present model well predicts the reactivity of PRF/toluene mixtures at wide range of temperature and pres- (dashed addition reproduc mixtures of cross Reac perform PRF/tol 10 0.6 0.7 0.8 0.9 T-1 (103 K-1 ) 12 atm 50 atm Fig. 2. Comparisons of measured and simulated ignition delay times of toluene at the equivalence ratio of 0.5% and 1.2% fuels diluted in Ar or air behind reflected shock waves at 2 [33], 15 and 50 atm [34]. Solid curves: present model, dashed curves: Pitz model. 10 100 1000 10000 0.75 0.80 0.85 0.90 0.95 1.00 T-1 (103 K-1 ) Ignitiondelaytimes(µs) Fig. 3. Comparisons of measured and simulated ignition delay times of toluene behind reflected shock waves at 50 atm [34]. Solid curves: present model, dashed curves: Pitz model. 0.00 Fig. 4. CO + CO by the flo of initial dashed cu 1 10 70 Ignitiondelaytimes(µs) Fig. 5. C delay tim heptane/i shock wa present m “In general, the present model predicts well the reactivity of […] mixtures…”9 “…the calculations show good agreements with experiments…”8 “…although there is a mismatch […] at […] T < 1000 K.”
  • 39.
  • 40.
  • 41.
    The solution 14 (s) ChemKED: ChemicalKinetics Experimental Data format
  • 42.
    The solution 14 (s) ChemKED: ChemicalKinetics Experimental Data format +
  • 43.
    The solution 14 (s) PyTeCK: Python-basedtesting of chemical kinetic models ChemKED: Chemical Kinetics Experimental Data format +
  • 44.
  • 45.
  • 46.
    ChemKED Written in YAML Human-AND machine-readable! 15
  • 47.
    ChemKED Written in YAML Human-AND machine-readable! Parsers and libraries for nearly every language! 15
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) 19
  • 53.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy 19
  • 54.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy 19
  • 55.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy • Interpreting & coverting units: Pint (pint.readthedocs.org) 19
  • 56.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy • Interpreting & coverting units: Pint (pint.readthedocs.org) • HDF5 file manipulation: PyTables (pytables.org) 19
  • 57.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy • Interpreting & coverting units: Pint (pint.readthedocs.org) • HDF5 file manipulation: PyTables (pytables.org) • Chemical kinetics work: Cantera (cantera.org) 19
  • 58.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy • Interpreting & coverting units: Pint (pint.readthedocs.org) • HDF5 file manipulation: PyTables (pytables.org) • Chemical kinetics work: Cantera (cantera.org) • Unit testing: pytest (docs.pytest.org) 19
  • 59.
    PyTeCK • Version control:git & GitHub (github.com/kyleniemeyer/PyTeCK) • Manipulating arrays: NumPy • Spline interpolation: SciPy • Interpreting & coverting units: Pint (pint.readthedocs.org) • HDF5 file manipulation: PyTables (pytables.org) • Chemical kinetics work: Cantera (cantera.org) • Unit testing: pytest (docs.pytest.org) • Continuous integration: Travis-CI (travis-ci.org) 19
  • 60.
  • 61.
    Handling units 20 •Pint interpretsunits in ChemKED files (pint.readthedocs.org)
  • 62.
    Handling units 20 •Pint interpretsunits in ChemKED files (pint.readthedocs.org) •Checks quantity values
  • 63.
    Handling units 20 •Pint interpretsunits in ChemKED files (pint.readthedocs.org) •Checks quantity values •Thanks Katy Huff! (https://pyrk.github.io/)
  • 64.
  • 65.
    PyTeCK components 21 • parse_files:read all necessary data to recreate experiment from ChemKED YAML file, using PyYAML. Creates list of Simulation objects from experiment properties.
  • 66.
    PyTeCK components 21 • parse_files:read all necessary data to recreate experiment from ChemKED YAML file, using PyYAML. Creates list of Simulation objects from experiment properties. • simulation: provides Simulation class, and associated VolumeProfile and PressureRiseProfile classes.
  • 67.
    PyTeCK components 21 • parse_files:read all necessary data to recreate experiment from ChemKED YAML file, using PyYAML. Creates list of Simulation objects from experiment properties. • simulation: provides Simulation class, and associated VolumeProfile and PressureRiseProfile classes. • eval_model: runs the show. Uses multiprocessing module to set up and run Simulation objects in parallel, then processes results.
  • 68.
    PyTeCK components 21 • parse_files:read all necessary data to recreate experiment from ChemKED YAML file, using PyYAML. Creates list of Simulation objects from experiment properties. • simulation: provides Simulation class, and associated VolumeProfile and PressureRiseProfile classes. • eval_model: runs the show. Uses multiprocessing module to set up and run Simulation objects in parallel, then processes results. Other modules: detect_peaks, exceptions, utils, validation
  • 69.
  • 70.
    Simulation 22 dT dt = 1 cv 0 @ Nsp X i=1 ei dYi dt + p dv dt 1 A dYi dt = 1 ⇢ Wi ˙!ii = 1, . . . , Nspecies cantera.ReactorNet cantera.IdealGasReactor cantera.Wall cantera.Reservior
  • 71.
  • 72.
  • 73.
  • 74.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0)
  • 75.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise:
  • 76.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise: p(t) = p0 + Z tend 0 dp dt dt
  • 77.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise: p(t) = p0 + Z tend 0 dp dt dt v(t) = v0 ⇢0 ⇢(t) s0
  • 78.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise: Wall(…, velocity=PressureRiseProfile(…)) p(t) = p0 + Z tend 0 dp dt dt v(t) = v0 ⇢0 ⇢(t) s0
  • 79.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise: Wall(…, velocity=PressureRiseProfile(…)) p(t) = p0 + Z tend 0 dp dt dt v(t) = v0 ⇢0 ⇢(t) s0 Given volume history:
  • 80.
    Simulation (2) 23 Constant volume,adiabatic: dv dt = 0 Wall(…, velocity=0) Constant pressure rise: Wall(…, velocity=PressureRiseProfile(…)) p(t) = p0 + Z tend 0 dp dt dt v(t) = v0 ⇢0 ⇢(t) s0 Given volume history: Wall(…, velocity=VolumeProfile(…))
  • 81.
  • 82.
  • 83.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time
  • 84.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time • detect_peaks
  • 85.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time • detect_peaks • Options:
  • 86.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time • detect_peaks • Options: • Max, d/dt max
  • 87.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time • detect_peaks • Options: • Max, d/dt max • P, T, OH, CH
  • 88.
    Simulation.process_results() 24 • Have: timehistory (HDF5) • Need: ignition delay time • detect_peaks • Options: • Max, d/dt max • P, T, OH, CH
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
    eval_model • parse_files.read_experiment() • parse_files.create_simulations() •estimate_std_dev() • multiprocessing.Pool() • Simulation.setup_case() 25
  • 95.
    eval_model • parse_files.read_experiment() • parse_files.create_simulations() •estimate_std_dev() • multiprocessing.Pool() • Simulation.setup_case() • Simulation.run_case() 25
  • 96.
    eval_model • parse_files.read_experiment() • parse_files.create_simulations() •estimate_std_dev() • multiprocessing.Pool() • Simulation.setup_case() • Simulation.run_case() • Calculate error function 25
  • 97.
  • 98.
    Error function 26 Ei = 1 Ni NiX j=1 log⌧exp ij log ⌧sim ij (log ⌧exp ij ) !2 Dataset error function:
  • 99.
    Error function 26 Ei = 1 Ni NiX j=1 log⌧exp ij log ⌧sim ij (log ⌧exp ij ) !2 Dataset error function: Overall error function: E = 1 N NX i=1 Ei
  • 100.
  • 101.
    The details: uncertainty Datasetstandard deviation σi: 27
  • 102.
    The details: uncertainty Datasetstandard deviation σi: • Spline fit of experimental data 27
  • 103.
    The details: uncertainty Datasetstandard deviation σi: • Spline fit of experimental data • σi = standard deviation of difference between data and fit 27
  • 104.
    The details: uncertainty Datasetstandard deviation σi: • Spline fit of experimental data • σi = standard deviation of difference between data and fit • Minimum allowable: 10% 27
  • 105.
  • 106.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) 28
  • 107.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) • 14 publications, 54 data sets, 786 data points 28
  • 108.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) • 14 publications, 54 data sets, 786 data points • Original publications from 1958–2013 28
  • 109.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) • 14 publications, 54 data sets, 786 data points • Original publications from 1958–2013 • Also collected 12 models for hydrogen combustion
 (doi:10.6084/m9.figshare.3482906.v1) 28
  • 110.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) • 14 publications, 54 data sets, 786 data points • Original publications from 1958–2013 • Also collected 12 models for hydrogen combustion
 (doi:10.6084/m9.figshare.3482906.v1) • Published 1999–2015 28
  • 111.
    Example • Collected hydrogenshock-tube ignition experimental data from the literature
 (doi:10.6084/m9.figshare.3482918.v1) • 14 publications, 54 data sets, 786 data points • Original publications from 1958–2013 • Also collected 12 models for hydrogen combustion
 (doi:10.6084/m9.figshare.3482906.v1) • Published 1999–2015 • Subset of study by Olm et al.10 28
  • 112.
  • 113.
  • 114.
    Plans for PyTeCK •Better documentation with Sphinx, hosted on Read The Docs 30
  • 115.
    Plans for PyTeCK •Better documentation with Sphinx, hosted on Read The Docs • Better functional testing, especially for rapid compression machine simulations 30
  • 116.
    Plans for PyTeCK •Better documentation with Sphinx, hosted on Read The Docs • Better functional testing, especially for rapid compression machine simulations • Support other fundamental experimental methods, such as laminar flames and jet-stirred reactors 30
  • 117.
    Plans for PyTeCK •Better documentation with Sphinx, hosted on Read The Docs • Better functional testing, especially for rapid compression machine simulations • Support other fundamental experimental methods, such as laminar flames and jet-stirred reactors • PyPI submission 30
  • 118.
    Thank you! Questions? 31 Acknowledgements:Bryan Weber, Matt McCormick, Erik Tollerud, & Katy Huff
  • 119.
    Thank you! Questions? 31 ? Acknowledgements:Bryan Weber, Matt McCormick, Erik Tollerud, & Katy Huff
  • 120.
    Thank you! Questions? 31 ? Acknowledgements:Bryan Weber, Matt McCormick, Erik Tollerud, & Katy Huff https://github.com/ kyleniemeyer/PyTeCK
  • 121.
    References 1. http://hanson.stanford.edu/index.php?loc=facilities_kst 2. http://combdiaglab.engr.uconn.edu/facilities/rapid-compression-machine/new-rapid-compression- machine 3.http://combdiaglab.engr.uconn.edu/facilities/atmospheric-pressure-counterflow-setup-for-flame-studies 4. Olivier Herbinet, Dayma Guillaume. Jet-Stirred Reactors. F Battin-Leclerc, J M Simmie, E Blurock, eds. Cleaner Combustion: Developing Detailed Chemical Kinetic Models, Springer, pp. 183–210, 2013, Green Energy and Technology, 978-1-4471-5306-1. <10.1007/978-1-4471-5307-8>. <hal-00880195> 5. Burcat A, Farmer RF, Matula RA. Shock initiated ignition in heptane-oxygen-argon mixtures. 13th Int. Symp. Shock Tubes Waves, 1981, 826–33. 6. Ciezki HK, Adomeit G. Shock-tube investigation of self-ignition of n-heptane–air mixtures under engine relevant conditions. Combust Flame 1993;93:421–33. doi:10.1016/0010-2180(93)90142-P 7. Colket MB, Spadaccini LJ. Scramjet fuels autoignition study. J. Propul. Power 17 (2) (2001) 315–323. doi: 10.2514/2.5744 8. Zhong B-J, Zheng D. A chemical mechanism for ignition and oxidation of multi-component gasoline surrogate fuels. Fuel 2014;128:458–66. doi:10.1016/j.fuel.2014.03.044. 9. Sakai Y, Miyoshi A, Koshi M, Pitz WJ, Pitz WJ. A kinetic modeling study on the oxidation of primary reference fuel-toluene mixtures including cross reactions between aromatics and aliphatics. Proc Combust Inst 2009;32:411–8. doi:10.1016/j.proci.2008.06.154. 10. Olm C, Zsély IG, Pálvölgyi R, Varga T, Nagy T, Curran HJ, et al. Comparison of the performance of several recent hydrogen combustion mechanisms. Combust Flame 2014;161:2219–34. doi:10.1016/j.combustflame. 2014.03.006. 32