Method and device for determining compression factor of natural gas with high hydrogen sulfide content

CN119004736APending Publication Date: 2024-11-22PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310552694.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

There are many impurities in the wellhead gas with high hydrogen sulfide and cannot be analyzed online, which results in the calculation of compression factor Z requiring on-site sampling and laboratory analysis, resulting in inaccurate measurement and safety threats.

Method used

The pre-trained high-hydrogen sulfide natural gas compression factor prediction model is adopted, and data is obtained using online temperature and pressure sensors, and the compression factor Z is directly calculated, avoiding on-site sampling and laboratory analysis, and improving metrology accuracy and operational safety.

Benefits of technology

Real-time calculation of high hydrogen sulfide natural gas compression factors on site is achieved, which improves the accuracy of volume flow metering, reduces operational risks, and avoids measurement errors of time lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004736A_ABST
    Figure CN119004736A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for determining a compression factor of natural gas with high content of hydrogen sulfide, and relates to the technical field of natural gas. The method comprises the following steps: acquiring the operating temperature and the operating pressure of the natural gas with high content of hydrogen sulfide at a wellhead to be metered; inputting the high-hydrogen-sulfide-content natural gas operating temperature and the high-hydrogen-sulfide-content natural gas operating pressure of the to-be-metered wellhead into a pre-trained high-hydrogen-sulfide-content natural gas compression factor prediction model to obtain a high-hydrogen-sulfide-content natural gas compression factor corresponding to the to-be-metered wellhead; wherein the high-hydrogen-sulfide-content natural gas compression factor prediction model is obtained through training according to historical acidic natural gas compression factors, historical acidic natural gas operating temperatures corresponding to the historical acidic natural gas compression factors and historical acidic natural gas operating pressures. According to the method, the influence of time delay on the metering accuracy can be eliminated, the metering accuracy of the volume flow is improved, and the operation safety in the calculation process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural gas technology, and in particular to a method and a device for determining the compression factor of natural gas with a high hydrogen sulfide content. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] Due to differences in geological conditions, the quality of natural gas at the wellhead of the gas source varies. In some areas, hydrogen sulfide (H2S) natural gas accounts for a considerable proportion of the total natural gas resources. Advanced orifice valves are usually used for volume flow measurement at high hydrogen sulfide natural gas wellheads. In the orifice flowmeter measurement process, there are two places where the key natural gas parameter compression factor Z needs to be used. One is the orifice flowmeter measurement principle: the compression factor Z is used to convert the density ρ of sour natural gas to complete the volume flow measurement; the other is the conversion between the operating volume flow and the standard volume flow: the compression factor Z is used for conversion.

[0004] However, natural gas wellhead gas contains many impurities, and it is impossible to install an online chromatograph for online sampling and analysis. On-site sampling, laboratory analysis, and assignment are required to calculate the compression factor Z, which will cause time differences in sampling time, analysis time, and assignment time, which will cause serious measurement inaccuracies. In addition, the sampling and analysis test data of each well can only be used for that well, but not for other wells, that is, the sampling, analysis, and test data of well A can only be used for well A, but not for well B, which will make the field data unable to be fully utilized, because the compression factor calculation method shows that the compression factor of natural gas is only related to temperature, pressure, and composition. As for which well the natural gas sample comes from, there is no need to pay special attention. Finally, since hydrogen sulfide is a toxic gas, repeated sampling, analysis, testing, and assignment may pose a threat to the safety of researchers.

[0005] From the above analysis, we can know that the analysis of gas components at the wellhead of high hydrogen sulfide gas wells and the assignment of compression factor Z can only be completed in the laboratory, and cannot be directly assigned on site, which brings a time lag to the measurement accuracy. At the same time, since hydrogen sulfide is a toxic gas, the experimenters must be very careful when performing laboratory analysis operations, and a slight gas leak may threaten the life of the experimental operators. Summary of the invention

[0006] The embodiment of the present invention provides a method for determining the compression factor of natural gas with high hydrogen sulfide content, which is used to directly calculate the compression factor of natural gas with high hydrogen sulfide content according to data sampled on site, eliminate the influence of time lag on measurement accuracy, improve the measurement accuracy of volume flow, and improve the operation safety during the calculation process. The method includes:

[0007] Obtaining the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be measured and the operating pressure of the high hydrogen sulfide-containing natural gas;

[0008] The operating temperature and pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be metered are input into a pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model to obtain the high hydrogen sulfide-containing natural gas compression factor corresponding to the wellhead to be metered;

[0009] The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

[0010] The embodiment of the present invention also provides a device for determining the compression factor of natural gas with high hydrogen sulfide content, which is used to directly calculate the compression factor of natural gas with high hydrogen sulfide content according to data sampled on site, eliminate the influence of time lag on measurement accuracy, improve the measurement accuracy of volume flow, and improve the operation safety during the calculation process. The device includes:

