📄 form1.frm
字号:
TabIndex = 18
Top = 4890
Width = 2235
End
Begin VB.Label Label10
Alignment = 2 'Center
BackColor = &H00C0FFFF&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管候口直径(mm)"
Height = 465
Left = 1350
TabIndex = 17
Top = 4410
Width = 2235
End
Begin VB.Label Label9
BackColor = &H00FFFF00&
BackStyle = 0 'Transparent
Caption = "输入参数区"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 585
Index = 0
Left = 4980
TabIndex = 8
Top = 210
Width = 1695
End
Begin VB.Shape Shape1
BackColor = &H000000FF&
BorderColor = &H000000FF&
BorderWidth = 3
Height = 2685
Left = 240
Shape = 4 'Rounded Rectangle
Top = 690
Width = 10635
End
Begin VB.Label Label8
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管混合段长度(m)"
Height = 450
Left = 8130
TabIndex = 7
Top = 2325
Width = 2370
End
Begin VB.Label Label7
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管长度(m)"
Height = 465
Left = 5355
TabIndex = 6
Top = 2295
Width = 2445
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管入口锥角(度)"
Height = 480
Left = 2835
TabIndex = 5
Top = 2280
Width = 2130
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "候口处目标压强(Pa)"
Height = 465
Left = 390
TabIndex = 4
Top = 2280
Width = 2220
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "空气质量流量(kg/s)"
Height = 450
Left = 8100
TabIndex = 3
Top = 975
Width = 2385
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管入口直径(m)"
Height = 465
Left = 5310
TabIndex = 2
Top = 960
Width = 2445
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管入口温度(K)"
Height = 480
Left = 2835
TabIndex = 1
Top = 930
Width = 2145
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H0080FF80&
BorderStyle = 1 'Fixed Single
Caption = "文丘里管入口压强(Pa)"
Height = 450
Left = 390
TabIndex = 0
Top = 945
Width = 2205
End
Begin VB.Menu wenjian
Caption = "File"
Begin VB.Menu sheji
Caption = "文丘里管设计要求"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim R As Single
R = 287.04 '定义气体常数
Dim k As Single
k = 1.4 '定义空气热容比
Dim u As Single
u = 1.8 / 100000 / 1.205 '定义气体运动粘度
'#########计算候口直径
Dim Pa As Single
Pa = Text1.Text
Dim Ta As Single
Ta = Text2.Text
Dim da As Single
da = Text3.Text
Dim m As Single
m = Text4.Text
Dim Po As Single
Po = Text5.Text
Dim ang As Single
ang = Text6.Text
Dim L As Single
L = Text7.Text
Dim Lo As Single
Lo = Text8.Text
'#########定义完毕
Dim rho As Single 'rho为进口处空气密度
rho = Pa / (R * Ta)
Dim va As Single 'va为进口处空气流速
va = 4 * m / (rho * 3.1415926 * da * da)
Dim aa As Single 'aa为进口处当地声速
aa = (R * k * Ta) ^ 0.5
Dim Ma As Single 'Ma为进口处马赫数
Ma = va / aa
Dim Tt As Single 'Tt为进口处滞止温度
Tt = Ta * (1 + (k - 1) / 2 * Ma * Ma)
Dim Pt As Single 'Pt为进口处滞止压强
Pt = Pa * (Tt / Ta) ^ (k / (k - 1))
Dim rhot As Single 'rhot为进口处的滞止温度
rhot = rho * (1 + (k - 1) / 2 * Ma ^ 2) ^ (k / (k - 1))
Dim x As Single
Dim y As Single
x = (2 * k * Pt ^ 2) / (R * Tt * (k - 1))
y = (Po / Pt) ^ (2 / k) - (Po / Pt) ^ ((k + 1) / k)
Dim Ao As Single 'Ao喉口目标压强为Po时的喉口面积
Ao = m / ((x * y) ^ 0.5)
Dim doo As Single 'doo为此时的喉口直径
doo = (4 * Ao / 3.1415926) ^ 0.5
doo = doo * 1000 '由米化为毫米
Text9.Text = Int(doo * 100 + 0.5) / 100 '取两位小数
doo = doo / 1000
'*****************计算文丘里管喉口临界截面积和直径
Dim Tcr As Single 'tcr为喉口处的临界温度
Tcr = Tt * 2 / (k + 1)
Dim vcr As Single 'vcr为喉口处的临界速度
vcr = (k * R * Tcr) ^ 0.5
Dim rhocr As Single 'rhocr为喉口处的临界密度
rhocr = rhot * (2 / (k + 1)) ^ (1 / (k - 1))
Dim Acr As Single 'Acr为临界喉口截面面积
Acr = m / (rhocr * vcr)
Dim dcr As Single 'dcr为临界喉口直径
dcr = (4 * Acr / 3.1415926) ^ 0.5
dcr = dcr * 1000 '由米化为毫米
Text10.Text = Int(dcr * 100 + 0.5) / 100 '取两位小数
dcr = dcr / 1000
'**********************计算收缩段和扩张段结构参数
Dim L1 As Single 'L1为收缩段长度
L1 = (da - doo) / (2 * Tan(ang * 3.1415926 / 360))
L1 = L1 * 1000 '由米化为毫米
Text12.Text = Int(L1 * 100 + 0.5) / 100 '取两位小数
L1 = L1 / 1000
Dim L2 As Single 'L2为扩张段长度
L2 = L - Lo - L1
L2 = L2 * 1000 '由米化为毫米
Text13.Text = Int(L2 * 100 + 0.5) / 100 '取两位小数
L2 = L2 / 1000
Dim ang2 As Single 'ang2为扩张段锥角
ang2 = 180 / 3.1415926 * 2 * Atn((da - doo) / (2 * L2))
Text11.Text = Int(ang2 * 100 + 0.5) / 100 '取两位小数
'**********************计算流体经过文丘里管的局部损失
Dim Re As Single 'Re为雷诺数
Re = va * da / u
Dim lamda As Single
If Re > 4000 & Re < 10 ^ 5 Then
lamda = 0.3164 / Re ^ (1 / 4)
Else
lamda = 0.0032 + 0.221 * Re ^ (-0.237)
End If
Dim e1 As Single
Dim e2 As Single
e1 = lamda / (Sin(3.1415926 * ang / 360)) * (1 - ((doo / da) ^ 2) ^ 2)
e2 = lamda / (8 * Sin(ang2 * 3.1415926 / 360)) * (1 - ((doo / da) ^ 2) ^ 2) + 0.15 * (1 - (doo / da) ^ 2)
Dim h As Single 'h为局部损失
h = (lamda * L / da + e1 + e2) * va ^ 2 / 19.6
Text14.Text = Int(h * 100 + 0.5) / 100 '取两位小数
'^^^^^^^^^^^^^^^^^^^^^^&&&&&&&&&&&&&&&&&&&&&&&&&&&&&求沿程损失
'@@@@@@@@@@@@@@@@@@@^^^^^^^^^^^(1)混合管的沿程损失
Dim lab2 As Single '混合管入口的沿程损失系数
Dim hf2 As Single '混合管的沿程损失
Dim v2 As Single '定义进入混合管时的速度
v2 = m / (Ao * rhot * (Po / Pt) ^ (1 / 1.4))
Re2 = v2 * doo / u
lab2 = 0.0032 + 0.221 * Re2 ^ (-0.237)
hf2 = lab2 * Lo * v2 * v2 / doo / 2 / 9.8 '@@求出了混合管的沿程损失
Text15.Text = Int(v2 * 10 + 0.5) / 10
'@@@@@@@@@@@@@@@@@@@^^^^^^^^^^^(2)收缩管的沿程损失
Dim lab1 As Single '混合管入口的沿程损失系数
Dim hf1 As Single '混合管的沿程损失
Dim v1 As Single '定义进入混合管时的速度
v1 = (va + v2) / 2
Re1 = v1 * ((da + doo) / 2) / u
lab1 = 0.0032 + 0.221 * Re2 ^ (-0.237)
hf1 = lab2 * L1 * v1 * v1 / ((da + doo) / 2) / 2 / 9.8 '@@求出了混合管的沿程损失
'@@@@@@@@@@@@@@@@@@@^^^^^^^^^^^(2)扩张管的沿程损失
Dim lab3 As Single '混合管入口的沿程损失系数
Dim hf3 As Single '混合管的沿程损失
Dim v3 As Single '定义进入混合管时的速度
v3 = (va + v2) / 2
Re3 = v3 * ((da + doo) / 2) / u
lab3 = 0.0032 + 0.221 * Re3 ^ (-0.237)
hf3 = lab3 * L2 * v3 * v3 / ((da + doo) / 2) / 2 / 9.8 '@@求出了混合管的沿程损失
Text14.Text = Int((hf1 + hf3 + hf2) * 100 + 0.5) / 100
'*****************画图显示
Picture1.Cls
Picture1.Scale (0, Text3.Text)-(Text7.Text, 0)
'******连线AC
Picture1.Line (0, Text3.Text)-(L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线BD
Picture1.Line (0, 0)-(L1, L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线CD
Picture1.Line (L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360))-(L1, L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线GE
Picture1.Line (Text7.Text, Text3.Text)-(Text8.Text + L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线HF
Picture1.Line (Text7.Text, 0)-(Text8.Text + L1, L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线FE
Picture1.Line (Text8.Text + L1, L1 * Tan(Text6.Text * 3.1415926 / 360))-(Text8.Text + L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线CE
Picture1.Line (L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360))-(Text8.Text + L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'******连线DF
Picture1.Line (L1, L1 * Tan(Text6.Text * 3.1415926 / 360))-(Text8.Text + L1, L1 * Tan(Text6.Text * 3.1415926 / 360)), QBColor(12)
'**************给图形加上标注
Label16.Caption = Int((Text3.Text * 1000) * 100 + 0.5) / 100 '取两位小数
'******标注混合长度
Picture1.Line (L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(0, 0.008), QBColor(9)
Picture1.Line (Text8.Text + L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(0, 0.008), QBColor(9)
Label18.Visible = True
Label18.Left = L1 + 0.007 '****左边距离为0.004+L1
Label18.Top = Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360) + 0.008
Label18.Caption = Text8.Text * 1000
Picture1.Line (L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360) + 0.004)-Step(Text8.Text, 0), QBColor(9) '********加条线,穿过标定值
'************标注候管直径
Picture1.Line (Text8.Text + L1, Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(0.01, 0), QBColor(9)
Picture1.Line (Text8.Text + L1, L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(0.01, 0), QBColor(9)
Label19.Visible = True
Label19.Left = Text8.Text + L1 + 0.001
Label19.Top = (Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360) + L1 * Tan(Text6.Text * 3.1415926 / 360)) / 2 + 0.004
Label19.Caption = Text9.Text
Picture1.Line (Text8.Text + L1 + 0.005, L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(0, doo), QBColor(9)
'*******标注入口段长度
Picture1.Line (0, Text3.Text / 2)-Step(L1, 0), QBColor(9)
Label20.Left = L1 / 2
Label20.Top = 0.003 + (Text3.Text - L1 * Tan(Text6.Text * 3.1415926 / 360) + L1 * Tan(Text6.Text * 3.1415926 / 360)) / 2
Label20.Visible = True
Label20.Caption = Text12.Text
'***********标注扩张管长度
Picture1.Line (Text8.Text + L1, L1 * Tan(Text6.Text * 3.1415926 / 360))-Step(L2, 0), QBColor(9)
Label21.Visible = True
Label21.Left = (Text8.Text + L1 + Text7.Text) / 2
Label21.Top = L1 * Tan(Text6.Text * 3.1415926 / 360) + 0.003
Label21.Visible = True
Label21.Caption = Text13.Text
'***************标上锥角
Label22.Visible = True
Label23.Visible = True
Label23.Caption = Text6.Text
Label24.Visible = True
Label25.Visible = True
Label25.Caption = Text11.Text
'****
Label17.Visible = True
Line1.Visible = True
Line2.Visible = True
Line3.Visible = True
End Sub
Private Sub Command2_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text15.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Label16.Caption = ""
'**********************使有记忆功能
Dim zfch1 As String, zfch2 As String, zfch3 As String, zfch4 As String, zfch5 As String, zfch6 As String, zfch7 As String, zfch8 As String
FileName = Dir("c:\windows\vbzhqch1.dat")
If FileName = "" Then
Open "c:\windows\vbzhqch1.dat" For Output As #1
Print #1, "196000"
Print #1, "311"
Print #1, "0.067"
Print #1, "0.152"
Print #1, "168000"
Print #1, "23"
Print #1, "0.32"
Print #1, "0.026"
Close #1
End If
Open "c:\windows\vbzhqch1.dat" For Input As #1
Input #1, zfch1
Input #1, zfch2
Input #1, zfch3
Input #1, zfch4
Input #1, zfch5
Input #1, zfch6
Input #1, zfch7
Input #1, zfch8
Close #1
Text1.Text = zfch1
Text2.Text = zfch2
Text3.Text = zfch3
Text4.Text = zfch4
Text5.Text = zfch5
Text6.Text = zfch6
Text7.Text = zfch7
Text8.Text = zfch8
End Sub
Private Sub sheji_Click()
Form3.Show
End Sub
Private Sub shuoming_Click()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -