!pip install https://pypi.python.org/packages/source/i/iapws/iapws-1.0.2.tar.gz
Downloading/unpacking https://pypi.python.org/packages/source/i/iapws/iapws-1.0.2.tar.gz Downloading iapws-1.0.2.tar.gz (50kB): 50kB downloaded Running setup.py (path:/var/folders/y2/xt27yn915zx1zxl9ptwbrhfw0000gn/T/pip-08Yz1s-build/setup.py) egg_info for package from https://pypi.python.org/packages/source/i/iapws/iapws-1.0.2.tar.gz Cleaning up...
from iapws import IAPWS97
IAPWS97(P=0.101325,T=320).h
283.621688203311
def k2c(T): return T-273.15
def c2k(T): return T+273.15
def f2c(T): return 5.0*(T-32.0)/9
def c2f(T): return (9./5)*T + 32
def k2f(T): return c2f(k2c(T))
def f2k(T): return c2k(f2c(T))
See if we can match the data in Appendix B.6, page 660, of Murphy.
def Tsat(P): return k2c(IAPWS97(P = P/10.0, x = 0).T)
P = [0.1, 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 100.0, 150.0, 200.0, 220.64]
for p in P:
print "{:7.1f} {:6.2f}".format(p,Tsat(p))
0.1 45.81 1.0 99.61 5.0 151.84 10.0 179.89 20.0 212.38 40.0 250.36 60.0 275.59 100.0 311.00 150.0 342.16 200.0 365.75 220.6 373.95
def Psat(T): return (IAPWS97(T = c2k(T), x = 0).P)*10.0
T = linspace(1,100)
P = [Psat(t) for t in T]
plot(T,P)
[<matplotlib.lines.Line2D at 0x10987d910>]
T = 100.0
print IAPWS97(T = c2k(T), x = 0).h
print IAPWS97(T = c2k(T), x = 1).h
419.099154998 2675.57202922
a = array([[]])
T =
display(a)
array([], shape=(1, 0), dtype=float64)
P = [0.1, 1.0, 2.0, 5.0, 10.0, 20.0, 40.0, 60.0, 100.0, 150.0, 200.0, 220.64]
T = 273.15 + arange(50,400,50)
H = zeros((len(P),len(T)))
for p in P:
for t in T:
print p,t,IAPWS97(P=p,T=t).h
0.1 323.15 209.411798567 0.1 373.15 2675.76736721 0.1 423.15 2776.59181545 0.1 473.15 2875.47506495 0.1 523.15 2974.53705806 0.1 573.15 3074.54038363 0.1 623.15 3175.81739372 1.0 323.15 210.187910591 1.0 373.15 419.774151851 1.0 423.15 632.574919594 1.0 473.15 2828.2675376 1.0 523.15 2943.22216523 1.0 573.15 3051.70318558 1.0 623.15 3158.16329436 2.0 323.15 211.04993714 2.0 373.15 420.525628187 2.0 423.15 633.193129569 2.0 473.15 852.572483582 2.0 523.15 2903.23138912 2.0 573.15 3024.25187576 2.0 623.15 3137.64121486 5.0 323.15 213.633993001 5.0 373.15 422.781875119 5.0 423.15 635.055399462 5.0 473.15 853.80043996 5.0 523.15 1085.66199478 5.0 573.15 2925.64404236 5.0 623.15 3069.29417488 10.0 323.15 217.933998578 10.0 373.15 426.54802393 10.0 423.15 638.183552023 10.0 473.15 855.917878999 10.0 523.15 1085.71716015 10.0 573.15 1343.09660906 10.0 623.15 2923.95784687 20.0 323.15 226.508658213 20.0 373.15 434.099605278 20.0 423.15 644.523776837 20.0 473.15 860.391147387 20.0 523.15 1086.58356466 20.0 573.15 1334.13952503 20.0 623.15 1645.95105148 40.0 323.15 243.556887134 40.0 373.15 449.265000273 40.0 423.15 657.49149245 40.0 473.15 870.124259682 40.0 523.15 1090.58628091 40.0 573.15 1325.41397293 40.0 623.15 1588.7405472 60.0 323.15 260.471987901 60.0 373.15 464.490271351 60.0 423.15 670.769717345 60.0 473.15 880.674830699 60.0 523.15 1096.71566852 60.0 573.15 1323.25139853 60.0 623.15
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-116-945c266271a7> in <module>() 5 for p in P: 6 for t in T: ----> 7 print p,t,IAPWS97(P=p,T=t).h /Applications/anaconda/lib/python2.7/site-packages/iapws.pyc in __init__(self, T, P, h, s, x) 1940 propiedades=_Region5(T, P) 1941 else: -> 1942 raise NotImplementedError("Incoming out of bound") 1943 1944 elif P!=None and h!=None: NotImplementedError: Incoming out of bound
1567.41203304 100.0 323.15 293.916631442 100.0 373.15 495.039528624 100.0 423.15 698.009807743 100.0 473.15 903.51320504 100.0 523.15 1113.0310103 100.0 573.15 1328.91928876 100.0 623.15 1553.92250337 150.0 323.15
H
array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]])