High-Order Finite-Element Framework for the Efficient Simulation of Multifluid Flows

In this paper, we present a comprehensive framework for the simulation of multifluid flows based on the implicit level-set representation of interfaces and on an efficient solving strategy of the Navier-Stokes equations. The mathematical framework relies on a modular coupling approach between the level-set advection and the fluid equations. The space discretization is performed with possibly high-order stable finite elements while the time discretization features implicit Backward Differentation Formulae of arbitrary order. This framework has been implemented within the FEEL++ library, and features seamless distributed parallelism with fast assembly procedures for the algebraic systems and efficient preconditioning strategies for their resolution. We also present simulation results for a three-dimensional multifluid benchmark, and highlight the importance of using high-order finite elements for the level-set discretization for problems involving the geometry of the interfaces, such as the curvature or its derivatives.


Introduction
Understanding and predicting the dynamics of systems consisting of multiple immiscible fluids in contact is a great challenge for numerical computations, as they involve bulk coupling of the fluids-related to the long-range features of the Navier-Stokes equations-and possible strong surface effects.
Such interfaces arise in a variety of applications in physics and engineering.For instance, the dynamics of drops immersed in another fluid [1], shocks in high-speed flows of aerospace interest [2], vortex sheets in wakes [3] or at the boundaries between immiscible fluids in engineering applications [4].A lot of effort has been thus recently put in the development of efficient numerical methods to solve these strongly coupled fluid problems while tracking the interfaces to accurately resolve the surface effects.
One of the main difficulties of these multifluid simulations is to keep track of the interfaces between the fluids as they evolve in time, as well as to characterize accurately their geometry.Two main approaches are typically used to account for the interface changes.In the first one, the interface is tracked explicitely with a moving mesh.This large class of "front-tracking" methods-which embrace, for example, the Arbitrary Lagrangian-Eulerian (ALE [5]), the Fat Boundary Method (FBM, [6])-feature a very accurate description of the contact surface, but at high computational costs.The second approach uses only a fixed mesh, and represents the interface implicitly with some additional field.For example, this is the approach used by the Volume Of Fluid (VOF [7]), the Phase-Field method [8,9] and the Level-Set method (LS [10]).These methods in general provide easier coupling formulations and smaller algebraic problems but with less accuracy regarding the description of the interface.
In this work, we present a level-set based framework for the simulation of generic multifluid flows.It features efficient solving strategies for the fluid-incompressible Navier-Stokes (or Stokes)equations and the level-set advection.This framework is implemented using the open-source FEEL++ library-Finite Element Embedded Library in C++ (v0.104.1,Feel++ Consortium, Strasbourg, France)- [11][12][13] within the FluidMechanics, AdvectionDiffusionReaction, LevelSet and MultiFluid toolboxes.
These toolboxes expose user-friendly interfaces and allow versatile parametrization of the problems and solving strategies while managing the parallel assembly of the finite-element algebraic systems and their resolution seamlessly.
We also present a 3D benchmark for our toolboxes.This numerical experiment is an extension of the classic rise of a drop in a viscous fluid in 2D.We use two different setups and compare our results with other approaches to validate our framework.
We stress that all the implementations and testcases presented below are freely available [14,15] and can be used for a large class of fluid-structure interaction and suspension problems.

Simulating Multifluid Flows
We consider a system consisiting of several non-miscible fluids with different physical properties occupying some domain Ω.We denote Ω i ⊂ Ω (Ω = i Ω i ) the domain occupied by the ith fluid.We want to study the dynamics of such a system, which means both solving for the motion of the fluids and tracking each fluid subdomain as it evolves in time.

Fluid Equations
In this work, we assume that all the considered fluids are incompressible, and thus obey the incompressible Navier-Stokes equations where u and p are respectively the velocity and pressure fields, ρ is the fluid density, σ is the fluid stress tensor and f b , f s are the bulk and surface forces respectively.We consider in the following Newtonian fluids, so that with µ the fluid viscosity and D( u) = 1 2 ∇ u + ∇ u T is the rate of strain tensor of the fluid.Note that these equations are satisfied for each fluid independently.In a multifluid system, they must be supplemented with boundary conditions for the velocity and pressure at both the domain boundary and at the interface between two fluids.In this work, we assume that there is no slip at the interfaces, so that the velocity and pressure fields are continuous at all the interfaces.The boundary conditions at the domain boundaries can be Dirichlet or Neumann:

Interface Tracking: The Level-Set Method
Let us consider two disjoint-not necessarily connected-fluid domains Ω i , Ω j ⊂ Ω such that ∂Ω i ∩ ∂Ω j = ∅, and denote Γ ij the interface between them.In order to efficiently track this interface Γ ij (t) as it evolves in time, we use the level set method [10,16,17] which provides a natural way to compute geometrical properties of the interface and to handle possible topological changes in a completely Eulerian framework.
It features a Lipschitz continuous scalar function φ (the level set function) defined on the whole domain.This function is arbitrarily chosen to be positive in Ω i , negative in Ω j and zero on Γ ij , so that the interface is implicitely represented by the 0-level of φ.
As Ω i and Ω j evolve following the Navier-Stokes Equation (2) dynamics, Γ ij gets transported by the velocity field u (uniquely defined at the interface by assumption and construction) and therefore obeys the advection equation: We choose as level set function the signed distance to the interface as the intrinsic property |∇φ| = 1-which is characteristic of the Euclidean distance for all points x such that arg min x 0 ∈Γ ij | x − x 0 | is a unit set-eases the numerical resolution of the advection equation by ensuring that no steep gradients are present.Furthermore, the regularity of the distance function allows us to use φ as a support for the regularized interface Dirac and Heaviside functions (see below).
However, the advection Equation ( 5) does not preserve the property |∇φ| = 1, and can lead to the accumulation or rarefaction of φ iso-levels depending on the velocity.It is therefore necessary to enforce the condition |∇φ| = 1 externally, and to reset φ(t) to a distance function without moving the interface, Refs.[18][19][20].To redistantiate φ(t), we can either solve a Hamilton-Jacobi equation, which "transports" iteratively the isolines of φ depending on the sign of |∇φ| − 1 until the steady "distance" solution is attained, or use the fast marching method, which computes the actual distance to the interface for each degree of freedom using an upwind O(N log N) scheme starting from the interface.We provide further details about our numerical implementation below (c.f.Section 3.5.3).
As mentioned above, the signed distance to the interface φ allows us to easily define the regularized interface-related Dirac and Heaviside functions which can be used to compute integrals on the interface [21,22] or on a fluid subdomain where ε is a parameter controlling the "numerical thickness" of the interface.We note in these definitions that enforcing |∇φ(t)| = 1 is critical to ensure that the interfacial support of δ ε and H ε is kept constant and larger than the mesh size.Typically, we choose ε to scale with the mesh size as ε ∼ 1.5 h, where h the average mesh size.The Heaviside function is used to define physical quantities which have different values on each subdomain.For example, we define the density and viscosity of two-fluid flows as The delta function allows to define quantities on the interface using non-conform meshes.In particular in the variational formulations we can replace integrals over the interface Γ with integrals over the entire domain Ω using the regularized delta function: if φ is a signed distance function (i.e., |∇φ| = 1), we have Γ 1 Ω δ ε (φ).
In the following, we consider without loss of generality only the two-fluid case, with only one level set function tracking the interface between fluids 1 and 2.

Finite Element Formulation
We use finite elements methods to solve Equations ( 2) and ( 5), and work with a continous Galerkin formulation.As mentioned above, this can be done by smoothing the discontinuities of the fluid parameters (e.g., the fluid density and viscosity) at the interfaces using the regularized Dirac and Heaviside functions Equations (7) and (8).The continuity of the velocity and pressure fields is then imposed strongly in the formulation, and we can work with function spaces defined on the whole domain Ω.
We introduce L 2 (Ω) the usual function space of square integrable functions, H 1 (Ω) the function space of square integrable functions which gradients are also square integrable and the vectorial Sobolev spaces H 1 The variational formulation of the two-fluid coupling problem Equations ( 2) and ( 5) then reads where we have integrated by parts the stress tensor term and used the Neumann boundary condition in Equation (4).The surface force term Ω f s • v is here generically written as a bulk integral, the surfacic aspect being hidden in the force expression f s (φ) which in general contains some Dirac distribution δ(φ).In our case, the surface forces actually account for the interfacial forces between the two fluids (i.e., the surface tension), so that the surface integral can be evaluated as a bulk integral using the regularized level set delta function.

