1 Introduction

Predicting the transition from stratified to intermittent two-phase flow is relevant to a number of industrial and engineering applications. Intermittent flows may be formed by changes in pipeline inclination (the so-called terrain-induced slugging), by re-starting the two-phase flow in a conduit (startup slugging) or by naturally occurring hydrodynamic conditions, whereby the transition to slug flow results from the amplification of instabilities at the interface between the phases. More specifically, starting from a stratified flow, interfacial waves grow in amplitude and wave length due to Kelvin–Helmholtz (K–H) instability until breaking waves or ‘slug precursors’ start to appear and fill the entire pipe cross section [1,2,3]. As a slug precursor accelerates due to a pressure buildup upstream of it, the precursor picks up the liquid ahead of it and grows in size, forming a liquid slug. Two-fluid models capable of predicting the growth of instabilities have been proposed to predict the transition to slug flow [4,5,6]. In general, such models are consistent with the Kelvin–Helmholtz instability theory, which forms the basis for a plethora of methods for slug flow initiation, as reviewed recently by Ref. [7]. Experimental data on slug flow initiation are useful (i) to improve the prediction ability of numerical models dedicated to developing strategies to prevent or delay the formation of slugs, and (ii) in the design of devices to mitigate the harmful consequences of severe flow intermittency, such as separators and slug catchers.

Compared to the amount of data for fully developed intermittent flows (slug and plug flow) in horizontal and slightly inclined pipes, there is a dearth of quantitative data on the developing flow structure in the entrance region. Vallee et al. [8] evaluated experimentally the formation of waves and slug precursors in a 2-m-long 250 (height) x 50 (width) mm\(^2\) transparent test section using high-speed video analysis. The data were compared with a numerical simulation of the two-phase flow in the developing region using a commercial software package. Czapp et al. [9] combined high-speed stereo particle image velocimetry (PIV) and laser-induced fluorescence (LIF) to obtain the instantaneous 3D liquid velocity field during slug formation in a 9.46-m-long, 54-mm ID circular pipe.

Recently, several studies have been presented in which techniques for processing digital images of two-phase flows (e.g., “blob” extraction, edge detection, watershed segmentation, etc.) have been used to determine phase fractions and/or intermittent flow parameters, such as slug velocity, frequency and size, in both developing and developed flow [10,11,12,13,14]. Although such techniques are still limited to low-pressure systems and relatively low gas superficial velocities due to difficulties in processing highly aerated liquid slugs, their advantages in comparison with other methods (intrusive or non-intrusive) are the low cost, simplicity, processing speed and safety.

As far as the numerical simulation is concerned, a number of models have been proposed recently to simulate two-phase gas–liquid flows where large and small length scale interfaces coexist (the so-called mixed flows) [15,16,17,18,19]. While problems involving the latter length scale can be traditionally dealt with using two-fluid (i.e., interpenetrating continua) models to resolve the space and time average quantities (such as the turbulent properties in dispersed bubbly flows), interface tracking methods (such as the VOF and level set methods) are used to compute the position of large-scale interfaces in the time and space domains. The so-called compressive schemes are often used to sharpen the phase interface and reduce the effects of numerical diffusion on the local flow properties [20]. In mixed flows, two-fluid models can be successfully applied to the whole computational domain, while an interface tracking method can be implemented to track the position of the large-scale interface [17, 19].

The purpose of this paper is twofold: firstly, we report on the development and application of an edge detection method [21] to process digital images and extract quantitative data on the formation of air–water slug flow in a 26.4-mm ID horizontal tube. A high-speed camera was used to record the image sequences and two 130-W (60 kLux) LED sources were used to illuminate the flow and provide the desired contrast between the phases. The experimental results on flow velocity and frequency were compared against data obtained simultaneously from capacitance sensors. Secondly, numerical simulations of the developing two-phase intermittent flow were carried out using a combination of the two-fluid model and the VOF (volume of fluid) method using the commercial CFD (Computational Fluid Dynamics) software package ANSYS-FLUENT v.16.2 [22]. The slug length and the slug velocity were well predicted by the model, with relative errors below 8% for the latter (with respect to the image processing technique).

