From 5cb1c787ad3c209b5f2a11cfe8a854c2f652e2b6 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 6 May 2014 14:39:01 +0000 Subject: [PATCH] [CTI] Allow omitting third body in Chebyshev reaction equations --- interfaces/cython/cantera/ctml_writer.py | 5 +++-- test/data/pdep-test.cti | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interfaces/cython/cantera/ctml_writer.py b/interfaces/cython/cantera/ctml_writer.py index c9fbcb69a..9fde1a57c 100644 --- a/interfaces/cython/cantera/ctml_writer.py +++ b/interfaces/cython/cantera/ctml_writer.py @@ -1525,8 +1525,9 @@ class chebyshev_reaction(reaction): self.coeffs = coeffs # clean up reactant and product lists - del self._r['(+'] - del self._p['(+'] + if '(+' in self._r: + del self._r['(+'] + del self._p['(+'] if 'M)' in self._r: del self._r['M)'] del self._p['M)'] diff --git a/test/data/pdep-test.cti b/test/data/pdep-test.cti index 77b87d41e..780448f99 100644 --- a/test/data/pdep-test.cti +++ b/test/data/pdep-test.cti @@ -256,7 +256,7 @@ chebyshev_reaction('R5 + H (+ M) <=> P5A + P5B (+M)', [-3.12850e-02, -3.94120e-02, 4.43750e-02, 1.44580e-02]]) # Reaction 6 -chebyshev_reaction('R6 (+ M) <=> P6A + P6B (+ M)', +chebyshev_reaction('R6 <=> P6A + P6B', Tmin=290.0, Tmax=3000.0, Pmin=(0.0098692326671601278, 'atm'), Pmax=(98.692326671601279, 'atm'), coeffs=[[-1.44280e+01, 2.59970e-01, -2.24320e-02, -2.78700e-03],