import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
!git clone https://github.com/yohanesnuwara/pyreservoir
Cloning into 'pyreservoir'... remote: Enumerating objects: 8, done. remote: Counting objects: 100% (8/8), done. remote: Compressing objects: 100% (8/8), done. remote: Total 665 (delta 3), reused 0 (delta 0), pack-reused 657 Receiving objects: 100% (665/665), 1.45 MiB | 17.70 MiB/s, done. Resolving deltas: 100% (357/357), done.
import sys
sys.path.append('/content/pyreservoir/pvt')
from pvtcorrelation import gas_zfactor
P_pr = np.linspace(0.1, 15, 50)
T_pr = np.arange(1.2, 3, 0.1)
plt.figure(figsize=(12,10))
for i in range(len(T_pr)):
z_factor = []
for j in range(len(P_pr)):
pseudo_rho, z = gas_zfactor(T_pr[i], P_pr[j])
z_factor.append(z)
plt.plot(P_pr, z_factor, label=r'$T_{pr}$='+str(np.round(T_pr[i], 1)))
plt.xlabel(r'$P_{pr}$', size=17); plt.ylabel(r'z-factor', size=17)
plt.title('Compressibility Factor Katz-like Chart (Using Dranchuk-Aboukassem, 1975)', size=17, pad=10)
plt.legend()
plt.show()