[Kinetics] Added a test for empty reaction mechanisms

This commit is contained in:
Ray Speth 2013-02-14 01:02:23 +00:00
parent a25c1a43b3
commit 45392f06ec

View file

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