Improved transient equation and data coupling long-distance oil pipeline simulation method
By improving the deep neural network method of coupling transient equations and data, the problem of monitoring blind spots in long-distance oil pipelines under transient working conditions is solved, and the accurate monitoring of pressure flow along the pipeline is achieved, which improves the safety of pipeline operation.
Patent Information
- Application Number
- CN202510216078.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-02-19
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There are monitoring blind spots in long-distance oil pipelines under transient working conditions, making it difficult to accurately monitor pressure changes along the line, increasing pipeline safety risks.
A deep neural network method that improves the coupling of transient equations and data is adopted to use real-time data and flow parameter change mechanisms at both ends of the pipeline to conduct efficient and accurate pressure flow simulation to obtain the changes in hydraulic states at each point along the pipeline.
Accurate monitoring of pressure flow at each point along the long-distance oil pipeline is achieved, reducing the workload of on-site personnel, and accurately monitoring dangerous points in blind sections, preventing high-point hollowing and low-point overpressure, and improving pipeline operation safety.
Smart Images

Figure CN120162913A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of refined oil transportation, and particularly to a long-distance oil pipeline simulation method that improves the coupling of transient equations and data. Background Art
[0002] Oil pipelines are important transportation tools for completing the spatial transfer of oil resources, and mostly adopt high-pressure closed transportation methods. Under quasi-steady state, the pressure and flow rate changes in the pipeline are relatively small, and the pressure change along the pipeline conforms to the basic hydraulic gradient law, and the calculation method is simple and reliable. However, due to the influence of operations such as station field subtransmission, pump station start-stop, and valve opening and closing, the operating conditions will change. At the same time, the oil product in the pipeline is a slightly compressible fluid, which causes severe disturbances in pressure and flow rate due to the transmission of water hammer waves in the pipeline when the operating conditions change. In severe cases, it may cause overpressure at the low points of the pipeline and underpressure gasification at the high points, affecting the safety of the pipe body.
[0003] A single pipe section of a long-distance oil pipeline stretches for dozens or even hundreds of kilometers. To effectively monitor the pressure and flow rate changes at each point along the pipeline, high-precision high-frequency sensors need to be installed to obtain monitoring results. However, due to the high cost of equipment installation, generally only instruments are installed at both ends of the pipeline, resulting in a large number of monitoring blind spots along the line, posing a major challenge to the safety of pipeline operation.
[0004] Therefore, to effectively monitor the pressure changes at each point along the pipeline under transient conditions and prevent problems such as overpressure at the low points and airification due to pulling at the high points, it is necessary to develop accurate hydraulic simulation technologies to accurately capture the pressure and flow rate changes at each point along the oil pipeline, improve the safety of pipeline operation, and ensure the stable supply of downstream oil products and the stable operation of the economic society. Summary of the Invention
[0005] In view of the above problems, the purpose of the present invention is to provide a long-distance oil pipeline simulation method that improves the coupling of transient equations and data. By using the real-time operation data at both ends of the pipeline and combining the change mechanism of flow parameters, it realizes efficient, accurate, and more reliable pressure and flow rate simulation, obtains the change of the hydraulic state at each point along the pipeline, and thus accurately monitors the dangerous points along the pipeline during transient condition changes to ensure the safe and stable operation of the pipeline.
[0006] To achieve the above purpose, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present application provides a long-distance oil pipeline simulation method that improves the coupling of transient equations and data, and the method includes:
[0008] Obtain the real-time operation data at both ends of the long-distance oil pipeline, and train a deep neural network with a preset network architecture;
[0009] Using the deep neural network, generate the input and output statistical-level mapping relationships for each point of the long-distance oil pipeline;
[0010] Based on the input and output statistical-level mapping relationships, couple with the mechanism control equations of the transient flow process inside the long-distance oil pipeline to generate a coupling loss function for further training the deep neural network;
[0011] Based on the coupling loss function and the input and output statistical-level mapping relationships, continue to train the deep neural network to obtain a complete mapping correlation between the flow parameters of the oil pipeline;
[0012] Using the obtained complete mapping correlation between the flow parameters, conduct online hydraulic simulation of the long-distance oil pipeline.
[0013] In one implementation, the deep neural network with the preset network architecture includes an input layer, a hidden layer, and an output layer;
[0014] The input layer is used to receive the input of the deep neural network, including the pipeline space and simulation time of the long-distance oil pipeline;
[0015] The hidden layer is used to perform feature extraction and calculation based on the input to generate the output of the deep neural network;
[0016] The output layer is used to output the results corresponding to the pipeline space and simulation time of the long-distance oil pipeline, including the pressure inside the pipe and the flow rate inside the pipe.
[0017] In one implementation, the mechanism control equations of the transient flow process include:
[0018]
[0019] In the formula, q is the oil flow rate inside the pipe, m 2 / s; h is the fluid head, m; f is the hydraulic friction coefficient; D is the pipe diameter, m; g is the acceleration due to gravity, 9.8 m / s 2 ; t is the flow time, s; x is the axial distance of the pipeline, m; a is the pressure wave velocity, m / s; K is the volume elastic coefficient of the oil, Pa; ρ is the density of the oil, kg / m 3 ; E is the elastic modulus of the pipe material, Pa; δ is the pipe wall thickness, m; C1 is the pipe constraint coefficient; A is the cross-sectional area of the pipeline, m 2 .
[0020] In one implementation, based on the order-of-magnitude difference between the oil flow rate inside the pipe and the fluid head, convert the oil flow rate inside the pipe to the hourly volume flow rate to obtain an equivalent transformation mechanism control equation:
[0021]
[0022] In one implementation, generating a coupled loss function for further training the deep neural network includes the following steps:
[0023] (1) Define and as the flow rate and pressure of the obtained training samples, and construct the corresponding residuals of the mechanism control equation after equivalent transformation through automatic differentiation:
[0024]
[0025] (2) Further construct the corresponding penalty function as follows:
[0026]
[0027] In the formula, and are the spatio-temporal coordinates at points inside the pipeline, and Nf is the number of paired points;
[0028] (3) The observed data at the boundary can be used to construct the corresponding data-driven constraint term as follows:
[0029]
[0030] Among them, is the pipeline coordinate at the boundary, and Ndata is the sample size of the data-driven constraint term;
[0031] (4) Assign different weights to the penalty function and the data-driven constraint term, and construct the coupled loss function of the model, which is expressed as follows:
[0032] MSE = λ data MSE data + λ Mo MSE Mo + λ Con MSE Con
[0033] {λ data ,λ Mo ,λ Con} are the weights of each item.
[0034] The hydraulic simulation method proposed by the present invention can utilize the on-site SCADA real-time operation data and combine the internal mechanism of pipeline operation to achieve accurate and reliable flow and pressure monitoring. It can not only greatly reduce the workload of on-site personnel, but also achieve accurate hydraulic monitoring of dangerous points in the blind section along the pipeline, prevent the high point from being emptied and the low point from overpressure, improve the operation safety of the oil pipeline, and ensure the normal supply of downstream oil products. Description of the Drawings
[0035] Figure 1 It is a schematic diagram of the network architecture of the DNN model provided by the embodiments of the present application;
[0036] Figure 2 It is a schematic diagram of further training a deep neural network in the embodiments of the present application;
[0037] Figure 3 It is a schematic diagram of the comparison between the predicted values and the true values of the flow rates at various points of the pipeline in an example;
[0038] Figure 4 It is the comparison between the predicted pressure and the true value at various points of the pipeline in an example. Specific embodiments
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention fall within the scope of protection of the present invention.
[0040] In view of the problems of the prior art, the embodiments of the present invention provide a long-distance oil pipeline simulation method for improving the coupling of transient equations and data, and the method includes:
[0041] Obtain the real-time operation data at both ends of the long-distance oil pipeline and train a deep neural network with a preset network architecture;
[0042] Use the deep neural network to generate the mapping relationship at the input and output statistical levels of each point of the long-distance oil pipeline;
[0043] Based on the mapping relationship at the input and output statistical levels, use the mechanism control equation of the transient flow process inside the long-distance oil pipeline for coupling to generate a coupling loss function for further training the deep neural network;
[0044] Based on the coupling loss function and the mapping relationship at the input and output statistical levels, continue to train the deep neural network to obtain a complete mapping association between the flow parameters of the oil pipeline;
[0045] Use the obtained complete mapping association between the flow parameters to carry out online hydraulic simulation of the long-distance oil pipeline.
[0046] Next, based on the accompanying drawings of the present application, the process details of the method provided by the present application will be further described in detail, and its technical effects will be illustrated based on an example.
[0047] In the embodiments of the present application, there is a complex non - linear mapping relationship between the change of pressure and flow rate in the pipeline during operation and the axial distance and operation time of the pipeline. For example, under quasi - steady state, the pressure drop along the pipeline can be calculated by the Rabinowitz formula. Under transient conditions, due to the influence of water hammer wave transmission, the pressure in the pipeline will show characteristics of continuous change over time under the influence of the propagation of pressure - increasing or pressure - decreasing waves along the axial direction of the pipeline. To initially capture the evolution law of flow parameters with respect to time and space distribution, considering that a deep neural network (DNN) can realize the mining and extraction of the change law of physical quantities in complex physical processes by stacking multiple hidden layers and has excellent non - linear fitting ability, therefore, in this section, a correlation extraction model of flow parameters based on DNN is first constructed, as Figure 1 shown.
[0048] Among them, the input of the DNN model is the spatial coordinates and simulation time of pipeline operation, and the output is the pressure and flow rate at each point of the pipeline. The process of constructing the mapping relationship between transient flow rate, pressure and spatio - temporal distribution based on DNN is shown in Equation (1):
[0049]
[0050] In the formula, σ G is the activation function of the G - th layer, h G is the output result of the G - th hidden layer, X = {x, t} is the spatio - temporal distribution matrix, is the output head and flow rate, w G , b G are the weight and bias of the G - th layer respectively. To continuously make the model solution approach the true simulation result, the DNN model updates the model parameters based on the mean square error between the predicted value and the true value, as shown in Equation (2):
[0051]
[0052] Among them, NN(X; θ) is the model predicted value, Y is the true value, and θ = {w, b} is the model learnable parameter.
[0053] Based on the DNN algorithm, a correlation model of flow parameters changing with spatio - temporal distribution is constructed. Although it can effectively extract the non - linear correlation between flow parameters and spatio - temporal distribution, during the training process, relying solely on data does not obtain effective constraints and guidance on the transient flow mechanism of the pipeline, and it is extremely easy to lead to results that do not conform to physical laws in the model. At the same time, to ensure excellent model training effects, higher requirements are placed on the quantity and quality of data. For a pipeline dozens of kilometers long, there are only observation data at both ends available for training. To accurately perform hydraulic simulation on a large number of blind sections along the pipeline through a pure data - driven model with extremely small amounts of observation data, it is difficult to ensure the accuracy and reliability of the model. Therefore, in this section, considering the internal mechanism equation followed by flow parameters during transient flow, through the automatic differentiation method, the equation is converted into a mathematical constraint term and coupled into the DNN model.
[0054] The transient flow process in pipelines follows the basic physical laws, which are derived from the laws of mass conservation and momentum conservation. The basic control equations for transient flow are as follows:
[0055]
[0056] where q is the flow rate of the oil product in the pipeline, m 2 / s; h is the fluid head, m; f is the hydraulic friction coefficient; D is the pipe diameter, m; g is the acceleration due to gravity, 9.8 m / s 2 ; t is the flow time, s; x is the axial distance of the pipeline, m; a is the pressure wave velocity, m / s; K is the volume elastic coefficient of the oil product, Pa; ρ is the density of the oil product, kg / m 3 ; E is the elastic modulus of the pipe material, Pa; δ is the pipe wall thickness, m; C1 is the pipe constraint coefficient; A is the cross-sectional area of the pipeline, m 2 .
[0057] Considering that there is a large difference in the order of magnitude between the oil product flow rate and the head in the above equation, it is easy to have the problem of "big number eating small number" during the training process. Therefore, to reduce the difference in the order of magnitude of the output variables and achieve the effective convergence of the model, the oil product flow rate is converted into the hourly volume flow rate (Q = 3600q) through transformation. In this way, the control equation becomes the following form:
[0058]
[0059] Based on this, define and as the flow rate and pressure obtained from the model simulation. Then, the residuals corresponding to the above control equations can be constructed by means of automatic differentiation:
[0060]
[0061] Therefore, the corresponding penalty function can be constructed as follows:
[0062]
[0063] where and are the spatio-temporal coordinates at the in-pipe points, and Nf is the number of paired points.
[0064] In addition, the observed data at the boundary can be used to construct the corresponding data-driven constraint terms, as follows:
[0065]
[0066] where Let the pipeline coordinates at the boundary be [coordinate value], and Ndata be the sample size of the data-driven constraint term. Based on this, the coupled loss function of the model can be expressed as follows:
[0067] MSE = λ data MSE data + λ Mo MSE Mo + λ Con MSE Con (13)
[0068] In the formula, {λ data , λ Mo , λ Con} are the weights of each loss function, which can be continuously adjusted to obtain the optimal model parameters. The Adam optimizer is selected for model training.
[0069] The schematic diagram for further training the deep neural network is Figure 2 , and the final network PINN can be obtained after completion of training.
[0070] Next, the effect of using the above network PINN will be illustrated in an example.
[0071] In an example, taking a certain oil pipeline system (including the initial station, intermediate stations, and terminal station) as an example, its corresponding SPS simulation model is constructed for testing. The basic parameters of the operating condition simulation are shown in Table 1. The boundary conditions set for the simulation are that the flow rate at the initial station is fixed, the pressure at the terminal station is constant, the sampling interval is 1 second, and the pipeline distance step division interval is 1 km.
[0072]
[0073]
[0074] Table 1
[0075] By simulating the start-up condition in the oil pipeline, the accuracy of the transient simulation along the line of the model is verified. The initial state of the start-up condition simulation is that the whole line is shut down, the pressure at the terminal station is 2.07 MPa, the density of the transported oil under standard conditions is 850 kg / m 3 , the volume elastic coefficient is 1.5×10 9 Pa, and the flow rate along the line at the end state of the condition is 154 m 3 / h. The above simulation samples are collected as simulation training and test data.
[0076] As Figure 3 and 4As shown, the start-up operation condition lasts for about 360 seconds. At the initial stage of the start-up operation condition, the flow rate along the pipeline gradually increases. Due to the pressure maintenance effect after the pipeline shutdown, the pipeline head now starts to rise from about 2 MPa, and then according to the set start-up flow rate value, the pressure drops to the value that maintains the stability of the pipeline hydraulic system corresponding to the set flow rate. By comparing the DNN model, taking the results at 5 km, 15 km, and 23 km as examples, the proposed model can better handle the fluctuations caused by the rebound of the water hammer wave and obtain more accurate simulation results.
[0077] Table 2 shows the comparison results of the prediction errors of each model under the start-up operation condition. Generally speaking, the proposed PINN model can obtain more accurate results with the lowest prediction error. Taking RMSE, MAE, and MAPE as the measurement indicators, it can be seen that this technology has a significant improvement compared with other technologies in these three indicators, which proves that the influencing factors considered by this technology from the mechanism level are more comprehensive and have prominent effects and engineering application values.
[0078] Table 2 Comparison of prediction errors of each model under the shutdown operation condition (a) Comparison of pressure prediction errors
[0079]
[0080] It can be seen that compared with the DNN algorithm, this technology has lower prediction errors for the flow rate and pressure along the pipeline, and this technology can achieve better performance than traditional deep learning models. At the same time, it highlights that by coupling mechanism constraints, more accurate and interpretable pipeline flow rate and pressure simulation results can be obtained.
[0081] The above system can be implemented in a computer device in the form of hardware or software, so that the computer device can implement The method for evaluating the remaining transportation capacity of the multi-injection-point refined oil pipeline in the embodiment of the present application, the specific steps of the method can be With reference to the description of the foregoing embodiments, it will not be repeated here.
[0082] In the embodiments of the present application, a computer-readable storage medium is also provided accordingly. A computer program is stored in the computer-readable storage medium. When the computer device executes the computer program, the method for evaluating the remaining transportation capacity of a multi-injection point refined oil pipeline in the embodiments of the present application is implemented.
[0083] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above system (device) and module units can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0084] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system device embodiments described above are merely illustrative. For example, the division of the above-mentioned module units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0085] The integrated units implemented in the form of software function units can be stored in a computer-readable storage medium. The above-mentioned software function units stored in a storage medium include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the methods in the various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0086] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A long-distance oil pipeline simulation method with improved transient equation and data coupling, characterized in that: The method comprises: Obtain real-time operating data at both ends of a long-distance oil pipeline and train a deep neural network with a preset network architecture; Using the deep neural network, generating a statistical level mapping relationship between input and output at each point of the long-distance oil pipeline; Based on the mapping relationship between the input and output statistics, the mechanism control equation of the transient flow process inside the long-distance oil pipeline is used for coupling to generate a coupling loss function for further training the deep neural network; Based on the coupling loss function and the input and output statistical level mapping relationship, continue to train the deep neural network to obtain a complete mapping association between the flow parameters of the oil pipeline; The complete mapping relationship between the obtained flow parameters is used to carry out online hydraulic simulation of long-distance oil pipelines.
2. The long-distance oil pipeline simulation method of improved transient equation and data coupling according to claim 1 is characterized in that: The deep neural network of the preset network architecture includes an input layer, a hidden layer and an output layer; The input layer is used to receive the input of the deep neural network, including the pipeline space and simulation time of the long-distance oil pipeline; The hidden layer is used to perform feature extraction and calculation based on the input to generate the output of the deep neural network; The output layer is used to output the results corresponding to the pipeline space and simulation time of the long-distance oil pipeline, including the pressure and flow rate in the pipeline.
3. The long-distance oil pipeline simulation method of improved transient equation and data coupling according to claim 1 is characterized in that: The mechanism control equation of the transient flow process includes: Where q is the oil flow rate in the pipe, m 2 / s; h is the fluid pressure head, m; f is the hydraulic friction coefficient; D is the pipe diameter, m; g is the gravitational acceleration, 9.8m / s 2 ; t is the flow time, s; x is the axial distance of the pipeline, m; a is the pressure wave velocity, m / s; K is the volume elastic coefficient of the oil, Pa; ρ is the density of the oil, kg / m 3 ; E is the elastic modulus of the pipe, Pa; δ is the pipe wall thickness, m; C1 is the pipe constraint coefficient; A is the pipe cross-sectional area, m 2 .
4. The long-distance oil pipeline simulation method of improved transient equation and data coupling according to claim 3 is characterized in that: Based on the order of magnitude difference between the oil flow rate in the pipe and the fluid pressure head, the oil flow rate in the pipe is converted into hourly volume flow rate to obtain the equivalent transformation mechanism control equation:
5. The long-distance oil pipeline simulation method of improved transient equation and data coupling according to claim 4 is characterized in that: Generating a coupling loss function for further training the deep neural network, the process comprising: (1) Definition and For the flow and pressure of the input and output statistical level mapping relationship, the corresponding residual of the mechanism control equation after equivalent transformation is constructed by automatic differentiation: (2) The corresponding penalty function is further constructed as follows: In the formula, and is the space-time coordinate of the point inside the pipeline, Nf is the number of paired points; (3) The observed data at the boundary can be used to construct the corresponding data-driven constraints, as shown below: in, is the pipeline coordinate at the boundary, Ndata is the sample size of the data-driven constraint; (4) Different weights are assigned to the penalty function and the data-driven constraint term to construct the coupled loss function of the model, which is expressed as follows: MSE=λ data MSE data +λ Mo MSE Mo +λ Con MSE Con {λ data ,λ Mo ,λ Con } are the weights of each item.