EIT Agent
登录
← 校园网页目录

校园网页 · 学校官网

A time-stepping scheme involving constant coefficient matrices for phase-field simulations of two-phase incompressible flows with large density ratios

A time-stepping scheme involving constant coefficient matrices for phase-field simulations of two-phase incompressible flows with large density ratios S. Dong ⇑, J. Shen Department of Mathematics, Purdue University, West Lafayette, IN 47907, United States article info Article history: Received 11 November 2011 Accepted 28 April 2012 Available online 18 May 2012 Keywords: Phase field approach Time stepping scheme Spectral element method Large density ratio Cahn–Hilliard equation abstract We present an efficient time-stepping scheme for simulations of the coupled Navier– Stokes Cahn–Hilliard equations for the phase field approach. The scheme has several attractive characteristics: (i) it is suitable for large density ratios, and numerical experi- ments with density ratios up to 1000 have been presented; (ii) it involves only constant (time-independent) coefficient matrices for all flow variables, which can be pre-computed during pre-processing, so it effectively overcomes the performance bottleneck induced by variable coefficient matrices associated with the variable density and variable viscosity; (iii) it completely de-couples the computations of the velocity, pressure, and the phase field function. Strategy for spectral-element type spatial discretizations to overcome the diffi- culty associated with the large spatial order of the Cahn–Hilliard equation is also discussed. Ample numerical simulations demonstrate that the current algorithm, together with the Navier–Stokes Cahn–Hilliard phase field approach, is an efficient and effective method for studying two-phase flows involving large density ratios, moving contact lines, and interfacial topology changes. /C2112012 Elsevier Inc. All rights reserved. 1. Introduction The essential idea of the (diffusive) phase field approach for two-phase flows is to use a phase field function to describe the two-phase system, and to replace the (sharp) fluid interface with a thin smooth transition layer (i.e. diffuse interface) connecting the two immiscible fluids. The phase field function varies continuously over the transition layer and is mostly uniform in the bulk phases. The concept of a diffuse interface can be traced back to Rayleigh [21] and van der Waals [28] over a century ago; see [1] for a review of related aspects. Among different formulations of phase fields, the energetic variational formulation (see e.g. [18,17]) is particularly attrac- tive. With this formulation, the two-phase flow is characterized by the free energy of the system. The Cahn–Hilliard [3] free energy is the most commonly used in this regard. The governing equations for the two-phase system can be derived by the classical procedure of Lagrangian mechanics based on the least action principle. They consist of a single unified incompress- ible Navier–Stokes equation for the entire flow domain, which includes phase field-dependent density/viscosity and a phase field-dependent force term representing the surface tension effect, coupled with the convective Cahn–Hilliard equation which describes the evolution of the phase field function. 0021-9991/$ - see front matter /C2112012 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/j.jcp.2012.04.041 ⇑ Corresponding author. E-mail address: sdong@math.purdue.edu (S. Dong). Journal of Computational Physics 231 (2012) 5788–5804 Contents lists available at SciVerse ScienceDirect Journal of Computational Physics journal homepage: www.else vier.com/locate/jcp The phase field-based approach exhibits favorable properties in several aspects compared to other related methods. For example, because this approach is physically motivated and the two-phase system is characterized by a free energy, different physical effects, such as complex rheology, can be accounted for by a suitable modification of the free energy. This appears to be a key advantage compared to other interface-capturing methods such as level set, volume of fluids and front tracking [19,23,22,27]. The phase field approach can also handle moving contact lines with ease because of the diffuse interface in- volved within [1,14], while for other approaches the moving contact line problem appears to be considerably challenging. This approach can also naturally capture morphological and topological changes of the interface such as breakup, coales- cence and reconnection, and it employs a single unified set of governing equations formulated over the entire domain, which can be solved on a fixed grid in a purely Eulerian fashion. When numerically simulating the coupled system of Navier–Stokes and Cahn–Hilliard equations, one faces several signif- icant challenges. In particular, the case with large density ratio poses the foremost challenge. When the density ratio be- comes very large (or very small) – for example, the air–water two phase system has a density ratio about 1000 – the commonly-used numerical schemes for incompressible Navier–Stokes equations face stability difficulties. Another main challenge is associated with the variable density and variable viscosity. Both the density and the viscosity change over time because they depend on the phase field function. Therefore, with usual formulations the coefficient matrices of the linear algebraic systems for the pressure and the velocity will be time-dependent. As a result, these coefficient matrices need to be re-computed every time step. This creates a severe bottleneck to the performance. Without a method to overcome this bottleneck, long-time production simulations will be severely hampered due to the high computational cost. A third chal- lenge involves the couplings among the phase field function, the pressure, and the velocity. Algorithms that de-couple the computations of these variables would be highly preferred from the simulation perspective. Finally, somewhat unique to the spectral element (and also to finite element) type approach, which is our method of choice for spatial discretizations in this paper, the high spatial order (4th order) of the Cahn–Hilliard equation presents a special challenge, because deriva- tives of order two or higher does not exist in the discrete function space. Largely owing to the difficulties posed by large density ratios, existing phase field simulations have been mostly confined to cases of matched density or small density ratios where a Boussinesq approximation can be used (which essentially uses a matched density for the two fluids); see e.g. [13,2,17,30,29,4,11,12]. The case with different densities for the two fluids is considered in a few studies with the phase field approach [16,5], which, however, all lead to linear algebraic systems with variable (time-dependent) coefficient matrices for the pressure and the velocity after discretization, resulting in a high com- putational cost. An energy-stable scheme has very recently been discussed in [26,25] with different fluid densities. The scheme results in a weakly coupled linear algebraic system for the velocity and the phase field function with variable coef- ficient matrices. However, most interestingly, only a Poisson equation needs to be solved for the pressure with this scheme, thanks to the adoption of a penalty formulation advocated by [8]. In this paper we present an algorithm for the phase field approach that overcomes the four aforementioned challenges. More specifically, the scheme is suitable for dealing with large density ratios, and numerical simulations with density ratios up to 1000 will be presented. The scheme involves only constant (time-independent) coefficient matrices for all flow vari- ables, which can be pre-computed during pre-processing. This is a splitting scheme based on a velocity-correction type strat- egy (cf., for instance, [10,9]), and the computations for the pressure, velocity and the phase field are completely de-coupled. The difficulty caused by the high spatial order of the Cahn–Hilliard equation for spectral-element (and finite-element) type spatial discretizations is overcome by successively solving two Helmholtz type equations that are de-coupled from each other. Moreover, since the algorithm is based on a velocity-correction formulation, the usual inf-sup condition is not re- quired and equal-order approximations for the velocity and pressure can be employed (cf. [9]). The presented algorithm will be useful not only to the phase field approach, but more generally also applicable to other interface-capturing methods such as level set, volume of fluids and front tracking. For example, the performance bottleneck caused by the time-dependent coefficient matrices associated with variable density/viscosity also exists in these other inter- face-capturing methods. The strategies presented herein will be useful also to those situations. We will also present benchmark test results to demonstrate the physical accuracy of the Navier–Stokes Cahn–Hilliard phase-field model. The study of this aspect seems to be lacking in the current phase-field literature. 2. Algorithm for Navier–Stokes/Cahn–Hilliard coupled system 2.1. Navier–Stokes/Cahn–Hilliard coupled system Let X /C26 Rd (d = 2 or 3) denote the flow domain, and C ¼ @X denote the boundary of X. Consider a mixture of two immis- cible, incompressible fluids contained in X. Let q1 and q2 respectively denote the densities of the two fluids, and l1 and l2 denote their dynamic viscosities. With the phase field approach, this two-phase system is described by the following coupled system of equations: q @u @t þ u /C1ru /C18/C19 ¼/C0 rp þ r /C1lðru þ ruT Þ /C2/C3 /C0 kr /C1r/ /C10r/ðÞ þ fðx; tÞ; ð1aÞ r /C1u ¼ 0; ð1bÞ S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5789 @/ @t þ u /C1r/ ¼/C0 kc1r2 r2/ /C0 hð/Þ hi þ gðx; tÞ: ð1cÞ In the above equations, uðx; tÞ is velocity, pðx; tÞ is pressure, and fðx; tÞ is a body force (such as gravity), where t is time and x is the spatial coordinate. /ðx; tÞ denotes the phase field function, /C0 1 6 / 6 1; The flow regions with / ¼ 1 and / ¼/C0 1 respectively represent the first and the second fluids, and the iso-surface /ðx; tÞ¼ 0 marks the interface between the two fluids at time t. The function hð/Þ is given by hð/Þ¼ 1 g2 // 2 /C0 1 /C0/C1 by assuming a double-well potential, where g is a charac- teristic length scale of the interface thickness. k is the mixing energy density, and is related to the surface tension by [30] k ¼ 3 2 ffiffiffi 2 p rg; ð2Þ where r is the interfacial surface tension and is assumed to be constant in the current paper. c1 is the mobility of the inter- face, and we assume a constant mobility in this paper. In Eq. (1a) the symbol /C10denotes tensor product. The density, q, and the dynamic viscosity, l, are related to the phase field function by, qð/Þ¼ q1 þ q2 2 þ q1 /C0 q2 2 /; lð/Þ¼ l1 þ l2 2 þ l1 /C0 l2 2 /: ð3Þ As a result, both the density and the dynamic viscosity in Eq. (1a) are time-dependent. gðx; tÞ in Eq. (1c) is a given source term for the purpose of numerical testing; gðx; tÞ¼ 0 in practical simulations. The superscript in ð/C1ÞT denotes the transpose of ð/C1Þ. Among the set of Eqs. (1a)–(1c), (1a) is the Navier–Stokes equation, involving a variable density and a variable dynamic viscosity, in which the term kr /C1ðr/ /C10r/Þ represents the surface tension effect. Eq. (1b) is the incompressibility condition on the velocity. Eq. (1c) is the Cahn–Hilliard equation. The derivations of the Cahn–Hilliard equation and the form of the sur- face tension term can be found in e.g. [17], among others. To facilitate subsequent discussions we transform the Navier–Stokes Eq. (1a) into a slightly different but equivalent form: q @u @t þ u /C1ru /C18/C19 ¼/C0 rP þ lr2u þ rl /C1ðru þ ruT Þ/C0 kðr2/Þr/ þ fðx; tÞ; ð4Þ where P ¼ p þ k 2 r/ /C1r/ is an effective pressure, and will also be loosely called pressure hereafter. When obtaining the above equation, we have used Eq. (1b) and the following identities: r /C1lðru þ ruT Þ /C2/C3 ¼ l r2u þ rðr /C1uÞ hi þ rl /C1ðru þ ruT Þ; r /C1ðr/ /C10r/Þ¼ 1 2 rðr/ /C1r/Þþð r2/Þr/: Eqs. (1a)–(1c) are to be supplemented by appropriate boundary and initial conditions for the velocity and the phase field function. We assume the following boundary conditions: ujC ¼ wðx; tÞ; ð5Þ n /C1r/jC ¼ 0; ð6Þ n /C1rðr2/ÞjC ¼ 0; ð7Þ where wðx; tÞ is the prescribed velocity on the domain boundary C, and n is the outward-pointing unit vector normal to the boundary. With the boundary conditions (6) and (7) for the phase field function, we have assumed for simplicity that, if the fluid interface intersects the wall, the contact angle would be 90 0. We will use this assumption about the contact angle throughout this paper. The initial conditions are given by: uðx; 0Þ¼ u0ðxÞ; ð8Þ /ðx; 0Þ¼ /0ðxÞ; ð9Þ where u0ðxÞ and /0ðxÞ are respectively the initial velocity and initial phase field function. Eqs. ((4), (1b), (1c) ), together with the boundary conditions, (5)–(7), and the initial conditions, (8) and (9) , constitute the starting point for the development of our algorithm. 2.2. The Algorithm We shall construct a time discretization scheme by carefully combining three approaches: (i) we use a velocity-correction type strategy to decouple the computation of pressure from that of the velocity; (ii) we split all variable coefficients into a constant (e.g., the average) part and a variable part, and treat the constant part implicitly and the variable part explicitly; (iii) we decompose the fourth-order equation into two independent second-order equations. 5790 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 Let un; Pn, and /n denote the velocity, pressure, and the phase field at time step n, respectively. To obtain these quantities for time step ( n þ 1), we successively solve for the phase field, the pressure, and the velocity as follows: For phase field /nþ1 c0/nþ1 /C0 ^/ Dt þ u/C3 ;nþ1 /C1r//C3 ;nþ1 ¼/C0 kc1r2 r2/nþ1 /C0 S g2 /nþ1 /C0 //C3 ;nþ1/C0/C1 /C0 hð//C3 ;nþ1Þ /C20/C21 þ gnþ1; ð10aÞ n /C1r/nþ1jC ¼ 0; ð10bÞ n /C1rðr2/nþ1ÞjC ¼ 0: ð10cÞ For pressure Pnþ1 c0 ~unþ1 /C0 ^u Dt þ 1 q0 rPnþ1 ¼/C0 NðunÞþ 1 q0 /C0 1 qnþ1 /C18/C19 rPn /C0 lnþ1 qnþ1 r /C2 r /C2 un þ 1 qnþ1 rlnþ1 /C1DðunÞ /C0 k qnþ1 r2/nþ1r/nþ1 þ 1 qnþ1 f nþ1 ; ð11aÞ r /C1~unþ1 ¼ 0; ð11bÞ n /C1~unþ1jC ¼ n /C1wnþ1: ð11cÞ For velocity unþ1 c0unþ1 /C0 c0 ~unþ1 Dt /C0 mmr2unþ1 ¼/C0 Nðu/C3 ;nþ1Þþ NðunÞþ mmr /C2 r /C2 u/C3 ;nþ1 þ 1 q0 /C0 1 qnþ1 /C18/C19 rðPnþ1 /C0 PnÞ /C0 lnþ1 qnþ1 r /C2 r /C2ð u/C3 ;nþ1 /C0 unÞþ 1 qnþ1 rlnþ1 /C1Dðu/C3 ;nþ1Þ/C0 DðunÞ /C2/C3 ; ð12aÞ unþ1jC ¼ wnþ1: ð12bÞ The meanings of the symbols in the above equations are as follows. ~unþ1 is an intermediate velocity, an approximation of unþ1. NðuÞ¼ u /C1ru, and DðuÞ¼ ru þ ruT . Dt is the time step size. If v denotes a generic variable, then ^v and v/C3 ;nþ1 are respectively defined by ^v ¼PJ/C0 1 k¼0akvn/C0 k (J controls the order of temporal accuracy, J ¼ 1 or 2), and v/C3 ;nþ1 ¼PJ/C0 1 k¼0bkvn/C0 k, such that 1 Dt Dvnþ1 ¼ 1 Dt c0vnþ1 /C0 ^v /C0/C1 represents the Jth order backward differentiation formula (BDF) of @v @t at time step ( n þ 1), and that v/C3 ;nþ1 represents a Jth order explicit approximation of vnþ1. More precisely, Dvnþ1 ¼ vnþ1 /C0 vn; if J ¼ 1; 3 2 vnþ1 /C0 2vn þ 1 2 vn/C0 1; if J ¼ 2; ( v/C3 ;nþ1 ¼ vn; if J ¼ 1; 2vn /C0 vn/C0 1; if J ¼ 2: /C26 ð13Þ S is a chosen constant satisfying S P g2 ffiffiffiffiffiffiffiffiffi 4c0 kc1 Dt q . qnþ1 and lnþ1 are respectively the density and dynamic viscosity at time step (n þ 1), determined from Eq. (3) based on /nþ1. The constant q0 is given by q0 ¼ minðq1; q2Þ. The parameter mm is a cho- sen constant satisfying mm P 1 2 maxðl1 ;l2 Þ minðq1 ;q2 Þ . We note that the important feature of the scheme that allows for a constant (time-independent) coefficient matrix for the pressure is the term 1 q0 rPnþ1 in (11a), and also the correction terms, ð 1 q0 /C0 1 qnþ1 ÞrPn in (11a) and ð 1 q0 /C0 1 qnþ1 ÞrðPnþ1 /C0 PnÞ in (12a). The feature that allows for a constant coefficient matrix for the velocity is the term mmr2unþ1 in Eq. (12a), and its ex- plicit counterpart in ‘‘rotational form’’ mmr /C2 r /C2 u/C3 ;nþ1. We note that the basic idea of this type of strategy for dealing with a diffusion term with a variable coefficient was discussed in [7, Section 9, p. 114] , and was also used by other researchers (e.g. [2,24]). The feature of the algorithm that enables a successful treatment of the 4th spatial order of the Cahn–Hilliard equa- tion with spectral elements is the term S g2 ð/nþ1 /C0 //C3 ;nþ1Þ, which was called a stabilization term in [26]. Because //C3 ;nþ1 is a Jth order approximation of /nþ1, this term does not compromise the overall temporal accuracy of the scheme. One can recognize that the procedures for computing the pressure Pnþ1 and the velocity unþ1 overall represents a velocity correction type strategy (see [10]). With the above scheme, the computations for the phase field, the pressure, and the veloc- ity are completely de-coupled. 2.3. Implementation of the algorithm We next discuss the implementation of this scheme, given by Eqs. (10a)–(10c), (11a)–(11c), (12a), (12b) , employing a spectral element discretization in space. The issues discussed herein also apply to C0 finite element discretizations. Because the terms involving second or higher derivatives, such as r /C2 r /C2 u; r2ðr2/Þ and r2/r/, can not be computed directly with C0 spectral (or finite) elements, we will first reformulate the scheme (10a)–(10c), (11a)–(11c), (12a), (12b) into a weak form, which will enable a convenient implementation. We will also eliminate the intermediate velocity ~unþ1 from the formulation. As a result, ~unþ1 is never actually computed. We will defer the discussions on how to solve Eqs. (10a)–(10c) for the phase field /nþ1 and how to deal with the high spatial order to Section 2.4. Here we will assume that both /nþ1 and r2/nþ1 have been computed in an appropriate fashion, and we discuss how to solve for the pressure Pnþ1 and velocity unþ1. S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5791 Given (un; Pn), and suppose that /nþ1 and r2/nþ1 are already available, we determine ( unþ1; Pnþ1) as follows. We first com- pute the density qnþ1 and the viscosity lnþ1 from Eq. (3). Then we set G ¼ 1 qnþ1 f nþ1 /C0 kr2/nþ1r/nþ1 þ rlnþ1 /C1DðunÞ hi þ ^u Dt /C0 NðunÞþ 1 q0 /C0 1 qnþ1 /C18/C19 rPn: ð14Þ Let us denote the vorticity with x ¼ r /C2 u. Take the L2-inner product of Eq. (11a) with rq, and we obtain the following Pois- son equation in the weak form for Pnþ1, Z X rPnþ1 /C1rq ¼ q0 Z X G þ r lnþ1 qnþ1 /C18/C19 /C2 xn /C20/C21 /C1rq /C0 q0 Z C lnþ1 qnþ1 n /C2 xn /C1rq /C0 c0q0 Dt Z C n /C1wnþ1q; 8q 2 H1ðXÞ; ð15Þ where we have used Eqs. (11b) and (11c) , the following identity l q r /C2 x /C1rq ¼ r /C1 l q x /C2 rq /C18/C19 /C0 r l q /C18/C19 /C2 x /C1rq: ð16Þ The intermediate velocity can then be expressed as, based on Eq. (11a), c0 Dt ~unþ1 ¼ G /C0 lnþ1 qnþ1 r /C2 xn /C0 1 q0 rPnþ1 ð17Þ Substitute this expression into Eq. (12a), we set R ¼ 1 qnþ1 f nþ1 /C0 kr2/nþ1r/nþ1 þ rlnþ1 /C1Dðu/C3 ;nþ1Þ hi þ ^u Dt /C0 Nðu/C3 ;nþ1Þ/C0 1 qnþ1 rPnþ1: ð18Þ Then Eq. (12a) is reduced to c0 mmDt unþ1 /C0 r2unþ1 ¼ 1 mm R /C0 1 mm lnþ1 qnþ1 /C0 mm /C18/C19 r /C2 x/C3 ;nþ1: ð19Þ Take the L2-inner product of the above equation with scalar test function u, and we obtain the weak form of this equation for unþ1: c0 mmDt Z X uunþ1 þ Z X ru /C1runþ1 ¼ 1 mm Z X R þ r lnþ1 qnþ1 /C18/C19 /C2 x/C3 ;nþ1 /C20/C21 u /C0 1 mm Z X lnþ1 qnþ1 /C0 mm /C18/C19 x/C3 ;nþ1 /C2 ru /C0 1 mm Z C lnþ1 qnþ1 /C0 mm /C18/C19 n /C2 x/C3 ;nþ1u; 8u 2 H1 0ðXÞ; ð20Þ where H1 0ðXÞ¼ v 2 H1ðXÞ : vjC ¼ 0 no , and we have used the identity ( v denoting a generic scalar variable) vðr /C2 xÞu ¼ r /C2ð xvuÞ/C0 urv /C2 x /C0 vru /C2 x: ð21Þ The reformulated algorithm therefore consists of solving the Poisson Eq. (15) for the pressure Pnþ1 and the Helmholtz type Eq. (20) for the velocity unþ1. The intermediate velocity ~unþ1 is not needed. These equations are in their weak forms, and no derivatives of order two or higher are involved. Spatial discretizations of these weak forms with spectral elements (or finite elements) can be performed in a straightforward fashion. Note that from Eq. (20) different velocity components can be com- puted individually (no coupling among velocity components). One can also note that, in all these equations, only time-inde- pendent coefficient matrices are involved, and they can be pre-computed during pre-processing. Therefore, the performance bottleneck caused by the variable density and variable viscosity is effectively avoided. Let us now consider the spatial discretization of Eqs. (15) and (20) . Let Xh denote domain X discretized with a spectral element mesh, and Ch denote the boundary of Xh. Let Xh /C26½ H1ðXhÞ/C138d and Mh /C26 H1ðXhÞ denote respectively the approximation spaces of velocity unþ1 h and pressure Pnþ1 h . Let Xh0 /C26 H1 0ðXhÞ, where H1 0ðXhÞ¼ v 2 H1ðXhÞ : vjCh ¼ 0 no . Then the discretized Eqs. (15) and (20) become: Find unþ1 h 2 Xh and Pnþ1 h 2 Mh such that Z Xh rPnþ1 h /C1rqh ¼ q0 Z Xh Gh þ r lnþ1 h qnþ1 h ! /C2 xn h "# /C1rqh /C0 q0 Z Ch lnþ1 h qnþ1 h nh /C2 xn h /C1rqh /C0 c0q0 Dt Z Ch nh /C1wnþ1 h qh; 8qh 2 Mh; ð22Þ and c0 mmDt Z Xh uhunþ1 h þ Z Xh ruh /C1runþ1 h ¼ 1 mm Z Xh Rh þ r lnþ1 h qnþ1 h ! /C2 x/C3 ;nþ1 h "# uh /C0 1 mm Z Xh lnþ1 h qnþ1 h /C0 mm ! x/C3 ;nþ1 h /C2 ruh /C0 1 mm Z Ch lnþ1 h qnþ1 h /C0 mm ! nh /C2 x/C3 ;nþ1 h uh; 8uh 2 Xh0; ð23Þ 5792 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 where the subscript in ð/C1Þh represents the discretized version of ð/C1Þ. In our implementation, equal-order approximations have been used for the velocity and the pressure (with a Jacobi poly- nomial-based expansion basis [15]). We observe that this spectral-element approximation can work properly with the cur- rent scheme. In all the numerical tests in Section 3, the same orders of expansion polynomials have been used to approximate the velocity and the pressure in the spectral element discretization. We refer the interested reader to [6] for more detailed discussions on equal-order spectral-element approximations with the velocity-correction type scheme, and the references therein for equal-order approximations by other researchers from the literature. Remarks. In the above discussions, the density qnþ1 and dynamic viscosity lnþ1 are computed according to Eq. (3) using the phase field data /nþ1. This may cause difficulties when the density ratio becomes very large or very small. In simulations we have observed that the numerical values for the phase field function / may not exactly lie within the range ½/C0 1; 1/C138. The phase field value may be slightly out of bound at some points (e.g. by /C24 10/C0 3). We refer the interested reader to [31] for a discussion of the interactions between mass conservation and the minimization of free energy inherent in the Cahn–Hilliard dynamics, which tends to produce a slight shift in the values of the phase field function in the bulk phases. The slightly out- of-bound values of the phase field function does not cause a problem if the density ratio is not very large (or very small). However, if the density ratio is very large (or very small), the density or the dynamic viscosity computed from Eq. (3) may become negative at certain points, thus causing difficulties in the computations. For large density ratios we therefore will define an auxiliary variable ^/ as follows, ^/ ¼ /; if j/j 6 1; signð/Þ; if j/j > 1; /C26 ð24Þ and compute the density and dynamic viscosity based on q ¼ q1 þ q2 2 þ q1 /C0 q2 2 ^/; l ¼ l1 þ l2 2 þ l1 /C0 l2 2 ^/; ð25Þ to maintain their positivity. 2.4. Spatial discretization of Cahn–Hilliard equation with spectral elements To complete the discussions from the previous subsection, let us now focus on how to solve Eqs. (10a)–(10c) for /nþ1 and how to compute r2/nþ1 appropriately. The 4th spatial order of the Cahn–Hilliard Eq. (10a) creates a special difficulty for C0 spectral-element and finite-element type discretizations because these high-order terms cannot be directly computed. We will borrow an idea from [30] to decompose the 4th order Eq. (10a) into two de-coupled Helmholtz type equations. We rewrite Eq. (10a) as: r2 r2/nþ1 /C0 S g2 /nþ1 /C20/C21 þ c0 kc1Dt /nþ1 ¼ Q ð26Þ where Q ¼ 1 kc1 gnþ1 /C0 u/C3 ;nþ1 /C1r//C3 ;nþ1 þ ^/ Dt ! þ r2 hð//C3 ;nþ1Þ/C0 S g2 //C3 ;nþ1 /C20/C21 : Then by adding/subtracting the expression ar2/nþ1 (a being a constant to be determined) on the left hand side of Eq. (26), we obtain: r2 r2/nþ1 þ a/nþ1 hi /C0 a þ S g2 /C18/C19 r2/nþ1 /C0 c0 kc1Dt a þ S g2 /C16/C17 /nþ1 2 4 3 5 ¼ Q : ð27Þ We choose a value such that a ¼/C0 c0 kc1Dt a þ S g2 /C16/C17 ; ð28Þ from which one can obtain a ¼/C0 S 2g2 1 þ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 1 /C0 4c0 kc1Dt g4 S2 s ! ; ð29Þ with the requirement S g2 P ffiffiffiffiffiffiffiffiffi 4c0 kc1 Dt q . Consequently, Eq. (27) is transformed into S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5793 r2w /C0 a þ S g2 /C18/C19 w ¼ Q ; ð30Þ where w is defined by r2/nþ1 þ a/nþ1 ¼ w: ð31Þ With w introduced in the above expression, the boundary condition with Eq. (10c) can be transformed into n /C1rwjC ¼ 0; ð32Þ taking into account Eq. (10b). Therefore, solving Eqs. (10a)–(10c) for /nþ1 is transformed into the following procedure. First, solve Eq. (30) for w, with boundary condition given by Eq. (32). Then, solve Eq. (31) for /nþ1, with boundary condition given by Eq. (10b). One can note that the above procedure involves two de-coupled Helmholtz equations, and constant coefficient matrices. The weak forms for the Eqs. (30) and (31) can be obtained by taking the inner product of these equations with a scalar test function u. They are given by Z X rw /C1ru þ a þ S g2 /C18/C19 Z X wu ¼/C0 Z X 1 kc1 gnþ1 /C0 u/C3 ;nþ1 /C1r//C3 ;nþ1 þ ^/ Dt ! u þ Z X r hð//C3 ;nþ1Þ/C0 S g2 //C3 ;nþ1 /C20/C21 /C1ru; 8u 2 H1ðXÞ; ð33Þ and Z X r/nþ1 /C1ru /C0 a Z X /nþ1u ¼/C0 Z X wu; 8u 2 H1ðXÞ: ð34Þ Note that the boundary conditions given by Eqs. (32) and (10b) have been taken into account when obtaining the weak forms. These weak forms can be directly adopted in the spectral element discretizations. Let us finally add that the surface tension term, r2/nþ1r/nþ1, in Eqs. (14) and (18) can be computed as follows, according to Eq. (31), r2/nþ1r/nþ1 ¼ð w /C0 a/nþ1Þr/nþ1: ð35Þ 2.4.1. Summary of overall solution procedure Our final algorithm for simulating the Navier–Stokes Cahn–Hilliard coupled system can be summarized as follows. Given (un; Pn; /n), it involves the following steps to compute ( unþ1; Pnþ1; /nþ1) with this algorithm: 1. Solve Eqs. (33) and (34) for the phase field /nþ1. 2. Compute density qnþ1 and dynamic viscosity lnþ1 using Eq. (3), or using (25) at large density ratios. 3. Solve Eq. (15) for pressure Pnþ1, using /nþ1. 4. Solve Eq. (20) for velocity unþ1, using Pnþ1 and /nþ1. 2.5. An alternative algorithm In this subsection we briefly describe an alternative algorithm to the one presented above. This alternative algorithm has also been implemented, and observed to be accurate and stable at large density ratios (tested with density ratios up to 1000). Specifically, given ( un; Pn; /n), we use the following procedure to successively solve for /nþ1, Pnþ1, and unþ1: For phase field /nþ1: use Eqs. (10a)–(10c). For pressure Pnþ1 c0 ~unþ1 /C0 ^u Dt þ 1 q0 rPnþ1 ¼/C0 Nðu/C3 ;nþ1Þþ 1 q0 /C0 1 qnþ1 /C18/C19 rP/C3 ;nþ1 /C0 lnþ1 qnþ1 r /C2 r /C2 u/C3 ;nþ1 þ 1 qnþ1 rlnþ1 /C1Dðu/C3 ;nþ1Þ /C0 k qnþ1 r2/nþ1r/nþ1 þ 1 qnþ1 f nþ1 ; ð36aÞ r /C1~unþ1 ¼ 0; ð36bÞ n /C1~unþ1jC ¼ n /C1wnþ1: ð36cÞ For velocity unþ1 c0unþ1 /C0 c0 ~unþ1 Dt /C0 mmr2unþ1 ¼ mmr /C2 r /C2 u/C3 ;nþ1 ð37aÞ 5794 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 unþ1jC ¼ wnþ1: ð37bÞ The notations about the variables in the above scheme follow exactly those outlined in Section 2.2. We have used the same strategies as in Section 2.2 to ensure constant coefficient matrices for the pressure and the velocity. The difference lies in that, in the above scheme we have used the extrapolated velocity u/C3 ;nþ1, and extrapolated pressure P/C3 ;nþ1, for computing the pressure Pnþ1. Accordingly, the form of the velocity Eq. (37a) is simpler than the Eq. (12a) for the original algorithm, with the absence of the correction terms. The implementation of this alternative algorithm follows closely the discussions in Section 2.3. The intermediate velocity ~unþ1 is not explicitly computed. The weak form of the Poisson equation for the pressure Pnþ1 can be obtained from Eqs. (36a)– (36c), and is given by: Z X rPnþ1 /C1rq ¼ q0 Z X 1 qnþ1 f nþ1 þ ^u Dt /C0 k qnþ1 r2/nþ1r/nþ1 þ 1 q0 /C0 1 qnþ1 /C18/C19 rP/C3 ;nþ1 /C20 /C0 Nðu/C3 ;nþ1Þþ 1 qnþ1 rlnþ1 /C1Dðu/C3 ;nþ1Þ þ r lnþ1 qnþ1 /C18/C19 /C2 x/C3 ;nþ1 /C21 /C1rq /C0 q0 Z C lnþ1 qnþ1 n /C2 x/C3 ;nþ1 /C1rq /C0 c0q0 Dt Z C n /C1wnþ1q; 8q 2 H1ðXÞ: ð38Þ The weak form for the velocity unþ1 can be obtained from Eqs. (37a)–(37b), by taking into account the expression for ~unþ1 from Eq. (36a), is given by: c0 mmDt Z X unþ1u þ Z X ru /C1runþ1 ¼ 1 mm Z X 1 qnþ1 f nþ1 þ ^u Dt /C0 k qnþ1 r2/nþ1r/nþ1 þ 1 q0 /C0 1 qnþ1 /C18/C19 rP/C3 ;nþ1 /C20 /C0 1 q0 rPnþ1 /C0 Nðu/C3 ;nþ1Þþ 1 qnþ1 rlnþ1 /C1Dðu/C3 ;nþ1Þþ r lnþ1 qnþ1 /C18/C19 /C2 x/C3 ;nþ1 /C21 u /C0 1 mm Z X lnþ1 qnþ1 /C0 mm /C18/C19 x/C3 ;nþ1 /C2 ru /C0 1 mm Z C lnþ1 qnþ1 /C0 mm /C18/C19 n /C2 x/C3 ;nþ1u; 8u 2 H1 0ðXÞ: ð39Þ One can observe that, like in the original algorithm, only constant coefficient matrices are involved for solving Pnþ1 and unþ1 in this alternative algorithm. In the subsequent section we will use numerical examples to demonstrate the convergence rates, the physical accuracy, and the capabilities of our algorithm for simulating two-phase flows with large density ratios. 3. Numerical tests In this section we use numerical examples to test the algorithm described in the previous section. We will demonstrate the scheme’s spatial and temporal convergence rates, and the physical accuracy of the Navier–Stokes Cahn–Hilliard phase field model with various density ratios. We also show numerical simulations of an air–water two-phase problem, which in- volves moving contact lines, with physical parameters assuming their true values (resulting in a density ratio approximately 829). All numerical tests are in two dimensions. 3.1. Convergence rates We first demonstrate the temporal and spatial convergence rates of the scheme presented in Section 2.2 using a contrived analytic solution to the coupled system of Navier–Stokes and Cahn–Hilliard equations. Consider the rectangular domain X ¼f ðx; yÞ : 0 6 x 6 2; /C0 1 6 y 6 1g. We employ the following unsteady analytic solution to the coupled Navier–Stokes/ Cahn–Hilliard equations, (4), (1b), (1c) , in the convergence tests: u ¼ A cos py sin a0x sin b0t; v ¼/C0 Aa0 p sin py cos a0x sin b0t; P ¼ A sin py sin a0x cos b0t; / ¼ A/ cos ax cos by sin w0t; 8 >> > < >>>: ð40Þwhere A; a0; b0; A/; a; b; w0 are prescribed constants, and ðu; vÞ are the ðx; yÞ components of the velocity u. A time-dependent body force field, f ¼ð fx; fyÞ, and a field of the source term gðx; tÞ in the Cahn–Hilliard Eq. (1c), have been imposed. These fields have been determined in a way such that the solutions given by (40) satisfy the coupled Navier–Stokes Cahn–Hilliard equations. Dirichlet conditions for the velocity computed based on the solution (40), and the no-flux conditions (6)–(7) for the phase field function, are imposed on the boundaries of the domain. Initial conditions for the velocity and the phase field function are given by setting t ¼ 0 to the analytic solution (40). We employ the following values for the physical and numerical parameters in the convergence tests: A ¼ 1:0; a0 ¼ p; b0 ¼ 1:0; A/ ¼ 1:0; a ¼ b ¼ p; w0 ¼ 1:0; q1 ¼ 1:0; q2 ¼ 3:0; l1 ¼ 0:01; l2 ¼ 0:02; k ¼ 0:001; c1 ¼ 0:001; g ¼ 0:1: /C26 ð41Þ S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5795 Note that the physical units for the parameters are not provided here and also in some of the subsequent tests. In such a case, we will assume that a system of consistent physical units have been employed, and they are therefore omitted. To simulate this problem, we partition the domain X along the x direction into two quadrilateral elements of equal size. We employ the scheme described in Section 2.2 to discretize in time, and the spectral element approach to discretize in space, the coupled system of Navier–Stokes and Cahn–Hilliard equations. To test the temporal convergence rate, we use a sufficiently high fixed element order for all elements so that the temporal error will be dominant. We systematically vary the time step size, Dt. For each Dt value we integrate the system from t ¼ 0t o t ¼ tf (tf ¼ 1:0), and then compute the L1 and L2 errors of the velocity and the phase field function, between the numerical solution and the analytic solution (40), at t ¼ tf . To test the spatial convergence rate, we use a sufficiently small fixed time step size so that the spatial error will be dominant. We systematically vary the element order, and for each element order integrate the system from t ¼ 0t o t ¼ tf . We then compute the errors of the numerical solution against the analytic solution (40) at t ¼ tf . Fig. 1 (a) shows the temporal convergence results. Here we plot the errors of the numerical solution for the velocity (x component u), the pressure P, and the phase field function /, as a function of Dt, with a fixed high element order 18. The results are obtained with J ¼ 2; see Eq. (13). A second-order temporal convergence rate has been observed with our scheme. Fig. 1(b) demonstrates the spatial convergence results. Plotted are the L1 and Ł2 errors of the numerical solution for the velocity component u, pressure P, and the phase field /, as a function of the element order, for a fixed small time step size, Dt ¼ 0:001. One can observe that, as the element order increases (within order 10), the numerical errors decrease approx- imately exponentially. As the element order increases to 12 and beyond, the numerical errors remain approximately a con- stant, due to the saturation by the errors associated with temporal discretization. 3.2. Capillary wave In this subsection we use the capillary wave problem, for which an exact solution is available (cf. [20]), to test our scheme and also to look into the physical accuracy of the Navier–Stokes Cahn–Hilliard phase field model. This problem takes into account all the crucial physical effects, such as surface tension, gravity, density ratio, and viscosity ratio. In [20] Prosperetti obtained an exact standing-wave solution to the initial-value problem associated with the small- amplitude waves on the interface between two incompressible viscous fluids in an infinite domain. The two fluids may have different densities and dynamic viscosities, but must have the same kinematic viscosity. More specifically, we assume that the lighter fluid (fluid one) resides in the top half of the domain, and the heavier fluid (fluid two) is in the bottom half of the domain. Let gr denote the magnitude of the gravitational acceleration (pointing downward), r denote the surface tension, and m denote the matching kinematic viscosity of the two fluids. Suppose that the fluid interface is perturbed from the equi- librium position in the form of a sinusoidal wave, with a wave number k (k ¼ 2p kw , kw being the wave length) and an initial small amplitude H0 and zero initial velocity. Then the amplitude of the interface wave, HðtÞ, evolves as the following function over time: Δt Errors 10 -3 10 -2 10 -1 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 L ∞ -u L 2 -u L ∞ -p L 2 -p L ∞ -φ L 2 -φ Reference 1 2 Element order Errors 5 10 15 20 10 -6 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 10 1 10 2 L ∞ -u L 2 -u L ∞ -p L 2 -p L ∞ -φ L 2 -φ (a) (b) Fig. 1. Temporal and spatial convergence rates: L1 and L2 errors of the velocity ( x component u), pressure P, and phase field function / as a function of time step size Dt (a) showing temporal second-order accuracy, and as a function of the element order (b), showing spatial exponential convergence rate with increasing element order until the error is saturated by temporal error when the element order is large. 5796 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 HðtÞ H0 ¼ 4ð1 /C0 4bÞm2k 4 8ð1 /C0 4bÞm2k 4 þ x2 0 erfc ffiffiffiffiffiffiffiffiffiffi mk 2 t q/C18/C19 þ X4 i¼1 zi Zi x2 0 z2 i /C0 mk 2 eðz2 i /C0 mk2 Þt erfc zi ffiffi t p/C16/C17 ; ð42Þ where x2 0 ¼ ðq2 /C0 q1Þgr k þ rk 3 q1 þ q2 ; b ¼ q1q2 ðq1 þ q2Þ2 ; ð43Þ and erfc( z) is the complementary error function of a complex variable z. zi (i ¼ 1; ... ; 4) are the four roots of the algebraic equation z4 /C0 4b ffiffiffiffiffiffiffiffi mk 2 q z3 þ 2ð1 /C0 6bÞmk 2 z2 þ 4ð1 /C0 3bÞ mk 2 /C16/C17 3 2 z þð 1 /C0 4bÞm2k 4 þ x2 0 ¼ 0; ð44Þ and Zi ¼ Y 1 6 j 6 4 j–i ðzj /C0 ziÞ; i ¼ 1; ... ; 4: ð45Þ To simulate this capillary wave problem, we assume that the initial amplitude of the perturbation wave is H0 ¼ 0:01, and choose a computational domain, X ¼ð x; yÞ : 0 6 x 6 1; /C0 1 6 y 6 1fg . We assume that the equilibrium position of the fluid interface coincides with the x-axis, and that the capillary wave-length equals the dimension of the domain in x-direction, i.e. kw ¼ 1. We further assume zero initial velocity, and that the initial perturbation profile of the interface is given by y ¼ H0 cos kx; k ¼ 2p kw ¼ 2p: ð46Þ Therefore, the initial phase field function is given by the following hyperbolic tangent function, /ðx; 0Þ¼ tanh y /C0 H0 cos kxffiffiffi 2 p g ! : ð47Þ We choose the following values for the gravitational acceleration, the surface tension, and the kinematic viscosity: gr ¼ 1:0; r ¼ 1:0; m ¼ l1 q1 ¼ l2 q2 ¼ 0:01: ð48Þ Periodic conditions are imposed along the x-direction for both the velocity and the phase field function. In the y-direction, for the velocity we impose the no-slip wall condition at the lower boundary y ¼/C0 1 and no flux condition, @u @n ¼ 0, at the upper boundary y ¼ 1. For the phase field function we impose the conditions (6), (7) at both lower and upper y boundaries. The computational domain is partitioned with 240 quadrilateral elements, with 10 and 24 elements respectively in x- and y-directions. The elements are uniform in the x-direction, and are non-uniform and clustered around the region /C0 0:012 6 y 6 0:012 in y-direction. We simulate this problem using the algorithm presented in Section 2.2, for several density/dynamic-viscosity ratios. Let us first consider a matched density for the two fluids, q1 ¼ q2 ¼ 1. Because of the matched kinematic viscosity requirement for the existence of the exact solution, we have l1 ¼ l2 ¼ q1m ¼ 0:01. We use a fixed interface mobility c1 ¼ 10/C0 5, and the mixing energy density k is computed according to Eq. (2). Let us first look into the convergence of simulation results with respect to spatial and temporal parameters. In Fig. 2 (a) we plot time histories of the amplitude of the capillary wave, HðtÞ, computed with different time step sizes, Dt ¼ 10/C0 4; 5 /C2 10/C0 5 and 2:5 /C2 10/C0 5. These results are obtained with a fixed ele- ment order 14 for all elements, and an interface thickness g ¼ 0:005. One observes that the curves for these Dt values exactly overlap with one another, suggesting the convergence of the results with respect to the time step size. Fig. 2(b) shows time histories of the capillary wave amplitude computed with different element orders, ranging from 12 to 18, and a fixed time step size Dt ¼ 10/C0 4 and interface thickness g ¼ 0:005. The exact overlap of the curves indicates that the simulation results have converged with respect to the spatial resolution. Fig. 2(c) shows time histories of the capillary wave amplitude corresponding to different interface thickness values, rang- ing from g ¼ 0:02 to 0 :003. These are obtained with a fixed Dt ¼ 10/C0 4 and element order 14. One can observe significant changes in the time history as the interface thickness is reduced from g ¼ 0:02 to g ¼ 0:01, little but noticeable changes as g decreases from 0.01 to 0.0075, and virtually no changes in the time history as g decreases to 0.005 and below. Note the initial amplitude of the capillary wave, H0 ¼ 0:01, and the relative magnitudes of the interface thickness values with re- spect to H0. In Fig. 2(d) we compare time histories of the capillary wave amplitude between our converged simulation results and the exact solution (42) obtained by Prosperetti [20]. Our simulation result corresponds to Dt ¼ 10/C0 4, element order 14, and g ¼ 0:003. We observe that the time history from the simulation exactly overlaps with Prosperetti’s exact solution. This S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5797 indicates that our algorithm, and the Navier–Stokes Cahn–Hilliard phase field model, have produced physically accurate re- sults for the capillary wave problem with matched densities. We have also tested other values for the mobility c1, and observe that the simulation results are virtually the same when c1 becomes small ( c1 ¼ 10/C0 4 and below for this case). Let us next consider the capillary wave problem with other density ratios. We have also performed simulations with den- sity ratios q2 q1 ¼ 10; 100, and 1000. In these simulations we assume a unit density for the first fluid, q1 ¼ 1, which results in a dynamic viscosity l1 ¼ 0:01 for the first fluid. Accordingly, the second fluid will have densities q2 ¼ 10; 100 and 1000, and dynamic viscosities l2 ¼ 0:1; 1 and 10 for these density ratio values, noting the requirement of matched kinematic viscosity for the exact capillary wave solution. We have also conducted tests to ensure the convergence of simulation results with respect to spatial and temporal parameters and resolutions. In Fig. 3 (a)–(c) we compare the time histories of the capillary wave amplitude for these density ratios between the converged simulation results and the exact solutions by Prosperetti [20]. The simulation results correspond to a time step size Dt ¼ 2:5 /C2 10/C0 5, element order 14, interface thickness g ¼ 0:002, and mobility c1 ¼ 10/C0 5. It is evident that the time histories from the simulations virtually overlap with those of the exact solutions for all density ratios. The inset of Fig. 3 (b) is a blow-up view of the two curves at density ratio q2 q1 ¼ 100 to show the small difference between simulation and the exact solution. The simulation results agree with Prosp- eretti’s exact solution very well, at both small and large density ratios. We would like to reiterate that, in our tests with the capillary wave problem, we have included essentially all the impor- tant physical effects usually encountered in practical simulations, namely, surface tension, gravity, different densities and different viscosities. The test results show that our algorithm can effectively handle large density ratios and viscosity ratios. (a) (b) (c) (d) Fig. 2. Capillary wave (matched density q1 ¼ q2 ¼ 1): Comparison of time histories of capillary wave amplitude with different time step sizes Dt (a), with different element orders (b), with different interface thickness g values (c), and between simulation result and the capillary-wave exact solution by Prosperetti [20] (d). In (a), element order 14, g ¼ 0:005; In (b), Dt ¼ 10/C0 4 ; g ¼ 0:005; In (c), Dt ¼ 10/C0 4 , element order 14; In (d), Dt ¼ 10/C0 4 , element order 14, g ¼ 0:003. Mobility c1 ¼ 10/C0 5 for all cases. 5798 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 They also demonstrate quantitatively that the phase field model of coupled Navier–Stokes Cahn–Hilliard equations can pro- duce physically accurate results. 3.3. Rising air bubble in water and moving contact lines In this subsection we test our scheme by simulating an actual air–water two-phase system and its interactions with solid walls. We consider a solid container containing water and an air bubble inside. The air bubble rises through the water, and breaks up on the upper container wall, forming an air cavity at the top of the container. This problem involves bubble defor- mation, fluid interface breakup and re-connection, and moving contact lines. We will simulate this process with our algo- rithm presented in Section 2, to demonstrate the capabilities of the scheme for dealing with such physical phenomena at the actual air–water density ratio and viscosity raio. More specifically, we consider a rectangular container with dimensions L /C2 3 2 L (L values to be specified later), which occu- pies the domain X ¼ð x; yÞ : /C0 L 2 6 x 6 L 2 ; 0 6 y 6 3 2 L /C8/C9 . The container is filled with water, which traps an air bubble inside; see Fig. 4(a). At t ¼ 0, the air bubble is circular with a diameter L 2 and its center located at ðx0; y0Þ¼ð 0; L 2Þ, and the bubble is at rest. The gravity is assumed to point downward ( /C0 y direction). We assume that the physical parameters about the air/water take their actual values, specifically, air : density q1 ¼ 1:204 kg=m3; dynamic viscosity l1 ¼ 1:78 /C2 10/C0 5 kg=ðm /C1sÞ; water : density q2 ¼ 998:207 kg=m3; dynamic viscosity l2 ¼ 1:002 /C2 10/C0 3 kg=ðm /C1sÞ; air-water surface tension r ¼ 7:28 /C2 10/C0 2 kg=s2; gravitational acceleration gr ¼ 9:8m =s2: 8 >> > >< >>> > : ð49Þ We further assume that, if the air–water interface intersects the wall, the contact angle on the wall would be 90 0. The above physical parameters result in a density ratio and a dynamic viscosity ratio: (a) (b) (c) Fig. 3. Capillary wave (different density ratios): Comparison of time histories of the capillary wave amplitude between simulation and Prosperetti’s exac t solution [20] for density ratios (a) q2 q1 ¼ 10, (b) q2 q1 ¼ 100, (c) q2 q1 ¼ 1000. Simulation results correspond to time step size Dt ¼ 2:5 /C2 10/C0 5 , element order 14, interface thickness g ¼ 0:002, and mobility c1 ¼ 10/C0 5 . S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5799 q2 q1 ¼ 829:08; l2 l1 ¼ 56:29: ð50Þ We normalize the physical variables and parameters in a consistent fashion. Specifically, all the length variables are normal- ized by the width of the container, L. The velocity is normalized by U ¼ ffiffiffiffiffiffiffiffiffi gr0L p , where gr0 ¼ 1m=s2. The density variable is normalized by the air density, q1. All the other flow variables can be normalized consistently, for example, time by L U, pres- sure by q1U2, surface tension by q1U2L, dynamic viscosity variable by q1UL, gravitational acceleration by gr0, mixing energy (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) Fig. 4. Time sequence of snapshots of an air bubble (initially circular, diameter 0 :3 cm) rising in water within a container (dimension 0 :6c m /C2 0:9 cm), eventually attaching to the upper container wall with a water drop trapped within. (a) t ¼ 0:025, (b) t ¼ 0:275, (c) t ¼ 0:525, (d) t ¼ 0:775, (e) t ¼ 0:9, (f) t ¼ 0:975, (g) t ¼ 1:0, (h) t ¼ 1:025, (i) t ¼ 1:275, (j) t ¼ 1:525, (k) t ¼ 1:775, (l) t ¼ 2:0. Shown is the contour level /ðx; tÞ¼ 0. Length has been normalized by the container width L, and the time has been normalized by ffiffiffiffiffiffiffiffiffiffiffi L=gr0 p . 5800 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 density by q1U2L2, mobility by L q1 U. In the following presentations of the results, the flow/physical variables are all in non- dimensional forms; their units are understood to be in terms of the above normalization constants. To simulate this problem we discretize the domain with 150 quadrilateral elements (10 elements in x and 15 in y direc- tions, both uniform). An element order 14 has been used for all the elements. No slip condition for the velocity is imposed on the container walls; the boundary conditions for the phase field function are given by the Eqs. (6), (7).A t t ¼ 0, zero velocity is assumed, and the phase field is given by the following hyperbolic tangent function, /ðx; y; 0Þ¼/C0 tanh ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðx /C0 x0Þ2 þð y /C0 y0Þ2 q /C0 R0 ffiffiffi 2 p g 0 @ 1 A; ð51Þ where R0 ¼ 1 4 is the initial radius of the air bubble. In the simulations we employ an interface thickness g ¼ 0:01, and the mixing energy density k is determined based on Eq. (2). We choose the mobility c1 such that kc1 has a constant value, kc1 ¼ 10/C0 7. A time step size Dt ¼ 2:5 /C2 10/C0 5 has been used in the simulations. We have considered several cases with different container sizes, L ¼ 0:6c m; 1 cm, and 2 cm. Accordingly, the air bubble initially has diameters, 0.3 cm, 0.5 cm, and 1 cm, corresponding to these cases. Due to the competition and the difference in relative importance between the buoyancy (gravity) effect and the surface tension effect, the air–water two-phase system exhibits quite different dynamical features for these cases. Let us first consider the case with a container dimension 0 :6c m /C2 0:9 cm, and an air bubble of initial diameter 0.3 cm. Fig. 4 shows a sequence of snapshots in time of the air–water interface, visualized by the contour level /ðx; tÞ¼ 0, for this (a) (b) (c) (d) (f) (g) (h) (i) (e) (j) (k) (l) (m) (n) (o) Fig. 5. Time sequence of snapshots of an air bubble (initially circular, diameter 0 :5 cm) rising in water within a container (dimension 1 cm /C2 1:5 cm), showing the bubble breakup on the upper container wall and the formation of an air cavity. (a) t ¼ 0:025, (b) t ¼ 0:275, (c) t ¼ 0:4, (d) t ¼ 0:525, (e) t ¼ 0:65, (f) t ¼ 0:775, (g) t ¼ 0:9, (h) t ¼ 1:025, (i) t ¼ 1:275, (j) t ¼ 1:4, (k) t ¼ 1:525, (l) t ¼ 1:775, (m) t ¼ 1:9, (n) t ¼ 2:025, (o) t ¼ 2:525. S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5801 case. Note that the container dimensions and the time are both non-dimensional in the plots, whose physical units are respectively in terms of L and ffiffiffiffiffiffiffiffiffiffiffi L=gr0 p . From t ¼ 0 to about t ¼ 0:9( Fig. 4(a)–(e)), the air bubble rises through the water inside the container, and it deforms approximately into an oval during the rising process. The shape of the air bubble never assumes a ‘‘terminal’’ shape, and it changes continuously over time, due to the limited container height and the strong effect of the (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) (m) (n) (o) (p) (q) (r) (s) (t) Fig. 6. Time sequence of snapshots of an air bubble (initially circular, diameter 1 cm) rising in water within a container (dimension 2 cm /C2 3 cm), showing the air–water interface breakup and re-connection and the formation of an air cavity at the top of container. (a) t ¼ 0:025, (b) t ¼ 0:275, (c) t ¼ 0:4, (d) t ¼ 0:525, (e) t ¼ 0:65, (f) t ¼ 0:775, (g) t ¼ 0:9, (h) t ¼ 1:025, (i) 1 :275, (j) t ¼ 1:525, (k) t ¼ 1:6, (l) t ¼ 1:65, (m) t ¼ 1:7, (n) t ¼ 1:725, (o) t ¼ 1:825, (p) t ¼ 1:85, (q) t ¼ 1:875, (r) t ¼ 1:925, (s) t ¼ 2:275, (t) t ¼ 2:525. 5802 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 walls. From approximately t ¼ 0:975 and onward ( Fig. 4 (f)–(l)) the air bubble contacts and attaches to the upper container wall. The air–water interface breaks up into two pieces. The inner piece of the interface traps a small water drop on the upper wall and inside the air bubble, while the outer piece separates the air and the bulk of water. Both the inner and the outer pieces of the air–water interface are approximately semi-circular, with both ends attached to the upper wall. One can ob- serve that moving contact lines are formed on the upper container wall upon breakup of the air–water interface. Note that the contact angle has been assumed to be 90 0 in current simulations. We would like to point out that, with the phase field approach, no-slip condition for the velocity is imposed on the solid walls, and no special processing is needed for simulating moving contact lines because of the diffuse interface involved within (see [14] for detailed discussions in this regard). One can observe the oscillation in the shape of the water drop trapped inside the air bubble ( Fig. 4(g)–(i)), and also in the semi- circular shape of the outer piece of air–water interface over time ( Fig. 4 (g)–(l)). Next we consider the case with a 1 cm /C2 1:5 cm container and an air bubble of an initial diameter 0 :5 cm. In Fig. 5 we plot a temporal sequence of snapshots of the air–water interface for this case. The dynamical characteristics observed here are nota- bly different from those in the previous case with a smaller air bubble and container. First, as the air bubble rises through the water (Fig. 5(a)–(i)), the bubble deformation seems notably more significant than the previous case; for example, one can ob- serve a flat bottom side in the shape of the bubble ( Fig. 5(b)–(c)). In addition, during the rising process the dimension of the bubble in the vertical direction can be clearly observed to undulate for this case. Most interestingly, after the air bubble con- tacts the upper container wall and the air–water interface breaks up into two pieces ( Fig. 5(j)), while the inner piece of the interface becomes semi-circular and traps a water drop on the upper wall, the outer piece of the interface experiences very large motions. The contact lines formed initially between the outer piece of the interface and the upper wall move sideways (Fig. 5(k)–(l)), and eventually spread over to the side walls ( Fig. 5(m)). As a result, the outer piece of the interface becomes a horizontal interface separating the air and the water, and an air cavity is formed at the top of the container (Fig. 5(m)–(o)). The semi-circular water drop attached onto the upper wall can be observed inside the air cavity from the plots. Again the lengths have been normalized by the container width in the plots. Although the water drop for this case appears comparable to that of the previous case in non-dimensional size, the difference in their actual sizes is much more significant. The case with an even larger container, 2 cm /C2 3 cm, and an air bubble of diameter 1 cm exhibits significantly more com- plicated dynamics. In Fig. 6 we show a temporal sequence of snapshots of the air–water interface for this case. One can evi- dently observe that the bubble experiences much more considerable deformations during the rising process for this case than for the previous cases ( Fig. 6 (a)–(j)). The undulation in the vertical dimension of the bubble is even more evident in this case, as the bubble rises through the water. Upon the bubble’s contact with the upper wall and breakup of the air–water interface, the dynamics exhibits more complicated features not observed in previous cases. After the air–water interface breaks up into two pieces on the upper wall ( Fig. 6 (k)), the inner piece of the interface traps a water drop onto the upper wall and inside the air bubble. However, unlike in previous cases, the surface tension in this case is apparently not strong enough to sustain the weight of the water drop, because the size of the water drop is larger (note again that the plots show non-dimensional lengths). Consequently, one can observe that the water drips from the upper wall ( Fig. 6 (l)–(m)), pierces the outer piece of the air–water interface ( Fig. 6(n)). The inner and the outer pieces of the air–water interface thus reconnect at this point, and the air bubble is effectively divided into two smaller bubbles by the dripping water from the upper wall (Fig. 6(n)–(o)). As the water drip is depleted from the upper wall, the two air–water interfaces that form the vertical water- dripping ‘‘channel’’ reconnect with each other, and detach from the upper wall ( Fig. 6(p)). At this point, the two air bubbles merge to become a single air pocket at the upper wall ( Fig. 6 (q)), and single piece of air–water interface is present in the system. Over time, the contact lines initially formed on the upper wall move over to the side walls ( Fig. 6 (r)). An air cavity is eventually formed at the top of the container, with a horizontal air–water interface with moving contact lines on the two side walls ( Fig. 6 (s)–(t)). To summarize, this test problem involves large density ratios and viscosity ratios, and the physical effects of gravity, sur- face tension, and solid walls, as well as large deformations and topological changes of the fluid interface, such as interfacial breakup and re-connection, and moving contact lines. The physical parameters involved in the problem assume their actual physical values. The simulation results demonstrate that, our algorithm, and the phase field approach with the Navier– Stokes Cahn–Hilliard coupled system, can be an effective method for simulating the air–water two-phase systems involving the above challenging issues. 4. Concluding remarks We have presented an efficient time-stepping scheme for simulating the coupled Navier–Stokes Cahn–Hilliard equations for two-phase flows with the phase field approach. Our algorithm has the following attractive properties: /C15It is capable of dealing with large density ratios. Ample numerical simulations with density ratios up to 1000 have been presented. /C15It involves only constant (time-independent) coefficient matrices for all flow variables after discretization, which can be pre-computed during pre-processing. The scheme effectively overcomes the performance bottleneck caused by variable coefficient matrices associated with the variable density and variable viscosity, which entails re-computation of the coef- ficient matrices every time step. S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804 5803 /C15It is a splitting type scheme and completely de-couples the computations of the velocity, pressure and the phase field function. /C15It effectively overcomes the high-spatial-order difficulty of the Cahn–Hilliard equation caused to spectral element (and finite element) type spatial discretizations, by successively solving two Helmholtz type equations that are de-coupled from each other. /C15It is based on a velocity-correction type formulation, so the usual inf-sup condition is not required and equal-order approximations for the velocity and pressure can be employed (cf. [9]). The strategies employed in the current algorithm for producing constant coefficient matrices will also be useful to other types of interface-capturing methods such as level set, volume of fluids and front tracking, as similar issues are also present in those methods. Our numerical tests demonstrate quantitatively that the Navier–Stokes Cahn–Hilliard phase field model is a physically accurate approach (see Section 3.2). Our simulations show that the current algorithm, together with the Navier–Stokes Cahn–Hilliard phase field approach, is an efficient and effective method for studying two-phase flows involving interesting physical effects such as large density ratios, moving contact lines, and interfacial topology changes. Acknowledgement S.D. gratefully acknowledges the support from ONR and NSF; J.S. is partially supported by AFOSR and NSF. Computer time was provided by XSEDE through an XRAC grant. References [1] D.M. Anderson, G.B. McFadden, A.A. Wheeler, Diffuse-interface methods in fluid mechanics, Annu. Rev. Fluid Mech. 30 (1998) 139–165. [2] V.E. Badalassi, H.D. Ceniceros, S. Banerjee, Computation of multiphase systems with phase field models, J. Comput. Phys. 190 (2003) 371–397. [3] J.W. Cahn, J.E. Hilliard, Free energy of a nonuniform system, I interfacial free energy, J. Chem. Phys. 28 (1958) 258–267. [4] H.D. Ceniceros, R.L. Nos, A.M. Roma, Three-dimensional fully adaptive simulations of phase-field fluid models, J. Comput. Phys. 229 (2010) 6135–6 155. [5] H. Ding, P.D.M. Spelt, C. Shu, Diffuse interface model for incompressible two-phase flows with large density ratios, J. Comput. Phys. 226 (2007) 20 78– 2095. [6] S. Dong, J. Shen, An unconditionally stable rotational velocity-correction scheme for incompressible flows, J. Comput. Phys. 229 (2010) 7013–70 29. [7] D. Gottlieb, S.A. Orszag, Numerical analysis of spectral methods: theory and applications, SIAM-CMBS, 1977. [8] J.-L. Guermond, A. Salgado, A splitting method for incompressible flows with variable density based on a pressure poisson equation, J. Comput. Phy s. 228 (2009) 2834–2846. [9] J.L. Guermond, P. Minev, J. Shen, An overview of projection methods for incompressible flows, Comput. Methods Appl. Mech. Eng. 195 (2006) 6011– 6045. [10] J.L. Guermond, J. Shen, Velocity-correction projection methods for incompressible flows, SIAM J. Numer. Anal. 41 (2003) 112–134. [11] Q. He, R. Glowinski, X.-P. Wang, A least squares/finite element method for the numerical solution of the Navier–Stokes–Cahn–Hilliard system mod eling the motion of the contact line, J. Comput. Phys. 230 (2011) 4991–5009. [12] J. Hua, P. Lin, C. Liu, Q. Wang, Energy law preserving C0 finite element schemes for phase field models in two-phase flow computations, J. Comput. Phys. 230 (2011) 7115–7131. [13] D. Jacqmin, Calculation of two-phase Navier–Stokes flows using phase-field modeling, J. Comput. Phys. 155 (1999) 96–127. [14] D. Jacqmin, Contact-line dynamics of a diffuse fluid interface, J. Fluid Mech. 402 (2000) 57–88. [15] G.E. Karniadakis, S.J. Sherwin, Spectral/hp Element Methods for Computational Fluid Dynamics, 2., Oxford University Press, 2005. [16] J. Kim, A continuous surface tension force formulation for diffuse-interface models, J. Comput. Phys. 204 (2005) 784–804. [17] C. Liu, J. Shen, A phase field model for the mixture of two incompressible fluids and its approximation by a fourier-spectral method, Physica D 179 (2003) 211–228. [18] J. Lowengrub, L. Truskinovsky, Quasi-incompressible Cahn–Hilliard fluids and topological transitions, Proc. R. Soc. London A 454 (1998) 2617– 2654. [19] S.J. Osher, J.A. Sethian, Fronts propagating with curvature dependent speed: algorithms based on Hamilton–Jacobi formulations, J. Comput. Ph ys. 79 (1988) 12–49. [20] A. Prosperetti, Motion of two superposed viscous fluids, Phys. Fluids 24 (1981) 1217–1223. [21] L. Rayleigh, On the theory of surface forces II, Phil. Mag. 33 (1892) 209. [22] R. Scardovelli, S. Zaleski, Direct numerical simulation of free-surface and interfacial flow, Annu. Rev. Fluid Mech. 31 (1999) 567–603. [23] J.A. Sethian, P. Semereka, Level set methods for fluid interfaces, Annu. Rev. Fluid Mech. 35 (2003) 341–372. [24] J. Shen, X. Yang, An efficient moving mesh spectral method for the phase-field model of two-phase flows, J. Comput. Phys. 228 (2009) 2978–2992. [25] J. Shen, X. Yang, Energy stable schemes for Cahn–Hilliard phase-field model of two-phase incompressible flows, Chin. Ann. Math. Ser. B 31 (2010) 74 3– 758. [26] J. Shen, X. Yang, A phase-field model and its numerical approximation for two-phase incompressible flows with different densities and viscositie s, SIAM J. Sci. Comput. 32 (2010) 1159–1179. [27] S.O. Unverdi, G. Tryggvason, A front-tracking method for viscous incompressible multi-fluid flows, J. Comput. Phys. 100 (1992) 25–37. [28] J. van der Waals, The thermodynamic theory of capillarity under the hypothesis of a continuous density variation, J. Stat. Phys. 20 (1893) 197–24 4. [29] X. Yang, J.J. Feng, C. Liu, J. Shen, Numerical simulations of jet pinching-off and drop formation using an energetic variational phase-field meth od, J. Comput. Phys. 218 (2006) 417–428. [30] P. Yue, J.J. Feng, C. Liu, J. Shen, A diffuse-interface method for simulating two-phase flows of complex fluids, J. Fluid Mech. 515 (2004) 293–317. [31] P. Yue, C. Zhou, J.J. Feng, Spontaneous shrinkage of drops and mass conservation in phase-field simulations, J. Comput. Phys. 223 (2007) 1–9. 5804 S. Dong, J. Shen / Journal of Computational Physics 231 (2012) 5788–5804

采集于

查看校方原文 ↗