A method, system and storage medium for calculating mass flux at a gas pipeline leakage point

The gradient descent method is used to iteratively calculate the gas flow Mach number, which solves the problems of long calculation time and large error of gas leakage mass flux at gas pipeline breaks in the traditional method, achieves more efficient and accurate calculations, and reduces costs and human involvement. risk.

CN112632872BActive Publication Date: 2024-09-06ZHEJIANG AEROSPACE HENGJIA DATA TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011625634.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2024-09-06
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

When traditional methods are used to calculate gas leakage mass flux at gas pipeline breaks, they take a long time, have large errors, and rely on manual estimation, which increases uncertainty and labor costs.

Method used

The gradient descent method is used to iteratively calculate the gas flow Mach number. By defining the loss function and the gradient function, the gas flow Mach number is automatically adjusted until the gas flow Mach number determination equation is satisfied, thereby calculating the gas mass flux at the break of the gas transportation pipeline.

Benefits of technology

It improves the accuracy and efficiency of gas leakage mass flux calculation, reduces equipment and labor costs, and reduces reliance on manual experience and potential dangers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112632872B
    Figure CN112632872B
Patent Text Reader

Abstract

The invention relates to a method, system and storage medium for calculating the mass flux at a gas pipeline leakage point. The method comprises the following steps: selecting a corresponding gas flow Mach number determination equation according to a gas flow scene in a gas transmission pipeline, and defining a loss function for calculating the gas flow Mach number at a pipeline fracture according to the gas flow Mach number determination equation; based on the loss function, using a gradient descent method to iteratively calculate the gas flow Mach number at the gas pipeline fracture point until the gas flow Mach number determination equation is established, and using the gas flow Mach number that makes the gas flow Mach number determination equation established as the optimal value of the gas flow Mach number at the gas transmission pipeline fracture point; and calculating the gas mass flux when the gas transmission pipeline fractures according to the optimal value. The invention can more efficiently and safely calculate the gas leakage mass flux at the pipeline fracture point, reduce dependence on manual experience, and reduce the potential danger of personnel directly participating in the assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of mass flux calculation at a pipeline leakage point, and in particular to a mass flux calculation method, system and storage medium at a gas pipeline leakage point. Background Art

[0002] At present, pipeline transportation is the most effective way to transport gas and liquid. Taking adiabatic stable flow as an example, the flow of gas and steam in pipelines in engineering can be regarded as stable flow. In order to simplify the device, it can be considered that the various thermal parameters and thermodynamic parameters on any cross section perpendicular to the pipeline axis are the same, and the gas parameters only change along the pipeline axis (the direction of airflow), which is called one-dimensional stable flow. In addition, the flow time of gas in the nozzle or diffuser is short, and there is almost no heat exchange with the outside world, which can be considered as adiabatic flow. Therefore, the flow of gas in the nozzle or diffuser is adiabatic stable flow. However, pipeline transportation often has long spans and is installed in concealed areas, which means that when a gas transmission pipeline breaks due to an accident or human factors, assessing the mass of gas or liquid leakage is a huge workload. Traditional calculations of the gas leakage mass flux at the pipeline break are all done through manual evaluation, and the algorithms used are mostly trial positioning methods or direct solution of equations. The trial positioning method is a method of calculating unknown quantities, making one or some estimates in advance, and each value selection depends on manual selection. This method increases the uncertainty of the gas flow Mach number determination equation, making the mass flux calculation process at the gas transmission pipeline break time long and error-prone. Summary of the invention

[0003] The technical problem to be solved by the present invention is to calculate the mass flux of gas leakage at the pipeline break more efficiently and safely, and provide a method, system, computer and storage medium for calculating the mass flux at the gas pipeline leakage point.

[0004] In one aspect, the present invention provides a method for calculating the mass flux at a gas pipeline leakage point, comprising the following steps:

[0005] Selecting a corresponding gas flow Mach number determination equation according to the flow scenario of the gas in the gas transmission pipeline, and defining a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation;

[0006] Based on the loss function, a gradient descent method is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture;

[0007] The gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break.

[0008] The beneficial effects of the present invention are as follows: the method of the present invention reduces the equipment requirements in the process of evaluating the gas leakage mass flux at the fracture of the gas transmission pipeline when the pipeline is broken, reduces the evaluation cost, abandons the traditional trial position method or direct solution of the equation, and adopts an iterative method to calculate the gas flow Mach number at the fracture of the gas transmission pipeline, thereby improving the accuracy and efficiency of the calculation of the gas leakage mass flux at the fracture of the gas transmission pipeline. At the same time, various parameters can be automatically calculated according to the calculation method after being obtained by the sensor in real time, which is convenient and fast, reduces labor costs, reduces dependence on manual experience, and reduces the potential dangers of personnel directly participating in the evaluation.

[0009] Further, based on the loss function, the Mach number of the gas flow at the gas pipeline rupture is iteratively calculated using the gradient descent method, which specifically includes the following steps:

[0010] Calculate the gradient function of the Mach number of the gas flow at the gas transmission pipeline rupture according to the loss function;

[0011] Based on the gradient function, the gradient value of the gas flow Mach number is calculated according to the basic data and real-time data of the gas delivery pipeline;

[0012] The gas flow Mach number at the gas delivery pipeline rupture is iteratively adjusted according to the gradient value combined with the step size.

[0013] The beneficial effect of adopting the above further solution is that the use of the gradient function can more conveniently and accurately calculate the gas flow Mach number.

[0014] Furthermore, the flow scenario of the gas in the gas delivery pipeline includes a gas adiabatic flow scenario and a gas isothermal flow scenario;

[0015] When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas adiabatic flow equation, and the gas adiabatic flow equation is,

[0016]

[0017] When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas isothermal flow equation, and the gas isothermal flow equation is,

[0018] Where m is the gas flow Mach number; γ is the gas adiabatic index; d is the inner diameter of the pipe; L is the length of the pipe from the initial point of gas flow to the leak; f is the Fanning friction coefficient, and

[0019]

[0020] Where ε is the roughness coefficient of the net pipeline.

[0021] Furthermore, a loss function for calculating the Mach number of gas flow at the pipeline fracture is defined according to the gas flow Mach number determination equation, specifically,

[0022] When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the gas flow Mach number in the gas adiabatic flow equation is defined as an unknown number, a variant of the gas adiabatic flow equation is obtained, and the loss function is constructed according to the variant of the gas adiabatic flow equation;

[0023] Among them, the variant form of the gas adiabatic flow equation is expressed as,

[0024]

[0025] The loss function is expressed as,

[0026]

[0027] When the flow scenario of the gas in the gas transmission pipeline is a gas isothermal flow scenario, the gas flow Mach number in the gas isothermal flow equation is defined as an unknown number, a variant of the gas isothermal flow equation is obtained, and the loss function is constructed according to the variant of the gas isothermal flow equation;

[0028] Among them, the variant form of the gas isothermal flow equation is expressed as,

[0029]

[0030] The loss function is expressed as

[0031]

[0032] The beneficial effect of adopting the above further scheme is to distinguish the flow scene types in the gas transmission pipeline and use different gas flow equations to define the loss function, so that the calculation results are more accurate and scientific.

[0033] Furthermore, the gradient function is expressed as,

[0034]

[0035] The gradient value is expressed as,

[0036]

[0037] Further, the gas flow Mach number at the gas transmission pipeline rupture is iteratively adjusted according to the gradient value combined with the step size, specifically including the following steps:

[0038] Determine the increment of the gas flow Mach number at the nth iteration according to the gradient value combined with the step size iteration;

[0039] The increment of the gas flow Mach number at the nth iteration is expressed as,

[0040]

[0041] Where n represents the number of iterations, and m(n) is the gas flow Mach number at the nth iteration;

[0042] Calculate the gas flow Mach number at the n+1th iteration according to the increment of the gas flow Mach number at the nth iteration;

[0043] The Mach number of the gas flow at the n+1th iteration is expressed as,