The FEEL++ Toolboxes
The numerical implementation is performed using the FEEL++-finite element C++ library [11][12][13], which provides a comprehensive finite-element framework for performing HPC resolution of generic problems.FEEL++ allows to use a very wide range of Galerkin methods and advanced numerical methods such as domain decomposition methods including mortar and three fields methods, fictitious domain methods or certified reduced basis.It features a very expressive domain specific embedded language, and powerful localization techniques used for interpolation and mixed spaces integration.It also provides automatic and efficient assembly of the algebraic systems, as well as seamless parallelization.The FEEL++ library has been used in many contexts ranging from the development and numerical verification of innovative mathematical methods to the simulation of large multi-physics systems [23][24][25].
The FEEL++ mathematical kernel can be used to solve linear and nonlinear partial differential equation using arbitrary order Galerkin methods (FEM, SEM, CG, DG, HDG, CRB).It naturally handles 1D, 2D, 3D manifolds using simplices and hypercubes meshes [11][12][13]26] and provides in particular: i a polynomial library allowing for a wide range of polynomial expansions including H div and H curl elements, ii a lightweight interface to BOOST.UBLAS, EIGEN3 and PETSC/SLEPC iii a scalable in-house solution strategy, in particular with specialized preconditioners which can easily be tuned from the configuration files iv a natural language for Galerkin methods allowing the definition of function spaces, (bi)linear forms, operators, functionals and integrals, v a framework that allows user codes to scale seamlessly from single core computation to thousands of cores and enables hybrid computing.
FEEL++ provides also an environment for modeling and solving various kinds of scientific and engineering problems.The framework, implemented in several FEEL++ toolboxes, provides a language to describe these models.Based on JSON and INI(we use the .cfgextension) file formats, it is possible to configure and simulate a large class of models by defining the relevant physical quantities-such as the material properties, the boundary conditions, the sources, the couplings and the solvers.In this paper, we focus on the MultiFluid toolbox which allows to setup all the necessary ingredients for a multifluid flow simulation.This toolbox, which mainly manages the coupling between the fluids present in the system, is built on others toolboxes inclined toward monophysics problem resolution, namely the FluidMechanics, LevelSet and AdvectionDiffusionReaction toolboxes.

Fluid-Interface Coupling
The coupling between the fluid and the level-set in Equations ( 9)-( 11) is highly nonlinear and solving these equations monolithically would require specific nonlinear solvers adapted to each particular coupling force f s (φ).In order to ease the implementation and development processes, and to benefit from efficient solving strategies, we choose an explicit-non-monolithic-coupling in our numerical approach.
At each time step, we first solve the fluid equations using the physical parameters and the surface forces computed from the last-step level-set function.We then use the obtained fluid velocity to advect the level-set and get the new interface position.We can then apply some redistantiation procedure depending on the chosen strategy before proceeding to the next iteration.
The fluid-level-set coupling algorithm then writes φ n+1 ← solve level-set; possibly redistantiate φ n+1 ; end Note that the successive resolution of the fluid and level-set equations can also be iterated within one time step, until a fix point of the system of equations is reached.In practice however, for reasonably small time steps, the fix-point solution is already obtained after the first iteration.

Space/Time Discretization
We introduce T h ≡ {K e , 1 ≤ e ≤ N elt } a compatible tessellation of the domain Ω, and denote e=1 K e the discrete-unstructured-mesh associated with average mesh size h.We work within the continuous Galerkin variational formulation framework, and use Lagrange finite elements to spatially discretize and solve the equations governing the evolutions of the fluid and the level-set.We thus introduce P k h ≡ P k h (Ω h ) the discrete (h-dependent) finite element space spanned by Lagrange polynomials of order k.
Then, from the time interval [0, T], we select M + 1 equidistributed times: {t i = i δt, 0 ≤ i ≤ M}, where δt is the time step.In the Navier-Stokes and level-set advection equations, we apply a fully implicit time discretization by using a backward differentiation formula of arbitrary order N named BDF N .Let φ be a function and denote φ (i) the function at time t i .The time derivative of this function is then discretized as where the α i are BDF N coefficients.In the numerical benchmarks reported below, we used the BDF 1 and BDF 2 schemes, which write respectively

