Rundulating topography gas-liquid two-phase pipeline virtual metering method based on flow pattern self-adaption
By constructing an equivalent Reynolds number to distinguish flow types and adopting an adaptive machine learning model, the problem of large measurement errors in undulating pipelines caused by traditional methods is solved, and low-cost, high-precision gas-liquid two-phase flow prediction is achieved.
Patent Information
- Application Number
- CN202510649530.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-10-17
AI Technical Summary
Traditional gas-liquid two-phase flow measurement methods have low accuracy under complex working conditions. Existing virtual metering methods are difficult to adapt to variable working conditions and nonlinear relationships, especially in undulating pipelines where measurement errors are large. Existing machine learning models have low prediction accuracy under cross-flow conditions and cannot effectively distinguish flow type characteristics.
Based on the flow type adaptation method, the flow types are distinguished by constructing the equivalent Reynolds number, and the BP neural network, SVR and RF models are used to adapt to different flow types respectively. The gas flow rate is predicted using parameters such as pipe diameter, pressure drop, and inclination angle, reducing dependence on physical sensors.
It reduces the dependence on physical sensors, reduces equipment costs, improves the accuracy and adaptability of gas-liquid two-phase flow measurement, and is suitable for gas field development in undulating terrain.
Smart Images

Figure CN120805639A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural gas gathering and transportation engineering, in particular to a virtual metering method for gas-liquid two-phase pipelines in undulating terrain based on flow pattern self-adaptation. BACKGROUND
[0002] Traditional gas-liquid two-phase flow metering methods rely on physical sensors (such as differential pressure flow meters, ultrasonic flow meters, etc.), which have problems such as high equipment cost, complex maintenance, and susceptibility to working conditions. The measurement accuracy of physical sensors is low under complex working conditions (such as high liquid holdup and low flow rate). Existing virtual metering methods are mostly based on empirical formulas or simple mathematical models, which are difficult to adapt to changing working conditions and nonlinear relationships.
[0003] However, the influence of complex terrain (such as changes in upward and downward inclination angles) and fluid characteristics (such as changes in water cut) on flow metering has not been fully addressed. In undulating pipelines, gas-liquid two-phase flow is prone to form complex flow patterns such as slug flow and stratified flow due to the coupling of gravitational and inertial forces. Traditional single-phase metering instruments (such as orifice plates and turbines) have errors as high as 20%-30%.
[0004] Existing machine learning methods do not distinguish flow pattern characteristics, and a single machine learning model has a significant drop in prediction accuracy under cross-flow pattern conditions, especially in the Reynolds number transition zone (2000≤Re≤4000). The modeling capability for the nonlinear dynamics of transitional flow and laminar flow is insufficient, and most virtual metering methods assume steady-state turbulent flow and ignore dynamic changes in flow patterns, resulting in poor model universality.
[0005] There is a need for a low-cost, high-precision, and applicable gas-liquid two-phase virtual metering method for undulating pipelines on the ground gathering and transportation. It is necessary to use machine learning technology to predict gas flow through a small number of easily measured parameters (such as pipe diameter, pressure drop, upward and downward inclination angles of the pipeline, water cut, temperature, etc.), reducing the dependence on physical sensors. Gas wells in undulating terrain account for 34%, and a low-cost virtual metering solution that adapts to dynamic changes in flow patterns is urgently needed. It is necessary to address the influence of complex terrain and flow pattern characteristics on flow metering. SUMMARY
[0006] The present application aims to solve the above problems and proposes a virtual metering method for gas-liquid two-phase pipelines in undulating terrain based on flow pattern self-adaptation.
[0007] The technical solution of the present application is as follows: A virtual metering method for gas-liquid two-phase pipelines in undulating terrain based on flow pattern self-adaptation, the method is as follows: an equivalent Reynolds number related to a terrain correction factor is constructed, the flow pattern is distinguished based on the equivalent Reynolds number, and a machine learning prediction model that adapts to the flow pattern is adapted according to the flow pattern distinguished by the equivalent Reynolds number, thereby realizing the prediction of gas flow.
[0008] The distinguishing of the flow pattern at the equivalent Reynolds number is: laminar flow when Re*≤2300, transition flow when 2300
[0009] The specific solving process of the equivalent Reynolds number is: Re*= Re·(1+k); Wherein, Re=ρvd / μ;k= sinθ eff ·(1+0.1ΔP / L) ·Γ;Γ=1+0.05(∣θ 上 -θ 下 ∣ / 10°) 1.2 ; ; In the formula: Re* is the equivalent Reynolds number, dimensionless; Re is the Reynolds number, dimensionless; k is the terrain correction factor, dimensionless; ρ is the fluid density, kg / m 3 ; v is the apparent flow velocity of the fluid, m / s; d is the pipe diameter, m; μ is the fluid viscosity, Pa·s; θ eff is the comprehensive inclination angle of the pipe, °; ΔP / L is the pressure drop per unit length, kpa / km; L is the total length of the pipe, km; ΔP is the calculated pressure drop, kpa; Γ is the terrain fluctuation coefficient, dimensionless °; θ 上 is the upward inclination angle of the pipe, °; θ 下 is the downward inclination angle of the pipe, °; N is the total number of pipe segments according to the inclination angle change, and any segment is represented by i, L i is the length of the i-th pipe segment, m; θ ᵢ is the inclination angle of the i-th pipe segment, °.
[0010] When the flow pattern is laminar flow, the machine learning prediction model corresponding to the laminar flow is a BP neural network prediction model; when the flow pattern is transition flow, the machine learning prediction model corresponding to the transition flow is an SVR prediction model; and when the flow pattern is turbulent flow, the machine learning prediction model corresponding to the turbulent flow is an RF prediction model.
[0011] When the machine learning prediction model is a BP neural network prediction model, the BP neural network is created by a feedforwardnet function, which includes an input layer, an output layer and two hidden layers; wherein the first layer of the hidden layer has 10 neurons and the second layer has 5 neurons; the input layer has 7 neurons and the output layer has 1 neuron.
[0012] When the machine learning prediction model is an SVR prediction model, the kernel function is an RBF kernel function, the kernel parameter γ=0.05, the balance penalty coefficient C=50 and the tolerance band of prediction error insensitive loss ε=0.03 after the hyperparameter optimization by grid search combined with 5-fold cross-validation.
[0013] When the machine learning prediction model is the RF model, Bootstrap theory is used for sample sampling, the number of decision trees is 100, the maximum depth is 2, the minimum number of sample splits is 2, and the minimum number of sample leaves is 1; the feature selection method is Entropy, and the random seed is fixed.
[0014] When predicting gas flow using a machine learning prediction model that is adaptive to the flow pattern, the actual data is standardized and preprocessed. 70% of the standardized preprocessed data is used to construct a training set for training, and 30% is used to construct a validation set for verification.
[0015] The actual mining data include but are not limited to: pipeline diameter d, calculated pressure drop ΔP, pipeline inclination angle θ 上 、Pipeline down-tilt angle θ 下 , water content W, temperature T, pressure P, superficial flow velocity of the fluid, gas flow velocity v and total length of the pipeline L.
[0016] The technical effects of the present invention are: The present invention reduces dependence on physical sensors, reduces equipment costs, improves the accuracy and adaptability of gas flow prediction in undulating pipelines, and can be widely used in gas-liquid two-phase flow measurement in gas field development. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Flowchart of the present invention.
[0018] Figures 2-4 This is a comparison chart of flow pattern classification predictions of the present invention; in, Figure 2 is the BP neural network prediction model, Figure 3 is the SVR prediction model, Figure 4 It is the RF model.
[0019] Figure 5 This is a comparison chart of the flow pattern classification prediction errors of the present invention. DETAILED DESCRIPTION
[0020] Example 1 A virtual metering method for gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation is proposed. The method is as follows: an equivalent Reynolds number related to a terrain correction factor is constructed, the flow pattern is distinguished by the equivalent Reynolds number, and a machine learning prediction model of flow pattern adaptation and flow pattern adaptation is used according to the equivalent Reynolds number classification to achieve gas flow prediction.
[0021] Example 2 On the basis of Example 1, it further includes that the flow type is distinguished by the equivalent Reynolds number as follows: Re*≤2300 is laminar flow, 2300<Re*≤4000 is transitional flow, and Re*>4000 is turbulent flow.
[0022] When the flow pattern is laminar, the machine learning prediction model corresponding to the laminar flow is a BP neural network prediction model; when the flow pattern is transition flow, the machine learning prediction model corresponding to the transition flow is an SVR prediction model; and when the flow pattern is turbulent flow, the machine learning prediction model corresponding to the turbulent flow is an RF prediction model.
[0023] Embodiment 3 Based on the embodiment 2, further comprising that the specific solving process of the equivalent Reynolds number is: Re*= Re·(1+k); Wherein, Re=ρvd / μ;k= sinθ eff ·(1+0.1ΔP / L) ·Γ;Γ=1+0.05(∣θ 上 -θ 下 ∣ / 10°) 1.2 ; .
[0024] Embodiment 4 Based on the embodiment 3, further comprising that, When the machine learning prediction model is a BP neural network prediction model, the BP neural network is created by a feedforwardnet function, which includes an input layer, an output layer and two hidden layers; wherein the first hidden layer has 10 neurons and the second hidden layer has 5 neurons; the input layer has 7 neurons and the output layer has 1 neuron; When the machine learning prediction model is an SVR prediction model, the kernel function is an RBF kernel function, and after the kernel parameter γ=0.05, the balance penalty coefficient C=50 and the tolerance band of prediction error ε=0.03 are optimized by grid search combined with 5-fold cross-validation, the Bootstrap theory is used for sample sampling, the number of decision trees is 100, the maximum depth is 2, the minimum sample split number is 2, the minimum sample leaf number is 1; the feature selection method is Entropy, and the random seed is fixed. When the machine learning prediction model is an RF model, the Bootstrap theory is used for sample sampling, the number of decision trees is 100, the maximum depth is 2, the minimum sample split number is 2, the minimum sample leaf number is 1; the feature selection method is Entropy, and the random seed is fixed.
[0025] Embodiment 5 Based on the embodiment 4, further comprising that when the gas flow is predicted by the machine learning prediction model adaptive to the flow pattern, the real data is standardized and pretreated, 70% of the data after the standardized pretreatment is used to construct a training set for training, and 30% is used to construct a validation set for validation. The real data includes but is not limited to: pipe diameter d, calculated pressure drop ΔP, pipe upward angle θ 上 , pipe downward angle θ 下, water cut W, temperature T, pressure P, apparent flow rate of fluid gas flow rate v and total length of pipeline L.
[0026] Specific application cases A fluctuating terrain gas-liquid two-phase pipeline virtual metering method based on flow pattern self-adaptation, the method is as follows: Step 1: data acquisition and pretreatment; Using pipe diameter sensor, pressure drop sensor, inclination sensor, water cut sensor, temperature sensor and other equipment, real-time acquisition of gas pipeline parameter data, ensuring the real-time and continuity of data; the real-time data includes but is not limited to: pipe diameter d, calculated pressure drop ΔP, pipe inclination angle θ 上 , pipe inclination angle θ 下 , water cut W, temperature T, pressure P, apparent flow rate of fluid gas flow rate v and total length of pipeline L; and the collected data is standardized pretreated; Step 2: build machine learning prediction model; 70% of the standardized pretreated data is used to build training set for training, and 30% is used to build validation set for validation; The BP neural network prediction model is established by MATLAB software, and the BP neural network is created by feedforwardnet function, which includes input layer, output layer and two hidden layers; wherein, the first layer of hidden layer is 10 neurons, and the second layer is 5 neurons; the input layer is 7 neurons, and the output layer is 1 neuron; The SVR prediction model is established by MATLAB software, the kernel function is RBF kernel function, the hyperparameter optimization is carried out by grid search combined with 5-fold cross validation, the kernel parameter γ=0.05, the balance penalty coefficient C=50, and the tolerance band of prediction error is not sensitive loss ε=0.03; The RF prediction model is established by MATLAB software, Bootstrap theory is used for sample sampling, the number of decision trees is 100, the maximum depth is 2, the minimum sample number is 2, and the minimum sample leaf number is 1; the feature selection method is Entropy, and the random seed is fixed; The validation set is used for evaluation to prevent overfitting in the training process; the evaluation results are shown in Table 1 Table 1 Evaluation results of validation set The results of the BP neural network prediction model are verified by R 2 The results of the BP neural network prediction model are verified by R Figure 2 , the results of the SVR prediction model are verified by R Figure 3 , the results of the RF prediction model are verified by R Figure 4 .
[0027] The prediction results obtained by the method of the present application are compared with the measured flow, and the comparison results are shown in Table 2. Table 2 Comparison results of prediction results (part) and measured flow The flow pattern classification prediction error comparison chart of the present application is shown in Figure 5 .
Claims
1. A virtual metering method for gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation, characterized in that: The method is as follows: construct an equivalent Reynolds number related to the terrain correction factor, use the equivalent Reynolds number to distinguish the flow type, and use the flow type adaptation and flow type self-adaptation machine learning prediction model divided by the equivalent Reynolds number to realize the prediction of gas flow.
2. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 1 is characterized in that: The flow type is distinguished by the equivalent Reynolds number as follows: Re*≤2300 is laminar flow, 2300<Re*≤4000 is transitional flow, and Re*>4000 is turbulent flow.
3. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 2, characterized in that: The specific solution process of the equivalent Reynolds number is: Re*= Re·(1+k); Where, Re=ρvd / μ;k=sinθ eff ·(1+0.1ΔP / L) ·Γ;Γ=1+0.05(∣θ 上 -θ 下 ∣ / 10°) 1.2 ; ; Where: Re* is the equivalent Reynolds number, dimensionless; Re is the Reynolds number, dimensionless; k is the terrain correction factor, dimensionless; ρ is the fluid density, kg / m 3 ; v is the apparent velocity of the fluid, m / s; d is the pipe diameter, m; μ is the fluid viscosity, Pa·s; θ eff is the comprehensive inclination angle of the pipeline, °; ΔP / L is the pressure drop per unit length, kPa / km; L is the total length of the pipeline, km; ΔP is the calculated pressure drop, kPa; Γ is the terrain fluctuation coefficient, dimensionless °; θ 上 is the upward inclination angle of the pipeline, °; θ 下 is the pipeline down-tilt angle, °; N is the total number of segments that the pipeline is divided into according to the change of inclination angle, and any segment is represented by i, L i is the length of the i-th pipe section, m; θ ᵢ is the inclination angle of the i-th pipe section, °.
4. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 2, characterized in that: When the flow type is laminar flow, the machine learning prediction model corresponding to the laminar flow is the BP neural network prediction model; when the flow type is transitional flow, the machine learning prediction model corresponding to the transitional flow is the SVR prediction model; when the flow type is turbulent flow, the machine learning prediction model corresponding to the turbulent flow is the RF prediction model.
5. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 4 is characterized in that: When the machine learning prediction model is a BP neural network prediction model, the BP neural network is created by the feedforwardnet function, which includes an input layer, an output layer and two hidden layers; wherein the first layer of the hidden layer is 10 neurons, and the second layer is 5 neurons; the input layer is 7 neurons, and the output layer is 1 neuron.
6. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 4, characterized in that: When the machine learning prediction model is an SVR prediction model, its kernel function is an RBF kernel function. After hyperparameter tuning using grid search combined with 5-fold cross validation, the kernel parameter γ=0.05, the balance penalty coefficient C=50, and the tolerance band insensitive loss ε of the prediction error are 0.
03.
7. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 4, characterized in that: When the machine learning prediction model is a random forest RF model, Bootstrap theory is used for sample sampling, the number of decision trees is 100, the maximum depth is 2, the minimum number of sample splits is 2, and the minimum number of sample leaves is 1; the feature selection method is Entropy, and the random seed is fixed.
8. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 1, characterized in that: When predicting gas flow using a machine learning prediction model that is adaptive to the flow pattern, the actual data is standardized and preprocessed. 70% of the standardized preprocessed data is used to construct a training set for training, and 30% is used to construct a validation set for verification.
9. The method for virtual metering of gas-liquid two-phase pipelines on undulating terrain based on flow pattern adaptation according to claim 8, characterized in that: The actual mining data include but are not limited to: pipeline diameter d, calculated pressure drop ΔP, pipeline inclination angle θ 上 、Pipeline down-tilt angle θ 下 , water content W, temperature T, pressure P, superficial flow velocity of the fluid, gas flow velocity v and total length of the pipeline L.