1 Introduction

Roughness elements in channel flows are widely employed in a variety of industrial applications such as electronics cooling, turbomachinery and chemical reactors, as they promote turbulence by inducing boundary layer separation. Following that, the heat transfer is locally increased where the boundary layer reattaches to the channel walls. However, such elements also contribute to a rise in the pressure losses, which directly increases operational costs.

The study of Ligrani et al. (2003) mentioned that dimpled surfaces augment the heat transfer with lower pressure losses compared to other elements as they do not block the flow field. For a dimple shape that maximizes heat transfer while keeping pressure drop to a minimum, Dedeyne et al. (2020) performed an optimization study with multiple design parameters. The study showed that heart-shaped dimples, due to more stable vortex structures, have a better performance compared to spherical dimples. When employed in a circular tube, the authors showed that the optimized dimple shapes reduce the pressure drop penalty by 20% compared to spherical dimples.

Zhou et al. (2016) used particle image velocimetry (PIV) to investigate flow structures on a dimpled test plate located in a rectangular channel. They found that much stronger Reynolds stresses and improved turbulence kinetic energy levels exist with relatively higher friction factors on dimpled surface compared to the flat surface. Virgilio et al. (2020) were able to find through PIV measurements that a significant flow separation/reattachment is formed around spherical dimples that are placed along one half of a circular channel where they studied turbulent flow structures. But the literature still lacks detailed experimental investigation of the flow structure in fully dimpled tubes because the dimples, due to their geometry, highly distort the optical access required for PIV.

When measuring with PIV, image distortions induced by several factors such as camera lenses, viewing angles, liquid/air interfaces, refractive surfaces are inevitable. Such distortions can lead to inaccurate particle displacement measurements due to varying magnification (Soloff et al. 1997). For reliable PIV results, it is essential to eliminate their impact on the velocity vectors calculation. Several correction methods were proposed to back-project either pixel elements or the displacement vectors from the image plane into the object plane so that actual particle displacements can be evaluated. Prasad and Adrien (1993) suggested a technique that uses ray tracing to eliminate the aberrations due to liquid–air interfaces. But this approach is unfeasible in cases when the imaging optics are imperfect, or the cameras are misaligned. Alternative techniques suggested employing a generalized mapping function for the back-projection. Wieneke (2005) used a mapping function based on a pinhole camera model while in another study, Soloff et al. (1997) proposed second-order and third-order polynomials to correct the optical distortions on the images. The mapping functions with higher-order terms can also overcome barrel and pincushion-type distortions due to imperfect imaging optics, curved surfaces, etc. (Willert 1997).

In the presence of stronger image distortions yielded by optically complex geometries, refractive index matching (RIM) is one of the solutions employed in PIV measurements (Amini and Hassan 2012). This method provides direct access to the measurement plane by matching the refractive index of the working fluid and the test geometry, avoiding (or minimizing) the light refractions on the complex interfaces. For RIM, the studies available in the literature used various types of liquid solutions such as glycerin/water, zinc iodide solution, zinc iodide solution, tetralin and diethylphthalate/ethanol (Scholz et al. 2012; Song et al. 2015). But these liquids bring physical and chemical drawbacks/challenges (e.g., toxicity, flammability, discoloration, high viscosity/limited Re, high costs) depending on the selected working fluid. Additionally, the method is unsuitable for gas flows with which the refractive index matching is unachievable. Although RIM has been successfully applied in the literature, it is not always feasible due to the criteria such as flow similarity, cost, applicability and safety.

Another way to overcome these strong distortions is to use solutions based on ray tracing, which has recently been adopted in many measurement applications. In PIV applications, ray tracing physics enables advanced image mapping operation to accurately determine particle displacements in the measurement plane. Kang et al. (2004) used two different ray tracing-based correction methods, i.e., an image mapping and a velocity mapping method, to eliminate the effects of the light refractions for the case of liquid droplet surfaces. Zha et al. (2016) applied a correction method, which is a combination of the ray tracing and the polynomial methods, to correct optical distortions caused by the refractions at a diesel engine piston surfaces. These methods focused on correcting moderate optical distortions given by axisymmetric geometries. For this reason, Martins et al. (2018) proposed an innovative image correction method based on generating an artificial version of the calibration image through an open-source ray tracing-based rendering software, PBRT (Pharr et al. 2016). For the correction, the method uses the correspondence between the pixels of the image and the spatial coordinates of the points inside the object plane. The authors managed to perform PIV of a gas flow, by correcting the high optical distortions given by a sequence of glass spheres placed in front of the camera. But this method requires generating the artificial image by precisely detecting exact positions of the refractive objects, which is a tedious and time-consuming process for complex geometries.

