Abstract

In order to clarify the gas-water two-phase flow law in horizontal wells and study the gas-water two-phase flow characteristics in horizontal wells, firstly, the gas-water two-phase in a horizontal well is numerically simulated and analyzed, and the flow pattern distribution under different well inclination angles and different phase separation flow rates is obtained. Secondly, a series of production logging instruments including CAT instrument was used to conduct experimental research on gas-water two-phase flow under different flow conditions, and the measured values of each CAT probe were extracted to reflect the local holdup under different flow patterns. Finally, SSA-BP neural network algorithm is used to identify a gas-water two-phase flow pattern in a wellbore by using experimental parameters such as center holdup, well inclination angle, spinner revolution, and CAT probe measurements. The recognition accuracy of the neural network was improved from 83.75% to 91.66%, and the operation speed was accelerated. It provides a research idea to explore the flow characteristics of gas-water two-phase flow in horizontal wells.

1. Introduction

As an unconventional natural gas, shale gas has the advantages of wide geographical distribution, abundant reserves, large development potential, and long stable production cycle, and its development has attracted more and more attention from the world and has a profound impact on the global economy, politics, and military [1, 2]. China’s shale gas resources are abundant, the degree of resource exploration is low, and the development potential is large. At present, horizontal well drilling technology and hydraulic fracturing technology [3, 4] are the core technologies of shale gas development, and production profile logging is an effective method for postfracturing assessment of shale gas wells, which can understand the output and reverse discharge law of fracturing layer section, understand the dynamics of downhole production, and provide a basis for completion and production optimization [5]. The interpretation of shale gas production profile logging is mainly through the study of flow patterns and water holdup.

When the gas-water two-phase flow in the production well flows in the pipeline, the distribution of the phase interface changes and fluctuates with the flow process, and the flow pattern is complex and changeable. As one of the most important parameters to describe the flow characteristics of multiphase flow, the flow pattern is of critical importance to the study of the production well because of the limitations of environmental conditions that cannot be directly measured [6].

Scholars at home and abroad have conducted a large number of studies on the gas-liquid two-phase flow using numerical simulations. In 2008, in Schepper et al.’s study, the 3D horizontal tube model was established, the CFD software VOF model and PLIC reconstruction method were used to simulate the flow state of air and water flow in the horizontal pipe, and the flow pattern diagram of the horizontal well was predicted to verify the horizontal well flow pattern distribution of the Baker chart [7]. In 2011, Kou et al. used the FLUENT software VOF model to simulate the flow pattern distribution of different gas-liquid phase apparent velocity horizontal tubes and compared it with Mandhane’s classic horizontal well flow pattern diagram [8]. In 2012, Zhao et al. used VOF multiphase flow to simulate the two-phase flow of gas and liquid in a vertical rectangular flow channel at a high flow rate, observed the flow pattern conversion of bubble flow-elastic flow-agitation flow-annular flow in the rectangular channel, established the change of cross-sectional gas content and flow pattern, and analyzed the distribution law of the gas-liquid two-phase gas content rate of the rectangular channel [9]. In 2016, Xu used the VOF model of FLUENT software and RNG - turbulence to simulate the gas-liquid two-phase flow state of the near-horizontal tube with different inclination angles of 20 mm and analyzed the variation of the gas-liquid two-phase flow pattern, holdup, and flow rate of the inclination angle to the horizontal tube [10]. In 2022, Mo-yan et al. used similar principles to establish a theoretical calculation model of horizontal well gas-water two-phase flow and applied multiphase flow simulation software to conduct numerical simulation analysis of the accumulation process of horizontal wells [11].

In order to clarify the flow law of gas-liquid two-phase flow, a large number of physical experiments on gas-liquid two-phase have been carried out. In 1974, Beggs and Brill used a two-phase mixture of air and water as a fluid medium to conduct experimental studies on the flow characteristics of gas and liquid in vertical tubes and transparent tubes with different tilt angles of 0° to 90° and divided the flow patterns into three types: dispersed bubble flow, intermittent flow, and separation flow [12]. In 1980, Taitel et al. explained and predicted the transition conditions between different flow patterns based on the physical experimental data, proposed the corresponding mathematical model of the two-phase flow pattern transition of gas and liquid in the vertical tube, established the vertical gas-liquid two-phase flow pattern diagram with a pipe diameter of 25 mm and 50 mm, and further subdivided the bubble flow into a dispersed bubble flow [13]. In 2001, Kaya et al. summarized and revised the mechanical model of gas-liquid two-phase flow on the basis of previous research and predicted the flow pattern and flow characteristics of gas flow in inclined wells [14]. In 2010, Lu Jing et al. established a simulated flow loop similar to that of underground production. Experimental flow patterns were observed and divided into experimental flow patterns using a string of production logging instruments, which were instrumentally measured and simulated for the mixed flow of gas and water under different flow conditions [14]. In 2011, Hongwei et al. carried out an experimental study on the flow pattern of the large pipe diameter gas-water two-phase pipe flow under inclined and horizontal conditions, with the intention of starting from the fluid flow state inside the wellbore and studying the relationship between the three main flow parameters (total flow, water holdup, and well bevel) and flow pattern of the production logging measurement [16]. In 2020, in order to study the two-phase flow of gas and liquid in the inclined channel under nonlinear vibration conditions, Bo et al. combined the vibration device with the experimental circuit of gas-liquid two-phase flow, conducted experimental studies by changing the channel inclination angle and vibration parameters, and concluded that the two-phase flow of gas and liquid under nonlinear vibration conditions and steady-state conditions is different, and increasing the inclination angle and vibration parameters will lead to changes in the flow type conversion boundary [17].

The use of numerical simulation and experimental simulation of human observation of flow patterns is inevitably affected by subjective factors, it is difficult to achieve objective identification of flow patterns and online identification, and in order to identify stream types online, many scholars have begun to try to identify flow patterns by other methods. In 2001, Bofeng et al. used a CPN neural network to automatically identify the flow pattern of air-water two-phase flow in the vertical ascending section of a U-shaped pipe by combining the fast Fourier transform coefficient of the pressure fluctuation process [18]. In 2005, Yunlong and Sun Bin analyzed the pressure difference fluctuation signal of the air-water two-phase flow in the horizontal tube to obtain the relevant parameters, and the improved BP neural network of the adaptive learning rate of the eigenvector input of the flow pattern can realize the objective identification of the unknown flow pattern through the learning of the training samples [19]. In 2021, Qichao et al. used a full noise-assisted aggregation empirical mode decomposition algorithm combined with a probabilistic neural network to identify the flow pattern of gas-liquid two-phase flow under fluctuating vibrations [20]. In 2022, Edmord linked several circular flow patterns observed in the experiment to pressure gradients measured during the water-air and water-carbon dioxide composite flows, using artificial neural network ANN and -means clustering methods for well surge prediction [21].

However, the traditional optimization algorithm has great limitations in the face of complex and difficult optimization problems, the BP neural network algorithm is very sensitive to the initial weight, and it is easy to converge to the local minimum, so in view of the above problems, this paper first carries out the gas-water two-phase numerical simulation to obtain the horizontal well gas-water two-phase flow pattern. Then, the gas-water two-phase flow physical experiment was carried out, the high-speed camera was used to observe the gas-water two-phase flow pattern, and the flow pattern experimental data were obtained. The time-flow pattern analysis was performed on the experimental data, and it was found that the conversion of the gas-water two-phase flow pattern was related to the well inclination angle (CATROT), center holding rate (CWH), number of revolutions (CFB), and CAT probe measurement value (NCAP01-NCAP12), according to the above experimental data. An SSA-BP neural network algorithm is proposed (this method takes into account the advantages of the sparrow algorithm and the gradient descent algorithm in global and local search for very small points, respectively, which has certain guiding significance for the identification of air-water two-phase flow patterns).

2. Numerical Simulation

2.1. Model Construction

