Skip to content

Commit

Permalink
[Thermo/Test] Add test for getPhase
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Oct 6, 2019
1 parent 86216ef commit 0dc02e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions interfaces/cython/cantera/test/test_purefluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ def test_TPX(self):
with self.assertRaisesRegex(ValueError, 'numeric value is required'):
self.water.TPX = T, P, 'spam'

def test_phase(self):
self.water.TP = 300, 101325
self.assertEqual(self.water.phase, "liquid")
self.water.TP = 500, 101325
self.assertEqual(self.water.phase, "vapor")
self.water.TP = self.water.critical_temperature*2, 101325
self.assertEqual(self.water.phase, "supercritical")
self.water.TP = 300, self.water.critical_pressure*2
self.assertEqual(self.water.phase, "supercritical")


# To minimize errors when transcribing tabulated data, the input units here are:
# T: K, P: MPa, rho: kg/m3, v: m3/kg, (u,h): kJ/kg, s: kJ/kg-K
Expand Down

0 comments on commit 0dc02e0

Please sign in to comment.