WorksPhysics and Astronomy
Optimizing recording speed and interrogation window for rotating flow recorded in the ambient light: PIV analysis
Abstract
The present study reports PIV analysis of the surface flow profile using a smartphone camera in ambient light instead of high-tech equipment like a professional camera and high-power laser/ LEDs. Additionally, it provides a stepwise method for optimizing recording speed and interrogation window size for the vortex flow generated at different rotational frequencies of the magnetic stirrer. The optimization method has been explained with an example of the vortex flow generated by a magnetic stirrer. The analysis has been carried out using the Matlab-based application PIVlab. Finally, the optimized parameters have been compared with the Burger vortex model, which shows good agreement with the PIV data. The proposed method can also determine the sureface flow of opaque liquids.
Introduction
Flow measurement and visualization are inseparable parts of fluid mechanics. Visualization of simple laminar flow to complex turbulent flow is possible due to analytical and computational fluid flow simulations. However, experimental measurements and visualization are equally crucial for the application and educational point of view. Particle Image Velocimetry (PIV) is well- established and vastly used technique for the experimental velocity estimation of fluid flow [11]. A typical PIV setup consists of a high-power multi-pulsed leaser sheet (to illuminate tracer seeded flow), a high-speed camera (to record the motion of the illuminated flow), a synchronizer (to synchronize laser pulse with a camera), and additional optical components & its arrangements (to convert laser beam into a sheet). In this method, initially, the flow geometry can be traced by the tracer particles illuminated by a laser sheet, and subsequently, flow geometry can be captured by the high-speed camera. Later, the captured images/ video can be processed by the standard PIV software. Finally, the software estimates the velocity based on the displacement of tracers using cross-correlation between two frames [11](2016). PIV, a non-destructive imaging-based technique, has gained interest among the scientific community, researchers, and academicians. Moreover, the technique can be applied to other fields, such as oceanography, marine biology, zoology, and microbiology[11][10].
Despite having advantages, PIV techniques have several limitations say the need for trained human resources, proper maintenance, space, and safety hazards associated with a high-power pulsed laser (class 4, >500mW), and above all, the high cost of all the instruments involved [10]. All these factors force educational institutions to restrict their use for new learners. On the other hand, various commercial PIV systems have been developed for educational purposes (e.g., THERMOFLOW, ePIV, HEMOFLOW, MiniPIV) [10] to enable users the ease of operation with limited variable components. For example, users can only change the inlet and outlet parameters, water level, and seeding density. Additionally, scientists and technologists have been working towards developing a PIV system with the motto of ease of operation, using advanced technology with slick models of equipment with less space utilization, economical, and minimal maintenance.
In PIV analysis, significant technological advancement has provided alternatives for the high-tech equipment, e.g., high-power pulsed lasers can be replaced with high-power LEDs and high-speed professional cameras with smartphone cameras, which in turn makes the overall PIV system safe, simple, easy to operate, and notably economical [3, 13, 8, 6, 5, 1]. Tomographic PIV, 3D PIV, mIPIV, and smartPIV are a few examples of technological developments. Tomographic PIV uses multiple smartphone cameras and different colored LEDs [1], while the 3D PIV technique uses a single camera and structured light illumination [2]. Both these studies show good agreement with the standard stereo-PIV data for the same flow. Simultaneously, mobile-based applications for PIV measurement, such as mIPIV and smartPIV, have been developed from the educational perspective [10, 4]. It provides the live visualization of flow, allows users to capture the flow at various fps, and gives the data as a text file and vector image [4]. In all these papers, either high-power lasers or high-power LEDs have been used. Contrary, the present work focuses on using ambient light for the water vortex generated using a magnetic stirrer.
Additionally, the effect of recording speed with different frames per second (fps), i.e., 30, 120, and 240 fps, has been illustrated here using the smartphone camera. Most publications mainly report either a trial-and-error method for selecting an interrogation window (IW) or the results without specifying the effect of IW. However, IW is an integral part of the process which directly affects the final output; it should be adequately addressed. Hence, here we have given a stepwise process for selecting the interrogation window (IW). The optimization step is critical learning for beginners. Here, we followed ITTC guidelines (2016) to optimize the interrogation window size. Results have been analyzed using the MatLab-based open-source extension PIVlab [12].
Experimental
A water vortex was generated in a cylindrical glass beaker using a magnetic stirring bar. Figure 1(a) shows a schematic of the experimental setup for generating the water vortex. The dimensions of the vessel and the stirrer bar are given in Table 1. The experiments have been carried out for different rotational speeds () i.e., , , , and of the magnetic stirrer bar. Here, the vortex depth was measured experimentally using a ruler.

Figure 1. (a) Schematic representation of experimental setup, (b) Vortex generated using magnetic stirrer. A half width of the vortex has been determined based on the cylindrical wall of dye.
| Dimensions | |
| The diameter of a vessel () | m |
| Height of vessel | m |
| Filled water at a height () | m |
| Length of the stirrer bar () | m |
| Width of the stirrer bar () | m |
Table 1. Dimensions of a vessel and magnetic stirrer bar
Simultaneously, the surface flow has been captured from the top of the vessel using a mobile camera (refer to Table 2) with different recording speeds, i.e., 30, 120, and 240 fps (see Figure 1(a)). The position of the mobile phone was fixed throughout the experiments.
| Model Name | OnePlus Nord-2 |
| Camera Sensor | Sony Exmor IMX766 |
| Pixel Size | |
| Lens Quantity | 6p |
| MP | 50 MP |
| OIS, Optical Zoom, Autofocus | YES |
| Aperture | f/1.88 |
| Video recording | • 4K at 30 fps<br>• 1080p at 30/60 fps<br>• 720p at 30/60 fps |
| Super slow-motion video recording | • 1080p at 120 fps<br>• 720p at 240 fps |
Table 2. Camera features
Next, the half-width of the vortex was measured by injecting the fluorescent dye near the center to see the illuminated cylindrical vortex wall (Figure 1(b)). The radius of the cylindrical wall is equivalent to the critical radius () or a half-width () of the vortex [7]. To measure the an image of the vortex was captured and later analyzed using PIVlab. The scale was initially calibrated during the PIV analysis using the calibration stick by entering the known distance (in meters). Once the calibration is done, PIV uses this scale for further analysis. In the present experiment, the vortex half-width ( or ) determined from PIV was m. The apparent advantage of PIV analysis is its accuracy compared to visual observation.
Data extraction from the PIVlab
The videos were recorded at different fps using the "One Plus Nord 2" mobile phone camera. Camera features are given in Table 2.
Figure 2 shows the flowchart to perform a PIV analysis of the recorded flow followed by its description. In the present work, (i) 50 consequently frames were inserted from the video, and (ii) the three pass interrogation windows with 50% overlapping with (a) pixels and (b) pixels were used.
Figure 2. flowchart for data extraction from PIVlab
Step 1: Input
Inset video frames with the desired number of frames or inset images (minimum two) to detect the displacement of tracer particles.
Step 2: Pre-processing
Pre-processing allows the selection of the region of interest (ROI), masking of unnecessary areas/ objects in the images, and image calibration into the physical unit. The path for the same is as follows.
Go to the menu bar and select,
Image settings > Exclusions (ROI, mask) > select ROI > draw mask > apply current mask to all frames
Calibration > select reference distance in image > enter real distance (mm) & time steps (ms)
Here the time step is .
Step 3: Analyze
The interrogation window (IW) size should be defined before applying the analyze command. The process enables software to generate velocity vectors from the displacement of the tracer particles.
Go to the menu bar and select,
Analysis > PIV settings > enter interrogation window size (unable necessary pass with the desired overlapping according to flow) > Analyze all frames.
Step 4: Post-processing
Once the analysis process is completed, one can remove the random vectors automatically by introducing velocity limits. Alternatively, manually individual vectors can be removed. The steps for the same are as follows.
Go to the menu bar and select,
Post-processing > velocity-based validation > select velocity limits > apply to all frames
The mean flow can be determined based on the total inserted frames as given below.
Plot > Temporal: Derive parameters > calculate mean
Step 5: Data extraction
The software gives the data of and components of velocity vectors, tangential velocity, vorticity, and shear rate. In the present work, our interest is to extract the tangential velocity component only. For this,
Go to the menu bar and select,
Extractions > parameters from polyline > Type > circle series > plot data > save result as a text file
Result and discussion
The study has been conducted in two parts to understand the significance of recording speed and interrogation window, i.e., (i) varying fps viz. 30fps, 120fps, and 240fps while keeping the interrogation window constant, (ii) varying interrogation window (IW) size for a single video recorded at a given fps.
Optimization of recording speed (fps- frames per second)
Error! Reference source not found. a(i, ii, iii) illustrates typical tangential velocity () distribution obtained from the PIV for respectively 30fps, 120fps, and 240fps at a constant rotations frequency of magnetic stirrer () 11.66s. Here IW area selected was 128 x 64 x 32 pixels. It is evident from the figure that the number of vectors observed is less at 30 fps, maximum at 120 fps, and moderate at 240 fps for a constant = 11.66 s. It also noted that the velocity magnitude increases with increasing fps. Detail vortex flow geometry can be determined precisely at 240 fps. The presently used mobile camera has a maximum of 240 fps, while one could record video at higher fps. Figure S1 shows the effect of varying fps, i.e., 30, 60, 120, 240, and 960 fps for = 3.33 s. It is inferred from the figure S1 that, the increases with increasing fps reaching maxima at 240 fps, and then further increase in fps (i.e., 960 fps) results into decrement in the . The fact that increasing fps reduces the resolution, which may hamper the pixel identification, result in generating a false vector in PIV.
Error! Reference source not found. b(i-iii) shows a typical tangential velocity () data obtained as a function of radial distance () from the central axis of the vortex at frequencies () 8.33s, 10.00s, 11.66s, and 13.33s. As shown in Figure b(i), the magnitude of is negligible at 30 fps for different . The velocity distribution (see fig:3a(i)) and the tangential velocity plot (see fig:3b(i)) at 30fps show negligible velocity magnitude. It means the tracers leave the IW in the next frame, resulting in the false correlation peak. Therefore, 30fps recording speed is insufficient for the rotational frequencies 8.33s, 10.00s, 11.66s, and 13.33s. The nature of tangential velocity obtained at 120 and 240 fps is similar; however, a higher magnitude is observed at 240 fps. It is known that the velocity magnitude increases with increasing . When the flow was recorded at 120fps, for () 8.33s, 10.00s, 11.66s, and 13.33s, velocity magnitude increased, but for 13.33s, it decreased. The data recorded at 120 and 240 fps have been normalized by to understand the effect of recording speed (fps).






