1 Introduction

Quantifying Brownian motion under the influence of flow, especially a shear flow, has been a topic of discussion that is receiving wide attention (Duits et al. 2015). Brownian motion is a random thermal vibration of microscopic particles, mathematically defined by the diffusion coefficient using the Stokes–Einstein equation,

$$\begin{array}{*{20}c} {D = \frac{kT}{{6\pi \mu a}}} \\ \end{array}$$

where \(k\) is the Boltzmann constant, \(T\) is the absolute temperature, \(\mu\) is the dynamic viscosity, and \(a\) is the hydrodynamic radius of particles (Brown 1828; Einstein 1905). Standard reference calculations involving the Stokes–Einstein equation assume fluids to remain quiescent for simplicity in quantifying Brownian motion. However, many researchers have delved into the characterization of Brownian motion with various aspects of fluid flow and different assumptions and restrictions (San Miguel and Sancho 1979; Foister and Ven 1980; Katayama and Terauti 1996; Schram and Trigger 1996). These are all tremendous theoretical achievements in characterizing the phenomenon of diffusion undergoing fluid flow.

With the development of new visualization technologies, novel experimental methods of visualization and quantification of Brownian motion have emerged. With technology to visualize sub-micron scale particles, calculations of diffusion quantification under shear flow have also been experimentally verified (Derksen and van de Water 1990). Using 2D planar and 3D stereo imaging systems can visualize the exact trajectories of particles exhibiting Brownian motion, fully capable of characterizing the diffusion aspect of particles under various types of flow (Orihara and Takikawa 2011; Takikawa et al. 2019).

Particle diffusometry (PD) is a visualization technique derived from particle image velocimetry (PIV) to quantify Brownian motion using correlation analysis. PD is often through imaging fluorescent microspheres suspended in a sample solution (Clayton et al. 2016). Unlike the single-particle tracking velocimetry (PTV) technique, which measures the individual movements of specific particles, known as a Lagrangian approach, PD incorporates the statistical averaging of the motion of multiple particles within a defined area of interest, an Eulerian approach. PD obtains diffusion coefficients by recording temporally sequential images and performing correlation analysis. Olsen and Adrian rederived Eq. 1 by involving experimental factors to calculate diffusion coefficients:

$$\begin{array}{*{20}c} {D = \frac{{s_{{\text{c}}}^{2} - s_{{\text{a}}}^{2} }}{{16M^{2} \Delta t}}} \\ \end{array}$$

where \(M\) represents the overall magnification in the image and \(\Delta t\) represents the time delay between images. The autocorrelation, the correlation of an image with itself, produces high and narrow peaks, with its peak width denoted as \(s_{{\text{a}}}\). The cross-correlation compares an image with its sequential pair, with its peak width designated as \(s_{{\text{c}}}\) (Olsen and Adrian 2000a, b). The cross-correlation peak tends to be lower and broader than the autocorrelation peak, broadened by the random particle movement (Chamarthy et al. 2009; Chuang and Sie 2014). Without convective flow within the recording, the cross-correlation peak width contains the Brownian motion information. The degree of correlation peak broadening can be directly related to the diffusion coefficient using Eq. 2.

Previous research found PD to be a promising method to measure changes in biomolecule conjugated nanoparticles, protein folding states for biotherapeutics, and amplified DNA presence to detect pathogens, all from the measured change in the diffusion coefficient (Clayton et al. 2016, 2017a, b, 2019). Using PD to perform such measurements only takes ~ 8 s of data using a fluorescence microscope, charge-coupled device (CCD) camera, and MATLAB algorithm (Clayton et al. 2017b). These materials are ubiquitous in typical wet lab spaces; therefore, PD can be performed in settings where traditional viscometers may be unavailable. Moreover, with the advancement of mobile phone technology, the smartphone camera has displaced the conventional CCD camera as a recording device of comparable quality but at a much more affordable price (Wang et al. 2021). PD has also taken this approach by expanding its use to a more portable application, measuring amplified DNA presence to detect pathogens. Recently, a smartphone-adapted mobile imaging device has been used to detect the presence of V. cholerae in environmental water, malaria in 10% blood, and SARS-CoV-2 in 10% saliva (Moehling et al. 2020; Colbert et al. 2021, 2022). These previous works involving PD on a portable device laid out the foundation for the technology to be used at the point of use. To further translate the technology into commercial use, the usability of this device was evaluated in the field in Bangladesh (Rager et al. 2021).

