Skip to content

Commit

Permalink
Added IAPWS97 region() method
Browse files Browse the repository at this point in the history
  • Loading branch information
acroucher committed Aug 29, 2014
1 parent 3d19908 commit 7e80e93
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions IAPWS97.py
Expand Up @@ -371,6 +371,19 @@ def b23t(p):

#------------------------------------------------------------------------

def region(t, p):
"""Returns thermodynamic region corresponding to the given temperature and pressure,
or None if out of bounds."""
if (0.01 <= t <= 800.) and (0. <= p <= 100.e6):
if t <= 350.:
return 1 if p > sat(t) else 2
elif t <= 590.:
return 3 if p > b23p(t) else 2
else: return 2
else: return None

#------------------------------------------------------------------------

def pressure_temperature_plot(plt,subplot=111):
"""Plots IAPWS-97 pressure-temperature region boundaries on plot plt"""

Expand Down

0 comments on commit 7e80e93

Please sign in to comment.