📄 form1.frm
字号:
Top = 2160
Width = 615
End
Begin VB.Label Label3
Caption = "J:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 5
Top = 1440
Width = 495
End
Begin VB.Label Label2
Caption = "I:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 4
Top = 720
Width = 375
End
Begin VB.Label Label1
Caption = "模型网格数目:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 240
Width = 2295
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Ni As Integer, Nj As Integer, Nk As Integer 'i j k方向网格数
Dim aimI As Integer, aimJ As Integer, aimK As Integer '井所在网格
Dim RGrid As Integer '周围半径
Dim Perm() As Double 'Kair
Dim dzNet() As Double '有效厚度
Dim Sw() As Double 'Sw
Dim LocalPerm() As Double '存放局部渗透率数据
Dim LocaldzNet() As Double
Dim LocalSw() As Double
Dim welDT(1 To 100) As String
Dim wellperfX() As Integer, wellperfY() As Integer
Private Sub Command1_Click()
Ni = Val(Text1.Text)
Nj = Val(Text2.Text)
Nk = Val(Text3.Text)
aimI = Val(Text4.Text)
aimJ = Val(Text5.Text)
aimK = Val(Text6.Text)
RGrid = Val(Text11.Text)
ReDim Perm(1 To Ni, 1 To Nj, 1 To Nk)
ReDim dzNet(1 To Ni, 1 To Nj, 1 To Nk)
ReDim Sw(1 To Ni, 1 To Nj, 1 To Nk)
Dim i As Integer, j As Integer, k As Integer
Dim ii As Integer, jj As Integer, kk As Integer
Open App.Path & "\perm" For Input As #1
Open App.Path & "\Sw" For Input As #2
Open App.Path & "\dz" For Input As #3
For k = 1 To Nk
For j = 1 To Nj
For i = 1 To Ni
Input #1, Perm(i, j, k)
Input #2, Sw(i, j, k)
Input #3, dzNet(i, j, k)
Next i
Next j
Next k
Close #1
Close #2
Close #3
' ' Open App.Path & "\dznet" For Input As #3
' For k = 1 To Nk
' Line Input #1, ss
' ' Line Input #3, ss
' For j = 1 To Nj
' For i = 1 To Ni
'
' ' Input #3, dzNet(i, j, k)
' Next i
' Next j
' Next k
'
' ' Close #3
' Dim LGridNum As Integer
' LGridNum = (RoundGrid + 2) '周围网格总数
ReDim LocalPerm(1 To 2 * RGrid + 1, 1 To 2 * RGrid + 1, 1 To Nk)
ReDim LocaldzNet(1 To 2 * RGrid + 1, 1 To 2 * RGrid + 1, 1 To Nk)
ReDim LocalSw(1 To 2 * RGrid + 1, 1 To 2 * RGrid + 1, 1 To Nk)
Dim sumPerm As Double, sumdzNet As Double, sumSw As Double
Dim avePerm, Sumpermk, temp As Double, avedzNet As Double, aveSw As Double
Dim tempi, tempj, tempii, tempjj As Integer
Dim Permk(1 To 7), Dzk(1 To 7) As Double
sumPerm = 0
sumdzNet = 0
sumSw = 0
avePerm = 0: avedzNet = 0: aveSw = 0
ii = 0
jj = 0
Open App.Path & "\LocalPerm" For Output As #7
Open App.Path & "\Localdz" For Output As #8
Open App.Path & "\LocalSw" For Output As #9
For k = 1 To Nk
ii = 0
jj = 0
tempj = aimJ - RGrid '边角井预防超出
If tempj <= 0 Then
tempj = 1
End If
tempi = aimI - RGrid
If tempi <= 0 Then
tempi = 1
End If
tempjj = aimJ + RGrid '边角井预防超出
If tempjj > 31 Then
tempjj = 31
End If
tempii = aimI + RGrid
If tempii > 31 Then
tempii = 31
End If
For j = tempj To tempjj
jj = jj + 1
ii = 0
For i = tempi To tempii
ii = ii + 1
LocalPerm(ii, jj, k) = Perm(i, j, k)
LocaldzNet(ii, jj, k) = dzNet(i, j, k)
LocalSw(ii, jj, k) = Sw(i, j, k)
sumPerm = sumPerm + LocalPerm(ii, jj, k)
sumdzNet = sumdzNet + LocaldzNet(ii, jj, k)
sumSw = sumSw + LocalSw(ii, jj, k)
Permk(k) = Permk(k) + LocalPerm(ii, jj, k)
Dzk(k) = Dzk(k) + LocaldzNet(ii, jj, k)
Print #7, LocalPerm(ii, jj, k);
Print #8, LocaldzNet(ii, jj, k);
Print #9, LocalSw(ii, jj, k);
If ii = 2 * RGrid + 1 Then Print #7,
If ii = 2 * RGrid + 1 Then Print #8,
If ii = 2 * RGrid + 1 Then Print #9,
Next i
Next j
Print #7,
Print #8,
Print #9,
kk = k
Next k
Close #7, #8, #9
' Debug.Print ii, jj, kk, k, Nk
For k = 1 To 7
Permk(k) = Permk(k) / (ii * jj) '每一层平均K
Dzk(k) = Dzk(k) / (ii * jj) * 0.4 '每一层平均有效厚度
Sumpermk = Sumpermk + Permk(k) * Dzk(k) 'fenzi
sumdzk = sumdzk + Dzk(k) 'fenmu,总有效厚度
Next k
avePerm = sumPerm / (ii * jj * kk)
avedzNet = sumdzNet / (ii * jj)
aveSw = sumSw / (ii * jj * kk)
temp = Sumpermk / sumdzk
' temp = Sumpermk / avedzNet / 0.4
Text7.Text = avedzNet * 0.4 '总共7层,纯总比 0.4
' Text8.Text = avePerm '数据体中乘了1000
Text8.Text = temp
Text9.Text = aveSw
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Dim sss As String
Dim ii As Integer, jj As Integer
Dim nn As Integer
Dim totalline As Integer
ii = 0
Open App.Path & "\sub-SHcais1-2.DATA" For Input As #1
Do While Not EOF(1)
Line Input #1, sss
nn = InStr(1, sss, "WELSPECS")
If nn > 0 Then
1 Line Input #1, sss
If Mid$(sss, 1, 1) = "/" Then
Exit Do
ElseIf Mid$(sss, 1, 2) = "--" Then
GoTo 1
Else
ii = ii + 1
welDT(ii) = sss
' List1.AddItem RTrim(Mid$(sss, 1, 4))
GoTo 1
End If
End If
Loop
Close #1
totalline = ii
'Debug.Print ii
ReDim wellperfX(1 To totalline), wellperfY(1 To totalline)
For jj = 1 To totalline
sss = welDT(jj)
' If Mid(sss, 1, 2) <> "--" Then
List1.AddItem Trim(Mid$(sss, 1, 11)) '找井名 'rtrim去掉右面的空格
' Text4.Text = RTrim$(Mid$(sss, 13, 2))
' Text5.Text = RTrim$(Mid$(sss, 22, 2))
wellperfX(jj) = Val(RTrim$(Mid$(sss, 25, 2))) '从第18个字符左右读,读两个字符
wellperfY(jj) = Val(RTrim$(Mid$(sss, 30, 2)))
' End If
Next jj
End Sub
Private Sub List1_DblClick()
' If List1.ListIndex = i - 1 Then
Text4.Text = wellperfX(List1.ListIndex + 1)
Text5.Text = wellperfY(List1.ListIndex + 1)
' End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -