1 Introduction

According to Kynch’s theory (see [20]) for sedimentation of homogeneous monodisperse suspensions, consisting of solid spherical particles of the same diameter and density immersed in a viscous fluid, two interfaces form in the settling process: a descending interface between the clear liquid and the initial homogeneous mixture and an ascending interface between the maximally concentrated mixture and the initial homogeneous mixture.

In [28], it is observed that, after several days, a colloidal monodisperse suspension of polystyrene particles forms a layered structure when sedimenting, a fact that contradicts Kynch’s theory. A spinodal decomposition, governed by the Cahn–Hilliard equation [9], is then conjectured as the underlying mechanism that explains this phenomenon.

The Cahn–Hilliard equation models the evolution of a mixture of immiscible fluids by letting an interface between them be diffuse, with some small, but positive, thickness. This is achieved by considering an expression for the Ginzburg–Landau free energy with terms that depend on the gradient of the difference of mass-fractions of the components of the mixture, in such a way that the Cahn–Hilliard equation is a gradient descent equation for the free energy, in contrast to other alternative models, as Volume Of Fluid methods [17] and Level Set methods [23, 24], that do not take energy into account.

The Cahn–Hilliard equation cannot explain, by itself, the cited layering phenomenon, since it does not take into account the gravitational force. The incorporation of dynamics into the evolution of binary fluids can be achieved by using Lagrangian techniques [1, 6, 22]. This leads to systems of equations that couple the evolution of individual mass-fractions, bulk momenta and, possibly, energy.

Among these possibilities, and although (quasi) incompressible versions of these equations might be more suitable for explaining the cited layering phenomenon, in this paper we focus on the approach in [1]. Ignoring temperature, this yields a system of equations, the isentropic compressible Cahn–Hilliard–Navier–Stokes equations, which are a system of fourth-order partial differential equations.

The difficulties in the numerical treatment of Cahn–Hilliard–Navier–Stokes equations stem from the fact that their second, third and fourth order differential terms in spatial coordinates have discretizations with large eigenvalues, due to their inherent differential nature, e.g., the finite difference discretization of a fourth-order derivative with respect to x will have \(\varDelta x^4\) in the denominator, where \(\varDelta x\) is the grid size in the x coordinate.

When solving a system of ODE \(z'=f(z)\), with Jacobian matrices \(f'(z)\) with negative eigenvalues with large absolute values (stiffness), implicit methods can perform larger time steps, whereas an explicit method is typically constrained to time steps proportional to \(\frac{1}{|\lambda |}\), where \(|\lambda |\) is the largest absolute value of eigenvalues of \(f'(z)\). This situation does not hold if \(f'(z)\) has positive eigenvalues, i.e., an implicit solver is forced also to perform small time steps.

In some situations where \(f(z)=g'_e(z)-g'_c(z)\), with an expansive term \(g'_e(z)\) and a contractive term \(g'_c(z)\), where \(g_c, g_e\) are strictly convex functions, an Implicit-Explicit scheme that treats \(g'_c(z)\) implicitly and \(g'_e(z)\) explicitly gives a gradient-stable method, as shown in [13].

Since the Cahn–Hilliard equation has diffusive (contractive) and anti-diffusive (expansive) terms and the viscous terms in the Cauchy stress tensor of the Navier–Stokes equations are also diffusive, efficient time-stepping schemes for the Cahn–Hilliard–Navier–Stokes equations should treat implicitly high order terms that are contractive and explicitly the rest, specially if they do not contribute to stiffness.

Effective numerical schemes for the Cahn–Hilliard equation can be traced back to [8, 11,12,13]. Numerical methods for incompressible and quasi-incompressible models have the additional difficulty of having to solve an equation for the pressure related to the divergence of the velocity (this being 0 in the case of incompressible models) (see [10, 15, 18, 19, 21, 26, 31]). Numerical methods for compressible models do not have this burden but need anyway to cope with the issues inherent to convective terms. In [16] relaxation techniques are used for this task.

The contribution of this paper is the proposal of second order Implicit-Explicit Runge–Kutta schemes for the isentropic compressible Cahn–Hilliard–Navier–Stokes equations with stability restriction on the time step dictated only by the convective terms, so that it is proportional to the spatial grid size. Some features of the scheme are that only linear systems have to be solved at each stage of the Implicit-Explicit Runge–Kutta method and those are efficiently solved by the V-cycle multigrid algorithm with Gauss-Seidel smoothing.

The paper is organized as follows: in section 2 the compressible isentropic Cahn–Hilliard–Navier–Stokes equations are introduced; in Sect. 3 implicit-explicit Runge–Kutta finite difference numerical schemes for the two-dimensional equations are proposed; in Sect. 4 we perform some numerical experiments to assess the efficiency of our proposals; finally, in Sect. 5 we draw some conclusions and give some perspectives for future research.

2 Cahn–Hilliard–Navier–Stokes Equations

2.1 Model Description

The models in this exposition are based on [1]. We denote by \(c_i\), the mass concentration of species \(i=1,2\), by \(c=c_1-c_2\), by \(\rho \) the density of the mixture and by \(\varvec{v} \) its bulk velocity (we use boldface for vector variables).

We denote by \(\Omega \) the open set in \(\mathbb {R}^3\) that is filled by the fluids and by \(\varepsilon \) a parameter related to the thickness of the diffuse interface of the fluid mixture. The Ginzburg–Landau free energy in some region \(V\subseteq \Omega \) of the immiscible compressible two-phase fluid is

$$\begin{aligned} \begin{aligned} E(\rho , c)&=\int _{V}(\rho f(\rho , c)+ \frac{\varepsilon }{2}|\nabla c|^2)d\varvec{x}\\ f(\rho , c)&=f_e(\rho )+ \psi (c) \end{aligned} \end{aligned}$$
(1)

where \(\psi (c) = \frac{1}{4}(c^2-1)^2\) is a double-well potential function and \(f_{e}\) is the specific Helmholtz free energy of an equivalent one-phase fluid.

The isentropic compressible Cahn–Hilliard–Navier–Stokes equations with gravitation are the following equations:

$$\begin{aligned} \left\{ \begin{aligned}&\rho _t+\mathop {\text {div}} \left( \rho \varvec{v}\right) =0,\\&(\rho \varvec{v})_t+\mathop {\text {div}} \left( \rho \varvec{v}\otimes \varvec{v} \right) =\rho \varvec{g}+\mathop {\text {div}} \mathbb {T}, \\&(\rho c)_t+\mathop {\text {div}} \left( \rho c\varvec{v}\right) =\varDelta \mu , \end{aligned} \right. \end{aligned}$$
(2)

where \(\mathop {\text {div}}\) is the divergence operator with respect to \(\varvec{x}\in {\mathbb {R}}^3\), the first equation is the continuity equation for the mixture, the second is the equation for conservation of bulk momenta. In these equations

$$\begin{aligned}&\mathbb {T}=\nu (c)(\nabla \varvec{v}+\nabla \varvec{v}^T)+(\lambda (c)\mathop {\text {div}} \varvec{v} - p(\rho , c))\mathbb {I}+\frac{\varepsilon }{2}|\nabla c|^2 \mathbb {I}-\varepsilon ( \nabla c\otimes \nabla c) \end{aligned}$$

is the stress tensor, \(p(\rho , c)=\rho ^2\frac{\partial f(\rho , c)}{\partial \rho }\) is the fluid pressure, \(\nu (c), \lambda (c)>0\) are the viscosity coefficients, \(\varvec{g}\) is the gravitational acceleration, and

$$\begin{aligned}&\mu =\psi '(c) - \frac{\varepsilon }{\rho } \varDelta c, \end{aligned}$$

is the chemical potential.

The \((\rho , \rho \varvec{v})\)-subsystem, with \(\varepsilon =0\), form the compressible isentropic Navier–Stokes equations. The equation for \(\rho c\), for constant \(\rho \) (which may be assumed to be 1) and \(\varvec{v}=0\), is the Cahn–Hilliard equation (see [9]):

$$\begin{aligned} c_t=\varDelta \big (\psi '(c) - \varepsilon \varDelta c\big ). \end{aligned}$$
(3)

These equations are supplemented by initial conditions \(\rho _0, \varvec{v}_0, c_0\) and the boundary conditions

$$\begin{aligned} \varvec{v}|_{\partial \Omega }= \nabla c\cdot \varvec{n}|_{\partial \Omega }= \nabla \mu \cdot \varvec{n}|_{\partial \Omega }=0, \end{aligned}$$
(4)

where \(\varvec{n}\) is the outward normal vector to the boundary.

In [1] it is proved that these equations admit weak solutions, with renormalization of \(\rho \) in the sense of Di Perna and Lions, in any interval \([0, T], T>0\), provided \(\gamma > \frac{3}{2}\), \(0\le \rho _0\in L^{\gamma }(\Omega ), \rho _0|v_0|^2 \in L^1(\Omega ), c_0\in H^1(\Omega )\).

We henceforth consider \(\nu (c), \lambda (c)\) constant and \(p=p(\rho )=C_{p}\rho ^{\gamma }\), for a positive constant \(C_{p}\) and the adiabatic constant \(\gamma > 1.5\), which corresponds to \(f_e(\rho )={C_p}\frac{\rho ^{\gamma -1}}{\gamma -1}\). Therefore, the equation for the conservation of bulk momenta can be rewritten as:

$$\begin{aligned} & (\rho \varvec{v})_t+\mathop {\text {div}} \left( \rho \varvec{v}\otimes \varvec{v} +p(\rho )\mathbb {I}\right) \\ & \quad =\rho \varvec{g}+(\nu +\lambda )\nabla \mathop {\text {div}} \varvec{v}+\nu \varDelta \varvec{v} +\frac{\varepsilon }{2}\nabla |\nabla c|^2 -\varepsilon \mathop {\text {div}}( \nabla c\otimes \nabla c). \end{aligned}$$

As expected, the \(\rho \) and \(q=\rho c\) variables are conserved since the respective associated fluxes,

$$\begin{aligned}&\rho \varvec{v}\cdot \varvec{n},\quad (q\varvec{v}-\nabla \mu )\cdot \varvec{n},\\ \end{aligned}$$

vanish at the boundary due to (4).

The two-dimensional version of these equations, for \(\varvec{v}=(v_1, v_2)\), is:

$$\begin{aligned} \begin{aligned} \rho _t +{(\rho v_1)_x+(\rho v_2)_{y}}&=0,\\ (\rho v_1)_t+{(\rho v_1^2 +{C_p}\rho ^\gamma )_{x}+(\rho v_1 v_2)_{y}}&=\frac{\varepsilon }{2}(c_{y}^2-c_{x}^2)_x -\varepsilon (c_{x}c_y)_{y} \\&\qquad +{\nu \varDelta v_1+(\nu +\lambda )( (v_1)_{xx}+(v_2)_{xy})},\\ (\rho v_2)_t+{(\rho v_1v_2)_{x}+(\rho v_2^2+{C_p}\rho ^{\gamma })_{y}}&={\rho g}+\frac{\varepsilon }{2}(c_{x}^2-c_{y}^2)_y -\varepsilon (c_xc_y)_x \\&\qquad +{\nu \varDelta v_2 +(\nu +\lambda )( (v_1)_{xy}+(v_2)_{yy})},\\ (\rho c)_t+{(\rho c v_1)_{x}+(\rho c v_2)_{y}}&={\varDelta (\psi '(c) - \frac{\varepsilon }{\rho } \varDelta c)}, \end{aligned} \end{aligned}$$
(5)

where \(\varDelta w=w_{xx}+w_{yy}\), for any \(\mathcal {C}^2\) function \(w=w(x,y)\), and the gravity acceleration \(\varvec{g}=(0,g)\) acts along the y coordinate.

We also consider the one-dimensional version of these equations:

$$\begin{aligned} \begin{aligned} \rho _t+ (\rho v)_x&=0,\\ (\rho v)_t+ (\rho v^2 +p(\rho ) )_x&=\rho g+ \Big ((2\nu +\lambda )v_x-\frac{\varepsilon }{2}c_x^2\Big )_x, \\ (\rho c)_t+ (\rho cv)_x&=\left( \psi '(c) - \frac{\varepsilon }{\rho } c_{xx}\right) _{xx}, \end{aligned} \end{aligned}$$
(6)

where gravity g acts along the x coordinate.

2.2 Spinodal Decomposition

The Cahn–Hilliard equation was proposed in [9] to model the separation of a homogeneous mixture of two incompressible fluids, the first of them stable with respect to the presence of small quantities of the second one, and this one unstable with respect to the presence of small quantities of the first one. The boundary of the unstable region in (cTp)-space, Tp being temperature and pressure, respectively, is given by the equation \(\frac{\partial ^2 G}{\partial c^2}=0\), where G(cTp) is the Gibbs free energy density of the fluid, and is usually named the spinodal.

To analyze the spinodal decomposition (see [11] for further details), we consider the linearization of (3) about a constant state \(c_0\) in the spinodal region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\), which satisfies \(\psi ''(c_0)<0\):

$$\begin{aligned} c(\varvec{x},t)=c_0+u(\varvec{x}, t), \end{aligned}$$

for assumedly small u, with \(\int _{\Omega } u=0\). Notice then that

$$\begin{aligned} \psi '(c_0+u(\varvec{x}, t))= \psi '(c_0)+\psi ''(c_0)u(\varvec{x}, t)+\mathcal {O}(u^2), \end{aligned}$$

therefore the linearized Cahn–Hilliard equation:

$$\begin{aligned}&u_t= \psi ''(c_0)\varDelta u - \varepsilon \varDelta ^2 u. \end{aligned}$$
(7)

is deduced from the Cahn–Hilliard equation (3).

By separation of variables, functions of the form

$$\begin{aligned} u(\varvec{x}, t)=v(t) \prod _{i=1}^{3}\cos (k_i\pi x_i),\quad k_i\in \mathbb {N}, \end{aligned}$$
(8)

satisfy the homogeneous Neumann boundary conditions and \(\int _{\Omega } u(\varvec{x}, t)d\varvec{x} =0\). Since

$$\begin{aligned} u_{t}&=v'(t) \prod _{i=1}^{3}\cos (k_i\pi x_i)\\ u_{x_ix_i}&=v(t) (-k_i^2\pi ^2)\prod _{i=1}^{3}\cos (k_i\pi x_i)\\ \varDelta u&=-v(t) \sum _{i=1}^{3}k_i^2\pi ^2\prod _{i=1}^{3}\cos (k_i\pi x_i), \end{aligned}$$

u is solution of (7) if

$$\begin{aligned}&v'(t)=\Big (-\psi ''(c_0) \sum _{i}k_i^2\pi ^2-\varepsilon (\sum _{i}k_i^2\pi ^2)^2 \Big )v(t), \end{aligned}$$

whose solutions are

$$\begin{aligned}&v(t)=v(0)e^{-\big (\psi ''(c_0) \sum _{i}k_i^2\pi ^2+\varepsilon (\sum _{i}k_i^2\pi ^2)^2\big )t}. \end{aligned}$$
(9)

The linearized equation (7) will therefore develop instabilities when \(t\rightarrow \infty \) if the coefficient of t in the exponent of (9) is \(>0\), i.e., provided

$$\begin{aligned} \psi ''(c_0) \sum _{i}k_i^2\pi ^2+\varepsilon (\sum _{i}k_i^2\pi ^2)^2< 0, \end{aligned}$$

for some \( k_i \ge 1\), and this will be so if \(\varepsilon \pi ^2+\psi ''(c_0) < 0\). But these instabilities, triggered by the linearized equation, will grow until some point, when the nonlinear character of the Cahn–Hilliard equations makes the linearization no longer valid, and will stop, since energy decreases with time as shown below, by using differentiation under the integral, integration by parts and Neumann boundary conditions for c:

$$\begin{aligned} \frac{d}{dt} F(c(\cdot , t))&= \int _{\Omega } (\psi '(c)c_t+\varepsilon \nabla c \nabla c_t) d\varvec{x} =\int _{\Omega } (\psi '(c)c_t-\varepsilon \varDelta c c_t) d\varvec{x} + \int _{\partial \Omega } \varepsilon c_t \nabla c \cdot \varvec{n} d\varvec{x} \\&=-\int _{\Omega } (\psi '(c)-\varepsilon \varDelta c )^2 d\varvec{x} \le 0, \end{aligned}$$

for \(F(c)=E(1, c)\), where E is given in (1).

3 Numerical Schemes

3.1 Spatial Semidiscretization

In this section, our purpose is to design finite difference numerical methods for the efficient approximation of solutions of the two-dimensional equations in Section 2. For this, we consider \(\Omega =(0,1)^2\) and the equispaced computational grid given by the \(M^2\) nodes \(\varvec{x}_{i,j}=((i-\frac{1}{2})h, (j-\frac{1}{2})h), i,j=1,\dots ,M\), where \(h=\frac{1}{M}\) and we denote by (xy) the spatial variable \(\varvec{x}\).

We denote by

$$\begin{aligned} u=(\rho , \varvec{m}, q), \qquad \varvec{m}=(m_1,m_2)=(\rho v_1,\rho v_2)=\rho \varvec{v}, \qquad q=\rho c, \end{aligned}$$

and aim to approximate (5) by a spatial semi-discretization consisting of \(4M^2\) ordinary differential equations

$$\begin{aligned} u_{k,i,j}'(t)={\mathcal {L}}(U(t))_{k,i,j}, \quad k=1,\dots ,4,\quad i,j=1,\dots ,M, \end{aligned}$$
(10)

for \(4M^2\) unknowns \(u_{k,i,j}(t)\in {\mathbb {R}}\), which are approximations of \( u_k(\varvec{x}_{i,j}, t)\). We define \(M\times M\) matrices \(\varrho , V_1, V_2, C\) as follows: for \(i,j=1,\dots ,M\)

$$\begin{aligned} \varrho _{i,j}=u_{1,i,j},\qquad (V_1)_{i,j}=\frac{u_{2,i,j}}{u_{1,i,j}},\qquad (V_2)_{i,j}=\frac{u_{3,i,j}}{u_{1,i,j}},\qquad C_{i,j}=\frac{u_{4,i,j}}{u_{1,i,j}}, \end{aligned}$$

Here, as in the rest of this section, we drop the dependence of U on t to obtain the cited spatial semidiscretization. The spatial semidiscretization is split as follows:

$$\begin{aligned} \begin{aligned} \mathcal {L}(U)&={\mathcal {C}}(U)+{\mathcal {L}}_1(U)+{\mathcal {L}}_2(U)+{\mathcal {L}}_3(U)+{\mathcal {L}}_4(U)\\ \end{aligned} \end{aligned}$$
(11)

for the following approximations:

$$\begin{aligned} {\mathcal {C}}(U)_{1,i,j}&\approx -( (\rho v_1)_x+(\rho v_2)_{y})(x_{i,j}, t),\\ {\mathcal {C}}(U)_{2,i,j}&\approx -( (\rho v_1^2 +{C_p}\rho ^{\gamma } )_{x}+(\rho v_1 v_2)_{y})(x_{i,j}, t),\\ {\mathcal {C}}(U)_{3,i,j}&\approx -( (\rho v_1v_2)_{x}+(\rho v_2^2+{C_p}\rho ^{\gamma })_{y})(x_{i,j}, t),\\ {\mathcal {C}}(U)_{4,i,j}&\approx -( (\rho c v_1)_{x}+(\rho c v_2)_{y})(x_{i,j}, t),\\ {\mathcal {L}}_1(U)_{3,i,j}&\approx \rho (x_{i,j},t) g ,\\ \mathcal {L}_{1}(U)_{1,i,j}&=\mathcal {L}_{1}(U)_{2,i,j}=\mathcal {L}_{1}(U)_{4,i,j}=0,\\ {\mathcal {L}}_2(U)_{2,i,j}&\approx \varepsilon ( \frac{1}{2}(c_{y}^2)_{x}-\frac{1}{2} (c_{x}^2)_x- (c_{x}c_y)_{y})(x_{i,j}, t),\\ {\mathcal {L}}_2(U)_{3,i,j}&\approx \varepsilon ( \frac{1}{2}(c_{x}^2)_{y}-\frac{1}{2} (c_{y}^2)_y -(c_xc_y)_x)(x_{i,j}, t),\\ \mathcal {L}_{2}(U)_{1,i,j}&=\mathcal {L}_{2}(U)_{4,i,j}=0,\\ {\mathcal {L}}_{3}(U)_{4,i,j}&\approx \varDelta (\psi '(c) - \frac{\varepsilon }{\rho } \varDelta c) (x_{i,j}, t) ,\\ \mathcal {L}_{3}(U)_{1,i,j}&=\mathcal {L}_{3}(U)_{2,i,j}=\mathcal {L}_{3}(U)_{3,i,j}=0,\\ {\mathcal {L}}_4(U)_{2,i,j}&\approx (\nu ( (v_1)_{xx}+(v_1)_{yy})+(\nu +\lambda )( (v_1)_{xx}+(v_2)_{xy}))(x_{i,j}, t),\\ {\mathcal {L}}_4(U)_{3,i,j}&\approx (\nu ((v_2)_{xx}+(v_2)_{yy}) +(\nu +\lambda )( (v_1)_{xy}+(v_2)_{yy}))(x_{i,j}, t),\\ \mathcal {L}_{4}(U)_{1,i,j}&=\mathcal {L}_{4}(U)_{4,i,j}=0. \end{aligned}$$

3.1.1 The Operator \(\mathcal {L}_1\)

The approximation of the only nonzero source term \({\mathcal {L}}_1(U)_{3,i,j} \approx \rho (x_{i,j},t) g\) is taken pointwise, i.e.,

$$\begin{aligned} \mathcal {L}_1(U)_{3,i,j}=\varrho _{i,j} g. \end{aligned}$$

3.1.2 The Operator \(\mathcal {C}\)

The convective term \({\mathcal {C}}\) is obtained through finite differences of numerical fluxes obtained by WENO5 reconstructions [3, 4] on Global Lax–Friedrichs flux splittings [27], which is fifth-order accurate for finite difference schemes, based on point values. Other schemes for systems of hyperbolic conservation laws, as MUSCL, could be used as well, see [29] and references therein, but we choose this one for its relative ease of implementation while achieving high resolution.

3.1.3 Basic Finite Difference Operators

We define finite difference operators for functions on \(M\times M\) grids, for fixed \(h>0\), to approximate first-order derivatives along the x dimension:

$$\begin{aligned}&D_{x}^{1*} f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i,j}}{h}& i=1,\\ \frac{f_{i,j}-f_{i-1,j}}{h}& 1<i<M,\\ \frac{-f_{i-1,j}}{h}& i=M.\\ \end{array}\right. } \end{aligned}$$
(12)
$$\begin{aligned}&D_{x}^1 f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i+1,j}-f_{i,j}}{h}& i<M,\\ 0& i=M. \end{array}\right. } \end{aligned}$$
(13)
$$\begin{aligned}&D_{x} f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i+1,j}-f_{i-1,j}}{2h}& 1<i<M,\\ \frac{f_{i+1,j}-f_{i,j}}{h}& i=1,\\ \frac{f_{i,j}-f_{i-1,j}}{h}& i=M.\\ \end{array}\right. } \end{aligned}$$
(14)
$$\begin{aligned}&D^*_{x} f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i+1,j}-f_{i-1,j}}{2h}& 1<i<M,\\ \frac{f_{i+1,j}-f_{i,j}}{2h}& i=1,\\ \frac{f_{i,j}-f_{i-1,j}}{2h}& i=M,\\ \end{array}\right. } \end{aligned}$$
(15)