In this paper, a horizontal well pipe geometry model (as shown in Figure 1) is established according to the inclination angle of -10°, -5°, -2°, 0°, 5°, 15°, and 45°, with a pipe diameter of 124.0 mm and a pipe length of 20 m.

The left side of the model is a gas-liquid two-phase flow inlet, the right side is an outlet, the outer wall of the pipe is a transparent plexiglass tube, the overall calculation domain of the pipeline is , and the model is meshed by software (as shown in Figure 2) The mesh is divided using the sweep method, the network type is set to all triangles, and the number of divided meshes is 1407856.

2.2. Numerical Calculation Methods

In this paper, the VOF method is used to track and capture the gas-water interface. The VOF model is a surface tracking method built on a fixed Euler grid. In this method, incompatible fluid components share a set of momentum equations and track the interphase interface within the computational domain by introducing a variable , the phase volume fraction, where the volume of a phase is represented by , the ratio of the volume of the mesh it is in [22]. (1) gas phase(2) gas/liquid mixed phase(3) liquid phase

The volume fractional equation (continuity equation), which tracks the interface between phases, is accomplished by solving a continuous equation for the volume ratio of one or more phases: where is the volume fraction and is the speed, m/s.

The density of the mixed-phase fluid , which appears in the transport equation, is determined by the separation phases present in each control volume. Assuming that in a two-phase flow system, the phases are represented by subscripts 1 and 2, and if the volume fraction of the second phase is tracked, then the density in each cell is

In general, for -phase systems, the average density of the volume ratio takes the following form:

In the momentum equation, by solving a single momentum equation over the entire region, the resulting velocity field is shared by each phase, and the momentum equation depends on the volume ratio of all phases through the attribute and . wherein is the pressure, Pa; is the dynamic viscosity, Ns/m2; and is the equivalent volume force of the surface tension, Ns/m2.

The energy equation is shared among the phases. where is the effective thermal conductivity; is the source items, including radiation and other volumetric heat sources; and is the total energy.

The turbulence model used in this article is the standard - model.

The standard - model consists of two equations: turbulence kinetic energy and turbulent dissipation rate , where the turbulence viscosity is a function of and :

The equations of the standard - model can be expressed as wherein is the turbulent velocity plant number of turbulence kinetic energy and is the turbulent velocity plant number of turbulence kinetic energy ; is a turbulent term caused by a velocity gradient; is a turbulent term caused by buoyancy; indicates the effect of compressible turbulence pulsation expansion on the total dissipation rate; is the turbulence viscosity coefficient; are empirical constants; are user-defined source items.

2.3. Simulation Results and Analysis

Numerical simulation of the flow of gas-water in horizontal wells (near-horizontal wells) can analyze the different flow pattern characteristics produced by different inclination angles, apparent velocity changes, and moisture content of the two phases. The fluid media used in this numerical simulation are air (density of 1.29 kg/m3 and viscosity of  pa·s) and water (density of 998.4 kg/m3 and viscosity of  pa·s). The model inlet is set to the velocity inlet, and the outlet is set to the pressure outlet. The moisture content of the mixed phase is 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, and 90%. The total flow is 100 m3/d, 200 m3/d, 400 m3/d, and 800 m3/d. Four typical flow patterns were simulated separately, namely, smooth stratified flow, waveform stratified flow, bubble flow, and segment plug flow, as shown in Figure 3, where blue represents the gas phase, and red represents the water phase. And the simulation results were in good proportion with the flow pattern characteristics in the literature [16], which verified the correctness and feasibility of the model.