Despite showing potential for translating PD-based diagnostic devices from the lab bench to the field, the current approach to PD relies on two restrictive assumptions. The first assumption is that the experiment is performed within a quiescent solution. Previously, we constructed enclosed microfluidic chips to minimize fluid flow in PD measurements to avoid evaporation-driven flows and temperature gradients (Clayton et al. 2019; Colbert et al. 2021). However, small amounts of potential flow may be present due to imperfections in constructing the microfluidic chip. The second assumption is that the solution must be maintained at room temperature, often denoted as 21 °C (Moehling et al. 2020). These assumptions are present to negate the flow effect on the broadening of the correlation peak widths and temperature effects that alter Brownian motion directly (as seen in Eq. 1). The presence of thermal gradients or expansion of microbubbles within the fluid due to the temperature differentials could induce flow. Indeed, the current algorithm does not distinguish Brownian motion from fluid flow when computing suspended particle diffusion coefficients. These issues need to be addressed to implement PD in more complex settings beyond the lab.

In this body of work, we address the computation of diffusion coefficients in the presence of convective fluid flow and temperature gradients within the imaging plane to improve PD for further real-world applications using a smartphone as the recording device. The PD technique could be implemented into diagnostic devices where a lab-grade environment would be hard to achieve by allowing the algorithm to compensate for more measurement errors upon data gathering.

2 Methods

2.1 Simulated videos

Simulated videos of particles undergoing Brownian motion are generated in triplicate using an in-house MATLAB® (The MathWorks, Natick, MA) code. The simulated particle concentration mimics the one used in experimental images (\(6 \times 10^{9} \;{\text{particles}}/{\text{mL}}\)). Additionally, the code implements various diffusion coefficients to generate videos with varying diffusivity. The simulated images are \(1024 \times 1024\) pixel areas, like an experimental microscope setup with a 40X objective on an inverted microscope (Zeiss Axio Observer, Zeiss, White Plains, NY). The experimental measurements are recorded without geometrical binning for signal enhancements and a lag time (\(\Delta t\)) of 0.067 s (15 frames per second).

Plotting is used to simulate the particle paths instead of indexing to avoid losing sub-pixel information of the simulated particles’ location. For each image, location information is plotted as a scatter plot, and then a Gaussian filter is applied to add the padding around the point source location.

Three different flow profiles are generated: constant, Couette, and Poiseuille. Their velocity profiles are distributed so that the zero velocity points (when they exist) are at the edge of each simulated image. The maximum value of each velocity profile is increased from 1 to 10 pixels with a 1-pixel increment. The particle motions from convective flow are overlaid on top of the Brownian diffusion. All convective flows proceed from left to right. The effect of the angle of the convective flow is explored by generating flows with various degrees of shear at angles varying from 0 to 80° with a 10-degree increment.

2.2 Experimental setup

We made a simple chip to contain the seeded particle solution for experimental imaging with an overall dimension of 1 cm by 1 cm. The chip is composed of 4 layers: 2 layers of 188 \({\upmu \text{m}}\) thick cyclic olefin polymer (COP) (Zeonor, Tokyo, Japan), 142 \({\upmu \text{m}}\) thick pressure-sensitive adhesives (PSA) (Adhesives Research, Glen Rock, PA), and 5 mm thick polydimethylsiloxane (PDMS) (Sylgard 184, Dow Corning, Auburn, MI, USA) (Fig. 1a). For the PSA layer, a channel with the dimensions of 2 mm by 2 cm is cut using a VLS3.75 laser cutter (Universal Laser Systems, Scottsdale, AZ). For one of the two layers of COP, 2 mm diameter through holes are punched at the inlet and the outlet. The syringe pump (kdScientific, Holliston, MA) is used to control the increments of flow rate through the chip. The 3 \({\text{mL}}\) BD Luer-Lok syringe (Becton, Dickinson and Company, Franklin Lakes, NJ) paired with PEEK tubing (Idex Health & Science, Oak Harbor, WA) is used to connect the syringe pump with the chip. A 5 cm by 5 cm cast of 5 mm thick PDMS is cut to the size of the overall chip with two designated channels for the inlet and the outlet and is used as supporting material for the polyetheretherketone (PEEK) tubing, aligned with the inlet and outlet of the chip (Fig. 1b).

Fig. 1
figure 1

Experimental setup. a Construction of the microfluidic channel. Layers were constructed by sandwiching COP and PSA, with PDMS on top to hold the tubing. b Exploited view of the chip, PDMS has an inlet and outlet punched through for the peek tubing placement. A rectangular setup allows the overall chip to be placed on the microscope stage without additional support. c Experimental image of the particle. d Simulated particle image for comparison

In the experiment, 500 nm Yellow–Green (Ex441/Em485) fluorescent microspheres (Polysciences, Niles, IL) are diluted in deionized water to a final concentration of \(6 \times 10^{9} \;{\text{particles}}/{\text{mL}}\). The recordings are taken at room temperature using an inverted fluorescence microscope (Axio Observer, Zeiss, White Plains, NY) equipped with a high-intensity LED lamp and 40X magnification objective. The images of the Yellow–Green particles are recorded using an iPhone 6 (Apple, Cupertino, CA) mounted to the eyepiece of the microscope using an adaptor (Gosky Optics, Zhejiang Province, China) (Fig. 1c). The adaptor is modified using two spacers, at a total thickness of 1.5 cm, to distance the eyepiece of the microscope and the iPhone 6, achieving the optimal focal length.

Using an objective micrometer (Carolina, Burlington, NC), the circular field of view, restricted by the eyepiece of the microscope, displayed on the recording device is calculated to have a diameter of 574 \({\upmu \text{m}}\). The obtained images have a dimension of \(1920 \times 1080{ }\;{\text{pixel}}\). The center coordinate of the circular field of view is computed, and then the information is used to cut out a \(1024 \times 1024\;{\text{pixel }}\) square region for further analysis. Outside the square cut-out region, the particle shows circular aberration due to the eyepiece’s combined lens effect and the iPhone camera lens system. For the experimental flow rates, conversions are applied to match the parameter used in the simulation. The simulated image sets have their maximum flow rate increased at a rate of 1 \({\text{pixel}}/\Delta t\) (Fig. 1d). With the channel geometry of \(2 \;{\text{mm}} \times 2 \;{\text{cm}} \times 142 \;{\upmu \text{m}}\), the calculation shows the volumetric flow rate of 77 \({\text{nL}}/{\text{min}}\) is equivalent to the planar flow rate increment of 1 \({\text{pixel}}/\Delta t\) in the simulated cases. The syringe pump controls the volumetric flow rate from 77 to 1702 \({\text{nL}}/{\text{min}}\) (22 \({\text{pixel}}/\Delta t\)). Each recording contains 300 image pairs (~ 21 s). 3–5 videos are recorded per increment of the flow rate.

2.3 Flow adjustments to particle diffusometry

Modifications are made on a pre-existing in-house MATLAB® (The MathWorks, Natick, MA) code built for end-point diffusion coefficient measurements. For the interrogation window size, \(128 \times 128\) pixel is chosen to account for spatial variation, followed by Keane and Adrian during the development of our analysis (Keane and Adrian 1992). On average, each interrogation window containing 8–10 particles was used for 100 image frame stacks (~ 8 s of data) for a high signal-to-noise ratio while maintaining a statistically relevant number of data points (Clayton et al. 2017b). Instead of using the correlation peak width from a single image pair, temporal averaging is used to reduce random error. Correlation peaks from 100 sequential image pairs are averaged (Samarage et al. 2012).

