1. Introduction
Multiphase flows with moving interfaces separating immiscible fluids are present in many natural phenomena and industrial applications. The presence of interfaces makes it difficult to simulate the physical phenomena involved, which often depend on the interfacial forces and the physical properties of the different phases. For example, two-phase flow can be characterized by high density and viscosity ratios with a wide range of spatial and temporal scales and strong interface deformation due to surface tension, which can produce complex topologies with merging and/or splitting of the interface. Direct numerical simulations of multiphase flows can simulate quite complex configurations of practical interest, where the continuum length and time scales are fully resolved. These require a precise calculation of the interface geometry, in particular the local values of the interface unit normal
and its curvature
, in all computational cells cut by the interface. For incompressible flows and constant physical properties, the computation of the spatial position of the phases is performed through the phase indicator function
, which is 1 inside the reference phase and 0 in the secondary phase. The function
is discontinuous on the interface and conventional discretization methods fail to reproduce its evolution in time satisfactorily. Several methods have been proposed to track a moving interface; examples include, among others, the volume-of-fluid (VOF) method, the Level Set (LS) method, and the Front-Tracking (FT) method [
1,
2,
3].
The computation of the unit normal and curvature along the interface can be approximated in various ways in the different methods. In this paper, we focus on the VOF method, which has also been implemented in several free, open-source software platforms [
4,
5,
6,
7,
8].
The VOF method considers the fraction of volume
of any computational cell
to represent implicitly the interface between two immiscible fluids:
where
is the volume of the cell and
the phase indicator function with value 1 inside the reference phase and 0 in the secondary phase.
The advection of the volume fraction field depends on the local fluid velocity
and satisfies the following advection equation:
The volume fraction field changes abruptly across the interface—see
Figure 1a—since the
function is discontinuous. When solving for the hyperbolic Equation (
1), finite difference methods, such as upwind schemes, are rather diffusive and the interface does not remain sharp in time. For an incompressible flow,
, a geometrical approach is more efficient and proceeds in two steps. The interface is first reconstructed, and the Piecewise Linear Interface Calculation (PLIC) approximates in two dimensions the interface line as a segment in each cut cell,
, where the non-homogeneous term
is computed by enforcing area conservation [
9]. Various schemes have been proposed to estimate the unit interface normal,
, in a uniform Cartesian grid, including finite differences and error minimization [
10,
11,
12]. Then, the reconstructed interface is advected in the given velocity field. This amounts to computing geometrically the reference phase area in two dimensions (2D) [
9] or volume in three dimensions (3D) [
13] that is exchanged across the boundary of neighboring cells. They can still produce very small mass errors due to the intrinsic finite machine precision, which should be removed during the numerical simulations.
The surface tension force, located at the fluid–fluid interface, can be modelled by a force per unit volume, using the continuum surface force (CSF) model [
14]:
, where
is the surface tension coefficient and
a surface distribution localized at the interface [
9]. The interface curvature,
, can be computed as the second derivative of the abruptly changing
C field, but it is a poor approximation. The volume fraction field
C can be convoluted with a smoothing kernel to obtain a more regular function (CV) [
15]. Another possibility is the reconstructed distance function (RDF), which can be computed from the piecewise linear reconstruction of the interface [
15], in a way similar to the coupled VOF-Level Set (CLSVOF) method [
16]. The CV and the RDF functions can then be numerically differentiated to compute the curvature. These two methods are robust at low resolution, but do not have good convergence properties with grid refinement. Other methods to compute the mean curvature include least-square methods that fit a parabola/paraboloid to the volume fractions of a block of cells [
17] or to a set of interfacial points [
5], and volumetric fitting methods [
18].
This paper focuses on the computation of the interface geometrical properties with the height function method (HF). In some articles, the HF method is observed to have first-order convergence with grid refinement [
19,
20], while theoretical results indicate second-order convergence. We analyze the reasons for this unexpected behavior of the VOF method. The novelty of this paper is a proposal for avoiding this incongruous result.
To this aim, we investigate the origin of the numerically observed first-order convergence of the HF method and suggest how to remove this inconsistency to obtain the theoretical second-order convergence. This work follows what was previously published in [
21].
Section 2 introduces the continuous height function of [
22] and three different polynomial approximations of the interface line, of its unit normal
, and of the curvature
in a column of cells cut by the interface.
Section 3 considers an interface line described by a set of differentiable parametric equations and characterized by a variation of the curvature, both in magnitude and sign. Second-order convergence with grid refinement is recovered when the interface line is drawn in a uniform Cartesian grid at the points where the heights are located, but data interpolation provides a different order of convergence according to the polynomial approximation under consideration. Finally, our conclusions are drawn in
Section 4.
2. Interface Line Approximation with the Height Function
The height function (HF) method is based on the
C field, and the heights are computed by summing the volume fractions across the interface along one coordinate direction. The height is an approximation of the distance of the interface point on the column midline from a reference coordinate line, as shown in
Figure 1. Three consecutive heights along the same coordinate direction are required to compute the unit normal
and the curvature
with centered finite differences. The Standard Height Function (SHF) method uses a fixed
stencil to calculate the three heights, while the Generalized Height Function (GHF) method uses an adaptive stencil to compute them [
5]. The second approach is more precise at low resolution or in the presence of complex topologies that are characterized by interface breakup or coalescence. The HF method has also been extended to non-uniform Cartesian grids [
23], to adaptively refined meshes [
5], and to unstructured meshes [
24].
The HF method fails to provide adequate estimates of the interface geometry when the surface is not well resolved in the computational grid, in other words, when the local radius of curvature is close to the grid spacing. Some hybrid methods have been developed to overcome this issue. At high grid resolutions, the unit normal and the curvature of the interface are computed with second-order convergence with the HF method. At lower grid resolutions, the hybrid method should automatically switch to another more robust method with coarse grids, such as the CV and RDF methods.
More recently, a machine learning approach has been used to estimate the interface properties, directly from the volume fractions of a fixed block of cells [
19,
20], or even from the HF distribution [
21]. Its curvature estimate does not converge with grid refinement; still, it can be used at coarse grid resolution as a part of a hybrid method.
2.1. The Continuous Height Function
Following the derivation of [
22], we consider an interface line that locally can be expressed in the explicit form
, when
. The inverse form
should be considered when
. We assume that
is continuous with its derivatives, with the notation
. The continuous height function
is then defined as
is by definition the mean value of
in the given interval of integration of length
h. Similarly, the mean value of
in the two adjacent intervals can be denoted as
and
. With these three consecutive values of the height function, it is possible to approximate with centered finite differences the values of the first and second derivatives and of the curvature
of the function
at point
x:
The first derivative represents the slope of the tangent line that determines uniquely the direction of the unit normal
. With an expansion in the Taylor series with the small parameter
h, it is straightforward to show the following [
22]:
where
and
. Higher-order terms of the Taylor series are defined by
. The approximation of the function
and of its derivatives and curvature with the height function
H and centered finite differences is therefore second-order-accurate with grid spacing
h. However, it should be noted that this statement is correct only at the abscissa
x where the height point is located.
For the situation depicted in
Figure 2a, the interface section inside the central column does not cross a horizontal grid line, and the height
, where the interface geometrical properties are evaluated, is centered with respect to that section. On the other hand, in
Figure 2b, the same interface line crosses a horizontal grid line in the central column. A centered scheme would require the computation of the geometrical properties at midpoints
and
, after the calculation of the position
of the interface intersection with the grid line.
For the normal calculation, this issue was first raised in [
25], where the numerical second derivative, given by the second of Equation (
3), was used to approximate the variation of the unit normal
across the column, and the abscissa of midpoints
and
was computed with an expression involving the volume fraction
C of the two consecutive cut cells. For the curvature calculation, a quadratic interpolation that was demonstrated to be second-order accurate was proposed in [
22], but numerical results were not provided.
Here, we consider three consecutive values of a geometrical property—for example, the height function values
,
, and
of
Figure 2a—to interpolate the data inside the central column. We compute the following three coefficients
and consider the three polynomials
,
, and
, of order 0, 1, and 2, respectively:
Let
be the abscissa of the midpoint of the central column; then at any point
x of the central column, with
and
, we find
The constant approximation
is first-order-accurate in the central cell, while the linear and quadratic interpolations,
and
, are both second-order-accurate. These results are a direct consequence of the fact that the three height function values
,
, and
are second-order-accurate.
In place of the height function values, we can consider three consecutive values of the first derivative and of the curvature, both of them defined in Equation (
3), to recompute the coefficients
a,
b, and
c of the polynomial approximations. For the first derivative, we find
and for the curvature
where
. For both geometrical properties, we find again that the constant approximation is first-order-accurate, while the linear and quadratic approximations are second-order-accurate.
2.2. The Discrete Height Function
In a computational domain in two dimensions, partitioned with square cells of side
h, the volume fraction field
C is initialized with the new version of the
Vofi library [
26], which requires a user-defined function
. The interface is described by the implicit equation
and points inside the reference phase satisfy
, while
in the secondary phase. The library computes the interface intersections with the grid lines and in each cut cell performs, where required, a 1D Gauss–Legendre integration with a variable number of nodes to calculate the area between the interface line and the cell boundary. The new version optimizes the algorithms described in [
27] while introducing a few new features as well. The volume fraction distribution in a
block of square cells is shown in
Figure 1a.
A grid cell
cut by the interface will have
; then the discrete height
H can be calculated with a one-dimensional (1D) stencil by adding the
C data columnwise, along the
y direction, or rowwise, along the
x direction. Let us consider only the vertical direction, where the interface line can be locally written in the explicit form
. Then,
For the volume fraction distribution of
Figure 1a, three vertical heights can be computed, as shown in
Figure 1b.
In the standard height function method (SHF), a fixed value of n is used; then, the 1D stencil will have 5 cells for and 7 cells for . The height point H is centered in the i-th column, but it is not necessarily inside the cell . Furthermore, it is not guaranteed that the interface line crosses the entire column within the stencil, or there can be more than one interface section in the given stencil. This second situation may happen in the case of complex topologies, such as droplet merging or filament breakup.
The generalized height function method (GHF) considers an adaptive 1D stencil [
5], centered on the mixed cell
and with a maximum length of
cells. The algorithm is dynamical, and the summation in (
13) stops as soon as a full cell,
, and an empty one,
, are found on opposite sides of the stencil. We usually consider a stencil with
cells; then the height in the first two cases of
Figure 3 is correctly computed, but not in
Figure 3c as the stencil is not wide enough. However, in
Figure 3c, the height can be computed along the
x coordinate direction. In
Figure 3d, there is an empty cell between the two interface sections, and the GHF method is capable of computing the two local heights; this is not the case for the SHF method. If the two sections approach each other even more and the empty cell disappears, both methods fail to provide an adequate height function value.
The height H is stored as an offset from the cell center, together with a positive integer flag to indicate if the height is measured from the top or the bottom of the cell. Therefore, when we collect the heights to compute the interface geometrical properties, we need to normalize their value to a common base of the central column before computing the numerical derivatives. In the mixed cells with no height, the integer flag is set to a negative value to indicate that an interpolation of the local geometrical data is required in that cell.
At small grid resolutions, it is not always possible to collect three consecutive values of the height function that have been computed along the same coordinate direction. In that case, we can combine discrete heights computed columnwise and rowwise. This part of the algorithm has been discussed in [
22]. In this study, we investigate only the asymptotic behavior of the height function method. In the present implementation of the algorithm, a first sweep across the computational domain is required to compute the discrete heights with Equation (
13); then, a second sweep is performed to numerically calculate the geometrical properties of the interface with Equation (
3). This procedure is similar to what has been implemented in other numerical codes. However, the geometrical data are no longer local, but need to be stored in matrices, and with a third sweep are interpolated where necessary with the polynomials of Equations (
11) and (
12), after the evaluation of the interface intersections with the grid lines using Equation (
9).
4. Conclusions
In this study, we considered the height function (HF) method for the representation of an interface line and the calculation of its geometrical properties. We proposed a numerical algorithm that removes the inconsistency between the theoretical and numerical results presented in many papers: the HF method is observed to have first-order convergence with grid refinement while theoretical results indicate second-order convergence. The HF method integrates the volume fraction (VOF) field along a column of grid cells of a Cartesian grid and provides a smoother field to be differentiated with finite differences. We chose the generalized height function (GHF) approach, which considers an adaptive stencil for the VOF function integration, over the standard height function (SHF) approach, which considers a fixed stencil, because it computes more accurate heights, in particular in high-curvature regions.
With the HF values from three consecutive columns of cells along the same coordinate direction and centered finite differences, the first and second derivatives of the interface line can be computed with second-order convergence with grid refinement. The unit normal and the curvature are then calculated along the column midline from these two derivatives. The interface line can intersect more than one cell in a given column of a Cartesian grid. When this happens, the interface geometrical properties have to be interpolated in the cut cells from the value in the column midline. We considered three polynomials that corresponded to constant, linear, and quadratic approximations of the interface line inside the column, respectively. The constant approximation is the most widely used approximation and provides first-order convergence, while the linear and quadratic approximations provide second-order convergence.
Finally, we considered an interface line in a uniform Cartesian grid. The interface is described by differentiable parametric equations and is characterized by a curvature changing both in magnitude and sign. The numerical results are in agreement with the theory presented.
The HF method has been extended to three dimensions [
5,
28]. If the interface section in a column is shared by two consecutive cubic cells, the two midpoints
and
of
Figure 2b in 2D become the barycenters of two interface subsections. Expressions for the barycenter coordinates have been derived for a linear interface cutting a cubic cell [
12]; this task becomes much more complicated for a quadratic interface and probably will require some approximations. Therefore, the linear interpolation should be considered in practice, as it provides second-order convergence with grid refinement at a lower computational cost. We believe that this algorithm may enhance robustness and limit phase break-up caused by improper surface tension evaluation in small structures. We plan to test this numerical algorithm in three dimensions and implement it in dynamic codes to evaluate its robustness.