Python-based natural gas physical property parameter and uncertainty calculation system
By developing a Python-based natural gas physical parameters and uncertainty calculation system, the problems of low computing efficiency and low data accuracy in the existing technology are solved, and efficient and automated calculation and data processing are realized, which is suitable for natural gas trade settlement and business negotiations.
Patent Information
- Application Number
- CN202311818524.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
The existing Excel tables or commercial software are not adaptable when calculating natural gas physical properties parameters and uncertainties, and cannot realize data sorting, rapid import, batch computing and other functions, resulting in low computing efficiency and low data accuracy.
Develop a natural gas physical property parameters and uncertainty calculation system based on Python, including human-computer interactive interface and computing module. Through Python's matrix processing functions and interface processing module, automated calculation and data processing are realized.
It improves computing efficiency and data accuracy, and provides a dedicated system with a friendly interface and high degree of automation, suitable for natural gas trade settlement and business negotiations.
Smart Images

Figure CN120218386A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of calculation of measurement data related to natural gas production, transportation, and sales, and particularly relates to a natural gas physical property parameter and uncertainty calculation system based on Python. Background Art
[0002] In the process of natural gas production and trade, accurate measurement of the quantity of natural gas is a basic requirement. In the process of measuring and converting the quantity of natural gas trade results, various physical property parameters of natural gas, such as compression factor, density, relative density, etc., must be used. The usual method is to detect the composition of natural gas with a gas chromatograph and then calculate the values of various physical property parameters by standard methods for measurement and trade settlement. The current solution is to use the Excel table provided by the corresponding international standard ISO6976 of GB / T 11062-2020 or other commercial software for calculation. The current tables and commercial software are not very adaptable to the natural gas composition and uncertainty data of the company, and cannot realize functions such as data collation, rapid import, and batch operation. Summary of the Invention
[0003] The present invention provides a natural gas physical property parameter and uncertainty calculation system based on Python to solve the above problems.
[0004] The present invention is realized through the following technical solutions:
[0005] A natural gas physical property parameter and uncertainty calculation system based on Python includes a human-computer interaction interface and an operation module. The human-computer interaction interface includes a first area for performing function operations, a second area for displaying a test chromatogram list, a third area for displaying the detailed information of the test chromatogram, and a fourth area for displaying the physical property parameters and the calculation results of the uncertainty of the physical property parameters. The operation module is used to calculate the physical property parameters and the calculation results of the uncertainty of the physical property parameters according to the detailed information of the test chromatogram and the calculation conditions input in the first area.
[0006] As an optimization, the first region includes a calculation condition input region, a component total option region, an uncertainty option region, a calculation and query function region. In the calculation and query function region, there is a query module and a query box. By using the editing module, query conditions are input into the query box, and the corresponding detailed test chromatogram information is queried through the query module. The list of the queried detailed test chromatogram information is inserted into the second region for display through the insertion module, and the detailed test chromatogram information is read through the call module and displayed in the third region. Meanwhile, in the calculation and query function region, there is a closing module, a calculation and saving module, and an export to table module. The closing module is used to close the human-computer interaction interface and the operation module. The calculation and saving module is used to trigger the operation module to perform calculations, and save the physical property parameters obtained after the operation of the operation module and the calculation results of the uncertainty of the physical property parameters.
[0007] As an optimization, the detailed test chromatogram information includes the natural gas component content and the uncertainty of the natural gas components.
[0008] As an optimization, the physical property parameters include molar mass, summation factor, compressibility factor, higher heating value per mole, lower heating value per mole, higher heating value per mass, lower heating value per mass, higher heating value per volume, lower heating value per volume, density, relative density, higher Wobbe index, lower Wobbe index.
[0009] As an optimization, the specific calculation formula for the compressibility factor is:
[0010]
[0011] where, p0 represents the standard atmospheric pressure, s j represents the summation factor of component j in natural gas, t2 represents the metrological reference temperature, x j represents the mole fraction of component j, N represents the total number of components; p2 represents the metrological reference pressure;
[0012] The specific calculation formula for the uncertainty of the compressibility factor is:
[0013]
[0014] where, u 2 (Z) represents the square of the uncertainty of the compressibility factor, s represents the total summation factor after the synthesis of the summation factors of each component of natural gas, u(s j ) represents the uncertainty of the summation factor of component j in natural gas, u(x i ) represents the uncertainty of component i, u(x j ) represents the uncertainty of component j, s j represents the summation factor of component j in natural gas, xi represents the mole fraction of component i.
[0015] As an optimization, the specific calculation formula for the higher heating value per mole is:
[0016]
[0017] where represents the total higher heating value per mole of the ideal gas of the mixed gas; (H c ) G (t1) represents the total higher heating value per mole of the real gas of the mixed gas; represents the total ideal higher heating value per mole of component j; x j represents the mole fraction of component j;
[0018] The specific calculation formula for the uncertainty of the higher heating value per mole is:
[0019]
[0020] where (H m ) G represents the higher heating value per mass, u((H m ) G ) represents the uncertainty of the higher heating value per mass, represents the higher heating value per mole of component i; (H c ) G represents the higher heating value per mole; u(M i ), u(M j ) respectively represent the uncertainties of the molar masses of components i and j, M i , M j respectively represent the molar masses of components i and j, M represents the molar mass of the mixed gas, is the correlation coefficient between components i and j of natural gas due to the presence of the same element, and this value is given by the basic data table.
[0021] As an optimization, the specific calculation formula for the lower heating value per mole is:
[0022]
[0023] where represents the lower heating value per mole of the ideal gas of the mixed gas; (H c ) N (t1) represents the lower heating value per mole of the real gas of the mixed gas; L 0 (t1) represents the standard enthalpy of water evaporation at temperature t1; b j represents the number of hydrogen atoms contained in each molecule of component j;
[0024] The specific calculation formula for the uncertainty of the lower calorific value is as follows:
[0025]
[0026] Wherein, represents the molar calorific value of the ideal gas of component i, represents the molar calorific value of the ideal gas of component j, u 2 (L 0 ) represents the square of the uncertainty of the standard enthalpy, b i represents the number of hydrogen atoms contained in each molecule in component i, b j represents the number of hydrogen atoms contained in each molecule in component j, L 0 represents the molar enthalpy of water evaporation in the ideal state (the heat absorbed when 1 mole of water is completely evaporated).
[0027] As an optimization, the specific calculation formula for the higher calorific value by mass is:
[0028]
[0029] Wherein, represents the higher calorific value of the ideal gas of the mixture based on mass; (H m ) G (t1) represents the higher calorific value of the real gas of the mixture based on mass; M represents the molar mass of the mixed gas, M j represents the molar mass of component j;
[0030] The specific calculation formula for the uncertainty of the higher calorific value by mass is:
[0031]
[0032] u((H v ) G ) represents the uncertainty of the higher calorific value of the real gas based on volume, (H v ) G represents the higher calorific value of the real gas based on volume, s i represents the summation factor of component i in natural gas, (H c ) G represents the total molar calorific value of the ideal gas of the mixed gas, Z represents the compressibility factor, s represents the total summation factor after synthesis of the summation factors of each component of natural gas, R is the molar gas constant, and u(R) represents the uncertainty of the molar gas constant.
[0033] As an optimization, the specific calculation formula for the lower calorific value by mass is:
[0034]
[0035] Among them, represents the lower calorific value of the ideal gas of the mixture based on mass; (H m ) N (t1) represents the lower calorific value of the real gas of the mixture based on mass;
[0036] The specific calculation formula for the uncertainty of the lower mass calorific value is:
[0037]
[0038] u((H m ) N ) represents the uncertainty of the lower calorific value of the real gas of the mixture based on mass, (H m ) N represents the lower calorific value of the real gas of the mixture based on mass.
[0039] As an optimization, the higher volume calorific value includes the higher volume calorific value of the ideal gas and the higher volume calorific value of the real gas. Among them, the specific calculation formula for the higher volume calorific value of the ideal gas is:
[0040]
[0041] Among them, represents the higher calorific value of the mixed gas based on the volume of the ideal gas; V 0 represents the ideal molar volume, V 0 = R*T2 / p2, where R is the molar gas constant and T2 is the absolute temperature;
[0042] The specific calculation formula for the higher volume calorific value of the real gas is:
[0043]
[0044] Among them, (H v ) G (t1; t2, p2) represents the higher calorific value of the real gas based on volume; V represents the real gas molar volume of the mixed gas, V = Z(t2, p2)*R*T2 / p2; z(t2, p2) represents the compression factor under the metrological reference conditions;
[0045] The specific calculation formula for the uncertainty of the higher volume calorific value is:
[0046]
[0047] Among them, Z represents the compressibility factor under metrological reference conditions.
[0048] As an optimization, the lower calorific value at volume basis includes the lower calorific value at volume basis of ideal gas and that of real gas. Among them, the specific calculation formula of the lower calorific value at volume basis of ideal gas is:
[0049]
[0050] Among them, represents the lower calorific value of the mixed gas based on the volume of ideal gas; V 0 represents the ideal molar volume, V 0 = R*T2 / p2, where R is the molar gas constant and T2 is the absolute temperature;
[0051] The specific calculation formula of the lower calorific value at volume basis of real gas is:
[0052]
[0053] Among them, (H v ) N (t1; t2, p2) represents the lower calorific value of real gas based on volume; V represents the molar volume of real gas, V = Z(t2, p2)*R*T2 / p2; Z(t2, p2) represents the compressibility factor under metrological reference conditions;
[0054] The uncertainty of the lower calorific value at volume basis is specifically:
[0055]
[0056] L 0 represents the molar enthalpy of water evaporation in the ideal state (the heat absorbed when 1 mole of water is completely evaporated).
[0057] As an optimization, the density includes the density of ideal gas and the density of real gas. Among them, the specific calculation formula of the density of ideal gas is:
[0058] D 0 (t2, p2) = M / V0;
[0059] Among them, D 0 (t2, p2) represents the density of ideal gas under metrological reference conditions; M represents the molar mass of the mixed gas, M j represents the molar mass of component j; V 0 represents the ideal molar volume, V 0 = R*T2 / p2, where R is the molar gas constant and T2 is the absolute temperature;
[0060] The specific calculation formula for the density of the real gas is as follows:
[0061]
[0062] D(t2,p2) represents the density of the real gas;
[0063] The specific calculation formula for the uncertainty of the density is as follows:
[0064]
[0065] u(D) represents the uncertainty of the natural gas density.
[0066] As an optimization, the relative density includes the relative density of the ideal gas and the relative density of the real gas. Among them, the specific calculation formula for the relative density of the ideal gas is as follows:
[0067]
[0068] Among them, G 0 represents the relative density of the ideal gas; M represents the molar mass of the mixed gas, M j represents the molar mass of component j; M air represents the molar mass of dry air with standard composition;
[0069] The specific calculation formula for the relative density of the real gas is as follows:
[0070]
[0071] Among them, G(t2,p2) represents the relative density of the real gas; Z(t2,p2) represents the compressibility factor of the gas; Z air (t2,p2) represents the compressibility factor of dry air with standard composition;
[0072] The specific calculation formula for the uncertainty of the relative density is as follows:
[0073]
[0074] Among them, u(G) represents the uncertainty of the relative density of the real gas, G represents the relative density of the real gas, u(M air ) represents the uncertainty of the molar mass of dry air with standard composition, u(Z air ) represents the uncertainty of the compressibility factor of dry air with standard composition under the metrological reference conditions.
[0075] As an optimization, the higher heating value Wobbe index includes the higher heating value Wobbe index of the ideal gas and the higher heating value Wobbe index of the real gas. Among them, the specific calculation formula for the higher heating value Wobbe index of the ideal gas is as follows:
[0076]
[0077] Among them, represents the total Wobbe index of the ideal gas; represents the higher calorific value per unit volume of the ideal gas; G 0 represents the relative density of the ideal gas;
[0078] The specific calculation formula for the higher Wobbe index of the real gas is:
[0079]
[0080] Among them, W G (t1; t2, p2) represents the higher Wobbe index of the real gas;
[0081] The specific calculation formula for the uncertainty of the higher Wobbe index is:
[0082]
[0083] u(W G ) represents the uncertainty of the higher Wobbe index of the real gas.
[0084] As an optimization, the lower Wobbe index includes the lower Wobbe index of the ideal gas and the lower Wobbe index of the real gas. Among them, the specific calculation formula for the lower Wobbe index of the ideal gas is:
[0085]
[0086] Among them, represents the total Wobbe index of the ideal gas; represents the lower calorific value per unit volume of the ideal gas;
[0087] The specific calculation formula for the lower Wobbe index of the real gas is:
[0088]
[0089] Among them, W N (t1; t2, p2) represents the lower Wobbe index of the real gas;
[0090] The specific calculation formula for the uncertainty of the lower Wobbe index is:
[0091]
[0092] u(W N ) represents the uncertainty of the lower Wobbe index of the real gas.
[0093] As an optimization, the specific calculation formula for the uncertainty of the molar mass is as follows:
[0094]
[0095] Among them, M i represents the molar mass of component i, M j represents the molar mass of component j, x i , x j represent the molar percentages (molar contents) of component i and component j in natural gas, r(x i , x j ) represents the correlation coefficient brought about by the presence of the same element between component i and component j in natural gas, and this value is given by the basic data table, r(M i , M j ) represents the correlation coefficient between the molar masses brought about by the presence of the same element between component i and component j in natural gas, and this value is given by the basic data table, u(x i ) represents the detection uncertainty of the content of component i.
[0096] The uncertainty of the summation factor is specifically as follows:
[0097]
[0098] Among them, s i represents the summation factor of component i, u 2 (s i ) represents the square of the uncertainty of the summation factor of component i.
[0099] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0100] Through the matrix processing function and interface processing module built in Python software, the present invention compiles a dedicated system with a friendly interface, higher automation degree and higher calculation efficiency for the characteristics of the natural gas composition detection result data of the company, improves work efficiency, improves data accuracy, and gives the uncertainty of the physical property parameters of natural gas, which can be used in fields such as business negotiation, contract signing, and trade settlement.
[0101] Based on the operation module of Python, the present invention adopts the design principle of the least code and the fastest running speed, does not require very complex code and logic, and can achieve powerful functions. In addition, all the content of Pyhton is open source and free, can be directly downloaded and used, and its code can also be modified, which is very convenient. Most importantly, it has good cross-platform and portability and can be transplanted to most platforms, such as Windows, MacOS, Linux, Andoride and IOS, etc. Description of the Drawings
[0102] The accompanying drawings described herein are used to provide a further understanding of the embodiments of the present invention, form a part of this application, and do not limit the embodiments of the present invention. In the drawings:
[0103] Figure 1 It is a schematic structural diagram of a natural gas physical property parameter and uncertainty calculation system based on Python according to the present invention;
[0104] Figures 2-4 It is an interface for calculating the physical property parameters and uncertainties of three test chromatograms. Specific Embodiments
[0105] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in combination with embodiments and the accompanying drawings. The illustrative embodiments of the present invention and their descriptions are only used to explain the present invention and do not limit the present invention.
[0106] Embodiment 1 of the present invention provides a natural gas physical property parameter and uncertainty calculation system based on Python, as Figures 1-4 shown, including a human-computer interaction interface and an operation module. The human-computer interaction interface includes a first area for performing function operations, a second area for displaying a list of test chromatograms, a third area for displaying detailed information of the test chromatograms, and a fourth area for displaying physical property parameters and calculation results of the uncertainty of the physical property parameters. The operation module is used to calculate physical property parameters and calculation results of the uncertainty of the physical property parameters according to the detailed information of the test chromatograms and calculation conditions input in the first area.
[0107] The human-computer interaction interface includes a python script code (invoking a user interface, implementing calculation functions, and outputting results), a code calling module (invoking a low-level user interface display function), a code analysis module (eliminating errors), and a code running module (completing matrix operations and logical judgment functions).
[0108] The first region includes a calculation condition input region, a component total option region, an uncertainty option region, and a calculation and query function region. In the calculation and query function region, there is a query module and a query box. By using an editing module, query conditions are input into the query box, and the corresponding detailed test chromatogram information is queried through the query module. The list of the queried detailed test chromatogram information is inserted into the second region for display through an insertion module, and the detailed test chromatogram information is read through a call module and displayed in the third region. Meanwhile, in the calculation and query function region, there is a closing module, a calculation and saving module, and an export to table module. The closing module is used to close the human-machine interaction interface and the operation module. The calculation and saving module is used to trigger the operation module to perform calculations, and save the physical property parameters obtained after the operation of the operation module and the calculation results of the uncertainty of the physical property parameters.
[0109] In this embodiment, the detailed test chromatogram information includes the natural gas component content and the uncertainty of the natural gas components. The physical property parameters include molar mass, summation factor (the summation factors of 60 components under standard conditions are given in GB / T 11062, and this data is calculated by the algorithm in GB / T 17747 and partially verified through experiments), compressibility factor, higher heating value per mole, lower heating value per mole, higher heating value per mass, lower heating value per mass, higher heating value per volume, lower heating value per volume, density, relative density, higher Wobbe index, lower Wobbe index.
[0110] As Figure 1 shown, in the calculation condition input part, a convenient, intuitive, and easy-to-use operation interface is provided. In the natural gas composition and uncertainty data input part, functions such as batch data import and normalization processing, and batch data sorting are provided. Combining the composition content and the basic data in the database, batch, fast, and accurate calculation and output of natural gas physical property parameters and uncertainties are realized.
[0111] The operation module refers to GB / T 11062-2020 and ISO 6976:2016. These two standards are widely used in the calculation scenarios of basic measurement data such as the compressibility factor, calorific value, density, and relative density of natural gas under standard conditions in the production, transportation, and sales of natural gas at home and abroad and globally. The main calculation models of 13 physical property parameters and uncertainties are as follows:
[0112] Compressibility factor under standard conditions:
[0113]
[0114] Among them, p0 represents the standard atmospheric pressure (101.325 kPa), s jThe summation factor of component j in natural gas, t2 represents the metering reference temperature (varies by country, in China it is 20 °C), x j represents the mole fraction of component j, and N represents the total number of components; p2 represents the metering reference pressure (generally 101.325 kPa);
[0115] Higher heating value per mole:
[0116]
[0117] In the formula:
[0118] ——Total ideal gas higher heating value per mole of the mixed gas;
[0119] (H c ) G (t1)——Total real gas higher heating value per mole of the mixed gas;
[0120] ——Total ideal mole higher heating value of component j;
[0121] x j is the mole fraction of component j.
[0122] Lower heating value per mole:
[0123] In a mixed gas with known composition, when the metering temperature is t1, the lower heating value per mole should be calculated according to formula (3):
[0124]
[0125] In the formula:
[0126] ——Total ideal gas lower heating value per mole of the mixed gas;
[0127] (H c ) N (t1)——Total real gas lower heating value per mole of the mixed gas;
[0128] L 0 (t1)——Standard enthalpy of water evaporation at temperature t1;
[0129] b j ——Number of hydrogen atoms contained in each molecule of component j;
[0130] u 2 (L 0 ) represents the uncertainty of the standard enthalpy, b i represents the number of hydrogen atoms contained in each molecule of component i, b j represents the number of hydrogen atoms contained in each molecule of component j, L0 Represents the molar enthalpy of water evaporation in the ideal state (the heat absorbed when 1 mole of water is completely evaporated).
[0131] Higher heating value on a mass basis:
[0132]
[0133] Where:
[0134] —— Higher heating value of the ideal gas of the mixture on a mass basis;
[0135] (H m ) G (t1)—— Higher heating value of the real gas of the mixture on a mass basis;
[0136] M—— Molar mass of the mixed gas, which should be obtained from Equation (5) in the known composition of the mixed gas:
[0137]
[0138] Where:
[0139] M j —— Molar mass of component j.
[0140] Lower heating value on a mass basis:
[0141]
[0142] Where:
[0143] —— Lower heating value of the ideal gas of the mixture on a mass basis;
[0144] (H m ) N (t1)—— Lower heating value of the real gas of the mixture on a mass basis.
[0145] Higher heating value of the ideal gas on a volume basis:
[0146]
[0147] Where:
[0148] —— Heating value of the mixed gas based on the volume of the ideal gas;
[0149] V o —— Ideal molar volume, which can be obtained from Equation (8):
[0150] V o= R·T2 / p2 ·····················(8)
[0151] Where:
[0152] R——Molar gas constant;
[0153] T2——Absolute temperature.
[0154] Lower calorific value of ideal gas at volume basis:
[0155]
[0156] Where:
[0157] ——Calorific value of the mixed gas based on the volume of ideal gas.
[0158] Higher calorific value of real gas at volume basis:
[0159]
[0160] Where:
[0161] (H v ) G (t1; t2, p2)——Higher calorific value of real gas at volume basis.
[0162] V——Real gas molar volume of the mixed gas, which should be calculated according to formula (11):
[0163] V = Z(t2, p2)·R·T2 / p2 ·····················(11)
[0164] Where:
[0165] Z(t2, p2)——Compressibility factor under metrological reference conditions. The metrological reference temperature may vary in different countries. Under the conditions specified in China, the metrological and combustion reference temperatures are both 20 degrees Celsius, so it is the same as the compressibility factor under standard conditions here.
[0166] The compressibility factor Z(t2, p2) can be calculated from the s j (t2, p0) values of each pure component of natural gas and formula (1). Generally, the calculation result is valid when Z > 0.9.
[0167] Lower calorific value of real gas at volume basis:
[0168]
[0169] Where:
[0170] (Hv ) N (t1; t2, p2) - Lower calorific value of real gas based on volume.
[0171] Relative density of ideal gas:
[0172]
[0173] Where:
[0174] G o - Relative density of ideal gas;
[0175] M - Molar mass of the mixed gas calculated according to formula (5);
[0176] M air - Molar mass of dry air with standard composition;
[0177] Density of ideal gas:
[0178] D 0 D(t2, p2) = M / V0 ························· (14)
[0179] Where:
[0180] D 0 (t2, p2) - Density of ideal gas under metering reference conditions;
[0181] M - Molar mass of the mixture obtained according to formula (5);
[0182] V o - Ideal molar volume of the mixture obtained according to formula (8).
[0183] Higher Wobbe index of ideal gas:
[0184]
[0185] Where:
[0186] - Total Wobbe index of ideal gas;
[0187] Calculated according to formula (7).
[0188] Lower Wobbe index of ideal gas:
[0189]
[0190] Where:
[0191] - Total Wobbe index of ideal gas;
[0192] Calculated according to formula (9).
[0193] Relative density of real gas:
[0194]
[0195] In the formula:
[0196] G(t2,p2) —— Relative density of real gas;
[0197] Z(t2,p2) —— Compressibility factor of gas;
[0198] Z(t2,p2) —— Compressibility factor of dry air with standard composition;
[0199] The compressibility factor Z(t2,p2) is calculated using the sum factor s Figure 2 for each pure component given in j (t2,p0) and formula (1), and the compressibility factor Z air (t2,p2) is calculated according to formula (18):
[0200]
[0201] When p0 = 101.325 kPa (14.696 psi), the metrological reference pressure p2 should also use the same unit.
[0202] Z air (t2 = 0 °C, p0) = 0.999419;
[0203] Z air (t2 = 15 °C, p0) = 0.999595;
[0204] Z air (t2 = 15.55 °C, p0) = 0.999601;
[0205] Z air (t2 = 20 °C, p0) = 0.999645.
[0206] Formula (18) is applicable to the range where p2 is between 90 kPa and 110 kPa (13.05 psi and 15.95 psi).
[0207] Density of real gas:
[0208]
[0209] In the formula:
[0210] D(t2,p2) —— Density of real gas.
[0211] Higher Wobbe index of real gas:
[0212]
[0213] In the formula:
[0214] W G (t1; t2, p2) — Higher Wobbe index of gas;
[0215] (H v ) G (t1; t2, p2) is calculated according to formula (10).
[0216] Lower Wobbe index of real gas:
[0217]
[0218] In the formula:
[0219] W N (t1; t2, p2) — Lower Wobbe index of real gas;
[0220] (H v ) N (t1; t2, p2) is calculated according to formula (12).
[0221] In the embodiments of the present application, the calculation formula for the uncertainty of each physical property parameter of natural gas is as follows (the uncertainty is represented by u):
[0222] Molar mass:
[0223]
[0224] Summation factor:
[0225]
[0226] Compression factor:
[0227]
[0228] Among them, s represents the total summation factor after the synthesis of the summation factors of each component of natural gas, u(s j ) represents the uncertainty of the summation factor of component j in natural gas, u(x i ) represents the uncertainty of component i, u(x j ) represents the uncertainty of component j, s j represents the summation factor of component j in natural gas, x i represents the molar fraction of component i.
[0229] Higher molar calorific value:
[0230]
[0231] (H m ) G represents the higher heating value of mass, u((H m ) G ) represents the uncertainty of the higher heating value of mass, represents the molar heating value of component i, (H c ) G represents the higher molar heating value, u(M i ), u(M j ) respectively represent the uncertainty of the molar mass of component i and j, M i , M j respectively represent the molar mass of component i and j, M represents the molar mass of the mixed gas, r(x i , x j ) is the correlation coefficient between component i and j of natural gas due to the presence of the same element, and this value is given by the basic data table.
[0232] Higher heating value in terms of mass:
[0233]
[0234] u((H v ) G ) represents the uncertainty of the higher heating value of the real gas based on volume, (H v ) G represents the higher heating value of the real gas based on volume, s i represents the summation factor of component i in natural gas, (H c ) G represents the total molar heating value of the ideal gas of the mixed gas, Z represents the compressibility factor, s represents the total summation factor after the synthesis of the summation factors of each component of natural gas, R is the molar gas constant, and u(R) represents the uncertainty of the molar gas constant.
[0235] Higher heating value in terms of volume:
[0236]
[0237] In the formula:
[0238]
[0239] Lower molar heating value:
[0240]
[0241] Among them, Denotes the ideal gas molar calorific value of component i, Denotes the ideal gas molar calorific value of component j, u 2 (L 0 ) Denotes the uncertainty of the standard enthalpy, b i Denotes the number of hydrogen atoms contained in each molecule in component i, b j Denotes the number of hydrogen atoms contained in each molecule in component j, L 0 Denotes the molar enthalpy of water evaporation in the ideal state (the heat absorbed when 1 mole of water is completely evaporated).
[0242] Lower calorific value on a mass basis:
[0243]
[0244] u((H m ) N ) Denotes the uncertainty of the lower calorific value of the real gas of the mixture on a mass basis, (H m ) N Denotes the lower calorific value of the real gas of the mixture on a mass basis.
[0245] Lower calorific value on a volume basis:
[0246] (31)
[0248] Density:
[0249]
[0250] Relative density:
[0251]
[0252] Among them, u(G) denotes the uncertainty of the relative density of the real gas, G denotes the relative density of the real gas, u(M air ) denotes the uncertainty of the molar mass of dry air with standard composition, u(Z air ) denotes the uncertainty of the compression factor of dry air with standard composition under metrological reference conditions.
[0253] Higher Wobbe index:
[0254]
[0255] Lower Wobbe index:
[0256]
[0257] Calculations were made for the three example components in the appendices of the GB / T 11062-2020 and ISO 6976:2016 standards, and the calculation results were consistent with those given in the standards. For examples, see Figures 2-4 。
[0258] Since the present invention involves many formula parameters, next, the symbolic parameters of this formula will be described:
[0259] Symbol-unit correspondence:
[0260]
[0261]
[0262] Symbol definitions for subscripts:
[0263] G High (calorific value or Wobbe index)
[0264] i Component counting identifier
[0265] j Component counting identifier
[0266] k Counting identifier
[0267] m Counting identifier
[0268] N Low (calorific value or Wobbe index)
[0269] n Counting identifier
[0270] air Air
[0271] 0 Reference value (pressure)
[0272] 1 Combustion reference state
[0273] 2 Measurement reference state
[0274] Symbol definitions for superscripts:
[0275] o Ideal gas state
[0276] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A natural gas physical property parameter and uncertainty calculation system based on Python, characterized in that, It includes a human-computer interaction interface and an operation module. The human-computer interaction interface includes a first area for performing function operations, a second area for displaying a test chromatogram list, a third area for displaying the detailed information of the test chromatogram, and a fourth area for displaying physical property parameters and the calculation results of the uncertainty of the physical property parameters. The operation module is used to calculate the physical property parameters and the calculation results of the uncertainty of the physical property parameters according to the detailed information of the test chromatogram and the calculation conditions input in the first area.
2. The natural gas physical property parameter and uncertainty calculation system based on Python according to claim 1, wherein The first area includes a calculation condition input area, a component total option area, an uncertainty option area, a calculation and query function area. In the calculation and query function area, there is a query module and a query box. The query condition is input in the query box through an editing module, and the corresponding detailed information of the test chromatogram is queried through the query module. The list of the queried detailed information of the test chromatogram is inserted into the second area for display through an insertion module, and the detailed information of the test chromatogram is read through a call module and displayed in the third area. At the same time, in the calculation and query function area, there is a close module, a calculate and save module, and an export to table module. The close module is used to close the human-computer interaction interface and the operation module. The calculate and save module is used to trigger the operation module to perform calculations and save the physical property parameters and the calculation results of the uncertainty of the physical property parameters obtained after the operation of the operation module.
3. The natural gas physical property parameter and uncertainty calculation system based on Python according to claim 1, wherein, The detailed information of the test chromatogram includes the content of natural gas components and the uncertainty of natural gas components.
4. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 1, characterized in that, The physical property parameters include molar mass, summation factor, compressibility factor, higher heating value per mole, lower heating value per mole, higher heating value per mass, lower heating value per mass, higher heating value per volume, lower heating value per volume, density, relative density, higher Wobbe index, lower Wobbe index.
5. The natural gas physical property parameter and uncertainty calculation system based on Python according to claim 4, characterized in that, The specific calculation formula for the compressibility factor is: where p0 represents the standard atmospheric pressure, s j represents the summation factor of component j in natural gas, t2 represents the metering reference temperature, x j represents the mole fraction of component j, N represents the total number of components; p2 represents the metering reference pressure; The specific calculation formula for the uncertainty of the compressibility factor is: Among them, u 2 (Z) represents the square of the uncertainty of the compression factor, s represents the total summation factor after the synthesis of the summation factors of each component of natural gas, u(s j ) represents the uncertainty of the summation factor of component j in natural gas, u(x i ) represents the uncertainty of component i, u(x j ) represents the uncertainty of component j, s j represents the summation factor of component j in natural gas, x i represents the mole fraction of component i.
6. The natural gas physical property parameter and uncertainty calculation system based on Python according to claim 5, characterized in that The specific calculation formula for the higher heating value per mole is: Among them, represents the total molar calorific value of the ideal gas of the mixed gas at temperature t1; (H c ) G (t1) represents the total molar calorific value of the real gas of the mixed gas; represents the total ideal molar calorific value of component j; x j represents the mole fraction of component j; The specific calculation formula for the uncertainty of the higher heating value per mole is: Among them, (H m ) G represents the higher heating value of mass, u((H m )) G represents the uncertainty of the higher heating value of mass, represents the molar heating value of component i, (H c ) G represents the higher molar heating value, u(M i ), u(M j ) respectively represent the uncertainty of the molar mass of component i and j, M i , M j respectively represent the molar mass of component i and j, M represents the molar mass of the mixed gas, is the correlation coefficient between component i and j of natural gas due to the presence of the same element, and this value is given by the basic data table.
7. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 6, characterized in that The specific calculation formula for the lower heating value per mole is: Among them, represents the lower molar calorific value of the ideal gas of the mixed gas; (H c ) N (t1) represents the lower molar calorific value of the real gas of the mixed gas; L 0 (t1) represents the standard enthalpy of evaporation of water at temperature t1; b j represents the number of hydrogen atoms contained in each molecule in component j; The specific calculation formula for the uncertainty of the lower heating value per mole is: Among them, represents the ideal gas molar calorific value of component i, represents the ideal gas molar calorific value of component j, u 2 (L 0 ) represents the square of the uncertainty of the standard enthalpy of water, b i represents the number of hydrogen atoms contained in each molecule in component i, b j represents the number of hydrogen atoms contained in each molecule in component j, L 0 represents the molar enthalpy of water evaporation in the ideal state.
8. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 7, characterized in that, The specific calculation formula for the higher heating value per mass is: Among them, represents the higher heating value of the ideal gas of the mixture based on mass; (H m ) G (t1) represents the higher heating value of the real gas of the mixture based on mass; M represents the molar mass of the mixed gas, M j represents the molar mass of component j; The specific calculation formula for the uncertainty of the higher heating value per mass is: u((H v ) G ) represents the uncertainty of the higher calorific value of the real gas on a volume basis, (H v ) G represents the higher calorific value of the real gas on a volume basis, s i represents the summation factor of component i in natural gas, (H c ) G represents the total molar calorific value of the ideal gas of the mixed gas, Z represents the compressibility factor, s represents the total summation factor after synthesizing the summation factors of each component of natural gas, R is the molar gas constant, and u(R) represents the uncertainty of the molar gas constant.
9. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 8, characterized in that, The specific calculation formula for the lower heating value per mass is: Among them, represents the lower calorific value of the ideal gas of the mixture based on mass; (H m ) N (t1) represents the lower calorific value of the real gas of the mixture based on mass; The specific calculation formula for the uncertainty of the lower heating value per mass is: u((H m ) N ) represents the uncertainty of the lower calorific value of the real gas of the mixture on a mass basis, (H m ) N represents the lower calorific value of the real gas of the mixture on a mass basis.
10. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 9, characterized in that, The higher heating value per volume includes the higher heating value per volume of ideal gas and the higher heating value per volume of real gas. Among them, the specific calculation formula for the higher heating value per volume of ideal gas is: Among them, represents the higher calorific value of the mixed gas based on the volume of the ideal gas; V 0 represents the ideal molar volume, V 0 = R*T2 / p2, where R is the molar gas constant and T2 is the absolute temperature; The specific calculation formula for the higher heating value per volume of real gas is: Among them, (H v ) G (t1; t2, p2) represents the higher calorific value of the real gas based on volume; V represents the real gas molar volume of the mixed gas, V = Z(t2, p2)*R*T2 / p2; Z(t2, p2) represents the compression factor under the metrological reference conditions; The specific calculation formula for the uncertainty of the higher heating value per volume is: Among them, Z represents the compressibility factor under metrological reference conditions.
11. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 10, characterized in that, The lower heating value per volume includes the lower heating value per volume of ideal gas and the lower heating value per volume of real gas. Among them, the specific calculation formula for the lower heating value per volume of ideal gas is: Among them, represents the lower calorific value of the mixed gas based on the ideal gas volume; V 0 represents the ideal molar volume, V 0 = R*T2 / p2, where R is the molar gas constant and T2 is the absolute temperature; The specific calculation formula for the lower heating value per volume of real gas is: where (H v ) N (t1; t2, p2) represents the lower calorific value of the real gas on a volume basis; V represents the molar volume of the real gas, V = Z(t2, p2)*R*T2 / p2; z(t2, p2) represents the compressibility factor under metrological reference conditions; The specific calculation formula for the uncertainty of the lower heating value per volume is: L 0 Represents the molar enthalpy of water evaporation in the ideal state.
12. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 11, characterized in that, The density includes the ideal gas density and the real gas density. Among them, the specific calculation formula for the ideal gas density is: D 0 (t2, p2) = M / V 0 ; Among them, D 0 (t2, p2) represents the ideal gas density under the metrological reference conditions; M represents the molar mass of the mixed gas, M j represents the molar mass of component j; V 0 represents the ideal molar volume, V 0 = R * T2 / p2, where R is the molar gas constant and T2 is the absolute temperature; The specific calculation formula for the real gas density is: D(t2,p2) represents the real gas density; The specific calculation formula for the uncertainty of the density is: u(D) represents the uncertainty of the real gas density.
13. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 12, characterized in that, The relative density includes the ideal gas relative density and the real gas relative density. Among them, the specific calculation formula for the ideal gas relative density is: Among them, G 0 represents the relative density of an ideal gas; M represents the molar mass of the mixed gas, M j represents the molar mass of component j; M air represents the molar mass of dry air with a standard composition; The real gas relative density is specifically: Among them, G(t2, p2) represents the relative density of the real gas; Z(t2, p2) represents the compressibility factor of the gas under the metrological reference conditions; Z air (t2, p2) represents the compressibility factor of dry air with standard composition under the metrological reference conditions; The specific calculation formula for the uncertainty of the relative density is: Among them, u(G) represents the uncertainty of the relative density of the real gas, G represents the relative density of the real gas, u(M air ) represents the uncertainty of the molar mass of dry air with a standard composition, u(Z air ) represents the uncertainty of the compressibility factor of dry air with a standard composition under the metrological reference conditions.
14. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 13, characterized in that The higher heating value Wobbe index includes the ideal gas higher heating value Wobbe index and the real gas higher heating value Wobbe index. Among them, the specific calculation formula for the ideal gas higher heating value Wobbe index is: Among them, represents the total Wobbe index of an ideal gas; represents the higher calorific value per unit volume of an ideal gas; G 0 represents the relative density of an ideal gas; The specific calculation formula for the real gas higher heating value Wobbe index is: Among them, W G (t1; t2, p2) represents the higher Wobbe index of the real gas; The specific calculation formula for the uncertainty of the higher heating value Wobbe index is: u(W G ) represents the uncertainty of the higher heating value Wobbe index of real gas.
15. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 14, characterized in that, The lower heating value Wobbe index includes the ideal gas lower heating value Wobbe index and the real gas lower heating value Wobbe index. Among them, the specific calculation formula for the ideal gas lower heating value Wobbe index is: Among them, represents the total Wobbe index of the ideal gas; represents the lower calorific value per unit volume of the ideal gas; The specific calculation formula for the real gas lower heating value Wobbe index is: Among them, W N (t1; t2, p2) represents the lower heating value Wobbe index of a real gas; The specific calculation formula for the uncertainty of the lower heating value Wobbe index is: u(W N ) represents the uncertainty of the lower heating value Wobbe index of real gas.
16. A Python-based natural gas physical property parameter and uncertainty calculation system according to claim 14, characterized in that, The specific calculation formula for the uncertainty of the molar mass is: Among them, M i represents the molar mass of component i, M j represents the molar mass of component j, r(x i , x j ) represents the correlation coefficient between the component contents of natural gas components i and j due to the presence of the same element, and this value is given by the basic data table, r(M i , M j ) represents the correlation coefficient between the molar masses of natural gas components i and j due to the presence of the same element, and this value is given by the basic data table, u(x i ) represents the detection uncertainty of the content of component i; The specific calculation formula for the uncertainty of the summation factor is: where s i represents the summation factor of the i-th component of natural gas, and u 2 (s i ) represents the square of the uncertainty of the summation factor of the i-th component of natural gas.
