Feature extraction and identification of gas–liquid two-phase flow based on fractal theory

Due to the gas–liquid two-phase flow system with nonlinear characteristics, the fractal theory has a significant impact on nonlinear analysis, so the paper proposes applying the fractal theory to characterize the fractal characteristics of two-phase flow. Firstly, it performs the mathematical morphology fractal dimension (MMFD) to analyse the fractal dimension of typical signals, and the box-counting dimension is employed as a comparison. The results indicate that the MMFD has better accuracy in estimating the fractal dimension of the typical signals. The MMFD can reflect the complexity and nonlinear of a chaotic system; Finally, it applies the MMFD to extract features and analyse two-phase flow characteristics. The experimental results show that the MMFD can effectively identify signals of different flow patterns, especially the transitional flow pattern, and reflect the complexity of gas–liquid two phases.


Introduction
The two-phase flow system widely exists in industrial production processes such as petroleum, chemical industry, nuclear power and metallurgy. Moreover, it seriously affects the safety, energy-saving and environmental protection of industrial production through heat and mass transfer rate, momentum loss, pressure gradient and other parameters. However, its production process involves physical and chemical reactions, the conversion and transfer of substances and energy, which leads to the problems that the process parameters are difficult to be detected. In a gas-liquid two-phase flow system, the flow patterns and dynamic characteristics of the two-phase flow are closely related to its system parameters (Zhou, Yunlong, 2010;Xiaolei et al., 2020). It can measure and control the system by identifying the flow patterns of the two-phase flow. Therefore, it can optimize the pipeline design to ensure the safety of industrial production. The gas-liquid interface of the gas-liquid two-phase flow is randomly variable, and the flow shape of the two-phase flow system is complex and changeable, so we need to investigate its characteristics further to identify the flow patterns.
The signal is a physical quantity representing the information. For example, electrical signals can express different information by changing amplitude, frequency, and phase (Meribout & Shehzad, 2020). Conductance CONTACT Chunling Fan peakfan@163.com fluctuation signal contains much information in the gas-liquid two-phase flow system. During the flow of gas-liquid flow in the pipeline, the flow pattern's conductance fluctuation exhibits nonlinear characteristics, so the feature extraction is essential for flow pattern recognition. Several signal processing techniques are widely used to extract certain system features, such as Fourier transform (Qiu et al., 2019;Sung et al., 2016), wavelet decomposition (Yan et al., 2018;Wang et al., 2018), and multi-scale complexity entropy causality plane (Dou et al., 2014). Meanwhile, many researchers apply the entropy theory and complex network features to characterize the twophase flow's complex characteristics. Gao (2020) developed a novel multiple entropy-based multilayer network (MEMN) for exploring the complex gas-liquid two-phase flow. The results show that the MEMN framework can effectively characterize the nonlinear evolution of the gas-liquid flow. Multivariate multi-scale weighted permutation entropy (MWMPE) can reflect the instability of oil-water two-phase flow and uncover the underlying evolution instability of the flow structures in oil-water flows (Han & Jin, 2018). Fan et al. ( 2018) proposed combining base-scale entropy with root mean square energy to analyse the gas-liquid two-phase flow. This method is a simple and straightforward strategy to extract the gas-liquid two-phase flow features and characterize the different flow patterns. Wavelet multiresolution complex network was applied to analyse multivariate nonlinear time series from oil-water two-phase flow experiments, and the results suggest that this method can characterize the nonlinear flow behaviour underlying the transitions of oil-water flows (Gao et al., 2017). Gao et al. (.,2016) inferred complex networks from multi-channel measurements in terms of phase lag index, aiming to uncover the phase dynamics governing the transition and evolution of different oil-in-water flow patterns. Although, in the field of two-phase flow we have made these achievements, we need to conduct more research deeply. Fractal theory is a science that studies the complexity of complex systems (J., C. & R, 2020; Razminia et al., 2019). Complex systems need to meet the characteristics of local and overall self-similarity. Therefore, we can study the complexity characteristics of gas-liquid two-phase flow pattern signals by the fractal theory. Zhou et al. (2017) employed the box-counting dimension algorithm theory to analyse multi-source information of gas-solid twophase flow. Their experiments show that it is conducive to deepen the understanding of the complicated flow behaviour in gas-solid two-phase systems, provided that the fractal characteristic of multi-source information can be correlated, and this theory is simple and convenient calculation. A novel relative permeability (RP) model for two-phase flow in fracture networks based on the fractal theory was proposed by Miao et al. (2018) This model can provide a better understanding of the fundamental mechanism of water-gas phase flow in fracture network. When the gas-liquid flow in the pipeline, the flow pattern's conductance fluctuation signal exhibits nonlinear characteristics. Therefore, the feature extraction is vital for identifying the flow pattern. Precisely, the fractal dimension is a significant parameter to describe complex and nonlinear systems, and the fractal theory has a significant effect on the process of nonlinear analysis. Therefore, this paper attempts to use mathematical morphology fractal dimension (MMFD) to study the characteristics of gas-liquid two-phase flow and achieve a good result.
In this paper, it verifies the effectiveness of the MMFD, implements it to calculate the fractal parameters corresponding to different flow patterns of twophase flow and explores the characteristics of the conductance fluctuation signals of different flow patterns from the perspective of complexity. According to the analysis of experiment results, the MMFD can not only reveal the complexity and nonlinear characteristic but also distinguish different flow patterns of two-phase flow, especially the transitional flow patterns.

Mathematical morphology fractal dimension theory
The mathematical morphology fractal dimension (Maragos & Sun, 1993) is very flexible and direct to calculate area of signals. We can directly perform one-dimensional morphological dilations and erosions. This algorithm solves the shortcoming of a large amount of calculation caused by converting a one-dimensional signal f (t) to a two-dimensional signal K(f ). The specific calculation method as follows: Suppose that G is a compact support, g is a unit structure function which is defined on G satisfying Equation (1).
We perform one-dimensional morphological dilations and erosions on f (t): x ∈ G}, ⊕ represents dilation operation and represents erosion operation. Defining the structure element function under scale ε: then the area A g (ε) covered by the morphology of the signal at scale ε is defined as: By referring to related literature (Maragos & Potamianos, 1999), the morphological coverage area obtained by performing two-dimensional dilations on K(f ) is equal to the morphological coverage area obtained from a onedimensional morphological erosions and dilations on f (t). Therefore, for a one-dimensional signal: Because the signals in the real situation are mostly discrete, it is necessary to discuss the calculation method of the MMFD in the case of discrete signals. Supposing that the discrete signal is f (n), n = 1, 2, · · · , N. The discrete scale is ε, and the unit structural element is defined as g. Then in the case of scale ε, the structural elements are defined: That is, the unit structural element g dilates ε times. Therefore, the erosions and dilations results of signal f (n) at scale ε are: The coverage area of the signal under scale ε is defined as: A g (ε) satisfies the following conditions: where D M is the fractal dimension obtained by MMFD,c is a constant, and ε max is the maximum scale. Therefore, the least squares fitting of log(A g (ε)/ε 2 ) and log(1/ε) can get the estimation of the MMFD.

The fractal dimension of typical signal
In this section, we take sine, cosine and Logistic mapping as examples to verify the effectiveness and accuracy of the MMFD. Figure 1 shows the modeling of typical signals. We regard time series as X(t), and employ the MMFD on X(t) to get fractal dimensions. The steps of the MMFD are shown in Table 1 First, we select g(1, 1, 1) and ε ∈ [1, 30]. X(t) performs erosion and dilation operations, as shown Equations (8) and (9), and we calculate log(1/ε) and log(A g (ε)/ε 2 ), Finally, we implement least-square fitting and obtain the fractal dimensions.

Analyse the characteristic of periodic signals
This section takes the X = sin(t) and Y = cos(t) as the experimental object. We take the sampling length     Table 2 shows the calculation results of fractal dimension of the MMFD. Table 3 lists that the calculation results of fractal dimension of the box-counting dimension. We know that the real dimensions of the sine and cosine wave signal are one by consulting the literature (Wang, 2006). From Table 2, we can get that the fractal dimensions of the MMFD of sine and cosine signals are entirely equal to the real dimensions of sine and cosine signals. However, from Table 3, the box-counting dimension of sine is 1.0004. It can be seen that the calculation result of box-counting dimension is slightly higher than the real dimension 1, and the error from the real dimension is 0.04%. The grid dimension of the cosine wave signal is 0.9999. The box-counting dimension of the calculated cosine signal is slightly smaller than the true value 1, and the error from the true dimension is 0.01%. Therefore, we can concluded that the MMFD accurately analyses the periodic signal's fractal dimensions.

Analyse the characteristic of chaotic systems
This section we take typical Logistic mapping as an example to verify that the MMFD can analyse the complexity and nonlinear characteristics of chaotic systems broadly. The Logistic mapping equation can be expressed as Equation (12).
where μ ∈ [2.8, 4], x(n) ∈ (0, 1). In the experiment, the generated data's length is 12,000, which is divided into 12 groups. Then we perform the MMFD on each group. The detailed steps of performing the MMFD can refer to Table 1 in section 3. The bifurcation diagram of the Logistic map is shown in Figure 2. The least-square fitting results of the fractal dimension of the MMFD are depicted in Figure 3.
In Figure 2, we can see that when µ is from 2.8 to 3.1, each µ corresponds to only one value of x, and the range is called the fixed point or period-1 curve. When 3.1 < µ ≤ 3.5, the first double period bifurcation occurs from period-1 to period-2. When µ is from 3.5 to 3.6, the second double period bifurcation occurs, and the Logistic system lies in period-4. when µ is from 3.6 to 4, the third double period bifurcation occurs, from period-4 to period-8. The system works in a chaotic state.
We can conclude from Figures 2 and 3 that when µ is from 2.8 to 4, as µ increases, the dimensions gradually increase. The larger the dimension of the system, the more complicated the system. When the chaotic system in period-1, the dimensions are the smallest, the dimension value is from 1.23479 to 1.23499, and the system complicated is smallest. When the chaotic system transforms into period-2, the dimension's value growth rate suddenly increases, the values enhance sharply from 1.23499 to 1.236. The complexity of the system is strengthened. When the chaotic system in period-8, corresponding serial number of Figure 3 is 8, the value of dimension is 1.23735. When the system works in a chaotic system, the dimensions of Logistics mapping increases  bigger, the growth rate becomes a little faster, and the complexity of it becomes greater. According to the analysis, the method of the MMFD can characterize the complexity and dynamic characteristics of chaotic systems greatly. And the transition process of complexity can be indicated explicitly. Therefore, we can apply the MMFD to analyse the two-phase flow patterns' characteristics and evolution dynamics.