2 Experimental work

2.1 Experimental facility

The experimental apparatus (Fig. 1) has been described in detail elsewhere [23, 24], so only the principal characteristics and changes necessary for the execution of the present work will be presented here. The apparatus was originally conceived and built for investigating gas–liquid flows in vertical return bends with different curvature radii. The test section is made from 26.4-mm ID borosilicate glass tube segments, with a length of approximately 5 m between the inlet flow mixers and the return bend.

Fig. 1
figure 1

Schematic diagram of the experimental facility. Key to components: (2) thermostatic bath, (3) centrifugal pump, (4) Coriolis mass flow meter, (5) particulate filter, (6) a coalescent filter, (7) pressure regulator, (8) micrometric valve, (9) hot-wire mass flow meter, (10) flow visualization box, (P) pressure measurement, (T) temperature measurement, (\(\alpha\)) possible locations of holdup (capacitance) sensors. Adapted from [24]

In the present study, the flow inlet was always through the upper leg (downflow in the bend) to minimize the influence of the bend on the flow upstream (e.g., flow reversal, backpressure). The curvature radius of the bend was approximately 161 mm. Inlet flow conditions, such as the geometry of the inlet flow mixer, are extremely important to establish the flow developing length. Eventually, as the flow becomes approximately developed, the two-phase flow parameters become independent of the inlet configuration. However, inlet geometries that favor a higher liquid level at the inlet lead to higher slug frequencies in the developing region, since this facilitates bridging of the pipe cross section by the interfacial disturbances [7, 25]. A flow mixer/injector (1) has been designed and constructed using a dividing plate and wire meshes to guarantee a smooth stratified flow regime at the test section inlet (see Fig. 2).

One of the most important parts of the test section is a flow visualization box (10) built around the borosilicate glass tube to minimize image distortion due to the curvature of the tube wall. The box is made of acrylic resin and filled with an aqueous solution to match the refractive index of the borosilicate glass. The flow visualization box is positioned at a distance of 8.9 ID (approximately 235 mm) from the tube inlet and has a length of 975 mm.

Gas holdup was evaluated by two non-intrusive capacitance sensors positioned approximately 1 m downstream of the flow visualization box. A full description of the capacitance sensors has been given elsewhere [23, 26]. In the present tests, a calibration curve specific for intermittent flows has been used [26]. Two absolute pressure sensors were installed at the inlet and outlet of the test section. Their measurements were used to calculate the air density. The ambient and inlet air flow temperatures were maintained at 24 \(^\circ\)C.

Fig. 2
figure 2

Inlet flow mixer

2.2 Time-resolved measurements and experimental conditions

To carry out time-resolved measurements of the phase distribution in slug and plug flows, a high-speed camera (Phantom V310) equipped with a 35-mm Carl Zeiss lens was positioned perpendicular to the test section, at approximately 2 m from the tube, as shown in Fig. 3. The length of the interrogation area (in the flow visualization box) was approximately 900 mm and the resolution of the image was 1.21 pixels/mm. The images were acquired at a rate of 200 Hz. Illumination was provided by two 130-W (60 kLux) LED sources.

Fig. 3
figure 3

Camera and LED source setup to record the images of the two-phase intermittent flow. Dimensions in mm

An algorithm was developed to capture the position of the two-phase interface by processing the sequences of digital images using the Canny edge detection method [21], as described in detail in Barbosa et al. [27]. Figure 4 illustrates the steps in the image processing implemented in Matlab. An iterative procedure, whose final result is illustrated in Fig. 4e, consists of dilation and filling processes to identify the region where the light intensity changes from 0 (black) to 1 (white) and construct an array with liquid height as a function of axial position. After applying the Canny method, two edge lines are obtained as a result of the curvature of the interface. To avoid using an interpolation scheme to determine the mean position of the interface, the bottom line was taken as the reference.

Fig. 4
figure 4

Sequence of steps in the image processing