[0044] m(n+1)=m(n)+Δm(n). (8)

[0045] The beneficial effect of adopting the above further scheme is that each increment is calculated according to the gradient function and the gradient value, and multiple iterations are performed to obtain the optimal value of the gas flow Mach number.

[0046] Further, the gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break, which specifically includes the following steps:

[0047] When the gas flow scenario in the gas transmission pipeline is a gas adiabatic flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is:

[0048] Wherein, G is the mass flux, P is the gas pressure at the gas pipeline fracture, T is the gas temperature at the gas pipeline fracture, R is the ideal gas constant, M is the relative molecular weight of the leaking gas, and γ is the gas adiabatic index; and

[0049]

[0050]

[0051] Wherein, P1 represents the upstream gas pressure, m is the gas flow Mach number, and T1 represents the upstream gas temperature;

[0052] When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is:

[0053]

[0054] Wherein, G is the mass flux, P is the gas pressure at the gas pipeline fracture, T is the gas temperature at the gas pipeline fracture, R is the ideal gas constant; M is the relative molecular weight of the leaking gas; and

[0055]

[0056]

[0057] Among them, P1 represents the upstream gas pressure, m is the gas flow Mach number, γ is the gas adiabatic index, and T1 represents the upstream gas temperature.

[0058] The beneficial effect of adopting the above further scheme is that the flow scene types in the gas transmission pipeline are distinguished, and different formulas are used to calculate the gas mass flux when the gas transmission pipeline is broken, and the calculation results are more accurate and scientific.

[0059] In a second aspect, the present invention provides a gas pipeline leakage mass flux calculation system, comprising the following modules:

[0060] A loss function definition module, which is used to select a corresponding gas flow Mach number determination equation according to the gas flow scenario in the gas transmission pipeline, and define a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation;

[0061] A gradient descent method iteration module, which is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture by using the gradient descent method based on the loss function until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture;

[0062] The gas mass flux calculation module is used to calculate the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break.

[0063] The beneficial effects of the present invention are as follows: the method of the present invention reduces the equipment requirements in the process of evaluating the gas leakage mass flux at the fracture of the gas transmission pipeline when the pipeline is broken, reduces the evaluation cost, abandons the traditional trial position method or direct solution of the equation, and adopts an iterative method to calculate the gas flow Mach number at the fracture of the gas transmission pipeline, thereby improving the accuracy and efficiency of the calculation of the gas leakage mass flux at the fracture of the gas transmission pipeline. At the same time, various parameters can be automatically calculated according to the calculation method after being obtained by the sensor in real time, which is convenient and fast, reduces labor costs, reduces dependence on manual experience, and reduces the potential dangers of personnel directly participating in the evaluation.

[0064] In a third aspect, the present invention provides a computer comprising a processor and a memory, wherein the memory stores at least one computer instruction, and when the computer instruction is executed by the processor, a method for calculating mass flux at a gas pipeline leakage point as described in any one of claims 1 to 7 is implemented.

[0065] In a fourth aspect, the present invention provides a computer storage medium, including a memory, wherein the memory stores at least one instruction, and when the instruction is executed, a method for calculating the mass flux at a gas pipeline leakage point as described in any one of claims 1-7 is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 is a flow chart of the method of the present invention;

[0067] Figure 2 This is a system module structure diagram of the present invention. DETAILED DESCRIPTION

[0068] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0069] First aspect:

[0070] like Figure 1 As shown, a method for calculating the mass flux at a gas pipeline leakage point includes the following steps:

[0071] Selecting a corresponding gas flow Mach number determination equation according to the flow scenario of the gas in the gas transmission pipeline, and defining a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation;

[0072] Based on the loss function, a gradient descent method is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture;

[0073] The gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break.

[0074] The mass of a component passing through a unit area perpendicular to the mass transfer direction per unit time is called mass flux; a function that maps the value of a random event or its related random variables to a non-negative real number to represent the "risk" or "loss" of the random event, usually used to estimate the gap between the calculated value and the true value; the gradient descent method is a method for solving extreme values, that is, the calculation process is to solve the minimum value in the direction of gradient descent or the maximum value in the direction of gradient ascent.

