Skip to content

Commit

Permalink
[Test] Replace XML with YAML for ReactionToYaml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed May 1, 2021
1 parent 20b31d4 commit f5ed357
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 2 deletions.
77 changes: 77 additions & 0 deletions test/data/chemically-activated-reaction.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
generator: ctml2yaml
cantera-version: 2.6.0a2
date: Fri, 30 Apr 2021 21:45:59 -0400
input-files: [/home/speth/src/cantera/build/python/cantera/test/data/chemically-activated-reaction.xml]

phases:
- name: gas
elements: [C, H, N, O, Ar]
species: [ch3, oh, ch2o, h2, n2]
thermo: ideal-gas
kinetics: gas
reactions: all
state: {T: 300.0 K, P: 1.01325e+05 Pa}

species:
- name: ch3
composition: {H: 3.0, C: 1.0}
note: iu0702
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [3.6571797, 2.1265979e-03, 5.4583883e-06, -6.6181003e-09, 2.4657074e-12, 1.6422716e+04,
1.6735354]
- [2.9781206, 5.797852e-03, -1.97558e-06, 3.072979e-10, -1.7917416e-14, 1.6509513e+04,
4.7224799]
- name: oh
composition: {H: 1.0, O: 1.0}
note: iu3/03
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [3.99198424, -2.40106655e-03, 4.61664033e-06, -3.87916306e-09, 1.36319502e-12,
3368.89836, -0.103998477]
- [2.83853033, 1.10741289e-03, -2.94000209e-07, 4.20698729e-11, -2.4228989e-15,
3697.80808, 5.84494652]
- name: ch2o
composition: {H: 2.0, C: 1.0, O: 1.0}
note: g8/88
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [4.79372312, -9.90833322e-03, 3.7321999e-05, -3.79285237e-08, 1.31772641e-11,
-1.43227879e+04, 0.602798058]
- [3.16952665, 6.1932056e-03, -2.25056366e-06, 3.6597566e-10, -2.20149458e-14,
-1.44922756e+04, 6.04207898]
- name: h2
composition: {H: 2.0}
note: tpis78
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [2.34433112, 7.98052075e-03, -1.9478151e-05, 2.01572094e-08, -7.37611761e-12,
-917.935173, 0.683010238]
- [2.93286575, 8.26608026e-04, -1.46402364e-07, 1.54100414e-11, -6.888048e-16,
-813.065581, -1.02432865]
- name: n2
composition: {N: 2.0}
note: g8/02
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [3.53100528, -1.23660988e-04, -5.02999433e-07, 2.43530612e-09, -1.40881235e-12,
-1046.97628, 2.96747038]
- [2.95257637, 1.3969004e-03, -4.92631603e-07, 7.86010195e-11, -4.60755204e-15,
-923.948688, 5.87188762]

reactions:
- equation: ch3 + oh (+ M) <=> ch2o + h2 (+ M)
type: chemically-activated
low-P-rate-constant: {A: 282.3201, b: 1.46878, Ea: -3270.56495 cal/mol}
high-P-rate-constant: {A: 5.88e-14, b: 6.721, Ea: -3022.227 cal/mol}
Troe: {A: 1.671, T3: 434.782, T1: 2934.21, T2: 3919.0}
109 changes: 109 additions & 0 deletions test/data/sri-falloff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
generator: ctml2yaml
cantera-version: 2.6.0a2
date: Fri, 30 Apr 2021 21:46:05 -0400
input-files: [/home/speth/src/cantera/build/python/cantera/test/data/sri-falloff.xml]

phases:
- name: gas
elements: [H, C, Ar]
species: [H, R1A, R1B, P1, R2, P2A, P2B, R3]
thermo: ideal-gas
kinetics: gas
reactions: all
state: {T: 300.0 K, P: 1.01325e+05 Pa}

species:
- name: H
composition: {H: 1.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [2.5, 7.05332819e-13, -1.99591964e-15, 2.30081632e-18, -9.27732332e-22, 2.54736599e+04,
-0.446682853]
- [2.50000001, -2.30842973e-11, 1.61561948e-14, -4.73515235e-18, 4.98197357e-22,
2.54736599e+04, -0.446682914]
- name: R1A
composition: {H: 4.0, C: 1.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: R1B
composition: {H: 4.0, C: 1.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: P1
composition: {H: 7.0, C: 2.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: R2
composition: {H: 7.0, C: 2.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: P2A
composition: {H: 4.0, C: 1.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: P2B
composition: {H: 4.0, C: 1.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]
- name: R3
composition: {H: 7.0, C: 2.0}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [5.14987613, -0.0136709788, 4.91800599e-05, -4.84743026e-08, 1.66693956e-11,
-1.02466476e+04, -4.64130376]
- [0.074851495, 0.0133909467, -5.73285809e-06, 1.22292535e-09, -1.0181523e-13,
-9468.34459, 18.437318]

reactions:
- equation: R1A + R1B (+ M) <=> P1 + H (+ M)
type: falloff
high-P-rate-constant: {A: 1.0e+15, b: -2.0, Ea: 1000.0 cal/mol}
low-P-rate-constant: {A: 4.0e+19, b: -3.0, Ea: 0.0 cal/mol}
efficiencies: {P2A: 5.0, R3: 2.0}
SRI: {A: 0.54, B: 201.0, C: 1024.0}
- equation: H + R2 (+ M) <=> P2A + P2B (+ M)
type: falloff
high-P-rate-constant: {A: 4.0e+15, b: -0.5, Ea: 100.0 cal/mol}
low-P-rate-constant: {A: 7.0e+20, b: -1.0, Ea: 0.0 cal/mol}
efficiencies: {P1: 0.4, R1A: 0.0, R3: 3.0}
SRI: {A: 1.1, B: 700.0, C: 1234.0, D: 56.0, E: 0.7}
4 changes: 2 additions & 2 deletions test/kinetics/kineticsFromYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ TEST_F(ReactionToYaml, TroeFalloff)

TEST_F(ReactionToYaml, SriFalloff)
{
soln = newSolution("sri-falloff.xml");
soln = newSolution("sri-falloff.yaml");
soln->thermo()->setState_TPY(1000, 2e5, "R1A: 0.1, R1B:0.2, H: 0.2, R2:0.5");
duplicateReaction(0);
EXPECT_TRUE(std::dynamic_pointer_cast<FalloffReaction>(duplicate));
Expand All @@ -462,7 +462,7 @@ TEST_F(ReactionToYaml, SriFalloff)

TEST_F(ReactionToYaml, chemicallyActivated)
{
soln = newSolution("chemically-activated-reaction.xml");
soln = newSolution("chemically-activated-reaction.yaml");
soln->thermo()->setState_TPY(1000, 2e5, "H2:1.0, ch2o:0.1, ch3:1e-8, oh:3e-6");
duplicateReaction(0);
EXPECT_TRUE(std::dynamic_pointer_cast<ChemicallyActivatedReaction>(duplicate));
Expand Down

0 comments on commit f5ed357

Please sign in to comment.