Figure 3 shows a numerical simulation of the gas-water two-phase flow in horizontal wells and large inclined wells. In this paper, numerical simulations adjust the magnitude of the mixed mass flow rate and the content of the gas-water two-phase at the inlet of the gas-liquid two-phase flow to analyze the different popular characteristics of the apparent velocity change of the gas-water two-phase flow [23]. According to the degree of dispersion of bubbles in the horizontal well, the size and quantity of bubbles, the flow type of gas-water two-phase flow is divided: stratified smooth flow, stratified wavy flow, bubble flow, and slug flow. (a)Stratified Smooth Flow. As shown in Figure 3(a), the gas phase and the water phase are completely separated, with a clear interface between them, and the gas phase flows above the pipe(b)Stratified Wavy Flow. As shown in Figure 3(b), the gas phase flows at a certain speed and creates fluctuations, undulations, and fluctuations at the top of the gas-water interface, like waves pushing forward, forming a stratified wavy flow(c)Bubble Flow. As shown in Figure 3(c), the bubbles are mostly in the upper part of the horizontal tubing and less in the lower part. The distribution of bubbles tends to be more uniform as the flow rate of the liquid phase increases(d)Slug Flow. As shown in Figure 3(d), on the basis of the wave flow, as the gas phase flow rate increases, the disturbing waves in these wave flow waves hit the upper surface of the flow channel, forming warhead-shaped large bubbles. In horizontal well conduits, water is in a continuous phase, while gas flows in the form of a segment plug

3. Experiment

3.1. Experiment Setup

The experiment was conducted on the multiphase flow simulation experimental platform of the production logging center of Yangtze University [16]. Figure 4 is a brief diagram of the multiphase flow simulation experimental platform.

The simulated wellbore device on the multiphase flow experimental platform has an inner diameter of 124 mm and a total length of 12 m, the main body of the wellbore is composed of a transparent plexiglass round tube with a length of 10 m (which is convenient for flow pattern and instrument experimental observation), and the two ends are 1 m long stainless-steel pipe [16]. The simulated wellbore can be set to any angle from horizontal to vertical. The experiment used an array logging instrument string including an array capacitance retention meter CAT. The experimental medium is air and tap water (at 16°C, standard atmospheric pressure are all Newtonian fluids, and gas and water densities are 0.0012 g/cm3 and 0.992 g/cm3, respectively). The multiphase fluids in the experimental wellbore are measured by the simulation workstation for their well angle, water holdup, flow pressure, etc. and stored in the database of the data acquisition system.

The experiment used an array logging instrument developed by GE (Figure 5). The probe array is designed to allow the instrument to simultaneously measure 12 fluids on a flow cross-section, and the measurement results comprehensively reflect the asymmetrical characteristics of the media distribution on the flow cross-section [15].

3.2. Analysis of Experimental Data

The experiment adopted five total flows from low to high, namely, 50, 100, 200, 400, and 800 m3/d; the corresponding horizontal direction of the well angle was set to 0, 5, 15, -2, -5, -10, and 45°; and the moisture content under each total flow rate was set to 0%, 10%, 30%, 50%, 70%, and 90%, respectively.

During the experiment, the flow control system on the flow loop adjusts and stabilizes the total supply flow rate and ratio of the gas-water two phases to the various well conditions in the above experimental scheme, and after the development of the gas-water two-phase flow pattern in the horizontal wellbore is stable [15], the well logging instrument is used to measure the gas-water mixed flow in the simulated wellbore, and the transparent wellbore gas-water two-phase flow pattern is observed and recorded with photographic equipment.

Through visual inspection during the test process, combined with the results of previous research and the analysis of photographic data, from the characteristics of the gas-water interface, the distribution of the air-water two phases in the horizontal and inclined tubes can be divided into five flow patterns as shown in Figure 6, namely, the five main flow types of smooth stratified flow, wave-like stratified flow, bubble flow, segment plug flow, and cyclic flow.

4. Flow Pattern Identification

4.1. Time Series Analysis

It is assumed that during the logging process, the fluid in the wellbore will not change the flow state due to temperature and pressure changes in a short period of time. Analyze the relationship between the measured value of each CAT probe and the flow pattern in the wellbore, and extract a section of the original data (extracted according to the fluctuating value, each working condition takes 1 s-2 s, the general speed measurement interval is 0.01 s, and when the speed measurement is 0, the interval is 0.1 s). Based on the raw data, the time-flow pattern plate composed of the local water retention rate and time relationship of each CAT probe, and the distribution of each CAT probe (the first probe is 0 at the top, counterclockwise) is drawn.