[0075] The working principle of the method of the present invention is:

[0076] Assuming that a gas transmission pipeline rupture accident occurs, it is determined whether the gas flow scene is isothermal flow or adiabatic flow, and a loss function for calculating the gas flow Mach number at the pipeline rupture is defined according to the gas flow Mach number determination equation;

[0077] Taking the inlet of the gas transmission pipeline as the initial state, the data required by formula (2) or (4) is obtained from the business static database and the real-time database;

[0078] Taking the initial state Mach number m(0)=1, calculating the loss value of the loss function formula (2) or (4) according to the data, judging whether the loss value is within an acceptable range, that is, until the gas flow Mach number determination equation is established, if so, stopping the iteration, otherwise calculating the gas flow Mach number m(n+1) used in the next iteration according to formulas (6)-(8), until the loss value of formula (2) or (4) is within an acceptable range;

[0079] The mass flux when a rupture accident occurs in the gas transmission pipeline is calculated according to equation (9) or (10) combined with the iteratively obtained gas flow Mach number.

[0080] The loss function is a function that maps the value of a random event or its related random variables to a non-negative real number to represent the "risk" or "loss" of the random event. It is usually used to estimate the gap between the calculated value and the true value.

[0081] The gradient descent method is a method for solving extreme values, that is, the calculation process is to solve the minimum value in the direction of gradient descent or the maximum value in the direction of gradient ascent.

[0082] Based on the loss function, the specific steps of iteratively calculating the Mach number of the gas flow at the gas pipeline fracture using the gradient descent method are as follows:

[0083] Calculate the gradient function of the Mach number of the gas flow at the gas transmission pipeline rupture according to the loss function;

[0084] Based on the gradient function, the gradient value of the gas flow Mach number is calculated according to the basic data and real-time data of the gas delivery pipeline;

[0085] The gas flow Mach number at the gas delivery pipeline rupture is iteratively adjusted according to the gradient value combined with the step size.

[0086] The method of the present invention will first analyze the flow scenario of the gas in the gas transmission pipeline according to the existing data before processing and calculating, including the gas adiabatic flow scenario and the gas isothermal flow scenario;

[0087] Taking adiabatic stable flow as an example, the flow of gas and steam in a pipeline in engineering can be regarded as stable flow. In order to simplify the device, it can be considered that the various thermal parameters and thermodynamic parameters on any cross section perpendicular to the pipeline axis are the same, and the gas parameters only change along the pipeline axis (the direction of airflow), which is called one-dimensional stable flow. In addition, the flow time of the gas in the nozzle or diffuser is short, and there is almost no heat exchange with the outside world, which can be considered as adiabatic flow. Therefore, the flow of gas in the nozzle or diffuser is adiabatic stable flow.

[0088] There are three basic equations for studying the one-dimensional steady flow of gas and steam, namely the continuity equation, the adiabatic steady flow energy equation and the constant entropy process equation. The continuity equation is that in a one-dimensional steady flow channel, take sections 1 to n, and according to the law of conservation of mass, a basic relationship can be derived. The parameters at any fixed point in the steady flow channel do not change with time, and the mass flow rate at each section is equal. That is, q1 = q2 = ... = qn = ACf / v = constant, where q is the mass flow rate at the section, in kg / s, A is the cross-sectional area at each section, in m2, Cf is the gas flow rate at the section, in m / s, and v is the gas specific volume at the section, in m3 / s. For the infinitesimal steady flow process, differentiation can be obtained, dCf / Cf+dA / A-dv / v=0, which is applicable to the reversible and irreversible steady flow process of any working fluid. Among them, the adiabatic steady flow energy equation, from the law of conservation of energy, we know that the steady flow of gas and steam must conform to the steady flow energy equation, that is, q = (h2-h1) + 1 / 2 (C2f2-C2f1) + g (Z2-Z1) + Ws; when gas and steam flow in the pipeline, in general, Z1 ~ Z2, Ws ~ 0, in adiabatic flow, q = 0, for the infinitesimal adiabatic steady flow process, it can be written as,

