Accurate calculation of bubble and droplet properties in diffuse-interface two-phase simulations Pranav J. Nathan, Suhas S. Jain Abstract In this paper, we address the challenge of accurately calculating droplet/bubble properties (e.g., volume, number) in diffuse-interface two-phase flow simulations. Currently, flood-fill algorithms can truncate a significant portion of the volume of droplets/bubbles contained within the diffuse interface region or artificially merge multiple droplets/bubbles. This error is also dependent on the volume fraction cutoff value, which is typically chosen to be 0.5 arbitrarily, in the flood-fill algorithms. We propose a simple volume-correction approach that incorporates an analytical approximation of the truncated volume to correct for the missing droplet/bubble volumes. This proposed method results in accurately recovering the dispersed phase volumes with minimal volume error over a wide range of volume fraction cutoff values; and hence, can also accurately recover the number of droplets/bubbles. This can be a valuable tool for accurate calculation of drop/bubble size distributions for analysis and for Eulerian-to-Lagrangian conversion of the dispersed phase in multi-scale modeling approaches. 1 Introduction Modeling of two-phase flows and the study of the deformation, breakup and coalescence of bubbles and droplets is an important problem relevant to various engineering and environmental processes [ Brennen 2005 ]. The atomization of jets and sprays, emulsions, boiling phenomena, and carbon sequestration all involve complex interactions between fluid phases [ Gorokhovski and Herrmann 2008 ; Pal 2011 Dhir et al. 2013 Jiang 2011 ]. In both laminar and turbulent settings, these interactions play a significant role in shaping the dynamics between the dispersed and carrier phases. As such, it is critical to understand how these interfaces evolve, since the exchange of mass, momentum, and energy between the phases occur at the interface. In these two-phase flows, it is critical to determine accurate values of the volume, surface area, number of droplets/bubbles, and droplet-size distribution (DSD). In engineering applications, these flow characteristics derive essential design parameters, such as the Sauter mean diameter (SMD) of fuel droplets in a gas turbine combustor. For environmental applications, they can determine the amount of air trapped in breaking waves, the drag experienced by raindrops, and the rate of dissolution of bubbles in an aqueous solution. In addition to these direct applications in engineering and nature, accurate determination of dispersed phase volumes in two-phase flows is also important for conversion from Eulerian-to-Lagrangian phase for Euler-Lagrange simulations of these flows. Currently, the flood-fill algorithm represents one of the best ways to calculate the volume of droplets in a two-phase flow. It excels in circumstances where there is a sharp interface between the two phases of the flow as was described in Lu et al. 2015 and Herrmann 2010 . However, when applied to a two-phase flow field with a diffuse interface, it struggles to accurately capture the volumes due to the lack of a clear distinction between one phase and another. Using the flood-fill algorithm and choosing an arbitrary cut-off value of the volume fraction could result in undesirable effects. Choosing a higher value of the cut-off results in significant underprediction of the volume of drops/bubbles, and choosing a lower value could result in artificial merging of separate drops/bubbles. Hence, in this paper, we propose a simple approach for accurate calculation of volumes of drops and bubbles in two-phase flows. We propose an analytical correction for the missing volumes, when the classical flood-fill algorithms are used to detect dispersed phases in diffuse interface approaches, which results in accurate calculation of volumes of drops and bubbles for wide range of cut-off values. With this new approach, a high enough cut-off value of volume fraction can then be used to prevent artificial merging of drops/bubbles while still accurately recovering the volume of drops and bubbles. The proposed approach is equally applicable for both drops and bubbles, but for brevity, the dispersed phase is referred to as droplets in the rest of the paper. In Section 2 , the phase-field method that is used to model two-phase flows is described. In Section 3 , the limitations of the flood-fill algorithm for this application are further elaborated on. In Section 4 , the three different approaches for volume calculation are explained, including the proposed approach. Finally, in Section 5 , the three described approaches are applied to sample flow fields and their performance is compared, followed by conclusions in Section 6 . 2 Phase-field method A phase-field (PF) method is a diffuse-interface approach for modeling the dynamic topological changes inherent to two-phase flows. PF methods are comparatively less expensive than other interface-capturing methods and are simple to implement while resulting in conservative transport of two phases. The challenge with calculating the number of droplets and volume within any general diffuse-interface model is the lack of a numerically sharp interface. Rather, the diffuse-interface method models the interface as approximately a hyperbolic tangent as a function of distance along the interface normal direction (see Figure 1 ) given by \phi\left(\psi\right)=\frac{1}{2}\left[1+\tanh\left(\frac{\psi}{2\epsilon}\right)\right], (1) where \psi is the signed normal distance from the interface. This diffuse nature of the interface introduces complexity when post-processing the solution fields due to the lack of clear distinction between the phases, as described in detail in Section 1 . Figure 1: The interface transitions from \phi = 1 to 0 gently following a hyperbolic tangent model. In this paper, we utilize the simulations performed using the accurate conservative diffuse-interface/phase-field (ACDI/ACPF) model ( Jain 2022 ) . The ACDI model for \phi , volume fraction of one of the fluids, can be written as \frac{\partial\phi}{\partial t}+\vec{\nabla}\cdot{(\phi\vec{u})}=\vec{\nabla}\cdot\left\{\Gamma\left\{\epsilon\nabla\phi-\frac{1}{4}\left[1-\tanh^{2}\left(\frac{\psi}{2\epsilon}\right)\right]\frac{\nabla\psi}{|\nabla\psi|}\right\}\right\}, (2) where \epsilon represents an interface thickness scale and \Gamma represents artificial regularization velocity scale. This recently developed ACDI method has gained popularity because of its suitability for accurate modeling of complex interface dynamics in drop-laden turbulence ( Jain 2022 ; Jain and Elnahhas 2023 ; Roccon et al. 2023 ; Hwang and Jain 2024 ) and a wide range of other multiphysics flow problems ( Scapin et al. 2022 ; Brown et al. 2023 ; Jain 2023 ; Jain 2024 ) . It is known to be more accurate than other existing phase-field models because it maintains a sharper interface—with only one-to-two grid points across the interface—while being non-dissipative, robust, less expensive, and conservative, without the need for any geometric treatment. Because of these advantages, the ACDI method was chosen as the interface-capturing method for the simulations in this work. However, the methods described in this paper apply to all diffuse interface approaches, including phase-field methods and algebraic volume-of-fluid models, especially those that admit equilibrium interface profiles. Some examples of the other commonly used diffuse interface approaches that have an equilibrium analytical expression for the interface between two phases are: the Cahn-Hilliard model ( Cahn and Hilliard 1958 ; Magaletti et al. 2013 ; Chen and Zhao 2020 ; Khanwale et al. 2020 ) , Allen-Cahn model ( Allen and Cahn 1979 ) , conservative diffuse-interface model ( Chiu and Lin 2011 ) and its compressible variants in Jain et al. 2020 ; Jain et al. 2023 with five-and four-equation models, and conservative Allen-Cahn model ( Brassel and Bretin 2011 ; Huang et al. 2020 ) and its compressible variant in Huang and Johnsen 2023 . 3 Flood-fill algorithm and its limitations Currently, the best practice for efficiently calculating the volume of an individual drop is using flooding algorithms. The flood-fill algorithm is a recursive procedure used to determine and mark all contiguous regions within a multi-dimensional space that share a specific property, commonly employed in image processing to fill connected areas with a uniform color or pattern ( Smith 1979 ) . The flood-fill algorithm can be applied for volume calculation in two-phase flows by recursively checking all nearby grid points against a certain cutoff value of volume fraction, \phi_{c} . When \phi_{c} is large, this approach will result in neglecting a large portion of the volume of the drop, as shown in Figure 2 (a). A smaller choice of cutoff value will result in a lower volume error. However, if the cutoff value is too low, the chance of counting two distinct but nearby droplets as a single larger droplet increases considerably, as illustrated in Figure 2 (b). A new method is thus needed that addresses this limitation with the flood-fill algorithm. (a) (b) Figure 2: A schematic showing droplet(s) using volume fraction fields in red. The blue shaded region is the one that will be used in the flood-fill algorithm to compute the droplet volume. (a) Here \phi_{c}=0.99 , and the orange region highlights the region not accounted for in the flood-fill algorithm, which results as an error in the droplet volume. (b) Here \phi_{c}=0.2 , which is too low, and as a result, multiple nearby drops can be artificially merged. 4 Volume calculation approaches In this section, we present three approaches, including the proposed approach, to calculate the volume of droplets in two-phase flows. 4.1 Approach 1 (classical flood fill) Approach 1 estimates the volume of droplets by masking the droplets using a cutoff value, \phi_{c} . From there, the flood-fill algorithm can be used to calculate the volume of the connected regions of fluid by setting a value of 1 inside the masked region, as illustrated in Figure 3 (a), and by integrating this value within each of the masked regions. The fluid volume calculated by this approach is likely to either be over or under-predicted depending on the chosen value of \phi_{c} . This is because the shaded area in Figure 3 (a) may not be equal to the area under the volume fraction curve. 4.2 Approach 2 Approach 2 uses the same masking and flood-fill algorithm, as in approach 1, to calculate the volume of the . But instead of evaluating a value of 1 inside the masked region, as in approach 1, it sums up the volume fraction values inside the masked region [see Figure 3 (b)]. This approach more accurately represents the volume of the drop, preventing the overestimation of the volume contributions at the surface of the droplet. Approach 2 will no longer overestimate the total fluid volume, but will diverge from the true value as you increase the \phi_{c} value. This is due to the volume contributions at the surface of the droplets being cut off during the masking procedure, as shown in the schematic in Figure 3 (b). (a) (b) Figure 3: A schematic showing droplet(s) using volume fraction fields in red and the calculated droplet fluid volume in blue. (a) Approach 1 is schematically shown, where all positions within the cutoff \phi range of 0.5 are masked and valued at 1, and then summed up to calculate the volume of the droplet. (b) Approach 2 is schematically shown, where all positions within the cutoff \phi range of 0.5 are masked, and the volume fraction values inside the region is summed up to calculate the volume of the droplet. 4.3 Proposed approach The proposed approach builds off of approach 2 by taking the volume calculated within the \phi_{c} cutoff value and adding an approximation of the volume contained within the truncated diffuse interface region. The first step of this process is to calculate an approximation of the surface area of an individual droplet. A spherical droplet approximation is made for this. To calculate the surface area of a droplet, an equivalent spherical diameter is first calculated as D_{eq,2}=2\left(\frac{3V_{drop,2}}{4\pi}\right)^{\frac{1}{3}}, (3) where V_{drop,2} is an estimation of the droplet volume computed using approach 2. The surface area is then computed using the expression SA_{drop,2}=4\pi\left(\frac{D_{eq,2}}{2}\right)^{2}. (4) The next step is to calculate the volume contained in the truncated diffuse interface region, which can be analytically approximated by first integrating the area under the volume fraction curve from -\infty to \psi(\phi_{c}) as illustrated in Figure 4 to calculate the interface thickness I_{T} as I_{T}=\int_{-\infty}^{\psi\left(\phi_{c}\right)}\frac{1}{2}\left[1+\tanh\left(\frac{\psi}{2\epsilon}\right)\right]d\psi=\epsilon\ln\left\{\cosh\left[\frac{\ln\left(\frac{-\phi_{c}}{\phi_{c}-1}\right)}{2}\right]\right\}+\frac{1}{2}\epsilon\ln\left(\frac{-\phi_{c}}{\phi_{c}-1}\right)+\epsilon\ln\left(2\right). (5) Here \psi(\phi_{c}) represents the location that corresponds to the cut-off value of \phi and can be calculated by inverting Eq. ( 1 ) to find \psi ( Jain 2022 ) as \psi\left(\phi\right)=\epsilon\ln\left({\frac{\phi+\varepsilon}{1-\phi+\varepsilon}}\right), (6) where \varepsilon is a small number that is added, to both the numerator and the denominator, to avoid \psi going to -\infty or \infty when \phi goes to 0 or 1, respectively (a value of \varepsilon=10^{-100} is used in this work). Figure 4: Zoomed in view of the interface transition from \phi = 1 to 0, following a hyperbolic tangent model. The shaded area represents the integrated tail of the droplet, I_{T} . Finally, the interface thickness value, I_{T} , calculated using Eq. ( 4 ) is multiplied by the surface area of the drop [Eq. ( 4 )] to calculate the truncated volume that is contained in the diffuse interface region [as illustrated in Figure 5 (b)] and then added to V_{droplet} [as illustrated in Figure 5 (a)] as V_{drop,3}=V_{drop,2}+V_{truncated}=V_{drop,2}+I_{T}*SA_{drop,2}. (7) This process is then repeated for each of the droplets in the flow field. (a) (b) Figure 5: A schematic showing the proposed approach, which includes a correction to the volume by adding the volume contained within the tails. (a) An illustration of the proposed approach in 2D, showing the multiplication of the droplet surface area with the interface thickness, I_{T} , to calculate the truncated volume. (b) A 1D representation of the droplet(s) using volume fraction fields in red and the calculated fluid volume in blue and the correction in green. 5 Results We will explore two different simulation setups to evaluate the accuracy of the proposed method and compare it with the classical approaches. In the first setup, we will consider a single stationary droplet case in Section 5.1 . Following that, we will consider a turbulent setup with multiple droplets in Section 5.2 . 5.1 Single-droplet case In this section, a single three dimensional stationary droplet was initialized at the center of a cubic domain with side length L as shown in Figure 6 . It contains a diffuse interface between the droplet phase and the carrier phase. The droplet was initialized with a diameter of 0.6L , and the value of \epsilon was chosen to be 0.51\Delta , where \Delta=L/250 is the grid size. Figure 6: This visualization shows a cross-section of a diffuse-interface spherical droplet located at the center of the domain. The three approaches described in Section 4 (which includes the proposed approach) were applied to the stationary droplet case to assess their performance. The plot in Figure 7 shows the normalized volume, V_{n} , calculated using the three methods for a range of \phi_{c} values. V_{n} is the calculated volume normalized by the exact total droplet volume, defined as V_{n}=\frac{V_{drop,k}}{\sum_{i}\phi_{i}}, (8) where V_{drop,k} is the calculated volume of the droplet using approach k , \phi_{i} is the value of the dispersed phase volume fraction at a particular grid point i . A value V_{n} of 1 represents an accurate volume calculation approach that results in the exact value of the dispersed phase volume in the simulation and is the target value for all approaches. As seen in Figure 7 , approach 1 results in overprediction of droplet volume for lower values of \phi_{c} and underprediction for higher values; approach 2 results in underprediction for all values of \phi_{c} ; and the proposed approach accurately calculates the droplet volume for all values of \phi_{c} , except a slight underprediction for very large values of \phi_{c} . The effect of the grid resolution on the accuracy of the proposed approach is presented in Appendix A. Figure 7: The calculated normalized droplet volume, V_{n} , as a function of volume fraction cut-off values for the single droplet. The proposed approach outperforms the other approaches over all values of \phi_{c} . 5.2 Multiple droplets in turbulence To further assess the performance of the methods in more realistic turbulent circumstances, the three approaches in Section 4 were applied to a two-phase flow field with homogeneous isotropic turbulence from the work of Jain and Elnahhas 2023 . The domain consists of a cube and was initialized with a droplet at the center of the flow field. This was then subjected to a forced homogeneous isotropic turbulence and allowed to reach a dynamic stationary state. A snapshot of the flow field with the droplets in this stationary state is shown in Figure 8 . The parameters for this simulation were chosen to be a density of 1, a viscosity of 2.0334\times 10^{-3} for both the dispersed and carrier phases, a void fraction of the dispersed phase of 0.0655, a Taylor-microscale Reynolds number of Re_{\lambda}\approx 87 , and an integral-scale Weber number of We_{l}=(2/3)\rho_{c}u_{l}^{2}l_{e}/\sigma=19.5 . Here, \rho_{c} is the carrier phase density, l_{e} is the integral length scale of the single-phase flow defined as l_{e}=k_{e}^{3/2}/\epsilon , where k_{e} and \epsilon are the kinetic energy and dissipation, respectively, and u_{l} is the root-mean-square velocity, which is related to the kinetic energy through k_{e}=3/2u_{l}^{2} . The computational setup consisted of a triply periodic domain of size (2\pi)^{3} discretized using N^{3} points with N = 256. Figure 8: A visualization of the turbulent two-phase flow field showing a \phi=0.5 isocontour of the dispersed phase and the velocity magnitude on the faces. The three approaches to calculate the droplet volumes in Section 4 were applied to the snapshot of the turbulent two-phase flow in Figure 8 . Figure 9 demonstrates the performance of each of the three approaches, by plotting V_{n} over a range of \phi_{c} values. Here V_{n} is the calculated normalized total volume of all the droplets in the domain. Similar to the results in Section 5.1 , approach 1 results in overprediction of the droplet volumes for lower values of \phi_{c} and underprediction for higher values; approach 2 results in underprediction for all values of \phi_{c} ; and the proposed approach accurately calculates the total droplet volume for all values of \phi_{c} , except a slight underprediction for very large values of \phi_{c} . Figure 9: The calculated normalized total volume of all the droplets, V_{n} , as a function of volume fraction cut-off values for the turbulent flow field. The proposed approach outperforms the other approaches over all values of \phi_{c} . Table 1 provides a more quantitative view of the performance of the approaches for a few specific values of \phi_{c} . The approach 1 is most accurate for \phi_{c} of approximately 0.4, resulting in an error of 1.442\% , but it diverges quickly when using other cutoff values. In contrast, the approach 2 is most accurate for smaller vales of \phi_{c} , and progressively gets worse as the chosen cutoff value increases. Note, albeit approach 2 is accurate enough for \phi_{c}\rightarrow 0 , this is not a viable option because it results in artificial merging of the droplets as illustrated in Figure 2 (b). The proposed approach remains accurate for all values of \phi_{c} , maintaining an error of less than 1\% . \phi_{c} Approach 1 Approach 2 Proposed Approach 0.2 20.38% -8.080% 0.4175% 0.4 1.442% -14.05% 0.1262% 0.5 -5.922% -17.44% 0.8212% 0.6 -12.89% -21.27% 0.9219% 0.8 -28.01% -31.69% 0.1972% Table 1: Error, E=V_{n}-V_{exact} , in the calculated volume. 5.2.1 Temporal evolution Next, the procedure in Section 5.2 was repeated for multiple time steps of the same simulation to further assess the performance of the three approaches in Section 4 . Figure 10 shows the total volume of the droplets as a function of time, calculated with the three approaches for \phi_{c}=0.5 (a typical value used in the flood-fill algorithms). Since this is an incompressible two-phase flow with no phase change, the total volume of all the droplets should be conserved. The proposed approach recovers the exact volume to within \approx 2\% for all times. The variation in the volume captured by the method is likely due to the deformation of the droplets, affecting the errors borne from the spherical droplet assumption. The approaches 1 and 2 perform consistently over time, but do not recover the true volume at this value of \phi_{c} . Figure 10: The calculated normalized total volume of all the droplets, V_{n} , over time in a turbulent flow for all three approaches for \phi_{c}=0.5 . The proposed approach outperforms the other approaches for all time steps. Here, \tau_{e}={2k}/({3\epsilon}) is the large eddy turnover time, where k is the turbulent kinetic energy and \epsilon is the turbulent dissipation. 5.2.2 Number of droplets Next, to determine the acceptable range of \phi_{c} for the calculation of flow statistics, an analysis on the number of droplets recovered by the approaches in Section 4 was done for the same two-phase turbulent flow field in Section 5.2 . The number of droplets recovered varies significantly with the value of \phi_{c} due to the artificial merging of drops (for low values of \phi_{c} ) and missing some drops (for high values of \phi_{c} ), with all three approaches recovering the same number of droplets. But the three approaches are not equally accurate in calculating droplet volumes for all values of \phi_{c} . The proposed approach is the most accurate approach for calculation of droplet volumes for a wide range of \phi_{c} except for large values over 0.8 . Hence, a suitable range of \phi_{c} needs to be determined that the proposed approach not only results in accurate droplet volumes but also can recover the number of droplets accurately. The droplets in the flow field were broken up into three size brackets. The smallest drops that are close to grid scale were considered small drops, which accounted for 0.01\% of the total volume of drops and hence are not counted. The medium-size drops represented those drops that contain upto about 1000 cells (average drop size in this simulation), and the large droplets represented everything larger than this value. Figure 11 shows the number of droplets remains roughly invariant to changes in the \phi_{c} value between the ranges of 0.2 to 0.6. There appears to be a drop-off in the number of droplets within the range of \phi_{c}=0 to 0.2 , and another drop-off within the range of \phi_{c}=0.6 to 1 . This lower drop-off range (0 - 0.2) is driven by the removal of really small droplets that were misclassified as medium drops due to the artificial merging that takes place for very small values of \phi_{c} . This is the reason the drop-off is only seen for the medium-sized drops. Hence, \phi_{c} should not be picked in the range of (0-0.2) . The higher drop-off range (0.6-1) could be explained by the removal of droplets that don’t contain a section of volume fraction values that is high enough to classify them as a droplet. Hence, this range should also be avoided for the value of \phi_{c} . Overall, in order to avoid undercounting or overcounting the droplets within the flow while maintaining an accurate calculation of the total volume, the recommended range of \phi_{c} values is 0.2 to 0.6 . Figure 11: The number of large- and medium-sized droplets are shows as function of the volume fraction cutoff value, along with their sum (total drops). The total number of droplets remains relatively constant for the range of \phi_{c} from 0.2 to 0.6 . 6 Concluding remarks In this paper, a new approach for the accurate calculation of dispersed-phase properties (e.g., volume, number) in diffuse-interface two-phase flow simulations is outlined. Current flood-fill algorithms rely on an arbitrary volume-fraction cutoff value and typically fail to capture the diffuse interface region accurately, leading to significant volume errors. Using a simple analytical approximation of the truncated volume in the diffuse interface region, the proposed method corrects for these missing volumes. The new approach was tested against two representative scenarios: a single spherical droplet and multiple droplets in a homogeneous isotropic turbulent flow field. In both cases, the proposed approach was shown to recover droplet volumes accurately across a wide range of volume-fraction cutoff values, offering significant improvements over the current approaches. This also permits one to choose a suitable volume fraction cutoff value that avoids artificial merging of nearby droplets while still recovering accurate volume of drops, therefore, yielding a more accurate representation of the number of drops. Hence the proposed method enables more accurate processing of the two-phase flow solution fields. Additionally, the approach was tested in an evolving turbulent flow field, and it remained accurate over time. Overall, the proposed method offers a simple and effective way to accurately calculate volumes in diffuse-interface two-phase flow simulations. This method can improve the calculation of droplet size distributions, total and individual dispersed-phase volumes, and droplet/bubble counts in two-phase flow simulations. Accurate calculation of these droplet and bubble properties is also important for the conversion of Eulerian-to-Lagrangian phase for Euler-Lagrange simulations of two-phase flows. Overall, this study aids in the design, optimization, and predictive modeling of complex two-phase systems in various engineering and environmental applications. Appendix A Grid resolution study The proposed approach requires that the droplets in the simulation are sufficiently resolved on the grid. If there are too few grid points per droplet, the accuracy of the method can drop. To determine this limit, a study on the relationship between droplet diameter and the accuracy of the model was done using the setup described in section 5.1 . As can be seen in figure 12 , there is a sharp drop off in the accuracy of the approach as the ratio of the diameter of the droplet D to the grid size dx drops below a value of approximately 20. It is therefore important to ensure that the droplets are resolved enough on the grid. But this is required not only for the accuracy of the proposed method, but more importantly to perform accurate numerical simulations of two-phase flows to accurately capture all the forces acting on the droplets. Hence, the proposed method is not imposing any new restrictions in terms of the grid resolution requirements. Figure 12: The accuracy V_{calculated}/V_{n} is plotted against the ratio of droplet diameter D to grid size dx for the proposed approach.