[0011] An acquisition module, used to acquire the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be measured, and the operating pressure of the high hydrogen sulfide-containing natural gas;

[0012] The first processing module is used to input the operating temperature of the high hydrogen sulfide natural gas and the operating pressure of the high hydrogen sulfide natural gas at the wellhead to be measured into a pre-trained high hydrogen sulfide natural gas compression factor prediction model to obtain the high hydrogen sulfide natural gas compression factor corresponding to the wellhead to be measured;

[0013] The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

[0014] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the compression factor of high hydrogen sulfide natural gas when executing the computer program.

[0015] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the compression factor of natural gas with a high hydrogen sulfide content is implemented.

[0016] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for determining the compression factor of natural gas with high hydrogen sulfide content is implemented.

[0017] In the embodiment of the present invention, the operating temperature and operating pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be measured are obtained; the operating temperature and operating pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be measured are input into a pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model to obtain the high hydrogen sulfide-containing natural gas compression factor corresponding to the wellhead to be measured; wherein the high hydrogen sulfide-containing natural gas compression factor prediction model is trained based on the historical sour natural gas compression factor and the historical sour natural gas operating temperature and historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor. In this way, the high hydrogen sulfide-containing natural gas compression factor can be directly calculated based on the data sampled on site through the pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model, eliminating the influence of time lag on the measurement accuracy, improving the volume flow measurement accuracy, and improving the operational safety during the calculation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 This is a flow chart of a method for determining a compression factor of natural gas with a high hydrogen sulfide content provided in an embodiment of the present invention;

[0020] Figure 2 An example diagram of a metering process of a natural gas with high hydrogen sulfide content provided in an embodiment of the present invention;

[0021] Figure 3 A flow chart of a method for training a prediction model for the compression factor of natural gas with high hydrogen sulfide content provided in an embodiment of the present invention;

[0022] Figure 4A flow chart of a method for building an initial neural network model by taking the natural gas operating temperature and the natural gas operating pressure as inputs and the natural gas compression factor as output, provided in an embodiment of the present invention;

[0023] Figure 5 A schematic diagram of an initial neural network model provided in an embodiment of the present invention;

[0024] Figure 6 A flow chart of a method for obtaining a trained high hydrogen sulfide natural gas compression factor prediction model by using a sample set to train an initial neural network model provided in an embodiment of the present invention;

[0025] Figure 7 It is a schematic diagram of a device for determining the compression factor of natural gas with high hydrogen sulfide content provided in an embodiment of the present invention;

[0026] Figure 8 A schematic diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0027] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0028] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of laws and regulations.

[0029] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0030] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions of reference terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The sequence of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the sequence of steps is not limited and can be adjusted appropriately as needed. It has been found that when the traditional method uses a standard orifice flowmeter to measure the volume flow of high hydrogen sulfide-containing natural gas, the following parameters need to be obtained: natural gas operating temperature T, natural gas operating pressure p, and natural gas composition. Among them, the natural gas operating temperature T and pressure p can be directly obtained through on-site temperature sensors and pressure sensors, and the natural gas components are usually obtained by on-site sampling and laboratory analysis. The main purpose is to use the AGA8-92DC equation proposed in GB 17747 "Calculation of natural gas compressibility factor" or the GERG-2008 equation in ISO 20765-2:2015 "Natural gas_Calculation of thermodynamic properties_Part 2:Single-phase properties (gas, liquid, and dense fluid) for extended ranges of application" to assign the compression factor Z based on the obtained temperature, pressure and components. Finally, the value is input into the on-site orifice flowmeter metering calculation system to complete the wellhead metering of high hydrogen sulfide natural gas.

[0031] However, the natural gas wellhead contains many impurities, and it is impossible to install an online chromatograph for online sampling and analysis. On-site sampling, laboratory analysis, and assignment are required to calculate the compression factor Z. This will cause a time difference between the sampling time, analysis time, and assignment time, which will cause serious measurement inaccuracy. In addition, the sampling and analysis test data of each well can only be used for that well, but not for other wells. That is, the sampling, analysis, and test data of Well A can only be used for Well A, but not for Well B. This will make it impossible to fully utilize the field data, because the compression factor calculation method shows that the compression factor of natural gas is only related to temperature, pressure, and composition. As for which well the natural gas sample comes from, there is no need to pay special attention. Finally, since hydrogen sulfide is a toxic gas, repeated sampling, analysis, testing, and assignment may pose a threat to the safety of researchers.

[0032] From the above analysis, we can know that the analysis of gas components at the wellhead of high hydrogen sulfide gas wells and the assignment of compression factor Z can only be completed in the laboratory, and cannot be directly assigned on site, which brings a time lag to the measurement accuracy. At the same time, since hydrogen sulfide is a toxic gas, the experimenters must be very careful when performing laboratory analysis operations, and a slight gas leak may threaten the life of the experimental operators.