The objective of this study is to develop ray tracing-based method for faster and more accurate image correction when investigating the flows in complex roughened tubes. To achieve this, an optimization algorithm was coupled with another evaluation calculating the standard deviation between the artificial image and the actual image to generate the image with minimum deviation. The optimized design (the artificial image) was used to obtain an image mapping matrix, as required for the correction method. High-level image distortions caused by roughness elements employed in a circular tube were removed in planar PIV configuration. Spatially resolved PIV data were collected and the velocity field of the turbulent flow inside a circular channel with heart-shaped dimples was obtained by postprocessing the corrected PIV images. The time-averaged velocity components and the fields of turbulent kinetic energy are presented for a streamwise plane at the center of the cavity at Re = 20,000. The experimental setup and the PIV configuration are presented in Sect. 2. Section 3 describes the image correction method and proposes a new processing step using an optimization loop. In Sect. 4, the effect of the optimization algorithm on the correction is examined. Also, a comparison with conventional techniques is presented. In the second part of the section, the flow field results are demonstrated. The last section contains the conclusions.

2 Experimental apparatus

2.1 Test facility

The PIV measurements were performed in the low-speed facility designed to investigate the flow field in circular channels in the “Heat and Mass Transfer Laboratory” of the von Karman Institute for Fluid Dynamics. This facility consists in a closed water circuit with five main sections: settling chamber, development duct, test section, overflow channel and discharge chamber, as shown in Fig. 1 (Mayo et al. 2018).

Fig. 1
figure 1

Experimental unit for particle image velocimetry measurements of corroborated test section

The primary aim of the circuit is to obtain a water flow with a desired Reynolds number and a constant total pressure at the inlet of the channel with a diameter of 150 mm. Therefore, the height of the water column in the settling chamber is kept at a constant level by using an adjustable overflow channel (Fig. 1). In this way, the inlet total pressure, as well as the mass flow and Reynolds number, can be set to desired values by preventing the unsteadiness resulting from the water pump. Before the fluid enters the discharge reservoir, an orifice flowmeter is placed in the outlet duct. The volumetric flow rate measured by the orifice flowmeter allows calculating the bulk velocity. Subsequently, the fluid is collected in the liquid tank from where it is pumped to the piping system again to close the water circuit.

The PIV images are taken in the test section, which is located downstream of the inlet pipe (2250 mm), where the flow is fully developed. A rectangular plexiglass box is placed around the test section to provide a straight surface between ambient air and the wall. The box is filled with water to assure better focus and refractive index matching, minimizing optical distortions caused by the curved surface of the channel. The circular test channel with an inner diameter of 150 mm is placed in the test section such that the water circuit is closed without disturbing the flow field.

The test channel is made up of a transparent bare half and a transparent dimpled half with ten evenly spaced rows of heart-shaped dimples (Fig. 2). Each row contains five heart-shaped indentations with a maximum depth of 6.3 mm and a width of 40 mm placed around the half circumference with an angular offset of 36-degrees. Rows are placed in an inline configuration with 2 mm in between each line. The distance between two rows -from the start of one to the start of the successor—is 80 mm.

Fig. 2
figure 2

Image of the PIV section of the experimental apparatus

2.2 Measurement configuration

In a planar PIV setup, the measurement plane was positioned in the symmetry plane of the central dimple on the circumference (Fig. 3). To ensure the flow development, the plane was set as far away from the inlet section as possible (at the 9th dimple row). A double shutter CCD camera was aligned with the 9th row such that the axis of the camera is perpendicular to the wall of the box and parallel to the horizontal. The measurement plane was investigated through a heart-shaped dimple in the same row, causing high-level optical distortions in PIV images. The lens selection was made to minimize the lens distortion. In the present study, the CCD camera was equipped with Nikon AF-S 50 mm f/1.8 NIKKOR lens, which produced around 0.2%-barrel type lens distortion. Although it is nearly negligible compared to dimple-induced distortions, all additional distortion sources caused by the lens and other unknown parameters will be included in the error assessments.

Fig. 3
figure 3

Planar PIV configuration