Experimental recordings of fluorescent particles do not necessarily form Gaussian intensity profiles due to impurities in the particle shapes, aggregation of particles, unbalanced illumination, and the presence of shear flow (Westerweel 2008). These irregularities cause the correlation peak to be stretched in their height, not entirely following a Gaussian profile. For both the simulation and experimental cases, the fitted Gaussian peak tends to be broader and shorter than the raw correlation peak (Fig. 2a) when fitting the curve of the overall interrogation plane (Scharnowski and Kähler 2016). Also, uncertainties in the experimental setup, such as particle shape deformation, aggregation, and illumination, produce background noises, causing the base value to rise from zero. As for the PD algorithm, Gaussian fitting has been used in the analysis, but here with the addition of the flow, fitting of non-circular-Gaussian peaks and correcting the baseline are necessary (Clayton et al. 2016, 2017a).

Fig. 2
figure 2

Correlation analysis processing. a Comparison of experimental data and fitted peak using an unmodified PD algorithm. b Two-part separated peak fit (top) and cross-correlation (bottom) peak due to shear. The first column presents the height fit using the \(3 \times 3\) region, the second column shows the width fit using the \(5 \times 5\) region excluding the center value, and the last column portrays the combined fit. The black line represents the \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\text{e}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\text{e}}$}}\) height. c Distortion on the cross section of the cross-correlation peak due to shear. The modified algorithm’s peak width is defined as the cross section width in the cross-streamwise direction

The entire interrogation window of \(128 \times 128\) pixel values is averaged, excluding the center \(11 \times 11\) pixel, and subtracted to match the baseline of the overall interrogation window. This baseline subtraction corrects the correlation of random fluctuations (Westerweel 1997; Xue et al. 2014). Next, for the peak fitting, an elliptical Gaussian profile is drawn using a two-part separated peak fit to obtain the peak width of each correlation peak. The two-part separated peak fit is used due to the stretched peak in their height beyond the Gaussian profile. Therefore, peak fit is split into two parts, a height fit and a width fit (Fig. 2b). First, a 3 by 3 pixel region encapsulating the pixel-level maximum location of the peak is used to identify the sub-pixel location of the maximum peak height (Nobach and Honkanen 2005; Blumrich 2010). Next, a 5 by 5 pixel region surrounding the pixel-level maximum location, excluding the center value (the maximum), is used to capture the Gaussian peak with width information matching the correlation peak. This combined Gaussian surface fit is used to calculate the 2D profile of the auto- and cross-correlation peaks.

The width of the correlation peak is defined by the width of the peak at \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 {\text{e}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\text{e}}$}}\) height (Olsen and Adrian 2000b). The width of the streamwise and cross-streamwise directional Gaussian curves are calculated by extracting the parameters of the equation of an ellipse in implicit form. Two radii of the ellipses are then computed using the algebraic manipulation of implicit and the general equation of ellipses (Reed and Hutchinson 1994). Since the Brownian motion along one coordinate axis is independent of the other, the axis length perpendicular to the flow direction is used as the correlation peak width (Chamarthy et al. 2009) (Fig. 2c).

2.4 Flow velocity confirmation

A secondary method is required to verify the results of the modified algorithm on the simulated videos. A single-pass PIV analysis is applied to the image pairs identifying the velocity vectors for the interrogation windows. The general assumption is that the flow direction does not change within the duration of 100 image pairs (6.67 s), which is indeed true for the simulated videos. For each interrogation window, a simple 5-point Gaussian sub-pixel peak fit is used to locate the true location of the peak maximum (Raffel et al. 2007). The true center location is recorded for all the pairs and averaged to the location of each interrogation window. The \(x\)- and \(y\)-directional shift is measured by identifying the peak maximum shift from the center of the interrogation window. The computed flow vectors are compared to the simulated values since the flow velocities are a known factor in the simulated videos.

