Analysis and modernization of real gas thermodynamic calculation for turbocompressors and detander units

In this work analysis, modernization and software implementation and an algorithm for thermodynamic calculation on the basis of the BenediktWebb-Rubin actual gas equation are performed. The work includes writing, analysis and modernization of the real gas thermodynamic calculation program. In the first part of the work data were processed to calculate real gas. In the second part, the development of the algorithm for thermodynamic calculation and its modifications is carried out. In the third part, the analysis of this algorithm is performed, revealing the main shortcomings and limits of applicability. In the fourth part of the work, the algorithm was implemented in the form of computational modules and programs, and also practical testing of these programs in the calculation of gas compressor and auxiliary equipment.


Introduction
This work is devoted to the analysis and modernization algorithm for calculating the thermodynamic of real gas on the basis of Benedict-Webb-Rubin modified equations proposed by OAO "VNIIGAZ".
The Benedict-Webb-Rubin modified equations are taken as the basics of thermodynamic equations for real gas calculating algorithm, proposed by OAO "VNIIGAS In the course of this work it is planned to implement the algorithm for calculating the thermodynamic real gas by using guidelines and equations based on ISO 6976 [1] international standard: 1995, interstate standards GOST 30319.0-96, GOST 30319.1-96 and GOST 30319.2-96 [2,3,4,5,6,7], as well as methodological equations proposed. The basis for the future algorithm is a compilation of equations, methods and principles of the sources above.
Initially, the following parameters are the initial data for the calculation (pin, pout, Tin, Tout and real gas composition). As the initial and final data there are parameters at the beginning and end of the process, respectively. The algorithm proceeds to the calculation directly after initial parameters setting.
Depending on the percentage the composition of methane in the mixture of real gas state equation coefficients BWR -a1, a2, a3, a4, a5, a6. [6, table E.2] are automatically set; The general characteristics of the gas and the thermodynamic process of (R, M, П, ΔT) are calculated.
The next step of real gas thermodynamics calculation is calculation of mixture under the standard conditions (s.c.).
After that, pseudocritical mixture of parameters π, τ, pcr, Tcr are given and defined at the beginning and end of the process.
Then there is the calculation of the real gas state equation compressibility coefficient z, Y, X by the BWR method iterations equations [6,8,9].
The real isobaric heat capacity and the actual enthalpy Cp, i are calculated at the beginning and end of the process according.
The internal head hi, polytropic head hpol and polytropic efficiency ηpol are defined by Schultz method [5,6] The internal head hi, polytropic head hpol and polytropic efficiency ηpol are defined by Enthalpy method [4,6] The flowchart of thermodynamic real gas calculation is listed [6]

Polynomials BWR equation coefficients
To improve the calculation accuracy on non-standard gas compositions, it was decided to construct a BWR state of the coefficients changes according to the proportion of methane in the gas.

Efficiency modification
This algorithm version for calculating the thermodynamic real gas supposes a redefinition of initial data for calculating the following parameters:  pininlet real gas pressure,  poutoutlet real gas pressure,  Tinthe inlet actual temperature of the gas,  ηpolpolytropic efficiency,  The real gas composition.
Mathematical apparatus, namely applicable equations and the calculation sequence of thermodynamic calculation algorithm are identical basic version, with the only differencefinal temperature is specified as a parameter, and after calculation, depending on the obtained efficiency it is adjusted to match conditions specified by iteration.
Conversion algorithm: 1. set a Tout ; 2. the calculation of real gas thermodynamics baseline algorithm (Section 2.1.) is carried out; 3. using the resulting polytropic efficiency ηpol according to the following formulas is calculated: 4. Obtained in step 3 is substituted into the final temperature of the point 1. The calculation continues as long as the convergence condition is satisfied: δ1relative iteration error (convergence condition). For each specific task δ1 coefficient can have different meanings. Recommended minimum value is 1 ≤ 0,01, recommended optimal value -1 ≤ 0,0001.
In addition, the convergence condition may be set by any alternative method, including the proportion: δ2, δ3 -relative error iterations (convergence condition).

