Analyzing the Fluid Flow of Transit-Time Ultrasonic Flowmeter with Image Processing Technique and Developing a Quality Metric Depending on Pipe Profile

— The ultrasonic transit-time method measures the velocity and quantity of fluids in circular type pipes by using the difference of transit time between the ultrasonic pulses propagating with and against the flow direction. This method gives the average velocity of the fluid along a particular acoustic path. At least two ultrasonic transducers are used for an acoustic path. The multipath ultrasonic flowmeters have more acoustic paths. In this paper, the acoustic path between two transducers is described as pixels for the turbulent flow and formed a flow map for ideal flow conditions such as no elbow or bend depending on pipe profile. This map is used to analyze the fluid flow for different Reynolds numbers. Additionally, for any acoustic path between two transducers, the average fluid velocity is calculated using the obtained pixel values. Thus, a quality metric is developed in this paper. This metric calculates the ideal average fluid velocity ratio between the acoustic paths. The developed metric can be used to evaluate the quality of the ultrasonic flowmeter in the domain of turbulent flow.


I. INTRODUCTION
CCORDING TO the measurement principle, the ultrasonic flowmeters are divided into two groups: Transit-Time Difference (TTD) and Doppler methods. The Doppler method is used for fluids containing particles such as bubbles and sand. This method relies on particles flowing through the fluid. Generally, this method is considered as having low performance due to the fact that the particle velocity is different from the fluid velocity. TTD ultrasonic flowmeter is used for homogeneous fluids that do not contain particles and has many advantages such as high accuracy, low maintenance and economical.
Many precision of TTD ultrasonic flowmeters, some of which find the optimal transducer angle [1], design the pipe [2], filter the signals [3,4] and use FPGA [5,6]. Zero-crossing and correlation methods are the most commonly used methods to find TTD [7]. Some of the scientists have studied to increase the "sensitivity for the zero-crossing method [8,9]. Leastsquare-sine-fitting technique is considered as an alternative method to obtain TTD [10].
To increase the accuracy in measuring, the multipath design has different acoustic paths. The calculation method for multipath ultrasonic flowmeter is described as follows: The fluid velocity is calculated for each path as in the one-path ultrasonic flowmeter. The average velocity is calculated by multiplying the calculated velocity value with the weight value for each path. The simplest way to calculate the weight value is the averaged method involving an equally weighted average of the path velocities [11]. In another method, the weight values are determined according to the geometric position of the transducers [12]. In this method, weight values are calculated by reference to the distance of the transducers from the pipe center. The transducer, which is close to the center, has a higher weight value. It has less weight value as it moves away from the center. Several path arrangement designs exist with weights to prescribe the position of acoustic paths, and an integration method is used such as Gauss-Jacobi and Optimal Weighted Integration for Circular Sections (OWICS) [13][14][15]. The major disadvantage of these methods is that weights are calculated based on fixed transducer positions. Researchers have focused on eliminating such disadvantages and increasing the accuracy by using a different algorithm such as Generalized Inverse Matrix, Levenberg-Marquardt, and variances of path velocities [16][17][18].
Although there are many studies on TTD ultrasonic flowmeters, research continues. This paper presents a flow map for ideal flow condition (FMIFC). FMIFC is formed in the domain of turbulent flow (i.e., Reynolds number (Re) > 4000) of transit-time ultrasonic flowmeter depending on pipe profile. Thus, researchers can analyze the fluid flow depending on Re. Furthermore, using FMIFC, a quality metric is developed. The developed metric calculates the ideal average fluid velocity ratio between the acoustic paths to obtain a reference value for ideal flow conditions. For the multiple acoustic paths, researchers can compare the application values with the reference values to evaluate their designs. In this paper, the following section presents the measurement principle of the transit-time ultrasonic flowmeter. FMIFC and the proposed quality metric are considered in Section III. Results and discussion are presented in Section IV. Finally, Section V concludes this paper.
II. OPERATING PRINCIPLE OF TRANSIT-TIME ULTRASONIC FLOWMETER Due to the simplicity of the measurement principle, TTD method is often used in industrial applications [19]. At least two ultrasonic transducers are placed on the surface of the pipe. The transducers send ultrasonic pulses to each other. The fluid flow velocity is calculated by using the propagation time of the received pulses. The operating principle of the TTD method is shown in Fig. 1.
In Fig. 1, r 0 is the pipe radius, t AB and t BA are the transit times, θ is the angle between the pipe and the direction of the ultrasonic wave and v m is the velocity on the center. In TTD method, the ultrasonic flowmeter measures the average velocity along the path between the ultrasonic transducers. Two ultrasonic transducers (shown as transducer A and transducer B in Fig. 1) send pulses propagating into and against the direction of the fluid flow. The transit time from transducer B to transducer A (t BA ) is greater than the transit time from transducer A to transducer B (t AB ) and they are calculated as follows: where L is the distance between the transducer A and transducer B, v is the fluid flow velocity and c is the ultrasound speed in the fluid. The TTD is calculated as follows: From the Eq. (3), we can obtain the v: At low fluid flow velocities, the flow tends to be dominated by laminar flow, while at high fluid flow velocities flow is referred to as the turbulent flow. This paper is about the turbulent flow, i.e., Re > 4000. In the domain of turbulent flow, the velocity profile is called the "pipe profile" given by [20,21]: where r is the distance from the center and p is a parameter as chosen [21,22]: Re log 023 . 0 25 . 0 10   p (6) Remark that this parameter decreases with increasing Re and hereby v(r) approaches to v m . Therefore, the ratio of v(r) to v m can be calculated depending on the Re.