In the present analysis, two “virtual sensors” were positioned near the end of the flow visualization box, as shown schematically in Fig. 5. A virtual sensor is a stack of approximately 21 pixels aligned in the vertical (transversal) direction and positioned at a certain distance from the inlet. Since each pixel in the virtual sensor can act as a local instantaneous probe to detect the presence of a given phase, the output signal from a virtual sensor can be an array of 21 values of a binary color function (liquid or gas) or an average of such values, which corresponds to the line average phase fraction at that particular position. In stratified flow, this average is directly related to the local instantaneous liquid height. The distance between the two virtual sensors used in the data processing was 70 mm, which is the same distance between the capacitance probes positioned at approximately 1 m downstream of the flow visualization box. The capacitance sensors were used as a reference to the measurements undertaken in this work.

The velocity of the two-phase flow structures (e.g., liquid slugs) can be determined using the signals from two different probes as \(L/\tau _o\), where L is the longitudinal distance between the probes and \(\tau _o\) is the time delay associated with the peak of the cross-correlation function of the two signals [28]. The dominant frequencies of the flow structures were calculated from the power spectral density (PSD) which, for each probe (virtual or capacitance), is computed from the Fourier transform of the autocorrelation function of the signal after subtraction of the mean value (DC component removal).

Fig. 5
figure 5

Position of the virtual sensors in the image processing analysis