Solving the Incompressible Navier-Stokes Equations
The spatial discretization of the Navier-Stokes equations is handled via a inf-sup stable finite element (Taylor-Hood) [P k+1 h ] d -P k h , see e.g., [27].We define V h and Q h the discrete function spaces where we search the velocity and the pressure solutions respectively.They are given by: We need also to introduce the test function space on the velocity with Hereafter we consider the case k = 1.The discrete weak formulation associated to Equations ( 9) and ( 10) reads: The nonlinear problem presented by Equation ( 15) is solved monolithically with Newton's method.From an algebraic point of view, at each nonlinear iteration, the following classical saddle-point system is inverted A B C 0 where A corresponds to the velocity block and B, C to the velocity/pressure coupling.This system is solved with a GMRES algorithm using the SIMPLE preconditioner, see [27].
In the benchmark presented in the next section, we have only Dirichlet boundary conditions defined on the whole boundary of the domain (i.e., ∂Ω N ≡ ∅).In this case, the problem represented by the weak formulation (15) is not well-posed as the pressure is defined up to a constant.To solve this issue, our strategy consists to 1. add the information to the Krylov subspace method (GMRES) that the system has a null space, i.e., the pressure constant.2. rescale the pressure solution after each iteration of the Newton algorithm by imposing a mean pressure equal to 0.
Another solution available in the FluidMechanics toolbox is to add a Lagrange multiplier in order to impose the mean value of the pressure.The disadvantages of this approach are to increase the stencil of the matrix and to make its block structure much denser.This implies a reduction in the efficiency of the solver.

Level-Set Advection
As mentioned above, the transport of the level-set by the fluid is accounted by the advection equation Equation (11) in variational form.This equation is discretized in time using a backward differentiation formula (BDF N ) and space discretization is performed using the P k h discrete spaces introduced above.However, as is well-known for central differencing schemes in hyperbolic partial differential equations, the naive Galerkin discretization of Equation ( 11) on P k h can lead to spurious oscillatory instabilities.To circumvent this well-known problem, we stabilize the discrete advection equation.Four different stabilization methods are supported in our framework: the Streamline Upwind Petrov-Galerkin (SUPG, [28]), the Galerkin Least Squares (GLS, [29,30]), the Sub-Grid Scale (SGS, [31]) and the Continuous Interior Penalty (CIP, [32]) methods.Detailed description of these methods can be found in [33][34][35].It should be noted that the CIP stabilization is much more costly than the three others, as it densifies the corresponding algebraic system, and requires larger stencils and thus larger connectivity tables.
In the benchmarks, we used the GLS stabilization method, introducing the bilinear form with L[φ] = α 0 δt φ + u • ∇φ, τ a coefficient chosen to adjust the stabilization to the local advection strength.The choice for the parameter τ was extensively discussed, in particular for the case of advection-diffusion-reaction (c.f.[31,36,37]), and we provide several of them in our AdvectionDiffusionReaction toolbox.However, for the specific case of pure transient advection, which can also be seen as an advection-reaction equation after time discretization, we use the simple expression In summary, the discrete FEM we solve for the level-set at time t + δt given the values at previous times is where S φ (n+1) , ψ; u (n+1) , {φ (i) } i≤n is the SUPG, GLS, SGS or CIP stabilization bilinear, which vanishes as h → 0 and in the three first cases involves the previous time steps to ensure consistency of the stabilized equation with its continuous version.
The assembly is performed in parallel with automatic choice of the appropriate quadrature order and seamless inter-process communication management.
The linear system is then solved using the PETSc library [38] with a GMRES solver preconditioned with an additive Schwartz Method (GASM [39]).

Geometrical Quantities
In many physical situations, the immersed structures play an active role in the dynamics of the whole system through the surface forces exerted by their "membranes" on the fluid.These forces can most of the time be computed from the geometry of the surface as they can be related to deformations of the interface.The level-set description of interfaces is very convenient when it comes to the computation of the geometrical parameters required in the interface forces.As an example, the normal and curvature of the surface can naturally be obtained from φ as These quantities are defined on the whole domain in an Eulerian way, and can therefore naturally be used in surface integrals as introduced in Equation (9).
To compute such derivatives of fields, we use projection operators in order to work with fields still in P k h .To this end, we introduce the L 2 projection operator Π k L 2 and the smoothing projection operator Π k sm , defined respectively as and with ε a-small-smoothing parameter typically chosen as ε ≈ 0.03 h/k.These projection operators can be defined for both scalar and vector fields in the same way by using the appropriate contractions.Note that the smoothing projection operator introduces some artificial diffusion which is controlled by ε.This diffusion is reponsible for the smoothing of the projected field, but can also introduce artefacts in the computation, so that ε needs to be carefully chosen depending on the simulation.In practice, the smoothing operator Π k sm is used to compute derivatives of order ≥ k + 1 of fields in P k h , as such order of derivation are subject to noise.The projection operators are implemented by the Projector class, which optimizes the assembly of the algebraic systems corresponding to Equations ( 21) and ( 22) by storing the constant terms-such as the mass matrix for example-to prevent unnecessary computations at each projection.We usually also store the preconditioner of the system for reuse.
The projection linear systems are solved using PETSc's GMRES solver with a GASM preconditioning method.
In the benchmarks below, we used n = Π 1 for higher order ones.