[0033] Regarding the above studies, Figure 1 As shown, an embodiment of the present invention provides a method for determining a compression factor of natural gas with a high hydrogen sulfide content, comprising:

[0034] S101: Obtaining the operating temperature and pressure of the natural gas with high hydrogen sulfide content at the wellhead to be measured;

[0035] S102: inputting the high hydrogen sulfide natural gas operating temperature and high hydrogen sulfide natural gas operating pressure of the wellhead to be metered into a pre-trained high hydrogen sulfide natural gas compression factor prediction model to obtain the high hydrogen sulfide natural gas compression factor corresponding to the wellhead to be metered;

[0036] The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

[0037] In the embodiment of the present invention, the high hydrogen sulfide natural gas operating temperature and high hydrogen sulfide natural gas operating pressure of the wellhead to be measured are obtained; the high hydrogen sulfide natural gas operating temperature and high hydrogen sulfide natural gas operating pressure of the wellhead to be measured are input into a pre-trained high hydrogen sulfide natural gas compression factor prediction model to obtain the high hydrogen sulfide natural gas compression factor corresponding to the wellhead to be measured; wherein the high hydrogen sulfide natural gas compression factor prediction model is trained based on the historical sour natural gas compression factor and the historical sour natural gas operating temperature and historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor. In this way, the high hydrogen sulfide natural gas compression factor prediction model can be used to directly calculate the high hydrogen sulfide natural gas compression factor based on the data sampled on site (for example, the high hydrogen sulfide natural gas operating temperature and high hydrogen sulfide natural gas operating pressure data obtained by online temperature sensors and pressure sensors), thereby eliminating the process of repeated on-site sampling and laboratory assignment, eliminating the influence of time lag on the measurement accuracy, improving the volume flow measurement accuracy, and improving the operational safety during the calculation process.

[0038] The method for determining the compression factor of the high hydrogen sulfide content natural gas is described in detail below.

[0039] With respect to the above S101, the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be metered can be obtained online, for example, through an online temperature sensor installed at the wellhead to be metered, and the operating pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be metered can be obtained online, for example, through a pressure sensor installed at the wellhead to be metered.

[0040] Specifically, Figure 2 As shown, an example diagram of a high-hydrogen sulfide natural gas metering process provided by an embodiment of the present invention is shown: after primary throttling, heat exchange, secondary throttling, and horizontal separator, metering is performed using a high-level orifice valve. Among them, there are continuous online pressure sensors and temperature sensors at the wellhead to measure pressure and temperature.

[0041] For S102, the high hydrogen sulfide natural gas compression factor prediction model is trained based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure. The trained high hydrogen sulfide natural gas compression factor prediction model can be applied to, for example Figure 2 In the orifice flowmeter shown in , there is no need to add additional metering equipment. The compression factor of high hydrogen sulfide content natural gas can be calculated in real time using only temperature and pressure data, thereby achieving the purpose of accurate metering.

[0042] Specifically, Figure 3 As shown, a flow chart of a method for training a prediction model for the compression factor of natural gas with high hydrogen sulfide content provided by an embodiment of the present invention includes:

[0043] S301: Obtaining a historical sour natural gas compression factor, a historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and a historical sour natural gas operating pressure.

[0044] Among them, the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure can be obtained, for example, through historical field sampling high hydrogen sulfide content natural gas data (such as operating pressure, operating temperature), and the compression factor obtained by laboratory analysis and testing.

[0045] In another embodiment of the present invention, the data can also be obtained through a worldwide literature survey on the calculation of sour natural gas compression factor. For example, Table 1 is a data table of a high hydrogen sulfide-containing natural gas sample obtained from existing literature provided in an embodiment of the present invention:

[0046] Table 1 Parameters of high hydrogen sulfide content natural gas samples

[0047]

[0048] Among them, the component data in the table can be used to determine the composition of natural gas, and then to determine whether it is a high hydrogen sulfide content natural gas.

[0049] S302: Generate a sample set according to the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

[0050] Specifically, for example, the method includes: taking the historical sour natural gas operating temperature and the historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor as sample input, and the historical sour natural gas compression factor as sample output, to generate multiple samples; dividing the generated multiple samples into training samples and test samples according to a preset ratio; and forming a sample set based on the training samples and the test samples.

[0051] S303: Taking the natural gas operating temperature and the natural gas operating pressure as input and the natural gas compression factor as output, an initial neural network model is constructed.

[0052] In one embodiment of the present invention, the initial neural network model includes: an input layer, a hidden layer, and an output layer; Figure 4 As shown, the natural gas operating temperature and natural gas operating pressure are taken as inputs, and the natural gas compression factor is taken as output to build an initial neural network model, including:

[0053] S401: Taking the natural gas operating temperature and the natural gas operating pressure as input, and configuring the number of input layer neurons according to the input.