The experimental conditions evaluated in this study were \(j_L = 0.27\) m/s and \(j_G = 1.89\) m/s (Case #1) and \(j_L = 0.19\) m/s and \(j_G = 0.61\) m/s (Case #2). In the flow pattern map of Mandhane et al. [29], Case #1 fell in the slug flow regime, while Case #2 was in the plug flow regime. As mentioned in Oliveira and Barbosa [23], a very good agreement was found between the Ref. [29] map and the flow regimes encountered in the present experimental facility.

3 Mathematical modeling

The two-phase flow was simulated with ANSYS-FLUENT v. 16.2. using the two-fluid model coupled with the volume of fluid (VOF) model to determine the position of the large-scale interface. Turbulence was solved using the k-\(\omega\) SST model with the Egorov [30] interfacial damping parameter assumed equal to 100 and 10 for Cases #1 (slug flow) and #2 (plug flow), respectively [31]. The interfacial momentum transfer model of Rezende et al. [32] was implemented via the UDF (user defined function) feature. The momentum and mass conservation equations were discretized via a third-order MUSCL scheme. An implicitly compressive scheme was used to discretize the volume fraction transport equation. The turbulence equations were discretized by a first order scheme. The transient terms in the volume fraction transport, mass and momentum conservation equations were discretized by a bounded second order scheme. The physical properties were treated as constants at 24 \(^\circ\)C, i.e., \(\rho _G = 1.188\) kg/m\(^3\), \(\rho _L = 997.3\) kg/m\(^3\), \(\mu _G = 1.84 \times 10^{-5}\) Pa.s, \(\mu _L = 9.11 \times 10^{-4}\) Pa.s, \(\sigma = 0.072\) N/m.

The boundary conditions are shown schematically in Fig. 6.a. The length of the domain was 1.4 m, i.e., 0,2 m longer than the visualization box so as to reduce the effect of gas back flow in the outlet region. At the inlet, uniform flow velocities are prescribed for the air and water, using the position of the dividing plate in the inlet flow mixer as a reference. Pressures were prescribed at the outlet, where an equivalent water hydrostatic head was assumed, for \(y > 0\). No slip boundary conditions were assumed on the pipe walls. The grid consisted of approximately 3 million hexaedric elements, with a radial dimension of approximately 0.1 mm near the wall and 0.5 mm close to the centerline (growth rate of 20%), as shown in Fig. 6.b. The axial dimension of the elements was 2 mm. More refined meshes did not produce a significant change in the characteristic frequency or time delay associated with the liquid slugs. The numerical computation residuals were lower than \(10^{-4}\) for the velocity components and \(10^{-3}\) for the mass conservation.

The time steps were 0.25 and 0.50 ms for Cases #1 (slug flow) and #2 (plug flow), which are 20 and 10 times smaller than the frame acquisition period in the image recordings. Ten iterations per time step were sufficient to guarantee numerical convergence of the transient simulation. The simulations were carried out using two SUPERMICRO servers (72 cores each). Grid partitioning was done with an infiniband network to reduce the computing time. The total wall time required for obtaining 50 big intermittent flow structures (i.e., slugs and plugs) was approximately 190 h.

Fig. 6
figure 6

a Schematic representation of the boundary conditions. b Cross-sectional view of the computational grid.

4 Results

Figure 7 shows a comparison between the void fraction signals obtained from the image processing (virtual sensor) and one of the capacitance sensors for Cases #1 and #2. The curvature of the interface in the plane normal to the tube center line (cross section) has been neglected in the computation of the void fraction from the image analysis. While the agreement in terms of the instantaneous behavior of the phase fraction is significantly better for Case #2 (the case with a much lower mixture velocity), the length of the elongated bubbles (and consequently the slug frequency) is reasonably well correlated between the two techniques for Case #1. In Case #2, the image processing results in somewhat shorter liquid slugs (longer elongated bubbles) because of the difficulty in detecting interfaces in the turbulent bubble wake region, where the interface is broken into small bubbles. Again, the higher void fraction predicted by the image analysis in the bubble nose region may be related to the curvature of the interface normal to the vertical mid-plane of the tube, which cannot be captured in the plane (projected) images. However, one should bear in mind that the capacitance sensors give a volume average phase fraction and, as a result, some local information on the phase distribution is lost during this averaging process.

Fig. 7
figure 7

Comparison of void fraction sensor and image analyses signals. a Case #1: \(j_L = 0.27\) m/s, \(j_G = 1.89\) m/s. b Case #2: \(j_L = 0.19\) m/s, \(j_G = 0.61\) m/s.

Figure 8 shows the sequences of images of phase distribution in the flow developing region for Case #1. The figures are presented in pairs to facilitate the comparison between the experimental (light gray sequences) and numerical (black sequences) results. The abscissas show that the distance from the inlet of the flow visualization box and the time interval between pairs of figures (earliest at the top) is 35 ms. In the experimental result, a slug precursor is formed at around 220 mm, having originated from film disturbances growing near the entrance of the flow visualization box. The increase in pressure upstream of the precursor accelerates the newly formed liquid slug, which grows in size as it engulfs the slower moving liquid ahead of it. The increase in pressure is also responsible for the decrease in liquid height upstream of the precursor. The size of the liquid slug and the thickness of the liquid film behind it are very similar between the experimental and numerical results. However, slug formation occurs approximately 0.15 m downstream for the case illustrated in Fig. 8.

Fig. 8
figure 8

Images of phase distribution in the inlet region of the 26.4-mm ID tube. Light gray sequences show the experimental data and the black sequences the numerical results. Case #1: \(j_L = 0.27\) m/s, \(j_G = 1.89\) m/s.

Figure 9 shows the spatio-temporal flow displacement maps for the experimental data (image processing) and numerical results for Case #1. The grayscale corresponds to the liquid height, in mm, so the liquid slugs are seen as the darkest region in both maps. Although the delay in predicting the slug formation is evident, the slug velocity is very well predicted by the model (inclination of the darker regions in the space–time domain). Cross-correlation of the signals from the “virtual sensors” and capacitance transducers resulted in the structure (slug) velocities shown in Table 1. The structure velocity calculated from cross-correlating the numerical results at the same positions of the virtual sensors is also shown. Interfacial waves are also clearly seen in the displacement maps corresponding to the numerical simulations. Their smaller inclination with respect to the horizontal axis indicates that the waves travel at a lower velocity than the liquid slug ahead of them.

Fig. 9
figure 9

Spatio-temporal flow displacement maps. a Experimental data (image processing), b numerical model. Case #1: \(j_L = 0.27\) m/s, \(j_G = 1.89\) m/s

Figure 10 shows the phase distribution for Case #2. Due to the lower displacement velocities of the flow structures (lower gas superficial velocities), the time interval between consecutive pairs of images is 0.11 s. The presence of a relatively higher liquid content near the tube inlet has led to a larger number of small amplitude interfacial waves compared with Case #1, so the model already predicts an unstable wave growth (blocking the tube cross section) upstream of the flow interrogation area, which is consistent with the experimental observations. The structure (slug) velocities calculated from the cross-correlation of the signals from the virtual sensors and capacitance transducers for Case #2 are also presented in Table 1, together with the structure velocity calculated from cross-correlating the numerical results at the same positions of the virtual sensors.

Fig. 10
figure 10

Images of phase distribution in the inlet region of the 26.4-mm ID tube. Light gray sequences show the experimental data and the black sequences the numerical results. Case #2: \(j_L = 0.19\) m/s, \(j_G = 0.61\) m/s.

In Table 1, the figures in brackets are the relative errors between the CFD structure velocity and the structure velocity associated with each corresponding experimental technique. As can be seen, an encouraging agreement is observed between the numerical analysis and each technique, with a clearly better agreement with the image processing method developed in this paper. Nevertheless, the experimental techniques are also in good agreement with each other; the relative deviations between the structure velocity derived from the image processing technique and the capacitance sensor were 5.7% and −6.9%, for Cases #1 and #2, respectively.

Table 1 Structure velocity derived from the cross-correlation of the signals

Figure 11 shows the spatio-temporal flow displacement maps for Case #2. It is quite evident that the velocity of the liquid slug is much higher in the experimental image processing than in the numerical simulation (inclination in the distance–time domain). The numerical model also predicts a somewhat thicker liquid film behind the liquid plugs, in comparison with the experiments. For a given superficial gas velocity, this thicker liquid film contributes to a faster rate of growth of instabilities at the interface following the passage of the plug, which results in a higher frequency of formation of flow structures for the numerical case, in comparison with the experimental observations. Also clear in the flow displacement maps is the smaller size of the liquid slug predicted by the numerical model for Case #2.

Fig. 11
figure 11

Spatio-temporal flow displacement maps. a Experimental data (image processing), b numerical model. Case #2: \(j_L = 0.19\) m/s, \(j_G = 0.61\) m/s.

Figure 12 shows the power spectral density (PSD) results for Cases #1 and #2. A very good agreement between the two experimental techniques is observed in both cases with respect to the dominant frequency associated with the structures of each flow regime. The dominant frequency was higher in the slug flow cases due to larger average relative velocity between the phases and associated Kelvin–Helmholtz instability. In both cases, the capacitance sensor captured a wider range of frequencies, with the image processing technique smoothing out some of the higher frequency structures. Regarding the predictions by the numerical model, the dominant frequency is underpredicted in Case #1 (slug flow) and overpredicted in Case #2 (plug flow). In slug flow, the discrepancy is due to the difficulty in reproducing the onset of slugging (formation delay) as discussed in Fig. 9. In the plug flow case, the overprediction by the numerical model may be related to the fact that the film thickness behind the liquid slug is much thicker in the numerical model than in the experiments, which induces more instabilities in the liquid film in the former.

Fig. 12
figure 12

Power spectral density (PSD) results for the slug flow cases. a Case #1, b Case #2.

5 Conclusions

A high-speed image processing technique based on the Canny edge detection method [21] was developed in this study to provide quantitative experimental data of the initiation of intermittent flows in the inlet region of a 26.4-mm horizontal pipe. Two 130-W LED sources were used to illuminate the flow and achieve a good contrast between the phases. A comparison with data obtained simultaneously using capacitance void fraction sensors revealed a good agreement in terms of the dominant frequency obtained from the power spectral density and the flow structure velocity derived from the cross-correlation of the phase distribution signals from both techniques (relative deviations of 5.7 and − 6.9% for Cases #1 and #2).

The problem was modeled numerically with the commercial package ANSYS-FLUENT v. 16.2 using a combination of the two-fluid and volume-of-fluid methods (to track the position of the two-phase interface) and a new model for the interfacial momentum transfer term [32]. A comparison between spatio-temporal displacement maps constructed using the image processing data and the numerical simulation results revealed an encouraging agreement for the phase distribution (liquid height), dominating frequency and average velocity of the flow structures in the flow developing region (relative errors of 6.8% and − 7.4% for Cases #1 and #2). Nonetheless, there is still room for improving the accuracy of the numerical results through a better prediction of the physical mechanisms associated with the interfacial instability. This shall be investigated further in future studies.