Redistantiation
As mentioned above, as the level-set is advected by the fluid, it loses its "distance" property, i.e., |∇φ| = 1 is not in general preserved by the advection equation.Therefore, to ensure numerical stability and prevent accumulation or rarefaction of the level-set iso-lines which support the regularized Dirac and Heaviside functions, one needs to redistantiate the level-set, i.e., recover a signed distance function to {φ = 0}.Too main approaches can be used: the first one relies on a efficient direct computation of the distance using the well-known "fast-marching algorithm" [20], while the second consists in solving an Hamilton-Jacobi equation [18,19] which steady state enforces |∇φ| = 1.Both methods are implemented in our framework; we provide some details in the following.
The fast-marching method is an efficient algorithm to solve the Eikonal equation in general, with an algorithmic complexity of O N do f log(N do f ) .It uses the upwind nature of this equation to "march" away from the 0-iso-level to the rest of the domain, hence the Dijkstra-like complexity.
Our implementation of the fast-marching algorithm is based on [35], and therefore strongly relies on φ being a P 1 h field.If the level-set is of order k > 1, we can still perform the fast-marching redistantiation using a P 1 iso space as proposed in [40].This order-1 Lagrange function space is constructed on a mesh obtained by replacing all the P k h degrees of freedom by nodes.The P 1 iso hence has the same number of degrees of freedom than the original P k h one.We can then project φ k ∈ P k h onto φ 1 iso ∈ P 1 iso , perform the fast-marching on φ 1 iso , and project back.The Hamilton-Jacobi method follows a different approach, and works directly within the finite-element framework.It consists in solving an Hamilton-Jacobi-like equation which steady states is a signed distance function, namely The sign(φ) term anchors the position of {φ = 0}, and ensures that the redistantiation front gets transported from this 0-iso-level, inward or outward depending on the initial sign of φ.In practice, this equation is discretized using the advection framework introduced above as with sign(φ (0) ) ≡ 2 H (φ (0) ) − 1 2 and S φ (n+1) a stabilization bilinear form.This equation is usually solved for a few iterations with δτ ∼ h.The main advantage of the Hamilton-Jacobi approach is that it can be used straigthforwardly for high-order level-set functions.However, it is in general slower than the fast-marching method, and numerical errors can quickly accumulate and lead to spurious motion of the interface resulting in strong loss of mass of the {φ ≤ 0} domain.To avoid these pitfalls, the number of iterations and the pseudo time-step δτ must be carefully chosen, which is not an easy task in general.

3D Rising Drops Benchmark
We now present a 3D benchmark of our numerical approach, using the Navier-Stokes solver developed with the FEEL++ library described in [41].This benchmark is a three-dimensional extension of the 2D benchmark introduced in [42] and realised using FEEL++ in [43].The setup for this benchmark was also used in [44] to compare several flow solvers.

