[CTI] Relax formatting requirements for third bodies in reaction strings

Allow 'A + B (+M)' in addition to 'A + B (+ M)'
This commit is contained in:
Ray Speth 2014-05-06 14:38:50 +00:00
parent 8cfac61a83
commit 87bea8ae30
3 changed files with 9 additions and 1 deletions

View file

@ -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+')

View file

@ -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)

View file

@ -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],