[0089] cfdcf=-dh;

[0090] It shows that the increase in kinetic energy of gas and steam during adiabatic stable flow is equal to the decrease in enthalpy. It is applicable to any reversible and irreversible adiabatic stable flow process of any working fluid. For the constant entropy process equation, the adiabatic flow process of gas in the pipeline, if it is reversible, is a constant entropy process. The change in the state parameters of the gas conforms to the ideal gas constant entropy process equation, that is,

[0091] Pvk = fixed value;

[0092] For the infinitesimal reversible adiabatic flow process, it can be written as The above is applicable to the reversible adiabatic flow process of an ideal gas with a constant specific heat capacity. The changes in the state parameters of steam in a constant entropy process can be found through a steam chart.

[0093] From these laws, the gas flow equations under different flow environments can be deduced, specifically,

[0094] When the gas flow scenario in the gas transmission pipeline is a gas adiabatic flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas adiabatic flow equation, which is,

[0095]

[0096] When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas isothermal flow equation, and the gas isothermal flow equation is,

[0097]

[0098] Where:

[0099] m is the Mach number of gas flow, which indicates the multiple of the speed of sound. It is generally called the Mach number in physics and is a dimensionless number. γ is the gas adiabatic index. d is the inner diameter of the pipeline, in meters. L is the length of the pipeline from the initial point of gas flow to the leakage point, in meters. f is the Fanning friction coefficient, which is taken as

[0100]

[0101] Where ε is the roughness coefficient of the net pipeline.

[0102] The gas flow Mach number determination equation is determined according to different gas flow scenarios, and then a loss function for calculating the gas flow Mach number at the pipeline fracture is defined, specifically,

[0103] When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the gas flow Mach number in the gas adiabatic flow equation is defined as an unknown number, a variant of the gas adiabatic flow equation is obtained, and the loss function is constructed according to the variant of the gas adiabatic flow equation;

[0104] Among them, the variant form of the gas adiabatic flow equation is expressed as,

[0105]

[0106] The loss function is expressed as,

[0107]

[0108] When the flow scenario of the gas in the gas transmission pipeline is a gas isothermal flow scenario, the gas flow Mach number in the gas isothermal flow equation is defined as an unknown number, a variant of the gas isothermal flow equation is obtained, and the loss function is constructed according to the variant of the gas isothermal flow equation;

[0109] Among them, the variant form of the gas isothermal flow equation is expressed as,

[0110]

[0111] The loss function is expressed as,

[0112]

[0113] The gradient function can be expressed as,

[0114]

[0115] According to the gradient function (4), the gradient value is expressed as:

[0116]

[0117] The gas flow Mach number at the gas transmission pipeline rupture is iteratively adjusted according to the gradient value combined with the step length, specifically comprising the following steps:

[0118] Determine the increment of the gas flow Mach number at the nth iteration according to the gradient value combined with the step size iteration;

[0119] The increment of the gas flow Mach number at the nth iteration is expressed as,

[0120]

[0121] Where n represents the number of iterations, and m(n) is the gas flow Mach number at the nth iteration;

[0122] Calculate the gas flow Mach number at the n+1th iteration according to the increment of the gas flow Mach number at the nth iteration;

[0123] The Mach number of the gas flow at the n+1th iteration is expressed as,

[0124] m(n+1)=m(n)+Δm(n). (8)

[0125] The mass of a component passing through a unit area perpendicular to the mass transfer direction per unit time is called mass flux.

[0126] The gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break, which specifically includes the following steps:

[0127] When the gas flow scenario in the gas transmission pipeline is a gas adiabatic flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is:

[0128]

[0129] Wherein, G is the mass flux, P is the gas pressure at the gas pipeline fracture, T is the gas temperature at the gas pipeline fracture, R is the ideal gas constant, M is the relative molecular weight of the leaking gas, and γ is the gas adiabatic index; and