Benchmark Problem
The benchmark consists in simulating the rise of a 3D drop in a Newtonian fluid.The equations solved are the aforementioned coupled incompressible Navier Stokes equations for the fluid and advection equation for the level set Equations ( 9)-( 11) with f b and f s respectively the gravitational and surface tension forces, defined as: with g ≡ −0.98 e z the gravity acceleration and σ the surface tension.
We consider Ω a cylinder with radius R = 0.5 and height H = 2, filled with a fluid and containing a droplet of another imiscible fluid.We denote Ω 1 = { x, s.t.φ( x) > 0} the domain outside the droplet, Ω 2 = { x, s.t.φ( x) < 0} the domain inside the drop and Γ = { x, s.t.φ( x) = 0} the interface.We impose no-slip boundary conditions u ∂Ω = 0 on Ω walls.The simulation is run from t = 0 to 3.
Initially, the drop is spherical with radius r 0 = 0.25 and is centered on the point (0.5, 0.5, 0.5) assuming that the bottom disk of the Ω cylinder is centered at the origin.Figure 1 shows this initial setup.We denote with indices 1 and 2 the quantities relative to the fluid in respectively Ω 1 and Ω 2 .The parameters of the benchmark are then ρ 1 , ρ 2 , µ 1 , µ 2 and σ.We also define two dimensionless numbers to characterize the flow: the Reynolds number which is the ratio between inertial and viscous terms and is defined as and the Eötvös number represents the ratio between the gravity force and the surface tension Table 1 reports the values of the parameters used for two different test cases proposed in [44].At t = 3, the first one leads to an ellipsoidal-shaped drop while the second one gives a skirted shape due to the larger density and viscosity contrasts between the inner and outer fluids.To quantify our simulation results, we use three quantities characterizing the shape of the drop at each time-step: the center-of-mass the rising velocity-focusing on the vertical component and the sphericity-defined as the ratio between the area of a sphere with same volume and the area of the drop- |Γ| .
Note that in the previous formulae, we have used the usual "mass" and area of the drop, respectively defined as |Ω 2 | = Ω 2 1 and |Γ| = Γ 1.

Simulation Setup
The simulations have been performed on the supercomputer of the Grenoble CIMENT HPC center up to 192 processors.To control the convergence of our numerical schemes, the simulations have been run with several unstructured meshes, which characteristics are summarized in Table 2.
We run the simulations looking for solutions in finite element spaces spanned by Lagrange polynomials of order (2, 1, k) for respectively the velocity, the pressure and the level set.The corresponding numbers of degrees of freedom for each mesh size are reported in Table 2 and the numerical parameters used for the simulations are provided in Table 3.The Navier-Stokes equations are solved using Newton's method and the resulting linear system is solved with a preconditioned flexible Krylov GMRES method using the SIMPLE preconditioner introduced in [45].The inner "inversions" of the velocity block matrix are performed using a block Jacobi preconditioner, with an algebraic multigrid (GAMG) preconditioner for each velocity component block.Note that these velocity block inversions are only preconditioned-without any KSP iteration.The nested Schur complement "inversion" required for SIMPLE is solved with a few iterations of GMRES preconditioned with an algebraic multigrid (GAMG).
The linear advection equation is solved with a Krylov GMRES method, preconditioned with an Additive Schwarz Method (GASM) using a direct LU method as sub-preconditionner.

Results
In this section, we analyze the simulations of the rising drop for the two cases with low-order-k = 1-Sections 5.1 and 5.2 and high-order-k = 2-Section 5.3 level set discretization space.Except for the comparison between the fast-marching and the Hamilton-Jacobi methods Section 5.1.1,the level set redistantiations were performed with the fast-marching method every 10 time-steps.

Case 1: The Ellipsoidal Drop
Figure 2a shows the shape of the drop in the x-z plane at the final t = 3 time step for the different aforementioned mesh sizes.The shapes are similar and seem to converge when the mesh size is decreasing.The drop reaches a stationary circularity as shown in Figure 2d, and its topology does not change.The velocity increases until it attains a constant value.Figure 2c shows the results obtained for the different mesh sizes.The evolution of the mass of the drop versus time is shown in Figure 2e.It highlights the rather good mass conservation property of our simulation setup, as about 3% of the mass is at most lost for the coarsest mesh, while the finest one succeeds in keeping the loss in mass below 0.7%.
We also note that our simulation perfectly respects the symmetry of the problem and results in a axially symmetric final shape of the drop, as shown in Figure 3.

Comparison between Hamilton-Jacobi and Fast-Marching Reinitialization
As mentioned in Section 3.5.3,two reinitialization procedures can be used to overcome the "deformation" of the level set which becomes more and more different from the distance to the interface function as it is advected with the fluid velocity.The fast-marching method resets the values of φ on the degrees of freedom away from the interface to match the corresponding distance.The Hamilton-Jacobi method consists in solving an advection equation which steady solution is the wanted distance function.
We have run the h = 0.0175 simulation with both reinitialization methods to evaluate the properties of each one, and compare them using the monitored quantities.Figure 4 shows the respective shapes of the drop at final time (t = 3), and Figure 5 gives the obtained results.
The first observation is that the mass loss (see Figure 5e) is considerably reduced when using the FM method.It goes from about 18% mass lost between t = 0 and t = 3 for the Hamilton-Jacobi method to less than 2% for the fast-marching method.This resulting difference of size can be noticed in Figure 4.The other main difference is the sphericity of the drop.Figure 5d shows that when using the fast-marching method, the sphericity decreases really quickly and stabilises to a much lower value than the one obtained with the Hamilton-Jacobi method.This difference can be explained by the fact that the fast-marching method does not smooth the interface.The shape can then contain some small irregularities leading to a bad sphericity.Even so, with both methods the sphericity stays quite constant after the first second of the simulation.The rising velocity and the vertical position do not show any significant difference between the two reinitialization methods.Comparison between the Fast Marching method (FM) and the Hamilton-Jacobi (HJ) method for test case 1 (ellipsoidal drop).The characteristic mesh size is h = 0.0175.

