Pipe-in multi-phase flow pressure feature prediction method based on bubble attention mechanism
Through the decomposition-prediction-reconstruction method based on the bubble attention mechanism, the nonlinear problem of pressure prediction in gas-liquid two-phase flow pipelines was solved, accurate pressure feature prediction and flow type identification in high-noise environments were achieved, and the risk of gas plug accidents was reduced.
Patent Information
- Application Number
- CN202511107740.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-08-08
AI Technical Summary
Existing technologies make it difficult to accurately predict the nonlinear pressure characteristics in gas-liquid two-phase flow pipelines. In particular, the model is easily distorted under high noise interference and lacks physical constraints on the pipeline, causing the prediction results to deviate from the actual safety boundaries of the project.
A multiphase flow pressure feature prediction method in pipelines based on the bubble attention mechanism is adopted. By decomposing the pressure time series into low-fluctuation and high-fluctuation series, the ARIMA and TCN-LSTM models are used to process different frequency domain features respectively, and a physical constraint layer is embedded. The prediction accuracy is optimized in combination with the dual loss function.
It achieves accurate modeling of the pressure characteristics of gas-liquid multiphase flow under high noise conditions, ensures that the prediction results conform to the laws of fluid dynamics, reduces the risk of gas plug accidents, and provides multi-dimensional decision support.
Smart Images