A 100 × 100 mm calibration plate consisting of 2500 black dots with a diameter of 1 mm was used to calibrate the field of view on the PIV images. The dotted calibration plate allowed the determination of dot center coordinates, which is a quantitative objective during the artificial image generation in the ray tracing-based image correction approach described in the next section. The calibration plate was positioned in a manner that it was slightly touching the wall of the central dimple (Fig. 3) given that the symmetry plane was investigated. Prior to performing the calibration, high-level irregular distortions on the calibration image caused by the dimple in front of the measurement plane were corrected using the present method.

A Quantel Evergreen Nd:Yag laser with a 532 nm wavelength and an applied power of 60 mJ was used to illuminate the measurement plane. The laser sheet on the plane was formed by optical lenses (cylindrical and spherical) installed after the laser head. A mirror (Gimbal mount Edmund optics) was aligned with the lenses to turn the laser sheet 90 by degrees toward the smooth half placed on the top of the dimpled half to obtain 1.5 mm of laser thickness on the measurement plane.

The flow was seeded with fluorescent polyethylene spheres with a diameter of 10–45 μm (Cospheric), which scatter the laser wavelength (532 nm) and re-emit the light with a longer wavelength (605 nm). A notch filter (Techspec OD 6.0) was used to block the light with the laser wavelength and let only the light emitted by the fluorescent particles be recorded by the camera. Therefore, undesirable lights reflected from the other objects such as the wall and air bubbles were banned to acquire clean PIV images without background noises.

A series of 1000 PIV image pairs were recorded at a frequency of 1 Hz during the measurement. The acquisition frequency was selected such that the time between the pairs was long enough with respect to the flow characteristic time. The separation time between two consecutive PIV images was set during the experiment to ensure particle displacements around 8 pixels near the center of the pipeline. The background image was generated by averaging all the intensities of each pixel. The correction was applied to the images after the background subtraction was made. Finally, the corrected images were processed by the Davis 8.4.0 software. The cross-correlation algorithm has been run in three refinement steps with the final interrogation windows of 32 × 32 pix2 and overlaps of 50%. Corresponding to the interrogation window, the field of view, the distance between the camera and the measurement plane, the final resolution was obtained as 1 mm2. The properties of the devices and the tools are summarized in Table 1.

Table 1 Overview of operating conditions and simulation settings

3 Mapping methodology

Function-based correction methods are incapable of correcting high-level anomalous distortions caused by roughness elements. The ray tracing-based image correction method (Martins et al. 2018), on the other hand, provides a powerful tool which uses a mapping matrix to map each pixel individually. But this method primarily depends on the artificial generation of the calibration image via ray tracing physics, requiring an exact knowledge of the experimental setup. In the presence of optically complex geometries such as heart-shaped dimples, the process becomes tedious and extremely time-consuming. A number of iterations are required due to uncertainties in the knowledge of the recording configuration. Therefore, this study proposes automation by merging the method with optimization assistance to eliminate the workload and the time spent. The present image correction procedure, optimization algorithm and implementation are discussed below.

3.1 Image correction procedure

For the reconstruction of the target image, the correction method uses a correction matrix that contains the correspondence between the pixel coordinates (i, j) in the image plane and the position coordinates (x, y) in the investigation plane (calibration plate) rather than using a single mapping function. The generation of the correction matrix consists of three steps:

  1. (i)

    Preparing a 3D model of the experimental setup in the computer domain

  2. (ii)

    Generating the artificial calibration image by rendering the constructed 3D setup using a ray tracing-based rendering software (pbrt-v3)

  3. (iii)

    Recording the pixel coordinates and corresponding position coordinates as the correction matrix during the rendering

As a result, the mapping matrix extracted over the artificial image is employed for the image correction. But, in case of difference between the actual and the artificial image, using this matrix for correcting the actual image causes a point in the image plane to be projected to a wrong coordinate in the object plane. Figure 4 depicts a series of rays sent to a cross section of the dimpled tube at small intervals of 5 mm. The deviations in the locations where the rays reach the measurement plane emphasize the precision of the dimpled tube’s vertical position in the computer domain. For the cross section taken at middle plane of the dimple, a 5 mm inaccuracy in the vertical position leads to an 8 mm deviation in the image plane due to irregular ray refractions caused by the dimple surface.

Fig. 4
figure 4

A bundle of rays and their projections on the measurement plane in the existence of a complex surface

The inconsistent projection expectedly would cause the corrected calibration image to deviate from the reference, which is the grid representing the perfect correction, leading to an error in the particle displacement calculation during PIV postprocessing. Therefore, it is necessary for a perfect correction that the light refractions are exactly simulated in the rendering software, meaning that the virtual image has to be generated to be the exact copy as the actual one, which is not possible in practice.