Comparison with Previous Results
Figure 6 shows a plot of our results compared to the ones presented in [44].In this paper, the authors perform simulations on the same setup and with the same test cases as considered here.
To ensure consistency of their results, they use three different flow solvers (hence three different space discretization methods) coupled with two different interface capturing methods: the DROPS and NaSt3D solvers coupled to a level set approach, and the OpenFOAM solver which uses a volume-of-fluid method.
To evaluate the effect of the characteristic mesh size, we plot the results we obtained for the simulations run with both h = 0.025 and h = 0.0125 along with the results from [44].
We can observe an overall good agreement between our results and the benchmark performed in [44].Comparison between our results (denoted FEEL) and the ones from [44] for the test case 2 (the ellipsoidal drop).

Case 2: The Skirted Drop
In the second test case, the drop gets more deformed because of the lower surface tension and the higher viscosity and density contrasts.Figure 7 displays the monitored quantities for this test case.We observe that the shape of the "skirt" of the drop at t = 3 is quite strongly mesh dependent, but converges as the mesh is refined.The other characteristics of the drop are not so dependent on the mesh refinement, even for the geometrically related ones, such as the drop mass, which shows a really small estimation error (only 2% difference between the coarsest and finest meshes), and displays the really good conservation properties of our simulations.We again also note in Figure 8 the symmetry of the final shape of the drop, which highlights the really good symmetry conservation properties of our approach.

Comparison between Hamilton-Jacobi and Fast-Marching Reinitialization
As for the test case 1, we provide a comparison of the results for the test case 2 obtained using either the fast-marching or the Hamilton-Jacobi reinitialization method.The comparison is performed with an average mesh size (h = 0.0175).The obtained shapes are shown in Figure 9 and the results are given in Figure 10.As before, they highlight noticeable differences between the two methods for geometrically related quantities such as mass loss, sphericity and final shape.We can even observe a non-negligible difference for the latter in the region of the "skirt".This difference, mainly related to the diffusive properties of the Hamilton-Jacobi method, can also be observed on the 3D shapes in Figure 9.The good agreement of the results obtained using the fast-marching method tends to suggest that the Hamilton-Jacobi method is not accurate enough-or would require more careful and costly adjustment of its parameters-for this kind of three-dimensional simulation.Comparison between the Fast Marching method (FM) and the Hamilton-Jacobi (HJ) method for test case 2 (skirted drop).The characteristic mesh size is h = 0.0175.

Comparison with Previous Results
As in Section 5.1.2,we compare our results to the benchmark [44], and show the relevant quantities in Figure 11.We also observe a good agreement between our simulations and the ones from the benchmark.We however note that the final shape of the skirted drop is very sensitive to the mesh and none of the groups agree on the exact shape which can explain the differences that we see on the parameters in Figure 11 at time t > 2.

High-Order Simulations
As already mentioned, our framework naturally allows the use of high-order Galerkin discretization spaces.As an illustration, we present here benchmark simulation results performed using finite element spaces spanned by Lagrange polynomials of order (2, 1, 2) and (2, 1, 3) for each test case.The mesh size considered here is h = 0.02, and the results are shown in Figures 12 and 13 for test cases 1 and 2 respectively.We expect the increase in order of the level-set field to improve the overall accuracy.
We can indeed observe that the final shapes of high-order simulations look smoother in both cases, as confirmed by the sphericity plots.The effect is highly noticeable on the "skirt" which appears for the second test-case, which looks even smoother than the one obtained with the finest (h = 0.0125) (2, 1, 1) simulation.
Let us also highlight that the small differences observed with the (2, 1, 3) simulations, in particular for the final shapes, are most likely related to the absence of articifial diffusion error in the computation of geometrical quantities (especially for the curvature), which suggest more robust and realistic results for these simulations.
We can also notice that more "physically" controlled quantities, such as the position of the center-of-mass and the vertical velocity are less impacted by the polynomial order of the level-set component, which is not so surprising, as these quantities are mainly determined by the (level-set-dependent) fluid equations, which discretization orders where kept constant for this analysis.

