Full text
Finite volume methods for multi-component Euler equations with source terms Alfredo Bermúdeza,b, Xián Lópeza,b, M. Elena Vázquez-Cendóna,b,∗ aDepartamento de Matemática Aplicada, Universidade de Santiago de Compostela, 15706 Santiago de Compostela, Spain bITMATI, Campus Sur, 15706 Santiago de Compostela, Spain Abstract A first-order well-balanced finite volume scheme for the solution of a multi-component gas flow model in a pipe on non-flat topography is introduced. The mathematical model consists of Euler equations with source terms which arise from heat exchange, and gravity and viscosity forces, coupled with the mass conservation equations of species. We propose a segregated scheme in which the Euler and species equations are solved separately. This methodology leads to a flux vector in the Euler equations which depends not only on the conservative variables but also on time and space variables through the gas composition. This fact makes necessary to add some artificial viscosity to the usual numerical flux which is done by introducing an additional source term. Besides, in order to preserve the positivity of the species concentrations, we discretize the flux in the mass conservation equations for species, in accordance with the upwind discretization of the total mass conservation equation in the Euler system. Moreover, as proposed in a previous reference by the authors, [5], the discretizations of the flux and source terms are made so as to ensure that the full scheme is well-balanced. Numerical tests including both academic and real gas network problems are solved, showing the performance of the proposed methodology. Keywords: Multi-component gas flow, non-linear hyperbolic systems with sources, segregated scheme, finite volume method, well-balanced scheme. ∗Corresponding author. Email addresses: [email protected] (Alfredo Bermúdez), [email protected] (Xián López), [email protected] (M. Elena Vázquez-Cendón) Preprint submitted to Computers and Fluids June 26, 2018
1. Introduction Mathematical modelling of gas flow in pipelines is an important subject in planning and operating gas transportation networks (see reference books, [24] and [30]). Many papers and computer programs on the subject deal with the case of steady state, based on which network optimization problems are considered. Most of them aim at saving operation costs related to the self-consumption of gas in the compression stations, which are needed to compensate the pressure loss due to pipe wall friction (see [1], [4], [28] and [35]). In the last years several papers have been devoted to transient models for the case where the gas flowing in the network is homogeneous. Let us mention [8], [18] and [25] where isothermal or isentropic flow are assumed. However, in real networks neither temperature nor entropy remain constant because, first, there is heat exchange with the environment (see [12] and [31]) and second, there is viscous dissipation in the boundary layer near the wall of the pipelines. These features complicate the model because they make necessary to use the full Euler system of equations and to include two respective source terms. Moreover, in real networks it is quite common that the height of the pipeline with respect to a reference level changes according to the topography. This fact leads to another source term in the Euler equations similar, in some sense, to the one corresponding to bathymetry in variable-bottom elevation shallow water flow models. Summarizing, the full model for real gas flow in transportation networks consists of a non-linear system of hyperbolic partial differential equations with several source terms. As it is well-known, the numerical solution of this kind of systems by finite volume discretizations and approximate Riemann solvers requires a nontrivial treatment of sources, in order to get well-balanced schemes avoiding spurious oscillations. During the last two decades, a large number of papers have been devoted to derive well-balanced schemes for non-linear balance laws with source terms. Most of them concern the shallow water equations (see [20], [7], [9] and references therein). For Euler equations with gravity the contributions are more recent, being the work by Cargo and LeRoux [10] considered a pioneering paper (see also [13]). Other relevant articles related to this topic are [23], [17] and [14]. The case of gas flow in one single pipeline on non-flat topography, also including friction and heat exchange source terms, has been considered in [5]. Moreover, passing from a pipeline to a network is not an easy task because the treatment of junctions is not trivial. Let us mention some articles devoted to this subject: [21], [2], [3], [16], [22], [32], [29] and [6]. In the last one, a method for numerically handling pipe junctions has been introduced based on modelling them as 2D containers. 2
In all the above references the gas is homogeneous in composition. However, in real gas networks, several gases from different origins are injected and subsequently mixed at network junctions. This makes the modelling problem more difficult because it is needed to compute the gas composition at any network point and at any time. More important, as the equation of state involve the gas composition, in principle Euler equations are coupled with the mass conservation equations for species. Nevertheless, in the present paper we propose a segregated scheme in which the Euler and the species equations are solved separately. By doing so we have to face two new difficulties. Firstly, we have to solve an Euler equation system involving a flux vector that depends not only on the conservative variables but also on the time and space variables through the gas composition. Secondly, when solving the mass conservation equations of species to determine the gas composition, we need to preserve positivity of concentrations. Dealing with the first problem makes necessary to add some artificial viscosity to the numerical flux, which is done in the present paper by introducing an additional source term. Regarding the second one, in order to preserve positivity of species concentrations, following [27] (see also [19]), we discretize the flux in the mass conservation equations in accordance with the upwind discretization of the flux we have made in the total mass conservation equation. Moreover, as proposed in a previous reference by the authors, [5], the discretization of all the source terms is upwinded so as to ensure that the full scheme is well-balanced. The paper is organized as follows: in Section 2 we recall the mathematical model for multi-component gas flow in a pipe, in the general case of real gases, viscous friction, non-flat topography and heat exchange. In Section 3 the numerical methodology is developed. Section 4 is devoted to present some numerical tests. It is followed by some conclusions and an Appendix containing further details on the mathematical model. 2. Mathematical modelling The starting mathematical model consists of Navier-Stokes equations for compressible flows. Since the length of the pipe is much larger than its diameter, a one-dimensional model can be used (see AppendixA for further details). In order to write this model in a compact way, we introduce the following notations for the conservative variables: W1=ρ, mass density (kg/m3), W2=ρv, mass flux or linear momentum density (kg/m2s), W3=ρE, total energy density (J/m3), ρk=ρYk, partial density of the k-th species (kg/m3), where Ykdenotes its the mass fraction. Notice that W1=PNe k=1 ρk. Let us denote W:= (W1, W2, W3)t,ρ= (ρ1,··· , ρNe)t and Y= (Y1,··· , YNe)t, being Nethe number of species. Then, ρ=ρY=W1Y. 3
By using these notations, the balance equations given in AppendixA can be rewritten in the compact form: ∂W ∂t (x, t) + ∂FW ∂x (W(x, t),ρ(x, t)) = 3 X j=1 Gj(x, t, W(x, t),ρ(x, t)),(2.1) ∂ρ ∂t (x, t) + ∂Fρ ∂x (W(x, t),ρ(x, t)) = 0,(2.2) where the flux vectors are FW(W,ρ) = W2 W2 2 W1 + ˆp(W,ρ) W3+ ˆp(W,ρ)W2 W1 ,(2.3) Fρ(W,ρ) = W2 W1 ρ,(2.4) and the source terms in (2.1) are G1(x, t, W,ρ) = 0 −λ 2D W2|W2| W1 0 ,G2(x, t, W,ρ) = 0 −gW1h0(x) −gW2h0(x) , G3(x, t, W,ρ) = 0 0 4β Dθext(x, t)−ˆ θ(W,ρ) . Actually, G1and G2are independent of variables tand ρand G1is also independent of x. By ˆpand ˆ θwe have denoted the mappings giving pressure and temperature from the conservative variables through the state equations (A.7), (A.8). Similarly, we will denote by ˆ θthe mapping giving the temperature from the conservative variables. Let us notice that the couple (p, θ)with p= ˆp(W,ρ)and θ=ˆ θ(W,ρ)is a solution of the following non-linear system of numerical equations: 4
p= Ne X k=1 ρk Mk!Rθ, (2.5) Ne X k=1 ρkZθ θref ˆcvk(s)ds =W3−1 2 W2 2 W1−W1ˆe(θref ).(2.6) Remark 2.1. Let us notice that, since W1=PNe k=1 ρkthen it is enough to solve Ne−1equations for the species in (2.2). Thus, the total number of PDEs is 3 + Ne−1. However, for the sake of simplicity in writing, in what follows we will not take advantage of that. Numerical solution of the non-linear system of partial differential equations (2.1), (2.2) together with the algebraic equations (2.5) and (2.6), for the case without sources, i.e., Gj≡0, j = 1,2,3,has been addressed in many papers. Let us mention, for instance, [27] and [15]. Generally speaking, the system can be solved as a fully coupled hyperbolic system. In this case, the upwind discretization of both flux terms is done simultaneously which becomes difficult and costly because it is necessary to compute eigenvalues and eigenvectors of Jacobian matrices of order 3 + Ne. An alternative approach consists in using a segregated scheme, i.e., for each time step W and ρare updated by solving “independently” equations (2.1) and (2.2). By doing so we could adapt a computer code written, in principle, for the standard Euler equations, to multicomponent gas flow. Therefore, a segregated scheme should be more appealing. However, since the partial densities ρkare not conservative variables for (2.1), neither the Wks for (2.2), a naïve application of standard upwind schemes leads to some troubles related to strong inaccuracies in the first block of conservative variables, i.e., in W, and to lacks of positivity in the second block, i.e., in the vector of partial densities ρ. In this paper we propose methods to avoid these two drawbacks. 2.1. Initial conditions W(x, 0) = W0(x),ρ(x, 0) = ρ0(x), x ∈(0,L). In practice, we know initial values for density, velocity, temperature and mass fractions of the species at each cross-section of the pipeline to be denoted by ρ0(x)respectively, v0(x),θ0(x)and Yk0(x), k = 1,··· , Ne. Then, W10(x) = ρ0(x), W20(x) = 5
ρ0(x)v0(x), and W30(x)and ρk0, k = 1,··· , Ne, can be computed by using (A.6) and (A.8): ρk0(x) = ρ0(x)Yk0(x), k = 1,··· , Ne, W30(x) = ρ0(x)E0(x) = ρ0(x)ˆe(θref ) + Ne X k=1 ρk0(x)Zθ θref ˆcvk(s)ds +1 2ρ0(x)(v0(x))2. 2.2. Boundary conditions They can be of different kind (they are written at the left end of the pipe and are similar for the right end): •Inflow (W2(0, t)>0): W2(0, t) = qL(t),θ(0, t) = θL(t),Yk(0, t) = Yk,L(t), k = 1,··· , Ne, •Outflow (W2(0, t)<0): W2(0, t) = qL(t), •Wall: W2(0, t) = 0, •Free exit: ∂Wi ∂x = 0, i = 1,2,3,∂ρk ∂x = 0, k = 1,··· , Ne, •Inlet/Outlet pressure: p(0, t) = pL(t); besides, θ(0, t) = θL(t),Yk(0, t) = Yk,L(t), k = 1,··· , Ne,if W2(0, t)>0, where qL(t),θL(t),pL(t)and Yk,L(t), k = 1,··· , Ne, are the (given) mass flux, temperature, pressure and mass fractions of species at x= 0 and time t, respectively. 3. Numerical solution In this section we introduce a numerical method for solving the above gas flow model. The problem to be solved is a system of non-linear hyperbolic partial differential equations with source terms. Let us notice that if Gk≡0, k = 1,2,3 and Yis constant (i.e., the gas composition is time-independent and the same along the whole pipe) then (2.1) is nothing but the standard one-dimensional compressible Euler equations. For their numerical solution, the finite volume method combined with approximate Riemann solvers are well established techniques from the eighties last century (see, for instance, [34]). However, if source terms are present the subject is more tricky because a naïve discretization of these terms, e.g., by a centred formula, does not always work properly. This fact was pointed out in [7] for the shallow water equations with variable-bed elevation (an important example of hyperbolic 6
system with source term) where a general theory for source term discretization was introduced. Subsequently, in the last two decades, many research papers have been written on the subject leading to the theory of well-balanced schemes for general nonconservative hyperbolic systems (see, for example, [10], [9] or [13]). In a previous paper by the authors, [5], the methodology from [7] has been applied to the Euler equations with sources for a homogeneous gas. The main goal of the present work is to extend the numerical methods from [5] to a multi-component heterogeneous gas. We propose a segregated scheme in which the Euler and species equations are solved separately. Let us notice first that systems (2.1) and (2.2) are coupled because pressure and temperature in the former depends on gas composition, that is, on the vector of partial densities ρwhich are the conservative variables in the latter. In its turn, the velocity (which is given by W2/W1) appears in the flux term (2.4) of the second system (2.2). In this paper we are interested in segregated schemes, i.e., in solving the two systems “independently”. Thus, when solving (2.1) we must assume that ρ is a given function of (x, t)and, similarly, when solving (2.2) we must assume that Wis a given function of (x, t). This fact leads us to write the above systems in a slightly different form, for the sake of clarity. For this purpose, let us introduce the following vector functions FWand Fρassociated, respectively, to FWand Fρ: FW(x, t, W) := FW(W,ρ(x, t)),(3.7) Fρx, t, ρ:= FρW(x, t),ρ.(3.8) Accordingly, for the source terms in (2.1) we define the vector function Gby Gj(x, t, W) := Gj(x, t, W,ρ(x, t)), j = 1,2,3.(3.9) Then equations (2.1) and (2.2) can be rewritten as follows: ∂W ∂t (x, t) + dFW dx (x, t, W(x, t)) = 3 X j=1 Gj(x, t, W),(3.10) ∂ρ ∂t (x, t) + dFρ dx (x, t, ρ(x, t)) = 0,(3.11) where dFW dx (x, t, W(x, t)) := ∂FW ∂x (x, t, W(x, t)) + ∂FW ∂W(x, t, W(x, t))∂W ∂x (x, t),(3.12) dFρ dx (x, t, ρ(x, t)) := ∂Fρ ∂x (x, t, ρ(x, t)) + ∂Fρ ∂ρ(x, t, ρ(x, t))∂ρ ∂x(x, t).(3.13) 7
3.1. The Euler stage. A first segregated scheme (E1) Let us consider a finite volume mesh of interval [0,L] = [x0, xN]. The i-th interior finite volume is denoted by Ci= (xi−1/2, xi+1/2), where xi−1/2=1 2(xi−1+xi), i = 1,··· , N, and their lengths are Ai=xi+1 2−xi−1 2, i = 1,··· , N −1. For boundary nodes x0and xN, we define C0= [x0, x0+1/2),CN= (xN−1/2, xN]so their lengths are A0=x1 2−x0and AN=xN−xN−1 2(see Figure 1). For simplicity, we will consider a uniform mesh and therefore ∆x=L/N, xi=i∆x, Ai= ∆x, i = 1, N −1and A0=AN=1 2∆x. x0x0+ 1 2 C0 - xN xN−1 2 CN - xi−1xixi+1 xi−1 2 xi+1 2 Ci - Figure 1: Finite volume grid: interior finite volume Ci. Boundary finite volumes C0and CN. Firstly, let us consider (3.10). By integrating in Ci, i = 1,··· , N −1, we get d dt ZCi W(x, t) dx+FW(xi+1/2, t, W(xi+1/2, t)) −FW(xi−1/2, t, W(xi−1/2, t)) = 3 X j=1 ZCi Gj(x, t, W(x, t)) dx. (3.14) Then we approximate this equality to introduce a discrete problem. The approximate solution is taken constant on each finite volume Ciwhere its value at time tis denoted by Wi(t). Since at the boundaries of the finite volumes the values of the approximate solution are not well-defined then we replace the flux there by a so-called numerical flux ΦW. More precisely, FW(xi−1/2, t, W(xi−1/2, t)) ≈ΦW(xi−1, xi, t, Wi−1(t),Wi(t)), i = 1,··· , N −1. Let us notice that the flux approximation at point xi−1/2only involves the approximate values of the conservative variables on the two finite volumes sharing this boundary point. Several numerical fluxes are proposed in the literature (see, for instance, [34]). In this paper we have chosen the Q-scheme of van Leer for which 8
ΦWis defined by (subscripts Land Rstand for left and right): ΦW(xL, xR, t, WL,WR) = 1 2FW(xL, t, WL) + FW(xR, t, WR) −1 2|QW(xL, xR, t, WL,WR)|(WR−WL),(3.15) where QW(xL, xR, t, WL,WR) = ∂FW ∂W1 2(xL+xR), t, 1 2(WL+WR).(3.16) Let us recall that the absolute value of a diagonalizable matrix Qis defined as follows: let Q=XΛX−1where Λis the diagonal matrix of the eigenvalues of Q. Then |Q| =X|Λ|X−1, where |Λ|is the diagonal matrix of the absolute values of the eigenvalues of Qand Xthe matrix of eigenvectors. In order to make a full discretization, a mesh of the time interval is introduced: tn=n∆t, n = 0,··· , M. Let us denote by Wn ithe cell average approximation of W(x, tn)in the i-th cell, Ci, given by the explicit Euler numerical scheme Wn+1 i−Wn i ∆t+1 ∆xΦW(xi, xi+1, tn,Wn i,Wn i+1)−ΦW(xi−1, xi, tn,Wn i−1,Wn i) = 3 X j=1 Gn j,i,(3.17) where Gn j,i denotes an approximation of 1 ∆xZCi Gj(x, tn,W(x, tn)) dx to be defined below. For interior nodes, Gn j,i := Ψj(xi−1, xi, xi+1, tn,Wn i−1,Wn i,Wn i+1), j = 1,2,3,(3.18) for some mappings Ψj. In order to get a well-balanced scheme, they have to be defined in accordance with the numerical flux ΦW. For this purpose we employ the general methodology introduced in [7]. In the present case, as we have taken the Q-scheme of van Leer, we define Ψj(xi−1, xi, xi+1, tn,Wn i−1,Wn i,Wn i+1) := ΨL j(xi−1, xi, tn,Wn i−1,Wn i) +ΨR j(xi, xi+1, tn,Wn i,Wn i+1), j = 1,2,3,(3.19) 9
where Φρhas been defined in (3.34), Rn i:= 1 2RLn i+RRn idenotes a centred approximation of 2 ∆xZxi xi−1 2 R(x, tn,ρ(x, tn)) dx+2 ∆xZxi+1 2 xi R(x, tn,ρ(x, tn)) dx, and Gn 5,i denotes the upwind approximation of 1 ∆xRCi G5(x, tn,ρn) dxdefined by (3.18) with (3.19), (3.20), (3.21) and (3.24) for j= 5. In what follows we develop the above calculations to get a more intelligible form of the numerical scheme. For this purpose we first recall that the numerical flux of the Q-scheme of van Leer (3.34) is given by Φρ(xi−1, xi, tn,ρn i−1,ρn i) = 1 2vn i−1ρn i−1+vn iρn i−1 2|vn i−1/2|(ρn i−ρn i−1),(3.39) Φρ(xi, xi+1, tn,ρn i,ρn i+1) = 1 2vn iρn i+vn i+1ρn i+1−1 2|vn i+1/2|(ρn i+1 −ρn i),(3.40) and for the corresponding discretization of the source term Gn 5,i we have ΨL 5(xi−1, xi, tn,ρn i−1,ρn i) = −1 2 I+|vn i−1/2| vn i−1/2I!RLn i,(3.41) ΨR 5(xi, xi+1, tn,ρn i,ρn i+1) = −1 2 I − |vn i+1/2| vn i+1/2I!RRn i.(3.42) Moreover, we choose the following expressions: RLn i=vn i−vn i−1/2 ∆xρn i+vn i−1/2−vn i−1 ∆xρn i−1,(3.43) RRn i=vn i+1 −vn i+1/2 ∆xρn i+1 +vn i+1/2−vn i ∆xρn i.(3.44) This scheme is fully independent of the one proposed for the Euler stage. It only considers the velocity computed at that stage. Consequently, the approximation of partial densities ρ(xi, tn)is quite different from the one used to approximate the total density W1(xi, tn). This fact provokes that the physical relation W1=PNe k=1 ρkis not satisfied. Let us confirm this drawback by analysing a particular case: assuming that vn i−1/2>0and vn i+1/2>0we will prove that the previous identity does not hold. Indeed, in this case, after some algebra scheme (3.38) becomes ρn+1 i=ρn i−∆t ∆xvn iρn i−vn i−1ρn i−1.(3.45) 16
Let us assume that, at time tn,Wn 1,i =PNe k=1 ρn k,i. Then we have Ne X k=1 ρn+1 k,i = Ne X k=1 ρn k,i −∆t ∆x vn i Ne X k=1 ρn k,i −vn i−1 Ne X k=1 ρn k,i−1! =Wn 1,i −∆t ∆xvn iWn 1,i −vn i−1Wn 1,i−1.(3.46) Moreover, the expression of Wn+1 1,i is given by (3.27) Wn+1 1,i =Wn 1,i −∆t ∆xηRn i−ηLn i,(3.47) where ηLn iand ηRn iare obtained from the numerical flux of the total mass conservation law in the Euler system, corrected by the upwind approximation of the source terms (see §3.1). More precisely, ηLn i:= φW 1xi−1, xi, tn,Wn i−1,Wn i+ ∆x 4 X j=1 ΨL j,1xi−1, xi, tn,Wn i−1,Wn i,(3.48) ηRn i:= φW 1xi, xi+1, tn,Wn i,Wn i+1−∆x 4 X j=1 ΨR j,1xi, xi+1, tn,Wn i,Wn i+1.(3.49) Let us recall that φW 1denotes the first component of the numerical flux defined by (3.15)while ΨL j,1and ΨR j,1are the first components of the numerical sources defined by (3.20) and (3.21), respectively. Hence, it is straightforward to check that if vn i−1/2>0 and vn i+1/2>0, the right-hand side of (3.46) is not equal to Wn+1 1,i given by (3.47). 3.4.2. The third scheme (C3) In this section we introduce a scheme that satisfies W1=PNe k=1 ρkat time tn+1, assuming that it is satisfied at time tn. For this purpose we follow the same procedure introduced in 3.4.1 but we will “couple” the composition stage to the Euler stage by replacing the velocities in the numerical flux of the former with the ones obtained from (3.48) and (3.49). In other words, we change the numerical fluxes of the Q-scheme of van Leer to introduce information relative to the numerical flux used to compute Wn+1 1,i in scheme (3.27). More precisely, we define the new left and right numerical fluxes of the Q-scheme of van Leer by Φρ L(xi−1, xi, tn,ρn i−1,ρn i) := 1 2˜vn L,i−1ρn i−1+ ˜vn L,iρn i−1 2|˜vn L,i−1/2|(ρn i−ρn i−1),(3.50) Φρ R(xi, xi+1, tn,ρn i,ρn i+1) := 1 2˜vn R,iρn i+ ˜vn R,i+1ρn i+1−1 2|˜vn R,i+1/2|(ρn i+1 −ρn i),(3.51) 17
where the new approximations of velocities are ˜vn L,i−1:= ηLn i 1 Wn 1,i−1 ,˜vn L,i := ηLn i 1 Wn 1,i ,(3.52) ˜vn L,i−1/2:= 1 2˜vn L,i−1+ ˜vn L,i=ηLn i 1 21 Wn 1,i−1 +1 Wn 1,i ,(3.53) ˜vn R,i := ηRn i 1 Wn 1,i ,˜vn R,i+1 := ηRn i 1 Wn 1,i+1 ,(3.54) ˜vn R,i+1/2:= 1 2˜vn R,i + ˜vn R,i+1=ηRn i 1 21 Wn 1,i +1 Wn 1,i+1 ,(3.55) where ηLn iand ηRn iare given by (3.48) and (3.49). Accordingly, the upwind discretization of the source term Gn 5,i correspond to ΨL 5(xi−1, xi, tn,ρn i−1,ρn i) = −1 2 I+|˜vn L,i−1/2| ˜vn L,i−1/2I!RLn i,(3.56) ΨR 5(xi, xi+1, tn,ρn i,ρn i+1) = −1 2 I − |˜vn R,i+1/2| ˜vn R,i+1/2I!RRn i,(3.57) where RLn i=˜vn L,i −˜vn L,i−1/2 ∆xρn i+˜vn L,i−1/2−˜vn L,i−1 ∆xρn i−1,(3.58) RRn i=˜vn R,i+1 −˜vn R,i+1/2 ∆xρn i+1 +˜vn R,i+1/2−˜vn R,i ∆xρn i.(3.59) Let us observe that sign(˜vn L,i−1/2) = sign(ηLn i)and sign(˜vn R,i+1/2) = sign(ηRn i). Then, after some algebra, we can rewrite this new scheme as ρn+1 i−ρn i ∆t+1 ∆xϕRn i(xi, xi+1, tn,ρn i,ρn i+1)−ϕLn i(xi−1, xi, tn,ρn i−1,ρn i)=0, (3.60) where the global numerical flux at the left boundary of the cell is defined by ϕLn i(xi−1, xi, tn,ρn i−1,ρn i) = ˜vn L,i−1ρn i−1if ˜vn L,i−1/2>0, ˜vn L,iρn iif ˜vn L,i−1/2≤0, (3.61) 18
and the global numerical flux at the right boundary of the cell by ϕRn i(xi, xi+1, tn,ρn i,ρn i+1) = ˜vn R,iρn iif ˜vn R,i+1/2>0, ˜vn R,i+1ρn i+1 if ˜vn R,i+1/2≤0. (3.62) Let us prove that this new scheme satisfies the suitable property, Wn+1 1=PNe k=1 ρn+1 k, assuming that Wn 1,i =PNe k=1 ρn k,i,∀i. Let us denote ϕLn k,i := ϕLn k(xi−1, xi, tn,ρn i−1,ρn i),ϕRn k,i := ϕRn k(xi, xi+1, tn,ρn i,ρn i+1).(3.63) We have Ne X k=1 ϕLn k,i = ˜vn L,i−1 Ne X k=1 ρn k,i−1=ηLn i 1 Wn 1,i−1 Ne X k=1 ρn k,i−1if ˜vn L,i−1/2>0 ˜vn L,i Ne X k=1 ρn k,i =ηLn i 1 Wn 1,i Ne X k=1 ρn k,i if ˜vn L,i−1/2≤0 =ηLn i, Ne X k=1 ϕRn k,i = ˜vn R,i Ne X k=1 ρn k,i =ηRn i 1 Wn 1,i Ne X k=1 ρn k,i if ˜vn R,i+1/2>0 ˜vn R,i+1 Ne X k=1 ρn k,i+1 =ηRn i 1 Wn 1,i+1 Ne X k=1 ρn k,i+1 if ˜vn R,i+1/2≤0 =ηRn i, and then, Ne X k=1 ρn+1 k,i = Ne X k=1 ρn k,i −∆t ∆x Ne X k=1 ϕRn k,i − Ne X k=1 ϕLn k,i ! =Wn 1,i −∆t ∆xηRn i−ηLn i=Wn+1 1,i .(3.64) Similar schemes have been introduced for the shallow water equations in [19] and [11]. An important feature is that it preserves the positivity of partial densities ρkif the CFL condition is satisfied, as the computations below show. We analyze successively the different possibilities: 19
•If ηLn i<0and ηRn i<0, (3.60) becomes ρn+1 i=ρn i−∆t ∆xηRn i 1 Wn 1,i+1 ρn i+1 −ηLn i 1 Wn 1,i ρn i.(3.65) Then, the scheme can be rewritten as ρn+1 i:= H(ρn)iwhere H(ρn)i=ρn i1 + ∆t ∆xηLn i 1 Wn 1,i +ρn i+1 −∆t ∆xηRn i 1 Wn 1,i+1 .(3.66) The positivity conditions are ∂H(ρn)i ∂ρn i = 1 + ∆t ∆xηLn i 1 Wn 1,i = 1 + ∆t ∆x˜vn L,i ≥0,(3.67) ∂H(ρn)i ∂ρn i+1 =−∆t ∆xηRn i 1 Wn 1,i+1 =−∆t ∆x˜vn R,i+1 ≥0.(3.68) Let us notice that (3.68) is always satisfied so the positivity is ensured if condition (3.67) holds. •If ηLn i>0and ηRn i>0, (3.60) becomes ρn+1 i=ρn i−∆t ∆xηRn i 1 Wn 1,i ρn i−ηLn i 1 Wn 1,i−1 ρn i−1.(3.69) Then, function H(ρn)iis H(ρn)i=ρn i−1∆t ∆xηLn i 1 Wn 1,i−1+ρn i1−∆t ∆xηRn i 1 Wn 1,i .(3.70) The positivity conditions are ∂H(ρn)i ∂ρn i−1 =∆t ∆xηLn i 1 Wn 1,i−1 =∆t ∆x˜vn L,i−1≥0,(3.71) ∂H(ρn)i ∂ρn i = 1 −∆t ∆xηRn i 1 Wn 1,i = 1 −∆t ∆x˜vn R,i+1 ≥0.(3.72) As (3.71) always holds, the positivity will be ensured if the maximum time step satisfies (3.72). 20
•If ηLn i>0and ηRn i<0, (3.60) is ρn+1 i=ρn i−∆t ∆xηRn i 1 Wn 1,i+1 ρn i+1 −ηLn i 1 Wn 1,i−1 ρn i−1.(3.73) Then, function H(ρn)iis H(ρn)i=ρn i−1∆t ∆xηLn i 1 Wn 1,i−1+ρn i+ρn i+1 −∆t ∆xηRn i 1 Wn 1,i+1 .(3.74) In this case the positivity conditions are always satisfied: ∂H(ρn)i ∂ρn i−1 =∆t ∆xηLn i 1 Wn 1,i−1 =∆t ∆x˜vn L,i−1≥0,(3.75) ∂H(ρn)i ∂ρn i = 1 ≥0,(3.76) ∂H(ρn)i ∂ρn i+1 =−∆t ∆xηRn i 1 Wn 1,i+1 =−∆t ∆x˜vn R,i+1 ≥0.(3.77) •If ηLn i<0and ηRn i>0, (3.60) becomes ρn+1 i=ρn i−∆t ∆xηRn i 1 Wn 1,i ρn i−ηLn i 1 Wn 1,i ρn i.(3.78) Then, taking into account (3.27), function H(ρn)iis H(ρn)i=ρn i1−∆t ∆xηRn i−ηLn i1 Wn 1,i =ρn i1 + Wn+1 1,i −Wn 1,i1 Wn 1,i =ρn i Wn+1 1,i Wn 1,i ,(3.79) where we have used the expression of Wn+1 1,i to prove −∆t ∆xηRn i−ηLn i=Wn+1 1,i −Wn 1,i. Hence, in this case the positivity condition holds as far as scheme (3.27) preserves the positivity of the mixture density. Indeed, in this case we have ∂H(ρn)i ∂ρn i =Wn+1 1,i Wn 1,i ≥0.(3.80) 21
3.4.3. The fourth scheme (C4) The scheme presented in Section 3.4.2 has been introduced in [27] for the multicomponent Euler equations without sources (i.e., Gj≡0, j = 1,2,3). Following [27], the velocities ˜vLand ˜vRare defined by ˜vn L,i−1:= φWL 1i 1 Wn 1,i−1 ,˜vn L,i := φWL 1i 1 Wn 1,i ,(3.81) ˜vn L,i−1/2:= 1 2˜vn L,i−1+ ˜vn L,i=φW L 1i 1 21 Wn 1,i−1 +1 Wn 1,i ,(3.82) ˜vn R,i := φW R 1i 1 Wn 1,i ,˜vn R,i+1 := φW R 1i 1 Wn 1,i+1 ,(3.83) ˜vn R,i+1/2:= 1 2˜vn R,i + ˜vn R,i+1=φW R 1i 1 21 Wn 1,i +1 Wn 1,i+1 ,(3.84) where φWL 1iis obtained from the numerical flux of the total mass conservation law (see §3.1). More precisely, φWL 1i:= φW 1xi−1, xi, tn,Wn i−1,Wn i, φWR 1i:= φW 1xi, xi+1, tn,Wn i,Wn i+1. Let us recall again that φW 1denotes the first component of the numerical flux defined by (3.15). The drawback of this velocities defined by (3.81)-(3.84) is that, if there are sources in the Euler block of equations then the scheme does not satisfies the suitable property, Wn+1 1=PNe k=1 ρn+1 k, assuming that Wn 1,i =PNe k=1 ρn k,i,∀i. Indeed, Ne X k=1 ϕLn k,i = ˜vn L,i−1 Ne X k=1 ρn k,i−1=φWL 1i 1 Wn 1,i−1 Ne X k=1 ρn k,i−1if ˜vn L,i−1/2>0 ˜vn L,i Ne X k=1 ρn k,i =φWL 1i 1 Wn 1,i Ne X k=1 ρn k,i if ˜vn L,i−1/2≤0 =φWL 1i, Ne X k=1 ϕRn k,i = ˜vn R,i Ne X k=1 ρn k,i =φWR 1i 1 Wn 1,i Ne X k=1 ρn k,i if ˜vn R,i+1/2>0 ˜vn R,i+1 Ne X k=1 ρn k,i+1 =φWR 1i 1 Wn 1,i+1 Ne X k=1 ρn k,i+1 if ˜vn R,i+1/2≤0 =φWR 1i, 22
and then, Ne X k=1 ρn+1 k,i = Ne X k=1 ρn k,i −∆t ∆x Ne X k=1 ϕRn k,i − Ne X k=1 ϕLn k,i ! =Wn 1,i −∆t ∆xφWR 1i−φWL 1i =Wn+1 1,i −∆t 4 X j=1 ΨR j,1− 4 X j=1 ΨL j,1!,(3.85) where ΨR j,1= ΨR j,1xi, xi+1, tn,Wn i,Wn i+1,(3.86) ΨL j,1= ΨL j,1xi−1, xi, tn,Wn i−1,Wn i.(3.87) Therefore, this scheme satisfies PNe k=1 ρn+1 k,i =Wn+1 1,i if and only if there is no upwinding in the discretization of the source terms, but it has been proved in [5] that some upwinding is needed in order to have a well-balance scheme. 3.5. Boundary conditions The numerical treatment of the boundary conditions given in Section 2.2 requires the use of special techniques involving so-called ghost cells. We refer the reader to [5] where a detailed description has been included. 4. Numerical results In this section we apply the numerical schemes introduced above to solve several test problems. 4.1. Test 1 This test corresponds to a static situation (v= 0) with discontinuous composition and temperature but with spatially constant product R(x)θ(x). This test is similar to Test 1 presented in [5] for a homogeneous gas composition. Let us take an arbitrary topography function h(x). We look for a steady solution such that v(x) = 0, θ(x)R(x) = K(constant),∀x∈(0,L).(4.88) In this case, the momentum equation becomes dp dx(x) = −gρ(x, t)h0(x).(4.89) 23
Moreover, the equation of state gives the relation ρ(x) = p(x) R(x)θ(x)=p(x) K.(4.90) Then Kdρ dx(x) = −gρ(x)h0(x),(4.91) and therefore ρ(x)is given by ρ(x) = ρ(0) exp −g Kh(x)−h(0),(4.92) and p(x)by p(x) = Kρ(0) exp −g Kh(x)−h(0).(4.93) In this test we have taken θ(x) = (θLif x < L 2, θRif x > L 2,, Yk(x) = (YkL if x < L 2, YkR if x > L 2,, k = 1,··· ,5,(4.94) where species are methane, ethane, propane, butane and nitrogen, respectively. The initial conditions for the different variables can be computed from the data shown in Tables 1 and 2. In all cases the CFL is 0.4 and ∆x= 200m. The logarithmic average for density is used. Notice that G1and G3are null. Y1LY1RY2LY2RY3LY3RY4LY4RY5LY5R 0.95 0.70 0.03 0.05 0.015 0.10 0.025 0.15 00025 0 Table 1: Data for Test 1 (I). In what follows we show the numerical results obtained from the different schemes considered in this paper. 24
θL(C) θR(C) Rθ h(x)(m) L(m) 4.965142 63.434338 140329 200 sin 4πx L10000 Table 2: Data for Test 1 (II). Figure 2: Test 1. Initial conditions equal to exact solutions. Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). 4.1.1. Numerical results with (E1)+(C3) Firstly, we will present numerical results for the combination of schemes (E1) and (C3). In Figures 3 and 4, temperature, pressure, velocity and mass fraction Y1are plotted at times t= 2 seconds and t= 200 seconds, respectively. The behavior of the other species is similar. Let us notice that for this scheme the velocity is fully wrong: roughly speaking it oscillates between vmin ≃ −4.6m/s and vMax ≃15 m/s while the exact velocity is null. The computed pressure is also wrong near x=L 2. These results illustrate the relevance of adding artificial viscosity to the discretization of the second flux term, ∂F ∂x , at the Euler stage. 25
where ρc,vcand Kare constants. We assume that h0(x)=0, and G1and G3are null at the Euler stage. Then, it is easy to check that the total energy Eis the solution of a transport equation with constant velocity vc. Moreover, if we assume that ρc, vcare constant, then mass fractions Yk, k = 1,··· , Neare also solution of the same linear transport equation. Figure 12: Test 2. Initial conditions. Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). The initial conditions for the different variables (see Figure 12) are the functions, θ(x) = (θLif x < L 2, θRif x > L 2,, Yk(x) = (YkL if x < L 2, YkR if x > L 2,, k = 1,··· ,5,(4.96) where species are methane, ethane, propane, butane and nitrogen, respectively. The values of the constants considered in this test are given in Table 3 and Table 4. In all cases the CFL is 0.5 and ∆x= 200m. We will present numerical results for the schemes (E2)+(C2) and (E2)+(C3). In this test both schemes yield numerical results in good agreement with the expected solution. In Figure 13 and Figure 14 it is clear that the initial discontinuities of 32
Y1LY1RY2LY2RY3LY3RY4LY4RY5LY5R 0.70 0.95 0.05 0.03 0.10 0.015 0.15 0.0025 0 0.0025 Table 3: Data for Test 2 (I). θL(C) θR(C) K=Rθ h(x)(m) L(m) ρc(kg/m3)vc(m/s) 63.434338 4.965142 140329 010000 40 2 Table 4: Data for Test 2 (II). Figure 13: Test 2. Numerical solutions with scheme (E2)+(C2) (blue), and with scheme (E2)+(C3) (red). Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). t= 5s. temperature and mass fraction 100Y1at x= 5000 m are moving to the right (vc= 2 m/s). 33
Figure 14: Test 2. Numerical solutions with scheme (E2)+(C2) (blue), and with scheme (E2)+(C3) (red). Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). t= 200s. At final time t= 200 s, we compute the L1-norm of the error between the approximate solution and the exact solution divided by the length of the domain, L= 10000 m (see Tables 5 and 6 for scheme (E2)+(C2), and Tables 7 and 8 for scheme (E2)+(C3)). The solution is not smooth, so for this test we do not show the order of convergence. 34
Mesh ∆x W1(kg/m3)W2(kg/(m2s))W3(J/m3) M1500,000 2,28E-02 4,86E-01 1,18E+05 M2250,000 1,74E-02 2,73E-01 9,10E+04 M3125,000 1,29E-02 2,44E-01 6,96E+04 M462,500 9,49E-03 2,87E-01 4,55E+04 M531,250 6,84E-03 3,04E-01 3,09E+04 M615,625 4,80E-03 2,59E-01 2,21E+04 Table 5: Test 2. L1absolute error divided by Lwith scheme (E2)+(C2) for Euler conservative variables. t= 200 s. CFL = 0.5. Mesh ∆x100Y1(%) 100Y2(%) 100Y3(%) 100Y4(%) 100 Y5(%) M1500,000 9,02E-01 7,76E-02 3,06E-01 5,26E-01 8,40E-03 M2250,000 6,80E-01 5,84E-02 2,31E-01 3,97E-01 6,34E-03 M3125,000 5,11E-01 4,37E-02 1,74E-01 2,99E-01 4,79E-03 M462,500 3,37E-01 2,90E-02 1,14E-01 1,97E-01 3,14E-03 M531,250 2,32E-01 2,00E-02 7,88E-02 1,35E-01 2,15E-03 M615,625 1,65E-01 1,42E-02 5,60E-02 9,62E-02 1,53E-03 Table 6: Test 2. L1absolute error divided by Lwith scheme (E2)+(C2) for mass fractions. t= 200 s. CFL = 0.5. Mesh ∆x W1(kg/m3)W2(kg/(m2s))W3(J/m3) M1500,000 2,30E-02 4,65E-01 1,15E+05 M2250,000 1,75E-02 2,79E-01 8,86E+04 M3125,000 1,31E-02 2,58E-01 6,80E+04 M462,500 9,78E-03 3,04E-01 4,41E+04 M531,250 7,19E-03 3,18E-01 2,98E+04 M615,625 5,19E-03 2,68E-01 2,13E+04 Table 7: Test 2. L1absolute error divided by Lwith scheme (E2)+(C3) for Euler conservative variables. t= 200 s. CFL = 0.5. 35
Mesh ∆x100Y1(%) 100Y2(%) 100Y3(%) 100Y4(%) 100 Y5(%) M1500,000 8,72E-01 6,98E-02 2,96E-01 5,15E-01 8,72E-03 M2250,000 6,58E-01 5,26E-02 2,24E-01 3,88E-01 6,58E-03 M3125,000 4,96E-01 3,97E-02 1,69E-01 2,93E-01 4,96E-03 M462,500 3,25E-01 2,60E-02 1,10E-01 1,92E-01 3,25E-03 M531,250 2,22E-01 1,78E-02 7,55E-02 1,31E-01 2,22E-03 M615,625 1,58E-01 1,26E-02 5,37E-02 9,31E-02 1,58E-03 Table 8: Test 2. L1absolute error divided by Lwith scheme (E2)+(C3) for mass fractions. t= 200s. CFL = 0.5. 4.3. Test 3 This case is similar to Test 2 but with sinusoidal initial condition for species and temperature, that is, Yk(x) = 1 2(YkL +YkR) + 1 2(YkR −YkL) sin 5π Lx+3 2π, k = 1,··· ,5,(4.97) θ(x) = K R(x),(4.98) where the values of the constant are given in Table 9, see Figure 15. Y1LY1RY2LY2RY3LY3RY4LY4RY5LY5R 0.70 0.95 0.05 0.03 0.10 0.015 0.15 0.0025 0 0.0025 Table 9: Data for Test 3 (I). K=Rθ h(x)(m) L(m) ρc(kg/m3)vc(m/s) 140329 010000 40 2 Table 10: Data for Test 3 (II). 36
Figure 15: Test 3: Initial conditions. Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). Figure 16: Test 3. Numerical solutions with scheme (E2)+(C2) (blue), and with scheme (E2)+(C3) (red). Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). t= 5s. 37
Figure 17: Test 3. Numerical solutions with scheme (E2)+(C2) (blue), and with scheme (E2)+(C3) (red). Above: temperature (left) and pressure (right). Below: velocity (left) and mass fraction 100Y1(right). t= 200s. At final time t= 200 s, we compute the L1-norm of the error between the approximate solution and the exact solution. The considered schemes in this test give similar results, but errors obtained with scheme (E2)+(C3), Tables 15 and 17, are always lower compared to those reported in Tables 11 and 13 for scheme (E2)+(C2). The order of convergence of these errors are shown in Tables 12 and 14 for scheme (E2)+(C2), and Tables 16 and 18 for scheme (E2)+(C3). It is nearly 1. Figures 16 and 17 show the numerical results with both schemes at time t= 2 seconds and t= 200 seconds. 38
Mesh ∆x W1(kg/m3)W2(kg/(m2s))W3(J/m3) M1500,000 4,98E-02 6,78E+00 2,36E+05 M2250,000 2,84E-02 2,39E+00 1,28E+05 M3125,000 1,50E-02 8,79E-01 6,57E+04 M462,500 7,61E-03 3,59E-01 3,33E+04 M531,250 3,93E-03 1,67E-01 1,68E+04 M615,625 2,63E-03 8,60E-02 8,51E+03 Table 11: Test 3. L1absolute error divided by Lwith scheme (E2)+(C2) for Euler conservative variables. t= 200 s. CFL = 0.5. Mesh W1W2W3 M1-M20,81 1,51 0,88 M2-M30,93 1,44 0,96 M3-M40,98 1,29 0,98 M4-M50,95 1,10 0,99 M5-M60,58 0,96 0,98 Table 12: Test 3. Order of convergence for the errors given in Table 11 with scheme (E2)+(C2). 4.4. Test 4, real case The ultimate goal of the methodology proposed in this article is the prediction of the physical variables involved in real gas transportation networks. In order to check if this is made accurately, we present a test involving real data. In [6] our industrial partner Reganosa allowed us to use a large data basis with the measurements it makes in real time on its own gas network. With this information, we are able to compare the numerical results of our model against their respective experimental values. The network, depicted in Figure 18, consists of 11 nodes, joined by 10 pipes. Moreover, at each “interior node” a fictitious pipe is introduced in order to prescribe the flow rate exchanged with the network outside. Node 1 represents the Reganosa regasification plant where we impose a pressure boundary condition taken from the data basis. This is the only gas inlet into the whole network: the rest of the nodes are outlets. The main gas outlet is located at node 5 which is a terminal node of the network where an outflow boundary condition is considered. In this experiment, the consumptions of the rest of the nodes are very small in comparison with this one. In order to take into account the consumption at the interior (i.e., non-terminal) nodes 39
Mesh ∆x100Y1(%) 100Y2(%) 100Y3(%) 100Y4(%) 100 Y5(%) M1500,000 1,82E+00 1,63E-01 6,17E-01 1,06E+00 1,66E-02 M2250,000 9,85E-01 8,90E-02 3,34E-01 5,71E-01 8,71E-03 M3125,000 5,02E-01 4,59E-02 1,70E-01 2,90E-01 4,36E-03 M462,500 2,54E-01 2,33E-02 8,60E-02 1,46E-01 2,19E-03 M531,250 1,28E-01 1,17E-02 4,33E-02 7,38E-02 1,10E-03 M615,625 6,49E-02 5,95E-03 2,20E-02 3,75E-02 5,61E-04 Table 13: Test 3. L1absolute error divided by Lwith scheme (E2)+(C2) for mass fractions. t= 200 s. CFL = 0.5. Mesh Y1(%) Y2(%) Y3(%) Y4(%) Y5(%) M1-M20,89 0,88 0,89 0,89 0,93 M2-M30,97 0,96 0,97 0,98 1,00 M3-M40,99 0,98 0,99 0,99 1,00 M4-M50,99 0,99 0,99 0,99 0,99 M5-M60,98 0,98 0,98 0,98 0,97 Table 14: Test 3. Order of convergence for the errors given in Table 13 with scheme (E2)+(C2). t= 200 s. CF L = 0.5. Mesh ∆x W1(kg/m3)W2(kg/(m2s))W3(J/m3) M1500,000 4,80E-02 6,62E+00 2,20E+05 M2250,000 2,66E-02 2,32E+00 1,19E+05 M3125,000 1,40E-02 8,62E-01 6,04E+04 M462,500 7,21E-03 3,51E-01 3,04E+04 M531,250 3,66E-03 1,61E-01 1,53E+04 M615,625 1,84E-03 8,27E-02 7,65E+03 Table 15: Test 3. L1absolute error divided by Lwith scheme (E2)+(C3) for Euler conservative variables. t= 200 s. CFL = 0.5. we introduce a new edge for each of them and impose an outflow boundary condition at its terminal node. Since we have measurements of pressure and mass flow rate (apart from temperature) at all nodes of the network, we compare the measured values of the magnitude that was not imposed in the model with its respective numerical results. In [6] the results are computed with a homogeneous gas composition model. 40
Mesh W1W2W3 M1-M20,85 1,51 0,89 M2-M30,92 1,43 0,98 M3-M40,96 1,30 0,99 M4-M50,98 1,12 1,00 M5-M60,99 0,96 1,00 Table 16: Test 3. Order of convergence for the errors given in Table 15 with scheme (E2)+(C3). Mesh ∆x100Y1(%) 100Y2(%) 100Y3(%) 100Y4(%) 1100Y5(%) M1500,000 1,69E+00 1,36E-01 5,76E-01 9,99E-01 1,69E-02 M2250,000 9,08E-01 7,26E-02 3,09E-01 5,36E-01 9,08E-03 M3125,000 4,59E-01 3,67E-02 1,56E-01 2,71E-01 4,59E-03 M462,500 2,31E-01 1,84E-02 7,84E-02 1,36E-01 2,31E-03 M531,250 1,16E-01 9,24E-03 3,93E-02 6,82E-02 1,16E-03 M615,625 5,78E-02 4,63E-03 1,97E-02 3,41E-02 5,78E-04 Table 17: Test 3. L1absolute error divided by Lwith scheme (E2)+(C3) for mass fractions. t= 200 s. CFL = 0.5. Mesh Y1(%) Y2(%) Y3(%) Y4(%) Y5(%) M1-M20,90 0,90 0,90 0,90 0,90 M2-M30,98 0,98 0,98 0,98 0,98 M3-M40,99 0,99 0,99 0,99 0,99 M4-M51,00 1,00 1,00 1,00 1,00 M5-M61,00 1,00 1,00 1,00 1,00 Table 18: Test 3. Order of convergence for the errors given in Table 17 with scheme (E2)+(C3). t= 200 s. CF L = 0.5. We show the results obtained with schemes (E2)+(C2) and (E2)+(C3) along edge number 2 in Figure 18. The variable height profile along this pipe is shown in Figure 19. We select a real case with methane constant composition along the edge (100Y1= 81.372634114) and show the numerical results obtained with the above mentioned schemes. At t= 20 s the velocity along the pipe is not constant and, furthermore it changes sign. For this magnitude both schemes gives similar results (see Figure 20 and Figure 21 for schemes (E2)+(C2) and E2)+(C3), respectively). 41
of species: ∂ρ ∂t (x, t) + ∂(ρv) ∂x (x, t) =0,(A.1) ∂(ρv) ∂t (x, t) + ∂(ρv2+p) ∂x (x, t) = −λρ(x, t) 2D|v(x, t)|v(x, t)−gρ(x, t)h0(x),(A.2) ∂(ρE) ∂t (x, t) + ∂((ρE +p)v) ∂x (x, t) =4β D(θext(x, t)−θ(x, t)) −gρ(x, t)v(x, t)h0(x).(A.3) ∂(ρYk) ∂t +∂(ρYkv) ∂x =0, k = 1,··· , Ne.(A.4) x(s) L π−α(x(s)) α(x(s)) ρg sin(π−α(x(s)) ≃ −ρg tan α(x(s)) ≃ −ρgh′(x(s)) s 0 h(x(s)) s Figure A.26: Geometry and approximation of the gravity force term assuming x0(s)≈1. •ρis the average mass density (kg/m3), •vis the mass-weighted average velocity on cross-sections of the pipe sections (m/s), •pis the average thermodynamic pressure (N/m2), •gis the gravity acceleration (m/s2), •h(x)is the height of the pipe at the xcross-section (m), •Dis the diameter of the pipe (m), 48
•λis the friction factor between the gas and the pipe walls; it is a nondimensional number depending on the diameter of the pipe, the rugosity of its wall and the Reynolds number of the flow. The computation of λ can be made by using the Colebrook’s equation (see [33]): 1 √λ=−2 log10 2.51 Re√λ+k 3.7D=−2 log10 2.51πDη 4|q|√λ+k 3.7D, (A.5) where kis the roughness coefficient of the pipe (m). •Eis the average specific total energy (J/kg): E=e+1 2v2,(A.6) ebeing the specific internal energy (J/kg). •βis a heat transfer coefficient (W/m2K), •θis the average temperature (K), •θext is the exterior temperature (K). 2. State equations thermodynamic : p=ρR(Y)θ, (A.7) caloric : e= ˆe(θ) = ˆe(θref ) + Zθ θref ˆcv(s, , Y)ds, (A.8) where •R(Y)is the gas constant of the mixture (J/(kg K)). We have –R(Y) = R M(Y),with –R= 8.3144598 J mol−1K−1, the universal gas constant. –M(Y) = Ne X k=1 Yk Mk!−1 , –Mkbeing the molecular mass of the k-th species. •eis the specific internal energy (J/kg), •θref is a reference temperature (K), 49
•ˆcv(θ, Y)is the specific heat at constant volume of the mixture, at temperature θ(J/kg K): ˆcv(θ, Y) = Ne X k=1 Ykˆcvk(θ), where ˆcvk(θ)is the specific heat at constant volume of the k-th species, at temperature θ. Let us transform equations (A.7) and (A.8) by using the partial densities of species: ρk(x, t) = ρ(x, t)Yk(x, t), k = 1,··· , Ne. We have, p=ρR(Y)θ=ρR Ne X k=1 Yk Mk θ= Ne X k=1 ρk Mk!θ, (A.9) ρe =ρˆe(θref ) + ρZθ θref ˆcv(s, Y)ds =ρˆe(θref ) + ρ Ne X k=1 YkZθ θref ˆcvk(s)ds (A.10) =ρˆe(θref ) + Ne X k=1 ρkZθ θref ˆcvk(s)ds. (A.11) 3. Conservative variables: ρ, ρv, ρE, ρk, k = 1,··· , Ne, References [1] J. André, J.F. Bonnans, Optimal structure of gas transmission trunklines, Optim. Eng. 12 (2011) 175 –198. [2] M.K. Banda, M. Herty, A. Klar, Gas flow in pipeline networks, Networks and Heterogeneous Media 1 (2006) 41–46. [3] M.K. Banda, M. Herty, A. Klar, Coupling conditions for gas networks governed by the isothermal Euler equations, Networks and Heterogeneous Media 1 (2006) 295–314. [4] A. Bermúdez, J. González-Díaz, F.J. González-Diéguez, A.M. González-Rueda, M. P. Fernández de Córdoba, Simulation and optimization models of steady-state gas transmission networks, Energy Procedia 64 (2015) 130–139. [5] A. Bermúdez, X. López, M.E. Vázquez-Cendón, Numerical solution of non-isothermal non-adiabatic flow of real gases in pipelines, J. Comput. Phys., 323 (2016) 126–148. http://dx.doi.org/10.1016/j.jcp.2016.07.020 50
[6] A. Bermúdez, X. López, M.E. Vázquez-Cendón, Treating network junctions in finite volume solution of transient gas flow models, J. Comput. Phys., 344 (2017) 187–209. https://doi.org/10.1016/j.jcp.2017.04.066 [7] A. Bermúdez, M.E. Vázquez-Cendón, Upwind methods for hyperbolic conservation laws with source terms, Comput. Fluids, 23 (1994) 1049–1071. [8] J. Brouwer, I. Gasser, M. Herty, Gas pipeline models revisited: model hierarchies, nonisothermal models, and simulations of networks. Multiscale Model. Simul. 9 (2) (2011) 601–623. [9] F. Bouchut, Nonlinear stability of finite volume methods for hyperbolic conservation laws: And well-balanced schemes for sources. Springer Science & Business Media, 2004. [10] P. Cargo, A.Y. LeRoux, A well balanced scheme for a model of atmosphere with gravity. C. R. Acad. Sci., Sér. 1 Math. 318 (1994) 73–76. [11] L. Cea, M.E. Vázquez-Cendón, Unstructured finite volume discretisation of bed friction and convective flux in solute transport models linked to the shallow water equations, J. Comput. Phys., 231 (2012) 3317–3339. [12] M. Chaczykowski, Transient flow in natural gas pipeline – The effect of pipeline thermal model, Appl. Math. Model. 34 (2010) 1051 –1067. [13] C. Chalons, F. Coquel, E. Godlewski, P.A. Raviart, N. Seguin, Godunov-type schemes for hyperbolic systems with parameter-dependent source: the case of Euler system with friction. Math. Models Methods Appl. Sci. 20 (11) (2010), 2109-2166. [14] P. Chandrashekar, C. Klingenberg, A second order well-balanced finite volume scheme for Euler equations with gravity, SIAM J. Sci. Comput. 37(3) (2015) B382–B402. [15] D. Chargy, R. Abgrall, L. Fézoui, B. Larrouturou, Conservative numerical schemes for multicomponent inviscid flows. Rech. Aérospat. (English Edition) (2) (1992) 61–80. [16] R.M. Colombo, M. Garavello, A well posed Riemann problem for the p-system at a junction, Networks and Heterogeneous Media 1 (2006) 495–511. [17] V. Desveaux, M. Zenk, C. Berthon, C. Klingenberg, A well-balanced scheme to capture non-explicit steady states in the Euler equations with gravity, Int. J. Numer. Meth. Fluids 001 (2010) 1–23. [18] S. Elaoud, E. Hadj-Taiëb, Transient flow in pipelines of high-pressure hydrogen–natural gas mixtures, Int. J. of Hydrogen Energy 33 (2008) 4824 – 4832. 51
[19] P. García-Navarro, M.E. Vázquez-Cendón, On numerical treatment of the source terms in the shallow water equations. Comput. Fluids 29 (2000) 951–979. [20] P. Glaister, Approximate Riemann solutions of the shallow water equations. J. Hydraul. Res. 26 (1988) 293-305. [21] M. Gugat, M. Dick, G. Leugering, Gas flow in fan-shaped networks: classical solutions and feedback stabilization. SIAM J. Control Optim. 49 (5) (2011) 2101—2117. [22] M. Herty, M. Seaïd, Simulation of transient gas flow at pipe-to-pipe intersections, Networks and Heterogeneous Media 56 (2008) 485–506. [23] R. Käppeli, S. Mishra, Well-balanced schemes for the Euler equations with gravitation. J. Comput. Phys. 259 (2014) 199-219. [24] T. Kosch, B. Hiller, M.E. Pfetsch, L. Schewe Eds., Evaluating Gas Network Capacities, SIAM, Philadelphia, 2015. [25] M. Herty, J. Mohringb, V. Sachersa, A new model for gas flow in pipe networks, Math. Meth. Appl. Sci. 33 (2010) 845–855. [26] F. Ismail, P.L. Roe, Affordable, entropy-consistent Euler flux functions II: Entropy production at shocks, J. Comput. Phys. 228 (2009) 5410–5436. [27] B. Larrouturou, How to preserve the mass fractions positivity when computing compressible multi-component flows, J. Comput. Phys. 95 (1) (1991) 59—84. [28] A. Martin, M. Möller, S. Moritz, Mixed Integer Models for the Stationary Case of Gas Network. Math. Progr. 105 (2006) 563–582. [29] A. Morin, G. A. Reigstad, Pipe networks: coupling constants in a junction for the isentropic Euler equations. Energy Procedia 64 (2015) 140–149. [30] A.J. Osiadacz. Simulation and Analysis of Gas Networks. Gulf Publishing Company, Houston, 1987. [31] A.J. Osiadacz, M. Chaczykowski, Comparison of isothermal and non-isothermal pipeline gas flow models, Chem. Eng. J. 81 (2001) 41–51. [32] G.A. Reigstad, Numerical network models and entropy principles for isothermal junction flow, Networks and Heterogeneous Media 9 (2014) 65–95. [33] E. Shasi Menon, Gas Pipeline Hydraulics, Taylor & Francis, Boca Raton, 2005. 52
[34] E.F. Toro, Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction. Springer, 3rd edition 2009. [35] S.W. Wu, R. Ríos-Mercado, E. Boyd, L. Scott, Model relaxation for the fuel cost minimization of steady-state gas pipeline networks. Math. and Comp. Modelling, 31 (2000) 197–220. 53