2.5 Flow profile identification

The constant flow profile case is investigated to provide a model experiment to test the accuracy of the simulation. To ensure the constant flow profile is maintained within the channel, the velocity profile along the width and height of the rectangular channel is calculated. The velocity profiles for a rectangular channel can be derived as,

$$\begin{array}{*{20}c} {u\left( {y,z} \right) = \frac{{4h^{2} \Delta p}}{{\pi^{3} \eta L}}\mathop \sum \limits_{{n,{\text{odd}}}}^{\infty } \frac{1}{{n^{3} }}\left[ {1 - \frac{{\cosh n\pi \frac{y}{h}}}{{\cosh n\pi \frac{w}{2h}}}} \right]\sin n\pi \frac{z}{h}} \\ \end{array}$$

where \(\Delta p\) is the pressure difference, \(\eta\) is viscosity, \(w\), \(h\), and \(L\) are the channel’s width, height, and length, respectively, and \(x\), \(y\), and \(z\) are the coordinate axes along the channel (White 1991). Along the channel width, the flow profile in Eq. 3 is that of constant flow. For the height of the flow, depth of correlation (DOC) also needs to be considered. The expression for the DOC can be derived as,

$$\begin{array}{*{20}c} {z_{{{\text{corr}}}} = 2\sqrt {\frac{1 - \sqrt \epsilon }{{\sqrt \epsilon }}\left[ {\frac{{n_{0}^{2} d_{{\text{p}}}^{2} }}{{4NA^{2} }} + \frac{{5.95\left( {M + 1} \right)^{2} \lambda^{2} n_{0}^{4} }}{{16M^{2} NA^{4} }}} \right]} } \\ \end{array}$$

where \(\epsilon\) is the threshold weighting function, normally taken as 0.01, \(n_{0}\) is the index of refraction of the immersion medium (for the case of air immersion lens, which is used in this paper, this value is 1), \(d_{{\text{p}}}\) is the particle diameter, \(NA\) is the numerical aperture of the objective, \(\lambda\) is the wavelength of the light, and \(M\) is the objective magnification (Bourdon et al. 2005; Wereley and Meinhart 2009). Parameters used for the experiments are as such, \(d_{{\text{p}}} = 470\; {\text{nm}}, \;NA = 0.95, \;\lambda = 488\; {\text{nm}}, {\text{and}} M = 40\). The depth of correlation is calculated to be 2.514 μm using these parameters. Applying Eqs. 3 and 4, the velocity variation along the z-direction is no more than 0.03%, showing the flow profile variation in the height dimension of the flow is negligible.

Experimentally, the flow profile of the recording always remains that of constant flow if the recording takes place at the center of the rectangular cross section of the channel geometry. With the syringe pump pushing liquid at constant flow rates, the overall particle behavior should be aligned to a single direction with a minimal angular variation.

3 Results and discussion

3.1 Frame rate adjustment

When experimentally measuring Brownian motion and quantifying diffusion coefficients with PD, the frame rate of recorded videos influences the calculated values (Clayton 2017). For example, particles’ Brownian motion is hindered by the solution viscosity for high viscosity medium. If the lag time between frames is shorter than the time required for a measurable motion of particles to occur, the correlation of these two frames may show a little-to-no change in the displacement of particles. On the other hand, if the lag time between frames is longer than the time required for a measurable motion of particles to occur, there may be no correlation between two subsequent frames as the time passed between two frames allow particles to move beyond their original coordinates. These errors can occur when the camera frame rate is not optimally aligned with the particle Brownian motion and can be corrected by changing \(\Delta t\), essentially adjusting the camera to have an optimal frame rate to match the particle Brownian motion (Clayton 2017). However, the technique would require pre-knowledge of the sample viscosity, which isn’t always available.