[0054] Here, the natural gas operating temperature and the natural gas operating pressure are taken as inputs, and the number of neurons in the input layer can be configured to be 2.

[0055] S402: Taking the natural gas compression factor as output, and configuring the number of neurons in the output layer according to the output.

[0056] Here, the natural gas compression factor is taken as the output, and the number of neurons in the output layer can be configured to be 1.

[0057] S403: Configure the number of hidden layers, the first connection weight between the input layer and the hidden layer, the second connection weight between the hidden layer and the output layer, the hidden layer threshold, the output layer threshold, the learning rate, and the activation function to obtain an initial neural network model.

[0058] like Figure 5As shown, it is a schematic diagram of an initial neural network model provided by an embodiment of the present invention, wherein, for example, the input layer is configured to include two input neurons (pressure P and temperature T), 8 hidden layers and 1 output layer are set, the hidden layer includes a first connection weight between the input layer and a hidden layer threshold, and the output layer includes a second connection weight between the hidden layer and the output layer threshold.

[0059] In one embodiment of the present invention, the hidden layer operator includes:

[0060]

[0061] Where, j = 1, 2, ..., l; l is the number of input hidden layers, x is the characteristic value obtained by combining the natural gas operating temperature and the natural gas operating pressure, H is the hidden layer output variable, ω ij is the first connection weight between the input layer and the hidden layer, b ij is the hidden layer threshold, n is the number of neurons in the hidden layer, and f1 is the hidden layer activation function:

[0062]

[0063] In another embodiment of the present invention, the output layer operator includes:

[0064]

[0065] Where k = 1, 2, ..., m; m is the number of output hidden layers, O is the natural gas compression factor, ω jk is the second connection weight between the hidden layer and the output layer, b jk is the output layer threshold, and f2 is the output layer function: f2(x)=x.

[0066] S304: Using the sample set to train the initial neural network model, to obtain a trained high hydrogen sulfide natural gas compression factor prediction model.

[0067] like Figure 6 As shown, a flow chart of a method for training an initial neural network model using a sample set to obtain a trained high hydrogen sulfide natural gas compression factor prediction model provided by an embodiment of the present invention includes:

[0068] S601: Input the sample input of the training sample into the initial neural network model to obtain the natural gas compression factor actually output by the initial neural network model.

[0069] S602: performing error calculation based on the natural gas compression factor actually output by the initial neural network model and the sample output of the training sample to obtain an error calculation result.

[0070] Here, for example, the following formula can be used to perform error calculation based on the actual output of the initial neural network model and the sample output of the training sample to obtain the error calculation result:

[0071] e k =Y k -O k ;

[0072] Where k = 1, 2, ..., m; e k is the error calculation result, Y k is the sample output, O k is the natural gas compression factor actually output by the initial neural network model.

[0073] S603: When the error calculation result is greater than the preset error value, the first connection weight, the second connection weight, the hidden layer threshold, and the output layer threshold of the initial neural network model are updated according to the error calculation result, and the initial neural network model is continued to be calculated using the training sample.

[0074] In one embodiment of the present invention, for example, the following formula may be used to update the second connection weight of the initial neural network model according to the error calculation result:

[0075] ω′ jk =ω jk +ηH j e k

[0076] Where j = 1, 2, ... l, k = 1, 2, ..., m, η is the learning rate, ω′ jk is the updated second connection weight.

[0077] In one embodiment of the present invention, for example, the following formula may be used to update the first connection weight of the initial neural network model according to the error calculation result:

[0078]

[0079] Among them, i=1,2,…n, j=1,2,…,l,ω′ ij is the updated first connection weight, and x(i) is the input characteristic value obtained according to the natural gas operating temperature and the natural gas operating pressure.

[0080] In one embodiment of the present invention, for example, the following formula may be used to update the hidden layer threshold of the initial neural network model according to the error calculation result:

[0081]

[0082] Where i = 1, 2, ... n, j = 1, 2, ..., l, b' ijis the updated hidden layer threshold, b ij is the hidden layer threshold before updating.

[0083] In one embodiment of the present invention, for example, the following formula may be used to update the output layer threshold of the initial neural network model according to the error calculation result:

[0084] b j ' k =b jk +e k

[0085] Where j = 1, 2, ... l, k = 1, 2, ..., m, b j ' k is the updated output layer threshold, b jk is the output layer threshold before updating.

[0086] S604: When the error calculation result is less than or equal to the preset error value, the initial neural network model is tested using the test sample.

[0087] Here, during the test, the sample input of the test sample is input into the initial neural network model, and then the test error is calculated based on the natural gas compression factor actually output by the initial neural network model and the sample output of the test sample. When the test error is less than the preset error value, the test passes.

[0088] S605: When the test passes, the initial neural network model is used as a trained high hydrogen sulfide natural gas compression factor prediction model.