III. FMIFC AND THE PROPOSED QUALITY METRIC
At first, in this paper, the fluid flow in circular type pipe for ultrasonic flowmeter application is described as pixels. The schematic of an ultrasonic flowmeter is shown in Fig. 2 The pipe profile in Eq. (5) gives the velocity profile on the horizontal direction as shown in Fig. 1 and Fig. 2. If the ultrasonic transducers are placed on both ends of the y-axis shown in Fig. 2b, the acoustic path between these transducers can be described as pixels in Fig. 3.  Fig. 3 is between 0-255 and depends on fluid velocity. The greater fluid velocity means the bigger pixel value. Each pixel value can be calculated using Eq. (5). r=r 0 corresponds to the pipe surface where the velocity equals zero (v(r) = 0) and pixel value is zero. The pixels, which is close to the center, has a bigger value. r=0 corresponds to the center of the pipe where velocity is the maximum (v(r) = v m ) and pixel value is 255. As mentioned above, for the larger Re, v(r) approaches to v m, resulting in bigger pixel value. After calculating each pixel value on the acoustic path, the average fluid velocity on the acoustic path can be obtained by averaging the calculated pixel values.
The velocity v given by Eq. (4), corresponding to the average fluid velocity on the acoustic path between the ultrasonic transducers shown in Fig. 3, can be obtained by using v m as follows [21]: v values are calculated by using both pixels shown in Fig. 3 and Eq. (7) between Re=4000 and Re=1000000. The obtained values are normalized with v m and shown in Fig. 4. Instead of handling the entire distance between the two transducers, shown in Fig. 3, only the pixels between the ultrasonic transducer A and center are handled to avoid extra processing. As shown in Fig. 4b, the normalized v value for the Re= 4000 is 0.856. It is approaching v m as the Re increases, and this value is 0.899 for the Re=1000000. Comparing Fig. 4a and Fig. 4b, the normalized values obtained by pixels and Eq. (7) are equal to each other. If we consider the acoustic path in Fig.  3 as in Fig. 5, the pixel values of the acoustic path between each ultrasonic transducer pair and average flow velocity for the corresponding acoustic path can be calculated by the method mentioned above.  The ultrasonic transducers may be located in the middle of the pipe (as shown in Fig. 3) or at any point in the z-direction (as shown in Fig. 6). Thus, each transducer pair has a different velocity and acoustic path length information. In this paper, the normalized average flow velocity value of each acoustic path shown in Fig. 6 is calculated using pixels. For this purpose, the acoustic paths between the ultrasonic transducers are first illustrated by pixels as shown in Fig. 7. Instead of handling the entire distance between two transducers, only the pixels between the ultrasonic transducer A and center (as shown in Fig. 3) are handled to avoid extra processing. The pixel values of the red acoustic paths can be calculated as previously stated in this paper. The green acoustic paths indicate the acoustic paths between the ultrasonic transducers located in the z-direction as shown in Fig. 6. While N represents the number of pixels in each acoustic path, M indicates the acoustic path number. Increasing the number of M and N means more precise result but more processing. So, in this study, M and N values are chosen as 1000 (that means the image shown in Fig. 7 has 1000*1000 pixels). a and b are the vertical and horizontal positions of the pixel to be calculated, respectively. To find the pixel (a, b) value, the following algorithm is applied:  (11) where v (a, b) is the pixel value at (a, b). Transducer distance, point distance, and r distance shown in Eqs. (8)(9)(10)(11) are indicated in Fig. 8:  Fig. 7 can be calculated by using Eqs. (8)(9)(10)(11) to obtain FMIFC. The r distance is calculated using Eqs. (8)(9)(10) to obtain any v (a, b) value in the image. For example, let the image has 10*10 pixels and calculate the r distance for v (3,8). In this case, the transducer distance is the distance from (3,10) to (3,1), while the point distance is the distance from (3,8) to (3,1). Thus the r distance is the distance from (3,8) to (1,1). After calculating the r distance, v (a, b) value is obtained using Eq. (11). v m which is pixel value at (1, 1) is 255. As stated in Eq. (6), parameter p shown in Eq. (11) depends on the Re. Thus, FMIFC can be obtained for each Re. Fig. 9 shows FMIFC having 1000*1000 pixels for Re=100000.  Fig. 7 after calculating the pixels on the acoustic paths shown in Fig.  7. There are 1000 acoustic paths and each acoustic path has 1000 pixels in Fig. 9. The pixel at (M=1, N=1) corresponds to the v m . The pixels at M=1000 or N=1000 correspond to the pipe surface. FMIFC can be used to analyze fluid flow for different Re values. Besides, FMIFC can be used to obtain the ideal average fluid velocity ratio between the acoustic paths in the z-direction. The average fluid velocity, for any acoustic path in the z-direction, is calculated by averaging the obtained pixels on this acoustic path. Thus, a quality metric is obtained in this paper, which indicates the ratio of the average fluid velocities of different acoustic paths. The quality metric based on pixel (Q bp ) is calculated as follows: a bpr bp Q Q Q  (12) where Q bpr and Q a are the quality metrics for reference and application, respectively and defined as (14) where v bp1 and v bp2 are the normalized average fluid velocities based on pixel for reference, v 1 and v 2 are the average fluid velocities for the application. A researcher places the ultrasonic transducers in any positions along the z-direction on the pipe. To obtain two different flow velocities, v 1 and v 2 , from two different transducer pairs, the average fluid flow velocity on the acoustic path between each ultrasonic transducer pair is measured for turbulent flow and ideal flow conditions. v bp1 and v bp2 are obtained by the method mentioned above for reference. If there is problem such as the placement of transducers in the design, the ratio between Q bpr and Q a is different from 1. That the ideal value of Q bp is 1 indicates excellent compatibility between the transducer pairs. Thus, this metric can be used to assess the quality of the ultrasonic flowmeter for turbulent flow.