Data collection and modeling
In the experiment, the water pumped from the pool or the air sucked by the compressor, and they are well mixed through a mixer and flow into the test vertical pipeline. And then flows into the water pool. The velocity of the gas phase is measured by the gas rotameter, and the water phase flow rate is controlled by the Leif YZ35 peristaltic pump. The Schematic diagram of the experimental setups shows in Figure 4. The experimental scheme is to fix the gas phase velocity and gradually increase the water phase velocity. The flow rates of water and air are varied within 1-12 m 3 /h and within 0.1-140 m 3 /h in the experiment.
The Modeling of gas-liquid two-phase flow is shown in Figure 5. First, we attain the conductivity signals under different working conditions through the acquisition system of conductivity signals of gas-liquid two-phase flow and regard it as X(t). The length of X(t) is 16,000, and we divide it into 16 groups; each group performs the MMFD operation. The detailed steps of conductance signal to perform the MMFD can refer to Table 1 in section 3.

Analysis of the characteristics of two-phase flow pattern
The two-phase flow system is a nonlinear dynamic system with complex characteristic properties affected by many factors. At present, we mainly employ sensors to obtain conductance fluctuation signals of different flow patterns. When the water flow rate is 12 m 3 /h, the conductance fluctuation signals of the three typical flow patterns and two transitional flow patterns under different gas flow conditions are shown in Figure 6.
The bubble flow usually occurs at low airflow speeds, its signal resembles a random signal, and the signal amplitude is very low. Due to the liquid flow instability, the twophase flow's conductance fluctuation signal has intermittent peaks and high amplitude. With the gas phase rate increases, the bubble transforms into bubble-slug. The randomness of the system is decreased. As to slug flow, it exhibits periodic behaviour. The slug-churn flow is the transitional flow pattern of slug flow and churn flow. As to the churns flow, when the gas plugs and liquid plugs rise in the tube, because of the gravity, the liquid plugs fall and collide with the incoming flows of the next moment. It vibrates alternately upward and downward in the pipe, exhibiting the irregularity and chaotic characteristics of conductance signals, similar to bubble flow patterns. However, the churn flow has a higher amplitude and weaker randomness than the bubble flow.

The MMFD analysis of two-phase flow patterns
To further investigate the characteristics and distribution of flow patterns under different operating conditions, the distribution graphs of the MMFD are obtained when the water flow are 2, 4, 6, 8, 12 m 3 /h as shown in Figure 7. Figure 7 shows that with the increase of the gas flow rate, the dimension values increase accordingly when the flow pattern is bubble-slug flow. The complicated of the two-phase flow is strengthened. Next, the flow pattern transforms into the slug flow, its dimension values are biggest. This phenomenon indicates that the complicated of the two-phase flow system are the most complex. While the slug flow transforms into slug-churn flow, the values of dimensions become smaller, and the complexity of two-phase flow decreases. When the flow pattern is churn flow, the two-phase flow system motion behaviour's randomness becomes weaker. For the three typical flow patterns: the bubble flow, slug flow and churn flow, the slug flow has the largest dimension values, which indicates that it is more periodic. In comparison, the bubble flow's dimension values are smallest, which shows that its motions are the most random. The churn flow's dimension values are slightly more prominent than the bubble flow, which indicates that its randomness is weaker than bubble flow. According to the analysis, there are apparent boundaries of different flow patterns, especially the transitional flow patterns. Therefore, MMFD can distinguish different flow patterns. Meanwhile, this method can reflect the complexity and dynamic characteristics of flow patterns of two-phase flow broadly.

Conclusions
Considering the two-phase flow's complex non-linear characteristics and non-stationary properties of the twophase flow, we employ the mathematical MMFD to analyse the gas-liquid two-phase flow's characteristic information. We take sine, cosine and Logistic mapping as examples to verify the effectiveness and accuracy of the MMFD. The results show that that the MMFD is better than grid fractal dimension in accuracy. Moreover, the MMFD can reflect the characteristic of chaotic systems. According to the analysis, this method is successfully applied to the feature extraction and the recognition of two-phase flow patterns, especially the transitional flow pattern can be recognized well. The paper provides a novel method on the flow patterns characteristics analysis of gas-liquid two-phase flow.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Funding
This project is supported by the Natural Science Foundation of Shandong (grant number ZR2019MEE071).