[0089] In another embodiment of the present invention, when the test fails, the initial neural network model continues to be trained with new training samples.

[0090] from Figure 2It can be seen that the prediction error of the artificial neural network method is basically within ±3%, with relatively good prediction accuracy. The average relative error and mean square error of the improved equations of 2 commonly used state equations, 3 commonly used empirical correlation equations, and 6 empirical correlation equations are shown in Table 2. Among them, the comparison equations include the SRK state equation, the BWR state equation proposed by Soave modified Benedict-Webb-Rubin, that is, the BWRS state equation; 3 commonly used empirical correlation equations, including the Hall-Yarbough (HY) empirical correlation equation, the Dranchuk-Abou-Kassem (DAK) empirical correlation equation, and the Dranchuk-Purvis-Robinson (DPR) empirical correlation equation; the acid gas corrected forms of the 6 commonly used empirical correlation equations, that is, the empirical correlation equations corrected by Wichert-Aziz (WA) acid gas and the empirical correlation equations corrected by GXQ acid gas, respectively, Hall-Yar Hall-Yarbough+Wichert-Aziz(H-Y+WA) empirical correlation equation, Dranchuk-Abou-Kassem+Wichert-Aziz(DA-K+WA) empirical correlation equation, Dranchuk-Purvis-Robinson+Wichert-Aziz(DP-R+WA) empirical correlation equation, Hall-Yarbough+GXQ(H-Y+GXQ) empirical correlation equation, Dranchuk-Abou-Kassem+GXQ(DA-K+GXQ) empirical correlation equation, Dranchuk-Purvis-Robinson+GXQ(DP-R+GXQ) empirical correlation equation. All the above equations require the input of natural gas composition, temperature and pressure parameters.

[0091] Table 2 Average relative error and mean square error of 12 calculation methods

[0092]

[0093]

[0094] From the average error results of high hydrogen sulfide compression factors calculated by different methods in Table 2, it can be seen that the method for determining the compression factor of high hydrogen sulfide natural gas in the embodiment of the present invention is significantly smaller than the minimum error of 6.27% of the empirical formula calculation result, and the minimum error of 1.47% of the other 9 empirical correlation models and their improved forms. This shows that the embodiment of the present invention has good adaptability to the prediction of the compression factor of high hydrogen sulfide acidic natural gas. In addition, the input parameters of the method of the embodiment of the present invention only require temperature and pressure, while other methods require natural gas component parameters in addition to temperature and pressure parameters. Therefore, the embodiment of the present invention can directly assign the compression factor through the temperature and pressure data obtained by the online temperature sensor and pressure sensor, eliminating the process of repeated on-site sampling and laboratory assignment.

[0095] The present invention also provides a device for determining the compression factor of natural gas with high hydrogen sulfide content, as described in the following embodiments. Since the principle of solving the problem by the device is similar to the method for determining the compression factor of natural gas with high hydrogen sulfide content, the implementation of the device can refer to the implementation of the method for determining the compression factor of natural gas with high hydrogen sulfide content, and the repeated parts will not be repeated.

[0096] like Figure 7 FIG. 1 is a schematic diagram of a device for determining a compression factor of a natural gas with high hydrogen sulfide content provided by an embodiment of the present invention, comprising:

[0097] An acquisition module 701 is used to acquire the operating temperature and pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be measured;

[0098] The first processing module 702 is used to input the high hydrogen sulfide natural gas operating temperature and high hydrogen sulfide natural gas operating pressure of the wellhead to be measured into a pre-trained high hydrogen sulfide natural gas compression factor prediction model to obtain the high hydrogen sulfide natural gas compression factor corresponding to the wellhead to be measured;

[0099] The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

[0100] In a possible implementation, the method further includes: a second processing module for obtaining a historical sour natural gas compression factor, a historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and a historical sour natural gas operating pressure; generating a sample set according to the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure; building an initial neural network model with the natural gas operating temperature and the natural gas operating pressure as input and the natural gas compression factor as output; and training the initial neural network model with the sample set to obtain a trained high hydrogen sulfide natural gas compression factor prediction model.

[0101] In a possible implementation, the method further includes: a second processing module, specifically configured to use the historical sour natural gas operating temperature and the historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor as sample inputs and the historical sour natural gas compression factor as sample outputs to generate a plurality of samples;

[0102] Divide the generated multiple samples into training samples and test samples according to a preset ratio;

[0103] The sample set is formed according to the training samples and the test samples.

[0104] In a possible implementation, the initial neural network model includes: an input layer, a hidden layer, and an output layer; a second processing module, which is specifically used to take the natural gas operating temperature and the natural gas operating pressure as inputs, and configure the number of input layer neurons according to the inputs; take the natural gas compression factor as output, and configure the number of output layer neurons according to the output; configure the number of hidden layers, the first connection weight between the input layer and the hidden layer, the second connection weight between the hidden layer and the output layer, the hidden layer threshold, the output layer threshold, as well as the learning rate and the excitation function to obtain the initial neural network model.