Figure 3. Figure 3(a&b): a (i – iii) shows typical tangential velocity () distribution for rotations frequency of magnetic stirrer @ 30fps, 120fps, and 240fps respectively (IW: 128 x 64 x 32pixels). b (i - iii): Variation of the tangential velocity () as a function of beaker radius (r) for different at (i) 30fps, (ii) 120fps, (iii) 240fps
Figure 4 (a & b) shows a normalized tangential velocity plot at 120 and 240 fps respectively for IW: 128 x 64 x 32 pixels. Inset of Figure 4 is a graphical illustration of three vortex regions, which are explained below. Both Figure 4 (a & b) are virtually divided into three regions, i.e., (I) from 0 m to 0.01 m, (II) 0.01 m to 0.03 m, and (III) 0.03 m to 0.047 m, which is the radius of the beaker.

Figure 4. Normalized tangential velocity for (a) 120 fps and (b) 240 fps. Inset: Graphical illustration of regions of vortex
It is evident that all data superimpose on each other in the region (I). The region-I is also referred the critical radius () (also known as vortex core or half-width(2))(see Figure 1(a & b) & inset of Figure 4(a)). The is the radius up to which the vortex obeys rigid rotation irrespective of the stirring speed. As mentioned above =0.0094±0.0002 m, the superimposition of the region (I) is attributed to the rigid rotations. In particular, the half-width can be expressed by , where β is the proportionality constant, ν is the kinematic viscosity of the liquid, and g is the gravitational constant [7]. This equation depicts that the half-width depends only on the vessel's radius and the stirrer's dimensions, while it does not depend on the rotation rate and the water level. Thus, half-width(2) would be the same for each rotational speed of the stirrer bar.
Region II experiences the maximum effect of the stirring bar, including down-welling and up-welling. Therefore, it leads to observe deviation due to variation in ω. At 120 fps, a relatively large deviation is observed for all the ω. While at 240 fps, most of the data overlap (within the error) for all the ω except ω = 8.33 s. Region III is far away from the vortex core and wall of the beaker, where one can expect superimposition of data due to the minimum effect of the stirring bar and wall. In this region, data recorded at 240 fps (see Figure 4(b)) superimposes while deviation is observed at 120 fps (Figure 4(a)). By comparing the data of Figure 4 (a & b) it is concluded that data recorded at 240 fps are more promising than at 120 fps. Hence, the experimental data of 240 fps is only considered to understand the effect of IW.
Optimization of interrogation window size
The software divides inserted frames into the small sub-images called interrogation window (IW), which performs correction correlation for each window to generate velocity vectors. Tracer particles belonging to the same interrogation window are assumed to have the same local velocity. The selection of interrogation window size usually depends on the size and number density of the tracer particles. As per the ITTC guidelines, there should be a minimum of 10 tracer particles in a single interrogation window to avoid the random displacement correlation peak (2016).
When the IW size is too larger, tracer displacement in the same window can result in the false magnitude of the correlation peak.
In contrast, small IW compares to the tracer particle size results in the clipping of tracers at the edge of the window. Because of the clipping, the random error increases as the average number of particles in a single window reduces (2016). Therefore, the optimization of IW size is necessary. Instead of one IW, three pass IW was used in the present analysis with 50% overlapping. Here, a single video was analyzed to optimize IW size for and at 240fps. Table 3 shows the two combinations of the IW, in which one has a primary IW of 64 pixels, and the other has 128pixels.
| Pass | The interrogation window size in pixels | ||
| 1 (Primary IW) | 64 | 128 | |
| 2 (Middle IW) | 32 | 64 | |
| 3 (Final IW) | 16 | 32 |
Table 3. combination of interrogation window size
Figure 55 depicts the data of tangential velocity for and at 240fps. The overlapping of the data for indicates the reliability of the combination of IW. Whereas, for , the large window sizes (128pixels) seem more accurate. When the rotational speed of the stirrer increases, the jet flow near the center of the vortex becomes stronger, resulting in the inhomogeneous distribution of the tracer particles. On the contrary, due to jet flow, fewer particles will be observed near the wall of the vessel. In Figure 5, tangential velocity increases with increasing radius reach to maxima followed by decrement. The fact that vortex mouth (diameter) increases with increasing stirring speed. However, after reaching maximum , the decrement in the tangential velocity is attributed to the wall effect. However, a large decrement in the velocity magnitude at 64 pixels could be due to the coverage of fewer tracer particles, leading to false velocity magnitude. In comparison, 128 pixels cover more particles which represent more realistic data. Hence, it is concluded that pixels IW with 50% overlapping is optimum for the entire range of .

