Skip to content

Commit

Permalink
[UnitTests] Test for invalid Plog with explicit 'M'
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Apr 28, 2022
1 parent b55fcdc commit a394423
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interfaces/cython/cantera/test/test_kinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,10 @@ def test_plog_rate(self):
self.assertNear(gas1.reaction(i).rate(gas1.T, gas1.P),
gas1.forward_rate_constants[i])

def test_plog_invalid_third_body(self):
with self.assertRaisesRegex(ct.CanteraError, "Found superfluous"):
gas = ct.Solution("pdep-test.yaml", "plog-invalid")

def test_chebyshev(self):
gas1 = ct.Solution('pdep-test.yaml')
species = ct.Species.list_from_file("pdep-test.yaml")
Expand Down
16 changes: 16 additions & 0 deletions test/data/pdep-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ phases:
kinetics: gas
reactions: [chebyshev-deprecated-rxns]
state: {T: 300.0, P: 1 atm}
- name: plog-invalid
thermo: ideal-gas
species: all
kinetics: gas
reactions: [plog-invalid-rxns]
state: {T: 300.0, P: 1 atm}

species:
- name: H
Expand Down Expand Up @@ -321,3 +327,13 @@ chebyshev-deprecated-rxns:
- [0.3177, 0.26889, 0.094806, -7.6385e-03]
- [-0.031285, -0.039412, 0.044375, 0.014458]
note: Chebyshev reaction written with the deprecated "(+M)" notation

plog-invalid-rxns:
- equation: R1A + R1B + M <=> P1 + H + M
type: pressure-dependent-Arrhenius
rate-constants:
- {P: 0.01 atm, A: 1.2124e+16, b: -0.5779, Ea: 1.08727e+04}
- {P: 1.0 atm, A: 4.9108e+31, b: -4.8507, Ea: 2.47728e+04}
- {P: 10.0 atm, A: 1.2866e+47, b: -9.0246, Ea: 3.97965e+04}
- {P: 100.0 atm, A: 5.9632e+56, b: -11.529, Ea: 5.25996e+04}
note: PLOG Reaction with invalid +M

0 comments on commit a394423

Please sign in to comment.