地層三壓力預測

# -*- coding: UTF-8 -*-
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pylab import mpl
mpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['axes.unicode_minus'] = False
# ===================================================================
# 算法——井身結構設計方法
# ===================================================================
# def bonds():
#     rho_d>=rho_p_max+Delta_rho
#
#     rho_d_max>=max(rho_p_max+Delta_rho,rho_c_max)
#
#     rho_bn_max = rho_d_max + S_g
#     rho_ff = rho_f - S_f
#     rho_bn_max<=rho_ff_min
#
#     Delta_p=0.00981*(rho_d_max-rho_p_min)*D_n<=Delta_p_N(Delta_p_A)
#
#     rho_ba_max = rho_d_max + D_m * S_k / D_x
#     rho_ba_max<=rho_ffDmin
print(np.degrees(np.arctan(0.13)))
df0=pd.read_excel(r'C:\Users\Administrator\Desktop\upupup\2-petrol_design_contest\2020\2020-CPEDC\table\attachment\table\附表8-三壓力數據.xlsx',sheet_name='Sheet1')
df=pd.read_excel(r'C:\Users\Administrator\Desktop\upupup\2-petrol_design_contest\2020\2020-CPEDC\table\attachment\table\附表2-測井解釋結果數據.xlsx',sheet_name='W1')
#-------------設計系數---------------
# D=df['深度/m']                      #深度/m
# phi_mean=df['孔隙度/%'].mean()/100  #平均孔隙度
# rho_m=2.5                           #岩石骨架密度,g·cm-3
# rho_f=1                             #空隙中流體密度,g·cm-3
# G_oi=0.00981*((1-phi_mean)*rho_m+phi_mean*rho_f)#當前段的地層壓力梯度
# p_pi=0.00981*G_p*d#當前段的地層孔隙壓力
d0=df0['井深/m']
rho_p=df0['孔隙壓力/g·cm-3']
rho_c=df0['坍塌壓力/g·cm-3']
rho_f=df0['破裂壓力/g·cm-3']
p_pi=0.00981*rho_p*d0#孔隙壓力
p_ci=0.00981*rho_c*d0#坍塌壓力
p_fi=0.00981*rho_f*d0#破裂壓力

d=np.linspace(0,5000,5000)
d_o=np.array([3889.57,3899.48,3911.41,3937.29,3941.57])
p_o_o=np.array([72.05,71.82,72.47,74.09,73.93])

d1=np.linspace(0,1200,50)
rho_p1=1.05*np.ones(50)
rho_c1=1.00*np.ones(50)
rho_f1=1.75*np.ones(50)
d2=np.linspace(1200,2600,50)
rho_p2=1.07*np.ones(50)
rho_c2=1.15*np.ones(50)
rho_f2=1.80*np.ones(50)
d3=np.linspace(2830,3644,50)
rho_p3=1.03*np.ones(50)
rho_c3=1.00*np.ones(50)
rho_f3=1.70*np.ones(50)
d4=np.linspace(3644,4100,50)
rho_p4=1.27*np.ones(50)
rho_c4=1.20*np.ones(50)
rho_f4=1.8*np.ones(50)
p_o=0.0230*d#正常上覆岩層壓力,G_o=0.0230
p_p=0.0105*d#正常地層孔隙壓力,G_p=0.0105

rho1=np.hstack((rho_p1,rho_p2,rho_p,rho_p3,rho_p4))
rho2=np.hstack((rho_c1,rho_c2,rho_c,rho_c3,rho_c4))
rho3=np.hstack((rho_f1,rho_f2,rho_f,rho_f3,rho_f4))
b=np.hstack((d1,d2,d0,d3,d4))
plt.figure(figsize=(10, 12))
ax=plt.subplot(1,2,1)
ax.xaxis.set_ticks_position('top') #將x軸的位置設置在頂部
plt.plot(rho1, b, label='孔隙壓力當量密度')
plt.plot(rho2, b, label='坍塌壓力當量密度')
plt.plot(rho3, b, label='破裂壓力當量密度')
# a=np.array([])
# for i in range(len(b)):
#     a=np.hstack((a,max(rho1[i],rho2[i])))
# plt.plot(a, b, label='坍塌和孔隙壓力最大當量密度')
# plt.plot(a+0.11, b, label='鑽井液密度')

ax.invert_yaxis()#翻轉y軸
plt.xticks(fontsize=13)
plt.xlabel(u'密度/g/cm^3',fontsize=13)
plt.yticks(fontsize=13)
plt.ylabel(u'井深',fontsize=13,rotation=0)
plt.title(u'地層三壓力當量密度',fontsize=13)
plt.legend(loc='upper right',fontsize=13)  # 確定標籤的位置
# from sklearn.linear_model import LinearRegression
# lr=LinearRegression().fit(p_o.values.reshape(-1,1),D)
# plt.plot(p_o,lr.predict(p_o.values.reshape(-1,1)),label='預測上覆岩層壓力')
p1=np.hstack((rho_p1,rho_p2,rho_p,rho_p3,rho_p4))*b*0.00981
p2=np.hstack((rho_c1,rho_c2,rho_c,rho_c3,rho_c4))*b*0.00981
p3=np.hstack((rho_f1,rho_f2,rho_f,rho_f3,rho_f4))*b*0.00981
ax=plt.subplot(1,2,2)
ax.xaxis.set_ticks_position('top') #將x軸的位置設置在頂部
plt.plot(p1,b, label='孔隙壓力')
plt.plot(p2, b, label='坍塌壓力')
plt.plot(p3, b, label='破裂壓力')
ax.invert_yaxis()#翻轉y軸
plt.xticks(fontsize=13)
plt.xlabel(u'壓力/MPa',fontsize=13)
plt.yticks(fontsize=13)
plt.yticks([])#清空y刻度,共用第一個圖的y軸
plt.title(u'地層三壓力剖面',fontsize=13)
plt.legend(loc=0,fontsize=13)
plt.grid(True)
plt.show()

 作者:ChenBD

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章