We developed a method to record and correct the effect of an inaccurate frame rate on diffusion coefficient calculations using a modified PD algorithm. We computationally simulated the Brownian motion of particles with diffusion coefficients varying from 3E-13 to 3E-12 m2/s with an increment of 1E-14 m2/s. The lower boundary value (3E-13 m2/s) was chosen from the previous paper regarding the PD technique (Moehling et al. 2020), and a tenfold value of 3E-12 m2/s was used as the upper boundary. We analyzed the simulated particle images to determine the correction factor to optimize the frame rate.

In Fig. 3a, as the raw data deviates from a \(y = x\) graph, we showed that the Brownian motion of particles produced a higher diffusion coefficient than what a pre-set frame rate can adequately capture, leading to inaccurate calculations. We calculated the correction required for each data point using this deviation from the expected \(y = x\) graph. When the ratio of the simulated diffusion coefficient to the analyzed diffusion coefficient is multiplied by the analyzed diffusion coefficient, this will produce the accurate diffusion coefficient for the simulated data set. A scatter plot was used to better represent this correction relationship (Fig. 3b). Here, the x-axis represented the analyzed diffusion coefficient from the algorithm, and the \(y\)-axis was the ratio between simulated and analyzed diffusion coefficients, representing the amount of correction required for the values on the \(x\)-axis. This comparison allowed us to estimate the percentage of correction needed based on the computed diffusion coefficient by the modified algorithm.

Fig. 3
figure 3

Correction of diffusion coefficients on fixed frame rate. Error bars represent one standard deviation above and below. a As the diffusion coefficients get larger, the deviation of raw data from the corrected data increases, and the correction made by the fitted equation is also represented. b Trend represents the percentage of correction required for the simulated diffusion coefficient range. (N = 3)

A regression analysis was performed on the list of correction factors to compensate for all possible outcomes from the algorithm. To best describe the simulated dataset and minimize the effect of constraining the curve, a cubic polynomial fit was used as the best fit with an R2 value of 0.983. Since the purpose of regression was to best capture all the aspects of the scattered plot, we also fitted higher degree polynomials beyond cubic. However, the resulting higher polynomial correction equation only varied the diffusion coefficient results in the 1E-15 m2/s region, 100-fold smaller in values than the target diffusion coefficient range (3E-13–3E-12 m2/s). After applying the correction equation, the analyzed and simulated diffusion coefficients matched. This linear regression is portrayed in Fig. 3a with the regression equation slope of 0.995, showing a near-perfect 1:1 ratio.

3.2 Diffusion simulation under simple flow

The particles were simulated with a diffusion coefficient of 1E-12 m2/s to represent the condition at room temperature (25 °C). A total of 270 videos per flow type (constant, Poiseuille, and Couette flows), each with 101 frames, were simulated as three replicates. Oftentimes, flows occur in microfluidic chips due to the movement of the air bubbles trapped within the microfluidic channel or well. When bubbles are present within the microfluidic well, these create flow within the sample at an angle not necessarily aligned with the axis of the camera. Therefore, particles were simulated with a flow angle ranging from 0 to 80° with 10-degree increments to recreate variations of angle alignment in the flow direction caused by the bubble. Each video contained 101 frames for the analysis, resulting in a single averaged diffusion coefficient value per video. All the analyzed diffusion coefficients were averaged with respect to the flow rate the videos were generated with. For each data point on the plot, 30 diffusion coefficients were averaged: three replicates of 0–80° with 10-degree increments.

