A new scalar projection method presented for simulating incompressible flows with variable density is proposed. It reverses conventional projection algorithm by computing first the irrotational component of the velocity and then the pressure. The first phase of the projection is purely kinematics. The predicted velocity field is subjected to a discrete Hodge-Helmholtz decomposition. The second phase of upgrade of pressure from the density uses Stokes’ theorem to explicitly compute the pressure. If all or part of the boundary conditions is then fixed on the divergence free physical field, the system required to be solved for the scalar potential of velocity becomes a Poisson equation with constant coefficients fitted with Dirichlet conditions.
Solving the equations of incompressible fluid flows requires ensuring the coupling of the equation of motion and that of the incompressibility constraint. This coupling can be implicit in a kind of “exact” approach by including the constraint in the linear system as for the method of the augmented Lagrangian [
Since many authors have developed time splitting or prediction-correction methods called projection that involve treating the solving of motion equations and their incompressibility constraint sequentially. Many algorithms allow obtaining convergence orders in time ranging from range
The approach proposed here is based entirely on the mechanics of discrete media [
The resolution of the equation of motion in an incompressible formulation associated with the boundary conditions of the physical problem is the objective of projection methodologies. These motion equations can be the Navier-Stokes equations or the equations coming from the discrete mechanics [
where V is the velocity, t the time, p the pressure, ρ the density and μ the dynamic viscosity. The boundary of the physical domain Ω is noted Σ. By decomposing the material derivative of velocity and discretizing equations at first order in time (a second order is easily obtained with the present method by using a second order Taylor expansion in time), a prediction step can be formulated for the intermediate velocity
with
for Dirichlet boundary conditions on
The first equation of system (2) is a prediction step. It can be solved with the physical boundary conditions of the problem. Its solution
By subtraction of these two equations, we obtain:
We also have
By combining (5) and (6), an equation linking the pressure increment
By using (3) and (7), we finally get the KSP projection step
The pressure increment is obtained by considering the Stokes theorem
According to (8) and (9),
Equation (10) is correct only if
holds, even for multi-phase flows, as soon as a fluid-fluid interface is part of mesh edges as in unstructured or ALE approaches. Finally, the update of the velocity and pressure fields is given by expressions:
where a and b correspond to vertices, endpoints of the edges Γ forming the computational mesh where the density is constant. This last relation corresponds to the application of one of the forms of the Stokes theorem which allows updating the potential geometrically if the velocity field is irrotational, which is the case. In the particular situation where the segment Γ is intersected at point c by an interface separating fluids of densities ρ1 and ρ2, i.e. front tracking, volume of fluid or level set representation of multiphase flows [
As for the velocity, it stays continuous and constant along all the segment. Point c will be determined thanks to an interface tracking method of VOF, Front-Tracking or Level-Set type [
The pressure at time n + 1 is then
・ Prediction step: solving of the first equation of system (2) to obtain
・ Projection step: decomposition of the field
・ Estimate of the irrotational component
・ Update of the velocity and pressure by considering (11)-(12).
The solution at the next time step
When high density gradients are associated to large magnitude source terms, it can be necessary to perform a preliminary Helmholtz-Hodge decomposition of source terms s acting in the momentum equations, before the time evolution loop begins. In this way, the initial condition for pressure at mechanical equilibrium is then built as
The initial condition is given by
Prior decomposition of the source term eliminates the adverse effects induced by exchanges between the pressure effects and all the other effects (viscous, inertial) that cause unwanted local and instant acceleration that affects the quality of the two-phase behavior. This KSP version suitable for very constrained two-phase flows, i.e. including surface tension effects for example, requires an additional projection step and the computing of the solution of a Poisson equation with constant coefficients. However, it allows building a very robust algorithm. The efficiency of solvers with constant coefficient Poisson equations offsets the additional cost of the resolution of an additional equation with respect to the conventional methods of projection. In general, the introduction of a significant source term in the Navier-Stokes equations generates difficulties due to the destabilization of the vector field by the scalar potential that it contains whereas the latter do not participate to the movement itself.
The considered problem is very simple, it consists of a square cavity of unit height filled with two immiscible fluids whose densities are ρ1 and ρ2. It is assumed that the two fluids are initially separated and the heavy fluid 1 occupies the lower half of the cavity. The stationary solution is simple: the velocity V is zero and the pressure field satisfies
Details of the different steps of the time splitting algorithm on this problem are the following. In the absence of initial velocity, the velocity field derived from the prediction step (2) is
The irrotational velocity field is
where
the other, the density is absent from differential operators and appears only for the increase of the pressure. The first phase for determining the potential Φ is independent of the density variations and the projection phase being explicit and local, the solution will always be accurate. All two phase incompressible flows can be simulated with the KSP method with the same efficiency.
Flows with variable density can be very different in nature, flows involving several immiscible phases, flows with phase changes, etc. Flows with continuously varying density which can be approached in the context of the incompressible approximation belong to this class. Natural convection is an example especially when the temperature differences are important and when the Boussinesq approximation is no longer valid. The example below aims to show that the proposed methodology allows finding accurately the solution adopted by many authors after multiple comparisons. This is the case of a cavity filled with air subjected to a horizontal temperature gradient in a gravity field. Natural convection induced by density variations is quantized by the Rayleigh number and the Prandtl number. The selected configuration correspond to a value of the Rayleigh number such that ra = 105 and Prandtl number Pr = 0.71 and it admits a stationary solution. Nusselt number that characterizes the heat transfer between the two isothermal walls is the main result of the problem. The reference solution is obtained by a finite volume method on a Cartesian staggered mesh with augmented Lagrangian technique [
The present test case is almost trivial but it has the advantage of providing a reference for flows with low variable density in an incompressible formulation. Furthermore, the Nusselt number is very sensitive to the numerical methodology. It allows anyway finding precisely a well-known solution with an original method.
With the addition of specific source terms, the system (1) can model many phenomena according to external actions such as gravity, capillary forces or rotation. In the case of a constant and uniform force of gravity, surface gravity waves of different nature can grow and maintain over large time constants at a fluid/fluid interface. This is the case of solitary waves or swells. In the present test case, a liquid sloshing in a cavity partially filled of gas is considered. First order involved mechanisms are inertia and gravity. Both although formally compressible fluids give rise to a motion that can be considered as incompressible at large time, so that the KSP method can be applied. Consider a cavity of length L and height H that contains a fluid of density ρ2 and viscosity μ2 topped with a fluid of density ρ1 and viscosity μ1. The interface between the two immiscible phases is slightly disturbed in a sinusoidal manner such that its initial height
with H = 0.1, L = 0.1 and A = H/100 in linear regime and A = H/3 in non-linear regime. Under the effect of gravity, the interface oscillates around an equilibrium position, i.e. a horizontal reference line. At equilibrium, the lower fluid occupies a height H/2.
Reference | KSP N = 1024 | |
---|---|---|
Nusselt | 4.521638 | 4.521614 |
sloshing movement whose frequency may be calculated by the linear theory. If the initial disturbance of the interface is defined by Fourier modes, i in the longitudinal direction and j for transverse modes, the linear theory allows expressing the frequency [
where l is the width of the domain along y. In two-dimensions, j = 0 and l = 1. We also define the pulsation ω and period T:
The expression of the theoretical frequency (18) was established from a linear stability theory for a fluid density ρ2 in the absence of fluid located above. When the densities ρ1 and ρ2 are close, it is necessary to introduce a correction [
Selected fluids are water and air and the corresponding densities are ρ2 = 1000 kg∙m−3 and ρ1 = 1.1728 kg∙m−3. Only the first 2D mode is tested, i.e. i = 1 and j = 1. The time step is equal to 10−3 s which achieves sufficient accuracy on the frequency of oscillations.
The present problem is used to test the entire methodology: the equation of motion, KSP time splitting algorithm, time and space discretization, interface tracking, etc. To quantify the errors introduced by the different modeling and discretization steps, frequency numerically obtained is compared with the theoretical frequency formulated by relation (18).
This example also serves to show that the formulation conserves kinetic energy when the viscous effects are neglected. Although in this case no transfer of momentum by viscosity is possible, that does not mean that the curl of the velocity field is zero. To finish with, the non-linear mode is illustrated in
Theory | Simulation | |
---|---|---|
Period | 0.3742 | 0.3748 |
The present test case corresponds to a solid rotating flow in a cylindrical cavity of radius R. The steady rotational velocity
with
where p0 is a selected constant chosen equal to zero on the axis. Since the density is not constant in the whole area, the pressure field will be calculated in the two fluid sub-domains on an analytical point of view. The KSP method is now applied from a zero velocity field V = 0 and a zero pressure field p = 0. Equations (2) applied to the problem gives the prediction velocity
From that predicted velocity field, it is possible to apply the projection phase (3) for obtaining the scalar potential Φ of the velocity. However, in the present test case
As the theoretical solution is a polynomial of order two, it is expected that the numerical solution will be accurate. Indeed, all polynomial of order lower or equal to two can be represented exactly by a spatial discretization scheme of order equal to two. Solving the Poisson Equation (3) actually gives the expected result, as reported in
With classical scalar projection (SP) methods, the velocity is calculated from the pressure correction as
The kinematics KSP projection method for solving the equation of incompressible fluid motion essentially solves various problems of incompressible flows, including flows with significant density variations. Unlike conventional methods where the pressure is first calculated from a Poisson equation with variable coefficients, the irrotational velocity is calculated first in KSP. The scalar potential of velocity is then obtained by solving a Poisson problem with constant coefficients that is insensitive to density variations. The scalar potential of the amount of acceleration, i.e. the pressure, is obtained thanks to the Stokes’ theorem by introducing at this stage the local density. In terms of accuracy in time and space, the results are very close to those of the conventional projection methodology for flows at variable density. However, the large variations in density introduce local consistency defects in standard projection methods due to interpolation of density at the location of each component of the velocity. The pressure undergoes non-physical variations that can lead to unstable or non-physical behaviors. The KSP method allows finding consistency between the pressure and the local density. This method
can be interpreted as a simple splitting of the motion equation of the continuum mechanics previously discretized in time. It is based on an original formulation of the law for fluid dynamics written as a discrete Helmholtz-Hodge decomposition.
The proposed KSP time splitting approach satisfies the following properties:
・ The continuous media properties of differential operators, i.e.
・ The space convergence order is 2 with a centered scheme and the time convergence order can be 1 or 2 depending on the order of the Taylor expansion used for the time derivative of the momentum conservation equations.
・ The numerical solution is exact whatever the mesh for all theoretical solution of order equal or less than 2.
・ KSP as SP are a prediction-correction method whose artifacts are well known, i.e. artificial boundary layers are generated by the projection step near the boundaries. Their magnitude decreases during time iterations.
・ Unlike conventional projection methods, the resolution steps for pressure and velocity are reversed. The scalar potential of the velocity Φ is first obtained and then the physical potential, i.e. the pressure, is updated explicitly and accurately.
・ The Poisson equation for velocity potential is at constant coefficients and the velocity potential does not depend on density.
・ The solving of the linear system is easy and allows the use of existing efficient parallel solvers.
As a conclusion, the KSP method is, among those existing in the literature, the easiest method to implement since it consists in solving a Poisson equation with constant coefficients.