The time-flow pattern plate plotted from the original data of the test shows that in pure water, the probe measurement is a single value in pure gas, 1 in water and 0.1 in gas, with slight fluctuations.

Figure 7(a) shows that the water cut of this set of data is 0.7, the flow rate is 50 m3/day, and the well slope is 0°. It can be seen that part of the probe is soaked in water (3, 4, 5, 6, 7, 8, 9, 10, and 11 probe values are 1), and part of the probe bubbles in the air (1, 2, and 12 probe values are 0.1). At this time, the performance of the time-flow pattern curve is part of the curve and remains at 1, with little change over time, and the other part of the value remains at 0.2, which does not change much with time. The curve value has obvious boundaries and remains stationary over time, and it can be seen that the flow pattern of this group of data is a stratified smooth flow by comparing the probe position map with the local water retention rate-time relationship of the probe. This group of data flow type is a stratified smooth flow.

Figure 7(b) shows that the water cut of this set of data is 0.5, the flow rate is 400 m3/day, and the well slope is -5°. It can be seen that part of the probe is soaked in water (6, 7, and 8 probe values are 1), a part of the probe bubbles in the gas (1, 2, 3, 11, and 12 probe values are 0.1), and another part of the probe fluctuates with time in water and gas (4, 5, 9, 10). The boundary of the curve value is obvious but some probes fluctuate, because the probe position is on the dividing boundary of the gas-water interface, and by comparing the probe position map with the local water retention rate-time relationship of the probe, this group of data flow type is a stratified wavy flow.

The water cut of this set of data shown in Figure 7(c) is 0.9, the flow rate is 200 m3/day, and the well slope is 45°. It can be seen that the probe is basically soaked in water (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 probe values are 1), and the probe changes with time to show regular fluctuations, but the fluctuation is not large, may be due to the time that is too fast. The water holdup is 0.9, and by comparing the probe position map and the probe local water holdup-time relationship, this group of data flow type is bubble flow.

Figure 7(d) shows that the water cut of this set of data is 0.3, the flow rate is 800 m3/day, and the well slope is 15°. It can be seen that the probe is basically soaked in water (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 probe values are 1), but the probe changes with time to show regular fluctuations. Fluctuations are larger, and some probe values fluctuate to the median value of pure gas (1, 2, 11, and 12 probe part value is 0.1), possibly due to changes in time. The probe passes through segment plug-like bubbles, and the time is slightly longer. By comparing the probe position map with the probe local water retention rate-time relationship, this set of data flow type should be slug flow.

Under different flow patterns, the local water holdup value measured by CAT probes changes with time, and it can be concluded that the time-flow pattern analysis method can provide a basis for dividing the flow pattern without relying on the field graphic.

4.2. Flow Pattern Identification Based on SSA-BP

When gas-water two-phase flow in production wells flows in the wellbore, the distribution of the phase interface changes and fluctuates with the flow process, resulting in complex and variable gas-water two-phase flow patterns. At present, there are two main methods to identify the flow pattern of gas-liquid two-phase flow: one is the human observation method and the other is the use of field flow parameters combined with the existing flow pattern transformation guidelines or flow pattern diagram judgment method, both of which are inevitably subject to subjective factors to achieve objective identification of the flow pattern [18]. In addition, due to the conditions in the production wells, direct measurement of the flow pattern is not effective. Therefore, this paper proposes SSA-BP neural network algorithm to identify gas-water two-phase flow patterns.

4.2.1. BP Neural Network

The learning process of a BP neural network consists of two processes: forward propagation of signals and backpropagation of errors [23]. When propagating forward, the input sample is passed in from the input layer, processed layer by layer by hidden layer, and then passed to the output layer. The BP network [24] consists of an input layer, an output layer, and a hidden layer, [25] with N1 being the input layer, Nm being the output layer, and the rest being the hidden layer. The structure of the BP neural network is shown in Figure 8.

(1) Forward Propagation Process. Output layer functions:

Let be the input variable, be the output variable, the output of the hidden layer neuron, and be the mapping relationship of the activation function. Set for the weight of the input variable and the neuron in the th hidden layer, and let be the threshold of the th neuron in the hidden layer (or called the bias term, which is equivalent to the constant term and intercept in the multivariate linear regression). You can write out expression:

Let be the weight of the th neuron connected to , and is the bias of , which can be obtained:

(2) Backpropagation Process. Let be the true characteristic of the data, the true value output value is , and is the value predicted by the neural network. The goal we ultimately want to get is as little error as possible between the true value and the predicted value over the network, and the objective function is set to

is the learning rate, is the goal, is the parameter to be optimized, and the gradient of the is found:

Find the gradient of :

represents the input of the th feature. Find the gradient of :

Find the gradient of :

4.2.2. Sparrow Search Algorithm

SSA is a new swarm intelligence optimization algorithm, mainly inspired by sparrow foraging behavior and antipredation behavior [26], with a strong global optimization-seeking ability not dependent on gradient information, good parallelism, and fast convergence speed [28].

The general flow of the sparrow search algorithm is as follows: (1)Initialize the number of sparrow populations and define the values of their relevant parameters(2)Output the global optimal position and global optimal fitness value of the current sparrow(3)When the current number of iterations is less than the maximum number of iterations, the fitness values are ranked to find the current best and worst individuals

Throughout the sparrow foraging process, all sparrows were divided into two categories: discoverers and joiners. The discoverers themselves are highly adapted and search a wide range, guiding the population to search and forage. The joiners follow the discoverers to forage for better adaptation. At the same time, to improve their predation rate, some joiners will monitor the discoverer to facilitate food competition or foraging around it. When the whole population is threatened by a predator or realizes the danger, it will immediately engage in antipredation behavior [27].

The population consisting of sparrows can be expressed as where denotes the number of dimensions of the variables of the problem to be optimized and denotes the number of sparrows. In the subsequent optimization problem, denotes the number of parameters in the BP neural network to be optimized, i.e., the total number of weights and deviations. The fitness values of all sparrows can be expressed as where denotes the adaptation degree value. According to the above principle of the sparrow search algorithm, the optimization objective function can be established as follows: where denotes the total number of training sets and and are the true and predicted values of the th data, respectively. The fitness function indicates that we eventually want to get a network with the minimum error on the training set.

(1) Discoverer Location Update. During each iteration, the position of the discoverer is updated as follows:

In equation (19), denotes the current iteration number; denotes the maximum iteration number; denotes the position information of the th sparrow in the th dimensional space; is a random number from 0 to 1; denotes the warning value; denotes the safety value; denotes a random number obeying normal distribution; denotes a unit matrix.

(2) Joiner Location Update. The location of the joiner is updated in the following manner:

In equation (20), denotes the optimal position of the current discoverer; denotes the current global worst position; denotes a matrix where each element is randomly assigned to 1 or -1 and .

(3) Vigilante Location Update. In addition, there is a part of the sparrow as a sentry alarm duty, generally accounting for 10% to 20% of the population. The location of this type of sparrow vigilante position updates in the following manner:

In equation (21), denotes the current global optimal position; β denotes the step control parameter, which is a normally distributed random number with mean 0 and variance 1; is a random number between [-1,1]; denotes the adaptation value of the th sparrow; and are the optimal and worst adaptation values of the current sparrow population, respectively; ε is a constant, which serves to avoid the denominator being zero.

4.2.3. Flow Pattern Recognition and Results Based on SSA-BP Neural Network

BP neural networks are widely used in many fields because of their nonlinear mapping, arbitrary accuracy approximation, strong generalization ability, and self-adaptive learning ability, but because the initial weights and thresholds in BP neural network models are randomly assigned, even though the model will continuously adjust the weights through the error backpropagation algorithm so as to find the optimal weights and thresholds, they often have the problem of falling into local minima and convergence is slow [29]. In this paper, the sparrow search algorithm [26] is used to optimize it. SSA can optimize the weights and thresholds of the BP neural network by using its own powerful local and global search ability and fast convergence ability to get the optimal initial weights and thresholds [30], which avoids the risk of premature convergence to a minimal point during the training of the BP network. The SSA-BP neural network gas-water two-phase flow pattern identification method is formed. The flow chart of SSA-BP neural network flow pattern identification is shown in Figure 9.