[0130]

[0131]

[0132] Wherein, P1 represents the upstream gas pressure, unit: Pa; m is the gas flow Mach number; T1 represents the upstream gas temperature, unit; K;

[0133] When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is:

[0134]

[0135] Among them, G is the mass flux, P is the gas pressure at the fracture of the gas transmission pipeline, T is the gas temperature at the fracture of the gas transmission pipeline, R is the ideal gas constant, and M is the relative molecular weight of the leaking gas;

[0136] and

[0137]

[0138]

[0139] Wherein, P1 represents the upstream gas pressure, unit: Pa; m is the gas flow Mach number; γ is the gas adiabatic index; T1 represents the upstream gas temperature.

[0140] The present invention constructs a static database for storing basic data of a target monitoring pipeline and a real-time database when a gas transmission pipeline breaks and leaks, and calculates the gas mass flux at the fractured portion of the pipeline when the gas pipeline breaks by combining data with an algorithm model; establishes a loss function for calculating the Mach number of the gas flow at the fractured portion of the pipeline according to a Mach number determination equation of the gas in adiabatic flow or isothermal flow in the gas transmission pipeline; calculates a gradient function about the Mach number of the gas flow at the fractured portion of the gas transmission pipeline according to the loss function, and calculates a gradient value based on data stored in the static database and the real-time database; iteratively adjusts the value of the gas flow Mach number at the fractured portion of the gas transmission pipeline according to the gradient value combined with the step size, so that the loss function value approaches 0, and obtains the optimal value of the gas flow Mach number at the fractured portion of the gas transmission pipeline; and calculates the gas mass flux when the gas transmission pipeline breaks according to the optimal value of the gas flow Mach number at the fractured portion of the pipeline.

[0141] The beneficial effect of the present invention is that the method of the present invention reduces the equipment requirements in the process of evaluating the gas leakage mass flux at the fracture of the gas transmission pipeline when the pipeline is broken, reduces the evaluation cost, abandons the traditional trial position method or direct solution of the equation, and adopts an iterative method to calculate the gas flow Mach number at the fracture of the gas transmission pipeline, thereby improving the accuracy and efficiency of the calculation of the gas leakage mass flux at the fracture of the gas transmission pipeline. At the same time, various parameters can be automatically calculated according to the calculation method after being obtained by the sensor in real time, which is convenient and fast, reduces labor costs, reduces dependence on manual experience, and reduces the potential dangers of personnel directly participating in the evaluation.

[0142] Second,

[0143] like Figure 2 As shown, a gas pipeline leakage mass flux calculation system includes the following modules:

[0144] A loss function definition module, which is used to select a corresponding gas flow Mach number determination equation according to the gas flow scenario in the gas transmission pipeline, and define a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation;

[0145] A gradient descent method iteration module, which is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture by using the gradient descent method based on the loss function until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture;

[0146] The gas mass flux calculation module is used to calculate the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break.

[0147] The beneficial effect is that the system of the present invention reduces the equipment requirements in the process of evaluating the gas leakage mass flux at the fracture of the gas transmission pipeline when the pipeline is broken, reduces the evaluation cost, abandons the traditional trial position method or direct solution of the equation, and adopts an iterative method to calculate the gas flow Mach number at the fracture of the gas transmission pipeline, thereby improving the accuracy and efficiency of the calculation of the gas leakage mass flux at the fracture of the gas transmission pipeline. At the same time, various parameters can be obtained by sensors in real time and then automatically calculated according to the calculation method, which is convenient and fast, reduces labor costs, reduces dependence on manual experience, and reduces the potential dangers of personnel directly participating in the evaluation.

[0148] In a third aspect, the present invention provides a computer, comprising a processor and a memory, wherein the memory stores at least one computer instruction, and when the computer instruction is executed by the processor, a method for calculating mass flux at a gas pipeline leakage point as described above is implemented.

[0149] The beneficial effect is that the computer of the present invention reduces the equipment requirements in the process of evaluating the gas leakage mass flux at the fracture of the gas transmission pipeline when the pipeline is broken, reduces the evaluation cost, abandons the traditional trial position method or direct solution of the equation, and adopts an iterative method to calculate the gas flow Mach number at the fracture of the gas transmission pipeline, thereby improving the accuracy and efficiency of the calculation of the gas leakage mass flux at the fracture of the gas transmission pipeline. At the same time, various parameters can be automatically calculated according to the calculation method after being obtained by the sensor in real time, which is convenient and fast, reduces labor costs, reduces dependence on manual experience, and reduces the potential danger of personnel directly participating in the evaluation.

[0150] In a fourth aspect, the present invention provides a computer storage medium, including a memory, wherein the memory stores at least one instruction, and when the instruction is executed, the above-mentioned method for calculating the mass flux at a gas pipeline leakage point is implemented.

[0151] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for calculating mass flux at a gas pipeline leakage point, characterized in that: The following steps are included: Selecting a corresponding gas flow Mach number determination equation according to the flow scenario of the gas in the gas transmission pipeline, and defining a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation; Based on the loss function, a gradient descent method is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture; The gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break; Among them, the flow scenarios of gas in the gas transmission pipeline include gas adiabatic flow scenarios and gas isothermal flow scenarios; When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas adiabatic flow equation, and the gas adiabatic flow equation is, When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas isothermal flow equation, and the gas isothermal flow equation is, Where m is the gas flow Mach number, γ is the gas adiabatic index, d is the inner diameter of the pipeline, L is the length of the pipeline from the initial point of gas flow to the leakage point, and f is the Fanning friction coefficient; and Among them, ε is the roughness coefficient of the net pipeline; The loss function for calculating the Mach number of gas flow at the pipeline fracture is defined according to the gas flow Mach number determination equation, specifically, When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the gas flow Mach number in the gas adiabatic flow equation is defined as an unknown number, a variant of the gas adiabatic flow equation is obtained, and the loss function is constructed according to the variant of the gas adiabatic flow equation; Among them, the variant form of the gas adiabatic flow equation is expressed as, The loss function is expressed as, When the flow scenario of the gas in the gas transmission pipeline is a gas isothermal flow scenario, the gas flow Mach number in the gas isothermal flow equation is defined as an unknown number, a variant of the gas isothermal flow equation is obtained, and the loss function is constructed according to the variant of the gas isothermal flow equation; Among them, the variant form of the gas isothermal flow equation is expressed as, The loss function is expressed as, 2. A method for calculating mass flux at a gas pipeline leakage point according to claim 1, characterized in that: Based on the loss function, the gradient descent method is used to iteratively calculate the gas flow Mach number at the gas pipeline fracture, which specifically includes the following steps: Calculate the gradient function of the Mach number of the gas flow at the gas transmission pipeline rupture according to the loss function; Based on the gradient function, the gradient value of the gas flow Mach number is calculated according to the basic data and real-time data of the gas delivery pipeline; The gas flow Mach number at the gas delivery pipeline rupture is iteratively adjusted according to the gradient value combined with the step size.

3. A method for calculating mass flux at a gas pipeline leakage point according to claim 2, characterized in that: The gradient function is expressed as, The gradient value is expressed as, Where n represents the number of iterations, and m(n) is the gas flow Mach number at the nth iteration.

4. A method for calculating mass flux at a gas pipeline leakage point according to claim 3, characterized in that: The gas flow Mach number at the gas transmission pipeline rupture is iteratively adjusted according to the gradient value combined with the step length, specifically comprising the following steps: Determine the increment of the gas flow Mach number at the nth iteration according to the gradient value combined with the step size iteration; The increment of the gas flow Mach number at the nth iteration is expressed as, Where n represents the number of iterations, m(n) is the gas flow Mach number at the nth iteration, and η represents the step size; Calculate the gas flow Mach number at the n+1th iteration according to the increment of the gas flow Mach number at the nth iteration; The Mach number of the gas flow at the n+1th iteration is expressed as, m(n+1)=m(n)+Δm(n) (8).