IV. RESULTS AND DISCUSSION
In this paper, FMIFC is obtained in MATLAB environment to analyze fluid flow for different Re values. Fig. 10 shows FMIFC for Re=10000, 100000 and 1000000. As mentioned above, subfigures in Fig. 10 have 1000*1000 pixels (i.e., they have 1000 acoustic paths and each acoustic path has 1000 pixels). The value of the pixel at (M=1, N=1) is 255 for each figure. Comparing the subfigures in Fig. 10, FMIFC has whiter pixels for the larger Re. That means any acoustic path in the z-direction has greater velocity (larger pixel value) for larger Re. By using FMIFC, the normalized fluid velocities are obtained for M=1, 500, 1000 and Re=10000, 100000 and 1000000 (shown in Fig. 11). .925 for Re=100000 and 1000000, respectively. The pixels at M=1 or N=1 are also calculated with Eq. (5) but other pixels are calculated with pixel-based calculation method. To find normalized v (1,600) (whose values are 0.865, 0.884 and 0.903 for Re=10000, 100000 and 1000000, respectively), both Eq. (5) and pixel-based method are used. To find normalized v (500,600) (whose values are 0.818, 0.842 and 0.867 for Re=10000, 100000 and 1000000, respectively), only the pixelbased method is used in this paper. M=1000 or N=1000 indicates the pipe surface and the values of v are zero for these positions. Fig. 11 is also used to calculate Q bpr which is indicated in Eq. (13). For any acoustic path in the z-direction, v bp is obtained by averaging the pixels. Fig. 12 shows the obtained v bp values for different acoustic paths. Re=100000 (c) Re=1000000 In Fig. 12, M=1 indicates the acoustic path in the middle of the pipe. In this position, v bp is 0.863, 0.881 and 0.899 for Re=10000, 100000 and 1000000, respectively. These values are also shown in Fig. 4 and can also be obtained with Eq. (7). But for other acoustic paths, the values of v bp are obtained with the pixel-based calculation method. These values are used to evaluate the quality of the ultrasonic flow meter systems. If the ultrasonic transducers are placed in positions M=309 and M=809, we obtain that v bp1 is 0.839 for the position M=309 and v bp2 is 0.7 for the position M=809 as shown in Fig. 12a for Re=10000. According to Eq. (13), Q bpr is 1.199. To evaluate the design, Q bpr is used for reference value. The researcher calculates Q bp by using the results of the application (v 1 and v 2 shown in Eq. (14)). The value of Q bp shows the compatibility between the ultrasonic transducers. The ideal value of Q bp is 1. For example, the researcher designs the ultrasonic flowmeter and calculates Q bp with the method given in this paper, and then changes the design and recalculates Q bp . If the value of the recalculated Q bp is closer to 1 after the operation, this means the change has improved the design. Otherwise, the change has damaged the performance of the design. Thus, Q bp can be used to analyze the design for any Re and acoustic path.

V. CONCLUSION
TTD method measures the average velocity of the fluid along the acoustic path between the two ultrasonic transducers. Currently, there are many studies on TTD ultrasonic flowmeters. For researchers, it is very important to analyze their designs. This paper presents FMIFC to analyze the fluid flow depending on Re for the ideal flow conditions and the turbulent flow. FMIFC is obtained with the pixels describing the acoustic paths. FMIFC in this paper has 1000*1000 pixels which represent the number of acoustic paths and the number of pixels in each acoustic path. Any pixel in FMIFC has a greater grey level value for greater velocity. Furthermore, a quality metric is developed by using the obtained FMIFC. This metric indicates the reference ratio of the average fluid velocity of different acoustic paths. The results show that the proposed metric is easy to use for any acoustic path or Re.