from iapws import IAPWS97 as water
import numpy as np
import pandas as pd
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib inline
h1 = water(P=1.0,T = 50.0+273.15).h
h2 = water(P=10.0,T = 50.0+273.15).h
v = water(P=1.0,T = 50.0+273.15).v
p2 = 1000000.0
p1 = 100000.0
print v*(p2-p1)
910.52754086
Tcen = np.array([50.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0])
Pbar = np.array([0.1, 1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 100.0, 150.0, 200.0, 220.64])
H = pd.DataFrame([[water(P = P/10.0, T=T + 273.15).h for T in Tcen] \
for P in Pbar],index=Pbar,columns=Tcen)
display(H)
50.0 | 100.0 | 150.0 | 200.0 | 250.0 | 300.0 | 350.0 | |
---|---|---|---|---|---|---|---|
0.10 | 2591.993619 | 2687.430931 | 2783.020096 | 2879.590157 | 2977.445660 | 3076.734320 | 3177.543459 |
1.00 | 209.411799 | 2675.767367 | 2776.591815 | 2875.475065 | 2974.537058 | 3074.540384 | 3175.817394 |
5.00 | 209.756771 | 419.398530 | 632.266303 | 2855.896196 | 2961.129843 | 3064.596220 | 3168.061200 |
10.00 | 210.187911 | 419.774152 | 632.574920 | 2828.267538 | 2943.222165 | 3051.703186 | 3158.163294 |
20.00 | 211.049937 | 420.525628 | 633.193130 | 852.572484 | 2903.231389 | 3024.251876 | 3137.641215 |
40.00 | 212.772979 | 422.029495 | 634.433388 | 853.387444 | 1085.686080 | 2961.651480 | 3093.318226 |
60.00 | 214.494670 | 423.534545 | 635.678641 | 854.217021 | 1085.650088 | 2885.490458 | 3043.858380 |
100.00 | 217.933999 | 426.548024 | 638.183552 | 855.917879 | 1085.717160 | 1343.096609 | 2923.957847 |
150.00 | 222.225554 | 430.320796 | 641.340324 | 858.117093 | 1086.035596 | 1338.063261 | 2692.999815 |
200.00 | 226.508658 | 434.099605 | 644.523777 | 860.391147 | 1086.583565 | 1334.139525 | 1645.951051 |
220.64 | 228.274262 | 435.661130 | 645.845268 | 861.350248 | 1086.870071 | 1332.778346 | 1635.608804 |
U = pd.DataFrame([[water(P = P/10.0, T=T + 273.15).u for T in Tcen] \
for P in Pbar],index=Pbar,columns=Tcen)
U
50.0 | 100.0 | 150.0 | 200.0 | 250.0 | 300.0 | 350.0 | |
---|---|---|---|---|---|---|---|
0.10 | 2443.319834 | 2515.463685 | 2587.884391 | 2661.330209 | 2736.080752 | 2812.274211 | 2889.993725 |
1.00 | 209.310589 | 2506.171426 | 2582.919154 | 2658.225581 | 2733.917933 | 2810.653601 | 2888.720170 |
5.00 | 209.250811 | 418.876904 | 631.721059 | 2643.379363 | 2723.915454 | 2803.294836 | 2882.992295 |
10.00 | 209.176213 | 418.731154 | 631.484769 | 2622.263888 | 2710.483232 | 2793.723996 | 2875.671118 |
20.00 | 209.027430 | 418.440648 | 631.014173 | 850.260364 | 2680.263374 | 2773.249520 | 2860.452349 |
40.00 | 208.731498 | 417.863575 | 630.080813 | 848.771284 | 1080.679309 | 2726.179635 | 2827.422101 |
60.00 | 208.437719 | 417.291678 | 629.157699 | 847.304698 | 1078.161612 | 2668.343652 | 2790.337532 |
100.00 | 207.856493 | 416.163070 | 627.341314 | 844.436118 | 1073.305609 | 1329.116257 | 2699.535833 |
150.00 | 207.141521 | 414.779933 | 625.124609 | 840.964658 | 1067.540461 | 1317.389383 | 2520.789278 |
200.00 | 206.438968 | 413.426345 | 622.964795 | 837.611432 | 1062.076387 | 1306.917760 | 1612.653716 |
220.64 | 206.152473 | 412.875928 | 622.089145 | 836.259715 | 1059.900566 | 1302.890485 | 1599.556222 |
V = pd.DataFrame([[water(P = P/10.0, T=T + 273.15).v for T in Tcen] \
for P in Pbar],index=Pbar,columns=Tcen)
V.name='Specific Volume'
display(V)
50.0 | 100.0 | 150.0 | 200.0 | 250.0 | 300.0 | 350.0 | |
---|---|---|---|---|---|---|---|
0.10 | 14.867378 | 17.196725 | 19.513570 | 21.825995 | 24.136491 | 26.446011 | 28.754973 |
1.00 | 0.001012 | 1.695959 | 1.936727 | 2.172495 | 2.406191 | 2.638868 | 2.870972 |
5.00 | 0.001012 | 0.001043 | 0.001090 | 0.425034 | 0.474429 | 0.522603 | 0.570138 |
10.00 | 0.001012 | 0.001043 | 0.001090 | 0.206004 | 0.232739 | 0.257979 | 0.282492 |
20.00 | 0.001011 | 0.001042 | 0.001089 | 0.001156 | 0.111484 | 0.125501 | 0.138594 |
40.00 | 0.001010 | 0.001041 | 0.001088 | 0.001154 | 0.001252 | 0.058868 | 0.066474 |
60.00 | 0.001009 | 0.001040 | 0.001087 | 0.001152 | 0.001248 | 0.036191 | 0.042253 |
100.00 | 0.001008 | 0.001038 | 0.001084 | 0.001148 | 0.001241 | 0.001398 | 0.022442 |
150.00 | 0.001006 | 0.001036 | 0.001081 | 0.001143 | 0.001233 | 0.001378 | 0.011481 |
200.00 | 0.001003 | 0.001034 | 0.001078 | 0.001139 | 0.001225 | 0.001361 | 0.001665 |
220.64 | 0.001003 | 0.001033 | 0.001077 | 0.001137 | 0.001222 | 0.001355 | 0.001634 |
S = pd.DataFrame([[water(P = P/10.0, T=T + 273.15).s for T in Tcen] \
for P in Pbar],index=Pbar,columns=Tcen)
S
50.0 | 100.0 | 150.0 | 200.0 | 250.0 | 300.0 | 350.0 | |
---|---|---|---|---|---|---|---|
0.10 | 8.174144 | 8.448771 | 8.689152 | 8.904837 | 9.101417 | 9.282656 | 9.451271 |
1.00 | 0.703753 | 7.360999 | 7.614673 | 7.835560 | 8.034576 | 8.217124 | 8.386524 |
5.00 | 0.703568 | 1.306702 | 1.841925 | 7.061071 | 7.272553 | 7.461448 | 7.634518 |
10.00 | 0.703337 | 1.306311 | 1.841366 | 6.695488 | 6.926623 | 7.124712 | 7.302809 |
20.00 | 0.702874 | 1.305530 | 1.840252 | 2.330092 | 6.547418 | 6.768515 | 6.958244 |
40.00 | 0.701950 | 1.303976 | 1.838037 | 2.326932 | 2.793329 | 6.363826 | 6.584264 |
60.00 | 0.701028 | 1.302430 | 1.835839 | 2.323811 | 2.788482 | 6.070211 | 6.335573 |
100.00 | 0.699186 | 1.299363 | 1.831498 | 2.317683 | 2.779094 | 3.248366 | 5.945796 |
150.00 | 0.696890 | 1.295575 | 1.826165 | 2.310222 | 2.767879 | 3.227477 | 5.443497 |
200.00 | 0.694602 | 1.291835 | 1.820933 | 2.302969 | 2.757179 | 3.208684 | 3.728849 |
220.64 | 0.693659 | 1.290305 | 1.818801 | 2.300031 | 2.752899 | 3.201419 | 3.706790 |
plt.figure(figsize=(6,10))
plt.hold(True)
H = np.linspace(200,3600,18)
for h in H:
P = np.linspace(0.01,100,100)
T = np.array([water(h=h,P=p).T - 273.15 for p in P])
S = np.array([water(h=h,P=p).s for p in P])
plt.plot(S,T,'b',lw=0.5)
P = np.array([0.01,0.02,0.05,0.1,0.2,0.5,1.0,2.0,5.0,10.0,20.0,50.0,100.0])
for p in P:
H = np.linspace(200,3600,15)
T = np.array([water(h=h,P=p).T - 273.15 for h in H])
S = np.array([water(h=h,P=p).s for h in H])
plt.plot(S,T,'b',lw=0.5)
T = np.linspace(1.0,374.0,20)
for x in np.linspace(0.001,0.999,11):
S = np.array([water(T=t,x=x).s for t in (T+273.15)])
plt.plot(S,T,'r--',lw=0.5)
for x in np.array([0.001,0.999]):
S = np.array([water(T=t,x=x).s for t in (T+273.15)])
plt.plot(S,T,'r',lw=1.0)
plt.xlim(0,9)
plt.grid()