There is always a difference between the artificial image and the actual image due to the inability to precisely measure the positions of objects and know exact values of material properties as well as the fact that there is a tolerance in manufacturing.

The presence of complex geometries, one of which is the heart-shaped dimple in this study, would make it even more difficult to match images because distortions are very sensitive to any input parameters such as the positions of the objects, material properties, camera position and its properties. Therefore, in this study, an optimization through a genetic algorithm was used to find the best input parameters that produces the closest artificial image to the actual one.

The best input parameters, optimized design, are then used to generate mapping matrix for “optimum” correction. The calibration is made through the corrected calibration image.

3.2 Implementation

The correction phases of the distorted calibration image, that is the image of dotted calibration plate, the calibration image with distortions due to dimples, the artificially generated calibration image and the corrected calibration images, are presented in Fig. 5.

Fig. 5
figure 5

The correction phases of the distorted image due to heart-shaped dimples. a The calibration plate; b the calibration image; c generated calibration image; d corrected artificial image; and e corrected calibration image

For preparing the PIV setup (Fig. 3) in the computer domain, 3D CAD models of the objects in the test section were defined as triangle meshes through which the calibration image can be generated by the ray tracing-based rendering software, PBRT. The conversion of the model and the assignment of the triangular meshes are made by the plugin of the software.

To minimize the uncertainties resulting from manufacturing, the section of the heart-shaped dimple was obtained by 3D scanning (Tetravision) with a minimum accuracy of ± 0.02 mm, which then will provide an average improvement of 0.1 pixels in the generated image.

The spatial positions (x, y, z) and rotations (theta) of all objects in the actual setup were measured, i.e., camera, rectangular box, dimpled pipe and calibration plate. Besides the refractive indices (n) of the objects and water, the resolution (w × h) and focal length of the camera (f) were determined.

The revised parameters were inserted into PBRT to start the rendering process. During the process, the mapping matrix was recorded while the artificial calibration image was being generated. The artificial image, whose similarity will quantitatively be evaluated in the next section, was matched with the actual calibration image taken by CCD camera in one-camera layout configuration (Fig. 5b, c). In Fig. 5b, the dimple in the center of the image also distorted the depth of focus preventing a proper focus near the edges. Therefore, this distorted, unfocussed region was masked out and excluded from the similarity evaluation. Despite the masked edges, a large part of the inner area could be recovered thanks to the optical access (Fig. 5d, e).

In the rendering software, a ray coming out from a pixel element of the image plane intersects a point of the calibration plate after several refractions and/or reflections throughout its path in the 3D setup as in the schematic view of the experimental facility (Fig. 6). However, we considered the rays with only refractions along their path to be the rays contributing to the artificial image generation as the study’s objective is to correct image distortions. In our configuration, the rays having 5 refractions until they reach the plate were taken into account for mapping.

Fig. 6
figure 6

Schematic view of the PIV setup

The average of all the intensities was considered as the intensity value of the corresponding pixel element in the reconstructed image since a position was intersected with more than one ray and therefore it has more than one intensity value (Martins et al. 2018). This calculation was made based on the correction matrix for all the pixels in both calibration images to reconstruct the target images which are presented in Fig. 5b, c. The blanked areas in both reconstructed images (Fig. 5d, e) represent the regions where the mapping was impossible because none of the rays coming out from these locations was able to reach the camera sensor. This implies that these regions are not even visible (or properly focused) in the raw images.

As for the calibration images, the same image correction was implemented for PIV image frames as they are affected by the same image deformations. The cross-correlation of the corrected frames was performed by Davis 8.4.0 after having the calibration via the corrected calibration image.

3.3 Optimization algorithm

Genetic algorithms are commonly used for the optimization of designs in global search algorithms with a wide parameter range. In the algorithm, there is a fixed number of individuals of which all parameters are represented by a binary string. The binary string representation allows a new population to be created by the crossing over operation. Two new individuals (children) are generated from selected two individuals (parents) whose binary strings are exchanged randomly (Verstraete 2018).

The individuals with higher fitness, higher objective values, have a higher probability to be selected as parents. Mutation is another operation that plays a role in generating new individuals. After crossing over, the mutation leads to a change in the binary sequence of an individual randomly (Deb and Kalyanmoy 2001). This process is mainly to avoid converging to a local minimum rather than a global minimum. However, the higher probability of mutation may lead to divergence.

