From 45392f06ec2a7175ae479e8d0bb8f62b1d04e05c Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 14 Feb 2013 01:02:23 +0000 Subject: [PATCH] [Kinetics] Added a test for empty reaction mechanisms --- interfaces/cython/cantera/test/test_kinetics.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/interfaces/cython/cantera/test/test_kinetics.py b/interfaces/cython/cantera/test/test_kinetics.py index be854c2aa..a4bd7822e 100644 --- a/interfaces/cython/cantera/test/test_kinetics.py +++ b/interfaces/cython/cantera/test/test_kinetics.py @@ -119,3 +119,13 @@ class TestKinetics(utilities.CanteraTest): self.assertArrayNear(self.phase.delta_standard_enthalpy - self.phase.delta_standard_entropy * self.phase.T, self.phase.delta_standard_gibbs) + + +class TestEmptyKinetics(utilities.CanteraTest): + def test_empty(self): + gas = ct.Solution('air-no-reactions.xml') + + self.assertEqual(gas.n_reactions, 0) + self.assertArrayNear(gas.creation_rates, np.zeros(gas.n_species)) + self.assertArrayNear(gas.destruction_rates, np.zeros(gas.n_species)) + self.assertArrayNear(gas.net_production_rates, np.zeros(gas.n_species))