Figure 5. Tangential velocity plot for IW 64pxls and 128pxls
Confirmation of velocity magnitude
As mentioned above (inset Figure 4(a)), a vortex region that is far away from the vortex core and beaker wall generally follows the Burger vortex model [7]. The same model can also fit whole data when the limiting factors like wall effect and perturbation created by the stirrer do not affect the vortex. However, as mentioned above, in the present work, considering the beaker dimensions and the stirring speed, regions I & II are excluded from the fit. The tangential velocity component of the Burger vortex can be expressed by equation (1) [7].
Where C is the vortex strength. It can be determined from , where g is the gravitational constant (= 9.8 m/s), is the change in the height of the vortex, is the critical radius of the vortex. The vortex strength calculated experimentally is denoted here as . Similarly, the tangential velocity () data compared to equation (1) with the variables C and are denoted here as and , respectively.

Figure 6. The tangential velocity () data extracted from PIV (open symbol) fitted to the Burger vortex model (solid line) at various rotational frequencies ()
Figure 6 shows the tangential velocity () data extracted from PIV (open symbol) fitted to the Burger vortex model (equation (1)) (solid line) as a function of radial distance (region – III) at various rotational frequencies (). It is evident from Figure 6 that the overserved agrees with the Burger vortex model. The parameters obtained from the fit are shown in Table 4. As shown in Table 4, the m matches that of experimentally observed (0.0094 ± 0.0002 m). Table 4 also confirms the agreement of and for the different values of . It also validates the proposed method of optimizing the parameters. The present method can also be applied to study the surface flow of opaque liquids.
| Stirring speed (s) | (m) | (m/s) | (m/s) | (m) |
| 8.33 | 0.024 ± 0.001 | 0.0055 ± 0.0015 | 0.0063 ± 0.0002 | 0.0095 ± 0.0002 m |
| 10.00 | 0.042 ± 0.001 | 0.0073 ± 0.0018 | 0.0079 ± 0.0002 | 0.0095 ± 0.0002 m |
| 11.66 | 0.053 ± 0.001 | 0.0081 ± 0.0020 | 0.0089 ± 0.0003 | 0.0095 ± 0.0002 m |
| 13.33 | 0.072 ± 0.001 | 0.0096 ± 0.0022 | 0.0095 ± 0.0002 | 0.0095 ± 0.0002 m |
Table 4. calculated () and fitted () vortex strength at different stirring speeds ()
Conclusion
Optimization of recording speed (fps) and interrogation window size for rotating flow recorded in the ambient light using PIV has been carried out here. In the experimental condition, the optimized parameters are 240 fps and 128 x 64 x 32 pixels for the video recording speed and interrogation window size, respectively. The tangential velocity determined based on the optimized condition matches that of the Burger vortex model, which validates the presently described method. As the present method does not require high-tech equipment like high-power lasers/LEDs, or professional cameras, budding researchers, students, and industries can use PIV easily for vortex analysis. Furthermore, the method can also be used to analyze the surface flow of opaque liquids.
Acknowledgment
SPS acknowledges the education department, Gujarat state, India, for providing SHODH fellowship vide no. 202001300006. Part of the work has been carried out under postgraduation dissertation project by NM and PB.
Supplementary Information