The software generating the artificial image (PBRT) requires an input file with input parameters that describe the experimental setup in which the ray tracing process is performed. All the parameters that are likely to have an influence on the image distortions were taken as design parameters such as the positions and material properties of the objects. Thus, the optimization environment has been described by 15 design variables:

  • The spatial position of the camera, x; y; z (mm)

  • The rotation of the camera, θ; β (°)

  • The focal length of the camera lens, f (mm)

  • The spatial position of the calibration grid, x2; y2; z2 (mm)

  • The spatial position of the pipe, x3; y3; z3 (mm)

  • The rotation of the pipe, α (°)

  • The refractive index of the pipe, n

  • The refractive index of the test box, n2

Each design variable was assigned as initial value of the measured one, and as range of the measurement uncertainty. In the present PIV configuration, the most sensitive design variable is the camera position as its relative position to the test pipe alters the angle of the rays at the interfaces on the complex surfaces.

Finally, an objective function must be determined to perform the optimization for the artificial image generation. The objective here is to optimize the similarity between actual and artificial images, which is an indicator of the accuracy of the correction. The objective function was defined as the standard deviation between the centers of the dots on the calibration image and on the artificial image. By detecting the pixel coordinates (x, y) of the dots’ centers in both images, the deviation was specified as the distance between the corresponding dots (Fig. 7). The standard deviation was calculated as a quantitative comparison of the images and expressed as

$$d=\frac{\sqrt{\sum_{i=1}^{n}\Delta {c}_{i}}}{N}$$

where N is the total number of dots.

Fig. 7
figure 7

Deviation between centers in the pixel domain

In the present optimization whose features are defined above, the design variables in the population are proposed by an algorithm developed in MATLAB. The individuals are prepared as an input file to be inserted into PBRT-v3. To decrease the time spent on a single rendering process, the minimum allowed amount of ray sampler (1) is defined for each pixel, yielding around 4,200,000 rays to be traced. The artificial images for each individual are rendered in around 20 s on a computer with an Intel 6700HQ running at 2.6 GHz, running Windows 10. After the rendering process over the input file is completed the value of standard deviation between the output image and the actual image is calculated. According to the deviation, a new generation of the design variables is proposed while the loop closes as presented in Fig. 8. The run is stopped when no further improvement is obtained in the population for a certain number of iterations.

Fig. 8
figure 8

Optimization algorithm for lowest standard deviation

4 Results and discussion

4.1 Test in the smooth section

A known flow field in a smooth pipe with a similar diameter as the heart-shaped pipe was firstly measured to validate the functionality of the ray tracing-based correction method before applying it to the complex turbulent flow caused by the heart-shaped dimples. Performing such experiments allow the experimental boundary conditions to be accurately characterized, when numerical or experimental comparisons are required. Therefore, PIV measurements were performed at the flow regime around Re = 24,000 using the planar PIV configuration mentioned in Sect. 2.2.

The recorded calibration image and artificially generated image are presented in Fig. 9, together with a map of the deviations between corresponding dot centers in these two images. The root means square of the center deviations in Fig. 9c is 0.03 pixels with a maximum deviation of 1.9 pixels. Following the generation of artificial image, the calibration image was corrected using the ray tracing calculations-based correction matrix, providing a standard deviation from the reference grid of 0.14. The distortion correction using third-order polynomials resulted in a standard deviation of 0.62 for the same calibration image, where it was unable to match the reference grid with the dots' centers close to the wall whereas the ray tracing-based method provided a proper match along the entire image (Appendix B).

Fig. 9
figure 9

The calibration image (a), generated calibration image (b) and the map of the deviations between the dot centers of the images (c)

Figure 10 demonstrates mean streamwise velocity profiles, nondimensionalized by the velocity along the centerline of the pipe, \({U}_{\mathrm{max}}\). Both profiles measured by PIV using the existing ray tracing-based correction and third-order polynomials are in excellent agreement with the results of the LDV measurements carried by Toonder and Nieuwstadt (1997) at Re = 24,600 in pipe flow. The data were nondimensionalized using kinematic viscosity \(\nu\) and the friction velocity \({u}_{\tau }=\sqrt{{\tau }_{\mathrm{w}}/\rho }\) where \({\tau }_{\mathrm{w}}\) is the statistically averaged wall shear stress and \(\rho\) is the density of the fluid. This scaling ensures the independency of flow geometry for the inner layer, allowing the comparison with DNS.

Fig. 10
figure 10

Mean axial velocity profile nondimensionalized with the velocity at the centerline (a) and scaled by inner variables (b)

Scaled mean axial velocity \({u}^{+}=u/{u}_{\tau }\) is shown in Fig. 10b as a function of dimensionless distance to the wall \({y}^{+}=y{u}_{\tau }/\nu\). In the present study, friction velocities were calculated using the wall shear stress values obtained from PIV data for both cases. The curves in Fig. 10b show that both PIV data are again in agreement with both DNS (Wu et al. 2012) and LDV (Toonder and Nieuwstadt 1997) results. To illustrate the deviations of the cases from the DNS, the velocity discrepancies are plotted from wall to the center of the pipe as in Fig. 10c. Although the polynomial case has a larger deviation along the radius than the ray tracing case, the trends of the two cases are quite similar except near the wall of the pipe. This is mainly due to the different values of the friction velocities as the wall shear stress varies depending on the image correction method. The error bars at several positions show that both PIV results and DNS are in the 95% reliability intervals.

4.2 Image rendering quality assessment

In order to obtain the correction matrix, the actual PIV calibration image (Fig. 5b) with high-level distortions was artificially generated in different ways: manually optimizing, using measured values and using the optimization algorithm (see Appendix A for the design variables with ranges). Following this, the actual image was corrected in each case using the correction matrix that was obtained through the corresponding artificial image. The overall comparison of the image generation procedures is summarized in Table 2. As expected, the deviations from the actual image caused the corrected image to furtherly deviate from the reference which indicates the ideal calibration plate.

Table 2 Comparison of the artificial images obtained by different procedures

The image acquired with the measured parameters resulted in too large deviations to apply a reasonable image correction. Therefore, the measured parameters were manually refined to generate an image closer to the actual one. Although manual refinement of the measured parameters was feasible, acquiring acceptable images was a quite challenging and time-consuming process. The automated optimization algorithm, on the other hand, provided an artificial image with a standard deviation of 0.13 pixels after 4–5 h period of run time. It is worth noting that the time spent as well as the workload was significantly reduced in comparison with the manual case despite depending on the user’s processing speed.

The maps of the deviations between the dots on the calibration image and those on the corresponding artificial image are presented in Fig. 11 according to the image generation procedures. Figure 11a shows the deviations from the artificial image generated through the 3D model constructed with the parameter values measured in the experimental facility. The maximum deviations around the heart shape are more than 20 pixels and almost entire image are deviated by at least 10 pixels.

Fig. 11
figure 11

Maps of pixel–pixel deviations between the actual and artificial images in three cases: a measured, b manual optimization and c optimization according to algorithm

After many trials, manually refined parameters yielded an artificial image providing a better match as shown in Fig. 11b. Although the deviations were drastically decreased over the entire image, further manual improvement lowering deviations was extremely challenging and time-consuming as the distortions resulted from heart-shaped dimples are sensitive to each parameter.

Finally, the optimization with the genetic algorithm loop was run to generate the artificial image. It can simply be noticed from the final map that the deviation values were impressively reduced despite taking much less time and effort (Fig. 11c). Higher level deviations take place in the center of the image, where the heart-shaped dimple exists. The maximum value, 10.1, is located near the edges of the heart-shaped dimples. The edges, where the curved surfaces of dimples intersect with the inner smooth wall of the tube, also distorted the depth of focus (as seen in the calibration image, Fig. 5b) resulting in additional disturbances around the intersection line. Minimum levels of deviation are found on both sides (without dimple) because the distortions on the smooth walls are less sensitive to changing parameters and thus result in fewer deviations compared to the dimpled wall.

Since the measured parameters were inadequate, this case was not evaluated for the reconstruction steps. The calibration image was corrected using correction matrices obtained through manual and optimization cases. The corrected images for both cases were compared with the reference grid in Figs. 12 and 13, respectively.

Fig. 12
figure 12

The deviations between the reference grid and the corrected image (manual case): a qualitative comparison and b quantitative comparison

Fig. 13
figure 13

The deviations between the reference grid and the corrected image (optimized case): a qualitative comparison and b quantitative comparison

Figures 12a and 13a show the corrected images with the reference (red) grids placed on top that the deviations are observed even qualitatively. Besides the qualitative comparison, the deviation distances for all dots were calculated in the maps and they are quantitatively presented in Figs. 12b and 13b.

The correction matrix over the manual case was not able to provide a good quality correction around the heart-shaped dimple and on the right-hand side (Fig. 12). Some deviations in these areas are even larger than the deviation values in the image matching process (Fig. 11b), meaning that the deviations between the actual image and the artificial image are directly related to the correction quality. The final standard deviation over the entire image was calculated as around 5.6 pixels.

According to Fig. 13, the optimized case provided a good match on the entire image unlike the previous case. Despite the optimization algorithm, small distortions remained due to the minor factors that are not simulated, such as the lens distortions, inevitable differences between the 3D CAD model and real geometry, or any unknown design variables affecting the objective function. The highest deflections occurred in the middle of the figure, where the image is most distorted, and the dots are closest to each other in the raw image. Like the deviations prior to the correction, the maximum deviation, 9.2 pixels, is found around the dimple edges and furtherly masked out before the vector calculation. The standard deviation was dramatically improved and calculated as around 1.3 pixels, a value within the acceptable range for proper velocity vector calculations.

During the calibration process in Davis 8.4, a third-order polynomial was applied to deal with the residual distortions, resulting in a final RMS of 0.32 pixels. Other image correction methods in the software, were also performed to correct the actual calibration image for comparison. But both pinhole model and third-order polynomials were unable provide a meaningful image correction, with RMS fit of 13.7 and 9.6, respectively (Table 3). Additionally, our approach yielded the standard deviation of 0.88 pixels when only the heart shape region is included whereas the other approaches again failed to provide acceptable corrections. The calibration was made on the images corrected by the optimization-assisted method. The results were obtained via postprocessing of the corrected PIV image pairs in Davis 8.4.

Table 3 Standard deviations based on the correction method

4.3 Turbulent flow structures in the half-dimpled tube

The PIV measurements are carried out to investigate the plane of symmetry in the streamwise direction for the dimple at the 9th row. Figure 14a shows the time-averaged axial velocity field contour with the velocity streamlines. The contour plot includes blanked areas because of the limited optical access caused by the optically complex shape of the dimples (as in the corrected images) and they represent the masked areas that are not included in the vector calculations. The flow separation starts at the leading edge of the cavity at x = 25 mm. The reattachment point, where the flow reattaches to the wall and ∂u/∂r = 0, is in the final section of the dimple at around x = 53 mm. The recirculation bubble takes place at x = 45 mm near the trailing edge inside the dimple, deviating from the center of the dimple. The reverse flow region inside the dimple, where the flow is toward the separation point, is illustrated by the negative axial velocity values.

Fig. 14
figure 14

Axial (a) and radial (b) velocity fields in the streamwise center plane

Additionally, the asymmetric shape of the recirculation bubble is clarified by the radial velocity contour in Fig. 14b. The positive components of the radial velocity spread over a large area inside the dimple, while the negative components are accumulated in the last section. The positive radial velocities at the downstream of the dimple show that the flow pushed to the trailing edge exits from the dimple and mixes with the core flow. Streamlines are almost parallel to each other and the axis of the channel in the region r = R < 0.9, indicating that they are not affected by the cavity.

Figure 15 illustrates the turbulent kinetic energy field generated in the symmetry plane of the dimple, where Ub is the bulk velocity and the quantity of the turbulent kinetic energy (TKE) is expressed as:

$$\mathrm{TKE}=\frac{3}{4}{\left(u-\overline{u }\right)}^{2}+{\left(v-\overline{v }\right)}^{2}$$

Since the planar PIV contains two components of the velocity in this case, u and v, the third component is assumed to have similar turbulent contribution as the others.

Fig. 15
figure 15

Turbulent kinetic energy field in the streamwise center plane

It is observed in the TKE field contour that relatively large values over the smooth part are in the near wall region where the velocity gradients are bigger. On the other hand, the highest values of turbulent kinetic energy (around 4% of bulk kinetic energy) are measured around the trailing edge of the dimple, where the highest heat transfer improvements are expected, while the lowest heat transfer levels are expected near the leading edge inside the cavity due to the minimum TKE values.

4.4 The uncertainty analysis on ray tracing-based mapping

The functionality of the present method was previously validated by the experiment in the smooth pipe. Section 4.2 examined the level of the similarity (or difference) between the actual and generated images, which directly affects the quality of the correction. However, the error quantification of the mapping method in this complex geometry should be furtherly investigated, since the method may induce additional sources of error apart from the mapping accuracy, such as particle elongation and depth of focus distortion. The synthetic particle image approach was employed to quantify the overall contribution of the error sources involved in this mapping method to the uncertainty in the particle displacement. This approach allows to separate the uncontrollable uncertainties found in real experiments [particle properties, illumination/pulse to pulse stability, the uniformity and alignment of the laser sheet, etc. (Raffel et al. 2018)] from the errors associated with the image correction technique.

50 synthetic image pairs with randomly distributed particles were generated as mentioned in the study of Zha et al. (2016). Uniform 8 pixels particle displacements in the streamwise direction, the dominant direction in the experiments, was applied for the second frame of the PIV images. Figure 16a shows a synthetic PIV image obtained by inserting a generated particle image into the object plane. The distortions occurred in the synthetic images, the same as in the calibration image, were corrected through the ray tracing-based correction matrix produced previously. The particle image size in the corrected images was around 3 pixels, with a concentration of 0.015 particles per pixel. Cross-correlation calculations were made using the PIV settings mentioned in Sect. 2 (Interrogation window size, overlap ratio, mask settings for the unrecovered regions).

Fig. 16
figure 16

a A synthetic PIV image; b corrected images obtained with and without the algorithm; and c instantaneous velocity fields calculated by using corresponding corrected image pairs (with and without algorithm)

Firstly, the image pairs were corrected via the design variables obtained by the optimization algorithm and the manual interactions were compared together with the corresponding instantaneous velocity fields. Figure 16 shows the comparison through the particle images and relative error in the velocity \(e = \left| {\frac{{d_{{\text{c}}} - d_{{\text{s}}} }}{{d_{{\text{s}}} }}} \right| \times 100\) where \(d_{{\text{c}}}\) is the calculated velocity and \(d_{{\text{s}}}\) is the velocity corresponding to the uniform particle displacement in the synthetic images.

In both PIV images, particles were elongated in the regions of heart-shaped dimple where the distortion is maximum. The correction made with the optimization algorithm induced much less relative errors as clearly revealed in Fig. 16c. In the application with ray tracing correction without optimization, the errors reach up to 22%, while the maximum value of the present case is 5%. The mean error values within the heart shape are 5.59% and 0.82%, respectively. The errors outside the heart shapes are similar and closer to zero in both cases due to the absence of complex interface causing high level of light refractions. The mean error values in the whole investigation fields are 1.88% and 0.61%, respectively.

Because ideal particle images with uniform displacements result in no significant velocity fluctuations, the errors in the particle displacements can be predicted by the standard deviations of the velocity fields (Martins et al. 2018). The standard deviation values were calculated in Davis software by postprocessing corrected synthetic images. After 50 image pairs, around zero pixel deviations were achieved on the undistorted region (Fig. 17). Like instantaneous field, additional noises were introduced to the regions affected by the dimples, resulting in an increase in the uncertainty. The maximum standard deviation located within the heart shape is 0.1 pixels, which corresponds to less than 1% of the mean velocity. The velocity vectors plotted on the standard deviation contour are also consistent with the mean velocity over the entire field.

Fig. 17
figure 17

Standard deviation field computed using the corrected image pairs together with the velocity vectors

5 Conclusions

Measuring velocity fields by using PIV in complex tubular geometries is challenging because of image distortions. To be able to carry out PIV through a complex geometry, a ray tracing-based image correction method was successfully implemented with the assistance of an optimization algorithm to reconstruct highly distorted calibration and PIV images. The optimization algorithm was developed to minimize the errors in the correction and the number of the manual interactions for such complex structures. The algorithm achieved an improvement of 9.1 pixels in standard deviation (a decrease of 98.5%) during the artificial image generation.

The efficiency of the approach was illustrated by investigating the flow field in a channel, whose one half of which has heart-shaped dimples and the other half is smooth. More specifically the flow structures around a dimple in the 9th row were measured using planar PIV at around Re = 20,000. Our approach gave a standard deviation of 0.32 pixels from the reference grid during calibration process while the conventional methods failed to provide a value within acceptable ranges.

The time-averaged averaged flow field and turbulent statistics in streamwise center plane could thus be obtained. The experimental data showed that the flow is separated as it approaches the leading edge of this heart-shaped dimple. The flow reattaches to the wall at the end of the shape, where a local increase in heat transfer can be obtained, while a recirculation zone was observed inside the dimple. Above the dimple, the streamlines remain parallel to each other. The maximum turbulent kinetic energy level was positioned close to the trailing edge of the dimple (4% higher than the bulk kinetic energy) where the heat transfer is expected to be locally improved.