Skip to content

Commit

Permalink
[Kinetics] Add unit test for heat_release
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Feb 22, 2020
1 parent 9028e61 commit c16c4b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions interfaces/cython/cantera/test/test_kinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ def test_rates_of_progress(self):
self.assertArrayNear(self.phase.forward_rates_of_progress - self.phase.reverse_rates_of_progress,
self.phase.net_rates_of_progress)

def test_heat_release(self):
hrr = - self.phase.partial_molar_enthalpies.dot(self.phase.net_production_rates)
self.assertNear(hrr, self.phase.heat_release_rate)
self.assertNear(hrr, sum(self.phase.heat_production_rates))

def test_rate_constants(self):
self.assertEqual(len(self.phase.forward_rate_constants), self.phase.n_reactions)
self.assertArrayNear(self.phase.forward_rate_constants / self.phase.reverse_rate_constants,
Expand Down

0 comments on commit c16c4b0

Please sign in to comment.