6.1. Generalization Test on a Sinusoidal Surface
To evaluate the generalization of the model, we conducted predictions on a 3D sinusoidal surface, as illustrated in
Figure 14. The surface was defined by
. The surrounding space was voxelized (generating a tetrahedral mesh) with a constant discretization of
. Graphs were then generated within each of these voxels, with each voxel containing the center point of a graph, and its neighboring voxels containing other nodes of the same graph. Therefore, a voxel can act as both a container for a center point and a neighbor point.
The maximum absolute nondimensionalized curvature of the test surface was
, falling within the range of the training dataset (
). With the volume fraction in the range
, each interface cell was then input to the model, while interface cells with very high or low volume fractions were filtered out, as we considered these to be outside the range of applicability for our model.
Figure 15 displays the errors of the prediction for the four variables and their corresponding histograms. The errors for each variable are defined in
Table 7. It is observed that errors do not exhibit a clear correlation with the geometry for any variable. The histograms display a unimodal shape, and no abnormal behavior is observed.
Table 7 also presents the median error values.
The test surface utilized in this study exhibited a nonuniform distribution about
, as depicted in
Figure 16. A higher concentration of samples is observed at
values close to 0 and 1, referred to as “marginal
”. This uneven distribution may impact the prediction results. In
Figure 16, the prediction is compared to the label and colored by
. Notably, cases with marginal
values exhibit larger errors. For instances with small marginal
, the model tends to predict values smaller than the label, whereas it tends to predict larger values for instances with large marginal
. This influence of
was not observed in the test case during training, where
was quasi-uniform. This suggests limited capacity of the model for marginal
, and should be taken into consideration when implementing the model in a real CFD solver and applying it to real-world use cases.
6.2. Validation Simulating a Two-Phase Flow Model with OpenFOAM
To validate our approach, we implemented our methodology in OpenFOAM (“Open-source Field Operation And Manipulation”), the C++ toolbox for the development of customized numerical solvers in computational fluid dynamics (CFD). We extended the IsoAdvector solver of OpenFOAM described in Roenby et al. [
14] with the implemented geometrical interface reconstruction method, denoted
IsoAlpha. To compute the geometrical features of interfaces, we introduced a new reconstruction method, denoted
IsoAlphaML, based on the GNN model described in
Section 3.
We benchmarked the two methods using a 3D study case inspired by the original 2D rising bubble study case published in 2009 by Hysing et al. [
20]. This study case involves simulating a two-phase flow within a cylindrical domain. The simulation domain is discretized with a tetrahedral mesh using the open-source GMSH tool presented in Geuzaine and Remacle [
21]. Three meshes,
,
, and
, are built. The original mesh
of size
is refined twice to obtain
of size
and
of size
. The primary goal of this study is to assess the impact of the mesh discretization size on the finite volume schemes employed across various models. Additionally, we seek to illustrate the performance of our method with different mesh sizes. Notably, as the grid cell size diminishes, the relative curvature of interfaces tends to decrease to lower values after normalization to the reference root cell of unit size. This significant reduction may trigger the emergence of unexpected phenomena.
The two phases are modeled as Fluid1 and Fluid2 with their specific dynamical properties (density and viscosity). Initially, the entire domain is occupied by Fluid1 except for the inside of a spherical bubble occupied by Fluid2. We impose boundary conditions as described in
Figure 17.
We denote the height of the domain by L and the radius of the initial spherical bubble by . We performed different simulations with a constant advected velocity along the z-axis imposed within the domain and with a surface tension coefficient denoted . These simulations can be classified and characterized by the scaling factors , , where is the gravitational velocity, the Reynolds number describes the ratio of inertial to viscous effects, and the Eötvös number describes the ratio of gravitational forces to surface tension effects.
The surface tension force plays a crucial role in these models, making its correct discretization necessary for achieving accurate simulation results. As seen in
Section 2, computation of the surface tension force based on the continuous surface force model (
2) relies on approximation of the mean curvature
. We compared our
IsoAlphaML approach, where
M is predicted with our GNN-based model, to the
IsoAlpha method, where
M is computed by discretizing Equations (
5) with a finite volume scheme, as explained in
Section 2.
The study case was designed in three progressive test cases:
Test-1: The Stationary Droplet test case, in which Fluid1 and Fluid2 have the same dynamic properties and . Nothing should happen. This test case aims to detect residual streams that may appear due to errors in the curvature computation.
Test-2: The Translating Droplet test case, in which the two fluids have the same properties. The imposed velocity is different from 0. The bubble should be translated without deformation.
Test-3: The Original 3D Hysing test case, in which the properties of the fluids are different. Fluid1 represents the liquid phase, while Fluid2 represents the gas phase. No velocity is imposed, and . The bubble is supposed to rise with the gravity effects. The bubble is deformed under the effect of surface tension at the gas–liquid interface, which depends on the interface curvature.
In
Table 8, we gather the fluids properties and simulation parameters of these three test-cases.
We first explore the distribution of the volume fraction generated by the OpenFOAM simulations to check whether it conforms to one of the datasets used to train our GNN model.
Figure 18 shows the histogram of the volume fraction
of the diphasic cells computed during the simulation of Test-1 on the left, while the right shows the histogram of the predicted normal error
on the spherical interface regarding the expected normal values, which can be easily computed. We can observe that many samples are found in the “marginal
” range. The distribution of the
is mono-modal and its peak is located near its median. These tendencies are similar to those observed in the previous generalization sinusoidal test case.
Figure 19 compares the evolution of bubble circularity over time for each test case when using the
IsoAlphaML method and the
IsoAlpha method. The similarity of the curves at first glance indicates that the simulation results are very similar. As expected, the bubble circularity does not change over time for Test-1 and Test-2. In Test-3, the evolution of bubble circularity using the two methods is very similar.
To better analyze the difference between the mean curvature computation of the two methods, we focus on the results of Test-1. In this test, the droplet should remain stationary. The mean curvature should also remain constant and equal to the reference value
, where
R denotes the initial radius of the droplet. We have introduced two variants
and
of the previous methods, setting the mean curvature to the reference value
. The reference normal value of the interface in each diphasic voxel is also easy to evaluate using the voxel center and the stationary droplet center. We evaluate the errors in the curvature computation and use the fact that these errors impact the value of the surface tension force, which leads to the appearance of nonzero residual velocities. Then, computing the overall kinetic energy is a simple way to evaluate the accuracy of the curvature computation method. The errors regarding the reference solution of the two approaches
IsoAlphaML and
IsoAlpha are gathered in
Table 9. The histogram of curvature values, the normal and curvature errors are plotted in
Figure 20 and
Figure 21.
Figure 22 plots the time evolution of the global residual kinetic energy for the
IsoAlphaML and the
IsoAlpha methods along with their variants
and
. As expected, we see that the kinetic energy of the
and
simulations remains very low. For
IsoAlphaML and
IsoAlpha, the kinetic energy increases with time, highlighting the effect of the curvature error on the surface tension computations. For the simulation with
and
, this effect is less important for the
IsoAlphaML method than for the original
IsoAlpha method, while for the simulation with
the effect is inverted.
The errors of our GNN-based approach are reasonable. Similar to the previous generalization sinusoidal test, the results prove the capability of our method to generalize on unseen surfaces. This makes the proposed method interesting in the context of real CFD simulations, where complex unstructured meshes are required.
Notably, our approach outperforms the IsoAlpha method on both variables.