?? form5.frm
字號:
VERSION 5.00
Begin VB.Form Form5
Caption = "紊流過度光滑區(1-1-4)"
ClientHeight = 6495
ClientLeft = 60
ClientTop = 420
ClientWidth = 8085
LinkTopic = "Form5"
ScaleHeight = 6495
ScaleWidth = 8085
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 615
Left = 600
TabIndex = 13
Top = 0
Width = 1335
End
Begin VB.TextBox Text2
Height = 615
Left = 3120
TabIndex = 12
Top = 0
Width = 1455
End
Begin VB.TextBox Text3
Height = 615
Left = 5760
TabIndex = 11
Top = 0
Width = 1575
End
Begin VB.TextBox Text4
Height = 615
Left = 600
TabIndex = 10
Top = 1080
Width = 2535
End
Begin VB.TextBox Text5
Height = 615
Left = 5520
TabIndex = 9
Top = 1080
Width = 2415
End
Begin VB.TextBox Text6
Height = 615
Left = 5520
TabIndex = 8
Top = 1920
Width = 2415
End
Begin VB.TextBox Text7
Height = 615
Left = 600
TabIndex = 7
Top = 2760
Width = 2415
End
Begin VB.TextBox Text8
Height = 615
Left = 5520
TabIndex = 6
Top = 2760
Width = 2415
End
Begin VB.TextBox Text9
Height = 615
Left = 600
TabIndex = 5
Top = 3600
Width = 2415
End
Begin VB.TextBox Text10
Height = 615
Left = 5520
TabIndex = 4
Top = 3600
Width = 2415
End
Begin VB.TextBox Text11
Height = 615
Left = 600
TabIndex = 3
Top = 1920
Width = 2415
End
Begin VB.CommandButton Command1
Caption = "計算"
Height = 495
Left = 120
TabIndex = 2
Top = 5520
Width = 1695
End
Begin VB.CommandButton Command3
Caption = "清除"
Height = 495
Left = 3120
TabIndex = 1
Top = 5520
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 5520
TabIndex = 0
Top = 5520
Width = 1935
End
Begin VB.Label Label1
Caption = "ks/d"
Height = 615
Left = 5040
TabIndex = 25
Top = 3600
Width = 495
End
Begin VB.Label Label2
Caption = "ks"
Height = 615
Left = 120
TabIndex = 24
Top = 0
Width = 495
End
Begin VB.Label Label3
Caption = "d"
Height = 615
Left = 2520
TabIndex = 23
Top = 0
Width = 615
End
Begin VB.Label Label4
Caption = "溫度"
Height = 615
Left = 5160
TabIndex = 22
Top = 0
Width = 615
End
Begin VB.Label Label5
Caption = "總管長"
Height = 615
Left = 120
TabIndex = 21
Top = 1080
Width = 495
End
Begin VB.Label Label6
Caption = "總損失系數"
Height = 615
Left = 4920
TabIndex = 20
Top = 1080
Width = 615
End
Begin VB.Label Label7
Caption = "高差"
Height = 615
Left = 120
TabIndex = 19
Top = 1920
Width = 615
End
Begin VB.Label Label8
Caption = "流量"
Height = 615
Left = 120
TabIndex = 18
Top = 2760
Width = 615
End
Begin VB.Label Label9
Caption = "計算的系數"
Height = 615
Left = 4920
TabIndex = 17
Top = 1920
Width = 495
End
Begin VB.Label Label10
Caption = "流速"
Height = 615
Left = 4920
TabIndex = 16
Top = 2760
Width = 495
End
Begin VB.Label Label11
Caption = "re"
Height = 615
Left = 240
TabIndex = 15
Top = 3600
Width = 495
End
Begin VB.Label Label12
Height = 615
Left = 240
TabIndex = 14
Top = 4680
Width = 7455
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim b1 As Single, b2 As Single, b3 As Single, b4 As Single, b5 As Single
Dim a(21, 2) As Single, i As Integer, j As Integer, a1 As Single, a2 As Single, a3 As Single ' j為溫度
Dim b6 As Single, re As Single, b8 As Single, b9 As Single, b10 As Single
Text1.SetFocus
j = Val(Text3.Text)
If j < 0 Or j > 100 Then
MsgBox ("請輸入0到100之間的數")
Text1.Text = ""
Text1.SetFocus
End If
For i = 1 To 21
a(i, 1) = 5 * (i - 1)
Next i
a(1, 2) = 1.792
a(2, 2) = 1.519
a(3, 2) = 1.308
a(4, 2) = 1.141
a(5, 2) = 1.007
a(6, 2) = 0.897
a(7, 2) = 0.804
a(8, 2) = 0.727
a(9, 2) = 0.661
a(10, 2) = 0.605
a(11, 2) = 0.556
a(12, 2) = 0.513
a(13, 2) = 0.477
a(14, 2) = 0.444
a(15, 2) = 0.415
a(16, 2) = 0.39
a(17, 2) = 0.367
a(18, 2) = 0.347
a(19, 2) = 0.328
a(20, 2) = 0.311
a(21, 2) = 0.296
For i = 1 To 21
If j = a(i, 1) Then
a1 = a(i, 2)
End If
Next i
For i = 1 To 20
If a(i, 1) < j And j < a(i + 1, 1) Then
a1 = a(i, 2) - ((a(i, 2) - a(i + 1, 2)) / 5) * (j - a(i, 1))
End If
Next i
b1 = Val(Text1.Text)
b2 = Val(Text2.Text)
b3 = Val(Text4.Text)
b4 = Val(Text5.Text)
b6 = Val(Text11.Text)
If b1 <> 0 And b2 <> 0 And b3 <> 0 And b4 <> 0 And b6 <> 0 Then
For re = 3000 To 300000
b5 = 1 / (2 * Log(a1 / 3.7) / Log(10)) ^ 2
a2 = Abs((1 / (2 * Log(2.51 / (re * Sqr(b5)) + a1 / 3.7) / Log(10)) ^ 2) - b5) / b5
a3 = 1
Do While b2 > 0.001
b5 = b5 + 0.000001
b2 = Abs((1 / (2 * Log(2.51 / (re * Sqr(b5)) + a1 / 3.7) / Log(10)) ^ 2) - b5) / b5
If b5 > 0.1 Then Exit Do
Loop
b8 = ((0.25 * 3.1415926 * ((b2) ^ 2) * (2 * 9.81 * b6) ^ (0.5)) / ((((b5 * b3) / b2) + b4) ^ (0.5)))
b9 = (4 * b8) / (3.14 * (b2 ^ 2))
b10 = (b9 * b2) / a1
If Abs(b10 - re) < 10 Then '精度可自定義
Text6.Text = b5
Text7.Text = b8
Text8.Text = b9
Text9.Text = b10
Text10.Text = b1 / b2
End If
Next re
If re > 300000 Then
Label12.Caption = ""
Label12.Caption = "不在此區,請選擇其他區域"
End If
Else
Label12.Caption = ""
Label12.Caption = "請輸入KS D 溫度 長度 系數 高差H"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
Form5.Hide
Form1.Show
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Label12.Caption = ""
Text1.SetFocus
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -