Pipeline flow field remodeling method based on LAAF-PINN
The pipeline flow field is reshaped through the LAAF-PINN model, and the accuracy problem of simulating water hammer wave attenuation in complex pipelines in the prior art is solved, and efficient flow field reconstruction and hydraulic parameter prediction without global modeling are achieved.
Patent Information
- Application Number
- CN202411894605.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing numerical simulation methods are difficult to accurately describe the actual pipeline characteristics when simulating the water hammer attenuation process in complex pipeline systems, especially in the absence of sensors in characteristic locations, and cannot effectively simulate changes in hydraulic parameters.
The pipeline flow field remodeling method based on LAAF-PINN is adopted. By collecting the flow field data of the pipeline measurement points, a PINN model of local adaptive activation function is constructed. The automatic differential algorithm and Brunone control equation are used to carry out data-driven flow field remodeling, and partial differential equation system is introduced as physical constraints to optimize the model training process.
It realizes rapid and accurate reconstruction of pipeline flow field information without global modeling, improves the robustness and accuracy of the model under scarce data, and can effectively simulate the pipeline hydraulic transient process.
Smart Images

Figure CN120429988A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computational technology for transient flow hydraulic parameter simulation, and in particular relates to a pipeline flow field reshaping method based on LAAF-PINN. Background Art
[0002] Many researchers have developed various numerical simulation methods for this transient flow problem, including the finite difference method, the finite volume method, and the finite element method. During the forward solution process, the entire pipeline system is divided into individual solution units using boundary and initial conditions, and approximate partial differential equation calculations are performed to efficiently simulate the pressure changes in the pipeline.
[0003] If a water pipeline is long and has diverse characteristics, the process of water hammer waves propagating and superimposing is complex. Accurately simulating the attenuation of water hammer waves is extremely difficult if the entire pipeline system is modeled and calculated. Therefore, pressure sensors must be deployed along the system. However, due to topographical and geological influences, sensors are often not placed at characteristic locations along the pipeline, such as before or after valves. Using effective sensor data to simulate the hydraulic parameters of key pipeline nodes is crucial for hydraulic safety assessment and real-time monitoring and analysis. If pressure sensors are deployed at both the upstream and downstream ends of a pipeline segment, forward numerical simulation methods can determine the hydraulic parameter variations at each node within that segment. However, this forward approach fails for areas outside the segment. The forward and backward analysis method, under single characteristic boundary conditions, can extrapolate the pipeline hydraulic parameters using a time-stepping approach. However, this method requires tedious interpolation to obtain the discrete solution to the partial differential equation.
[0004] PINN is a data-driven model that leverages automatic differentiation algorithms to solve both forward and inverse problems of partial differential equations. Prior physical knowledge helps the neural network converge faster in the right direction. The inclusion of a loss term in the partial differential equations enables the neural network to discern physical laws even with scarce data. Furthermore, PINN is a meshless method, resulting in continuous solutions across the entire spacetime.
[0005] LAAF is a method for optimizing neural network frameworks. It demonstrates good performance in solving nonlinear problems and can effectively avoid the gradient vanishing and gradient exploding problems that may occur during model training.
[0006] The partial differential equations of transient flow exhibit a complex nonlinearity. Therefore, studying the feasibility of applying LAAF-PINN (Locally Adaptive Activation Functions) to pipeline flow field reshaping is of great significance for solving the problem of accurately simulating pipeline hydraulic transients with data-driven models. Summary of the Invention
[0007] In order to solve the problem that numerical models cannot fully describe the actual pipeline characteristics, the present invention provides a pipeline flow field reshaping method based on LAAF-PINN to expand the existing pipeline hydraulic transient simulation method and perform flow field reshaping from a data-driven perspective.
[0008] A pipeline flow field reshaping method based on LAAF-PINN (Locally Adaptive Activation Functions) is proposed. LAAF-PINN (Locally Adaptive Activation Functions) is used to reshape pipeline hydraulic transients in a data-driven manner. The method includes the following steps:
[0009] S1: Collect flow field data at the pipeline measuring points to obtain two sets of N×T-dimensional sequences of pressure tube head and flow velocity, where N is the total number of measuring points and T is the total time step of the acquisition;
[0010] S2: Divide the measurement points into monitoring points and test points, and perform the same preprocessing on the data sequences: stretch and reorganize the two sets of sequences and merge them into data of shape (N×T, 2) to form the training set M d and the test set M t ;
[0011] S3: Construct LAAF-PINN, randomly select collocation points along the pipeline, and input the one-dimensional space-time coordinate sequence {x d ,t d}, {x r ,t r}, get the flow field information sequence u output by the model d ={h d ,v d},u r ={h r ,v r};
[0012] S4: Calculate the data loss term based on the model output of the monitoring point. Substitute the model output of the collocation point into the Brunone control equation through the automatic differentiation algorithm to obtain the partial differential equation loss term. The two are combined to obtain the total loss.
[0013] S5: After multiple rounds of iterative updates, the trained improved PINN model is obtained. When the spatiotemporal sequence of the test set is input, the corresponding flow field information can be reconstructed quickly and accurately.
[0014] In S1, it is only necessary to collect flow field information from measuring points along the pipeline, without modeling the entire pipeline, to train and predict the model.
[0015] In S3, the local adaptive activation function (LAAF) is introduced in the PINN neural network. It is an optimization scheme to improve the neural network framework and can effectively avoid the gradient disappearance and gradient explosion problems that occur during training.
[0016] Furthermore, a deep neural network with a depth of d has an input layer, d-1 hidden layers and an output layer, and the input of each hidden layer is:
[0017] l j (z j-1 )=ω j z j-1 +b j (1)
[0018] Where, l j (z j-1 ) indicates that the current hidden layer is receiving the output z of the neurons in the previous layer j-1 The input after ω j is the weight between the j-1th layer and the jth layer of the neural network; b j represents the bias of the jth hidden layer;
[0019] PINN with local adaptive activation function introduces parameter n and trainable parameter a for each hidden layer neuron, where n≥1 is a preset scaling factor. Acts as the slope of the activation function. This operation can amplify the mapping relationship between neurons, thereby improving the performance of the neural network:
[0020]
[0021] Where σ is the activation function of each hidden neuron; N j is the number of neurons in the jth hidden layer, so the neural network needs additional optimization parameters.
[0022] In S3, matching points are randomly selected along the line. Only the spatiotemporal sequence of these points needs to be input, and they do not need to correspond to the actual "target value". This provides a lot of freedom for model construction. At the same time, when flow field information is scarce, the number of matching points can be increased to make up for the lack of training data.
[0023] Furthermore, in S4, the model output u of the collocation point r ={h r ,v rAutomatic Differentiation (AD) can be used to obtain the partial differential terms in the partial differential equations, thereby evaluating the degree of fit of the model output to the physical information level, enhancing physical constraints, and accelerating model convergence.
[0024] Furthermore, in S4, an improved transient flow control equation is adopted, which takes into account the local instantaneous acceleration and instantaneous convection acceleration, and better describes the dynamic friction caused by the transient flow of water in the pipeline:
[0025]
[0026] Where H is the pressure tube head, m; t is time, s; a is the pipe wave velocity, m / s; g is the acceleration of gravity, m / s 2 ; V is the flow velocity, m / s; x represents the distance along the pipeline, m; k is the friction coefficient introduced by the Brunone model;
[0027] The above control equation is introduced into the PINN model, and the model output u of the collocation point is obtained. r ={h r ,v r},get:
[0028]
[0029] Where F1 and F2 represent the residual vectors of the corresponding equations. The smaller their values are, the more the model output conforms to the description of the physical equations. k(θ) represents the adaptive parameter of the neural network training, and θ is the neural network parameter set θ = [ω, b, a].
[0030] The data loss term MSE of the monitoring point is obtained by the mean square error formula MSE. u and the partial differential equation loss term MSE about the collocation point f , therefore, the total loss L(θ) of the model in one iteration is:
[0031] L(θ)=MSE u +w f MSE f (7)
[0032] Where w f MSE f The weighted value of
[0033] In each iteration, the gradient of the loss function is calculated, and the parameters θ of LAAF-PINN are updated through the Adam gradient descent optimizer to optimize the model output until convergence.
[0034] Furthermore, in S5, a trained PINN model can quickly and accurately reconstruct the pipeline flow field by inputting the time and space coordinates of the test point or any point along the pipeline. At the same time, the performance of the model can be measured by the relative error L 2 express:
[0035]
[0036] Where u t Output of the flow field information of the model at the test point.
[0037] Compared with the existing technology, the pipeline flow field reshaping method based on LAAF-PINN provided by the present invention has the following advantages:
[0038] (1) The present invention applies the PINN model to pipeline flow field reconstruction. The trained model is learned based on real flow field information and can be extended to practical engineering applications.
[0039] (2) Compared with the numerical simulation method, it is a gridless method that inputs the spatiotemporal sequence of measurement points and can efficiently output the flow field information of the entire sequence.
[0040] (3) A set of partial differential equations is introduced as physical constraints to ensure that the model can learn the physical laws implied by real data and accurately predict the hydraulic parameters of unknown nodes efficiently even when flow field information is scarce.
[0041] (4) From a data-driven perspective, the flow field is reshaped to make up for the insufficiency of the numerical model in fully describing the actual pipeline characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a flow chart of a pipeline flow field reshaping method based on LAAF-PINN of the present invention;
[0043] Figure 2 It is a schematic diagram of the PINN model framework of the present invention;
[0044] Figure 3 is a schematic diagram of a pipeline system according to an embodiment of the present invention;
[0045] Figure 4 The characteristic line method is used to generate the pressure gauge head at the monitoring point based on the transient flow equation considering only the constant friction model. A diagram of the transient pressure change at the monitoring point;
[0046] Figure 5 This is the second figure of transient pressure change at the monitoring point;
[0047] Figure 6 These are three graphs of transient pressure changes at the monitoring points;
[0048] Figure 7 It is the pressure comparison result of the flow field remodeling result of the model of the present invention at the test point and the "real" solution.
[0049] Figure 8 This is the second pressure comparison result between the flow field remodeling result of the model of the present invention and the “real” solution at the test point. Implementation Method
[0050] The principles and technical advantages of the present invention will be further explained below in conjunction with specific implementation cases and corresponding drawings. It should be noted that this case is only used to illustrate the function of the present invention and is not used to limit the scope of application of the present invention. After reading the relevant principles and functions of the present invention, those skilled in the art need to make various changes to the equivalent forms of the present invention within the scope limited by the claims attached to the present application.
[0051] like Figure 1 As shown, the present invention is a pipeline flow field reshaping method based on LAAF-PINN, which uses LAAF-PINN (Locally Adaptive Activation Functions) to reshape pipeline hydraulic transients in a data-driven manner, and is carried out in the following steps:
[0052] S1: Collect flow field data at the pipeline measuring points to obtain two sets of N×T-dimensional sequences of pressure tube head and flow velocity, where N is the total number of measuring points and T is the total time step of the acquisition;
[0053] In S1, only the flow field information of the measuring points along the pipeline is collected for model training and prediction.
[0054] S2: Divide the measurement points into monitoring points and test points, and perform the same preprocessing on the data sequences: stretch and reorganize the two sets of sequences and merge them into data of shape (N×T, 2) to form the training set M d and the test set M t .
[0055] S3: Construct LAAF-PINN, randomly select collocation points along the pipeline, and input the one-dimensional space-time coordinate sequence {x d ,t d}, {x r ,t r}, get the flow field information sequence u output by the model d ={h d ,v d},u r ={h r ,v r}:
[0056] In S3, a local adaptive activation function is introduced into the PINN neural network. It is an optimization scheme to improve the neural network framework and can effectively avoid the gradient vanishing and gradient exploding problems that occur during training.
[0057] A deep neural network with a depth of d has an input layer, d-1 hidden layers and an output layer. The input of each hidden layer is:
[0058] l j (z j-1 )=ω j z j-1 +b j (1)
[0059] Where, l j (z j-1 ) indicates that the current hidden layer is receiving the output z of the neurons in the previous layer j-1 The input after ω j is the weight between the j-1th layer and the jth layer of the neural network; b j represents the bias of the j-th hidden layer.
[0060] LAAF-PINN with local adaptive activation function introduces parameter n and trainable parameter a for each hidden layer neuron, where n≥1 is a preset scaling factor. Acts as the slope of the activation function. This operation can amplify the mapping relationship between neurons, thereby improving the performance of the neural network:
[0061]
[0062] Where N j is the number of neurons in the jth hidden layer, so the neural network needs additional optimization parameters.
[0063] Randomly select collocation points along the line. Generally, the points can be evenly collected along the line. Determine the spatiotemporal coordinates of the monitoring points and collocation points. According to the step length of the collected data, determine the sequence length and convert the spatiotemporal sequence into (N×T, 2) shaped data. Input the input of the monitoring points and collocation points respectively to obtain the corresponding model output u d ={h d ,v d},u r ={h r ,v r}.
[0064] In S3, matching points are randomly selected along the line. Only the spatiotemporal sequence of these points needs to be input, and they do not need to correspond to the actual "target value". This provides a lot of freedom for model construction. At the same time, when flow field information is scarce, the number of matching points can be increased to make up for the lack of training data.
[0065] S4: Calculate the data loss term based on the model output of the monitoring point. Substitute the model output of the collocation point into the Brunone control equation through the automatic differentiation algorithm to obtain the partial differential equation loss term. The two are combined to obtain the total loss:
[0066] In S4, the model output u of the collocation point r ={h r ,v r The automatic differentiation algorithm (AD) can be used to obtain the partial differential terms in the partial differential equations, thereby evaluating the degree of fit of the model output to the physical information level, enhancing physical constraints, and accelerating model convergence.
[0067] The model output of the monitoring point is used to calculate the data loss term MSE u :
[0068]
[0069] Where N d is the training set M d total, is the model output of the monitoring point.
[0070] The model output of the collocation point is used to calculate the partial differential equation loss term MSE that measures the physical constraints f The Brunone dynamic friction model is used, taking into account the local instantaneous acceleration and instantaneous convection acceleration, to better describe the dynamic friction caused by the transient flow of water in the pipeline:
[0071]
[0072] Where H is the pressure tube head, m; t is time, s; a is the pipe wave velocity, m / s; g is the acceleration of gravity, m / s 2 ; V is the flow velocity, m / s; x represents the distance along the pipeline, m; k is the friction coefficient introduced by the Brunone model.
[0073] The above control equation is introduced into the PINN model, and the model output u of the collocation point is obtained. r ={h r ,v r}, the partial differential terms in the partial differential equation are obtained through the automatic differentiation algorithm, and the friction coefficient k is used as a trainable parameter of the neural network:
[0074]
[0075] Where F1 and F2 represent the residual vectors of the corresponding equations. The smaller their values are, the more the model output conforms to the description of the physical equations. θ is the neural network parameter set θ = [ω, b, a].
[0076] The data loss term MSE of the monitoring point is obtained by the mean square error formula MSE. u and the partial differential equation loss term MSE about the collocation point f , therefore, the total loss L(θ) of the model in one iteration is:
[0077] L(θ)=MSE u +w f MSE f (7)
[0078] Where w f MSE f The weighted value of .
[0079] like Figure 2 This is a schematic diagram of the LAAF-PINN framework. In each iteration, the gradient of the loss function is calculated, and the model parameters θ are updated through the Adam gradient descent optimizer to optimize the model output until convergence.
[0080] S5: After multiple rounds of iterative updates, the trained improved PINN model is obtained. When the spatiotemporal sequence of the test set is input, the corresponding flow field information can be reconstructed quickly and accurately. The performance of the model can be measured by the relative error L 2 express:
[0081]
[0082] Where u t Output of the flow field information of the model at the test point.
[0083] Based on the above scheme, in order to verify the practicability of the method of the present invention, Figure 3The system consists of a reservoir-pipeline-valve system. The upstream reservoir maintains a constant water level of Hr = 50 m, the pipeline has a total length of L = 300 m, a wave velocity a = 1000 m / s, a diameter of D = 0.05 m, a constant friction coefficient f = 0.015, and an initial flow velocity of 0.412 m / s. To highlight the pressure changes in the pipeline caused by valve actuation, the terminal valve is rapidly closed within 0.02 seconds to generate a transient pressure wave. Five pressure sensors are deployed in the center of the pipeline system. The monitoring points are sensor 2 (x = 80 m), sensor 3 (x = 160 m), and sensor 5 (x = 240 m). The test points are sensor 1 (x = 50 m) and sensor 4 (x = 200 m).
[0084] The characteristic line method is used to generate a "real" data set for the transient flow equation considering only the constant friction model. Figure 4 This is a graph showing transient pressure changes at the monitoring point. Figure 5 Figure 2 shows the transient pressure change of the monitoring point. Figure 6 Figure 3 shows the transient pressure changes at the monitoring point.
[0085] After training, LAAF-PINN predicts the pressure pipe head at the test point. Figure 7 A graph comparing the model's predictions at the test point with the "true" solution curve. Figure 8 The two graphs compare the model's prediction results at the test point with the "real" solution curve. It can be found that the model can accurately predict the pressure changes at the node, including the peaks and undulations. According to formula (8), the pressure prediction L is obtained 2 The relative errors are 6.29e-2, which further demonstrates that the proposed method has good generalization ability.
[0086] This study applies LAAF-PINN to the study of pipeline hydraulic transients, expanding existing flow field reconstruction methods. It also demonstrates robustness to data containing uncertainties while avoiding the potential computational inaccuracies associated with forward simulations. This approach is of great significance for accurately simulating pipeline hydraulic transients using data-driven models.
Claims
1. A pipeline flow field reshaping method based on LAAF-PINN, characterized in that: LAAF-PINN is used to reshape pipeline hydraulic transients in a data-driven manner. The specific steps are as follows: S1: Collect flow field data at the pipeline measuring points to obtain two sets of N×T-dimensional sequences of pressure tube head and flow velocity, where N is the total number of measuring points and T is the total time step of the acquisition; S2: Divide the measurement points into monitoring points and test points, and perform the same preprocessing on the data sequences: stretch and reorganize the two sets of sequences and merge them into data of shape (N×T, 2) to form the training set M d and the test set M t ; S3: Construct LAAF-PINN, randomly select collocation points along the pipeline, and input the one-dimensional space-time sequence {x d ,t d }, {x r ,t r }, get the flow field information sequence u output by the model d ={h d ,v d },u r ={h r ,v r }; S4: Calculate the data loss term based on the model output of the monitoring point. Substitute the model output of the collocation point into the Brunone control equation through the automatic differentiation algorithm to obtain the partial differential equation loss term. The two are combined to obtain the total loss. S5: After multiple rounds of iterative updates, the trained PINN model is obtained. By inputting the spatiotemporal sequence of the test set, the corresponding flow field information can be reconstructed quickly and accurately.
2. The pipeline flow field reshaping method based on LAAF-PINN according to claim 1, characterized in that: In S3, a local adaptive activation function is introduced into the PINN neural network. A deep neural network with a depth of d has an input layer, d-1 hidden layers and an output layer. The input of each hidden layer is: l j (z j-1 )=ω j z j-1 +b j (1) Where, l j (z j-1 ) indicates that the current hidden layer is receiving the output z of the neurons in the previous layer j-1 The input after ω j is the weight between the j-1th layer and the jth layer of the neural network; b j represents the bias of the jth hidden layer. PINN with local adaptive activation function introduces parameter n and trainable parameter a for each hidden layer neuron, where n≥1 is a preset scaling factor. Serves as the slope of the activation function: Where N j is the number of neurons in the jth hidden layer, so the neural network needs additional optimization parameters.
3. The pipeline flow field reshaping method based on LAAF-PINN according to claim 1, characterized in that: In S4, the model output u of the collocation point r ={h r ,v r }The automatic differentiation algorithm can be used to obtain the partial differential terms in the partial differential equations, thereby evaluating the degree of fit of the model output to the physical information level.
4. The pipeline flow field reshaping method based on LAAF-PINN according to claim 1, characterized in that: In S4, an improved transient flow control equation is used to take into account the local instantaneous acceleration and instantaneous convection acceleration to describe the dynamic friction caused by the transient flow of water in the pipeline: Where H is the pressure tube head, m; t is time, s; a is the pipe wave velocity, m / s; g is the acceleration of gravity, m / s 2 ; V is the flow velocity, m / s; x represents the distance along the pipeline, m; k is the friction coefficient introduced by the Brunone model; The above control equation is introduced into the PINN model, and the model output u of the collocation point is obtained. r ={h r ,v r },get: Where F1 and F2 represent the residual vectors of the corresponding equations. The smaller their values are, the more the model output conforms to the description of the physical equations. k(θ) represents the adaptive parameter of the neural network training, and θ is the neural network parameter set θ = [ω, b, a]. The data loss term MSE of the monitoring point is obtained by the mean square error formula MSE. u and the partial differential equation loss term MSE about the collocation point f , therefore, the total loss L(θ) of the model in one iteration is: L(θ)=MSE u +w f MSE f (7) Where w f MSE f The weighted value of In each iteration, the gradient of the loss function is calculated, and the parameters θ of LAAF-PINN are updated through the Adam gradient descent optimizer to optimize the model output until convergence.
5. The pipeline flow field reshaping method based on LAAF-PINN according to claim 1, characterized in that: In S5, a trained PINN model can quickly and accurately reconstruct the pipeline flow field by inputting the time and space coordinates of the test point or any point along the pipeline. At the same time, the performance of the model can be measured by the relative error L 2 express: Where u t Output of the flow field information of the model at the test point.
Citation Information
Patent Citations
Pipeline state evaluation method based on physical information neural network
CN117725821A
Additive manufacturing temperature field prediction method fusing physical characteristics and physical constraints
CN118821504A
Method and apparatus for BI-level physics-informed neural networks for PDE constrained optimization
WO2024031525A1
Cited By
Forward prediction method, device and equipment for transient flow of pipeline and medium
CN121031396A
A pipeline transient flow forward prediction method, device, equipment and medium
CN121031396B
PINN-based high-precision hydrodynamic numerical simulation method and system
CN121413519A
A high-precision hydrodynamic numerical simulation method and system based on PINN
CN121413519B
Illusion suppression intelligent aid decision-making method and device fusing dynamic knowledge graph and space-time snapshot mechanism, equipment and storage medium
CN122222046A