Figure S1. Variation of tangential velocity () as a function of radial distance (r) for various recording speed i.e., 30, 60, 120, 240, and 960 fps for
References
- [1]Aguirre-Pablo AA, Alarfaj MK, Li EQ, et al (2017) Tomographic Particle Image Velocimetry using Smartphones and Colored Shadows. Sci Rep 7.: https://doi.org/10.1038/s41598-017-03722-9
- [2]Aguirre-Pablo AA, Aljedaani AB, Xiong J, et al (2019) Single-camera 3D PTV using particle intensities and structured light. Exp Fluids 60.: https://doi.org/10.1007/s00348-018-2660-7
- [3]Buchmann NA, Willert C, Soria J (2010) Pulsed, high-power LED volume illumination for tomographic Particle Image Velocimetry. In: 17th Australasian Fluid Mechanics Conference 2010
- [4]Cierpka C, Otto H, Poll C, et al (2021) SmartPIV: flow velocity estimates by smartphones for education and field studies. Exp Fluids 62.: https://doi.org/10.1007/S00348-021-03262-Z
- [5]Dai X, Yang H, Jiang H (2017) Low-cost high-power light emitting diodes for photoacoustic imaging. In: Photons Plus Ultrasound: Imaging and Sensing 2017DOI
- [6]Hain R, Buchmann NA, Cierpka C (2016) On the possibility of using mobile phone cameras for quantitative flow visualization
- [7]Halász G, Gyüre B, Jánosi IM, et al (2007) Vortex flow generated by a magnetic stirrerDOI
- [8]Harshani HMD, Galindo-Torres SA, Scheuermann A (2015) Particle Image Velocimetry with high power Light Emitting Diodes for flow through porous medium. In: Computational Methods in Multiphase Flow VIIIDOI
- [10]Minichiello A, Armijo D, Mukherjee | Sarbajit, et al (2020) Developing a mobile application-based particle image velocimetry tool for enhanced teaching and learning in fluid mechanics: A design-based research approach. https://doi.org/10.1002/cae.22290 and references theirin
- [11]Raffel M, Willert CE, Wereley ST, Kompenhans J (2007) Particle Image Velocimetry A Practical Guide
- [12]Thielicke W, Stamhuis EJ (2014) PIVlab – Towards User-friendly, Affordable and Accurate Digital Particle Image Velocimetry in MATLAB. J Open Res Softw 2.: https://doi.org/10.5334/jors.bl
- [13]Willert C, Stasicki B, Klinner J, Moessner S (2010) Pulsed operation of high-power light emitting diodes for imaging flow velocimetry. Meas Sci Technol 21.: https://doi.org/10.1088/0957-0233/21/7/075402 (2016) ITTC-Recommended Procedures and Guidelines Guideline on the Uncertainty Analysis for Particle Image Velocimetry ITTC Quality System Manual Recommended Procedures and Guidelines Guideline