The relative error (% error on diffusion coefficients in Fig. 4a) on the analyzed diffusion coefficients was plotted against the simulated flow velocities. Since the diffusion coefficient values are known for the simulated data set, the relative error is calculated as the ratio of the difference between the measured diffusion coefficient and simulated diffusion coefficient to the measured diffusion coefficient. We observed that the % Error in diffusion coefficient measurements increased as the flow velocity increased; the phenomenon is observed in other works involving measurement under flow conditions (Walker et al. 2005). The effect generally resembled a linear pattern, with deviations from linear caused by the flow type. The slope was the smallest in the constant flow case compared to Couette or Poiseuille flows. The next lowest slope was from the Couette flow, where the polynomial degree was 1, one dimension higher than the constant flow. Lastly, Poiseuille flow with a polynomial degree of 2, hence the parabolic flow, showed the highest slope value showing the most progressive increasing trend in error as the induced flow rate increased. Therefore, the % Error measured for the diffusion coefficient depended on their induced flow rate and the degree of shear on each flow. The analysis revealed that the diffusion coefficient results show a greater than 10% error when the flow rate exceeds 8 \({\text{pixel}}/\Delta t\) (120 pixel/s) with the improved algorithm on PD.

Fig. 4
figure 4

Comparison of simulation results with analyzed values on the trend of error increase on flow rate variation. a Relative error percentage on diffusion coefficients on three simple shear flow types. b Relative error percentage on analyzed flow rate through single-pass PIV. c Relative error percentage of analyzed diffusion coefficients of constant flow at elevated temperatures

Single-pass PIV was applied to obtain the velocity vector of the flow, which was then compared to the values each video was simulated with to verify the correctness of the algorithm. Induced flow velocity was compared to the velocity analyzed using PIV on both magnitude and direction. As shown in Fig. 4b, a simple pass PIV, a 5-point Gaussian sub-pixel fit on a correlation peak, is a valid estimator for the computation of flow speed from the generated simulation videos. However, a significant measurement variation occurred in the low flow velocity region. As the flow velocity became comparable to, or smaller than, the Brownian motion of the particles in the solution, the single-pass PIV analysis presented a substantial margin of error in computing the induced flow velocity. Overall, the maximum error on the graph did not exceed \(\pm 10\%\), and the trend suggested that the error reduced as the induced flow velocity increased. The results showed the modified algorithm did not neglect the overall amount of flow when computing diffusion coefficients under the presence of a simple flow.

We adjusted measurements to analyze different temperature variations once the simulation results were verified under room temperature conditions (25 °C). We extended the simulation range to 22 \({\text{pixel}}/\Delta t\), compared to the 10 \({\text{pixel}}/\Delta t\) used for the previous analysis, to ensure a broader range of trends was captured. Only the constant flow case was considered as the variation amongst the simulation results for the three flow types only varied in their slopes; their trend remained identical. The theoretical diffusion coefficients were simulated at temperatures ranging from 25 to 65 °C with 10 °C increments. Likewise, the tabulated values for dynamic viscosity at varying temperatures were integrated into the simulation. During the frame rate adjustment investigation, the correction equation for such phenomena was established for the diffusion coefficient range of 3E-13–3E-12 m2/s. Only the diffusion coefficient in this range could be adjusted with the proposed correction equation. The highest theoretical diffusion coefficient for the analyzed temperature range occurred at 65 °C, as the diffusion coefficient is proportional to the temperature (stated in Eq. 1). The theoretical diffusion coefficient at 65 °C is 2.43E-12 m2/s, below 3E-13 m2/s, ensuring the analyzed diffusion coefficient was within the proposed diffusion coefficient range that the correction equation for the frame rate adjustment accounts for.

The results of the varied temperature simulation show no visual differences in their trends; scatter plots were aligned on top of each other (Fig. 4c). Additionally, the slopes showed no statistically significant difference when comparing multiple linear regressions on each variable temperature data set (p-value = 0.3). The variance on multiple linear regression was only presented amongst their percentage error at zero flow velocity. Therefore, relative error change of diffusion coefficients did not depend on the temperature variation. The improvement made on capturing the appearance of the correlation peak in the presence of flow can be used for any temperature variation, given the correction equation is applied for the said range. The percent error only changed when the induced flow rate changed at each temperature value simulated. The change in percent error, calculated by the modified PD algorithm, depended only on the induced flow rate.