Conclusions and Outlooks
We have presented in this paper a comprehensive numerical framework for the simulation of multifluid flows.This framework is based on level-set methods solved by a (possibly high-order) finite element method.The explicit coupling between the level-set and the fluid has proven to be efficient and has allowed us to take advantage of reliable and efficient preconditioning strategies to solve the fluid equations.
The framework has been implemented within the FEEL++ toolboxes and leverages the efficiency of the library to run on large numbers of processors in parallel.It also features user-friendly interfaces, and allows for easy model setup and parametrization using the JSON and CFG standard formats.The use of state-of-the-art metaprogramming techniques allows to seamlessly perform simulations in two or three dimension, and to increase the polynomial order of the finite elements.We highlight again that both the implementation and the benchmarks configuration files are open-source and available online [14,15].
The presented MultiFluid framework has been validated using a three-dimensional two-fluid numerical benchmark and achieved results in agreement with the simulations performed with other methods.
We have also compared two different level-set reinitialization procedures (the fast-marching and the Hamilton-Jacobi methods) and observed significantlty different behaviors, in particular the former is much better at mass conservation than the latter.
High-order simulations were performed to highlight the increased smoothness of the computed interfaces.High-order discretizations of the level-set function also greatly helps for the computation of geometrical quantities, such as the curvature of the interface.It avoids the need for artificial diffusion in the computation of such derivatives, which can be prove essential for accurate accounts of surface effects.In particular the (2, 1, 3) simulations which feature complete diffusion-free geometrical quantities suggest that increasing the order of the level-set discretization can be of great interest when seeking highly accurate results regarding shapes, or when physical forces involving high derivatives of the level-set field are present.
Further improving the accuracy of the level-set and related quantities using higher order and/or hybrid methods is still ongoing.
The framework presented and validated here provides the blocks for the simulation of complex fluids in complex geometries.The use of a high-order level-set method to track interfaces allows in particular the simulation of a large number of immersed vesicles or cells with implicit account of the surface forces at constant cost with respect to the number of particles.Its versatility shall be used in a near future to better understand the flow of blood cells in realistic vascular systems, or the dynamics of swimming droplets interacting with external surfactants.

Figure 1 .
Figure 1.Initial setup for the benchmark.
Shape at final time (t = 3) in the vertical x − z plane.z c center-of-mass vertical component.

Figure 3 .
Figure 3. Shape at final time in the x-z and y-z planes for test case 1 (h = 0.0125).
(a) Fast Marching method (b) Hamilton-Jacobi method

Figure 5 .
Figure 5.Comparison between the Fast Marching method (FM) and the Hamilton-Jacobi (HJ) method for test case 1 (ellipsoidal drop).The characteristic mesh size is h = 0.0175.

(
a) z c center-of-mass vertical component.

Figure 6 .
Figure 6.Comparison between our results (denoted FEEL) and the ones from[44] for the test case 2 (the ellipsoidal drop).
Shape at final time (t = 3) in the vertical x z plane.z c center-of-mass vertical component.

Figure 10 .
Figure10.Comparison between the Fast Marching method (FM) and the Hamilton-Jacobi (HJ) method for test case 2 (skirted drop).The characteristic mesh size is h = 0.0175.

Figure 11 .
Figure 11.Comparison between our results (denoted FEEL) and the ones from[44] for the test case 2 (the skirted drop).
Shape at final time (t = 3) in the vertical x − z plane.0 0.
(b) z c center-of-mass vertical component.

Table 1 .
Numerical parameters taken for the benchmarks.

Table 2 .
Mesh properties and degrees of freedom: mesh characteristic size, number of tetrahedra, number of points, number of order 1 degrees of freedom, number of order 2 degrees of freedom and total number of degrees of freedom of the simulation.

Table 3 .
Numerical parameters used for simulations and resulting simulation times for each test case.
Comparison between P 1 , P 2 h and P 3 h simulations for the ellipsoidal test case (h = 0.02).