1、第一题题目:编写一个 PR 方程已知 p、T 求比体积 v 的计算机程序。计算 R134a的比体积,并将结果与文献值进行比较。将计算结果与文献值列表,并计算相对偏差;将计算值与文献值画在 p v 图上。1、比较饱和线上的比体积;2、比较等温线 t=90的比体积;R134a: Tc=374.18K,pc=4.056MPa,=0.326 , M=102.03一、计算过程P-R 方程为: ()gRTaPvbbv()(,)cra20.457/cgcTRTp()8b0.50.51)rk2.3746.2.69将 P-R 方程整理,用牛顿迭代法求 v 值f = RgT(v2 + 2bv - b2) - a(
2、v - b) - P(v - b)(v2 + 2bv - b2)f1 = RgT(2v + 2b) - a - P(3v2 - 3b2 + 2bv)根据 v(k+1) = v(k) - f / f1 经过数次迭代后既可求得 P、T 所对应的 v 值二、源程序(1) 计算并比较饱和线上的比体积Private Sub Command1_Click()Dim b, k, Rg As Double, i As IntegerDim p(10), t(10), f(10), f1(10), v(10), v1(10), v2(10), a(10), at(10), tr(10)Picture1.Cls:
3、 Picture2.ClsTc = 374.18: Pc = 4056000: w = 0.326k = 0.37464 + 1.5422 * w - 0.26992 * w 2t(1) = 246.7: t(2) = 262.96: t(3) = 273.73: t(4) = 282.08: t(5) = 288.87t(6) = 294.7: t(7) = 299.87: t(8) = 304.47: t(9) = 308.65: t(10) = 312.54For i = 1 To 10p(i) = i * 10 5tr(i) = t(i) / Tca(i) = (1 + k * (1
4、- Sqr(tr(i) 2Rg = 8.3145 / 0.10203at(i) = (0.45724 * Rg 2 * Tc 2 * a(i) / Pcb = (0.0778 * Rg * Tc) / Pcv(i) = 1For n = 1 To 5000f(i) = Rg * t(i) * (v(i) 2 + 2 * b * v(i) - b 2) - at(i) * (v(i) - b) - p(i) * (v(i) - b) * (v(i) 2 + 2 * b * v(i) - b 2)f1(i) = Rg * t(i) * (2 * v(i) + 2 * b) - at(i) - p(
5、i) * (3 * v(i) 2 - 3 * b 2 + 2 * b * v(i)v1(i) = v(i) - f(i) / f1(i)If Abs(v1(i) - v(i) 0.00001 Thenv(i) = v1(i)End IfNext nPicture1.Print Format(v1(i), “#0.000000“)Picture1.PrintNext iv2(1) = 0.189737: v2(2) = 0.098326: v2(3) = 0.066694: v2(4) = 0.050444: v2(5) = 0.040612v2(6) = 0.03387: v2(7) = 0.
6、029081: v2(8) = 0.025428: v2(9) = 0.022569: v2(10) = 0.020228For i = 1 To 10v2(i) = Abs(v1(i) - v2(i) / v2(i) * 100Picture2.Print Format(v2(i), “#0.000“)Picture2.PrintNext iEnd Sub(2) 计算并比较等温线 t=80的比体积Private Sub Command1_Click()Dim b, k, Rg As Double, i As IntegerDim p(10) As Double, t(10) As Doubl
7、e, f(10) As Double, f1(10) As Double, v(10) As Double, v1(10) As Double, v2(10) As Double, a(10) As Double, at(10) As Double, tr(10) As DoublePicture1.Cls : Picture2.ClsTc = 374.18 : Pc = 4056000 : w = 0.326k = 0.37464 + 1.5422 * w - 0.26992 * w 2For i = 1 To 10t(i) = 353.15 : p(i) = i * 10 5 tr(i)
8、= t(i) / Tca(i) = (1 + k * (1 - Sqr(tr(i) 2 Rg = 8.3145 / 0.10203at(i) = (0.45724 * Rg 2 * Tc 2 * a(i) / Pcb = (0.0778 * Rg * Tc) / Pcv(i) = 1For n = 1 To 5000f(i) = Rg * t(i) * (v(i) 2 + 2 * b * v(i) - b 2) - at(i) * (v(i) - b) - p(i) * (v(i) - b) * (v(i) 2 + 2 * b * v(i) - b 2)f1(i) = Rg * t(i) *
9、(2 * v(i) + 2 * b) - at(i) - p(i) * (3 * v(i) 2 - 3 * b 2 + 2 * b * v(i)v1(i) = v(i) - f(i) / f1(i)If Abs(v1(i) - v(i) 0.00001 Thenv(i) = v1(i)End IfNext nPicture1.Print Format(v1(i), “#0.00000“)Picture1.PrintNext iv2(1) = 0.28477: v2(2) = 0.14086: v2(3) = 0.09288: v2(4) = 0.06886: v2(5) = 0.05444v2
10、(6) = 0.04482: v2(7) = 0.03794: v2(8) = 0.03277: v2(9) = 0.02874: v2(10) = 0.02551For i = 1 To 10v2(i) = Abs(v1(i) - v2(i) / v2(i) * 100Picture2.Print Format(v2(i), “#0.000“)Picture2.PrintNext iEnd Sub三、 计算结果1.饱和线上的比体积程序运行结果截图计算值与文献值列表比较压力/MPa 计算值/m3/kg 文献值 /m3/kg 相对偏差%0.1 0.194439 0.189737 2.4780.2
11、 0.101142 0.098326 2.8640.3 0.068688 0.066694 2.9890.4 0.052031 0.050444 3.1470.5 0.041814 0.040612 2.9590.6 0.034893 0.033870 3.0190.7 0.029887 0.029081 2.7720.8 0.026083 0.025428 2.5760.9 0.023093 0.022569 2.3201.0 0.020683 0.020228 2.252注:文献值来自朱明善等著绿色环保制冷剂 HFC-R134a 热物理性质2.计算并比较等温线 t=80的比体积程序运行结果
12、截图计算值与文献值列表比较压力/MPa 计算值/m3/kg 文献值 /m3/kg 相对偏差%0.1 0.28453 0.28477 0.0850.2 0.14062 0.14086 0.1730.3 0.09263 0.09288 0.2690.4 0.06863 0.06886 0.3400.5 0.05421 0.05444 0.4160.6 0.04460 0.04482 0.4980.7 0.03772 0.03794 0.5800.8 0.03255 0.03277 0.6570.9 0.02853 0.02874 0.7291.0 0.02530 0.02551 0.807注:文献
13、值来自朱明善等著绿色环保制冷剂 HFC-R134a 热物理性质第二题题目:R134a 从压力 0.2MPa、温度 -5 压缩至 1.6 MPa。压缩机绝热效率为 0.85,选用 PR 状态方程,编写计算机程序。计算压缩机出口处 R134a 的温度、比体积及压缩 1 kg R134a 所需的功。R134a 热力性质: Tc=374.18K, pc=4.056MPa, =0.326, M=102.03一、 计算过程已知公式:PR 方程:()gRTaPvbbv()(,)cra20.457/cgcTRTp()8b0.50.51)rk2.3746.2.69压缩因子3 232130ggZBABZABapb
14、ART余熵方程* *0.41lnlnln2 g gvvvs Rb21.50.5.0.47()/gcrcaRTkTPT余自由能方程: * *.41lnlnln2 g gvbavbvR余焓方程: *(1)()haRTZsR134a 理想状态时定压比热与温度关系0 622.54.0317.80pgcTR第一步:用可逆时的熵差方程 =0 求根据余熵方程可知= *22 22121 *0.41lnlnln g gvbvbvssRR11 1*0.4(lnll) g gvbRvv其中 21* 22 1lnTpgdsCR用二分法求 =0 的根即为第二步:由 , , , 计算定熵过程的 由式可推出下式 = )+
15、- - + -+ - 其中 =2.254 +0.0317 -16.8 -第三步:根据已知的 及 ,计算实际过程的=第四步: 计算实际过程的终温类似式, = )+ - - +- + - 此时 应与 的值相等,另 dh= ,用二分法求 dh=0时的根即为第五步:根据已知 及第四步所求的 可求出1kg R134a 所做的功 = =二、源程序Const R = 8.3145 / 0.10203, Tc = 374.18, Pc = 4056000Const w = 0.326, T1 = 268.15, P1 = 200000, P2 = 1600000Dim a#, b#, k#, vv#, at#, da#Private Sub Command1_Click() 用二分法求Picture1.ClsDim fx0, fx1, x0, x1, f, z#e1 = 0.0001x0 = 300: x1 = 400fx0 = T(x0)fx1 = T(x1)Picture1.Print Space(2); “( “ “( “ “( “ & Format(x0, “#0.0000“) & “ , “ & Format(x1, “#0.0000“) & “ )“Picture3.PrintEnd IfGoTo 5End SubPrivate Sub Command4_Click() 已知 求