Isenthalpic modification
This algorithm version for calculating the thermodynamic real gas implies a redefinition of initial data for calculation of the following:  pininlet real gas pressure,  poutoutlet real gas pressure,  Tinthe initial actual temperature of the gas,  isoenthalpic condition ∆ = 0,  the real gas composition. As it was in the efficiency modification mathematical apparatus is identical to basic version and the final temperature is defined as a parameter.
Conversion algorithm follows next steps: 1. set a Tk; 2. real gas calculation is carried out on basic thermodynamics algorithm (subsection 2.1); 3. using the obtained inlet and outlet ii enthalpy and the final temperature io the more approximate to isoenthalpic condition is calculated, by the following formulas: ki -iterative factor is defined so that ≤ 1 10 , value used in the algorithm = 10000. This mathematical tool is selecting the desired value To automatically. 4. what was obtained in step 3 is substituted into the final temperature item 1. The calculation continues as long as the convergence condition is satisfied, as in paragraph 4, subsection 2.3.

Results
The optimum operating range of the real gas thermodynamic algorithm calculation is shown in Table 1. Using real gas thermodynamic calculation algorithm can construct diagrams for environments with high methane content. (More than 85% mol in the mixture) There is a diagram i-lg (p) below for natural gas (shown in Figures 1 and 2) with the following composition (shown in Table 2).   in-butane 0,24 6 id-pentane 0 7 in-pentane 0 8 in-hexane 0 9 Nitrogen 2,6 10 carbon dioxide 0, 13 11 Hydrogen 0 12 Helium 0 From the comparison of the natural gas experimental diagrams, proposed by V. A. Zagoruchenko [10,11] and diagrams of natural gas, constructed using the algorithm of thermodynamic real gas calculation it is possible to identify the degree of precision and relative error of the algorithm based on the specific gas composition and at a specific temperature range.
For the analysis, we take four "extreme" points on the principle of maximum distance from each other, thus: * 1st point: low pressure, low temperature * 2nd point: high pressure, low temperature * 3rd point: low pressure, high temperature * 4th point: high pressure, high temperature Then it is necessary to determine the enthalpy of each and four points in both charts and compare the results to obtain the relative error.
The relative error is calculated using the following formula 14: The results comparison diagrams are presented in table 3 Thus, though the real gas equation of state takes into account only the coefficients of the polynomials in dependence on the methane content in the mixture, the change in indirect parameters such as density at standard conditions pseudocritical temperature and pressure, the individual gas constant of the mixture, etc. when changing composition of the minor components (сomponents 2-12) lead to the change in the thermodynamic properties of the gas. From this perspective, it can be said that the algorithm for calculating the real thermodynamic gas takes into account the effect on the parameters of all components of the mixture with a certain accuracy lobes.

Conclusions
The course of this work was the analysis and modernization of thermodynamic calculation of real gas turbochargers and expander units. Upgraded algorithm software is implemented in C ++ programming. The algorithm is based on the equation of real gas state BWR [12,13,14,15].
The modification of the algorithm applicable to the process and expansion of the real gas was also developed. The possibility of calculating thermodynamic parameters of the real gas mixture at any point in the compression or expansion process, as well as for the static state of the gas was realized. It was found that almost all the characteristics and results of the program have a high level of precision (optimum range of applicability).
The relative error on the basic parameters of gas does not exceed 3% in the range of application.
Thus, this algorithm is applicable to the mixtures of real gas thermodynamic calculation for the vast majority of the gas compression process in the petroleum industry, except for the processes beyond the range of applicability of the above.
The algorithm for calculating the real thermodynamic gas was implemented in three program versions. The second and the third implementation have a uniform of the code written in the C ++ programming language.
All three versions were successfully implemented in a variety of mathematical models and software as embedded software submodules.