Based on the results of time-flow pattern analysis, the 15 characteristic quantities of well slope angle (CATROT), center holdup (CWH), number of revolutions (CFB), and measured values of each CAT probe (NCAP01-NCAP12) obtained from the experiment were used as input, and the flow pattern was used as output to establish the SSA-BP neural network flow pattern recognition model.

Based on the BP basic neural network structure proposed in Section 4.2.1, a neural network structure dedicated to gas-water two-phase flow type recognition is built, as shown in Figure 10.

In this paper, 139 samples were collected in the gas-water two-phase flow experiments: 59 groups of stratified smooth flow (SF), 30 groups of stratified wavy flow (SWF), 38 groups of slug flow (SLF), and 12 groups of bubble flow (BF), based on visual inspection and analysis of images taken by high-speed cameras.

115 sets of training samples and 24 sets of test samples (6 sets randomly selected from each class of flow patterns, 24 sets in total: 1-6 for SF, 7-12 for SWF, 13-18 for SLF, and 19-24 for BF) were used as the sample set for the SSA-BP neural network model [31].

The parameters of the system prediction model were set, the number of individuals in the sparrow population was 50, the maximum number of iterations was 100, the proportion of discoverers to the total population was 0.7, the rest were followers, the proportion of vigilantes to the total population was 0.2, and the vigilance value was 0.6. The upper and lower boundaries of the weight threshold were -10 and 10. The number of BP neural network training was 1000 times, and the learning efficiency was 0.1. The training target minimum error was set to 0.001.

The results of BP neural network flow pattern identification are shown in Figure 11, and the results of SSA-BP neural network flow pattern identification are shown in Figure 12. The comparison table of the real category of air-water two-phase flow pattern with the BP prediction category and SSA-BP prediction category is shown in Table 1.

BP accuracy: 87.5%. SSA-BP accuracy: 91.66%.

According to the graph and table analysis, it can be concluded that the correct rate of BP neural network flow pattern recognition is 0.875, and the correct rate of SSA-BP neural network flow pattern recognition is 0.9166. By comparing the display to visually show the flow pattern prediction results and the actual category results, it can be concluded that both BP neural network algorithm and SSA-BP neural network can be used for gas-water two-phase flow pattern recognition. The introduction of the SSA algorithm can improve the accuracy of the BP neural network for flow pattern recognition and can effectively avoid the risk of convergence to local minima very early in the BP network training process.

5. Conclusions

(1)In this paper, a three-dimensional numerical model under the conditions of gas-water two-phases was established by using the FLUENT plate in ANSYS large finite element analysis software, and the flow of gas-water in horizontal wells and near-horizontal wells was investigated. The gas-water two-phase flow type can be divided into stratified smooth flow, stratified wavy flow, bubble flow, and slug flow(2)The holdup logging curve data and flow data of the typical flow pattern of gas-water in horizontal wells and near-horizontal wells are obtained by means of array logging instruments (array capacitance retention rate meter CAT), and the gas-water two-phase flow pattern is obtained based on the visual inspection of the test and the images taken by the high-definition camera(3)It is proposed to draw the local water holding capacity measurement and time of each CAT probe to obtain a time-flow pattern analysis method to analyze the flow law of gas-water two-phase, which can be used to divide the convection pattern when there is no on-site image(4)It is proposed to use the SSA-BP neural network algorithm to identify the gas-water two-phase flow patterns and obtain the accurate flow pattern categories, and the classification accuracy is 91.66%.

Data Availability

Data is available on request. Please contact the corresponding author for the underlying data supporting the results of the research.

Conflicts of Interest

All authors confirm that there is no financial/personal interest or belief that could affect our objectivity, and no conflicts exist.

Acknowledgments

This research was supported by the National Natural Science Foundation of China (42174155).