[0105] In a possible implementation, the hidden layer operator includes:

[0106]

[0107] Where, j = 1, 2, ..., l; l is the number of input hidden layers, x is the characteristic value obtained by combining the natural gas operating temperature and the natural gas operating pressure, H is the hidden layer output variable, ω ij is the first connection weight between the input layer and the hidden layer, b ij is the hidden layer threshold, n is the number of neurons in the hidden layer, and f1 is the hidden layer activation function:

[0108]

[0109] In one possible implementation, the output layer operator includes:

[0110]

[0111] Where k = 1, 2, ..., m; m is the number of output hidden layers, O is the natural gas compression factor, ω jk is the second connection weight between the hidden layer and the output layer, b jk is the output layer threshold, and f2 is the output layer function: f2(x)=x.

[0112] In one possible implementation, the second processing module is specifically used to input the sample input of the training sample into the initial neural network model to obtain the natural gas compression factor actually output by the initial neural network model; perform error calculation based on the natural gas compression factor actually output by the initial neural network model and the sample output of the training sample to obtain an error calculation result; when the error calculation result is greater than a preset error value, update the first connection weight, the second connection weight, the hidden layer threshold, and the output layer threshold of the initial neural network model based on the error calculation result, and continue to use the training sample to calculate the initial neural network model; when the error calculation result is less than or equal to the preset error value, use the test sample to test the initial neural network model; when the test passes, use the initial neural network model as a trained high hydrogen sulfide natural gas compression factor prediction model.

[0113] In a possible implementation, the second processing module is specifically used to perform error calculation according to the actual output of the initial neural network model and the sample output of the training sample using the following formula to obtain an error calculation result:

[0114] e k =Y k -O k ;

[0115] Where k = 1, 2, ..., m; e k is the error calculation result, Y k is the sample output, O k is the natural gas compression factor actually output by the initial neural network model.

[0116] In a possible implementation, the second processing module is specifically configured to update the second connection weight of the initial neural network model according to the error calculation result using the following formula:

[0117] ω′ jk =ω jk +ηH j e k

[0118] Where j = 1, 2, ... l, k = 1, 2, ..., m, η is the learning rate, ω′ jkis the updated second connection weight;

[0119] The following formula is used to update the first connection weight of the initial neural network model according to the error calculation result:

[0120]

[0121] Among them, i=1,2,…n, j=1,2,…,l,ω′ ij is the updated first connection weight, and x(i) is the input characteristic value obtained according to the natural gas operating temperature and the natural gas operating pressure.

[0122] In a possible implementation, the second processing module is specifically configured to update the hidden layer threshold of the initial neural network model according to the error calculation result using the following formula:

[0123]

[0124] Where i = 1, 2, ... n, j = 1, 2, ..., l, b' ij is the updated hidden layer threshold;

[0125] The following formula is used to update the output layer threshold of the initial neural network model according to the error calculation results:

[0126] b′ jk =b jk +e k

[0127] Where j = 1, 2, ... l, k = 1, 2, ..., m, b' jk is the updated output layer threshold.

[0128] Based on the above invention concept, Figure 8 As shown, the present invention also proposes a computer device 800, including a memory 810, a processor 820, and a computer program 830 stored in the memory 810 and executable on the processor 820, wherein the processor 820 implements the aforementioned method for determining the compression factor of high hydrogen sulfide content natural gas when executing the computer program 830.

[0129] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the compression factor of natural gas with a high hydrogen sulfide content is implemented.

[0130] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for determining the compression factor of natural gas with high hydrogen sulfide content is implemented.

[0131] In the embodiment of the present invention, the operating temperature and operating pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be measured are obtained; the operating temperature and operating pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be measured are input into a pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model to obtain the high hydrogen sulfide-containing natural gas compression factor corresponding to the wellhead to be measured; wherein the high hydrogen sulfide-containing natural gas compression factor prediction model is trained based on the historical sour natural gas compression factor and the historical sour natural gas operating temperature and historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor. In this way, the high hydrogen sulfide-containing natural gas compression factor can be directly calculated based on the data sampled on site through the pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model, eliminating the influence of time lag on the measurement accuracy, improving the volume flow measurement accuracy, and improving the operational safety during the calculation process.

[0132] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0133] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0134] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0135] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0136] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for determining the compression factor of natural gas with high hydrogen sulfide content, It is characterized in that include: Obtaining the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be measured and the operating pressure of the high hydrogen sulfide-containing natural gas; The operating temperature and pressure of the high hydrogen sulfide-containing natural gas at the wellhead to be metered are input into a pre-trained high hydrogen sulfide-containing natural gas compression factor prediction model to obtain the high hydrogen sulfide-containing natural gas compression factor corresponding to the wellhead to be metered; The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

2. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 1, It is characterized in that Before obtaining the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be measured and the operating pressure of the high hydrogen sulfide-containing natural gas, the following steps are also included: Obtaining historical sour natural gas compression factors, historical sour natural gas operating temperatures corresponding to the historical sour natural gas compression factors, and historical sour natural gas operating pressures; Generate a sample set according to the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure; Take the natural gas operating temperature and natural gas operating pressure as input and the natural gas compression factor as output to build the initial neural network model; The sample set is used to train the initial neural network model to obtain a trained prediction model for the compression factor of natural gas with high hydrogen sulfide content.

3. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 2, It is characterized in that A sample set is generated according to the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure, including: The historical sour natural gas operating temperature and the historical sour natural gas operating pressure corresponding to the historical sour natural gas compression factor are used as sample inputs, and the historical sour natural gas compression factor is used as sample output to generate multiple samples; Divide the generated multiple samples into training samples and test samples according to a preset ratio; The sample set is formed according to the training samples and the test samples.

4. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 2, It is characterized in that The initial neural network model includes: input layer, hidden layer, and output layer; Taking the natural gas operating temperature and natural gas operating pressure as input and the natural gas compression factor as output, an initial neural network model is built, including: Take the natural gas operating temperature and natural gas operating pressure as input, and configure the number of input layer neurons according to the input; Take the natural gas compression factor as output and configure the number of neurons in the output layer according to the output; The number of hidden layers, the first connection weight between the input layer and the hidden layer, the second connection weight between the hidden layer and the output layer, the hidden layer threshold, the output layer threshold, the learning rate, and the activation function are configured to obtain an initial neural network model.

5. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 4, It is characterized in that The hidden layer operators include: Where, j = 1, 2, …, l; l is the number of input hidden layers, x is the characteristic value obtained by combining the natural gas operating temperature and the natural gas operating pressure, H is the hidden layer output variable, ω ij is the first connection weight between the input layer and the hidden layer, b ij is the hidden layer threshold, n is the number of neurons in the hidden layer, f 1 Is the hidden layer activation function:

6. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 5, It is characterized in that The output layer operators include: Where k = 1, 2, ..., m; m is the number of output hidden layers, O is the natural gas compression factor, ω jk is the second connection weight between the hidden layer and the output layer, b jk is the output layer threshold, f 2 is the output layer function: f 2 (x) = x.

7. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 6, It is characterized in that The sample set is used to train the initial neural network model, and the trained high hydrogen sulfide natural gas compression factor prediction model is obtained, including: Input the sample input of the training sample into the initial neural network model to obtain the natural gas compression factor actually output by the initial neural network model; According to the natural gas compression factor actually output by the initial neural network model and the sample output of the training sample, an error calculation is performed to obtain an error calculation result; When the error calculation result is greater than the preset error value, after updating the first connection weight, the second connection weight, the hidden layer threshold, and the output layer threshold of the initial neural network model according to the error calculation result, the initial neural network model is continued to be calculated using the training sample; When the error calculation result is less than or equal to the preset error value, the initial neural network model is tested using the test sample; When the test passes, the initial neural network model is used as the trained high hydrogen sulfide natural gas compression factor prediction model.

8. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 7, It is characterized in that According to the actual output of the initial neural network model and the sample output of the training sample, the error calculation is performed to obtain the error calculation results, including: The following formula is used to calculate the error based on the actual output of the initial neural network model and the sample output of the training sample to obtain the error calculation result: and k =And k -EITHER k ; Where k = 1, 2, ..., m; e k is the error calculation result, Y k is the sample output, O k is the natural gas compression factor actually output by the initial neural network model.

9. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 8, It is characterized in that According to the error calculation result, updating the first connection weight and the second connection weight of the initial neural network model includes: The following formula is used to update the second connection weight of the initial neural network model according to the error calculation result: oh' jk =ω jk +ηH j e k Where j = 1, 2, ... l, k = 1, 2, ..., m, η is the learning rate, ω′ jk is the updated second connection weight; The following formula is used to update the first connection weight of the initial neural network model according to the error calculation result: Where i = 1, 2, ... n, j = 1, 2, ..., lω′ ij is the updated first connection weight, and x(i) is the input characteristic value obtained according to the natural gas operating temperature and the natural gas operating pressure.

10. The method for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 9, It is characterized in that According to the error calculation results, the hidden layer threshold and output layer threshold of the initial neural network model are updated, including: The following formula is used to update the hidden layer threshold of the initial neural network model according to the error calculation results: Where i = 1, 2, ... n, j = 1, 2, ..., l ... b' ij is the updated hidden layer threshold; The following formula is used to update the output layer threshold of the initial neural network model according to the error calculation results: b′ jk =b jk +e k Where j = 1, 2, ... l, k = 1, 2, ..., m, b' jk is the updated output layer threshold.

