arXiv:1611.08622v1 [math.NA] 25 Nov 2016 pcfidpesr,tmeaue n oa rcin.Second, det uniquely fractions. be molar a not and is might density state) temperature, the of pressure, so equation density, specified Peng-Robinson the to 20 (e.g. respect 19, 11, state with [10, of limitations equation essential [4,8,17,2 alistic some applications has many in framework used NPT-based NPT-based extensively are so-called tradition been variables (the has the state framework composition In thermodynamic chemical the and velocity. fluids, temperature, fluid multiphase and modeling variables of state years. thermodynamic recent scale of the pore in tha the gas reservoir natural in gas of role shale source especially important important reser flow, very increasingly fluid and plays subsurface chemical It of the simulation in 27]. [2 25, topic state 20, 19, of research [10–14, equation challenging Peng-Robinson and (e.g. attractive state of equation realistic nrydsiain elsi qaino state. of equation Realistic dissipation; Energy out carried numeri are proposed tests the Numerical method. that dissipation. prove th We energy velocity (free) rigor. and mathematical densities a fr molar with Helmholtz between of relations splitting convex-concave coupling novel densiti stron a molar the propose between from relations we result coupling tight difficulties dissipatio and key energy density the (free) flui model, total of proposed the the equation, force satisfies balance driving model momentum primary gradi proposed the the of become potential formulation gradients partia chemical new potential the and a describe to gradient can d leads pressure that we of phases the thermodynamics, equation bulk between of transport and law interfaces a second both derive the Different we using by then framework. Furthermore, and thermody NPT-based related equation, and the thermodynamics balance u lates of in model law a first energy proposed the is combine The free which fluids. Gibbs framework realistic NVT-based than the mult the model the to of describe framework principles to proposed the is on state) of equation Robinson igo fSuiAai.Email: Scien Arabia. of Saudi University of Abdullah Kingdom King Engineering, and Science China. AS eerhfn oteCmuainlTasotPhenome Transport Computational the to fund research KAUST ∗ ‡ † M ujc classifications. subject AMS words. Key Abstract. hswr sspotdb ainlNtrlSineFoundati Science Natural National by supported is work This orsodn uhr opttoa rnpr Phenomena Transport Computational author. Corresponding colo ahmtc n ttsis ue niern Un Engineering Hubei Statistics, and Mathematics of School h ahmtclmdl fmlihs ud r fe omltdb formulated often are fluids multiphase of models mathematical The .Introduction. 1. IUAINO UT-OPNN W-HS FLOW TWO-PHASE MULTI-COMPONENT OF SIMULATION HROYAIAL OSSETMDLN AND MODELING CONSISTENT THERMODYNAMICALLY eea iueitraemdlwt elsi qaino equation realistic a with model interface diffuse general A ut-opnn w-hs o;Dffs nefc oe;Pa model; interface Diffuse flow; two-phase Multi-component OE IHPRILMISCIBILITY PARTIAL WITH MODEL oeigadsmlto fmlihs udsseswt a with systems fluid multiphase of simulation and Modeling IHN KOU JISHENG [email protected] 51;7T0 49S05 76T10; 65N12; † AND 1 HY SUN SHUYU sadvlct.T eov hs problems, these resolve To velocity. and es ovrf h ffcieeso h proposed the of effectiveness the verify to of simulation numerical For time. with n og eycrflpyia observations physical careful very rough eeeg est n elwl ihthe with well deal and density energy ee . oin oevr epoeta the that prove we Moreover, motion. d eadTcnlg,Tua 23955-6900, Thuwal Technology, and ce -opnn w-hs udflwbased flow fluid two-phase i-component olnaiyo emot reenergy free Helmholtz of nonlinearity g nsi salse,adti relation this and established, is ents entropy the derive to relations namical icblt ftoflis relation A fluids. two of miscibility l e h emot reeeg rather energy free Helmholtz the ses a ceecnpeev h discrete the preserve can scheme cal h emot reeeg density. energy free Helmholtz the rv e fuie qain for equations unified of set a erive hc eosrtsta chemical that demonstrates which aLaboratory. na lentv vrteNPT-based the over alternative t vriy ioa 300 Hubei, 432000, Xiaogan iversity, no hn N.1013,and (No.11301163), China of on aoaoy iiino Physical of Division Laboratory, rmtecasclruie,we routines, classical the from ‡ 2]sae htthe that states [25] ] a eoean become has 6]) ∗ rmwr) This framework). 5.Frt re- a First, 25]. , tt eg Peng- (e.g. state f ] oee,the However, 2]. an become has t orengineering voir rie o the for ermined ui equation cubic ta miscibility; rtial oeigand modeling lframework al h pressure, the set a y specification of pressure, temperature, and mole fractions does not always determine the equilibrium state of the system uniquely. In addition, in compositional fluid sim- ulation, the pressure is not known a-priori and there exists no intrinsic equation for the pressure. This leads to the complication of constructing the pressure evolution equation for application of the NPT-based framework [25]. In order to resolve the issues of the NPT-based framework, an alternative frame- work [19] has been developed, and it uses the moles, volume, and temperature (the so-called NVT-based framework) as the primal state variables. The NVT-based frame- work is initially applied to the phase-split computations of multi-component fluids at the constant moles, volume and temperature (also called NVT flash computation) in [19], and for the subsequent research progress of the NVT flash computation, we refer to [10,11,15,20]. Recently, the NVT-based framework has been successfully applied in the numerical simulation of compositional two-phase flow in porous me- dia [25]. Very recently, in [16], we have extended the NVT-based framework to the pore scale and developed a diffuse interface model to simulate multi-component two- phase flow with partial miscibility, but the rigorous mathematical analysis is absent to demonstrate the consistency with the thermodynamical laws. In this work, we will propose a general mathematical model for multi-component two-phase flow with partial miscibility, which is viewed as an extension of the NVT-based framework. Moreover, the proposed model is derived with the mathematical rigor based on the thermodynamic laws and a realistic equation of state (e.g. Peng-Robinson equation of state). The diffuse-interface models for two-phase incompressible immiscible fluids have been developed in the literature, [1] for instance. The proposed model in this work can characterize the compressibility and partial miscibility. A significant contribution in [1] is that an additional term involving mass diffusions is introduced in the momentum equation to ensure consistency with thermodynamics for the case of non-matched densities. As shown in our derivations of Section 3, we find that an analogical term that also results from mass diffusions is crucial to establish the thermodynamically consistent model of compressible and partially miscible multi-component two-phase flow. This term occurs in the momentum equation through a different but natural derived form, which satisfies the thermodynamic laws. A major distinction is that the NVT-based framework uses the Helmholtz free energy rather than Gibbs free energy used in the NPT-based framework. The first challenging problem caused by this transition is that the traditional techniques [7,18] can no longer work well to derive the two-phase flow model. It is well known that the entropy balance equation plays a fundamental role in the derivations of two-phase flow model. In the classical non-equilibrium thermodynamics [7, 18], the variation of entropy dS exists, so the Gibbs relation can be used to derive this key equation. However, when the Helmholtz free energy is introduced in the Gibbs relation, the variation of entropy dS is eliminated. As a result, the Gibbs relation cannot be used to derive the entropy balance equation as in the classical thermodynamics. In this work, we resolve this problem by combing the first law of thermodynamics and the related physical relations, and from this, we derive consistent entropy balance equations. Different from the NPT-based framework, we use a thermodynamic pressure, which is no longer an independent state variable in the NVT-based framework, and indeed, it is a function of the molar density and temperature. Consequently, it is never necessary to construct the pressure evolution equation although the velocity field is no 2 longer divergence-free. The proposed model is related to the dynamic van der Waals theory of two-phase fluid flow for a pure substance with the thermodynamic pressure, which is developed from physical point of view [23, 24]. Such model is first proposed in [23, 24], and it has successful applications [29] for example. But the proposed model has substantial differences from [23, 24] that we consider the fluids composed of multiple components and introduce an additional term involving mass diffusions in the momentum equation by a natural way. Moreover, we establish the relation between the pressure gradient and gradients of the chemical potentials. Based on these relations, we derive a new formulation of the momentum conservation equation, which shows that the gradients of chemical potentials become the primary driving force of the fluid motion. This formulation allows us to conveniently prove that the total (free) energy of the proposed model is dissipated with time. For numerical simulation, a main challenge of diffuse interface models is to design efficient numerical schemes that preserve the discrete (free) energy dissipation [3,5,28]. There are a lot of efforts on the developments of such schemes in the literature; in particular, a notable progress is that efficient numerical simulation methods for simu- lating the model of [1] have been proposed in [5,28]. The key difficulties encountered in constructing energy-stable numerical simulation for the proposed model are the strong nonlinearity of Helmholtz free energy density and tight coupling relations be- tween molar densities and velocity. To resolve these problems, we propose a novel convex-concave splitting of Helmholtz free energy density and deal well with the cou- pling relations between molar densities and velocity through very careful physical observations with a mathematical rigor. The proposed numerical scheme is proved to preserve the discrete (free) energy dissipation. The key contributions of our work are listed as below: (1) A general diffuse interface model with a realistic equation of state (e.g. Peng- Robinson equation of state) is proposed to describe the multi-component two-phase fluid flow based on the principles of the NVT-based framework. (2) We combine the first law of thermodynamics and the related physical relations to derive the entropy balance equations, and then we derive a transport equation of the Helmholtz free energy density. Finally, using the second law of thermodynamics, we derive a set of unified equations for both interfaces and bulk phases that can describe the partial miscibility of two fluids. (3) A term involving mass diffusions is naturally included in the momentum equa- tion to ensure consistency with thermodynamics. (4) We prove a relation between the pressure gradient and the gradients of the chemical potentials, and from this, we derive a new formulation of the momentum balance equation, which demonstrates that chemical potential gradients become the primary driving force of the fluid motion. (5) We prove that the total (free) energy of the proposed model is dissipated with time. (6) An energy-dissipation numerical scheme is proposed based on a convex-concave splitting of Helmholtz free energy density and a careful treatment of the coupling re- lations between molar densities and velocity. Numerical tests are carried out to verify the effectiveness of the proposed method. The rest of this paper is organized as follows. In Section 2, we will introduce the related thermodynamic relations. In Section 3, we derive a general model for multi-component two-phase fluid flow. In Section 4, we prove the total (free) energy dissipation law of the proposed model. In Section 5, we propose an efficient energy- 3 stable numerical method, and in Section 6 numerical tests are carried out to verify effectiveness of the proposed method. Finally, concluding remarks are provided in Section 7. 2. Thermodynamic relations. 2.1. Primal thermodynamic relations. We consider a fluid mixture com- posed of M components under a constant temperature (T ). We denote the molar T density vector by n = [n1,n2, ,nM ] , where ni is the molar density of the ith component. Furthermore, we denote··· the overall volume by V , and then the moles of component i is Ni = niV . The NVT-based framework uses the moles of each component (Ni) and volume (V ) together with the given constant temperature as the primal state variables. With the relation ni = Ni/V , the primal state variables can be reduced into the molar density (n). By fundamental laws of thermodynamics [8], we have the Gibbs relation [7]
M dU = T dS pdV + µ dN , (2.1) − i i i=1 X where U is the internal energy, T is the temperature, S is the entropy, p is the pressure, and µi is the chemical potential of component i. We define the Helmholtz free energy as usual:
F = U T S. (2.2) − With the definition of the Helmholtz free energy, we get dU = dF + T dS, and thus, the Gibbs relation (2.1) becomes
M dF = pdV + µ dN . (2.3) − i i i=1 X We first note that the entropy balance equation plays a fundamental role in the derivations of two-phase flow model. In the classical derivations [7, 18], the Gibbs relation is used to derive this key equation because it contains the variation of entropy dS. However, we can see from (2.3) that after the Helmholtz free energy is introduced in the Gibbs relation, the variation of entropy dS is eliminated. As a result, the Gibbs relation cannot be used to derive the entropy equation as in the classical theory, and it is clearly in need of the other alternative relations. In order to resolve this problem, we will use the first law of thermodynamics and the entropy structure rather than the Gibbs relation to derive the entropy balance equation. F We now define the Helmholtz free energy density as f = V , and then have its form
M f = p + µ n . (2.4) − i i i=1 X In general, the Helmholtz free energy density is a function of n and temperature. 2.2. Helmholtz free energy and a realistic equation of state. We intro- duce briefly the formulations of Helmholtz free energy density fb(n) of a homogeneous bulk fluid determined by Peng-Robinson equation of state, which is widely used in 4 the oil reservoir and chemical engineering. The proposed model can also apply the other realistic cubic equations of state, for instance, the van der Waals equation of state [23, 24], which is popularly used in physics. The Helmholtz free energy density fb(n) of a bulk fluid is calculated by a ther- modynamic model as
ideal repulsion attraction fb(n)= fb (n)+ fb (n)+ fb (n), (2.5)
ideal repulsion attraction where fb , fb and fb are formulated in the appendix. The mole- pressure-temperature form of Peng-Robinson equation of state [26] is
nRT an2 p = , (2.6) 1 bn − 1+2bn b2n2 − − which is a cubic equation of the overall molar density n. In the mathematical sense, (2.6) might have not a unique solution for the specified pressure, temperature, and molar fractions (that is, p,T,yi are given and thus a,b are known). It is a well-known drawback of the NPT-Based framework. However, under the NVT-based framework, (2.6) can always provide a unique and explicit pressure for given molar density and temperature. We note that for bulk fluids, the PR-EOS formulation (2.6) is equivalent to the pressure equation (see the details in the appendix)
M p = µ n f, (2.7) i i − i=1 X which results from (2.4). However, the pressure equation (2.7) is more general and it can be also used to define and calculate the pressure of an inhomogeneous fluid. For realistic fluids, the diffuse interfaces always exist between two phases. The interfacial partial miscibility is a phenomenon that the two-phase fluids behave on the interfaces. To model this feature, a local density gradient contribution is introduced into the Helmholtz free energy density of inhomogeneous fluids. The general form of Helmholtz free energy density (denoted by f) is then the sum of two contributions: Helmholtz free energy density of bulk homogeneous fluid and a local density gradient contribution:
f = fb + f∇, (2.8) where
M 1 f∇ = c n n . (2.9) 2 ij ∇ i · ∇ j i,j=1 X
Here, cij is the cross influence parameter. The density gradient contribution accounts for the phase transition by the gradual density changes of each component on the interfaces. But for a bulk phase, the molar density of each component has uniform distribution in space, and in this case, f∇ vanishes. For the influence parameters, it is generally considered constant in this paper (see the appendix). The chemical potential of component i is defined as
M δf(n,T ) µ = = µb (c n ) , (2.10) i δn i − ∇ · ij ∇ j i T j=1 X 5 b ∂fb(n,T ) δ where µi = ∂ni and δni is the variational derivative. Moreover, the general T pressure can be formulated as
M p = n µ f i i − i=1 X M M 1 = p n (c n ) c n n , (2.11) b − i∇ · ij ∇ j − 2 ij ∇ i · ∇ j i,j=1 i,j=1 X X M b where pb = i=1 niµi fb. From (2.11), the pressure is a function of n and T in the NVT-based framework,− but it is no longer an independent state variable as it is so in the NPT-basedP framework. 3. Mathematical modeling of multi-component two-phase flow. In this section, we will derive the general model for the multi-component two-phase fluid flow, in which the viscosity and density gradient contribution to free energy are under consideration. First, we use the first law of thermodynamics and entropy splitting structure to derive an entropy equation, and then we derive a transport equation of Helmholtz free energy density to further reduce the entropy equation. From the reduced entropy equation, we derive a general model of multi-component two-phase flow, which obeys the second law of thermodynamics. 3.1. Entropy equation. The first law of thermodynamics states d(U + E) dW dQ = + , (3.1) dt dt dt where t is the time, E is the kinetic energy, W is the work done by the face force Ft, and Q stands for the heat transfer from the surrounding that occurs to keep the system temperature constant. We split the total entropy S into a summation of two contributions. One is the entropy of the system, denoted by Ssys. The other is the entropy of the surrounding, denoted by Ssurr, which has the relation with Q as dQ dS = . (3.2) surr − T
Taking into account the relation U = F + TSsys, and using (3.1) and (3.2), we have dS dS dS = sys + surr dt dt dt dS 1 dQ = sys dt − T dt dS 1 d(U + E) dW = sys dt − T dt − dt 1 d(F + E) 1 dW = + . (3.3) −T dt T dt
We denote by Mw,i the molar weight of component i, and define the mass density of the mixture as
M ρ = niMw,i. (3.4) i=1 X 6 In a time-dependent volume V (t), we define the entropy, Helmholtz free energy and kinetic energy within V (t) as
1 S = sdV, F = fdV, E = ρ u 2dV, (3.5) 2 | | ZV (t) ZV (t) ZV (t) where s is the entropy density and u is the mass-averaged velocity. Applying the Reynolds transport theorem and the Gauss divergence theorem, we deduce that
dS ∂s = dV + (us) dV, (3.6) dt ∂t ∇ · ZV (t) ZV (t)
dF ∂f = dV + (uf) dV, (3.7) dt ∂t ∇ · ZV (t) ZV (t) and dE 1 ∂ (ρu u) 1 = · dV + (u (ρu u)) dV dt 2 ∂t 2 ∇ · · ZV (t) ZV (t) ∂u 1 ∂ρ = ρu + u u dV · ∂t 2 · ∂t ZV (t) 1 + (ρu u) u + (u u) u ρ + ρu (u u) dV 2 · ∇ · · · ∇ · ∇ · ZV (t) ∂u 1 ∂ρ = ρu + u u dV · ∂t 2 · ∂t ZV (t) 1 + (u u) (ρu)+2ρu (u u) dV 2 · ∇ · · · ∇ ZV (t) ∂u 1 ∂ρ = ρu + u u dV + u u + (ρu) dV. (3.8) · ∂t · ∇ 2 · ∂t ∇ · ZV (t) ZV (t) In presence of a fluid velocity field, the mass transfer in fluids takes place through the convection in addition to the diffusion of each component. Thus, the mass balance law for component i gives us
∂n i + (un )+ J =0, (3.9) ∂t ∇ · i ∇ · i where J i is the diffusion flux of component i and its formulation will be discussed in the latter of this section. Multiplying (3.9) by Mw,i and summing them from i = 1 to M, we obtain the mass balance equation
M ∂ρ + (ρu)+ M J =0. (3.10) ∂t ∇ · w,i∇ · i i=1 X Substituting (3.10) into (3.8), we have
M dE du 1 = ρu dV M ( J ) (u u) dV dt · dt − 2 w,i ∇ · i · V (t) V (t) i=1 Z Z X 7 M du = u ρ + M J u dV · dt w,i i · ∇ V (t) i=1 ! Z X M 1 M ((u u)J ) dV, (3.11) −2 w,i∇ · · i V (t) i=1 Z X where du = ∂u + u u. dt ∂t · ∇ The work done by Ft is expressed as
dW = F uds. dt t · Z∂V (t)
Cauchy’s relation between face force Ft and the stress tensor σ of component i gives F = σ ν, and as a result, t − · dW = (σ ν) uds dt − · · Z∂V (t) = σT : u + u ( σ) dV, (3.12) − ∇ · ∇ · ZV (t) where ν is the unit normal vector towards the outside of V (t). We note that the other external forces including gravity force is ignored in this work, but the model derivations can be easily extended to the cases in the presence of external forces. Substituting (3.6), (3.7), (3.11) and (3.12) into (3.3), and taking into account the arbitrariness of V (t), we obtain the entropy balance equation
∂s 1 M ∂f T + (us) = M ((u u)J ) (uf) σT : u ∂t ∇ · 2 w,i∇ · · i − ∂t − ∇ · − ∇ i=1 X M du u ρ + M J u + σ . (3.13) − · dt w,i i · ∇ ∇ · i=1 ! X In the following subsections, we will derive the transport equation of Helmholtz free energy density to reduce the entropy equation. 3.2. Transport equation of Helmholtz free energy density. From the def- inition of pb, we have
M M M p = n µb f = n µb + µb n µb n = n µb.(3.14) ∇ b ∇ i i − b i∇ i i ∇ i − i ∇ i i∇ i i=1 ! i=1 i=1 X X X Using the relation (3.14) and component mass balance equation (3.9), we derive the transport equation of Helmholtz free energy density fb as
M M ∂f ∂n b = µb i = µb ( (n u)+ J ) ∂t i ∂t − i ∇ · i ∇ · i i=1 i=1 X X M M M = n µbu p u (p u)+ n u µb µb J −∇ · i i − b − ∇ · b i · ∇ i − i ∇ · i i=1 ! i=1 i=1 X X X 8 M = (f u) (p u)+ u p µb J −∇ · b − ∇ · b · ∇ b − i ∇ · i i=1 X M = (f u) p u µb J . (3.15) −∇ · b − b∇ · − i ∇ · i i=1 X The gradient contribution of Helmholtz free energy density can be formulated as
M M ∂f∇ 1 ∂ i,j=1 cij ni nj ∂n = ∇ · ∇ = c n j ∂t 2 ∂t ij ∇ i · ∇ ∂t P i,j=1 X M = c n (un )+ J − ij ∇ i · ∇ ∇ · j ∇ · j i,j=1 X M M = ( (un )) c n ( J ) c n − ∇ · ∇ · j ij ∇ i − ∇ · ∇ · j ij ∇ i i,j=1 i,j=1 X X M M + n ( u) (c n )+ (u n ) (c n ) j ∇ · ∇ · ij ∇ i · ∇ j ∇ · ij ∇ i i,j=1 i,j=1 X X M + ( J ) (c n ) , (3.16) ∇ · j ∇ · ij ∇ i i,j=1 X and
1 M (f∇u)= u c n n ∇ · 2∇ · ij ∇ i · ∇ j i,j=1 X 1 M 1 M = c n n u + u c n n .(3.17) 2 ij ∇ i · ∇ j ∇ · 2 · ∇ ij ∇ i · ∇ j i,j=1 i,j=1 X X Combining (3.15)-(3.17), we deduce the transport equation of the Helmholtz free energy f as
∂f ∂fb ∂f∇ + (fu)= + (f u)+ + (f∇u) ∂t ∇ · ∂t ∇ · b ∂t ∇ · M M = p u µb J ( (un )) c n − b∇ · − i ∇ · i − ∇ · ∇ · j ij ∇ i i=1 i,j=1 X X M M + ( u) n (c n )+ (u n ) (c n ) ∇ · i∇ · ij ∇ j · ∇ j ∇ · ij ∇ i i,j=1 i,j=1 X X M M ( J ) c n + ( J ) (c n ) − ∇ · ∇ · j ij ∇ i ∇ · j ∇ · ij ∇ i i,j=1 i,j=1 X X M M 1 1 + c n n u + u (c n n ) 2 ij ∇ i · ∇ j ∇ · 2 · ∇ ij ∇ i · ∇ j i,j=1 i,j=1 X X 9 M M 1 = p n (c n ) c n n u − b − i∇ · ij ∇ j − 2 ij ∇ i · ∇ j ∇ · i,j=1 i,j=1 X X M M µb J ( (un )) c n − i ∇ · i − ∇ · ∇ · j ij ∇ i i=1 i,j=1 X X M M + (u n ) (c n ) ( J ) c n · ∇ j ∇ · ij ∇ i − ∇ · ∇ · j ij ∇ i i,j=1 i,j=1 X X M M 1 + ( J ) (c n )+ u (c n n ) ∇ · i ∇ · ij ∇ j 2 · ∇ ij ∇ i · ∇ j i,j=1 i,j=1 X X M M = p u µ J + (u n ) (c n ) − ∇ · − i∇ · i · ∇ i ∇ · ij ∇ j i=1 i,j=1 X X M M ( (un )) c n ( J ) c n − ∇ · ∇ · j ij ∇ i − ∇ · ∇ · j ij ∇ i i,j=1 i,j=1 X X M 1 + u (c n n ) . (3.18) 2 · ∇ ij ∇ i · ∇ j i,j=1 X Taking into account the identity
M M M 1 ( n ) (c n )+ (c n n )= (c n n ) , ∇ i ∇ · ij ∇ j 2 ∇ ij ∇ i · ∇ j ∇ · ij ∇ i ⊗ ∇ j i,j=1 i,j=1 i,j=1 X X X we can reformulate (3.18) as
∂f M M + (fu)= p u µ J + u c ( n n ) ∂t ∇ · − ∇ · − i∇ · i · ∇ · ij ∇ i ⊗ ∇ j i=1 i,j=1 X X M M ( (un )) c n ( J ) c n − ∇ · ∇ · j ij ∇ i − ∇ · ∇ · j ij ∇ i i,j=1 i,j=1 X X M M = p u + c ( n n ) u (µ J ) − ∇ · ∇ · ij ∇ i ⊗ ∇ j · − ∇ · i i i,j=1 i=1 X X M M ( (un )) c n ( J ) c n − ∇ · ∇ · j ij ∇ i − ∇ · ∇ · j ij ∇ i i,j=1 i,j=1 X X M M c ( n n ) : u + J µ . (3.19) − ij ∇ i ⊗ ∇ j ∇ i · ∇ i i,j=1 i=1 X X 3.3. Model equations. Substituting (3.19) into (3.13), we reformulate the en- tropy equation as
M M ∂s 1 T + (us) = M ((u u)J ) c ( n n ) u ∂t ∇ · 2 w,i∇ · · i − ∇ · ij ∇ i ⊗ ∇ j · i=1 i,j=1 X X 10 M M + (µ J )+ ( (un )) c n ∇ · i i ∇ · ∇ · j ij ∇ i i=1 i,j=1 X X M M + ( J ) c n J µ σT : u ∇ · ∇ · j ij ∇ i − i · ∇ i − ∇ i,j=1 i=1 X X M + pI + c ( n n ) : u ij ∇ i ⊗ ∇ j ∇ i,j=1 X M du u ρ + M J u + σ , (3.20) − · dt w,i i · ∇ ∇ · i=1 ! X where I is the second-order identity tensor. We consider the fluid mixture in a closed system with the fixed total moles for each component. Let Ω denote the domain with the fixed volume. The natural boundary conditions can be formulated as
u γ =0, J γ =0, n γ =0. (3.21) · ∂Ω i · ∂Ω ∇ i · ∂Ω
where γ∂Ω denotes a normal unit outward vector to the boundary ∂Ω. Integrating (3.20) over the entire domain, we obtain the change of total entropy S with time
M M ∂S T = J µ dx σT pI c ( n n ) : udx ∂t − i · ∇ i − − − ij ∇ i ⊗ ∇ j ∇ Ω i=1 Ω i,j=1 Z X Z X M du u ρ + M J u + σ dx. (3.22) − · dt w,i i · ∇ ∇ · Ω i=1 ! Z X where x Ω. According to the second law of thermodynamics, the total entropy shall not decrease∈ with time. Using this principle, we can determine the complete forms of multi-component two-phase flow model. First, we consider an ideal reversible process to get the form of the reversible stress, and the reversibility implies that there exist no effects of viscosity and friction. In this case, the entropy shall be conserved, so the diffusions vanish, i.e. J i = 0, and the total tress σ becomes equal to the reversible stress, denoted by σrev, which must have the form
M σ = pI + c ( n n ) . (3.23) rev ij ∇ i ⊗ ∇ j i,j=1 X The last term on the right-hand side of (3.22) shall also be zero as
du ρ + σ =0. (3.24) dt ∇ · rev For the realistic irreversible multi-component chemical systems, the driving force for diffusion of each component is the gradient of chemical potentials, so we express the diffusion flux for each component as [6, 16]
M J = µ , i =1, ,M, (3.25) i − Mij ∇ j ··· j=1 X 11 M M where = ( ij )i,j=1 is the mobility. Onsager’s reciprocal principle [7] requires the symmetry of MM, and moreover, the second law of thermodynamics demands that M is positive semidefinite or positive definite, i.e.
M M J µ = µ µ 0, (3.26) i · ∇ i − Mij ∇ i · ∇ j ≤ i=1 i,j=1 X X which ensures the non-negativity of the first term on the right-hand side of (3.22). In general principle, J i may depend on the chemical potential gradients of other components except for component i. In numerical tests of this paper, we take a special case of M that is a diagonal positive definite matrix; indeed, we use the following diffusion flux [6, 15]
D n J = i i µ , (3.27) i − RT ∇ i
where Di > 0 is the diffusion coefficient of component i. For the realistic viscous flow, the total stress can be split into two parts: reversible part (i.e. σrev given in (3.23)) and irreversible part (denoted by σirrev); that is,
σ = σrev + σirrev. (3.28)
Newtonian fluid theory suggests
2 σ = η u + uT ξ η u I, (3.29) irrev − ∇ ∇ − − 3 ∇ · where ξ is the volumetric viscosity and η is the shear viscosity. We assume that η> 0 2 and ξ > 3 η. So the second term on the right-hand side of (3.22) is non-negative. The non-negativity of the last term on the right-hand side of (3.22) requires that
M du ρ + M J u + σ =0. (3.30) dt w,i i · ∇ ∇ · i=1 X Substituting (3.23), (3.28) and (3.29) into (3.30), we obtain the complete momen- tum balance equation as
M ∂u 2 ρ + u u + M J u = ξ η u p ∂t · ∇ w,i i · ∇ ∇ − 3 ∇ · − i=1 X M + η u + uT (c n n ) , (3.31) ∇ · ∇ ∇ − ∇ · ij ∇ i ⊗ ∇ j i,j=1 X which is also equivalent to
M ∂ (ρu) 2 + (ρu u)+ M (u J )= ξ η u p ∂t ∇ · ⊗ w,i∇ · ⊗ i ∇ − 3 ∇ · − i=1 X M + η u + uT (c n n ) . (3.32) ∇ · ∇ ∇ − ∇ · ij ∇ i ⊗ ∇ j i,j=1 X 12 M If J i is taken such that i=1 Mw,iJ i = 0, then (3.32) is reduced into the form in [16], but for the general formulations of J , the term M M J u or M M P i i=1 w,i i · ∇ i=1 w,i∇ · (u J i) is essential to ensure the thermodynamical consistency [1]. ⊗In summary, the proposed mathematical modelP of multi-componenPt two-phase flow is formulated by a nonlinear and fully coupled system of equations including the mass conservation equation (3.9) coupling with the diffusion flux (3.25) and the chem- ical potential (2.10), and the momentum balance equation (3.31) or (3.32) coupling with the pressure formulation (2.11). 4. Energy dissipation. In this section, we will demonstrate the total (free) energy dissipation property of the proposed model, which seems not an obvious con- clusion from its derivation, but it is required for thermodynamical consistency and it is essential to design the stable and efficient numerical methods in the next section. To do this, we first reformulate the momentum conservation equation by a simpler form. This requires the following theorem regarding the relations between the gradients of the pressure and chemical potentials. Theorem 4.1. The gradients of the pressure and chemical potentials have the following relation
M M n µ = p + (c n n ) . (4.1) i∇ i ∇ ∇ · ij ∇ i ⊗ ∇ j i=1 i,j=1 X X M b Proof. We recall the relation pb = i=1 ni µi proved in (3.14), and then taking into account chemical potential∇ formulation (2.10)∇ and pressure formulation (2.11), we obtain P
M M M n µ p = n µb (c n ) i∇ i − ∇ i∇ i − ∇ · ij ∇ j i=1 i=1 j=1 X X X M M 1 p n (c n ) c n n −∇ b − i∇ · ij ∇ j − 2 ij ∇ i · ∇ j i,j=1 i,j=1 X X M M M = n µb p n (c n ) i∇ i − ∇ b − i∇ ∇ · ij ∇ j i=1 i=1 j=1 X X X M M 1 + n (c n ) + (c n n ) ∇ i∇ · ij ∇ j 2 ∇ ij ∇ i · ∇ j i,j=1 i,j=1 X X M M 1 = ( (c n )) n + (c n n ) ∇ · ij ∇ j ∇ i 2 ∇ ij ∇ i · ∇ j i,j=1 i,j=1 X X M = (c n n ) . ∇ · ij ∇ i ⊗ ∇ j i,j=1 X Thus, (4.1) is obtained. As a direct application of (4.1), the momentum conservation equation (3.31) is reformulated as M M ∂u ρ + u u + M J u = n µ ∂t · ∇ w,i i · ∇ − i∇ i i=1 i=1 X X 13 2 + η u + uT + ξ η ( u) I , (4.2) ∇ · ∇ ∇ − 3 ∇ · which indicates that the fluid motion is indeed driven by the gradients of chemical potentials. Applying the formulation of momentum conservation equation given in (4.2), we can conveniently prove the total (free) energy dissipation property of the proposed d d×d model. We use ( , ) and to represent the L2 (Ω), L2 (Ω) or L2 (Ω) inner product and norm· · respectively.k·k We define the Helmholtz free energy and kinetic energy within the entire domain Ω as 1 F = fdx, E = ρ u 2dx. (4.3) 2 | | ZΩ ZΩ Theorem 4.2. The sum of the Helmholtz free energy and kinetic energy is dis- sipated with time, i.e. ∂(F + E) 0. (4.4) ∂t ≤
Proof. Taking into account the mass balance equation (3.10), we obtain ∂E ∂u 1 ∂ρ = ρ , u + , u 2 ∂t ∂t 2 ∂t | | ∂u 1 M = ρ , u (ρu)+ M J , u 2 ∂t − 2 ∇ · w,i∇ · i | | i=1 ! X M ∂u = ρ + ρu u + M J u, u ∂t · ∇ w,i i · ∇ i=1 ! X M 2 = (n µ , u)+ η u + uT + ξ η ( u) I , u − i∇ i ∇ · ∇ ∇ − 3 ∇ · i=1 X M 2 = (n µ , u) η u + uT + ξ η ( u) I, u − i∇ i − ∇ ∇ − 3 ∇ · ∇ i=1 X M 2 = (n µ , u) η u + uT , u ξ η u, u − i∇ i − ∇ ∇ ∇ − − 3 ∇ · ∇ · i=1 X 2 M 2 1/2 1 1/2 T 2 = (ni µi, u) η u + u ξ η u . (4.5) − ∇ − 2 ∇ ∇ − − 3 ∇ · i=1 X
Multiplying both sides of (3.9) by µi and integrating it over Ω, we obtain ∂n i ,µ + ( (n u),µ ) = (J , µ ) . (4.6) ∂t i ∇ · i i i ∇ i Applying the formulation of µi, we derive the summation of the first term on the left-hand side of (4.6) as
M M M ∂n ∂n i ,µ = i ,µb (c n ) ∂t i ∂t i − ∇ · ij ∇ j i=1 i=1 j=1 X X X 14 M ∂f ∂n = b , 1 i , (c n ) ∂t − ∂t ∇ · ij ∇ j i,j=1 X ∂f M ∂n = b , 1 + i ,c n ∂t ∇ ∂t ij ∇ j i,j=1 X M ∂f 1 ∂ = b , 1 + (c n , n ) ∂t 2 ∂t ij ∇ i ∇ j i,j=1 X ∂F = . (4.7) ∂t We denote µ = [µ , ,µ ]T , and further define the norm 1 ··· M M 2 µ = µ , µ . ∇ M Mij ∇ i ∇ j i,j=1 X
Using (4.7) and (3.25), we have the summation of (4.6) from i =1 to M as
M ∂F 2 = ( (n u),µ ) µ . (4.8) ∂t − ∇ · i i − ∇ M i=1 X
We combine (4.5) and (4.8)
1/2 2 ∂ (F + E) 2 1 2 2 = µ η1/2 u + uT ξ η u .(4.9) ∂t − ∇ M − 2 ∇ ∇ − − 3 ∇ ·
where we have also used (n µ , u) + ( (n u),µ ) = ( (n µ u), 1)=0. i∇ i ∇ · i i ∇ · i i Therefore, the energy dissipation (4.4) can be obtained from (4.9) and (3.26). 5. Energy-stable numerical method. In this section, we will design an energy- dissipated semi-implicit time marching scheme for simulating the proposed multi- component fluid model. The key difficulties result from the complication of Helmholtz free energy density and fully coupling relations between molar densities and velocity. We resolve these problems through very careful physical observations with a mathe- matical rigor. The gradient contribution to the Helmholtz free energy density is always convex with respect to molar densities, so it shall be treated implicitly. The challenge is to deal with the bulk Helmholtz free energy density fb. For the pure substance, the ideal repulsion ideal and repulsion terms, i.e. fb and fb , result in convex contributions to the Helmholtz free energy density [27]. For the multi-component mixtures (M ideal ≥ 2), we can prove the ideal contribution fb is still convex with respect to molar densities since its Hessian matrix is a diagonal positive definite matrix. However, repulsion the repulsion term fb for multi-component mixtures is never convex due to cross products of multiple components, and it can be easily verified for the binary mixtures through eigenvalue calculations (we omit the details here). For the pure attraction substance, the attraction term fb is proved to result in a concave contribution 15 to the Helmholtz free energy density [27]. But it may be not true for multi-component mixture; in fact, numerical tests show that the maximum eigenvalues of its Hessian matrix may be slightly larger than zero in some cases (not presented here). In order to construct a strict convex-concave splitting for the case of multi- component mixture, we impose two auxiliary terms on the bulk Helmholtz free energy density. One term is the additional ideal term for the reason that the ideal term is a good approximation of the behavior of many gases and always convex. The other SR is a separate repulsion term, denoted by fb , which reduces the cross products of multiple components in the original repulsion term and is expressed as
M f SR(n)= RT n ln (1 b n ) . (5.1) b − i − i i i=1 X M SR We note that bn = i=1 bini < 1 in terms of its physical meaning, so fb is well defined. We define the summation of the above two auxiliary terms as P auxiliary ideal SR fb (n)= fb (n)+ fb (n) M M = RT n (ln n 1) RT n ln (1 b n ) , (5.2) i i − − i − i i i=1 i=1 X X which has a diagonal positive definite Hessian matrix
2 auxiliary 2 auxiliary ∂ fb (n) RT RTbi RTbi ∂ fb = + + 2 , =0, i = j. (5.3) ∂ni∂ni ni 1 bini (1 b n ) ∂ni∂nj 6 − − i i We now state a convex-concave splitting of the bulk Helmholtz free energy density based on the above auxiliary terms. Let us define a parameter λ > 0, and then we reformulate the bulk Helmholtz free energy density as
convex concave fb(n)= fb (n)+ fb (n), (5.4) where
convex ideal repulsion auxiliary fb (n)= fb (n)+ fb (n)+ λfb (n), (5.5)
f concave(n)= f attraction(n) λf auxiliary(n). (5.6) b b − b The chemical potentials can be reformulated accordingly
b b,convex b,concave µi (n)= µi (n)+ µi (n). (5.7)
We make some remarks on the convex-concave splitting given in (5.4)-(5.6): repulsion (a) The reason that fb is considered in the convex part is an observation in repulsion numerical tests that positive eigenvalues of fb are usually large, while its neg- attraction ative eigenvalues are only slightly less than zero. In contrast, fb is included in the concave part because numerical tests show that its negative eigenvalues are usually far from zero, while its positive eigenvalues are only slightly larger than zero. Moreover, the attraction force shall result in a concave contribution from the point view of physics [27]. 16 auxiliary (b) Because of strong convexity of fb , if we choose a sufficiently large λ, the strict convex-concave splitting can be achieved for the bulk Helmholtz free energy density of multi-component mixture. But a very large value for λ is not necessary in practical computations, and in fact, we just take λ = 1 in our numerical tests, which is enough to gain the numerical convex-concave splitting. Consequently, we assume convex that there exists a suitable λ> 0 such that the convexity of fb (n) and concavity concave of fb (n) hold. We consider a time interval = (0,T ], where T > 0. We divide into I f f I K subintervals k = (tk,tk+1], where t0 = 0 and tM = Tf . Furthermore, we denote δtk = t t . ForI any scalar v(t) or vector v(t), we denote by vk or vk its approximation k+1 − k at the time tk. We now state the semi-implicit time marching scheme. First, a semi- implicit time scheme is constructed for the molar density balance equation (3.9) as
k+1 k ni ni k+1 k+1 k+1 − + (ni u )+ J i =0, (5.8) δtk ∇ · ∇ · where
M J k+1 = k µk+1, (5.9) i − Mij ∇ j j=1 X
M µk+1 = µb,convex nk+1 + µb,concave nk c nk+1 . (5.10) i i i − ∇ · ij ∇ j j=1 X We note that the mobility coefficients ij generally depend on the molar densities, k M k so we use ij to denote their values computed from molar densities n . In theM previous section, we have reformulated the momentum balance equation by the form (4.2) coupling with the chemical potentials rather than pressure. A semi- implicit time scheme for the momentum conservation equation (4.2) is constructed as
uk+1 uk M M ρk − + ρk+1 uk+1 uk+1 + M J k+1 uk+1 = nk+1 µk+1 δt · ∇ w,i i · ∇ − i ∇ i k i=1 i=1 X X T 2 + η uk+1 + uk+1 + ξ η uk+1 I . (5.11) ∇ · ∇ ∇ − 3 ∇ · Here, the viscosities η and ξ are assumed to be constant. We now demonstrate that the proposed semi-implicit time scheme satisfies the dissipation property of the total (free) energy. We define the discrete Helmholtz free energy and discrete kinetic energy at the time tk as 1 F k = f nk dx, Ek = ρk uk 2dx. (5.12) 2 | | ZΩ ZΩ Theorem 5.1. The sum of the discrete Helmholtz free energy and discrete kinetic energy is dissipated with time steps, i.e.
Ek+1 + F k+1 Ek + F k. (5.13) ≤
17 k+1 Proof. Multiplying both sides of (5.8) by µi and integrating it over Ω, we obtain
k+1 k ni ni k+1 k+1 k+1 k+1 k+1 k+1 − ,µi + (ni u ),µi + J i ,µi =0. (5.14) δtk ! ∇ · ∇ · We define the bulk and gradient contributions of the discrete Helmholtz free energy as
k k k k Fb n = fb(n )dx, F∇ n = f∇(n )dx. (5.15) ZΩ ZΩ The convexity and concavity yields
M F nk+1 F nk nk+1 nk,µb,convex(nk+1)+ µb,concave(nk) .(5.16) b − b ≤ i − i i i i=1 X Using the symmetry of cij , we can estimate the gradient contribution of Helmholtz free energy as
M M nk+1 nk, c nk+1 = c nk+1 nk , nk+1 − i − i ∇ · ij ∇ j ij ∇ i − i ∇ j i,j=1 i,j=1 X X k+1 k F∇ n F∇ n . (5.17) ≥ − k k k Since F = Fb n + F∇ n , we obtain from (5.14), (5.16) and (5.17) that