【正文】
ublic gd0 As Single 39??諝饷芏?Kg/m3 常量在調(diào)用時需賦值 Public t0 As Single 39。標準狀態(tài)下溫度℃ 常量在調(diào)用時需賦值 Public g As Single 39。重力加速度 m/s2 常量在調(diào)用時需賦值 東北石油大學石油工程課程設(shè)計(報告) Public Rp As Single 39。生產(chǎn)油氣比 不變量在調(diào)用時需賦值 Public AP As Single 39。油管截面積 m2 不變量在調(diào)用時需賦值 Public NN As Single 39。計算點的個數(shù) 39。數(shù)組的定義 Public SHUZUH(2020) As Single 39。計算點深度 m Public SHUZUP(2020) As Single 39。計算點壓力 MPa Public SHUZUT(2020) As Single 39。計算點溫度℃ Public SHUZUd(2020) As Single 39。計算點混合物平均密度 Kg/m3 Public SHUZUuo(2020) As Single 39。計算點原油粘度 mPas Public SHUZURs(2020) As Single 39。計算溶解油氣比 Public SHUZUBo(2020) As Single 39。計算點原油體積系數(shù) Public SHUZUZ(2020) As Single 39。計算點天然氣壓縮系數(shù) Public SHUZUug(2020) As Single 39。計算點天然氣粘度 mPas Public SHUZUuw(2020) As Single 39。水的粘度 mPas 39。求溶解油氣比 Rs( p,t)函數(shù) Public Function Rs(P As Single, t As Single) As Single Dim c1 As Single, c2 As Single If miduor = Then c1 = : c2 = : c3 = Else c1 = : c2 = : c3 = End If Rs = * c1 * dgr689 * ( * P) ^ (c2) * Exp(c3 * (( * miduor) / (miduor * ( * t + 492)))) If Rs Rp Then Rs = Rp End Function 39。求原油體積系數(shù) Bo(p,t)函數(shù) Public Function Bo(P As Single, t As Single) As Single Dim Bob As Double, c1 As Single, c2 As Single, c3 As Single Dim a1 As Single, a2 As Single, a3 As Single, a4 As Single, a5 As Single, a6 As Single Dim c0 As Single If P = Pb Then If miduor = Then c1 = * 10 ^ (4): c2 = * 10 ^ (5): c3 = * 10 ^ (8) Else c1 = * 10 ^ (4): c2 = * 10 ^ (5): c3 = * 10 ^ (9) End If Bo = 1 + * c1 * Rs(P, t) + c2 * ( * t 28) * (( * miduor) / (miduor * dgr689)) + * c3 * Rs(P, t) * ( * t 28) * (( * miduor) / (miduor * dgr689)) 東北石油大學石油工程課程設(shè)計(報告) Else Bob = Bo(Pb, tpb) a1 = 1433: a2 = 5: a3 = : a4 = 1180: a5 = : a6 = 10 ^ 5 c0 = * (a1 + * a2 * Rs(P, t) + a3 * ( * t + 32) + a4 * dgr689 + a5 * ( * miduor) / miduor) / (a6 * P) Bo = Bob * Exp(c0 * (P Pb)) End If End Function 39。求天然氣壓縮系數(shù) Z(p,t)函數(shù) 39。富氣為 1,貧氣為 0 Public Function Z(P As Single, t As Single) As Single Dim Tc As Single, Pc As Single Dim Tr As Single, Pr As Single, dr As Single 39。( dr 為天然氣的對比度) Dim i As Integer If Flag = 1 Then If midugr = Then Tc = 132 + * midugr Pc = 5102 * midugr Else Tc = 106 + * midugr Pc = 4778 * midugr End If Else If midugr = Then Tc = 92 + * midugr Pc = 4881 * midugr Else Tc = 92 + * midugr Pc = 4778 * midugr End If End If Z = 1 Tr = (273 + t) / Tc: Pr = P / Pc For i = 1 To 5 dr = * Pr / (Z * Tr) Z = 1 + ( / Tr / Tr ^ 3) * dr + ( / Tr + / Tr ^ 3) * dr ^ 2 Next i End Function 東北石油大學石油工程課程設(shè)計(報告) 39。求原油粘度 uo 函數(shù) Public Function uo(P As Single, t As Single) As Single Dim uon As Single Dim x As Single, y As Single, zz As Single, a As Single, b As Single zz = * (( * miduor) / miduor): y = 10 ^ zz: x = y * ( * 20 + 32) ^ () 39。地面脫氣原油溫度取 15℃ ,對結(jié)果影響較大 uon = 10 ^ x 1 a = * ( * Rs(P, t) + 100) ^ () b = * ( * Rs(P, t) + 150) ^ () uo = a * uon ^ b End Function 39。求管道條件下天然氣密度 dg(p,t)函數(shù) Public Function dg(P As Single, t As Single) As Single dg = midug * P * ( + t0) / (Z(P, t) * p0 * ( + t)) 39。根據(jù)氣體狀態(tài)方程推導 ,地面標準條件下 Z=1 End Function 39。求管道條件下天然氣相對密度 dgr(p,t)函數(shù) Public Function dgr(P As Single, t As Single) As Single dgr = dg(P, t) / gd0 End Function 39。求天然氣粘度 ug(t)函數(shù) Public Function ug(P As Single, t As Single) As Single Dim x As Single, y As Single, c As Single x = + 548 / (t + ) + * midugr y = * x c = ( + * midugr) * (273 + t) ^ / (116 + 306 * midugr + (273 + t)) ug = c * 10 ^ (3) * Exp(x * (dg(P, t) * 10 ^ (3)) ^ y) End Function 39。求水粘度 uw(t)函數(shù) Public Function uw(t As Single) As Single uw = Exp( ( * 10 ^ (2) * ( * t + 32)) + ( * 10 ^ (5) * ( * t + 32) ^ 2)) End Function 39。求以 10 為底的對數(shù) log10(x)的函數(shù) Public Function Log10(x As Single) As Single Log10 = Log(x) / Log(10) End Function 39。求混合物的密度 dm(p,t)函數(shù) Public Function dm(P As Single, t As Single) As Single 東北石油大學石油工程課程設(shè)計(報告) Vt = Bo(P, t) + WO + Z(P, t) * p0 * (273 + t) / (P * (273 + t0)) * Abs(Rp Rs(P, t)) dm = Wt / Vt 39?;旌衔锏钠骄芏? End Function 39。求壓力梯度函數(shù) Public Function r(P As Single, t As Single) As Single Dim m As Integer, n As Integer Dim K As Single, a As Single, b As Single Dim a0 As Single, a1 As Single, a2 As Single Dim Reg As Single, Rel As Single, Re2 As Single Dim f As Single 39。摩擦阻力損失系數(shù) Dim ul As Single 39。平均溫度和平均壓力下的液體粘度 Dim AP As Single 39。求氣相、液相雷諾數(shù) ul = uo(P, t) * (1 fw) + uw(t) * fw AP = * d ^ 2 / 4 Reg = d * qo * Abs(Rp Rs(P, t)) * midug / AP / (ug(P, t) / 1000) 39。(天然氣粘度為 因此要除以 1000) Rel = d * qo * (miduo + gdg * Rs(P, t) + miduw * WO) / AP / (ul / 1000) 39。求兩相雷諾數(shù) K = Abs(Rp Rs(P, t)) * midug / (miduo + gdg * Rs(P, t) + miduw * WO) m = 10: n = 1 a = m * K / (m * K + 1): b = 1 / Exp(n * K) Re2 = Reg ^ a * Rel ^ b 39。求摩擦損失系數(shù) f a0 = / ((100 * K) ^ 5 + ) + * (100 * K) + * (100 * K) ^ 2 a1 = / ((100 * K) ^ + ) + * (100 * K) * (100 * K) ^ 2 a2 = / ((100 * K) ^ 5 + ) + * (100 * K) + * (100 * K) ^ 2 f = 10 ^ (a0 + a1 * Log10(Re2) + a2 * (Log10(Re2)) ^ 2) r = dm(P, t) * g + f * qo ^ 2 * Wt ^ 2 / ( * d ^ 5 * dm(P, t)) End Function 39。井溫分布計算 Public Function t(l As Single) As Single Dim W As Single 39。水當量 Dim q1 As Single 39。內(nèi)熱源,對于常規(guī)采油, q1=0