11. A device for determining the compression factor of natural gas with high hydrogen sulfide content, It is characterized in that include: An acquisition module, used to acquire the operating temperature of the high hydrogen sulfide-containing natural gas at the wellhead to be measured, and the operating pressure of the high hydrogen sulfide-containing natural gas; The first processing module is used to input the operating temperature of the high hydrogen sulfide natural gas and the operating pressure of the high hydrogen sulfide natural gas at the wellhead to be measured into a pre-trained high hydrogen sulfide natural gas compression factor prediction model to obtain the high hydrogen sulfide natural gas compression factor corresponding to the wellhead to be measured; The high hydrogen sulfide natural gas compression factor prediction model is obtained by training based on the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure.

12. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 11, It is characterized in that Also includes: The second processing module is used to obtain the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure; Generate a sample set according to the historical sour natural gas compression factor, the historical sour natural gas operating temperature corresponding to the historical sour natural gas compression factor, and the historical sour natural gas operating pressure; Take the natural gas operating temperature and natural gas operating pressure as input and the natural gas compression factor as output to build the initial neural network model; The sample set is used to train the initial neural network model to obtain a trained prediction model for the compression factor of natural gas with high hydrogen sulfide content.

13. The device for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 12, It is characterized in that The initial neural network model includes: input layer, hidden layer, and output layer; The second processing module is specifically used to take the natural gas operating temperature and the natural gas operating pressure as inputs, and configure the number of input layer neurons according to the inputs; Take the natural gas compression factor as output and configure the number of neurons in the output layer according to the output; The number of hidden layers, the first connection weight between the input layer and the hidden layer, the second connection weight between the hidden layer and the output layer, the hidden layer threshold, the output layer threshold, the learning rate, and the activation function are configured to obtain an initial neural network model.

14. The device for determining the compression factor of natural gas with high hydrogen sulfide content according to claim 13, It is characterized in that The hidden layer operators include: Where, j = 1, 2, …, l; l is the number of input hidden layers, x is the characteristic value obtained by combining the natural gas operating temperature and the natural gas operating pressure, H is the hidden layer output variable, ω ij is the first connection weight between the input layer and the hidden layer, b ij is the hidden layer threshold, n is the number of neurons in the hidden layer, f 1 Is the hidden layer activation function:

15. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 14, It is characterized in that The output layer operators include: Where k = 1, 2, ..., m; m is the number of output hidden layers, O is the natural gas compression factor, ω jk is the second connection weight between the hidden layer and the output layer, b jk is the output layer threshold, f 2 is the output layer function: f 2 (x) = x.

16. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 15, It is characterized in that The second processing module is specifically used to input the sample input of the training sample into the initial neural network model to obtain the natural gas compression factor actually output by the initial neural network model; According to the natural gas compression factor actually output by the initial neural network model and the sample output of the training sample, an error calculation is performed to obtain an error calculation result; When the error calculation result is greater than the preset error value, after updating the first connection weight, the second connection weight, the hidden layer threshold, and the output layer threshold of the initial neural network model according to the error calculation result, the initial neural network model is continued to be calculated using the training sample; When the error calculation result is less than or equal to the preset error value, the initial neural network model is tested using the test sample; When the test passes, the initial neural network model is used as the trained high hydrogen sulfide natural gas compression factor prediction model.

17. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 16, It is characterized in that The second processing module is specifically used to perform error calculation according to the actual output of the initial neural network model and the sample output of the training sample using the following formula to obtain the error calculation result: and k =And k -EITHER k ; Where k = 1, 2, ..., m; e k is the error calculation result, Y k is the sample output, O k is the natural gas compression factor actually output by the initial neural network model.

18. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 17, It is characterized in that The second processing module is specifically used to update the second connection weight of the initial neural network model according to the error calculation result using the following formula: oh' jk =ω jk +ηH j e k Where j = 1, 2, ... l, k = 1, 2, ..., m, η is the learning rate, ω′ jk is the updated second connection weight; The following formula is used to update the first connection weight of the initial neural network model according to the error calculation result: Among them, i=1,2,…n, j=1,2,…,l,ω′ ij is the updated first connection weight, and x(i) is the input characteristic value obtained according to the natural gas operating temperature and the natural gas operating pressure.

19. The device for determining the compression factor of natural gas containing high hydrogen sulfide content according to claim 18, It is characterized in that The second processing module is specifically used to update the hidden layer threshold of the initial neural network model according to the error calculation result using the following formula: Where i = 1, 2, ... n, j = 1, 2, ..., l, b' ij is the updated hidden layer threshold; The following formula is used to update the output layer threshold of the initial neural network model according to the error calculation results: b′ jk =b jk +e k Where, j = 1, 2, ... lk = 1, 2, ..., m, b′ jk is the updated output layer threshold.

20. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.

21. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

22. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.