Public Class Gas_Hysical_Property
Private Pressure As Single '定义压力,MPa
Private Temperature As Single '定义温度,℃
Private Relative_Molecular_Mass(17) As Single '纯组分相对分子质量
Private Percentage_Gas_Temperament(17) As Single '输入的气体组分
Private Total_Relative_Molecular_Mass As Single '计算得到的气体分子量
Private Temperature_Critical(17) As Single '临界温度,K
Private Density_Critical(17) As Single '临界密度,kmol/m3
Private Acentric_Factor(17) As Single '偏心因子
Private Interaction_Coefficient(17, 17) As Single 'BWRS交互作用系数
Private Const_A(10) As Single '通用常数Ai
Private Const_B(10) As Single '通用常数Bi
Private Const R = 8.3143 '气体常数,kJ/(kmol*K)
''''纯组分状态方程的11个参数,以及混合气体的11个参数''''
Private B0_Pure(17), B0_Mix As Single
Private A0_Pure(17), A0_Mix As Single
Private C0_Pure(17), C0_Mix As Single
Private Gama_Pure(17), Gama_Mix As Single
Private b_Pure(17), b_Mix As Single
Private a_Pure(17), a_Mix As Single
Private Alpha_Pure(17), Alpha_Mix As Single
Private c_Pure(17), c_Mix As Single
Private D0_Pure(17), D0_Mix As Single
Private d_Pure(17), d_Mix As Single
Private E0_Pure(17), E0_Mix As Single
''''纯组分状态方程的11个参数,以及混合气体的11个参数''''
Private Density_mol As Single '定义摩尔密度,kmol/m3
Private Density_mol_Temp(200) As Single '求密度时的的临时变量
Private Density As Single '定义密度,kg/m3
Private Z As Single '定义压缩因子
Private Partial_Differential_Coefficient_Temperture As Single '偏微分系数,偏p比偏T
Private Partial_Differential_Coefficient_Density As Single '偏微分系数,偏p比偏T
Private SHCPC_B(17) As Single, SHCPC_C(17) As Single, SHCPC_D(17) As Single, SHCPC_E(17) As Single, SHCPC_F(17) As Single
Private Cp_Ideal(17) As Single
Private Cp0_Mix As Single, Cv0_Mix As Single '理想气体纯组分的比热
Private Cp_Mix As Single, Cv_Mix As Single '理想气体混合物的比热
Private Di As Single 'J-T系数(Di),℃/MPa
Private Adiabatic_Exponent_Temperature As Single '定温绝热指数
Private Adiabatic_Exponent_Volume As Single '定容绝热指数
Private LHV_Pure(17) As Single '纯组分的低热值
Private LHV_Mix As Single '天然气混合物的低热值
Private Relative_Density As Single '相对密度
Private X_Temp As Single : Private Y_Temp As Single : Private C_Temp As Single
Private Dynamic_Viscosity As Single '天然气的动力粘度(mPa*s)
Private Sub Gas_Hysical_Property_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call ClearData()
Pressure = Val(TextBox1.Text) * 1000 '将压力单位转化为kPa
Temperature = Val(TextBox2.Text) + 273.1 '将温度转化为K
LHV_Pure = {35.9, 59.477, 64.4, 87.667, 93.24, 122.85, 123.65, 155.72, 156.73, 156.73, 156.73, 156.73, 156.73, 156.73, 156.73, 0, 0, 23.36} '各组分的低热值
'''''''''''''''''''''计算相对分子质量'''''''''''''''''''''
Relative_Molecular_Mass = {16.042, 28.05, 30.068, 42.08, 44.094, 58.12, 58.12, 72.146, 72.0146, 86.172, 100.198, 114.224, 128.25, 142.276, 156.3, 28.016, 44.01, 34.076}
'气体组分,先后顺序为CH4,C2H4,C2H6,C3H6,C3H8,iC4H10,nC4H10,iC5H12,nC5H12,C6H14,C7H16,C8H18,C9H20,C10H22,C11H24,N2,CO2,H2S
Percentage_Gas_Temperament = {Gas_Temperament.TextBox1.Text, Gas_Temperament.TextBox12.Text, Gas_Temperament.TextBox2.Text, Gas_Temperament.TextBox11.Text, Gas_Temperament.TextBox3.Text, Gas_Temperament.TextBox5.Text, Gas_Temperament.TextBox4.Text, Gas_Temperament.TextBox7.Text, Gas_Temperament.TextBox6.Text, Gas_Temperament.TextBox8.Text, Gas_Temperament.TextBox16.Text, Gas_Temperament.TextBox15.Text, Gas_Temperament.TextBox14.Text, Gas_Temperament.TextBox13.Text, Gas_Temperament.TextBox10.Text, Gas_Temperament.TextBox24.Text, Gas_Temperament.TextBox22.Text, Gas_Temperament.TextBox9.Text}
Total_Relative_Molecular_Mass = 0
For i = 0 To 17
Total_Relative_Molecular_Mass = Total_Relative_Molecular_Mass + Relative_Molecular_Mass(i) * Percentage_Gas_Temperament(i)
Next
TextBox3.Text = Math.Round(Total_Relative_Molecular_Mass, 4)
'''''''''''''''''''''计算相对分子质量'''''''''''''''''''''
'''''''''''''''''''''BWRS'''''''''''''''''''''
Const_A = {0.44369, 1.28438, 0.356306, 0.544979, 0.528629, 0.484011, 0.0705233, 0.504087, 0.0307452, 0.0732828, 0.00645}
Const_B = {0.115449, -0.920731, 1.70871, -0.270896, 0.349261, 0.75413, -0.044448, 1.32245, 0.179433, 0.463492, -0.022143}
Temperature_Critical = {190.69, 283.05, 305.38, 365.04, 369.89, 408.13, 425.18, 460.37, 469.49, 507.28, 540.28, 568.58, 594.57, 617.54, 639.99, 126.15, 304.09, 373.39}
Density_Critical = {10.05, 8.0653, 6.7566, 5.5248, 4.9994, 3.8012, 3.9213, 3.2469, 3.2149, 2.7167, 2.3467, 2.0568, 1.8421, 1.6611, 1.5154, 11.099, 10.638, 10.526}
Acentric_Factor = {0.013, 0.101, 0.1018, 0.15, 0.157, 0.183, 0.197, 0.226, 0.252, 0.302, 0.353, 0.412, 0.475, 0.54, 0.6, 0.035, 0.21, 0.105}
Interaction_Coefficient(0, 1) = 0.01 : Interaction_Coefficient(0, 2) = 0.01 : Interaction_Coefficient(0, 3) = 0.021 : Interaction_Coefficient(0, 4) = 0.023 : Interaction_Coefficient(0, 5) = 0.0275 : Interaction_Coefficient(0, 6) = 0.031
Interaction_Coefficient(0, 7) = 0.036 : Interaction_Coefficient(0, 8) = 0.041 : Interaction_Coefficient(0, 9) = 0.05 : Interaction_Coefficient(0, 10) = 0.06 : Interaction_Coefficient(0, 11) = 0.07 : Interaction_Coefficient(0, 12) = 0.081
Interaction_Coefficient(0, 13) = 0.092 : Interaction_Coefficient(0, 14) = 0.101 : Interaction_Coefficient(0, 15) = 0.025 : Interaction_Coefficient(0, 16) = 0.05 : Interaction_Coefficient(0, 17) = 0.05 '甲烷
Interaction_Coefficient(1, 2) = 0.0 : Interaction_Coefficient(1, 3) = 0.003 : Interaction_Coefficient(1, 4) = 0.0031 : Interaction_Coefficient(1, 5) = 0.004 : Interaction_Coefficient(1, 6) = 0.0045 : Interaction_Coefficient(1, 7) = 0.005
Interaction_Coefficient(1, 8) = 0.006 : Interaction_Coefficient(1, 9) = 0.007 : Interaction_Coefficient(1, 10) = 0.0085 : Interaction_Coefficient(1, 11) = 0.01 : Interaction_Coefficient(1, 12) = 0.012 : Interaction_Coefficient(1, 13) = 0.013
Interaction_Coefficient(1, 14) = 0.015 : Interaction_Coefficient(1, 15) = 0.07 : Interaction_Coefficient(1, 16) = 0.048 : Interaction_Coefficient(1, 17) = 0.045 '乙烯
Interaction_Coefficient(2, 3) = 0.003 : Interaction_Coefficient(2, 4) = 0.0031 : Interaction_Coefficient(2, 5) = 0.004 : Interaction_Coefficient(2, 6) = 0.0045 : Interaction_Coefficient(2, 7) = 0.005 : Interaction_Coefficient(2, 8) = 0.006
Interaction_Coefficient(2, 9) = 0.007 : Interaction_Coefficient(2, 10) = 0.0085 : Interaction_Coefficient(2, 11) = 0.01 : Interaction_Coefficient(2, 12) = 0.012 : Interaction_Coefficient(2, 13) = 0.013 : Interaction_Coefficient(2, 14) = 0.015
Interaction_Coefficient(2, 15) = 0.07 : Interaction_Coefficient(2, 16) = 0.048 : Interaction_Coefficient(2, 17) = 0.045 '乙烷
Interaction_Coefficient(3, 4) = 0.0 : Interaction_Coefficient(3, 5) = 0.003 : Interaction_Coefficient(3, 6) = 0.0035 : Interaction_Coefficient(3, 7) = 0.004 : Interaction_Coefficient(3, 8) = 0.0045 : Interaction_Coefficient(3, 9) = 0.005
Interaction_Coefficient(3, 10) = 0.0065 : Interaction_Coefficient(3, 11) = 0.008 : Interaction_Coefficient(3, 12) = 0.01 : Interaction_Coefficient(3, 13) = 0.011 : Interaction_Coefficient(3, 14) = 0.013 : Interaction_Coefficient(3, 15) = 0.1
Interaction_Coefficient(3, 16) = 0.045 : Interaction_Coefficient(3, 17) = 0.04 '丙烯
Interaction_Coefficient(4, 5) = 0.003 : Interaction_Coefficient(4, 6) = 0.0035 : Interaction_Coeffic
评论1