5. A method for calculating mass flux at a gas pipeline leakage point according to any one of claims 1 to 4, characterized in that: The gas mass flux when the gas transmission pipeline is broken is calculated according to the optimal value of the gas flow Mach number at the pipeline break, which specifically includes the following steps: When the gas flow scenario in the gas transmission pipeline is a gas adiabatic flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is: Wherein, G is the mass flux, P is the gas pressure at the gas pipeline fracture, T is the gas temperature at the gas pipeline fracture, R is the ideal gas constant; M is the relative molecular weight of the leaking gas, γ is the gas adiabatic index; and Wherein, P1 represents the upstream gas pressure, m is the gas flow Mach number, and T1 represents the upstream gas temperature; When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the formula for calculating the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break is: Wherein, G is the mass flux, P is the gas pressure at the gas pipeline fracture, T is the gas temperature at the gas pipeline fracture, R is the ideal gas constant, and M is the relative molecular weight of the leaking gas; and Among them, P1 represents the upstream gas pressure, m is the gas flow Mach number, γ is the gas adiabatic index, and T1 represents the upstream gas temperature.

6. A gas pipeline leakage mass flux calculation system, characterized by: Includes the following modules, A loss function definition module, which is used to select a corresponding gas flow Mach number determination equation according to the gas flow scenario in the gas transmission pipeline, and define a loss function for calculating the gas flow Mach number at the pipeline fracture according to the gas flow Mach number determination equation; A gradient descent method iteration module, which is used to iteratively calculate the gas flow Mach number at the gas pipeline rupture by using the gradient descent method based on the loss function until the gas flow Mach number determination equation is established, and the gas flow Mach number that makes the gas flow Mach number determination equation established is used as the optimal value of the gas flow Mach number at the gas pipeline rupture; A gas mass flux calculation module, which is used to calculate the gas mass flux when the gas transmission pipeline is broken according to the optimal value of the gas flow Mach number at the pipeline break; Among them, the flow scenarios of gas in the gas transmission pipeline include gas adiabatic flow scenarios and gas isothermal flow scenarios; When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas adiabatic flow equation, and the gas adiabatic flow equation is, When the gas flow scenario in the gas transmission pipeline is a gas isothermal flow scenario, the corresponding gas flow Mach number determination equation is specifically the gas isothermal flow equation, and the gas isothermal flow equation is, Where m is the gas flow Mach number, γ is the gas adiabatic index, d is the inner diameter of the pipeline, L is the length of the pipeline from the initial point of gas flow to the leakage point, and f is the Fanning friction coefficient; and Among them, ε is the roughness coefficient of the net pipeline; The loss function for calculating the Mach number of gas flow at the pipeline fracture is defined according to the gas flow Mach number determination equation, specifically, When the flow scenario of the gas in the gas transmission pipeline is a gas adiabatic flow scenario, the gas flow Mach number in the gas adiabatic flow equation is defined as an unknown number, a variant of the gas adiabatic flow equation is obtained, and the loss function is constructed according to the variant of the gas adiabatic flow equation; Among them, the variant form of the gas adiabatic flow equation is expressed as, The loss function is expressed as, When the flow scenario of the gas in the gas transmission pipeline is a gas isothermal flow scenario, the gas flow Mach number in the gas isothermal flow equation is defined as an unknown number, a variant of the gas isothermal flow equation is obtained, and the loss function is constructed according to the variant of the gas isothermal flow equation; Among them, the variant form of the gas isothermal flow equation is expressed as, The loss function is expressed as, 7. A computer, characterized in that: It comprises a processor and a memory, wherein the memory stores at least one computer instruction, and when the computer instruction is executed by the processor, a method for calculating the mass flux at a gas pipeline leakage point as described in any one of claims 1 to 5 is implemented.

8. A computer storage medium, characterized in that: It comprises a memory, wherein at least one instruction is stored in the memory, and when the instruction is executed, a method for calculating the mass flux at a gas pipeline leakage point as described in any one of claims 1 to 5 is implemented.