Public maximumYaxis, minimumYaxis, K1module, K2module, Mu1, Mu2, Den_Fluid, Den_dry, Den_matrix, K_fluid, K_dry, K_matrix, Den1, Den2, K_sat
Private Sub cmdCalPic1_Click()
a = Text1.Text
b = Text2.Text
c = Text3.Text
d = Text4.Text
e = Picture1.Width
f = Picture1.Height
K1module = a
K2module = b
Call drawfigure(a, b, c, d, f, e)
End Sub
Private Sub cmdCalpic2_Click()
Call checksat(Sw, So, Sg)
Call mixFluid(Text15.Text, Text16.Text, Text17.Text, Text6.Text, Text8.Text, Text12.Text, Text5.Text, Text7.Text, Text11.Text)
preK = K_matrix
maximumK = K_matrix
minimumK = K_fluid
maxYaxis = Fix((maximumK / 5 + 1)) * 5
minYaxis = (Fix(minimumK / 5) - 1) * 5
If (minYaxis < 0) Then
minYaxis = -5
End If
preKpos = Picture2.Height - (K_matrix - minYaxis) * Picture2.Height / (maxYaxis - minYaxis)
zeropos = Picture2.Height - (0 - minYaxis) * Picture2.Height / (maxYaxis - minYaxis)
PreK_dry_Ypos = preKpos
preK_dry_Xpos = 0
preK_sat_Xpos = 0
PreK_sat_Ypos = preKpos
Picture2.DrawStyle = 2
Picture2.Line (0, zeropos)-(Picture2.Width, zeropos)
Picture2.DrawStyle = 1
Label32.Caption = maxYaxis
Label33.Caption = minYaxis
changecolortag = 1
For i = 0 To 99
Call solidBuilder(K_matrix, K_fluid, i / 100)
pic2relativeXpos = i * Picture2.Width / 100
K_dry_Ypos = Picture2.Height - (K_dry - minYaxis) * Picture2.Height / (maxYaxis - minYaxis)
K_sat_Ypos = Picture2.Height - (K_sat - minYaxis) * Picture2.Height / (maxYaxis - minYaxis)
Picture2.ForeColor = RGB(128, 128, 128)
Picture2.DrawWidth = 2
Picture2.Line (preK_dry_Xpos, PreK_dry_Ypos)-(pic2relativeXpos, K_dry_Ypos)
If changecolortag = 1 Then
If Text8.Text + Text12.Text >= Text6.Text Then
If Text8.Text >= Text12.Text Then
redvalue = CInt(Rnd() * 255)
greenvalue = CInt(Rnd() * 20)
bluevalue = CInt(Rnd() * 20)
Else
redvalue = CInt(Rnd() * 255)
greenvalue = CInt(Rnd() * 255)
bluevalue = CInt(Rnd() * 255)
End If
Else
redvalue = CInt(Rnd() * 20)
greenvalue = CInt(Rnd() * 20)
bluevalue = CInt(Rnd() * 255)
End If
changecolortag = 0
Else
End If
Picture2.ForeColor = RGB(redvalue, greenvalue, bluevalue)
Picture2.DrawWidth = 1
Picture2.Line (preK_sat_Xpos, PreK_sat_Ypos)-(pic2relativeXpos, K_sat_Ypos)
preK_dry_Xpos = pic2relativeXpos
PreK_dry_Ypos = K_dry_Ypos
preK_sat_Xpos = pic2relativeXpos
PreK_sat_Ypos = K_sat_Ypos
Next
End Sub
Private Sub Command1_Click()
Picture2.Cls
End Sub
Private Sub Form_Load()
Picture1.DrawWidth = 2
pic1height = Picture1.Height
pic1width = Picture1.Width
K1module = Text1.Text
K2module = Text2.Text
Mu2 = Text4.Text
Mu1 = Text3.Text
Den1 = 2.65
Den2 = 2.4
K_matrix = 36
Den_matrix = 2.65
Den_dry = 2.65
K_fluid = 1.375
End Sub
Function checksat(Sw, So, Sg)
If Text6.Text > 1 Then
MsgBox "含水饱和度不能大于1"
Text6.Text = 1
End If
If Text6.Text < 0 Then
MsgBox "含水饱和度不能小于0"
Text6.Text = 0
End If
If Text8.Text > 1 Then
MsgBox "含油饱和度不能大于1"
Text8.Text = 1
End If
If Text8.Text < 0 Then
MsgBox "含油饱和度不能小于1"
Text8.Text = 0
End If
If Text12.Text > 1 Then
MsgBox "含气饱和度不能大于1"
Text12.Text = 1
End If
If Text12.Text < 0 Then
MsgBox "含气饱和度不能小于1"
Text12.Text = 0
End If
If CDbl(Text6.Text) + CDbl(Text8.Text) + CDbl(Text12.Text) <> 1 Then
If CDbl(Text8.Text) + CDbl(Text12.Text) <= 1 Then
MsgBox "油气水饱和度不为 100%,将自动调整含水饱和度"
Text6.Text = 1 - CDbl(Text8.Text) - CDbl(Text12.Text)
Else
MsgBox "油气水饱和度不为 100%,将自动调整含水饱和度和含气饱和度"
Text6.Text = 0
Text12.Text = 1 - CDbl(Text8.Text)
End If
End If
End Function
Function drawfigure(K1module, K2module, Mu1, Mu2, picheight, picwidth)
Picture1.Cls
maximumYaxis = Fix(K1module / 5 + 1) * 5
temp1 = Fix(K2module / 5 - 1) * 5
If temp1 > 0 Then
minimumYaxis = temp1
Else
minimumYaxis = 0
End If
Label8.Caption = maximumYaxis
Label9.Caption = minimumYaxis
preVRHXaxispos = 0
preVRHavgpos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preHSavgpos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preVRHtoppos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preVRHbottompos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preHStoppos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preHSbottompos = picheight - (K1module - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
preHSXaxispos = 0
Picture1.DrawWidth = 1
Picture1.DrawStyle = 1
For i = 0 To 100 Step 1
Picture1.DrawWidth = 2
VRHXaxispos = i / 100 * picwidth
VRHtopboundary = K1module * (100 - i) / 100 + K2module * (i) / 100
VRHbottomboundary = 1 / (((100 - i) * 0.01 / K1module + i * 0.01 / K2module))
VRHavg = (VRHtopboundary + VRHbottomboundary) / 2
Picture1.ForeColor = H00000000&
VRHtoppos = picheight - (VRHtopboundary - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
VRHbottompos = picheight - (VRHbottomboundary - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
VRHavgpos = picheight - (VRHavg - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
Picture1.Line (preVRHXaxispos, preVRHtoppos)-(VRHXaxispos, VRHtoppos)
Picture1.Line (preVRHXaxispos, preVRHbottompos)-(VRHXaxispos, VRHbottompos)
Picture1.Line (preVRHXaxispos, preVRHavgpos)-(VRHXaxispos, VRHavgpos)
preVRHXaxispos = VRHXaxispos
preVRHtoppos = VRHtoppos
preVRHbottompos = VRHbottompos
preVRHavgpos = VRHavgpos
Picture1.DrawWidth = 1
Picture1.DrawStyle = 3
HSXaxispos = i / 100 * picwidth
HStopboundary = K1module + (i / 100) / ((1 / (K2module - K1module)) + (0.01 * (100 - i) / (K1module + 4 * Mu1 / 3)))
HSbottomboundary = K1module + (i / 100) / ((1 / (K2module - K1module)) + (0.01 * (100 - i) / (K1module + 4 * Mu2 / 3)))
HSavg = (HStopboundary + HSbottomboundary) / 2
HStoppos = picheight - (HStopboundary - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
HSbottompos = picheight - (HSbottomboundary - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
HSavgpos = picheight - (HSavg - minimumYaxis) * picheight / (maximumYaxis - minimumYaxis)
Picture1.ForeColor = 255
Picture1.Line (preHSXaxispos, preHStoppos)-(HSXaxispos, HStoppos)
Picture1.Line (preHSXaxispos, preHSbottompos)-(HSXaxispos, HSbottompos)
Picture1.Line (preHSXaxispos, preHSavgpos)-(HSXaxispos, HSavgpos)
preHSXaxispos = HSXaxispos
preHStoppos = HStoppos
preHSbottompos = HSbottompos
preHSavgpos = HSavgpos
Next
End Function
Function mixFluid(Den_Water, Den_Oil, Den_Gas, Sat_Water, Sat_Oil, Sat_Gas, K_Water, K_Oil, K_Gas)
Den_Fluid = Sat_Water * Den_Water + Sat_Oil * Den_Oil + Sat_Gas * Den_Gas
K_fluid = 1 / (Sat_Water / K_Water + Sat_Oil / K_Oil + Sat_Gas / K_Gas)
Text18.Text = Round(Den_Fluid, 3)
Text19.Text = Round(K_fluid, 3)
End Function
Function solidBuilder(K_matrix, K_fluid, Por)
K_dry = K_matrix * (1 - Por) ^ (3 / (1 - Por))
Text21.Text = Round(K_dry, 4)
K_sat = K_dry + (1 - K_dry / K_matrix) ^ 2 / (Por / K_fluid + (1 - Por) / K_matrix + K_dry / (K_matrix ^ 2))
End Function
Function fillFluid(K_m, K_dry, K_fl, Por)
End Function
Function fluidsubstitution(K_m, K_dry, K_fl, Por, K_sat1, K_sat2)
End Function
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
relativeXpos = X / Picture1.Width
Picture1.ToolTipText = "矿物2含量" + CStr(Round(relativeXpos * 100, 2)) + "%"
VRHtopvalue = re
评论1