3.3 Diffusion experiment under constant flow

We performed PD experimentally to translate our frame adjustment correction algorithms into real-world scenarios. Our observed experimental flow profile identification suggested that the overall flow was constant. Moreover, the trends of PD error under constant flow over the range of elevated temperature values were indistinguishable from each other. With these two conclusions in mind, we concluded that a Brownian motion measurement under a constant flow profile at 25 °C was suitable for validating the simulation analysis on the modified PD algorithm. The result is portrayed in Fig. 5.

Fig. 5
figure 5

Comparison of simulation results with experimental results. The constant flow is maintained in the experiment. The independent variable refers to the setting on the syringe pump in units of \({\text{pixel}}/\Delta t\). The error bars represent one standard deviation above and below the data point for the dependent variable

Due to a slow volumetric flow rate, obtaining a near-identical flow rate posed a difficulty. Therefore, flow range averaging was used to calculate the analyzed values in intervals, implementing error bars on the independent value (flow rate). The independent values are obtained using a single-pass PIV with the method described in the "Flow velocity confirmation" section. The data points ranged between 10 and 50 points per flow rate. A total of 137 data points with flow values recorded from 0 to 0.49 \({\text{pixel}}/\Delta t\) were averaged to produce the baseline standard to calculate the percentage error of diffusion coefficient calculation. The standard deviation suggested high variation among the dataset, marking 18 \({\text{pixel}}/\Delta t\) as the 10% error threshold. The analysis revealed the overall trend match between the simulation and the experiment dataset, proving the feasibility and realistic nature of the newly improved algorithm for PD to quantify Brownian motion under the presence of flow.

4 Conclusion

Prior to this work, the PD algorithm was excellent for measuring an average particle diffusion coefficient in a quiescent solution. However, the modified PD algorithm described herein improves upon prior approaches by determining the diffusion coefficient of particles under simple shear flows in a range of temperature settings.

We acknowledge there are ways to correct flow in particle image velocimetry, such as window deformation and sub-pixel shift. However, these methods do not apply to the study of diffusion coefficient via correlation methods as it would also alter the particle movement information embedded within. In this work, we describe the shape change in the correlation peak under flow occurrences and that this shape change only occurs in the direction of the flow. By understanding the elliptical nature of the correlation peak and obtaining the width of the two axes separately, we have improved the method to quantify Brownian motion by computing the diffusion coefficient. Also, we have developed a correction equation for when there is a mismatch between the recording device’s frame rate and the particles’ average Brownian motion. While it is known that this phenomenon is correctable by adjusting the lag time for imaging based on the known solution viscosity, this requires pre-existing knowledge of the solution viscosity. The method presented in our work is an improvement over the existing method as the mismatch problem can be resolved without knowing the solution viscosity beforehand.

The modified PD algorithm analyzes the diffusion coefficient with simple flow up to the flow rate of 8 pixel/∆t (120 pixel/s) with less than 10% error. The single-pass PIV used to confirm the credibility of the algorithm overall showed less than a 5% error across all values of flow velocities. The algorithm is also tested using simulation at various elevated temperatures. The change in the amount of error on the diffusion coefficient shows no statistical significance, presenting that the error depends only on the induced flow rate.

Our flow-adjusted PD algorithm is an improvement to the pre-existing PD. The experiments for quantifying the Brownian motion are influenced by any outside vibration source or propagation of trapped air bubbles within the microfluidic setup. The improved method can reduce the number of experiment recordings that are otherwise discarded due to flow within the recording. With factors in the experiment setup known, such as magnification, exposure time, and frame rate, Brownian motion experiments involving other setups can use the improvement method mentioned above to calibrate for the flow. Future development can expand the flow velocity and shear rate the algorithm can compensate for. Further, the improved PD algorithm can enlarge the field of application where quantification of the Brownian motion by measuring the diffusion coefficient is useful.