and the shift operator

$$\begin{aligned}&S_{x}f_{i,j}={\left\{ \begin{array}{ll} f_{i+1,j} & i < M,\\ 0& i=M; \end{array}\right. } \end{aligned}$$

and likewise in the y direction.

The properties of these operators are the following:

  1. 1.

    \(D_{x}^{1*}f_{i,j}\) is a second-order accurate approximation for \(f_{x}(x_{i-\frac{1}{2},j})\) when \(f_{i,j}=f(x_{i,j})\) and \(f\in {\mathcal {C}}^3\) with \(f(x_{0,j})=f(x_{M,j})=0\), which is used to approximate pure double derivatives.

  2. 2.

    \(D_{x}^1f_{i,j}\) is a second-order accurate approximation for \(f_{x}(x_{i+\frac{1}{2},j})\) when \(f_{i,j}=f(x_{i,j})\) and \(f\in {\mathcal {C}}^3\) with \(f_{x}(x_{M+\frac{1}{2},j})=0\), which is used to approximate pure double derivatives. These two operators are related as \(D_{x}^{1*}=-(D_{x}^1)^T\).

  3. 3.

    \(D_{x}f_{i,j}\) is a second-order accurate approximation for \(f_{x}(x_{i,j})\) for \(1<i,j<M\) and first-order accurate otherwise, when \(f_{i,j}=f(x_{i,j})\) and \(f\in {\mathcal {C}}^3\).

  4. 4.

    \(D_{x}^*f_{i,j}\) is a second-order accurate approximation for \(f_{x}(x_{i,j})\) for \(1<i,j<M\) or \(j=1,M\) and first-order accurate otherwise, when \(f_{i,j}=f(x_{i,j})\) and \(f\in {\mathcal {C}}^3\) with \(f(x_{i,\frac{1}{2}})=f(x_{i,M+\frac{1}{2}})=0\).

For the sake of notation, for functions fg on \(M\times M\) grids we denote

$$\begin{aligned} (f*g)_{i,j}=f_{i,j}g_{i,j}. \end{aligned}$$

3.1.4 The Operator \(\mathcal {L}_2\)

To approximate the terms \(\mathcal {L}_2(U)_{k,i,j}, k=2,3,\) that involve derivatives of c in the conservation of momenta, we consider the following expressions:

$$\begin{aligned} (c_x^2)_x(x_{i,j})&\approx (D_{x}^{1*}(D_{x}^{1}C*D_{x}^{1}C))_{i,j},\\ (c_y^2)_x(x_{i,j})&\approx (D_x((D_{y}^*C*D_{y}^*C)))_{i,j},\\ (c_xc_y)_x(x_{i,j})&\approx \frac{1}{2} (D_x^{1*}(D_{x}^1C*(S_{x}D_y^*C+D_{y}^*C)))_{i,j}. \end{aligned}$$

As an instance, for \(C=(c_{i,j})\):

$$\begin{aligned} (D_{x}^{1*}(D_{x}^{1}C*D_{x}^{1}C))_{i,j}= {\left\{ \begin{array}{ll}\frac{1}{h^3} (c_{2,j}-c_{1,j})^2& i=1,\\ \frac{1}{h^3} (c_{i+1,j}-c_{i,j})^2-(c_{i,j}-c_{i-1}j)^2& 1<i<M,\\ -\frac{1}{h^3}(c_{M,j}-c_{M-1,j})^2& i=M. \end{array}\right. } \end{aligned}$$

Symmetrically:

$$\begin{aligned} (c_y^2)_y(y_{i,j})&\approx (D_{y}^{1*}(D_{y}^{1}C*D_{y}^{1}C))_{i,j},\\ (c_x^2)_y(y_{i,j})&\approx (D_y((D_{x}^*C*D_{x}^*C)))_{i,j},\\ (c_yc_x)_y(y_{i,j})&\approx \frac{1}{2} (D_y^{1*}(D_{y}^1C*(S_{y}D_x^*C+D_{x}^*C)))_{i,j}. \end{aligned}$$

These approximations take the boundary conditions (4) on c into account and are second-order accurate at interior points \(1<i,j<M\) and first-order accurate at the rest of the points.

3.1.5 The Operator \(\mathcal {L}_4\)

To approximate the terms \(\mathcal {L}_4(U)_{k,i,j}, k=2,3,\) that involve derivatives of \(\varvec{v}\) in the conservation of momenta, we consider the following finite difference approximations

$$\begin{aligned}&z''(x_i)\approx {\left\{ \begin{array}{ll} \frac{1}{h^2}\left( \frac{4}{3}z(x_{i+1})-4 z(x_{i}) \right) & i=1,\\ \frac{1}{h^2}\left( z(x_{i+1})-2 z(x_{i})+z(x_{i-1}) \right) & 1<i< M,\\ \frac{1}{h^2}\left( -4 z(x_{i})+\frac{4}{3}z(x_{i-1}) \right) & i= M, \end{array}\right. } \end{aligned}$$
(16)

for any \(\mathcal {C}^4\) function z on [0, 1] such that \(z(0)=z(1)=0\). This approximation is second-order accurate for \(1<i<M\) and first-order accurate otherwise.

These approximations lead to the \(M\times M\) blocks \({\mathcal {L}}_4(U)_2, {\mathcal {L}}_4(U)_3\)

$$\begin{aligned} \mathcal {L}_{4}(U)_2&= (2\nu +\lambda )EV_1+\nu V_1E^T+(\nu +\lambda )D V_2 D^T\\ {\mathcal {L}}_{4}(U)_3&= (\nu +\lambda )DV_1 D^T+ \nu EV_2+(2\nu +\lambda ) V_2E^T \end{aligned}$$

where DE are the matrices associated to the finite difference operators in (14) and (16), respectively:

(17)

The matrices in (17) fail to be symmetric due to the boundary conditions. This could be circumvented with staggered grids for the velocity, but we do not consider this possibility in this paper.

3.1.6 The Operator \(\mathcal {L}_3\)

The term \((\psi '(c) )_{xx}=(\psi ''(c)c_x)_x\) needs special care, since it is not negatively definite, due to \(\psi ''(c)=3c^2-1\) changing sign in \((-1,1)\). Since only negatively definite (right-hand side) terms should be treated implicitly, we consider the splitting \(\psi '=\phi _{+}+\phi _{-}\), with

$$\begin{aligned} \phi _{-}&=c^3-3c,\qquad \phi _{+}=2c, \\ \phi _{-}'(c)&=3(c^2-1)\le 0,\qquad \phi _{+}'(c)=2> 0\,\forall c\in [-1,1], \end{aligned}$$

as in [13, 30], where it is shown that time-stepping schemes for the Cahn–Hilliard equations that are built by considering the term containing \(\phi _+\) as implicitly treated and the term containing \(\phi _-\) as explicitly treated are unconditionally stable.

For \(\chi =\phi _{\pm }\), taking into account that \((\chi (c))_{z}=\chi '(c)c_z\), \(z=x,y\), so \(\chi (c)\) satisfies Neumann boundary conditions, we have the following second-order accurate approximations:

$$\begin{aligned} \begin{aligned}&(\chi (c))_{xx}(x_{i,j}) \\&\approx {\left\{ \begin{array}{ll} \frac{(\chi '(c_{i+1,j})+\chi '(c_{i,j}))(c_{i+1,j}-c_{i,j})}{2h^2}& i=1,\\ \frac{(\chi '(c_{i+1,j})+\chi '(c_{i,j}))(c_{i+1,j}-c_{i,j})-(\chi '(c_{i,j})+\chi '(c_{i-1,j}))(c_{i,j}-c_{i-1,j})}{2h^2}& 1<i<M,\\ \frac{-(\chi '(c_{i,j})+\chi '(c_{i-1,j}))(c_{i,j}-c_{i-1,j})}{2h^2}& i=M.\\ \end{array}\right. } \\&(\chi (c))_{yy}(x_{i,j})\\&\approx {\left\{ \begin{array}{ll} \frac{(\chi '(c_{i,j+1})+\chi '(c_{i,j}))(c_{i,j+1}-c_{i,j})}{2h^2}& j=1,\\ \frac{(\chi '(c_{i,j+1})+\chi '(c_{i,j}))(c_{i,j+1}-c_{i,j})-(\chi '(c_{i,j})+\chi '(c_{i,j-1}))(c_{i,j}-c_{i,j-1})}{2h^2}& 1<j<M,\\ \frac{-(\chi '(c_{i,j})+\chi '(c_{i,j-1}))(c_{i,j}-c_{i,j-1})}{2h^2}& j=M.\\ \end{array}\right. } \end{aligned} \end{aligned}$$
(18)

These yield approximations

$$\begin{aligned} (\mathcal {M}_{\pm }(C)C)_{i,j} \approx \varDelta (\phi _{\pm }(c))(x_{i,j}, t), \end{aligned}$$
(19)

where we denote by \(\mathcal {M}_{\pm }(C)\) the tensor built from the values of \(\chi '=\phi '_{\pm }\) that appear in (18).

It can be seen that the boundary conditions

$$\begin{aligned} \nabla c(x, y, t)\cdot \varvec{n}(x, y)=\nabla \mu (x,y,t) \cdot \varvec{n}(x,y)=0 \end{aligned}$$

are equivalent to

$$\begin{aligned} \nabla c(x, y, t)\cdot \varvec{n}(x,y)=\nabla \xi (x,y,t) \cdot \varvec{n}(x,y)=0 \end{aligned}$$

for \(\xi =\frac{1}{\rho }\varDelta c\).

If f(xy) satisfies the Neumann boundary condition \(\nabla f(x,y)\cdot \varvec{n}(x,y)=0\) and \(f_{i,j}=f(x_{i,j})\) then \((\varDelta _h f)_{i,j}\), \(\varDelta _h=\varDelta _{x,h}+\varDelta _{y,h}\), yields a second-order accurate approximation of \(\varDelta f(x_{i,j})\) for \(f\in {\mathcal {C}}^4\), where

$$\begin{aligned}&\varDelta _{x,h} f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i+1,j}-f_{i,j}}{h^2} & i=1,\\ \frac{f_{i+1,j}-2f_{i,j}+f_{i-1,j}}{h^2} & 1<i<M,\\ \frac{f_{i-1,j}-f_{i,j}}{h^2} & i=M. \end{array}\right. }\\&\varDelta _{y,h} f_{i,j}= {\left\{ \begin{array}{ll} \frac{f_{i,j+1}-f_{i,j}}{h^2} & j=1,\\ \frac{f_{i,j+1}-2f_{i,j}+f_{i,j-1}}{h^2} & 1<j<M,\\ \frac{f_{i,j-1}-f_{i,j}}{h^2} & j=M. \end{array}\right. } \end{aligned}$$

Therefore we get the second-order accurate approximation

$$\begin{aligned}&\varDelta \xi (x_{i,j})\approx \Big (\varDelta _h\big (D(\varrho )^{-1}\varDelta _h c\big )\Big )_{i,j}, \end{aligned}$$

which, together with (19), yields the second-order accurate approximation

$$\begin{aligned}&\varDelta \mu (x_{i,j})\approx {\mathcal {L}}_3(U)_{4,i,j}=\Big (\mathcal {M}_{+}(C)C+\mathcal {M}_{-}(C)C-\varepsilon \varDelta _h\big ( D(\varrho )^{-1}\varDelta _h C\big )\Big )_{i,j}, \end{aligned}$$
(20)

where \(D(v), v\in {\mathbb {R}}^{M\times M},\) is the diagonal operator on \(M\times M\) matrices given by

$$\begin{aligned} (D(v) w)_{i,j}=v_{i,j}w_{i,j}, i,j =1,\dots ,M. \end{aligned}$$

3.2 Vector Implementation

An \(M\times M\) A matrix can be cast into a \(M^2\) (column) vector J(A) as follows:

$$\begin{aligned} J(A)_{M(j-1)+i}=A_{i,j}, \quad i,j=1,\dots ,M, \end{aligned}$$

i.e., J(A) is formed by stacking the columns of A.

In order not to clutter notation, we henceforth identify by X the vector J(X) for \(X=\varrho , V_1, V_2, C, \mathcal {C}(U), \mathcal {L}_k(U), k=1,2,3,4\). For \(M^2\) vectors ab we denote by \(a*b\) the \(M^2\) vector such that

$$\begin{aligned} (a*b)_{i}=a_ib_i, i=1,\dots ,M^2. \end{aligned}$$

Using this notation, we reorder the 4 \(M\times M\) matrices functions that we have used in the previous section into a \(4M^2\) (column) vector function U(t) as follows

$$\begin{aligned}&U=\begin{bmatrix} \varrho \\ \varrho *V_1\\ \varrho *V_2\\ \varrho *C \end{bmatrix}, \end{aligned}$$

and, correspondingly:

$$\begin{aligned} \mathcal {C}(U)= \begin{bmatrix} J(\mathcal {C}(U)_{1})\\ J(\mathcal {C}(U)_{2})\\ J(\mathcal {C}(U)_{3})\\ J(\mathcal {C}(U)_{4}) \end{bmatrix}, \qquad \mathcal {L}_k(U)= \begin{bmatrix} J(\mathcal {L}_k(U)_{1})\\ J(\mathcal {L}_k(U)_{2})\\ J(\mathcal {L}_k(U)_{3})\\ J(\mathcal {L}_k(U)_{4}) \end{bmatrix}, k=1,2,3,4, \end{aligned}$$

so that (10) is equivalent to

$$\begin{aligned} \left\{ \begin{aligned} U'(t)&=\mathcal {L}(U(t)), \\ \mathcal {L}(U)&=\mathcal {C}(U)+\mathcal {L}_1(U)+\mathcal {L}_2(U)+\mathcal {L}_3(U)+\mathcal {L}_4(U), \end{aligned} \right. \end{aligned}$$
(21)

with U(t) and \(\mathcal {L}(U(t))\) being \(4M^2\) vectors.

With this notation \({\mathcal {L}}_4(U)\) is given by

$$\begin{aligned}&{\mathcal {L}}_{4}(U) = \begin{bmatrix} \varvec{O}_{M^2}& \varvec{O}_{M^2}\\ (2\nu +\lambda )I_{M}\otimes E+\nu E\otimes I_{M} & (\nu +\lambda )D\otimes D \\ (\nu +\lambda )D\otimes D & \nu I_{M}\otimes E+(2\nu +\lambda ) E\otimes I_{M}\\ \varvec{O}_{M^2}& \varvec{O}_{M^2}\\ \end{bmatrix} \begin{bmatrix} V_1\\ V_2 \end{bmatrix}, \end{aligned}$$

where \(I_M\) is the \(M\times M\) identity matrix, \(\otimes \) is the Kronecker product, the matrices DE have been defined in (17) and \(\varvec{O}_{M^2}\) denotes the \(M^2\times M^2\) null matrix.

Likewise, \(\mathcal {L}_3(U)\) is given by

$$\begin{aligned}&{\mathcal {L}}_{3}(U) = \begin{bmatrix} \varvec{O}_{M}\\ \varvec{O}_{M}\\ \varvec{O}_{M}\\ \Big (\mathcal {M}_{+}(C)+\mathcal {M}_{-}(C)-\varepsilon \varDelta _h\big ( D(\varrho )^{-1}\varDelta _h \big )\Big )C \end{bmatrix}, \end{aligned}$$

where \(\varvec{O}_{M}\) denotes the \(M^2\) null vector and \(\mathcal {M}_{+}(C),\varDelta _h\) are the \(M^2\times M^2\) matrices corresponding to the homonymous tensors in Subsection 3.1.6.

Remark 1

The numerical schemes for the one-dimensional case are obtained in a straightforward manner from those for the two-dimensional case.

3.3 Implicit-Explicit Schemes

An explicit Runge–Kutta solver for (21), as the Explicit Euler method

$$\begin{aligned} U^{n+1}&=U^{n}+\varDelta t \mathcal {L}(U^{n}), \end{aligned}$$
(22)

applied to obtain a fully discrete scheme would require \(\varDelta t \propto \varDelta x^4\) for stability, which would yield a prohibitively expensive numerical scheme.

Instead, we use the technique of doubling variables and partitioned Runge-Kutta schemes [5, 25] to obtain Linearly Implicit Explicit (LIMEX) schemes. We denote the variables that are to be treated explicitly with a tilde and we define

$$\begin{aligned} \widetilde{\mathcal {L}}(\widetilde{U}, U)= {\mathcal {C}}(\widetilde{U})+{\mathcal {L}}_1(U)+{\mathcal {L}}_2(U)+ \widetilde{{\mathcal {L}}}_3(\widetilde{U}, U)+{\mathcal {L}}_4(U), \end{aligned}$$

where

$$\begin{aligned}&\widetilde{U}= \begin{bmatrix} \widetilde{\varrho }\\ \widetilde{\varrho }* \widetilde{V}_1\\ \widetilde{\varrho }* \widetilde{V}_2\\ \widetilde{\varrho }* \widetilde{C} \end{bmatrix} , \quad U= \begin{bmatrix} \varrho \\ \varrho * V_1\\ \varrho * V_2\\ \varrho * C \end{bmatrix},\\&\widetilde{\mathcal {L}}_{3}(\widetilde{U}, U) =\begin{bmatrix} \varvec{0}_{M}\\ \varvec{0}_{M}\\ \varvec{0}_{M}\\ \mathcal {M}_{+}(\widetilde{C})C+\mathcal {M}_{-}(\widetilde{C})\widetilde{C}-\varepsilon \varDelta _h\big ( D(\varrho )^{-1}\varDelta _h \big )C \end{bmatrix}, \end{aligned}$$

i.e., the coefficients of the matrix \(\mathcal {M}_+(\widetilde{C})\) are computed from the explicit data \(\widetilde{C}\), whereas all the term corresponding to the negative part \(\phi _{-}\) of the splitting \(\psi '=\phi _++\phi _{-}\) is computed from \(\widetilde{C}\).

From (20) and (11), the requirement \(\widetilde{\mathcal {L}}(U, U)={\mathcal {L}}(U)\) is met.

Now we have that the IVP

$$\begin{aligned} \begin{aligned} \widetilde{U}'&=\widetilde{\mathcal {L}}(\widetilde{U}, U)\\ U'&=\widetilde{\mathcal {L}}(\widetilde{U}, U)\\ \widetilde{U}(0)&=U(0)=U_0\\ \end{aligned} \end{aligned}$$
(23)

is equivalent to

$$\begin{aligned} U'&= {\mathcal {L}}(U)\\ U(0)&=U_0. \end{aligned}$$

A partitioned Runge–Kutta scheme, in which there are two different s stages Butcher tableaus, one explicit and one (diagonally) implicit

$$\begin{aligned} \begin{array}{c|c} \widetilde{\delta }& \widetilde{\alpha }\\ \hline & \widetilde{\beta }^{T^{\phantom {T}}} \end{array},\quad \widetilde{\alpha }_{i,j}=0, j\ge i \qquad \begin{array}{c|c} \delta & \alpha \\ \hline & \beta ^{T } \end{array},\quad \alpha _{i,j}=0, j> i, \end{aligned}$$

can be applied to (23). It can be seen (cf. [14, 25]) that if both Butcher tableaus yield second-order accurate schemes and \(\beta =\widetilde{\beta }\), then the resulting partitioned Runge-Kutta scheme is second-order accurate and that third-order accuracy is also achievable.

The s intermediate stages in the partitioned Runge–Kutta method are computed for \(i=1,\dots ,s\) as follows:

$$\begin{aligned} \widetilde{U}^{(i)}&=\widetilde{U}^{n}+\varDelta t \sum _{j<i}\widetilde{\alpha }_{i,j} \widetilde{\mathcal {L}}(\widetilde{U}^{(j)}, U^{(j)}),\\ U^{(i)}&=U^{n}+\varDelta t \sum _{j< i} \alpha _{i,j} \widetilde{\mathcal {L}}(\widetilde{U}^{(j)}, U^{(j)}) +\varDelta t \alpha _{i,i} \widetilde{\mathcal {L}}(\widetilde{U}^{(i)}, U^{(i)}),\\ \widetilde{U}^{n+1}&=\widetilde{U}^{n}+\varDelta t\sum _{j=1}^{s} \widetilde{\beta }_{j}\widetilde{\mathcal {L}}(\widetilde{U}^{(j)}, U^{(j)}),\\ U^{n+1}&=U^{n}+\varDelta t\sum _{j=1}^{s} \beta _{j}\widetilde{\mathcal {L}}(\widetilde{U}^{(j)}, U^{(j)})=\widetilde{U}^{n+1}, \end{aligned}$$

since \(\widetilde{\beta }_{j}=\beta _j\), \(\forall j\) if \(U^{n}=\widetilde{U}^{n}\), so there is no need of doubling variables, which we henceforth assume.

The definitive time-stepping expression is the following:

$$\begin{aligned} \widetilde{U}^{(i)}&= U^{n}+\varDelta t \sum _{j<i}\widetilde{\alpha }_{i,j} {\mathcal {K}}_j,\\ U^{(i)}&=U^{n}+\varDelta t \sum _{j< i} \alpha _{i,j} {\mathcal {K}}_j +\varDelta t \alpha _{i,i} \widetilde{\mathcal {L}}(\widetilde{U}^{(i)}, U^{(i)}),\\ U^{n+1}&=U^{n}+\varDelta t\sum _{j=1}^{s} \beta _{j} {\mathcal {K}}_j, \end{aligned}$$

where

$$\begin{aligned} {\mathcal {K}}_j=\widetilde{\mathcal {L}}(\widetilde{U}^{(j)}, U^{(j)}). \end{aligned}$$

In this paper we consider Stiffly Accurate Runge–Kutta solvers, i.e., the last row of the \(\alpha \) matrix coincides with \(\beta ^T\). Specifically, we consider the following Butcher tableaus

$$\begin{aligned} \text {EE-IE }&\begin{array}{c|c} 0& 0\\ \hline & 1 \end{array} & \begin{array}{c|c} 1& 1\\ \hline & 1 \end{array} \\ \text {*-DIRKSA}&\begin{array}{c|cc} 0& 0& 0\\ 1+s& 1+s& 0\\ \hline & s& 1-s \end{array} & \begin{array}{c|cc} 1-s& 1-s& 0\\ 1& s& 1-s\\ \hline & s& 1-s \end{array}, \quad s=\frac{1}{\sqrt{2}}. \end{aligned}$$

The DIRKSA scheme is the only 2-stages second order stiffly accurate DIRK method with \(\alpha _{ij}\ge 0\). The order for EE-IE is 1 and it is 2 for *-DIRKSA.

3.4 Solution of the Nonlinear Systems

One needs to solve

$$\begin{aligned} U^{(i)} =U^{n}+\varDelta t \sum _{j< i} \alpha _{i,j}{\mathcal {K}}_j +\varDelta t \alpha _{i,i} \widetilde{\mathcal {L}}(\widetilde{U}^{(i)}, U^{(i)}), \end{aligned}$$
(24)

for \(U^{(i)}\), where

$$\begin{aligned} U^{n}= \begin{bmatrix} \varrho ^{n}\\ M_1^{n}\\ M_2^{n}\\ Q^{n} \end{bmatrix}, \quad U^{(i)}= \begin{bmatrix} \varrho ^{(i)}\\ M_1^{(i)}\\ M_2^{(i)}\\ Q^{(i)} \end{bmatrix}= \begin{bmatrix} \varrho ^{(i)}\\ \varrho ^{(i)}*V_1^{(i)}\\ \varrho ^{(i)}*V_2^{(i)}\\ \varrho ^{(i)}* C^{(i)} \end{bmatrix}. \end{aligned}$$

As we shall see, although \({\mathcal {L}}_2, \widetilde{{\mathcal {L}}}_3, {\mathcal {L}}_4\) are not linear, only linear systems for \(V_k^{(i)}, C^{(i)}\) have to be solved.

For the first variable, with block superscript notation for the operators and \({\mathcal {K}}\) variables, we get:

$$\begin{aligned}&\varrho ^{(i)}= \varrho ^{n}+\varDelta t \sum _{j< i} \alpha _{i,j} {\mathcal {K}}^1_j+\varDelta t \alpha _{i,i} \widetilde{\mathcal {C}}^1(\widetilde{U}^{(i)}), \end{aligned}$$

so \(\varrho ^{(i)}\) is explicitly computable.

For the fourth variable \(Q^{(i)}\), since \(\varrho ^{(i)}\) is already known, this system can be cast for the \(C^{(i)}\) variables:

$$\begin{aligned} Q^{(i)}&=Q^{n}+\varDelta t \sum _{j< i} \alpha _{i,j} {\mathcal {K}}^4_j \\&\quad + \varDelta t \alpha _{i,i} \Big ( \widetilde{\mathcal {C}}^4(\widetilde{U}^{(i)}) + \mathcal {M}_{+}(\widetilde{C}^{(i)}) C^{(i)}+ \mathcal {M}_{-}(\widetilde{C}^{(i)}) \widetilde{C}^{(i)}-\varepsilon \varDelta _h D(\varrho ^{(i)})^{-1}\varDelta _hC^{(i)} \Big ), \end{aligned}$$

which is equivalent to

$$\begin{aligned} \begin{aligned}&\left( D(\varrho ^{(i)})-\varDelta t \alpha _{i,i} \mathcal {M}_{+}(\widetilde{C}^{(i)}) +\varDelta t \alpha _{i,i}\varepsilon \varDelta _h D(\varrho ^{(i)})^{-1}\varDelta _h\right) C^{(i)}\\&\quad =Q^{n}+\varDelta t \sum _{j< i} \alpha _{i,j} {\mathcal {K}}^4_j + \varDelta t \alpha _{i,i} \Big ( \widetilde{\mathcal {C}}^4(\widetilde{U}^{(i)}) +\mathcal {M}_{-}(\widetilde{C}^{(i)}) \widetilde{C}^{(i)} \Big ). \end{aligned} \end{aligned}$$
(25)

If \(\varrho ^{i}_k>0\,\forall k\), then the matrix of this system is symmetric and positive definite, since it is the sum of a diagonal positive matrix and two symmetric and positive semidefinite matrices.

For the second and third variables, one needs to solve:

$$\begin{aligned} \begin{bmatrix} \varrho ^{(i)}*V_1^{(i)}\\ \varrho ^{(i)}*V_2^{(i)} \end{bmatrix}&=\begin{bmatrix} M_1^{n}\\ M_2^{n} \end{bmatrix} +\varDelta t \sum _{j< i} \alpha _{i,j} \begin{bmatrix} {\mathcal {K}}^2_j\\ {\mathcal {K}}^3_j \end{bmatrix} + \varDelta t \alpha _{i,i} \begin{bmatrix} {\mathcal {C}}^2(\widetilde{U}^{(i)})+ {\mathcal {L}}_1^2(U^{(i)})+ {\mathcal {L}}_2^2(U^{(i)}) \\ {\mathcal {C}}^3(\widetilde{U}^{(i)})+ {\mathcal {L}}_1^3(U^{(i)})+ {\mathcal {L}}_2^3(U^{(i)}) \end{bmatrix} \\&\quad +\varDelta t \alpha _{i,i} \begin{bmatrix} (2\nu +\lambda )I_{M}\otimes E+\nu E\otimes I_{M} & (\nu +\lambda )D\otimes D \\ (\nu +\lambda )D\otimes D & \nu I_{M}\otimes E+(2\nu +\lambda ) E\otimes I_{M} \end{bmatrix} \begin{bmatrix} v_{1}^{(i)}\\ v_{2}^{(i)} \end{bmatrix}. \end{aligned}$$

Since \({\mathcal {L}}_1^j(U^{(i)})\) and \({\mathcal {L}}_2^j(U^{(i)}), j=2,3,\) do not depend on \(V_1^{(i)},V_2^{(i)}\), they can be computed from previous steps and there only remains the following equation to be solved:

$$\begin{aligned} \begin{aligned}&\left( \begin{bmatrix} D(\varrho ^{(i)})& 0\\ 0& D(\varrho ^{(i)}) \end{bmatrix} \right. \\&\qquad \left. -\varDelta t \alpha _{i,i} \begin{bmatrix} (2\nu +\lambda )I_{M}\otimes E+\nu E\otimes I_{M} & (\nu +\lambda )D\otimes D \\ (\nu +\lambda )D\otimes D & \nu I_{M}\otimes E+(2\nu +\lambda ) E\otimes I_{M} \end{bmatrix} \right) \begin{bmatrix} V_{1}^{(i)}\\ V_{2}^{(i)} \end{bmatrix} \\&\quad =\begin{bmatrix} M_1^{n}\\ M_2^{n} \end{bmatrix} +\varDelta t \sum _{j< i} \alpha _{i,j} \begin{bmatrix} {\mathcal {K}}^2_j\\ {\mathcal {K}}^3_j \end{bmatrix} + \varDelta t \alpha _{i,i} \begin{bmatrix} {\mathcal {C}}^2(\widetilde{U}^{(i)})+ {\mathcal {L}}_1^2(U^{(i)})+ {\mathcal {L}}_2^2(U^{(i)}) \\ {\mathcal {C}}^3(\widetilde{U}^{(i)})+ {\mathcal {L}}_1^3(U^{(i)})+ {\mathcal {L}}_2^3(U^{(i)}) \end{bmatrix}. \end{aligned} \end{aligned}$$
(26)

If \(\varrho ^{(i)}_k>0\,\forall k\), then the matrix of this system should be close to symmetric and positive definite, since the matrix

$$\begin{aligned} -\begin{bmatrix} (2\nu +\lambda )I_{M}\otimes E+\nu E\otimes I_{M} & (\nu +\lambda )D\otimes D \\ (\nu +\lambda )D\otimes D & \nu I_{M}\otimes E+(2\nu +\lambda ) E\otimes I_{M} \end{bmatrix} \end{aligned}$$

is a discretization of the self-adjoint elliptic operator

$$\begin{aligned} -\Big ((\nu +\lambda )\nabla \mathop {\text {div}} \varvec{v}+\nu \varDelta \varvec{v}\Big ), \end{aligned}$$

under the boundary conditions (4).

3.5 Linear Solvers

We have used the multigrid V-cycle algorithm with 4 pre- and post- Gauss-Seidel smoothings and direct solution when the size of the projected systems is \(\le 4\) (see [7]) for the solution of systems (25) and (26).

The matrix in system (25) is symmetric and positive, so there is the possibility of using the conjugate gradient method, using the following approximation

$$\begin{aligned} A&=D(\varrho ^{(i)})-\varDelta t \alpha _{i,i} \mathcal {M}_{+}(\widetilde{C}^{(i)}) +\varDelta t \alpha _{i,i}\varepsilon \varDelta _h D(\varrho ^{(i)})^{-1}\varDelta _h \\&\approx B=\mu _1 I_{M^2}+\varDelta t \alpha _{i,i} \mu _2\varDelta _h+\varDelta t \alpha _{i,i}\varepsilon \mu _3\varDelta _h^2,\\ \mu _1&=\text {mean}(\varrho ^{(i)}),\quad \mu _2=\text {mean}(\phi '_+(\widetilde{C}^{(i)}))=2,\quad \mu _3=\text {mean}(1/\varrho ^{(i)}), \end{aligned}$$

as preconditioner, for \(\varDelta _h\) can be efficiently diagonalized by discrete cosine transforms.

We next analyze the condition number of the preconditioned matrix:

$$\begin{aligned} \frac{\max \limits _{z\ne 0}\frac{z^TAz}{z^TBz}}{\min \limits _{z\ne 0}\frac{z^TAz}{z^TBz}}. \end{aligned}$$

We drop the superindex \(^{(i)}\) for simplicity. The matrix \(\mathcal {M}_{+}(\widetilde{C})\) can be expressed as

Since \(\phi _+'=2\) and

$$\begin{aligned} -(I_M\otimes D_1^T)(I_M\otimes D_1) -(D_1^T\otimes I_M)(D_1\otimes I_M)=\varDelta _h, \end{aligned}$$

we get the following:

$$\begin{aligned} z^TAz&=\sum _{k=1}^{M^2} \varrho _{k}z_k^2+2\varDelta t \alpha _{i,i} (\sum _{k=1}^{M^2} ((I_M\otimes D_1)z)_k^2+((D_1\otimes I_M)z)_k^2 ) \\&\quad +\varDelta t \alpha _{i,i}\varepsilon \varDelta _h \sum _{k=1}^{M^2} \frac{1}{\varrho _k} (\varDelta _hz)_k^2\\ z^TBz&=\mu _1\sum _{k=1}^{M^2} z_k^2+2\varDelta t \alpha _{i,i} (\sum _{k=1}^{M^2} ((I_M\otimes D_1)z)_k^2+((D_1\otimes I_M)z)_k^2 ) \\&\quad +\mu _3\varDelta t \alpha _{i,i}\varepsilon \varDelta _h \sum _{k=1}^{M^2} (\varDelta _hz)_k^2. \end{aligned}$$

Therefore, for \(0\ne z\in {\mathbb {R}}^{M^2}\):

$$\begin{aligned} \min \left( \frac{\min \varrho _j}{\mu _1}, \frac{\min \frac{1}{\varrho _j}}{\mu _3}\right) \le \frac{z^TAz}{z^TBz} \le \max \left( \frac{\max \varrho _j}{\mu _1}, \frac{\max \frac{1}{\varrho _j}}{\mu _3}\right) \end{aligned}$$

therefore the condition of the preconditioned matrix is bounded above by

$$\begin{aligned} \frac{\max \left( \frac{\max \varrho _j}{\mu _1}, \frac{\max \frac{1}{\varrho _j}}{\mu _3}\right) }{ \min \left( \frac{\min \varrho _j}{\mu _1}, \frac{\min \frac{1}{\varrho _j}}{\mu _3}\right) }, \end{aligned}$$

which is close to 1 if \(\varrho \) is nearly constant. Therefore, it is expected to be a good preconditioner in this case.

3.6 Time-Step Selection

The time-step stability restrictions of the purely convective subsystem is

$$\begin{aligned} \varDelta t =\text {CFL}^* \cdot \text {cs}\cdot \varDelta x, \end{aligned}$$
(27)

where CFL\(^*\) is some number and the maximum of the characteristic speeds, \(\text {cs}\), is computed, at each time step, as

$$\begin{aligned} \text {cs}=\max \{|V_{k,j}^{(i)}|+\sqrt{C_{p}\gamma (\varrho _{j}^{(i)})^{\gamma -1}} / i=1,\dots ,s,k=1,2,j=1,\dots ,M^2\}. \end{aligned}$$

The scheme is not ensured to be bound preserving, i.e., it might happen that density become negative or the c-variable be outside \([-1,1]\). Purely convective models might develop vacuum regions and the high-order WENO reconstructions might create overshoots near high gradients. Coping with these difficulties is certainly challenging and out of the scope of this paper.

In our case, there is no guarantee that the solution of (25) be in \([-1,1]\). We have used in our simulation the strategy of decreasing CFL\(^*\) (by a factor of 1/2 in our implementation) when |c| reaches some threshold (1.5 in the experiments) and increasing it (by a factor of 2 in our implementation) until a prescribed maximum value CFL otherwise. The rationale behind this strategy is that decreasing \(\varDelta t\) asymptotically ensures bound preservation.

Although we do not have a proof that this strategy always succeeds, the simulations have been successful, in the sense that |c| has been kept always below the threshold, at the expense of local reductions of the parameter CFL\(^*\).

4 Numerical Experiments

The objectives of the experiments in this section are the following:

  1. 1.

    Showing that the order of the global errors in some experiments coincides with the expected design order of the scheme used to obtain them.

  2. 2.

    Showing that some IMEX schemes can perform time steps \(\varDelta t\) with the same stability restrictions as the purely convective subsystem, see (27).

  3. 3.

    Testing the behavior of different issues for the algorithms, such as conservation, number of iterations for the linear solvers, etc.

In all numerical experiments, the adiabatic constant \(\gamma \) has been set to 5/3 and the constant \(C_p\) to 1, unless otherwise stated.

All the results have been obtained with a C++ implementation, using the GNU C++ compiler with optimizations -O3 and running in a single core of an AMD EPYC 7282 3.0 GHz CPU. The matrices of systems (25) and (26) are stored by diagonals.

4.1 One-Dimensional Experiments

4.1.1 Test 1

The purpose of this test is to show that the Explicit Euler solver needs that \(\varDelta t\) be proportional to \(\varDelta x^4\) and that our proposal is stable for \(\varDelta t\) selected by (27) with \(CFL^*=1\) for one-dimensional simulations.

We consider the following initial condition for a one-dimensional test: (\(c_0\) is in the unstable region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\))

$$\begin{aligned}&\rho _0(x)=0.1\cos (2 \pi x)+1.25\\&v_{0}(x) = \sin (\pi x) \\&c_0(x)=0.1\cos ( \pi x) \end{aligned}$$

with parameters \(g=-10\), \(\nu _*=2\nu +\lambda =2\), \(\varepsilon =10^{-4}\). The Explicit Euler scheme (22) blows up for \(M=4000\), and \(\varDelta t=\varDelta x^3\) for \(t\approx { 10^{-10}}\) , whereas, with the same setup and \(\varDelta t = \varDelta x^4\), the code has taken 640000 time steps to get to a simulation time of \(t= 10^{-9}\) without blow up.

The EE-IE and *-DIRKSA blow up for \(M=100\) and \(\varDelta t\) computed by (27) for \(\text {CFL}^*=1.1\) for \(t\approx 10^{-1}\), whereas they do not for \(\text {CFL}^*=1\) and \(M=10000\).

4.1.2 Test 2, 3 and

The purpose of these tests is to have a comparison with tests taken from [16] and the effect of using \(\gamma < 1.5\). The setup of the test requires some changes to the equations, due to a different scaling of the Ginzburg–Landau free energy. Specifically, we obtain approximate solutions for the following system of equations:

$$\begin{aligned} \rho _t+ (\rho v)_x&=0,\\ (\rho v)_t+ (\rho v^2 +\rho ^{\gamma } )_x&= \Big (\nu ^* v_x-\frac{\varepsilon }{2}c_x^2\Big )_x, \\ (\rho c)_t+ (\rho cv)_x&=\left( \frac{1}{\varepsilon }\psi '(c) - \frac{\varepsilon }{\rho } c_{xx}\right) _{xx}, \end{aligned}$$

for \(\nu ^*=1\), \(\varepsilon =10^{-3}\), with \(M=100\), simulated time \(T=100\) and the following initial conditions

  1. 1.

    Test 2 (Example 3 in [16]), \(\gamma =1.5\):

    $$\begin{aligned} \rho _0(x)&=0.9+\frac{1}{1000} \cos (2 \pi (x-1)), \\ v_0(x)&= \frac{1}{2} e^{-50 (x-0.5)^2},\\ c_0(x)&=\tanh \left( \frac{x-0.5}{0.1 \sqrt{5}}\right) . \end{aligned}$$
  2. 2.

    Test 3 (Example 4 in [16]), \(\gamma =1.5\):

    $$\begin{aligned} \rho _0(x)&=0.9+\frac{1}{1000} \cos (2 \pi (x-1)), \\ v_0(x)&= \frac{1}{2} e^{-50 (x-0.5)^2},\\ c_0(x)&=0.75+\frac{1}{5}\tanh \left( \frac{x-0.5}{0.1 \sqrt{5}}\right) . \end{aligned}$$
  3. 3.

    Test 4 (Example 3 in [16]), \(\gamma =1.4\):

    $$\begin{aligned} \rho _0(x)&=0.9+\frac{1}{1000} \cos (2 \pi (x-1)), \\ v_0(x)&= \frac{1}{2} e^{-50 (x-0.5)^2},\\ c_0(x)&=\tanh \left( \frac{x-0.5}{0.1 \sqrt{5}}\right) . \end{aligned}$$

Notice that \(c_0\) does not satisfy the boundary conditions, which are, in this case:

$$\begin{aligned} c_0'(0)=c_0'''(0)=c_0'(1)=c_0'''(1)=0. \end{aligned}$$

The results of the comparisons of Test 2 and Test 3 are displayed in Fig. 1 and show some qualitative similarity with those from [16]. We cannot explain the quantitative difference between our results and those from the cited reference.

Fig. 1
figure 1

Tests 2 and 3: Test 2 corresponds to the Example 3 in [16] and displays phase separation and Test 3 corresponds to the Example 4 in [16] and does not display phase separation

The results of the comparisons of Test 2 and Test 4 are displayed in Fig. 2 and do not show much difference between using \(\gamma =1.5\) and \(\gamma =1.4\).

Fig. 2
figure 2

Test 4: comparison of Example 3 in [16] with \(\gamma =1.5\) and \(\gamma =1.4\)

4.2 Two-Dimensional Tests

4.2.1 Order Test

This test aims to assess that the *-DIRKSA method achieves second-order accuracy in the global errors. For this purpose, we add a forcing term to the equations so that the solution is prescribed. Specifically, the solution in this case is

$$\begin{aligned} \rho ^*(x,y,t)&=\frac{\cos \left( 2\,\pi \,x\right) \,\cos \left( \pi \,y\right) \,\left( t+1\right) }{10}+\frac{5}{4},\\ v^*_1(x,y,t)&= -\sin \left( \pi \,x\right) \,\sin \left( \pi \,y\right) \,\left( 2\,t^2-1\right) ,\\ v^*_2(x,y,t)&= \sin \left( \pi \,x\right) \,\sin \left( 2\,\pi \,y\right) \,\left( t^2+1\right) ,\\ c^*(x,y,t)&= \frac{3}{4}-\frac{\cos \left( \pi \,x\right) \,\cos \left( \pi \,y\right) \,\left( t-1\right) }{10}. \end{aligned}$$

Notice that these functions satisfy the boundary conditions (4). The equations that are solved are the following:

$$\begin{aligned}&\rho _t +{(\rho v_1)_x+(\rho v_2)_{y}}=\rho ^*_t +{(\rho ^* v^*_1)_x+(\rho ^* v^*_2)_{y}},\\&(\rho v_1)_t+{(\rho v_1^2 +C_p\rho ^\gamma )_{x}+(\rho v_1 v_2)_{y}}=\frac{\varepsilon }{2}(c_{y}^2-c_{x}^2)_x -\varepsilon (c_{x}c_y)_{y} \\&\quad +{\nu \varDelta v_1+(\nu +\lambda )( (v_1)_{xx}+(v_2)_{xy})}\\&\quad +(\rho ^* v^*_1)_t+{(\rho ^* (v^*_1)^2 +C_p(\rho ^*)^\gamma )_{x}+(\rho ^* v^*_1 v^*_2)_{y}}-\frac{\varepsilon }{2}((c^*)_{y}^2-(c^*)_{x}^2)_x +\varepsilon (c^*_{x}c^*_y)_{y} \\&\quad -\nu \varDelta v^*_1-(\nu +\lambda )( (v^*_1)_{xx}+(v^*_2)_{xy}), \\&(\rho v_2)_t+{(\rho v_1v_2)_{x}+(\rho v_2^2+C_p\rho ^{\gamma })_{y}}={\rho g}+\frac{\varepsilon }{2}(c_{x}^2-c_{y}^2)_y -\varepsilon (c_xc_y)_x \\&\quad +{\nu \varDelta v_2 +(\nu +\lambda )( (v_1)_{xy}+(v_2)_{yy})}\\&\quad + (\rho ^* v^*_2)_t+{(\rho ^* v^*_1v^*_2)_{x}+(\rho ^* (v^*)_2^2+C_p(\rho ^*)^{\gamma })_{y}}\\&\quad -{\rho ^* g}-\frac{\varepsilon }{2}((c^*)_{x}^2-(c^*)_{y}^2)_y +\varepsilon (c^*_xc^*_y)_x \\&\quad -\nu \varDelta v^*_2 -(\nu +\lambda )( (v^*_1)_{xy}+(v^*_2)_{yy}),\\&(\rho c)_t+{(\rho c v_1)_{x}+(\rho c v_2)_{y}}={\varDelta (\psi '(c) - \frac{\varepsilon }{\rho } \varDelta c)}+(\rho ^* c^*)_t+{(\rho ^* c^* v^*_1)_{x}+(\rho ^* c^* v^*_2)_{y}}\\&\quad -{\varDelta (\psi '(c^*) - \frac{\varepsilon }{\rho ^*} \varDelta c^*)}. \end{aligned}$$

The parameters that have been used for this test are the following:

$$\begin{aligned} \nu =1, \quad \lambda =10^{-1},\quad \varepsilon =10^{-4},\quad g=-10. \end{aligned}$$

For these tests, we have used \(\varDelta t\) given by (27) with CFL=0.4.

For \(M\times M\) grids, with \(M=2^{l}, l=3,\dots ,8\), the global errors for the approximations \(u_{k,i,j}^n\) obtained by the *-DIRKSA method for \(t_n=T=0.01\), are computed as

$$\begin{aligned} e_{M}=\frac{1}{M^2}\sum _{k=1}^{4}\sum _{i,j=1}^{M}|u_{k,i,j}^n-u_{k}(x_{i,j}, T)|, \end{aligned}$$

and are displayed in Table 1, where it can be observed the convergence of the experimental orders of convergence \(\text {EOC}_{M}=\log _2\left( e_{M}/e_{2M}\right) \) towards 2, which is compatible with the scheme being second-order accurate. The analogous experiment is performed for the EE-EI scheme resulting in experimental orders of convergence that decrease away from 2.

Table 1 Computed orders of convergence of global errors of *-DIRKSA and EE-EI IMEX schemes for the test with a forced solution

4.2.2 Tests 1, 2 and 3

For the following two-dimensional tests, we have used \(\varDelta t\) given by (27) with CFL=0.4, which is a safe setup for simulations with the corresponding explicit schemes for the convective part only (isentropic Euler equations).

We consider the following tests:

  • Test 1 (\(c_0\) is in the unstable region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\)):

    $$\begin{aligned}&\rho _0(x, y)=0.1\cos (2 \pi x) \cos (\pi y)+1.25\\&\varvec{v}_{0}(x, y) =( \sin (\pi x) \sin (\pi y), \sin (\pi x) \sin (2\pi y))\\&c_0(x, y)=0.1\cos ( \pi x) \cos (\pi y) \end{aligned}$$
  • Test 2 (\(c_0\) is in the stable region):

    $$\begin{aligned}&\rho _0(x, y)=0.1\cos (2 \pi x) \cos (\pi y)+1.25\\&\varvec{v}_{0}(x, y) =( \sin (\pi x) \sin (\pi y), \sin (\pi x) \sin (2\pi y))\\&c_0(x, y)=0.75+0.1\cos ( \pi x) \cos (\pi y) \end{aligned}$$
  • Test 3: \(\rho =1, \varvec{v}_0=0,\) \(c_0\) has been set to a uniform random sample of 0 mean and \(10^{-10}\) standard deviation.

Notice that these functions satisfy the boundary conditions (4) (for test 3, almost within roundoff error).

In Fig. 3, we show the time evolution of the conservation errors for \(\rho \) and \(q=\rho c\) for Test 3, and parameters \(\nu =10^{-3}, \lambda =10^{-4}, {\varepsilon }=10^{-4}, M=256\), with linear systems solved by the V-cycle multigrid algorithm with relative decrease of residual of \(10^{-12}\) as stopping criterion. Specifically, we approximate

$$\begin{aligned} \int _{\Omega }\rho (x, t_n)d\varvec{x}- \int _{\Omega }\rho (x, 0)d\varvec{x}&\approx \text {err}_{\rho }(t_n)=\sum _{i,j=1}^{M}\varrho _{i,j}^{n}- \sum _{i,j=1}^{M}\varrho _{i,j}^{0} \\ \int _{\Omega }q(x, t_n)d\varvec{x}- \int _{\Omega }q(x, 0)d\varvec{x}&\approx \text {err}_{q}(t_n)=\sum _{i,j=1}^{M}Q_{i,j}^{n}- \sum _{i,j=1}^{M}Q_{i,j}^{0} \end{aligned}$$
Fig. 3
figure 3

Conservation errors for test 3

In Fig. 4 we show the time evolution of the CFL\(^*\) parameter, according to subsection 3.6, for a case for Test 1, with parameters \(\nu =10^{-3},\lambda =10^{-4}, \varepsilon =10^{-5}, M=256\), with the largest number of variations in CFL\(^*\), according to subsection 3.6, in all test cases.

Fig. 4
figure 4

Test 1. Left: Time evolution of the CFL parameter; Right: Time evolution of \(\min c\), \(\max c\)

We show in Figs. 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14 some snapshots of the results obtained for all the tests with *-DIRKSA, \(M=256\), \(g=-10\), \(\nu =10^{-3}, \lambda =10^{-4}, \varepsilon =10^{-4}\), which correspond to flows with Reynolds number roughly in the range \([10^2, 10^3]\).

In Fig. 5, it can be seen that the c-component in the initial condition for Test 1 lies entirely within the spinodal region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\). Therefore, at the early stages of the simulation, at \(T=0.1\), separation occurs forming complex patterns. Meanwhile, it can be appreciated from the pictures corresponding to the \(\rho \)-variable that gravity is acting so that density increases at the bottom boundary, \(y=0\). This trend continues in Fig. 6, where it can be appreciated that the maximal density continues increasing, a sharp upgoing front develops for all the variables, but c, where the diffuse interface experiments many topological changes, with growing regions, a phenomenon named nucleation. At the final stages of the simulation, as seen in Fig. 7, the maximal density decreases, nucleation continues and the bulk flow enters into a seemingly turbulent regime.

Lastly, in Fig. 8 the results for \(T=1.0\) and \(M=64\) and \(M=128\) are displayed in order to be compared with the corresponding result in Fig. 7. As empirically expected, there are larger differences in the c variable than in the others.

Fig. 5
figure 5

Results for Test 1. Left: Initial condition, with c-variable inside spinodal region; Right: Results for \(T=0.1\), where density increases at the bottom and separation is clearly visible in the c-variable

Fig. 6
figure 6

Results for Test 1, \(T=0.3\) (left) and \(T=0.5\) (right) where it can be seen that density continues increasing at the bottom, forming an upgoing front, and nucleation is beginning, as seen in the c-variable

Fig. 7
figure 7

Results for Test1, \(T=0.7\) (left) and \(T=1.0\) (right) where it can be seen in the velocity that vorticity has developed and nucleation is increasing, as seen in the c-variable

Fig. 8
figure 8

Results for Test1, \(T=1.0\) \(M=64\) (left) and \(T=1.0\) \(M=128\) (right)

In Fig. 9, it can be seen that the c-component in the initial condition for Test 2 lies above the spinodal region. Therefore, as seen in the pictures for the c-variable in the snapshots shown in this Figure and also in Fig. 10, the fluid remains almost homogeneous, with c tending to 3/4 in the whole domain, which corresponds to mass fractions \(c_1=\frac{7}{8}, c_{2}=\frac{1}{8}\), which are exactly the initial proportions of the individual species. This fact means that the rest of the equations behave like a uniform fluid governed by the compressible Navier–Stokes equations under gravitation, with Reynolds number high enough for a seemingly turbulent regime.

Fig. 9
figure 9

Results for Test 2. Left: Initial condition, with c-variable above the spinodal region; Right: Results for \(T=0.3\), where it can be seen that density continues increasing at the bottom, forming an upgoing front, while the c-variable is converging towards 0.75

Fig. 10
figure 10

Results for Test 2, \(T=0.6\) (left) and \(T=1.0\) (right) where it can be seen in the velocity that vorticity has developed, while the c-variable has almost fully converged to 0.75

In Fig. 11, it can be seen that the c-component in the initial condition for Test 3 is almost 0, thus lies entirely within the spinodal region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\). Therefore, at the early stages of the simulation, at \(T=0.01\), a typical spinodal decomposition begins appearing in the form of a medium-frequency pattern, corresponding to a solution as in (8)-(9), for \(k_1, k_2\in \mathbb {N}\) that minimize

$$\begin{aligned} -(k_1^2+k_2^2)+\varepsilon \pi ^2 (k_1^2+k_2^2)^2, \end{aligned}$$

corresponding to the expression in (9), for \(c_0=0\), taking into account that \(\psi ''(c_0)=-1\).

The rest of the simulation can be seen in Figs. 12, 13, 14, where the spinodal decomposition continues until nucleation. Density increases at the bottom, but no clear turbulence is appreciated, maybe due to the simulation having been carried only until \(T=0.29\).

Fig. 11
figure 11

Results for Test 3. Left: Initial condition, where it can be seen that the c-component is in the range \((-5\, 10^{-11}, 5\, 10^{-11})\), thus lies entirely within the spinodal region \((-\frac{1}{\sqrt{3}}, \frac{1}{\sqrt{3}})\); Right: for \(T=0.01\) onset of a spinodal decomposition begins appearing with an amplitude around \(10^{-8}\)

Fig. 12
figure 12

Results for Test 3, where it can be seen that density increases at the bottom and the spinodal decomposition continues its development with an amplitude around \(4\, 10^{-5}\) for \(T=0.02\) (left) and 0.2 for \(T=0.03\) (right)

Fig. 13
figure 13

Results for Test 3, where it can be seen that density continues increasing at the bottom and the spinodal decomposition has given a fully developed separation pattern for \(T=0.04\) (left), which has continued towards the onset of nucleation for \(T=0.14\) (right)

Fig. 14
figure 14

Results for Test 3, where nucleation is visible in the c-variable near (0.9, 0.5), with an ever-shrinking region of the second fluid disappearing

Fig. 15
figure 15

Results for Test 3 for times \(T=0.4,0.6,0.8,1.0\)

4.2.3 Test 4

This test is taken from [10] and simulates the evolution dynamics of two merging bubbles, which are initially tangent. Specifically, the initial condition is

$$\begin{aligned} \rho _0(x, y)&=1,\\ \varvec{v}_0(x, y)&=(0, 0),\\ c_0(x, y)&= \tanh (10^4(\sqrt{(x-0.375)^2+(y-0.5)^2}-0.125))\cdot \\&\tanh (10^4(\sqrt{(x-0.625)^2+(y-0.5)^2}-0.125)). \end{aligned}$$

The parameters in our model are \(\varepsilon =10^{-3}, C_p=1000, \gamma =5/3\). We have tried two viscosity parameters \(\lambda =\nu =0.1\) and \(\lambda =\nu =1\).

There are substantial differences between the results reported here and those in the cited reference. This may be explained because our model is compressible and that in the cited reference is incompressible, besides the additional terms in the Cauchy stress tensor being radically different. The most prominent difference is that there seems to be a factor of 2500 between the simulated times reported here and there. Other issue is that there are little differences when changing the viscosity parameter.

The 0 level set of the c variable at times \(T=0,0.002, 0.008,0.04,0.08, 0.12\) (which are 2500 times smaller than those times in the cited reference \(T=0,5,20,\) 100, 200, 300) is displayed in Fig. 16. In Fig. 17 the velocity field and the pressure fluctuations about there mean value are displayed for \(T=0.002, 0.008,\) 0.04, 0.12

Fig. 16
figure 16

Results for Test 4: 0-level set of c for \(T=0,0.002, 0.008,0.04,0.08, 0.12\)

Fig. 17
figure 17

Results for Test 4: the velocity field and the pressure fluctuations about there mean value for \(T=0.002, 0.008,0.04, 0.12\)

Table 2 Average number of multigrid iterations to solve (25) for Test 1

4.3 Linear Solvers

The multigrid solver mentioned in subsection 3.5 for the solution of (26) has shown a very satisfactory performance throughout all tests, requiring almost always only one iteration to achieve convergence to double precision digits.

The performance of the solvers for the solution of (25) is more complex. In Tables 2, 3 and 4 we show the average number of multigrid iterations to solve (25) for tests 1, 2, 3, respectively, with \(\nu =10^{-2},10^{-3},10^{-4}\) and \(\varepsilon =10^{-3},10^{-4},10^{-5}\), for a stopping criterion based on a relative decrease of the residual by a factor of \(10^{-6}\).

It can be deduced from these tables that the number of iterations grows slowly with M for all cases.

In Table 5 we show a comparison between the multigrid and the preconditioned conjugate gradient solvers in subsection 3.5. The results have been obtained with *-DIRKSA, \(M=16,32,64,128,256\), \(g=-10\), \(\nu =10^{-2}, \lambda =10^{-3}, \varepsilon =10^{-4}\). It can be deduced that the preconditioned conjugate gradient solver uses less CPU time than the multigrid solver, although the latter takes fewer iterations than the former.

Table 3 Average number of multigrid iterations to solve (25) for Test 2
Table 4 Average number of multigrid iterations to solve (25) for Test 3
Table 5 Comparison of average number of iterations and CPU time (in seconds) for the preconditioned conjugate gradient and multigrid solvers for (25) and Test 1

5 Conclusions and Future Work

In this paper, we propose efficient linearly implicit-explicit schemes for the two-dimensional compressible isentropic Cahn–Hilliard–Navier–Stokes equations. Some tests are performed to show that they achieve second-order accuracy under time-step stability restrictions dictated only by the convective part of the equations.

If the pressure law is not stiff, then the proposal yields an efficient time-stepping method to solve the isentropic Cahn–Hilliard–Navier–Stokes equations. For large pressure coefficient \(C_p\), the time steps have to be smaller, so including the pressure term in the implicitly treated terms might allow again larger time steps, dictated only by the velocity (akin to low-Mach-number solvers [2]).

As future research, we plan to extend these techniques to other, stiffer pressure laws, and to a three-dimensional setting with Galerkin techniques. We also plan the extension of these techniques to quasi-incompressible models (see [22]).

A crucial part of the algorithms is the iterative linear solvers used for solving the system related to the Cahn–Hilliard subequation. We plan to explore the possibility of using the multigrid solver as preconditioner for the conjugate gradient solver.

Third-order accuracy can be obtained by using fourth-order accurate finite-differences for the spatial discretization and third-order accurate partitioned Runge–Kutta schemes, at the expense of larger stencils and four Runge–Kutta stages.

The code can be parallelized by decomposing the computational domain in smaller rectangles and letting a processor do the job in each rectangle. Communication would be needed for data associated to neighboring cells in different rectangles. More global communication would be needed in case of using multigrid solvers.

The use of bound-preserving high-order reconstructions for discretizing the convective part is planned as a possible mechanism for reducing the regions where \(|c|>1\). Exploring situations and conditions for the solution of the Cahn–Hilliard subsystem (25) being in \([-1, 1]\) will be also undertaken.