柴油机工作过程算

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

图1,计算结果;
图2,P-V图
图3,P-Φ图图4,P-φ图
图5,h-Φ图
图6,活塞温度图
程序代码:
Option Explicit
Dim n, nn, pr, po As Single
Dim tr, pa, s, d, vh, kkk As Single Dim pab, e, paa, pad, pac As Single
Dim tt, T, yy, fa, X, Y, ta As Single
Dim nv, n1, tc, jx, pc, fx As Single
Dim l, vc, Va, gc, gh, g0 As Single
Dim vcx, r, lo, A, mt, m1, m2, u0, u As Single
Dim khu, cv1, cv2, tz, ccc, hu, qq, aaa, bbb As Single
Dim l8, n2, pz, H, tb, pi1, pi, φx, φ, p As Single
Dim fi, pm, nm, ni, gi, ne, pe, ge, nne, i, v, pb, pcx, vbx, pbx As Double
Dim aa(50), ylsgb As Single
Private Sub Command4_Click()
Picture1.Cls
Picture1.ForeColor = vbGreen
Picture1.DrawWidth = 1.5
Picture1.Scale (-0.1, 99)-(1, -10)
Picture1.Line (0, 0)-(0, 95) 'y轴
Picture1.Line (0, 0)-(0.95, 0) 'x轴
Picture1.Line (0.93, 1)-(0.95, 0)
Picture1.Line (0.93, -1)-(0.95, 0)
Picture1.Line (0.015, 94)-(0, 95)
Picture1.Line (-0.015, 94)-(0, 95)
For i = 1 To 9 Step 1
Picture1.Line (0, i * 10)-(0.015, i * 10)
Picture1.Line (0.1 * i, 0)-(0.1 * i, -1)
Picture1.CurrentX = -0.1: Picture1.CurrentY = 10 * i + 3: Picture1.Print i * 10
Picture1.CurrentX = 0.1 * i - 0.04: Picture1.CurrentY = -3: Picture1.Print "0" & i * 0.1 Next i
Picture1.CurrentX = 0: Picture1.CurrentY = 95: Picture1.Print " P (atm)"
Picture1.CurrentX = 0.8: Picture1.CurrentY = 10: Picture1.Print "V (L)"
'压缩过程曲线
If vh = 0 Then
MsgBox "请先输入参数,并计算", 0, "提示": GoTo q End If
vc = vh / e
Dim X As Single: Dim pcx, vcx As Single
Picture1.DrawWidth = 1.3
Picture1.Line (vc, 10 * po)-(0.9, 10 * po)
Picture1.Line (vc, po)-(vc, 88)
Picture1.DrawWidth = 1.5
Picture1.ForeColor = vbYellow
For X = v To vc Step -0.0001
vcx = X
pcx = pa * (v / vcx) ^ n1
Picture1.PSet (vcx, pcx)
Next X
'燃烧过程曲线
Picture1.Line (vcx, pcx)-(vc, pz)
'膨胀过程曲线
Dim vbx, pbx As Single
Picture1.Line (vc, pz)-(vc * p, pz): vc = vc * p
For X = vc To v Step 0.0001
vbx = X
pbx = pz * ((vc / vbx) ^ n2)
Picture1.PSet (vbx, pbx)
Next X
'排气过程曲线
Picture1.Line (vbx, pbx)-(v, pa)
Picture1.DrawWidth = 1
Picture1.ForeColor = vbRed
Picture1.CurrentX = 0.1: Picture1.CurrentY = 8: Picture1.Print "po"
Picture1.CurrentX = 0.02: Picture1.CurrentY = 20: Picture1.Print "vc"
q:
End Sub
Private Sub Command1_Click()
s = Val(Text2.Text): d = Val(Text4.Text)
n = Val(Text1.Text): po = Val(Text15.Text) / 10:
e = Val(Text5.Text): tt = Val(Text17.Text): fa = Val(Text18.Text): r = Val(Text2.Text)
l = Val(Text31.Text) / 3.14 / ((d / 2) ^ 2)
gc = Val(Text11.Text): gh = Val(Text12.Text): g0 = Val(Text8.Text)
A = Val(Text19.Text): mt = Val(Text20.Text): fi = Val(Text9.Text): i = Val(Text3.Text)
n1 = Val(Text14.Text): n2 = Val(Text33.Text)
'排气过程
pr = Int(1000 * 10.8 * po) / 1000: tr = 350 / (1.2 / Log(n) * Log(10) + 0.005 * (e - 3) + 0.01 * (fa - 1)): hu = 42500 '柴油机暂时先赋的值
'进气过程
paa = n ^ 2 / 520000000
pac = ((e - 0.5) ^ 2) / ((e - 1) ^ 2) '残余废气收缩系数暂时取的0.5
T = 20 't 进气温升取的20
pa = 0.9 * po * 10 '进气压力
yy = (tt + T) * pr / tr / (e * pa - pr) ' 残余废气系数yy
ta = (tt + T + yy * tr) / (1 + yy) '进气温度nv = tt * pa * e * (e * pa - pr) / (tt + T) / (10 * po) / (e - 1) / e / pa '充气系数
'压缩过程
'平均压缩多变指数
pc = Int(100 * (pa * e ^ (n1))) / 100 '压缩终点压力
tc = Int(10 * ta * e ^ (n1 - 1)) / 10 '压缩终点温度
'燃烧过程
lo = 1 / 0.21 * (gc / 12 + gh / 4 - g0 / 32)
m1 = A * lo: m2 = A * lo + gh / 4 + g0 / 32
u0 = m2 / m1
u = (u0 + yy) / (1 + yy) '实际分子变更系数
'化学损失
khu = 0
cv1 = (4.815 + 0.000415 * tc) * 4.1868
qq = Val(Text30.Text) '---------------------------qq 热量利用系数选取ccc = (qq * (hu - khu) / m1 / (1 + yy) + cv1 * tc) / u
aaa = (3.3 / A + 3.7) * 4.1868 / 10000 '柴油机
bbb = (4.8 + 2.2 / A) * 4.1868
tz = Int((-bbb + (bbb ^ 2 + 4 * aaa * ccc) ^ 0.5) / 2 / aaa) '燃烧终点温度
ylsgb = Val(Text29.Text)
p = u * tz / ylsgb / tc '----柴油机预期膨胀比----
pz = Int(100 * (ylsgb * pc)) / 100 '最高燃烧压力
pb = Int(100 * (pz / (e ^ n2))) / 100 '膨胀终点压力
tb = Int(tz / (e ^ (n2 - 1))) '膨胀终点温度
pi1 = pc / (e - 1) * (ylsgb * p / (n2 - 1) * (1 - 1 / e ^ (n2 - 1)) - 1 / (n1 - 1) * (1 - 1 / e ^ (n1 - 1))) pi = fi * pi1 '平均指示压力
pm = 0.1 * (Val(Text32.Text)) ^ 0.5 * (1 + n / 1000) '机械损失压力
nm = 1 - pm / pi ' 机械效率
ni = Int(10000 * 8.314 * m1 * tt * pi / hu / 10 / po / nv) / 10000 '指示热效率
gi = 3600000 / hu / ni '指示燃油消耗率
ne = nm * ni '有效热效率
pe = pi * nm '平均有效压力
ge = 3600000 / hu / ne '有效燃油消耗率
vh = Int(10000 * 3.14 * (d / 2) ^ 2 * r / 10 ^ 6) / 10000
v = Int(10000 * (vh / e + vh)) / 10000
nne = i * v * pe * n / 1224
Text7(1).Text = "0" & Int(10000 * ni) / 10000
Text7(3).Text = Int(100 * gi) / 100
Text7(4).Text = "0" & Int(10000 * ne) / 10000
Text7(5).Text = Int(1000 * pe) / 1000
Text7(6).Text = Int(100 * ge) / 100
Text7(7).Text = Int(100 * nne) / 100
Text10.Text = pr: Text13.Text = Int(10 * tr) / 10: Text21.Text = "0" & Int(100 * pa) / 100: Text22.Text = Int(ta * 10) / 10
Text23.Text = pz: Text24.Text = tz: Text25.Text = tb: Text26.Text = pb
Text27.Text = pc: Text28.Text = tc
eee:
End Sub
Private Sub Command5_Click()
Picture1.Cls
Picture1.Scale (-10, 120)-(780, -10)
Picture1.Line (0, 0)-(725, 0)
Picture1.Line (0, 0)-(0, 115)
vc = vh / (e - 1)
Picture1.Line (0, po)-(720, po), RGB(0, 220, 0)
Picture1.CurrentX = 680: Picture1.CurrentY = 8: Picture1.Print "φ(°AC)"
Picture1.CurrentX = 10: Picture1.CurrentY = 129: Picture1.Print "P (bar)"
For Y = 10 To 110 Step 10#
Picture1.Line (0, Y)-(7, Y)
Picture1.CurrentX = -0.1: Picture1.CurrentY = Y: Picture1.Print Y
Next Y
Picture1.Line (0, 115)-(-5, 112)
Picture1.Line (0, 115)-(5, 112)
For X = 0 To 720 Step 60
Picture1.Line (X, 0)-(X, 2)
Picture1.CurrentX = X - 20: Picture1.CurrentY = -2: Picture1.Print X Next X
Picture1.Line (725, 0)-(716, 2)
Picture1.Line (725, 0)-(716, -2)
If vh = 0 Then
MsgBox "请先输入参数,并计算", 0, "提示": GoTo q
End If
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
For φx = 3.14 To 6.28 Step 0.0001
vcx = vh / 2 * ((1 - Cos(φx)) + (1 - Cos(2 * φx)) * r * l / 4) + vc '压缩过程
pcx = pa * (Va / vcx) ^ n1
φ = φx * 180 / 3.14
Picture1.PSet (φ, pcx), RGB(0, 400, 200)
Next φx
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
For φx = 9.42 To 6.28 Step -0.0001
vbx = vh / 2 * ((1 - Cos(φx)) + (1 - Cos(2 * φx)) * r * l / 4) + vc
pbx = pb * (Va / vbx) ^ n2
φ = φx * 180 / 3.14
If pbx <= pz Then
Picture1.PSet (φ + 20, pbx), RGB(400, 0, 220)
Else: Picture1.Line (360, pz)-(φ, pz), RGB(400, 100, 0) '做功过程
Picture1.Line (360, pc)-(360, pz), RGB(0, 0, 220)
End If
Next φx
Picture1.Line (540, 2.11)-(720, 2.11)
Picture1.Line (360, 54.202)-(360, 86.72), RGB(100, 0, 220)
Picture1.Line (360, 86.72)-(380, 86.72), RGB(0, 100, 220)
q:
End Sub
Private Sub Command6_Click()
Dim T, ex, A, C, bx, ea, b
Picture1.Cls
Picture1.Scale (-60, 2600)-(780, -150)
Picture1.Line (0, 0)-(740, 0)
Picture1.Line (0, 0)-(0, 2500)
vc = vh / (e - 1)
Picture1.CurrentX = 680: Picture1.CurrentY = 120: Pictur e1.Print "φ(°AC)"
Picture1.CurrentX = 10: Picture1.CurrentY = 2500: Picture1.Print "T(K)"
For Y = 200 To 2200 Step 200#
Picture1.Line (0, Y)-(7, Y)
Picture1.CurrentX = -60: Picture1.CurrentY = Y + 30: Picture1.Print Y
Next Y
Picture1.Line (0, 2500)-(-5, 2400)
Picture1.Line (0, 2500)-(5, 2400)
For X = 0 To 720 Step 60
Picture1.Line (X, 0)-(X, 40)
Picture1.CurrentX = X - 20: Picture1.CurrentY = -30: Picture1.Print X Next X
Picture1.Line (740, 0)-(733, 25)
Picture1.Line (740, 0)-(733, -25)
If vh = 0 Then
MsgBox "请先输入参数,并计算", 0, "提示": GoTo q
End If
b = Val(Text6.Text)
For φx = 3.14 * 2 To 3.11 * 2.35 Step 0.0001
A = 1 - Cos(φx) + 0.5 * 0.25 * Sin(φx) ^ 2
C = 1 / (e - 1)
ea = e
ex = 1 + A / (2 * C)
bx = b - ((352 - φx * 180 / 3.14) / (352 - 400)) ^ 3 * (b - 1)
T = (ta * ex * 10) / (pa * ea * bx)
φ = φx * 180 / 3.14
Picture1.PSet (φ - 120, T), RGB(220, 0, 0)
Next φx
For φx = 3.14 To 2 * 3.14 Step 0.0001
A = 1 - Cos(φx) + 0.5 * 0.25 * Sin(φx) ^ 2
C = 1 / (e - 1)
ea = e
ex = 1 + A / (2 * C)
bx = b - ((352 - φx * 180 / 3.14) / (352 - 400)) ^ 3 * (b - 1)
T = (ta * ex * 10) / (pa * ea * bx)
φ = φx * 180 / 3.14
Picture1.PSet (φ + 120, T), RGB(0, 0, 220)
Next φx
q:
End Sub
Private Sub Command7_Click()
Dim T, ex, A, Cm, bx, ea, b, Cu, C1, C2, C, h1, h2, H3
Picture1.Cls
Picture1.Scale (-60, 2000)-(780, -150)
Picture1.Line (0, 0)-(740, 0)
Picture1.Line (0, 0)-(0, 1900)
vc = vh / (e - 1)
Picture1.Curr entX = 680: Picture1.CurrentY = 120: Picture1.Print "φ(°AC)"
Picture1.CurrentX = 10: Picture1.CurrentY = 1900: Picture1.Print "h:W/(m2.K)"
For Y = 200 To 1800 Step 200#
Picture1.Line (0, Y)-(7, Y)
Picture1.CurrentX = -60: Picture1.CurrentY = Y + 30: Picture1.Print Y
Next Y
Picture1.Line (0, 1900)-(-5, 1850)
Picture1.Line (0, 1900)-(5, 1850)
For X = 0 To 720 Step 60
Picture1.Line (X, 0)-(X, 40)
Picture1.CurrentX = X - 20: Picture1.CurrentY = -30: Picture1.Print X Next X
Picture1.Line (740, 0)-(733, 25)
Picture1.Line (740, 0)-(733, -25)
If vh = 0 Then
MsgBox "请先输入参数,并计算", 0, "提示": GoTo q
End If
C = Val(Text34.Text)
Cm = s * 2 / 30: C1 = 2.28 + 0.308 * C: C2 = 3.2 * 10 ^ (-3)
d = Val(Text4.Text)
A = vh * ta / (pa * 0.03719)
For φx = 3.14 To 6.28 Step 0.0001
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
vcx = vh / 2 * ((1 - Cos(φx)) + (1 - Cos(2 * φx)) * r * l / 4) + vc
pcx = pa * (Va / vcx) ^ n1
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
A = 1 - Cos(φx) + 0.5 * 0.25 * Sin(φx) ^ 2
C = 1 / (e - 1)
ea = e
ex = 1 + A / (2 * C)
bx = 1.04 - ((352 - φx * 180 / 3.14) / (352 - 400)) ^ 3 * (1.04 - 1)
T = (ta * ex * 10) / (pa * ea * bx)
H = 130 * (d * 0.001) ^ (-0.2) * (p * 10) ^ (0.8) * T ^ (-0.53) * (C1 * Cm + C2 * A * (p - 1)) ^ 0.8
φ = φx * 180 / 3.14
Picture1.PSet (φ, H), RGB(220, 0, 0)
H = H + 456.9
Next φx
h1 = H / 3.14
For φx = 6.28 To 450 * 3.14 / 180 Step 0.0001
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
vcx = vh / 2 * ((1 - Cos(φx)) + (1 - Cos(2 * φx)) * r * l / 4) + vc
pcx = pa * (Va / vcx) ^ n1
Va = vh + vh / (e - 1)
vc = vh / (e - 1)
A = 1 - Cos(φx) + 0.5 * 0.25 * Sin(φx) ^ 2
C = 1 / (e - 1)
ea = e
ex = 1 + A / (2 * C)
bx = 1.04 - ((352 - φx * 180 / 3.14) / (352 - 400)) ^ 3 * (1.04 - 1)
T = (ta * ex * 10) / (pa * ea * bx)
H = 130 * (d * 0.001) ^ (-0.2) * (p * 10) ^ (0.8) * T ^ (-0.53) * (C1 * Cm + C2 * A * (p - 1)) ^ 0.8
φ = φx * 180 / 3.14
Picture1.PSet (φ, H), RGB(0, 0, 220)
H = H + 1302.56
Next φx
h2 = H / 1.07
H3 = (h1 + h2) / 2
Text35.Text = Int(H3)
q:
End Sub
Private Sub Command8_Click()
Dim tmax, C1, C2, f1, t1, tmax1, ti, fx, fy, dyi, yi, xi
Picture1.Cls
Picture1.Scale (-10, 130)-(130, -10)
Picture1.Line (0, 100)-(110, 100): Picture1.Line (52.5, 120)-(52.5, 20)
Picture1.CurrentX = 110: Picture1.CurrentY = 105: Picture1.Print "+X"
Picture1.CurrentX = 0: Picture1.CurrentY = 105: Picture1.Print "-X"
Picture1.CurrentX = 55: Picture1.CurrentY = 120: Picture1.Print "-Y"
Picture1.CurrentX = 55: Picture1.CurrentY = 20: Picture1.Print "+Y"
Picture1.Line (110, 100)-(108, 98): Picture1.Line (110, 100)-(108, 102)
Picture1.Line (52.5, 20)-(50.5, 22): Picture1.Line (52.5, 20)-(54.5, 22)
'Picture1.Line (0, 0)-(110, 0)
' Picture1.Line (0, 0)-(0, 110)
' vc = vh / (e - 1)
' Picture1.CurrentX = 680: Picture1.CurrentY = 120: Picture1.Print "φ(°AC)"
' Picture1.CurrentX = 10: Picture1.CurrentY = 1900: Picture1.Print "h:W/(m2.K)"
' 'For Y = 0 To 105 Step 5
' Picture1.Line (0, Y)-(2, Y)
'Picture1.CurrentX = -8: Picture1.CurrentY = Y: Picture1.Print Y
' Next Y
' Picture1.Line (0, 110)-(-2, 108)
' Picture1.Line (0, 110)-(2, 108)
' For X = 0 To 105 Step 5
' Picture1.Line (X, 0)-(X, 2)
' Picture1.CurrentX = X - 3: Picture1.CurrentY = -2: Picture1.Print X
' Next X
'Picture1.Line (110, 0)-(108, 2)
' Picture1.Line (110, 0)-(108, -2)
Picture1.ForeColor = vbYellow
Picture1.DrawWidth = 1.5
Picture1.Line (52.5, 100)-(100, 100): Picture1.Line (100, 100)-(100, 5): Picture1.Line (100, 5)-(88.6, 5): Picture1.Line (88.6, 5)-(88.6, 80)
Picture1.Line (88.6, 80)-(52.5, 80): Picture1.Line (52.5, 80)-(52.5, 100)
n = 2000: e = 20: pe = 0.6912: d = 95
f1 = 0.2 * d * pe * 10 ^ (-3)
t1 = 128 + 4.18 * n * 10 ^ (-2) + (747 + 0.245 * n - (13.6 + 0.45 * n * 10 ^ (-2)) * pe) * pe * 10 ^ (-2)
tmax = 0.27 * (3 + e / 16) * Exp(-f1 * t1) * 5000
tmax1 = 0.9 * tmax
For xi = 0 To 47.5 Step 0.1
For yi = 0 To 20 Step 1
For dyi = 11.4 To 14.25 Step 0.01
fx = -(xi * (3 * 95 - 2 * dyi)) / (16 * 95 * (95 - dyi))
fy = -yi / (4 * (95 / 15) + 11.4)
ti = Exp(fx) * Exp(fy) * tmax
Next dyi
Next yi
Next xi
End Sub
Private Sub Command3_Click()
Picture1.Cls
End Sub
Private Sub Command2_Click()
End
End Sub。

相关文档
最新文档