An adaptive oil and gas pipeline flow control method
By using dynamic pressure sensors and hidden Markov models in oil and gas pipelines, combined with a weighted fusion of feedforward and model predictive controllers, the problem of poor flow control accuracy under slug flow conditions was solved, achieving high-precision tracking and improved system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHWEST PETROLEUM UNIV
- Filing Date
- 2026-04-23
- Publication Date
- 2026-06-30
AI Technical Summary
Existing flow control methods for oil and gas pipelines have poor control accuracy under slug flow conditions, which can easily cause system oscillations and equipment wear. They are also unable to actively sense and adaptively adjust to the dynamic changes in gas-liquid two-phase flow.
Pressure signals are acquired using dynamic pressure sensors, flow regimes are identified using hidden Markov models, and adaptive valve control commands are generated by weighted fusion of feedforward controllers, model predictive controllers, and proportional-integral-derivative controllers.
It achieves high-precision tracking of slug flow, reduces the impact of flow disturbance, reduces invalid actions of valve actuators, and improves system stability.
Smart Images

Figure CN122308476A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil and gas pipeline transportation and metering technology, and relates to an adaptive oil and gas pipeline flow control method. Background Technology
[0002] In oil and gas mixed-transport pipelines, especially marine risers or undulating onshore pipelines, gas-liquid two-phase flow is a common flow pattern. Slug flow, in particular, poses a serious threat to the stability of downstream flow control systems due to its intermittent flow structure and strong disturbances. Currently, industrial sites commonly employ proportional-integral-derivative (PID) flow control methods based on single-point pressure or differential pressure feedback. This method relies on a time-averaged flow signal provided by a flow meter installed upstream of the valve as feedback. The controller, based on the deviation between the setpoint and the measured flow rate, performs proportional, integral, and derivative calculations to output valve opening commands to regulate the pipeline flow.
[0003] However, in slug flow conditions, when a liquid plug, ten to twenty times the pipe's inner diameter, passes through the flow meter with high kinetic energy, the flow meter detects a sharp, false flow peak signal far exceeding the actual flow rate. Based on this false signal, the proportional-integral-derivative (PID) controller instructs the downstream throttling valve to close excessively; after the liquid plug passes, the ensuing low-density, long bubble region causes a sharp drop in the flow meter reading, and the PID controller then instructs the valve to open abruptly. This "chasing" control action severely degrades flow control accuracy and leads to unstable operating conditions of downstream receiving equipment, pressure oscillations in the pipeline system, and accelerated wear of valve actuators.
[0004] Therefore, there is a need for a flow control method that can actively sense the dynamic changes in the flow pattern of the gas-liquid two-phase flow in the pipeline, predict flow disturbances in advance, and adaptively adjust the control strategy under different flow conditions. This is to overcome the shortcomings of the existing proportional-integral-derivative control method in slug flow conditions, such as poor control accuracy, easy induction of system oscillation, and accelerated equipment wear. Summary of the Invention
[0005] To address the problems existing in the background technology, this invention proposes an adaptive oil and gas pipeline flow control method.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: an adaptive oil and gas pipeline flow control method, applied to an oil and gas pipeline system including a dynamic pressure sensor, a controller, and a throttle valve, comprising the following steps: Acquire dynamic pressure signals collected by dynamic pressure sensors arranged along the pipeline axis, wherein the sampling frequency of the dynamic pressure signals is not lower than a preset frequency threshold. Based on the dynamic pressure signal, the dynamic pressure signal is processed by frame segmentation, and the multidimensional fluid acoustic feature vector of each frame signal is extracted. The multidimensional fluid acoustic feature vector is input into a pre-constructed flow regime identification model. The flow regime identification model calculates and outputs a flow regime confidence vector in real time. Each element in the flow regime confidence vector represents the probability that the current fluid is in different preset fluid dynamic states. Based on the flow confidence vector, calculate the first weighting factor of the feedforward controller and the second weighting factor of the model prediction controller; Based on the first weighting factor and the second weighting factor, the first output of the feedforward controller, the second output of the model prediction controller, and the third output of the proportional-integral-derivative controller are weighted and fused to generate valve control commands. The valve control command is sent to the downstream throttle valve to regulate the pipeline flow.
[0007] Specifically, the extraction of multidimensional fluid acoustic feature vectors includes: The dynamic pressure signal is pre-emphasized to obtain an emphasized signal; The emphasized signal is divided into data frames of a preset frame length, and a window function is applied to each data frame to obtain a windowed data frame; Perform a Fourier transform on the windowed data frame to obtain the amplitude spectrum; The amplitude spectrum is passed through a preset Mel filter bank to obtain a filtered energy spectrum, wherein the frequency range covered by the Mel filter bank includes the characteristic frequency band of the hydroacoustic signal; Perform a discrete cosine transform on the filtered energy spectrum and extract a preset number of coefficients as Mel frequency cepstral coefficient features; Calculate the short-time energy characteristics, short-time zero-crossing rate characteristics, and frequency band energy distribution characteristics of each frame of data; The Mel frequency cepstral coefficient feature, the short-time energy feature, the short-time zero-crossing rate feature, and the frequency band energy distribution feature are concatenated to obtain the multidimensional fluid acoustic feature vector.
[0008] Specifically, the flow regime identification model is a Hidden Markov Model (HMM), which contains several hidden states. These hidden states correspond to various preset fluid dynamic states, including: The multidimensional fluid acoustic feature vector sequence is input into the hidden Markov model; The hidden Markov model is solved using the Viterbi algorithm, and the posterior probability of each hidden state at the current time is calculated in real time. The flow state confidence vector is generated based on the posterior probability of each hidden state.
[0009] Specifically, the hidden states include: a first state, a second state, a third state, a fourth state, and a fifth state; The first state represents stable bubbly flow, the second state represents the slug front, the third state represents the slug body or liquid film region, the fourth state represents long bubbles or stratified flow, and the fifth state represents stable annular flow. In the Hidden Markov Model, the observation probability distribution of each hidden state is characterized by a mixture model of multiple Gaussian components, and the state transition probability matrix and the initial state probability vector are trained from a pre-labeled fluid acoustic feature sample dataset using the Baum-Welch algorithm.
[0010] Specifically, the pre-labeled fluid acoustic feature sample dataset is constructed in the following manner: Mixed density signals are acquired at the upstream and downstream sections of the dynamic pressure sensor, respectively. Based on the mixing density change rate and mixing density standard deviation of the upstream and downstream sections, and according to the preset labeling rules, each frame of dynamic pressure signal is associated with the first state, second state, third state, fourth state, or fifth state to generate training labels.
[0011] Specifically, the calculation of the first weighting factor and the second weighting factor includes: Obtain the first probability value in the flow confidence vector that corresponds to the state of the slug front; The first weighting factor is calculated based on the comparison results between the first probability value and the first preset threshold and the second preset threshold; Obtain at least one second probability value from the flow confidence vector that corresponds to a stable flow pattern; The second weighting factor is calculated based on the second probability value.
[0012] Specifically, the calculation of the first weighting factor and the second weighting factor further includes: When the maximum value of each element in the flow confidence vector is less than the third preset threshold, the first weighting factor and the second weighting factor are both set to zero, so that the valve control command is determined only by the third output of the proportional-integral-derivative controller.
[0013] Specifically, the first output of the feedforward controller is obtained in the following manner: The rate of change of pressure measured by the dynamic pressure sensor at a preset position in the dynamic pressure signal is obtained. When the first probability value is greater than the fourth preset threshold, the first output quantity is calculated based on the difference between the pressure change rate and the dead zone threshold, and the preset feedforward gain. The range of the feedforward gain is predetermined based on the constraint of suppressing slug disturbance and avoiding overcompensation.
[0014] Specifically, the second output of the model prediction controller is obtained in the following manner: Construct a predictive model that includes pipeline state variables; Based on the prediction model, the optimal control sequence that minimizes the cost function is solved in the prediction time domain. The cost function includes a penalty term for the tracking deviation of the flow setpoint and a penalty term for the magnitude of the control increment. The first control variable in the optimal control sequence is used as the second output variable.
[0015] Specifically, the generation of valve control commands includes: Based on the first weighting factor, the second weighting factor, the first output quantity, the second output quantity, and the third output quantity, the valve opening command is calculated according to a preset fusion formula. In the preset fusion formula, the valve opening command is determined by the sum of the product of the first output quantity and the first weight, the product of the second output quantity and the second weight, and the product of the third output quantity and the third weight, wherein the first weight, the second weight, and the third weight are determined by the first weight factor and the second weight factor, respectively.
[0016] Compared with the prior art, the present invention has the following advantages: by extracting multidimensional fluid acoustic feature vectors from dynamic pressure signals in real time and inputting them into a hidden Markov model for online flow regime identification, the invention achieves advance perception of different fluid dynamic states such as the slug front in the pipeline, providing a basis for advance adjustment of control strategies.
[0017] By dynamically adjusting the weighted fusion weights of the feedforward controller, model predictive controller, and proportional-integral-derivative controller based on the flow confidence vector, the control system actively suppresses disturbances with feedforward compensation when the slug front approaches, and achieves high-precision tracking with model predictive control under steady-state flow conditions, thereby reducing the instantaneous flow tracking deviation under slug flow conditions.
[0018] The multimodal composite control architecture described above avoids over-adjustment caused by false flow peak signals in the proportional-integral-derivative controller, shortens the recovery time of pipeline pressure after slug flow, and reduces the ineffective reciprocating motion of the throttling valve actuator. Attached Figure Description
[0019] Figure 1 This is a flowchart of an adaptive oil and gas pipeline flow control method according to the present invention; Figure 2 This is a diagram of the oil and gas pipeline system architecture of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] like Figures 1-2 As shown, the technical solution adopted by the present invention is as follows: An adaptive oil and gas pipeline flow control method, comprising: an adaptive oil and gas pipeline flow control method, applied to an oil and gas pipeline system including a dynamic pressure sensor, a controller, and a throttle valve, comprising the following steps: S1: Acquire dynamic pressure signals collected by dynamic pressure sensors arranged along the pipeline axis, wherein the sampling frequency of the dynamic pressure signals is not lower than a preset frequency threshold.
[0022] In one specific embodiment of the invention, a dynamic pressure sensor is installed along the axial direction of the oil and gas pipeline, i.e., on the outer wall of the pipeline parallel to the direction of fluid flow. The dynamic pressure sensor is used to sense transient pressure fluctuations in the fluid within the pipeline caused by changes in flow pattern, turbulent pulsation, slug impact, etc., and converts these pressure fluctuations into electrical signals. To effectively identify the slug leading edge along the pipeline's propagation direction, three dynamic pressure sensors are arranged at equal intervals of 50 cm along the pipeline's axial direction.
[0023] The dynamic pressure sensor is a piezoelectric sensor, model PCB Piezotronics 113B26, with key performance indicators including: resonant frequency not lower than 500 kHz, rise time less than or equal to 1 microsecond, and a range of 0 to 3450 kPa. These performance parameters ensure that the sensor has a sufficiently rapid response capability to the steep pressure front generated by the slug front and has a flat amplitude-frequency response characteristic within the operating frequency band.
[0024] The analog electrical signal output by the dynamic pressure sensor is connected to the data acquisition system via a shielded cable with a bayonet connector. The data acquisition system includes a cDAQ-9189 Ethernet chassis and a built-in NI 9234 four-channel, 24-bit synchronous data acquisition module. This acquisition module synchronously and at equal intervals samples the signals from each channel at a preset frequency threshold. In this embodiment, the preset frequency threshold is specifically set to 51.2 kHz.
[0025] The sampling frequency value is set based on the fact that the fluid acoustic feature vectors extracted in subsequent steps cover a frequency band of interest ranging from 20 Hz to 20 kHz. According to the Nyquist sampling theorem, to recover the highest frequency component in the original signal without distortion, the sampling frequency must be at least twice that highest frequency. Setting the sampling frequency to 51.2 kHz satisfies the minimum sampling rate requirement of 40 kHz while providing a reasonable transition band margin for the anti-aliasing filter, thereby ensuring complete and accurate acquisition of signals within the fluid acoustic feature frequency band.
[0026] The anti-aliasing filter inside the acquisition module automatically filters out frequency components higher than 26.1 kHz to prevent spectral aliasing. The 24-bit high-resolution digital signal generated after analog-to-digital conversion is transmitted in real time to the controller in the control layer via Ethernet protocol, serving as the raw data input for multidimensional fluid acoustic feature vector extraction.
[0027] Through the aforementioned sensing and acquisition processes, real-time, high-fidelity signals of the fluid dynamics state inside oil and gas pipelines were acquired, providing a reliable data foundation for subsequent online flow pattern identification based on fluid acoustic fingerprinting.
[0028] S2: Based on the dynamic pressure signal, perform frame-by-frame processing on the dynamic pressure signal and extract the multidimensional fluid acoustic feature vector of each frame signal.
[0029] In one specific embodiment of the present invention, the controller initiates feature extraction processing upon receiving each frame of dynamic pressure signal data. This framing process divides the continuously sampled dynamic pressure signal time series into a series of short-time data segments, each segment being called a frame, to analyze the hydrodynamic state reflected by the signal within that frame under the quasi-steady-state assumption. For each frame, a multidimensional hydroacoustic feature vector is extracted. This multidimensional hydroacoustic feature vector is a numerical array that comprehensively describes the acoustic characteristics of the frame signal across multiple dimensions, including the time domain, frequency domain, and cepstral domain.
[0030] Specifically, the extraction of multidimensional fluid acoustic feature vectors includes: S21: The controller first pre-emphasizes the dynamic pressure signal. The purpose of pre-emphasis is to increase the amplitude of the high-frequency components in the signal. In fluid acoustic signals, the high-frequency characteristic signals generated by rapid flow phenomena such as bubble bursting and turbulent pulsation naturally have lower energy than the low-frequency pressure fluctuations generated by the liquid plug body. If analyzed directly, the high-frequency characteristics may be relatively weakened in subsequent processing.
[0031] The pre-emphasis processing is implemented using a first-order high-pass digital filter, the transfer function of which is expressed as: ;in, For the system function of the filter, The variable is a complex variable. The coefficients of this filter, 0.97, are a set of experimentally verified typical values used to boost high-frequency components in the 20 Hz to 20 kHz frequency band of interest, with a slope of approximately 6 dB per octave, thereby equalizing the signal spectrum. The processed signal is called the emphasized signal.
[0032] S22: The controller performs framing and windowing processing on the re-processed signal. First, the continuous re-processed signal is divided into a series of data frames with a preset frame length. In this embodiment, each data frame contains 1024 consecutive sampling points, corresponding to a time length of 20 milliseconds. Adjacent data frames can have a 50% overlap to ensure the temporal continuity of the flow evolution.
[0033] Secondly, to suppress spectral leakage caused by abrupt truncation of data frames, a window function is applied to each frame. Spectral leakage causes signal energy to spread from the true frequency location to adjacent frequencies, reducing the accuracy of frequency domain analysis. This embodiment uses a Hamming window, whose mathematical expression is: ; in, For window functions at index The weighting coefficients at the point, Pi is the standard mathematical constant. This represents the sample number of the data point within the current frame. The function of this window function is to smoothly decay the data at both ends of the frame to zero, while preserving the middle portion, thereby effectively reducing spectral leakage. The windowed data frame is obtained by multiplying the value of each sample point in each frame of the emphasized signal by the weighting coefficient of the corresponding point in this window function.
[0034] S23: The controller performs a Fast Fourier Transform (FFT) on each windowed data frame to convert the time-domain pressure waveform into a frequency-domain spectral representation. This embodiment performs a 2048-point FFT, meaning that zeros are padded to 2048 points after the first 1024 data points of the windowed data frame before the transform, improving the visual resolution after frequency-domain interpolation. The output of the FFT is a complex spectrum; its magnitude is taken to obtain the amplitude spectrum of the frame signal. The amplitude spectrum describes the energy distribution of the frame signal at various discrete frequency points.
[0035] S24: The controller processes the obtained amplitude spectrum through a preset Mel filter bank to obtain the filtered energy spectrum. The Mel filter bank is a set of triangular bandpass filters evenly distributed on the Mel frequency scale. The conversion relationship between the Mel frequency scale and linear physical frequency simulates the nonlinear perception of pitch by the human ear. Applying it to fluid acoustic signal analysis helps to simulate the acoustic texture differences caused by different flow patterns impacting the pipe wall.
[0036] In this embodiment, the Mel filter bank comprises 40 triangular filters. The passband of this filter bank covers a frequency range of 20 Hz to 20 kHz, which is the characteristic frequency band of fluid acoustic signals. Acoustic fingerprint information generated by events such as slug impacts and bubble collapses is mainly concentrated in this band. The amplitude spectrum is passed through this filter bank, and the weighted sum (i.e., energy) of the squared signal amplitude within the passband of each triangular filter is calculated. The 40 filters output a total of 40 energy values, constituting the filtered energy spectrum.
[0037] S25: The controller takes the natural logarithm of the filtered energy spectrum and then performs a discrete cosine transform (DCT). The DCT is an orthogonal transform with strong energy concentration properties, compressing the main information of the signal into at least a few low-frequency transform coefficients and making the coefficients approximately uncorrelated. After the transform, the first 13 coefficients are extracted; these 13 coefficients constitute the Mel-frequency cepstral coefficient feature. The Mel-frequency cepstral coefficient feature describes the overall shape of the signal's spectral envelope and is a core feature for distinguishing acoustic fingerprint differences under different hydrodynamic states.
[0038] S26: In addition to the Mel frequency cepstral coefficient characteristics, the controller also calculates the following three types of auxiliary acoustic characteristics in parallel to comprehensively characterize the signal properties.
[0039] First, calculate the short-time energy characteristics. For each windowed data frame, calculate the average of the squared amplitudes of all its sampling points to obtain the root mean square energy value; then calculate the first and second differences of this energy value between adjacent frames, reflecting the rate and acceleration of energy change, respectively. This yields the three-dimensional short-time energy characteristics.
[0040] Second, calculate the short-time zero-crossing rate characteristic. For each windowed data frame, count the number of symbol changes between two adjacent sampling points to obtain the zero-crossing rate value; and calculate the first-order difference of this zero-crossing rate value between adjacent frames. The zero-crossing rate roughly reflects the average frequency of the signal. Thus, a two-dimensional short-time zero-crossing rate characteristic is obtained.
[0041] Third, calculate the frequency band energy distribution characteristics. The effective analysis bandwidth from 0 to 25.6 kHz (half of the sampling frequency of 51.2 kHz) is divided into four sub-bands: the first sub-band is 0 to 1 kHz, the second sub-band is 1 kHz to 5 kHz, the third sub-band is 5 kHz to 10 kHz, and the fourth sub-band is 10 kHz to 25.6 kHz. For the amplitude spectrum of each frame of the signal, calculate the percentage of signal energy in each sub-band relative to the total energy of the entire frequency band. This yields the four-dimensional frequency band energy distribution characteristics.
[0042] S27: The controller concatenates all the features extracted in the previous sub-steps in a preset order. Specifically, it sequentially combines the 13-dimensional Mel frequency cepstral coefficient features, the 3-dimensional short-time energy features, the 2-dimensional short-time zero-crossing rate features, and the 4-dimensional frequency band energy distribution features to form a multi-dimensional fluid acoustic feature vector with a total dimension of 22.
[0043] The extraction process of the multidimensional hydroacoustic feature vector is repeated at a rate of 100 Hz, that is, a new 22-dimensional feature vector is generated every 10 milliseconds. This feature vector sequence serves as the input to the flow regime identification model in step S3, which is used to solve the current hydrodynamic state in real time.
[0044] S3: Input the multidimensional fluid acoustic feature vector into the pre-constructed flow state identification model, and calculate and output the flow state confidence vector in real time through the flow state identification model. Each element in the flow state confidence vector represents the probability that the current fluid is in different preset fluid dynamic states.
[0045] In one specific embodiment of the present invention, the multidimensional fluid acoustic feature vector sequence extracted in real time is input into a pre-constructed flow regime identification model. This flow regime identification model is a mathematical model trained offline using a large amount of labeled fluid acoustic feature sample data. Its function is to determine the flow state of the fluid in the pipe based on the input current and historical feature vector sequences.
[0046] After real-time computation, the flow regime identification model outputs a flow regime confidence vector. The dimension of the flow regime confidence vector is the same as the number of predefined fluid dynamic states in the model, and each element is a value between 0 and 1, representing the posterior probability that the fluid in the pipe is in a certain preset fluid dynamic state at the current moment. This probability value reflects the model's confidence in the current flow regime assignment and provides a basis for calculating the controller weight factors.
[0047] In this embodiment, the flow regime identification model specifically adopts a Hidden Markov Model (HMM). An HMM is a probability-based statistical model for time-series signals. Its mathematical structure includes a set of hidden states, transition probabilities between states, and the observation probability distribution for each state generating an observation.
[0048] In this technical solution, the hidden state corresponds to a variety of preset fluid dynamic states. The model analyzes the changes of multidimensional fluid acoustic feature vectors (i.e., observable sequences) over time to infer the hidden state sequence most likely to produce the observable sequence.
[0049] During online identification, the controller inputs the output multidimensional fluid acoustic feature vector sequence into the trained Hidden Markov Model (HMM) in real time. The model internally calls the Viterbi algorithm for calculation. The Viterbi algorithm is a dynamic programming algorithm used to find the most probable hidden state sequence path given an observation sequence and model parameters. Through the recursive calculation of the Viterbi algorithm, the model can update and output the posterior probability of each hidden state at the current moment in real time; that is, the probability value of the fluid being in each hidden state given the current feature vector sequence observed at that moment. These posterior probability values are arranged according to a preset hidden state order, thus forming the flow confidence vector.
[0050] In this embodiment, the hidden states of the Hidden Markov Model are specifically defined as five, which correspond to five preset fluid dynamic states in the gas-liquid two-phase flow that have significantly different acoustic characteristics and flow behaviors.
[0051] The first state characterizes stable bubbly flow, in which the gas phase is uniformly distributed in the continuous liquid phase in the form of discrete small bubbles, and the flow is smooth.
[0052] The second state represents the slug front, i.e. the liquid plug head. At this time, the liquid phase forms a liquid column that fills the cross section in the pipe and moves forward at a high speed. Its front impacts the pipe wall and generates a steep pressure wave.
[0053] The third state characterizes the slug body or liquid film region, namely the high-density liquid phase region after the liquid plug has passed or the liquid film flow region remaining on the pipe wall.
[0054] The fourth state characterizes long bubbles or stratified flow, which is a state in which the gas phase flows in the form of long bubbles at the top of the pipe while the liquid phase flows at the bottom.
[0055] The fifth state represents a stable annular flow, in which the gas phase flows at high speed in the center of the pipe, and the liquid phase flows along the pipe wall in the form of a liquid film, and the flow structure is relatively stable.
[0056] For each hidden state, its observation probability distribution is characterized using a mixture model of multiple Gaussian components. Specifically, in this embodiment, the observation probability density function for each state is a weighted sum of three Gaussian components. The Gaussian mixture model can flexibly fit the complex distribution of multidimensional hydroacoustic feature vectors in the feature space, thereby improving the accuracy of state identification.
[0057] In a Hidden Markov Model (HMM), the state transition probability matrix is a 5x5 matrix, where the element in the i-th row and j-th column represents the probability of transitioning from state i to state j. The non-zero elements of this matrix are mainly concentrated on the main diagonal and its vicinity, reflecting the physical constraint that manifold evolution usually follows a certain order and does not involve abrupt changes.
[0058] The initial state probability vector is a 5-dimensional row vector, where each element represents the probability of the system being in each hidden state at the initial moment. Both the state transition probability matrix and the initial state probability vector are trained from a pre-labeled hydroacoustic feature sample dataset using the Baum-Welch algorithm.
[0059] The Baum-Welch algorithm is an unsupervised learning algorithm based on expectation maximization. It can iteratively estimate the parameters of a hidden Markov model when only the observation sequence is available and the hidden state sequence is unknown, thereby maximizing the probability of generating the observation sequence.
[0060] The pre-labeled fluid acoustic feature sample dataset forms the basis for training the Hidden Markov Model, and its construction involves physical-aided annotation methods. During the offline data acquisition phase, a fast-response gamma-ray densitometer was installed at two locations: one 10 times the pipe diameter upstream and one 10 times the pipe diameter downstream of the dynamic pressure sensor array, to measure the mixing density of the fluid in real time. Mixing density refers to the average density of the gas-liquid two-phase mixture within the pipe cross-section.
[0061] Based on the dual-section densitometer signal, statistical quantities such as the rate of change of mixed density and the standard deviation of mixed density are calculated. Then, according to preset labeling rules, a corresponding fluid dynamics state label is assigned to each frame of dynamic pressure signal. The preset labeling rules are as follows: The labeling rule for the first state (stable bubbly flow) is as follows: when the standard deviation of the mixing density of the upstream and downstream sections is less than 5 kg per cubic meter, and the signal-to-noise ratio of the vortex shear signal is greater than 15 dB, the dynamic pressure signal of the corresponding time frame is labeled as the first state.
[0062] The labeling rule for the second state (slug front) is as follows: when the upward slope of the upstream cross-section mixing density exceeds 200 kg / m³ / s within 0.1 seconds, and the downstream cross-section mixing density has not changed significantly, the dynamic pressure signal of the corresponding time frame is labeled as the second state.
[0063] The labeling rule for the third state (slug body or liquid film region) is as follows: after the second state is identified, when both the upstream and downstream sections show a mixing density greater than 700 kg per cubic meter and the standard deviation of the mixing density is greater than 30 kg per cubic meter, the dynamic pressure signal of the corresponding time frame is labeled as the third state.
[0064] The labeling rule for the fourth state (long bubble or stratified flow) is as follows: when the mixing density of both the upstream and downstream sections is less than 50 kg per cubic meter, and the proportion of high-frequency energy in the frequency band energy distribution is less than 10%, the dynamic pressure signal of the corresponding time frame is labeled as the fourth state.
[0065] The labeling rule for the fifth state (stable annular flow) is as follows: under the condition of high apparent gas velocity, when the cross-sectional mixing density is stable between 20 kg and 100 kg per cubic meter, the dynamic pressure signal of the corresponding time frame is labeled as the fifth state.
[0066] Using the aforementioned labeling rules based on physical measurements, reliable state labels are generated for each frame of dynamic pressure signal. These labeled dynamic pressure signals are then processed according to the procedure described in step S2 to extract multidimensional fluid acoustic feature vectors, thus forming a pre-labeled fluid acoustic feature sample dataset for training the Hidden Markov Model.
[0067] S4: Calculate the first weighting factor of the feedforward controller and the second weighting factor of the model prediction controller based on the flow confidence vector.
[0068] In one specific embodiment of the present invention, the controller receives an output flow confidence vector, which is a five-dimensional array, where each element corresponds to the posterior probability of a preset fluid dynamic state. Based on the element values of this vector, the controller calculates two key parameters for subsequent control fusion: a first weighting factor corresponding to the feedforward controller and a second weighting factor corresponding to the model predictive controller (MPC).
[0069] The first weighting factor determines the weight of the feedforward controller in the final valve control command. Its value mainly depends on the probability of the slug leading state, which is reflected in the ability to suppress upcoming strong disturbances in advance.
[0070] The second weighting factor determines the weight of the model predictive controller (MPC) in the final valve control command. Its value mainly depends on the probability of the steady-state flow pattern, which is reflected in the high-precision tracking capability of the flow setpoint under stable operating conditions.
[0071] Specifically, the calculation of the first weighting factor and the second weighting factor includes: Obtain the first probability value in the flow confidence vector that corresponds to the state of the slug front.
[0072] The first weighting factor is calculated based on the comparison results between the first probability value and the first preset threshold and the second preset threshold.
[0073] Obtain at least one second probability value from the flow confidence vector that corresponds to a stable flow pattern.
[0074] The second weighting factor is calculated based on the second probability value.
[0075] In this embodiment, the calculation of the first weighting factor and the second weighting factor involves extracting the probability value corresponding to a specific state from the flow confidence vector and comparing it with a preset threshold.
[0076] First, the controller extracts the probability value corresponding to the slug front state (i.e., the second state) from the flow confidence vector, denoted as the first probability value. The magnitude of the first probability value reflects the likelihood of a strong disturbance event, the slug front, occurring in the pipe at the current moment. The controller compares the first probability value with a first preset threshold and a second preset threshold. In this embodiment, the first preset threshold is set to 0.4, and the second preset threshold is set to 1.
[0077] The comparison rules and calculation method are as follows: When the first probability value is less than or equal to the first preset threshold, the first weighting factor is 0; when the first probability value is greater than or equal to the second preset threshold, the first weighting factor is 1; when the first probability value is between the first preset threshold and the second preset threshold, the first weighting factor is calculated by subtracting the first preset threshold from the first probability value, and then dividing by the difference between the second preset threshold and the first preset threshold, i.e., a smooth transition is achieved through linear interpolation. This calculation logic ensures that the intervention degree of the feedforward controller gradually increases with the increase of the sluice gate leading probability, avoiding abrupt changes in the controller output.
[0078] Secondly, the controller extracts at least one second probability value corresponding to the stable flow pattern state from the flow confidence vector. In this embodiment, the stable flow pattern includes a first state (stable bubble flow), a fifth state (stable annular flow), and a partial fourth state (long bubble or stratified flow).
[0079] The second weighting factor is calculated by multiplying the probability values corresponding to the first state, the fifth state, and the fourth state by 0.5, and then summing the results. This calculation logic ensures that the second weighting factor takes a larger value when the fluid is in a stable bubbly or annular flow; a moderate value when the fluid is in a transitional flow pattern such as long-term bubble or stratified flow; and a smaller value when the fluid is in a turbulent flow pattern such as the slug front or main body. The second weighting factor determines the degree of participation of the Model Predictive Controller (MPC) in the final command, ensuring that the MPC dominates flow regulation under steady-state conditions.
[0080] Specifically, the calculation of the first weighting factor and the second weighting factor further includes: When the maximum value of each element in the flow confidence vector is less than the third preset threshold, the first weighting factor and the second weighting factor are both set to zero, so that the valve control command is determined only by the third output of the proportional-integral-derivative controller.
[0081] This embodiment also includes a robust design logic. The controller monitors the maximum value of each element in the flow confidence vector in real time, which is the highest value among the five state posterior probabilities. When this maximum value is less than a third preset threshold, it indicates that the model's confidence in identifying the current flow state is too low, and it may be in an unknown flow pattern, a complex transitional state, or an abnormal sensor signal condition. In this embodiment, the third preset threshold is set to 0.3.
[0082] If this condition is triggered, the controller forces both the first and second weighting factors to be set to zero. This operation results in both the first and second weighting factors being zero, so the outputs of the feedforward controller and the model prediction controller (MPC) have zero weights in the subsequent weighted fusion.
[0083] At this point, the valve control command is entirely determined by the third output of the proportional-integral-derivative (PID) controller. This mechanism ensures that under boundary conditions or abnormal conditions with high flow regime uncertainty, the control system can retreat to a mature and widely adaptable PID control mode, guaranteeing the basic safety and stability of pipeline operation.
[0084] S5: Based on the first weighting factor and the second weighting factor, the first output of the feedforward controller, the second output of the model prediction controller, and the third output of the proportional-integral-derivative controller are weighted and fused to generate valve control commands.
[0085] In one specific embodiment of the invention, three sub-controllers operate in parallel within the controller: a feedforward controller, a model predictive controller (MPC), and a proportional-integral-derivative (PID) controller. Each sub-controller calculates a control output based on the current operating conditions, denoted as the first output, the second output, and the third output, respectively. These outputs all represent the adjustment recommendations for the downstream throttle valve opening, with dimensions expressed as a percentage of the valve opening. Based on a first weighting factor and a second weighting factor, the controller determines the weight allocation of each sub-controller's output in the fusion process and generates a comprehensive valve control command through a weighted summation.
[0086] This weighted fusion mechanism enables the control system to adaptively adjust its behavior based on real-time flow confidence: when the probability of a slug leading edge increases, the output of the feedforward controller is given higher weight to suppress disturbances in advance; when the flow is stable, the output of the model predictive controller (MPC) is given higher weight to achieve high-precision tracking; and the output of the proportional-integral-derivative (PID) controller serves as a basic guarantee, always participating in the fusion when the flow identification is uncertain or as a supplement to the output of other controllers.
[0087] Specifically, the first output of the feedforward controller is obtained in the following manner: The rate of change of pressure measured by the dynamic pressure sensor at a preset position in the dynamic pressure signal is obtained.
[0088] When the first probability value is greater than the fourth preset threshold, the first output quantity is calculated based on the difference between the pressure change rate and the dead zone threshold, and the preset feedforward gain. The range of the feedforward gain is predetermined based on the constraint of suppressing slug disturbance and avoiding overcompensation.
[0089] In this embodiment, the first output of the feedforward controller is calculated based on the principle of advance compensation for pressure disturbances caused by the slug front.
[0090] First, the controller selects the pressure value measured by the dynamic pressure sensor at a preset location from the acquired dynamic pressure signal. This preset location is the first dynamic pressure sensor located upstream. The controller performs a differential operation on this pressure signal to obtain the pressure change rate, in kilopascals per second. The pressure change rate reflects the steepness of the pressure rise as the sluice gate approaches.
[0091] Next, the controller acquires a first probability value, which is the probability value in the flow confidence vector corresponding to the slug front state (second state). This first probability value is compared with a fourth preset threshold. In this embodiment, the fourth preset threshold is set to 0.6. When the first probability value is greater than the fourth preset threshold, it indicates that the confidence in the occurrence of the slug front is high enough, and the feedforward control function is activated; when the first probability value is less than or equal to the fourth preset threshold, the first output value is zero, and the feedforward controller does not participate in the adjustment.
[0092] When the activation condition is met, the controller calculates the first output. The first output is determined by multiplying the feedforward gain by the positive difference between the pressure change rate and the dead zone threshold.
[0093] Specifically, the dead zone threshold is subtracted from the pressure change rate. If the difference is less than or equal to zero, it is set to zero; if the difference is greater than zero, it is multiplied by the feedforward gain, and the product is the first output. The purpose of setting the dead zone threshold is to filter out low-amplitude pressure fluctuations caused by turbulence and other factors, thus avoiding frequent malfunctions of the feedforward controller. In this embodiment, the dead zone threshold is set to 100 kPa per second.
[0094] The range of the feedforward gain is predetermined based on constraints that suppress slug disturbances and avoid overcompensation. In this embodiment, the preferred range of the feedforward gain is -0.12% / kPa / s to -0.18% / kPa / s, with a typical value of -0.15% / kPa / s. A negative feedforward gain indicates that when the pressure rise rate exceeds the dead zone threshold, the controller outputs a negative valve opening increment command, i.e., pre-closing the throttle valve before the slug advances to counteract the impact of the liquid slug on the downstream flow. This range has been experimentally verified: when the value is within this range, the system can effectively suppress slug flow disturbances while avoiding flow downsurges caused by excessively premature valve closure.
[0095] The second output of the model prediction controller is obtained in the following way: Construct a predictive model that includes pipeline state variables.
[0096] Based on the prediction model, the optimal control sequence that minimizes the cost function is solved in the prediction time domain. The cost function includes a penalty term for the tracking deviation of the flow setpoint and a penalty term for the magnitude of the control increment.
[0097] The first control variable in the optimal control sequence is used as the second output variable.
[0098] In this embodiment, the second output of the model predictive controller (MPC) is calculated based on the model predictive control principle.
[0099] First, a predictive model incorporating pipeline state variables is constructed. This model describes the dynamic relationship between changes in throttle valve opening and the pipeline flow response, and can employ state-space equations based on pipeline fluid dynamics mechanisms or transfer function models based on system identification. The state variables of the predictive model include pressure distribution and flow distribution along the pipeline.
[0100] Secondly, in each control cycle, the Model Predictive Controller (MPC) uses the current pipeline state as the initial condition and the predictive model to recursively predict the pipeline flow response over a future period of time, i.e., the prediction time domain.
[0101] In this embodiment, the prediction time domain length is set to 20 control cycles. Simultaneously, within a shorter future timeframe (the control time domain), the controller solves for an optimal sequence of valve opening increments to minimize a predefined cost function. In this embodiment, the control time domain length is set to 5 control cycles.
[0102] The cost function includes two penalty terms: the first term is the penalty term for the tracking deviation of the flow setpoint, which is the weighted sum of the squares of the differences between the actual flow and the set flow at each future prediction time; the second term is the penalty term for the control increment amplitude, which is the weighted sum of the squares of the valve opening changes at each future control time.
[0103] In the first penalty term, the element corresponding to the flow rate in the weight matrix corresponding to the flow rate deviation has a value of ten; in the second penalty term, the element corresponding to the valve in the weight matrix corresponding to the control increment has a value of zero. By adjusting the relative magnitudes of these two weights, a trade-off can be achieved between flow tracking accuracy and valve operation smoothness.
[0104] The optimization problem can be solved online using a quadratic programming algorithm. The resulting optimal control sequence is a sequence containing valve opening increments over multiple future control cycles. The Model Predictive Controller (MPC) extracts only the first control increment value from this sequence, adds it to the current valve opening to obtain the second output, and executes it within the current control cycle. In the next control cycle, the controller re-acquires the pipeline state and repeats the above prediction and optimization process, thereby achieving rolling time-domain optimal control.
[0105] The generated valve control commands specifically include: The valve opening command is calculated according to the first weighting factor, the second weighting factor, the first output quantity, the second output quantity, and the third output quantity, based on a preset fusion formula.
[0106] In the preset fusion formula, the valve opening command is determined by the sum of the product of the first output quantity and the first weight, the product of the second output quantity and the second weight, and the product of the third output quantity and the third weight, wherein the first weight, the second weight, and the third weight are determined by the first weight factor and the second weight factor, respectively.
[0107] In this embodiment, the controller weights and combines the outputs of each sub-controller according to a preset fusion formula to generate the final valve opening command.
[0108] The preset fusion formula determines that the valve opening command is equal to the sum of the product of the first output quantity and the first weight, the product of the second output quantity and the second weight, and the product of the third output quantity and the third weight. The first weight, the second weight, and the third weight are all coefficients between zero and one, and the sum of the three is always equal to one, to ensure that the total control quantity after fusion does not exceed the reasonable valve opening range.
[0109] The first weight, the second weight, and the third weight are determined by the first weight factor and the second weight factor, respectively, and their corresponding relationships are as follows: The first weight is directly equal to the first weight factor. The first weight factor reflects the degree of participation of the feedforward controller in the fusion; the higher its value, the stronger the feedforward control effect.
[0110] The second weight is obtained by multiplying the second weight factor by one and subtracting the first weight factor from the difference. This relationship ensures that, under the constraint of a total weight of one, the weights of the Model Predictive Controller (MPC) are allocated proportionally to the second weight factor in the remaining share after being allocated to the feedforward controller.
[0111] The third weight is obtained by multiplying the difference between the first weight factor and the difference between the second weight factor and the first weight factor. This relationship allocates all the portion of the total weight not occupied by the feedforward controller and the model predictive controller (MPC) to the proportional-integral-derivative (PID) controller.
[0112] The above weight allocation logic ensures that the sum of the weights of the three sub-controllers is always one regardless of the flow regime changes, and the participation level of each controller can be smoothly transitioned. When the robust design is triggered in step S4, and the first and second weight factors are both zero, the first and second weights are both zero, and the third weight is one. At this time, the valve opening command is completely determined by the third output of the proportional-integral-derivative (PID) controller.
[0113] The third output of the proportional-integral-derivative (PID) controller is calculated using an incremental PID control algorithm. The proportional coefficient is set to 0.8, the integral time constant to 30 seconds, and the derivative time constant to 2 seconds. This PID controller is always active, providing the control system with basic closed-loop regulation capability.
[0114] The controller updates the valve opening command every ten milliseconds and sends it to the digital valve positioner of the downstream throttle valve in the form of a current signal of four to twenty milliamps through the analog output module, driving the throttle valve actuator to act and complete the regulation of pipeline flow.
[0115] S6: Send the valve control command to the downstream throttle valve to regulate the pipeline flow.
[0116] After completing the control quantity fusion calculation, the controller generates a final valve control command. This valve control command represents the set value of the downstream throttle valve opening, usually expressed as a percentage of the valve's full stroke.
[0117] The controller converts the valve control command into a standard industrial control signal through its analog output module. In this embodiment, the industrial control signal is a DC current signal ranging from 4 mA to 20 mA, where 4 mA corresponds to the fully closed valve position and 20 mA corresponds to the fully open valve position, with the intermediate current value being linearly proportional to the valve opening degree.
[0118] The current signal is transmitted via a shielded cable to the digital valve positioner associated with the throttle valve located downstream of the pipeline. "Downstream" refers to the position of the throttle valve after the dynamic pressure sensor and controller, relative to the direction of fluid flow within the pipe.
[0119] In this embodiment, the throttle valve is a Fisher ET type straight-through control valve, equipped with a Fisher FIELDVUEDVC6200f digital valve positioner. The digital valve positioner receives a 4 mA to 20 mA setpoint signal from the controller, while simultaneously detecting the actual valve opening in real time via a position feedback sensor mounted on the valve stem. The microprocessor inside the positioner compares the setpoint signal with the actual opening and drives a pneumatic amplifier through a built-in proportional-integral-derivative control algorithm to adjust the air pressure entering the diaphragm head of the valve actuator, thereby pushing the valve stem to the precise opening position corresponding to the command signal.
[0120] Changes in the opening of a throttle valve directly alter the local resistance coefficient of a pipeline system. When the valve opening decreases, the local resistance increases, the upstream pressure rises, and the flow rate through the valve decreases; conversely, when the valve opening increases, the local resistance decreases, and the flow rate through the valve increases. This fundamental principle of fluid mechanics allows for the regulation of pipeline flow, bringing it closer to the desired setpoint.
[0121] The controller repeats the above steps at a fixed time period. In this embodiment, the control period is set to 10 milliseconds, meaning that the valve control command is updated and sent to the digital valve positioner every 10 milliseconds. This update frequency ensures that the control system can respond promptly to rapid changes in the fluid dynamics state, especially in slug flow conditions to achieve rapid suppression of disturbances.
[0122] The above process completes the closed loop from control decision-making to physical execution, enabling the entire adaptive oil and gas pipeline flow control method to ultimately apply to the process and achieve precise and stable control of pipeline flow under gas-liquid two-phase flow conditions.
[0123] In one specific embodiment, an adaptive oil and gas pipeline flow control method is applied to an oil and gas mixed transport riser system located on an offshore oil platform. This riser system connects the subsea wellhead to the platform's upper receiving facilities. The riser has a total height of approximately 120 meters and an inner diameter of 8 inches, transporting a mixture of unseparated crude oil and associated gas from the subsea wellhead. Due to the riser's undulating geometry and the two-phase flow characteristics of the gas-liquid system, severe slugging frequently occurs under certain operating conditions, leading to drastic fluctuations in the liquid level of the upper slugging trap on the platform and instability in the downstream compressor inlet pressure.
[0124] The hardware configuration in this embodiment follows the three-layer architecture of the sensing layer, control layer, and execution layer in the technical solution. The sensing layer includes three dynamic pressure sensors arranged at 50 cm intervals along the underwater section and the rising section of the riser. The dynamic pressure sensors are PCB Piezotronics 113B26 piezoelectric sensors with a resonant frequency of not less than 500 kHz, a rise time of less than or equal to 1 microsecond, and a range of 0 to 3450 kPa. The dynamic pressure sensor signals are connected via BNC shielded cables to an NI 9234 four-channel, 24-bit synchronous data acquisition module built into an NI cDAQ-9189 Ethernet chassis. Downstream, a Micro Motion ELITE CMF100H Coriolis mass flow meter is also installed, whose 4 mA to 20 mA signals are connected to an NI 9203 analog input module.
[0125] The core of the control layer is a Siemens SIMATIC S7-1518F programmable logic controller (PLC) with a cycle time set to 5 milliseconds. This PLC communicates deterministically with an NI cDAQ-9189 Ethernet chassis via the Profinet RT protocol, receives real-time data, and executes feature extraction, flow identification, and multimodal control algorithms.
[0126] The actuator is a Fisher ET type straight-through control valve, equipped with a Fisher FIELDVUE DVC6200f digital valve positioner. The programmable logic controller (PLC) sends 4mA to 20mA control commands to the digital valve positioner through the analog output module.
[0127] Three dynamic pressure sensors acquire dynamic pressure signals in real time from the fluid inside the pipe caused by slug formation, slug rise, and bubble collapse, with a sampling frequency set to 51.2 kHz. The acquired dynamic pressure signals are converted into digital signals by a synchronous data acquisition module and then transmitted to a programmable logic controller (PLC) via an Ethernet chassis using the Profinet RT protocol.
[0128] After receiving the dynamic pressure signal, the programmable logic controller (PLC) first performs frame processing on the signal. Each frame contains 1024 sampling points, corresponding to a time length of 20 milliseconds, with 50% overlap between adjacent frames. For each frame of the dynamic pressure signal, pre-emphasis, Hamming windowing, fast Fourier transform, Mel filtering, discrete cosine transform, and auxiliary feature calculations are performed to ultimately extract a 22-dimensional multi-dimensional fluid acoustic feature vector. This multi-dimensional fluid acoustic feature vector is composed of 13-dimensional Mel frequency cepstral coefficient features, 3-dimensional short-time energy features, 2-dimensional short-time zero-crossing rate features, and 4-dimensional frequency band energy distribution features. The update rate of the multi-dimensional fluid acoustic feature vector is 100 Hz.
[0129] Subsequently, the programmable logic controller (PLC) continuously inputs the real-time generated multidimensional fluid acoustic feature vector sequence into a pre-trained hidden Markov model. The five hidden states of this hidden Markov model correspond to steady bubbly flow, slug front, slug body or liquid film region, long bubble or stratified flow, and steady annular flow, respectively. The PLC uses the Viterbi algorithm to calculate the posterior probability of each hidden state in real time and outputs a five-dimensional flow confidence vector in sequence. Each element of the flow confidence vector reflects the probability that the fluid in the riser is currently in a corresponding preset fluid dynamic state.
[0130] Based on the flow confidence vector, the programmable logic controller (PLC) dynamically calculates the first weighting factor of the feedforward controller and the second weighting factor of the model predictive controller. Specifically, a first probability value corresponding to the slug front state is extracted from the flow confidence vector, and the first weighting factor is calculated by linear interpolation based on the comparison between the first probability value and a first preset threshold of 0.4 and a second preset threshold of 1.
[0131] Simultaneously, probability values corresponding to stable bubbly flow, stable annular flow, and long bubble or stratified flow are extracted from the flow confidence vector. A second weighting factor is calculated, which is the sum of the probability values of stable bubbly flow and stable annular flow, plus the product of the probability values of long bubble or stratified flow multiplied by 0.5. When the maximum probability value in the flow confidence vector is lower than the third preset threshold of 0.3, both the first and second weighting factors are forcibly set to zero to ensure that the programmable logic controller (PLC) retreats to proportional-integral-derivative control mode when the uncertainty of flow identification is high.
[0132] The programmable logic controller (PLC) operates three sub-controllers in parallel. The feedforward controller calculates the first output based on the pressure change rate of the upstream dynamic pressure sensor: when the first probability value is greater than the fourth preset threshold of 0.6, the positive difference between the pressure change rate and the dead zone threshold of 100 kPa / s is taken, and multiplied by the feedforward gain of -0.15% / kPa / s to obtain the first output; otherwise, the first output is zero.
[0133] The model predictive controller, based on a pipeline state variable prediction model, solves for the optimal control sequence that minimizes the cost function within the prediction time domain of 20 control cycles and the control time domain of 5 control cycles using quadratic programming. In the cost function, the flow tracking deviation weight is set to 10, and the control increment weight is set to 0.5. The second output is obtained by superimposing the first control increment of the optimal control sequence with the current valve opening. The proportional-integral-derivative (PID) controller continuously calculates the third output using an incremental algorithm with a proportional gain of 0.8, an integral time constant of 30 seconds, and a derivative time constant of 2 seconds.
[0134] The programmable logic controller (PLC) determines the first weight, second weight, and third weight based on a first weighting factor and a second weighting factor: the first weight equals the first weighting factor; the second weight equals the second weighting factor multiplied by one minus the difference of the first weighting factor; and the third weight equals the difference between one minus the first weighting factor multiplied by one minus the difference of the second weighting factor. The first, second, and third output quantities are multiplied by their respective weights and then summed to generate the valve opening command.
[0135] The programmable logic controller (PLC) updates the valve opening command every 10 milliseconds and converts it into a 4mA to 20mA current signal via an analog output module. This signal is then sent to the digital valve positioner of the straight-through control valve installed on the downstream section of the riser. The digital valve positioner, based on the command signal, drives the valve actuator to adjust the opening of the FisherET type straight-through control valve, changing the pipeline system resistance and thus stabilizing the riser outlet flow rate near the set value.
[0136] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An adaptive flow control method for oil and gas pipelines, applied to an oil and gas pipeline system including a dynamic pressure sensor, a controller, and a throttle valve, characterized in that, Includes the following steps: Acquire dynamic pressure signals collected by dynamic pressure sensors arranged along the pipeline axis, wherein the sampling frequency of the dynamic pressure signals is not lower than a preset frequency threshold. Based on the dynamic pressure signal, the dynamic pressure signal is processed by frame segmentation, and the multidimensional fluid acoustic feature vector of each frame signal is extracted. The multidimensional fluid acoustic feature vector is input into a pre-constructed flow regime identification model. The flow regime identification model calculates and outputs a flow regime confidence vector in real time. Each element in the flow regime confidence vector represents the probability that the current fluid is in different preset fluid dynamic states. Based on the flow confidence vector, calculate the first weighting factor of the feedforward controller and the second weighting factor of the model prediction controller; Based on the first weighting factor and the second weighting factor, the first output of the feedforward controller, the second output of the model prediction controller, and the third output of the proportional-integral-derivative controller are weighted and fused to generate valve control commands. The valve control command is sent to the downstream throttle valve to regulate the pipeline flow.
2. The adaptive oil and gas pipeline flow control method according to claim 1, characterized in that, The extraction of multidimensional fluid acoustic feature vectors includes: The dynamic pressure signal is pre-emphasized to obtain an emphasized signal; The emphasized signal is divided into data frames of a preset frame length, and a window function is applied to each data frame to obtain a windowed data frame; Perform a Fourier transform on the windowed data frame to obtain the amplitude spectrum; The amplitude spectrum is passed through a preset Mel filter bank to obtain a filtered energy spectrum, wherein the frequency range covered by the Mel filter bank includes the characteristic frequency band of the hydroacoustic signal; Perform a discrete cosine transform on the filtered energy spectrum and extract a preset number of coefficients as Mel frequency cepstral coefficient features; Calculate the short-time energy characteristics, short-time zero-crossing rate characteristics, and frequency band energy distribution characteristics of each frame of data; The Mel frequency cepstral coefficient feature, the short-time energy feature, the short-time zero-crossing rate feature, and the frequency band energy distribution feature are concatenated to obtain the multidimensional fluid acoustic feature vector.
3. The adaptive oil and gas pipeline flow control method according to claim 1, characterized in that, The flow regime identification model is a Hidden Markov Model (HMM), which contains several hidden states. These hidden states correspond to various preset fluid dynamic states, including: The multidimensional fluid acoustic feature vector sequence is input into the hidden Markov model; The hidden Markov model is solved using the Viterbi algorithm, and the posterior probability of each hidden state at the current time is calculated in real time. The flow state confidence vector is generated based on the posterior probability of each hidden state.
4. The adaptive oil and gas pipeline flow control method according to claim 3, characterized in that, The hidden states include: a first state, a second state, a third state, a fourth state, and a fifth state; The first state represents stable bubbly flow, the second state represents the slug front, the third state represents the slug body or liquid film region, the fourth state represents long bubbles or stratified flow, and the fifth state represents stable annular flow. In the Hidden Markov Model, the observation probability distribution of each hidden state is characterized by a mixture model of multiple Gaussian components, and the state transition probability matrix and the initial state probability vector are trained from a pre-labeled fluid acoustic feature sample dataset using the Baum-Welch algorithm.
5. The adaptive oil and gas pipeline flow control method according to claim 4, characterized in that, The pre-labeled hydroacoustic feature sample dataset is constructed in the following way: Mixed density signals are acquired at the upstream and downstream sections of the dynamic pressure sensor, respectively. Based on the mixing density change rate and mixing density standard deviation of the upstream and downstream sections, and according to the preset labeling rules, each frame of dynamic pressure signal is associated with the first state, second state, third state, fourth state, or fifth state to generate training labels.
6. The adaptive oil and gas pipeline flow control method according to claim 1, characterized in that, The calculation of the first weighting factor and the second weighting factor specifically includes: Obtain the first probability value in the flow confidence vector that corresponds to the state of the slug front; The first weighting factor is calculated based on the comparison results between the first probability value and the first preset threshold and the second preset threshold; Obtain at least one second probability value from the flow confidence vector that corresponds to a stable flow pattern; The second weighting factor is calculated based on the second probability value.
7. The adaptive oil and gas pipeline flow control method according to claim 6, characterized in that, The calculation of the first weighting factor and the second weighting factor also includes: When the maximum value of each element in the flow confidence vector is less than the third preset threshold, the first weighting factor and the second weighting factor are both set to zero, so that the valve control command is determined only by the third output of the proportional-integral-derivative controller.
8. The adaptive oil and gas pipeline flow control method according to claim 6, characterized in that, The first output of the feedforward controller is obtained in the following way: The rate of change of pressure measured by the dynamic pressure sensor at a preset position in the dynamic pressure signal is obtained. When the first probability value is greater than the fourth preset threshold, the first output quantity is calculated based on the difference between the pressure change rate and the dead zone threshold, and the preset feedforward gain. The range of the feedforward gain is predetermined based on the constraint of suppressing slug disturbance and avoiding overcompensation.
9. The adaptive oil and gas pipeline flow control method according to claim 1, characterized in that, The second output of the model prediction controller is obtained in the following way: Construct a predictive model that includes pipeline state variables; Based on the prediction model, the optimal control sequence that minimizes the cost function is solved in the prediction time domain. The cost function includes a penalty term for the tracking deviation of the flow setpoint and a penalty term for the magnitude of the control increment. The first control variable in the optimal control sequence is used as the second output variable.
10. The adaptive oil and gas pipeline flow control method according to claim 6, characterized in that, The generated valve control commands specifically include: Based on the first weighting factor, the second weighting factor, the first output quantity, the second output quantity, and the third output quantity, the valve opening command is calculated according to a preset fusion formula. In the preset fusion formula, the valve opening command is determined by the sum of the product of the first output quantity and the first weight, the product of the second output quantity and the second weight, and the product of the third output quantity and the third weight, wherein the first weight, the second weight, and the third weight are determined by the first weight factor and the second weight factor, respectively.