Figure CN120611639B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of gas-liquid multiphase flow pressure prediction, and particularly relates to a pipe internal multiphase flow pressure feature prediction method based on a bubble attention mechanism. BACKGROUND
[0002] The pressure fluctuation phenomenon in gas-liquid two-phase flow is a core basic problem restricting the safe and efficient operation of energy and chemical equipment, and its essence is derived from the cross-scale dynamic coupling effect in the multiphase system, that is, the strong nonlinear positive feedback of microscale bubble coalescence / breakup, mesoscale flow pattern transient transition and macroscale system pressure oscillation. In the long oil pipeline, the slug flow induced by gas accumulation can cause the pressure peak to rise to 6-8 times the steady-state value. This periodic impact load not only makes the flow meter measurement deviation exceed ± 15%, but also excites the pipe mechanical resonance and accelerates the erosion wear at the elbow position. In addition, in the steam generator of a nuclear power plant, the density wave instability caused by boiling crisis can cause the local heat flux density to fluctuate by ± 20%, and even cause the nuclear power plant to trigger an emergency shutdown accident due to two-phase flow oscillation. At the same time, the pressure fluctuation in gas-liquid two-phase flow is also a key scientific problem of energy and chemical systems, and widely exists in nuclear reactor cooling, oil pipeline, boiling heat exchange equipment and chemical separation devices and other industrial scenes. In the gas-liquid two-phase system, the generation of pressure fluctuation is derived from the strong nonlinear interaction of bubble dynamics behavior, flow pattern transient transition and phase interface momentum exchange. Taking the long oil pipeline as an example, the pressure pulsation caused by gas-liquid phase slip can significantly reduce the control accuracy of the pump valve, cause the slug flow impact load, and accelerate the pipe wall erosion failure; in the steam generator of a nuclear power plant, the severe pressure oscillation will destroy the critical heat flux density, threatening the safe operation of the reactor. Therefore, in-depth analysis of the generation mechanism, propagation and attenuation law of pressure fluctuation not only has engineering value for multiphase flow system stability control and equipment fatigue life prediction, but also is a core basis for realizing energy efficient conversion and ensuring process industry intrinsic safety, and has important significance for promoting the intelligent development of high-end equipment.
[0003] Currently, the traditional time series prediction method is usually used for the pressure prediction of gas-liquid two-phase flow pipeline, but the traditional time series prediction method has significant limitations when applied to the pressure prediction of gas-liquid two-phase flow pipeline, mainly embodied in: it is difficult to capture the complex coupling of multi-scale dynamic characteristics in the pressure signal based on a single statistical model, that is, the low-frequency trend and the transient strong noise caused by the physical mechanism such as bubble burst cannot be effectively separated and modeled; although a single deep learning model has certain time series representation ability, it is easy to appear high-frequency oscillation distortion and lag in capturing sharp peak events under strong noise interference, and because there is no explicit modeling of the physical constraints of the pipeline, the prediction result may deviate from the engineering actual safety boundary, and there is a risk of misjudgment; in addition, the smooth processing of the traditional loss function on the pressure mutation area also leads to insufficient sensitivity of the model to key transient events. Based on this, a pressure feature prediction method for multiphase flow in a pipeline based on a bubble attention mechanism is proposed. SUMMARY
[0004] In order to solve the problem that the nonlinear pressure characteristics of complex gas-liquid multiphase flow in a pipeline containing super-bubbles are difficult to accurately predict, the present application proposes a pressure feature prediction method for multiphase flow in a pipeline based on a bubble attention mechanism.
[0005] The present application adopts the following technical solutions:
[0006] A pressure feature prediction method for multiphase flow in a pipeline based on a bubble attention mechanism, comprising the steps of:
[0007] S1, obtaining gas-liquid multiphase flow pressure time series data of different flow types in the pipeline, performing data preprocessing, and dividing into a training set and a test set;
[0008] S2, decomposing the preprocessed pressure time series data into low fluctuation sequence data and high fluctuation sequence data;
[0009] S3, establishing a pressure feature prediction model composed of a low fluctuation sequence ARIMA prediction module and a high fluctuation sequence TCN-LSTM prediction module, and setting the output result of the pressure feature prediction model as the fusion of the low fluctuation prediction result and the high fluctuation prediction result;
[0010] S4, based on the pressure feature prediction model established in step S3, the training set of the low fluctuation sequence data is used to train the low fluctuation sequence ARIMA prediction module, and the training set of the high fluctuation sequence data is used to train the high fluctuation sequence TCN-LSTM prediction module, and when the loss function shows convergence and reaches a preset value, the iteration is ended, and a mature pressure feature prediction model is obtained;
[0011] S5. Testing the pressure feature prediction model trained in step S4 using a test set of low-volatility sequence data and high-volatility sequence data to evaluate the final performance of the pressure feature prediction model;
[0012] S6. Inputting the known pressure time series data of the multiphase flow in the pipeline to be predicted into a well-trained pressure feature prediction model, and using the well-trained pressure feature prediction model to predict the future pressure time series of the multiphase flow in the pipeline;
[0013] S7. Based on the prediction result of step S6, the flow pattern is identified and the bubble dynamics-related parameters are calculated, and the pressure characteristics of the gas-liquid multiphase flow in the pipeline are comprehensively analyzed.
[0014] Furthermore, the data preprocessing process in step S1 is:
[0015] S11. performing time alignment correction on the obtained gas-liquid multiphase flow pressure time series data of different flow patterns in the pipeline, filling in missing values, and making the data complete;
[0016] S12, performing physical range filtering on the pressure time series data after time alignment correction to remove obviously abnormal data;
[0017] S13. Perform industrial noise processing on the pressure time series data after physical range filtering. Eliminate the air pump vibration noise using a 45-55 Hz Butterworth band-stop filter. Use the gradient threshold method to accurately locate the effective bubble peaks and exclude the pseudo-peaks that appear continuously within 5 ms.
[0018] S14, performing feature derivation processing on the pressure time series data, that is, calculating the pressure difference between adjacent sampling points to generate a pressure gradient feature, obtaining a bubble velocity feature based on the time step corresponding to the pressure gradient feature, and performing first-order difference processing on the bubble velocity feature to obtain an acceleration feature to characterize the acceleration of the pressure change;
[0019] S15, performing normalization and scaling processing on the pressure time series data, and linearly scaling the pipeline working pressure range to the interval [-1, 1];
[0020] S16. The normalized and scaled data is used as sample data and converted into a supervised learning format. The sliding window is used to generate input vectors and output vectors to construct a sample set.
[0021] Furthermore, in step S2, when performing moving average decomposition on the pressure time series data preprocessed in step S1, a kurtosis optimization algorithm is used to determine the optimal moving average window period, and the optimal moving average window period is used to decompose the pressure time series data into low-volatility sequence data and high-volatility sequence data to form a dual-channel data matrix.
[0022] Furthermore, the high volatility sequence TCN-LSTM prediction module in step S3 is established based on the physically constrained TCN-LSTM model, specifically including:
[0023] The TCN backbone network includes an input layer, at least two stacked deformable convolution layers and a residual connection layer. Each deformable convolution layer is provided with a ReLU activation function layer and a Dropout regularization layer after the convolution operation, and a bubble motion attention mechanism is introduced after the terminal deformable convolution layer.
[0024] A physical constraint layer, wherein the physical constraint layer performs fluid dynamics constraints based on pipeline resonance characteristics and fluid dynamics continuity equations;
[0025] An LSTM prediction network includes an input layer, a hidden layer, and a linear output layer. The hidden layer of the LSTM captures long-range dependencies in the time dimension through a gating mechanism, combines a memory unit state update mechanism to generate a pressure prediction value that conforms to the laws of fluid dynamics, and outputs the prediction value through a linear output layer.
[0026] The low volatility prediction result of the low volatility sequence ARIMA prediction module is incorporated into the TCN backbone network, and the output result of the LSTM prediction layer of the high volatility sequence TCN-LSTM prediction module is a fusion of the low volatility prediction result and the high volatility prediction result.
[0027] Furthermore, the bubble attention mechanism includes a feature extraction convolution layer, a Reynolds number adaptation layer, a feature fusion layer, and a weighted output layer arranged in sequence;
[0028] The feature extraction convolution layer includes a first deformable convolution channel for extracting bubble velocity features and a second deformable convolution channel for extracting bubble frequency features, which are arranged in parallel;
[0029] The Reynolds number adaptive layer is used to monitor the pressure fluctuation characteristics in real time to calculate the Reynolds number, judge the laminar flow and turbulent flow state changes according to the Reynolds number, and dynamically adjust the bubble velocity characteristics and bubble frequency characteristics weights;
[0030] The feature fusion layer is used to splice the bubble velocity feature and the bubble occurrence frequency feature in the channel dimension to generate a dynamic attention weight matrix;
[0031] The weighted output layer is used to perform element-wise multiplication of the attention weight matrix and the input feature map of the input bubble attention mechanism to obtain a weighted feature map and output it.
[0032] Furthermore, the constraint operations performed by the physical constraint layer include:
[0033] Based on the frequency domain constraint of pipeline resonance characteristics, the expression is:
[0034] ;
[0035] ;
[0036] ;
[0037] Where, is the frequency domain representation obtained after fast Fourier transform, is the fast Fourier transform, To output pressure signal; At the resonant frequency The spectrum amplitude after suppression processing is At a specific resonant frequency The original spectrum amplitude at is the learnable frequency suppression coefficient; is the final output time domain pressure signal, An algorithm for inverse fast Fourier transform, which converts the signal from the frequency domain back to the time domain; Based on the pipe length Speed of sound The calculated resonant frequency, and ;
[0038] The pressure amplitude constraint based on pipeline safety parameters is expressed as:
[0039] ;
[0040] Where, To output pressure signal, represents the truncation function, is the input pressure signal, 0 is the lower limit of pressure, The maximum pressure after prediction is to ensure that the pressure does not exceed the maximum bearing value of the pipeline;
[0041] The fluid continuity equation constraint is expressed as:
[0042] ;
[0043] Where, For The first-order difference of pressure in the time step, that is, the rate of change of pressure; For The raw predicted pressure value at the time step, For The raw predicted pressure value at the time step;
[0044] Based on the fluid continuity equation constraint, continue to constrain the obtained pressure first-order difference in the frequency domain, and the expression is:
[0045] ;
[0046] ;
[0047] In the formula, is the frequency domain representation obtained after the fast Fourier transform of the first-order difference sequence , is the first-order difference sequence of pressure, that is, the set of the first-order difference of pressure in the above continuity equation constraint, is the fast Fourier transform; is the attenuation coefficient, is a mask, which is used to select the frequency region that needs to be attenuated near the resonance frequency, is the frequency domain signal after the frequency domain constraint processing;
[0048] The processed frequency domain signal is inversely transformed back to the time domain, and the expression is:
[0049] ;
[0050] In the formula, is the inverse fast Fourier transform; is the first-order difference sequence converted back to the time domain by the processed frequency domain signal ;
[0051] The pressure sequence is reconstructed as:
[0052] ;
[0053] In the formula, is the pressure sequence reconstructed at the previous time step; is the final output physical compliant pressure sequence at the current time step.
[0054] Further, the damage function used by the step S4 in the training process is a double-loss function combining the prediction error and the physical constraint error;
[0055] The double-loss function includes a main loss function for calculating the mean square error of the predicted value and the true value, and an auxiliary physical loss function for evaluating the similarity of the second-order derivative of pressure to ensure that the predicted waveform conforms to the laws of fluid mechanics;
[0056] Wherein, the main loss function is the mean square error function, that is:
[0057] ;
[0058] In the formula, is the mean square error loss, is the number of samples, is the true value of the i-th sample, is the true value of the i-th sample, is the predicted value of the i-th sample; is the predicted value of the i-th sample;
[0059] The auxiliary physical loss function is:
[0060] ;
[0061] wherein, is the physical loss, i.e., the second-order difference loss, is the number of samples, is the true value of the i-th sample, is the true value of the i-th sample, is the predicted value of the i-th sample, is the predicted value of the i-th sample.
[0062] Further, in the step S5 of evaluating the established pressure feature prediction model, a conventional index is used to evaluate the overall deviation degree of the predicted value and the true value, and a special index for gas-liquid two-phase flow characteristics is used to evaluate the ability of the model to capture the unique phenomena of gas-liquid two-phase flow;
[0063] The conventional index includes at least one of mean square error, root mean square error, mean absolute percentage error, and determination coefficient;
[0064] The special index includes spike capture accuracy, fluctuation error, and direction accuracy;
[0065] The calculation formula of the spike capture accuracy is:
[0066] ;
[0067] In the formula, is the spike capture accuracy, is the actual spike set, is the indicator function, is the predicted spike pressure feature, is the time step corresponding to the predicted spike, is the time step corresponding to the actual spike;
[0068] The calculation formula of the fluctuation error is:
[0069] ;
[0070] In the formula, is the fluctuation error, is the predicted pressure fluctuation amount; is the actual pressure fluctuation amount, The mathematical expectation is denoted as E{X} = ∑xP(x), where P(x) is the probability of x.
[0071] The direction accuracy rate is divided into two categories. The first category investigates whether the change direction of the predicted value relative to the actual value at the previous time step conforms to the true trend. The second category verifies whether the change direction of adjacent steps in the predicted value sequence is synchronized with the true pressure change. The calculation formulas are as follows:
[0072] ;
[0073] ;
[0074] In the formula, f1 is the first category direction accuracy rate, f2 is the second category direction accuracy rate, I is the indicator function, sgn is the sign function, P is the pressure fluctuation, t is the time step, T is the total time step, i.e., the total number of pressure sequence samples used for calculating the accuracy rate, P is the predicted pressure value at the time step, P is the predicted pressure value at the time step, P is the actual pressure value at the time step, P is the actual pressure value at the time step, P is the predicted pressure fluctuation at the time step, and P is the true pressure fluctuation at the time step.
[0075] Further, the flow pattern recognition in step S7 is based on dynamic window wavelet analysis technology and statistical feature recognition of the gas-liquid mixing state in the pipeline, and three feature threshold values are set to realize classification.
[0076] When the average absolute pressure change value in the continuous 5 pressure windows is greater than 50% of the historical average pressure value, it is determined to be dispersed bubble flow.
[0077] When the peak pressure in the continuous 30 time steps in the same pressure window exceeds 1.5 times the average pressure level, it is determined to be slug flow.
[0078] If the pressure fluctuation standard deviation in the current pressure window significantly increases by more than 20% of the historical fluctuation standard deviation reference value, it is determined to be turbulent flow.
[0079] Further, the bubble dynamics related parameters in step S7 include the bubble volume fraction and the coalescence breakup rate.
[0080] wherein the bubble volume fraction is calculated according to the pressure fluctuation amplitude, and the calculation formula is:
[0081] ;
[0082] wherein, is the bubble volume fraction, is the pressure fluctuation in the pipeline, is the fluid density, is the gravitational acceleration, is the pipeline diameter;
[0083] The bubble coalescence and breakup rate is calculated according to the pressure spike frequency change, and the calculation formula is:
[0084] ;
[0085] wherein, is the bubble coalescence and breakup rate, is the bubble number, is the bubble number change rate, is the average bubble number, is the pressure change rate.
[0086] The present application has the following beneficial effects:
[0087] (1) The present application establishes a prediction method based on a three-level architecture of "decomposition-prediction-reconstruction", that is, the original pressure time series is first decomposed into low fluctuation and high fluctuation pressure time series through the dynamic sequence decomposition technology guided by kurtosis optimization, then the ARIMA prediction module and the TCN-LSTM prediction module with the introduction of the bubble attention mechanism and the physical constraint layer are used to process different frequency domain features, which can realize the directional capture of the turbulent micro-scale dynamics through the bubble motion attention mechanism, and retain the fluid dynamics evolution law, finally fuse the prediction results and verify them through the three special indexes of regular indexes, spike capture accuracy, fluctuation rate error and direction accuracy, realize the accurate modeling of the pressure time series evolution law under high noise conditions, and accurately predict the development law of the nonlinear pressure characteristics of complex gas-liquid multiphase flow in the pipeline;
[0088] (2) The prediction method of the present application designs the bubble motion attention mechanism in the TCN-LSTM prediction module, and extracts the bubble speed feature and occurrence frequency feature through the double-path convolution network, realizes the automatic adjustment of the laminar-turbulent critical region feature weight through the real-time sensing of the flow state conversion process through the Reynolds number adaptive layer, and effectively analyzes the bubble coalescence and breakup dynamics process;
[0089] (3) The prediction method of the present application converts the fluid mechanics continuity equation and the pipeline resonance characteristics into mathematical constraints by embedding a physical constraint layer in the TCN-LSTM prediction module, ensuring that the prediction results are not only statistically accurate but also comply with the laws of fluid dynamics;
[0090] (4) The prediction method of the present application also uses a double-loss strategy to simultaneously optimize prediction accuracy during model training, ensuring consistency of prediction results and using pressure second derivative similarity to ensure that the predicted waveform complies with the laws of fluid mechanics;
[0091] (5) The prediction method of the present application also proposes using pressure feature prediction results to identify bubble flow, slug flow, or mixed flow flow patterns and calculate bubble volume fraction, coalescence breakup rate, and other bubble dynamics-related parameters, thereby further comprehensively analyzing the pressure characteristics of gas-liquid multiphase flow in the pipeline, providing multi-dimensional decision support for the safe operation of industrial pipelines, and significantly reducing the risk of gas plug accidents. BRIEF DESCRIPTION OF DRAWINGS
[0092] Figure 1 Network architecture diagram of the pressure feature prediction model established by the embodiments of the present application;
[0093] Figure 2 Network architecture diagram of the bubble attention mechanism established by the embodiments of the present application;
[0094] Figure 3 Comparison chart of predicted values and true values obtained when the mature pressure feature prediction model trained by the test set is tested. DETAILED DESCRIPTION
[0095] To make the objectives, technical solutions, and effects of the present application clearer and more explicit, the present application is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0096] With reference to Figure 1 and Figure 2 , the present embodiment proposes a bubble attention mechanism-based pressure feature prediction method for multiphase flow in a pipeline, specifically including the following steps S1-S6, which realizes the prediction of the nonlinear pressure characteristics of gas-liquid multiphase flow in the pipeline.
[0097] S1, obtain gas-liquid multiphase flow pressure time series data of different flow patterns in the pipeline, perform data preprocessing to construct a sample set, and divide the sample set into a training set and a test set.
[0098] The data preprocessing process in this step S1 is as follows:
[0099] S11, time alignment correction is performed on the acquired pressure time series data of different flow patterns in the pipeline, missing values are filled, and the data is complete. Because the sensor may have missing data due to bubble shielding or equipment failure during pressure data collection, it is necessary to fill in the missing values. The specific processing method is:
[0100] Check the sensor timestamp interval, and use linear interpolation to fill in isolated missing points (i.e. 1 missing point), i.e. fill in the average of the pressure values at the previous and next time points of the missing point;
[0101] Use cubic spline interpolation for 2≤continuous missing≤3 points;
[0102] More than 3 consecutive missing points are marked as abnormal segments and not used for training;
[0103] S12, the pressure time series data after time alignment correction is filtered by physical range, and the obviously abnormal data is removed; Specifically, delete the abnormal readings exceeding the maximum pressure of the pipeline, remove the transient zero fault points with a duration <1 ms, and ensure that the minimum pressure of the bubble flow is not less than 0.1 times atmospheric pressure;
[0104] S13, the pressure time series data after physical range filtering is processed by industrial noise, the gas pump vibration noise is eliminated by a 45-55 Hz Butterworth band-stop filter, and the gradient threshold method is used to accurately locate the effective bubble peak, and the pseudo-peak appearing continuously within 5 ms is excluded;
[0105] S14, feature derivation processing is performed on the pressure time series data, i.e. calculating the pressure difference between adjacent sampling points to generate pressure gradient features, based on the time step corresponding to the pressure gradient features to obtain bubble speed features, and performing first-order difference processing to obtain acceleration features, which represent the acceleration of pressure change;
[0106] S15, the pressure time series data is normalized and scaled, i.e. linearly scaling the pipeline operating pressure range to the interval [-1, 1]; This standardization processing can eliminate the influence of different dimensions or orders of magnitude on the subsequent model, and improve the numerical stability;
[0107] S16, the data after normalization and scaling is used as sample data, converted to supervised learning format, and input vectors and output vectors (i.e. prediction targets) are generated using sliding windows to construct a sample set;
[0108] The input vector is:
[0109] ;
[0110] The output vector is:
[0111] ;
[0112] wherein, is an input vector, is a time step, is a time step length, is a prediction step length, ,…, is a pressure value at different time steps, is an output vector, is a pressure prediction value at future time steps.
[0113] After data preprocessing is completed, 70-80% of the sample set is taken as the training set, and the remaining 20-30% is taken as the test set, and the training set covers all flow patterns of bubble flow, slug flow, and churn flow and contains several complete bubble life cycles. The test set needs to contain at least 3 complete bubble life cycle events (i.e. generation, rise, coalescence, and fragmentation).
[0114] S2, decompose the preprocessed pressure time series data into low fluctuation sequence data and high fluctuation sequence data.
[0115] Specifically, this step first performs moving average decomposition on the pressure time series data preprocessed in step S1, that is, the kurtosis optimization algorithm is used to determine the optimal moving average window period, and the pressure time series data is decomposed into low fluctuation sequence data and high fluctuation sequence data using the optimal moving average window period to form a double-channel data matrix. In the decomposition process, the kurtosis optimization algorithm is first used to calculate the kurtosis value of the smoothed sequence obtained under different moving average window sizes (usually from 4 to 100 time steps are traversed), and the kurtosis value closest to the kurtosis value 3 of the Gaussian distribution is taken as the optimization target. The optimal moving average window period most suitable for the current pressure data characteristics (spike distribution characteristics) is automatically selected, and then this optimal period is applied to SMA (simple moving average line) to decompose the pressure time series data into low fluctuation sequence data and high fluctuation sequence data. In this way, the original complex pressure signal is clearly disassembled into two parts representing the slow-changing background trend (low fluctuation) and the rapid oscillation and spike (high fluctuation) caused by bubble motion. The above low fluctuation specifically refers to low-amplitude fluctuation of pressure, and the high fluctuation specifically refers to high-amplitude fluctuation of pressure. The fluctuation amplitude of not higher than 30% of the average value is taken as the low amplitude, and the fluctuation amplitude higher than 30% of the average value is taken as the high amplitude.
[0116] The above decomposition process is specifically:
[0117] ;
[0118] The high fluctuation sequence data is:
[0119] ;
[0120] wherein, is the time step, is the moving window length, is the low volatility sequence data of the time step, is the high volatility sequence data of the time step, is the original pressure data of the time step, is the pressure value after moving different moving windows on the basis of the original pressure value, the maximum moving window length.
[0121] S3, a pressure feature prediction model composed of a low volatility sequence ARIMA prediction module and a high volatility sequence TCN-LSTM prediction module is established, and the output result of the pressure feature prediction model is set as the fusion of the low volatility prediction result and the high volatility prediction result.
[0122] The above low volatility sequence ARIMA prediction module is established based on a seasonal autoregressive integrated moving average model, and this module focuses on predicting the trend and relatively smooth low volatility component obtained by decomposition.
[0123] The above high volatility sequence TCN-LSTM prediction module is established based on a physically constrained TCN-LSTM (time convolution network-long short-term memory) model, which is used to predict the high volatility component caused by bubble strong turbulence. The module includes a TCN main network, a physically constrained layer, a fully connected layer, and an LSTM prediction network arranged in sequence. The TCN main network includes an input layer, two stacked deformable convolution layers (the dilation rate increases exponentially through two deformable convolution layers), and a residual connection layer. Each deformable convolution layer is provided with a ReLU activation function layer and a Dropout regularization layer after convolution operation, and a bubble motion attention mechanism is arranged after the last deformable convolution layer. The physically constrained layer is based on the common fluid mechanics constraint of pipeline resonance characteristics and fluid mechanics continuity equation; the fully connected layer is used to reduce the dimension of the output features of the physically constrained layer; the LSTM prediction network includes an input layer, a hidden layer, and a linear output layer. The hidden layer of the LSTM captures the long-range dependence in the time dimension through the gating mechanism, generates pressure prediction values that meet the fluid dynamics law by combining the memory cell state update mechanism, and outputs the prediction values through a linear output layer. Moreover, the low volatility prediction result of the low volatility sequence ARIMA prediction module is incorporated into the TCN main network, and the output result of the LSTM prediction network is the fusion of the low volatility prediction result and the high volatility prediction result. The fusion means that the low volatility prediction result and the high volatility prediction result are added point by point to obtain the overall prediction result of the future pressure of the pipeline.
[0124] Specifically, for the deformable convolution layer in the TCN backbone network, it adjusts the sampling position of the convolution kernel dynamically, adapts to the nonlinear change of the bubble motion trajectory, and captures the local features of the pressure fluctuation. Its convolution process is as follows:
[0125] The sampling position of the convolution is adjusted by dynamically learning the offset, so as to capture the non-rigid transformation. Specifically, an offset field is generated by a deformable convolution layer, assuming that the input is The offset field is:
[0126] ;
[0127] In the formula, is the offset field, is the input feature window, is the batch size, is the sequence length, is the offset convolution layer, is the convolution kernel size;
[0128] Then a standard uniform sampling grid is created, and the learned offset is added to obtain the offset sampling grid as follows:
[0129] , ;
[0130] ;
[0131] In the formula, is the normalized coordinate of the position , is the index position sequence number, is the sequence length, is the offset sampling grid vector;
[0132] Then the input feature map (i.e. the feature matrix composed of the pressure time series data in the sample set) is sampled according to the offset grid using the bilinear interpolation method, and finally the regular convolution is performed on the sampled grid.
[0133] Specifically, for the bubble attention mechanism introduced in the TCN backbone network, it is designed for the bubble motion characteristics in gas-liquid two-phase flow, and dynamically captures the physical trajectory changes of bubble motion through the deformable convolution technology, and combines with the Reynolds number adaptive mechanism to perceive the flow state conversion. The mechanism specifically includes an input layer, a feature extraction convolution layer, a Reynolds number adaptive layer, a feature fusion layer, and a weighted output layer arranged in turn. Among them, the feature extraction convolution layer includes a first deformable convolution channel for bubble speed feature extraction and a second deformable convolution channel for bubble occurrence frequency feature extraction arranged in parallel, and the bubble speed feature and the bubble occurrence frequency feature are used to accurately reflect the motion mode of the bubble group; the Reynolds number adaptive layer is used to monitor the pressure fluctuation characteristics in real time to calculate the Reynolds number, and to judge the laminar flow and turbulent flow state changes according to the Reynolds number and dynamically adjust the bubble speed feature and the bubble occurrence frequency feature weight; the feature fusion layer is used to splice the weights of the bubble speed feature and the bubble occurrence frequency feature in the channel dimension, and then perform 1x1 convolution, and generate a dynamic attention weight matrix through the Sigmoid activation function, and the weighted output layer is used to multiply the attention weight matrix with the input feature map of the input bubble attention mechanism to obtain a weighted feature map, realizing the spatial adaptability of the feature map. The recalibration strengthens the feature expression of the key mode of bubble motion.
[0134] The above attention weight matrix is also called attention map, which represents the spatio-temporal weight distribution of the influence of bubble motion on pipeline pressure, and is specifically used to quantify the contribution degree of bubble motion to pressure change at different time points. Its mathematical representation is a weight matrix with the same shape as the input feature map processed by the TCN convolution block (value range [0, 1]), which is used to highlight the influence of key events such as bubble coalescence / breakup and suppress irrelevant noise.
[0135] For the feature extraction convolution layer in the above bubble attention mechanism, the first deformable convolution channel includes a deformable convolution layer and a ReLU activation function, and the deformable convolution layer with ReLU activation is used to extract a bubble motion speed feature vector from the pressure fluctuation signal; the second deformable convolution channel includes a deformable convolution layer and a Sigmoid activation function, and the convolution layer with Sigmoid activation is used to capture a bubble occurrence frequency feature vector; wherein, for the bubble motion speed feature vector extraction, the bubble speed and bubble acceleration data calculated in the data preprocessing process can be directly extracted; for the bubble occurrence frequency feature vector, it is obtained according to the nonlinear characteristics of pressure fluctuation, such as points of pressure steep increase and pressure sudden drop.
[0136] For the Reynolds number adaptive layer in the above bubble attention mechanism, the specific process of adjusting the feature weight of the Reynolds number adaptive layer is as follows:
[0137] First, the fluid flow rate is estimated using the pressure fluctuation data (i.e. the displacement of the pressure data in the time step), that is:
[0138] ;
[0139] wherein, is the average fluid flow rate, is the fluid velocity at a specific pressure feature over a time step, is the time step, is the total time step;
[0140] Then the Reynolds number is calculated based on the fluid flow rate, that is:
[0141] ;
[0142] wherein, is the Reynolds number, is the fluid density, is the fluid viscosity, is the pipe diameter;
[0143] Then the scaling factor is calculated according to the Reynolds number, so as to normalize, and the expression is:
[0144] ;
[0145] wherein, is the scaling factor, is the fully connected network;
[0146] Finally, the feature weight is adjusted by using the above scaling factor, that is:
[0147] ;
[0148] wherein, is the adjusted feature weight, is the feature weight before adjustment.
[0149] In addition, when adjusting the feature weight by using the scaling factor, the flow state change is judged according to the size of the Reynolds number, that is, whether it belongs to the laminar flow or the turbulent flow, when it is detected that the Reynolds number is close to the critical value of the flow state change, it is indicated that the turbulent flow occurs, and then the bubble speed feature weight and the bubble generation frequency feature weight of the turbulent flow are automatically enhanced by using the scaling factor. In the embodiment, the Reynolds number critical value of the pipe fluid obtained is 3000, that is, when the calculated Reynolds number is close to 3000, it is indicated that the turbulent flow occurs, and in the embodiment, it is set that the turbulent flow occurs when the Reynolds number is greater than or equal to 3000.
[0150] Specifically, for the above-mentioned physical constraint layer, the pipeline resonance characteristics are analyzed according to the pipeline geometric parameters, and are converted into frequency domain constraint conditions, that is, the fluid mechanics constraints are imposed on the characteristics in the frequency domain space, the energy distribution of the resonance peak region is dynamically adjusted through the learnable frequency suppression coefficient, and at the same time, the pressure amplitude constraint is performed based on the pipeline safety parameters, so as to ensure that the prediction value does not exceed the maximum pressure bearing limit of the pipeline; in addition, the fluid mechanics continuity equation is embedded, so as to ensure that the prediction result meets the law of conservation of mass. The physical constraint layer performs fluid mechanics constraints through the pipeline resonance characteristics and the fluid mechanics continuity equation, so as to ensure that the prediction result is not only statistically accurate, but also meets the fluid dynamics law.
[0151] wherein the frequency domain constraint based on the pipeline resonance characteristics is expressed as:
[0152] ;
[0153] ;
[0154] ;
[0155] In the formula, is the frequency domain representation obtained after fast Fourier transform, is the fast Fourier transform, is the output pressure signal; is the frequency spectrum amplitude after suppression processing at the resonance frequency , is the original frequency spectrum amplitude at the specific resonance frequency , is the learnable frequency suppression coefficient; is the final output time domain pressure signal, is the inverse fast Fourier transform, which is an algorithm for converting the signal from the frequency domain back to the time domain; is the resonance frequency calculated based on the pipeline length and the sound speed , and ;
[0156] The pressure amplitude constraint based on the pipeline safety parameters is expressed as:
[0157] ;
[0158] In the formula, is the output pressure signal, represents a truncation function, is the input pressure signal, 0 is the lower limit of pressure, is the maximum value of the predicted pressure, so as to ensure that the pressure does not exceed the maximum bearing value of the pipeline;
[0159] The fluid continuity equation constraint is expressed as:
[0160] ;
[0161] Where, For The first-order difference of pressure in the time step, that is, the rate of change of pressure; For The raw predicted pressure value at the time step, For The raw predicted pressure value at the time step;
[0162] Based on the above fluid continuity equation constraints, the obtained first-order difference of pressure is further constrained in the frequency domain, and the expression is:
[0163] ;
[0164] ;
[0165] Where, is the first-order difference sequence The frequency domain representation obtained after fast Fourier transform is: is the pressure first-order difference sequence, that is, the set of pressure first-order differences in the above continuity equation constraints, is the Fast Fourier Transform; is the attenuation coefficient, It is a mask used to select the frequency region that needs to be attenuated near the resonant frequency. is the frequency domain signal after frequency domain constraint processing;
[0166] The processed frequency domain signal is inversely transformed back to the time domain, and the expression is:
[0167] ;
[0168] Where, is the inverse fast Fourier transform; The processed frequency domain signal is passed through Convert back to the first-order difference series in the time domain;
[0169] The reconstructed pressure sequence is:
[0170] ;
[0171] Where, is the reconstructed pressure series for the previous time step; The physical compliance pressure sequence finally output for the current time step.
[0172] S4, for the pressure feature prediction model established in step S3, the low volatility sequence ARIMA prediction module is trained by using the training set of low volatility sequence data, and the high volatility sequence TCN-LSTM prediction module is trained by using the training set of high volatility sequence data. When the loss function converges and reaches the preset value, the iteration is ended, and the trained pressure feature prediction model is obtained.
[0173] Specifically, in the training process, the training engine adopts a double loss function; when the optimizer performs back propagation with gradient clipping, the physical constraint layer synchronously applies the pipe resonance frequency and fluid continuity equation constraints to attenuate the amplitude of the feature spectrum after FFT transformation in the natural frequency interval; at the same time, the Reynolds number adaptive layer in the training process monitors the pressure fluctuation feature in real time, and automatically enhances the feature weight in the turbulent state when the estimated Reynolds number approaches the critical value 3000; the learning rate scheduler dynamically adjusts the optimization step based on the validation loss, and triggers the learning rate halving operation when the loss platform lasts for 5 cycles; when the double loss function converges and reaches the preset value, the iteration is ended, and the finally trained network parameters are solidified to the prediction engine to form an intelligent prediction model that is trained and has the bubble motion trajectory perception ability and the fluid mechanics law compliance characteristics.
[0174] In addition, the ARIMA prediction module in the above training process determines the optimal parameters of the model through an automatic order determination algorithm, trains the model using a compound iteration method, and then outputs the multi-step prediction results of the low volatility component; then, based on the information criterion, the optimal model order is selected, the model parameters are estimated and fitted, and the rolling prediction is performed; in the rolling prediction process, the model performs the next step prediction based on the current training data; then, the real next step observation value is included in the training set, and the model is refitted; the next next step is predicted, and the iteration is continued until the prediction of the entire test sequence is completed. This mechanism ensures that the prediction process can continuously adapt to the latest changes in the data, thereby achieving mature training.
[0175] In addition, a double loss function combining prediction error and physical constraint error (second-order difference similarity) is used for joint training in the above training process. The double loss function includes a main loss function for calculating the mean square error of the predicted value and the true value, and an auxiliary physical loss function for evaluating the similarity of the second derivative of the pressure to ensure that the predicted waveform conforms to the laws of fluid mechanics.
[0176] wherein the main loss function is a mean square error function (MSE), i.e.:
[0177] ;
[0178] wherein, is the mean square error loss, is the number of samples, is the first The true value of the sample, For the The predicted value of samples;
[0179] The auxiliary physical loss function is:
[0180] ;
[0181] in, is the physical loss, i.e. the second-order difference loss, is the number of samples, For the The true second-order difference of the sample, For the The second-order difference of the predicted values of the samples.
[0182] S5. Use the test sets of low-volatility sequence data and high-volatility sequence data to test the mature pressure feature prediction model trained in step S4 to evaluate the final performance of the pressure feature prediction model.
[0183] When evaluating the established pressure characteristic prediction model, conventional indicators are used to evaluate the overall deviation between the predicted value and the true value, and special indicators targeting the characteristics of gas-liquid two-phase flow are used to evaluate the model's ability to capture the unique phenomena of gas-liquid two-phase flow.
[0184] Among them, conventional indicators include mean square error (MSE), root mean square error (RMSE), mean absolute percentage error (MAPE) and coefficient of determination (R 2 ) etc.; special indicators include peak capture accuracy, volatility error, and direction accuracy.
[0185] The aforementioned spike capture accuracy focuses on the ability to quantify the ability to predict pressure transient events caused by bubble bursts. It is calculated based on the set of all spike points on the actual pressure curve that exceed the dynamic threshold. The prediction sequence is statistically checked to see if there are matching points within 5 sampling steps of each actual spike time. The final evaluation value is the ratio of correctly matched spikes to the total number of spikes. This is used to calculate the proportion of actual pressure spikes that were successfully predicted by the model within a reasonable time offset (e.g., within 5 time steps). The calculation formula is:
[0186] ;
[0187] Where, is the peak capture accuracy, is the actual peak set, is the indicator function, is the predicted peak pressure feature, To predict the time step corresponding to the spike, is the time step corresponding to the actual spike;
[0188] The above volatility error is used to measure the degree of consistency between the predicted sequence and the actual sequence in terms of pressure change intensity. By comparing the mathematical expectation difference of the absolute difference between adjacent time steps of the two sequences, and calculating the relative error based on the actual volatility expectation value to eliminate the dimension effect, it is used to measure whether the pressure change amplitude predicted by the model is close to the actual pressure change amplitude. The calculation formula is:
[0189] ;
[0190] Where, is the volatility error, To predict the amount of pressure fluctuation; is the actual pressure fluctuation, is the mathematical expectation;
[0191] Directional accuracy is divided into two categories. The first category examines whether the direction of change (increase or decrease) of the predicted value relative to the actual value of the previous time step is consistent with the true trend. The second category verifies whether the direction of change of adjacent steps in the predicted value sequence itself is synchronized with the actual pressure change. The two categories evaluate the ability to capture pressure change trends from the two dimensions of external reference and internal self-consistency. The calculation formulas are:
[0192] ;
[0193] ;
[0194] Where, is the first type of direction accuracy, is the second type of direction accuracy, is the indicator function, is a sign function that determines whether the pressure is rising (+1), falling (-1), or remaining unchanged (0) by judging the sign of the pressure fluctuation. is the time step, is the total time step, that is, the total number of pressure sequence samples used to calculate the accuracy, for The predicted pressure value at the time step, for The predicted pressure value at the time step, for The actual pressure value of the time step, for The actual pressure value of the time step, for The predicted pressure fluctuation amount for the time step, for The actual pressure fluctuation amount for the time step.
[0195] The three types of special indicators form a multi-angle evaluation framework for strong transient and high noise characteristics of gas-liquid two-phase flow, overcoming the evaluation limitations of traditional mean square error in pressure mutation scenarios. The peak capture accuracy is directly related to the safety warning value of bubble movement prediction, the fluctuation rate error reflects the simulation accuracy of turbulent mixing state, and the double direction accuracy ensures the reliability of adjusting process parameters based on the prediction results.
[0196] S6, input the known pressure time series data of the multiphase flow in the pipeline to be predicted into the trained pressure feature prediction model, and use the trained pressure feature prediction model to predict the future pressure time series of the multiphase flow in the pipeline.
[0197] S7, based on the prediction result of step S6, identify the flow pattern and calculate the bubble dynamics related parameters, and comprehensively analyze the pressure characteristics of the gas-liquid multiphase flow in the pipeline.
[0198] Among them, the flow pattern recognition is based on dynamic window wavelet analysis technology and statistical characteristics (kurtosis / fluctuation rate) to identify the gas-liquid mixing state in the pipeline, such as bubble flow, slug flow or turbulent flow mode. The above gas-liquid mixing state is accurately classified by setting three characteristic thresholds:
[0199] When the average absolute pressure change value in 5 consecutive pressure windows is greater than 50% of the average pressure value, it is determined to be dispersed bubble flow, at this time the bubbles are uniformly distributed and the fluctuation is violent;
[0200] When the peak pressure in the same pressure window is detected for 30 consecutive time steps, the peak pressure is more than 1.5 times the average pressure value, it is determined to be slug flow, which represents the periodic impact of large bubble groups blocking the pipeline;
[0201] If the pressure fluctuation standard deviation in the current pressure window increases significantly, more than 20% of the historical fluctuation standard deviation benchmark value, it is determined to be turbulent flow, reflecting the turbulent state of the gas-liquid interface height.
[0202] The average pressure value and standard deviation are calculated based on the real-time sliding window.
[0203] The bubble dynamics related parameters mainly include bubble volume fraction, coalescence and breakup rate and other key parameters, which are used to quantify the two-phase flow characteristics.
[0204] Among them, the bubble volume fraction is calculated according to the pressure fluctuation amplitude, and the calculation formula is:
[0205] ;
[0206] In the formula, is the bubble volume fraction, is the pressure fluctuation in the pipeline, is the fluid density, is the gravitational acceleration, is the pipe diameter;
[0207] The bubble coalescence and breakup rate is calculated according to the pressure spike frequency, and the calculation formula is:
[0208] ;
[0209] In the formula, is the bubble coalescence and breakup rate, is the bubble number (represented by the spike number), is the bubble number change rate, is the average bubble number (the average of the actual and predicted spike numbers), is the pressure change rate.
[0210] Based on the future pressure time series of the multiphase flow in the pipe predicted by the above step S6 and the kinetic parameters including the bubble volume fraction and the coalescence and breakup rate calculated by step S7, a complete pressure prediction and analysis is formed, and a reference is provided for safety warning at the same time.
[0211] Referring to Figure 3 , the pressure feature prediction model trained according to the above prediction method is tested by using the test set, and from Figure 3 it can be seen that the pressure fluctuation curve of the predicted value and the actual value is basically coincident. In addition, according to the prediction results, the conventional indicators and special indicators are calculated, for the conventional indicators, the mean square error (MSE) is 0.092, the mean absolute percentage error (MAPE) is 4.27%, and the determination coefficient R 2 is 0.913; for the special indicators, the spike capture accuracy is 95.7%, the fluctuation rate error is 5.3%, the first type direction accuracy is 96.73%, and the second type direction accuracy is 97.8%.
[0212] From the comparison chart of the predicted value and the actual value and the evaluation index data, it can be seen that the model established by the method of the present application can accurately predict the nonlinear pressure characteristics of the gas-liquid two-phase flow in the pipe.
[0213] Of course, the above description is not a limitation of the present application, and the present application is not limited to the above examples. Changes, modifications, additions or replacements made by those skilled in the art within the essential scope of the present application should also be within the protection scope of the present application.
Claims
1. A method for predicting pressure characteristics of multiphase flow in pipelines based on bubble attention mechanism, characterized in that: Including steps: S1. Obtain time series data of gas-liquid multiphase flow pressure of different flow patterns in the pipeline, perform data preprocessing, and divide it into training and test sets; S2, decomposing the preprocessed pressure time series data into low-volatility series data and high-volatility series data; S3. Establish a pressure feature prediction model consisting of a low-volatility sequence ARIMA prediction module and a high-volatility sequence TCN-LSTM prediction module, and set the output of the pressure feature prediction model to be a fusion of the low-volatility prediction result and the high-volatility prediction result; S4. Based on the pressure feature prediction model established in step S3, the low-volatility sequence ARIMA prediction module is trained using the training set of the low-volatility sequence data, and the high-volatility sequence TCN-LSTM prediction module is trained using the training set of the high-volatility sequence data. When the loss function converges and reaches a preset value, the iteration ends, and a mature pressure feature prediction model is obtained. S5. Testing the pressure feature prediction model trained in step S4 using a test set of low-volatility sequence data and high-volatility sequence data to evaluate the final performance of the pressure feature prediction model; S6. Inputting the known pressure time series data of the multiphase flow in the pipeline to be predicted into a well-trained pressure feature prediction model, and using the well-trained pressure feature prediction model to predict the future pressure time series of the multiphase flow in the pipeline; S7. Based on the prediction result of step S6, the flow pattern is identified and the bubble dynamics-related parameters are calculated, and the pressure characteristics of the gas-liquid multiphase flow in the pipeline are comprehensively analyzed.
2. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1 is characterized in that: The data preprocessing process in step S1 is as follows: S11. performing time alignment correction on the obtained gas-liquid multiphase flow pressure time series data of different flow patterns in the pipeline, filling in missing values, and making the data complete; S12, performing physical range filtering on the pressure time series data after time alignment correction to remove obviously abnormal data; S13. Perform industrial noise processing on the pressure time series data after physical range filtering. Eliminate the air pump vibration noise using a 45-55 Hz Butterworth band-stop filter. Use the gradient threshold method to accurately locate the effective bubble peaks and exclude pseudo-peaks that appear continuously within 5 ms. S14, performing feature derivation processing on the pressure time series data, that is, calculating the pressure difference between adjacent sampling points to generate a pressure gradient feature, obtaining a bubble velocity feature based on the time step corresponding to the pressure gradient feature, and performing first-order difference processing on the bubble velocity feature to obtain an acceleration feature to characterize the acceleration of the pressure change; S15, performing normalization and scaling processing on the pressure time series data, and linearly scaling the pipeline working pressure range to the interval [-1, 1]; S16. The normalized and scaled data is used as sample data and converted into a supervised learning format. The sliding window is used to generate input vectors and output vectors to construct a sample set.
3. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: When performing moving average decomposition on the pressure time series data preprocessed in step S1 in step S2, a kurtosis optimization algorithm is used to determine the optimal moving average window period, and the pressure time series data is decomposed into low-volatility sequence data and high-volatility sequence data using the optimal moving average window period to form a dual-channel data matrix.
4. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: In step S3, the high volatility sequence TCN-LSTM prediction module is established based on the physically constrained TCN-LSTM model, specifically including: The TCN backbone network includes an input layer, at least two stacked deformable convolution layers and a residual connection layer. Each deformable convolution layer is provided with a ReLU activation function layer and a Dropout regularization layer after the convolution operation, and a bubble motion attention mechanism is introduced after the terminal deformable convolution layer. A physical constraint layer, wherein the physical constraint layer performs fluid dynamics constraints based on pipeline resonance characteristics and fluid dynamics continuity equations; An LSTM prediction network includes an input layer, a hidden layer, and a linear output layer. The hidden layer of the LSTM captures long-range dependencies in the time dimension through a gating mechanism, combines a memory unit state update mechanism to generate a pressure prediction value that conforms to the laws of fluid dynamics, and outputs the prediction value through a linear output layer. The low volatility prediction result of the low volatility sequence ARIMA prediction module is incorporated into the TCN backbone network, and the output result of the LSTM prediction layer of the high volatility sequence TCN-LSTM prediction module is a fusion of the low volatility prediction result and the high volatility prediction result.
5. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 4 is characterized in that: The bubble attention mechanism includes a feature extraction convolution layer, a Reynolds number adaptation layer, a feature fusion layer, and a weighted output layer arranged in sequence; The feature extraction convolution layer includes a first deformable convolution channel for extracting bubble velocity features and a second deformable convolution channel for extracting bubble frequency features, which are arranged in parallel; The Reynolds number adaptive layer is used to monitor the pressure fluctuation characteristics in real time to calculate the Reynolds number, judge the laminar flow and turbulent flow state changes according to the Reynolds number, and dynamically adjust the bubble velocity characteristics and bubble frequency characteristics weights; The feature fusion layer is used to splice the bubble velocity feature and the bubble occurrence frequency feature in the channel dimension to generate a dynamic attention weight matrix; The weighted output layer is used to perform element-wise multiplication of the attention weight matrix and the input feature map of the input bubble attention mechanism to obtain a weighted feature map and output it.
6. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 4, characterized in that: The constraint operations performed by the physical constraint layer include: Based on the frequency domain constraint of pipeline resonance characteristics, the expression is: ; ; ; Where, is the frequency domain representation obtained after fast Fourier transform, is the fast Fourier transform, To output pressure signal; At the resonant frequency The spectrum amplitude after suppression processing is At a specific resonant frequency The original spectrum amplitude at is the learnable frequency suppression coefficient; is the final output time domain pressure signal, An algorithm for inverse fast Fourier transform, which converts the signal from the frequency domain back to the time domain; Based on the pipe length Harmony The calculated resonant frequency, and ; The pressure amplitude constraint based on pipeline safety parameters is expressed as: ; Where, To output pressure signal, represents the truncation function, is the input pressure signal, 0 is the lower limit of pressure, The maximum pressure after prediction is to ensure that the pressure does not exceed the maximum bearing value of the pipeline; The fluid continuity equation constraint is expressed as: ; Where, For The first-order difference of pressure in the time step, that is, the rate of change of pressure; For The raw predicted pressure value at the time step, For The raw predicted pressure value at the time step; Based on the fluid continuity equation constraint, the obtained first-order pressure difference is further constrained in the frequency domain, and the expression is: ; ; Where, is the first-order difference sequence The frequency domain representation obtained after fast Fourier transform is: is the pressure first-order difference sequence, that is, the set of pressure first-order differences in the above fluid continuity equation constraints, is the Fast Fourier Transform; is the attenuation coefficient, It is a mask used to select the frequency region that needs to be attenuated near the resonance frequency. is the frequency domain signal after frequency domain constraint processing; The processed frequency domain signal is inversely transformed back to the time domain, and the expression is: ; Where, is the inverse fast Fourier transform; The processed frequency domain signal is passed through Convert back to the first-order difference series in the time domain; The reconstructed pressure sequence is: ; Where, is the reconstructed pressure series for the previous time step; The physical compliance pressure sequence finally output for the current time step.
7. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: The damage function used in the training process of step S4 is a dual loss function combining prediction error and physical constraint error; The dual loss function includes a main loss function for calculating the mean square error between the predicted value and the true value, and an auxiliary physical loss function for evaluating the similarity of the second-order derivative of pressure to ensure that the predicted waveform conforms to the laws of fluid mechanics; Among them, the main loss function is the mean square error function, that is: ; Where, is the mean square error loss, is the number of samples, For the The true value of the sample, For the The predicted value of samples; The auxiliary physical loss function is: ; in, is the physical loss, i.e. the second-order difference loss, is the number of samples, For the The true second-order difference of the sample, For the The second-order difference of the predicted values of the samples.
8. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: In step S5, when evaluating the established pressure characteristic prediction model, conventional indicators are used to evaluate the overall deviation between the predicted value and the true value, and special indicators for gas-liquid two-phase flow characteristics are used to evaluate the model's ability to capture the unique phenomena of gas-liquid two-phase flow; The conventional indicators include at least one of mean square error, root mean square error, mean absolute percentage error and coefficient of determination; The special indicators include peak capture accuracy, volatility error and direction accuracy; The calculation formula for the peak capture accuracy is: ; Where, is the peak capture accuracy, is the actual peak set, is the indicator function, is the predicted peak pressure feature, To predict the time step corresponding to the spike, is the time step corresponding to the actual spike; The calculation formula for volatility error is: ; Where, is the volatility error, To predict the amount of pressure fluctuation; is the actual pressure fluctuation, is the mathematical expectation; There are two types of directional accuracy. The first type examines whether the direction of change of the predicted value relative to the actual value of the previous time step conforms to the true trend. The second type verifies whether the direction of change of adjacent steps in the predicted value sequence itself is synchronized with the actual pressure change. The calculation formulas are: ; ; Where, is the first type of direction accuracy, is the second type of direction accuracy, is the indicator function, It is a sign function that determines whether the pressure is rising, falling or remaining unchanged by judging the positive or negative value of the pressure fluctuation. is the time step, is the total time step, that is, the total number of pressure sequence samples used to calculate the accuracy, for The predicted pressure value at the time step, for The predicted pressure value at the time step, for The actual pressure value of the time step, for The actual pressure value of the time step, for The predicted pressure fluctuation amount for the time step, for The actual pressure fluctuation amount for the time step.
9. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: In step S7, the flow pattern recognition is based on the dynamic window wavelet analysis technology and statistical characteristics to identify the gas-liquid mixing state in the pipeline, and classification is achieved by setting three characteristic thresholds: When the average absolute pressure change value within five consecutive pressure windows is greater than 50% of the historical average pressure value, it is determined to be diffuse bubble flow; When the peak pressure detected in 30 consecutive time steps within the same pressure window exceeds 1.5 times the average pressure level, it is judged as slug flow; If the standard deviation of pressure fluctuations within the current pressure window increases significantly and exceeds 20% of the baseline value of the historical fluctuation standard deviation, it is judged to be a churning flow.
10. The method for predicting pressure characteristics of multiphase flow in a pipeline based on a bubble attention mechanism according to claim 1, characterized in that: The bubble dynamics-related parameters in step S7 include bubble volume fraction and coalescence and breakage rate; Among them, the bubble volume fraction is calculated according to the pressure fluctuation amplitude, and the calculation formula is: ; Where, is the bubble volume fraction, is the pressure fluctuation in the pipeline, is the fluid density, is the acceleration due to gravity, is the pipe diameter; The bubble coalescence and breakage rate is calculated based on the change in pressure peak frequency. The calculation formula is: ; Where, is the bubble coalescence and breakage rate, is the number of bubbles, is the bubble number change rate, is the average number of bubbles, is the pressure change rate.
Citation Information
Patent Citations
Air compression station mother pipe pressure prediction method and system based on time sequence
CN115544863A
Deep-sea mining multiphase flow particle conveying prediction and regulation method based on flow pattern recognition
CN120046536A