diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index ab15c1e23..c9fbcb69a 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -403,6 +403,10 @@ def getReactionSpecies(s): >>> {'CH3':1, 'H':3.7, 'O2':5.2} """ + # Normalize formatting of falloff third bodies so that there is always as + # space following the '+', e.g. '(+M)' -> '(+ M)' + s = s.replace(' (+', ' (+ ') + # get rid of the '+' signs separating species. Only plus signs # surrounded by spaces are replaced, so that plus signs may be # used in species names (e.g. 'Ar3+') diff --git a/interfaces/cython/cantera/test/test_convert.py b/interfaces/cython/cantera/test/test_convert.py index c04b2664e..65c60647a 100644 --- a/interfaces/cython/cantera/test/test_convert.py +++ b/interfaces/cython/cantera/test/test_convert.py @@ -320,3 +320,7 @@ class CtmlConverterTest(utilities.CanteraTest): face = ct.Interface('diamond.cti', 'diamond_100', [gas, solid]) self.assertNear(face.site_density, 3e-8) + + def test_pdep(self): + gas = ct.Solution('../data/pdep-test.cti') + self.assertEqual(gas.n_reactions, 6) diff --git a/test/data/pdep-test.cti b/test/data/pdep-test.cti index 8db635a6f..77b87d41e 100644 --- a/test/data/pdep-test.cti +++ b/test/data/pdep-test.cti @@ -247,7 +247,7 @@ pdep_arrhenius('H + R4 <=> H + P4', [(10.0, 'atm'), 1.740000e+07, 1.98, 4521.0]) # Reaction 5 -chebyshev_reaction('R5 + H (+ M) <=> P5A + P5B (+ M)', +chebyshev_reaction('R5 + H (+ M) <=> P5A + P5B (+M)', Tmin=300.0, Tmax=2000.0, Pmin=(0.0098692326671601278, 'atm'), Pmax=(98.692326671601279, 'atm'), coeffs=[[ 8.28830e+00, -1.13970e+00, -1.20590e-01, 1.60340e-02],