From 55a8910686d15071f300b2c2cec38812514f8ef6 Mon Sep 17 00:00:00 2001 From: Richard West Date: Thu, 29 Jun 2017 18:30:27 -0400 Subject: [PATCH] A failing unit test for chemkin files with weird names in PDep rates. Reactions of the type A (+B) <=> C (+B) ought to work, as long as they are provided a pressure-dependent rate expression. This commit adds three examples to the test file. The first works OK, the second two cause problems. (For what it's worth, this currently crashes the official chemkin. Or at least the parentheses do; I've not tested the plus. Ansys have created a defect record and say they will fix the issue.) --- interfaces/cython/cantera/test/test_convert.py | 2 +- test/data/species-names.inp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/test/test_convert.py b/interfaces/cython/cantera/test/test_convert.py index fc5fbb579..c8b342ebd 100644 --- a/interfaces/cython/cantera/test/test_convert.py +++ b/interfaces/cython/cantera/test/test_convert.py @@ -151,7 +151,7 @@ class chemkinConverterTest(utilities.CanteraTest): self.assertEqual(gas.species_name(5), 'eq=uals') self.assertEqual(gas.species_name(6), 'plus') - self.assertEqual(gas.n_reactions, 7) + self.assertEqual(gas.n_reactions, 10) nu = gas.product_stoich_coeffs() - gas.reactant_stoich_coeffs() self.assertEqual(list(nu[:,0]), [-1, -1, 0, 2, 0, 0, 0]) self.assertEqual(list(nu[:,1]), [-2, 3, 0, -1, 0, 0, 0]) diff --git a/test/data/species-names.inp b/test/data/species-names.inp index 10a30ad64..8c0ff5d6c 100644 --- a/test/data/species-names.inp +++ b/test/data/species-names.inp @@ -45,5 +45,11 @@ plus+ + (Parens) = 2plus+ 9.999e9 9.9 999.9 plus + plus+ = 2 (Parens) 9.999e9 9.9 999.9 plus+ eq=uals = plus++(Parens) 9.999e9 9.9 999.9 co:lons: + eq=uals = 2 (Parens) 9.999e9 9.9 999.9 +plus+ (+plus) = eq=uals (+plus) 9.999e9 9.9 999.9 +LOW / 8.888e8 8.8 888.8 / +plus+ (+(Parens)) = eq=uals (+(Parens)) 9.999e9 9.9 999.9 +LOW / 8.888e8 8.8 888.8 / +plus+ (+plus+) = eq=uals (+plus+) 9.999e9 9.9 999.9 +LOW / 8.888e8 8.8 888.8 / end