Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

Computations of complex two-phase flows are required for the safety analysis of nuclear reactors. These computations keep causing problems for the development of best estimate computer codes dedicated to design and safety studies of nuclear reactors. Moreover, we often need to find the long-term behavior of the system. In these cases, implicit schemes are proven very efficient. Unfortunately, for implicit schemes, after the discretization, we need to solve a nonlinear system \(\mathcal{A}U = b\). This task is computationally expensive in particular since the matrix \(\mathcal{A}\) is usually non-symmetric and very ill-conditioned. It is therefore necessary to find an efficient preconditioner.

When the size of the system is large, the parallel resolution on multiple processors is essential to obtain reasonable computation times. Currently in the thermal hydraulic code, FLICA-OVAP (see [7]), the matrix \(\mathcal{A}\) and the right hand side b are stored on multiple processors and the system is solved in parallel with a Krylov solver with a classical incomplete factorization preconditioner. Unfortunately, the parallel preconditioners of FLICA-OVAP only perform well on a few processors. In contrast, if we want to increase the number of processors these parallel preconditioners perform poorly. Tests were run on different test cases and led us to conclude that it is often better not to use these parallel preconditioners, especially for 3D problems [2]. This strategy does not make an optimal use of the available computational power. Hence, we seek for more efficient methods to distribute the computations. We study and use a domain decomposition method as an alternative to the classical distribution.

2 Mathematical Model

For the modeling of two-phase flows, several sets of equations have been worked out. They range in complexity from the homogeneous equilibrium model to two-fluid models involving unequal pressure for each phase. In this paper, we consider the well-known two-fluid model. This model is obtained by averaging the balance equations for each separated phase, using space, time or ensemble averaged quantities (see [8] and [6]). The unknown physical quantities are the volume fraction α k  ∈ [0, 1], the density ρ k  ≥ 0, and the velocity u k of each phase. The subscript k stands for l if it is the liquid phase and g for the gas phase. The common averaged pressure of the two phases is denoted by p. In our model, pressure equilibrium between the two phases is postulated. For the sake of simplicity, we study the isentropic two-fluid model. This model can be written as follows:

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{ccll} \frac{\partial (\alpha _{g}\rho _{g})} {\partial t} &+&\nabla \cdot (\alpha _{g}\rho _{g}{\boldsymbol u_{g}}) & = 0, \\ \frac{\partial (\alpha _{l}\rho _{l})} {\partial t} &+&\nabla \cdot (\alpha _{l}\rho _{l}{\boldsymbol u_{l}}) & = 0, \\ \frac{\partial (\alpha _{g}\rho _{g}{\boldsymbol u_{g}})} {\partial t} &+&\nabla \cdot (\alpha _{g}\rho _{g}{\boldsymbol u_{g}} \otimes {\boldsymbol u_{g}}) +\alpha _{g}\nabla p +\varDelta p\nabla \alpha _{g} -\nabla \cdot (\alpha _{g}\nu _{g}\nabla {\boldsymbol u_{g}})& = 0, \\ \frac{\partial (\alpha _{l}\rho _{l}{\boldsymbol u_{l}})} {\partial t} &+&\nabla \cdot (\alpha _{l}\rho _{l}{\boldsymbol u_{l}} \otimes {\boldsymbol u_{l}}) +\alpha _{l}\nabla p +\varDelta p\nabla \alpha _{l} -\nabla \cdot (\alpha _{l}\nu _{l}\nabla {\boldsymbol u_{l}}) & = 0,\\ \end{array} \right.& &{}\end{array}$$
(1)

with α g +α l  = 1, and the two equations of state(EOS) ρ g  = ρ g (p) and ρ l  = ρ l (p). In our problem, we use the stiffened equation of state. Here ν k is the viscosity of phase k, and Δ p denotes the pressure default pp k between the bulk average pressure and the interfacial average pressure.

By denoting m k  = α k ρ k , q k  = α k ρ k u k and \(\mathbf{U} = \left (m_{g},\mathbf{q}_{g},m_{l},\mathbf{q}_{l}\right )^{t}\), we can write the system (1) as follows:

$$\displaystyle{ \frac{\partial \mathbf{U}} {\partial t} + F^{\mathit{conv}}(\mathbf{U}) + F^{\mathit{diff }}(\mathbf{U}) = 0,\quad \text{where} }$$
(2)

\(F^{\mathit{conv}}(\mathbf{U})\,=\left (\!\!\begin{array}{c} \nabla \cdot \mathbf{q}_{g} \\ \nabla \cdot \mathbf{q}_{l} \\ \nabla \cdot (\mathbf{q}_{g} \otimes \frac{\mathbf{q}_{g}} {m_{g}})\,+\,\alpha _{g}\nabla p\,+\,\varDelta p\nabla \alpha _{g} \\ \nabla \cdot (\mathbf{q}_{l} \otimes \frac{\mathbf{q}_{l}} {m_{l}})\,+\,\alpha _{l}\nabla p\,+\,\varDelta p\nabla \alpha _{l} \end{array} \!\!\right )\), \(F^{\mathit{diff }}(\mathbf{U})\,=\left (\!\!\begin{array}{c} 0\\ 0 \\ \,-\,\nabla \cdot (\alpha _{g}\nu _{g}\nabla \frac{\mathbf{q}_{g}} {m_{g}}) \\ \,-\,\nabla \cdot (\alpha _{l}\nu _{l}\nabla \frac{\mathbf{q}_{l}} {m_{l}}) \end{array} \!\!\right )\).

3 Numerical Method

Most of the numerical methods used in two-phase flow computer codes are based upon semi-implicit finite difference schemes with staggered grids and donor-cell differencing. The main features of these schemes are their efficiency and their robustness. However, these methods have a large amount of numerical dissipation, giving poor accuracy in smooth regions of the flow. Moreover, discontinuities are heavily smeared on coarse grids and oscillations appear when the grid is refined. Here, we propose to use an approximate Riemann solver to discretize and solve the system (2). We decompose the computational domain into N disjoint cells C i with volume v i . Two neighboring cells C i and C j have a common boundary ∂ C ij with area s ij . We denote N(i) the set of neighbors of a given cell C i and \({\boldsymbol n}_{\mathit{ij}}\) the exterior unit normal vector of ∂ C ij . Integrating the system (2) over C i and setting \(\mathbf{U}_{i}(t) = \frac{1} {v_{i}}\int _{C_{i}}U(x,t)dx\) and \(U_{i}^{n} = \mathbf{U}_{i}(n\varDelta t)\), the discretized equations can be written:

$$\displaystyle{ \int _{C_{i}}\frac{\partial \mathbf{U}} {\partial t} \,\mathrm{d}\mathbf{x}\; +\sum _{j\in N(i)}\varPhi _{\mathit{ij}}^{\mathit{conv}} +\sum _{ j\in N(i)}\varPhi _{\mathit{ij}}^{\mathit{diff }} = 0 }$$
(3)

with \(\varPhi _{\mathit{ij}}^{\mathit{conv}}\), \(\varPhi _{\mathit{ij}}^{\mathit{diff }}\) denote the numerical flux of convection and diffusion on the cell C i in direction of the neighbor cell C j .

The diffusion numerical flux \(\varPhi _{\mathit{ij}}^{\mathit{diff }}\) is approximated on structured meshes using the formula:

$$\displaystyle\begin{array}{rcl} \varPhi _{\mathit{ij}}^{\mathit{diff }} = D(\frac{\mathbf{U}_{i} + \mathbf{U}_{j}} {2} )(\mathbf{U}_{j} - U_{i}).& &{}\end{array}$$
(4)

Full details of the evaluation of diffusive flux terms are given in [15].

Due to the α k p and Δ pα k terms, the inviscid part of the two-phase flow cannot be written in a conservative form. But this system can be written in the quasi-linear form:

$$\displaystyle{ \frac{\partial \mathbf{U}} {\partial t} + A(\mathbf{U})\frac{\partial \mathbf{U}} {\partial x} = 0. }$$
(5)

Under some simplifying assumptions, the authors of [16] were able to obtain a conservative form that allowed them to give a sense to discontinous solutions. It was also under those assumptions that they have been able to develop an approximate Riemann solver of Roe-type for the system (5) providing a local linearization of the non-conservative term α k p. We can also construct other linearizations than that of [16]. Here, we will not propose a specific linearization but a general method for the construction of the Roe matrix once we have chosen a linearization. We then define a local inviscid flux function F locand a local Roe matrix A Roe for this linearization. The inviscid flux in the normal direction to the cell interface ∂ C i, j is given by:

$$\displaystyle\begin{array}{rcl} \varPhi _{\mathit{ij}}^{\mathit{conv}}& =& \frac{F^{\mathit{loc}}(\mathbf{U}_{ i}) + F^{\mathit{loc}}(\mathbf{U}_{ j})} {2}.\mathbf{n}_{\mathit{ij}} + \mathcal{D}\frac{\mathbf{U}_{i} -\mathbf{U}_{j}} {2} \\ & =& F^{\mathit{loc}}(\mathbf{U}_{ i}).\mathbf{n}_{\mathit{ij}} + A^{-}(\mathbf{U}_{ j} -\mathbf{U}_{i}), {}\end{array}$$
(6)

where \(\mathcal{D}\) is an upwinding matrix, A Roe the Roe matrix and \(A^{\pm } = \frac{1} {2}(A_{\mathit{Roe}} \pm \mathcal{D}).\)

The choice \(\mathcal{D} = 0\) gives the centered scheme, whereas \(\mathcal{D} = \vert A_{\mathit{Roe}}\vert \) gives the upwind scheme.

3.1 Newton Scheme

Finally, since \(\sum _{j\in N(i)}F^{\mathit{loc}}(\mathbf{U}_{i}).{\boldsymbol n}_{\mathit{ij}} = 0\), using (6) and (4) Eq. (3) of the numerical scheme becomes:

$$\displaystyle{ \frac{\mathbf{U}_{i}^{n+1} -\mathbf{U}_{i}^{n}} {\varDelta t} +\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \{(A^{-} + D)(\mathbf{U}_{ i}^{n+1},\mathbf{U}_{ j}^{n+1})\}(\mathbf{U}_{ j}^{n+1} -\mathbf{U}_{ i}^{n+1}) = 0. }$$
(7)

The system (7) is nonlinear, hence we use the following Newton iterative method to obtain the required solutions:

$$\displaystyle\begin{array}{rcl} & & \frac{\delta \mathbf{U}_{i}^{k+1}} {\varDelta t} +\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ]\left (\delta \mathbf{U}_{ j}^{k+1} -\delta \mathbf{U}_{ i}^{k+1}\right ) \\ & & \quad \qquad = -\frac{\mathbf{U}_{i}^{k} -\mathbf{U}_{i}^{n}} {\varDelta t} -\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ](\mathbf{U}_{ j}^{k} -\mathbf{U}_{ i}^{k}),{}\end{array}$$
(8)

where \(\delta \mathbf{U}_{i}^{k+1} = \mathbf{U}_{i}^{k+1} -\mathbf{U}_{i}^{k}\) is the variation of the k-th iterate that approximates the solution at time n + 1. Defining the unknown vector \(\mathcal{U} = (\mathbf{U}_{1},\ldots,\mathbf{U}_{N})^{t}\), each Newton iteration for the computation of \(\mathcal{U}\) at time step n + 1 requires the numerical solution of the following linear system:

$$\displaystyle{ \mathcal{A}(\mathcal{U}^{k})\delta \mathcal{U}^{k+1} = b(\mathcal{U}^{n},\mathcal{U}^{k}). }$$
(9)

3.2 Scaling Strategy

The larger the time step, the worse the condition number of the matrix \(\mathcal{A}\) in (9). As a consequence, it is important to apply a preconditioner before solving the linear system. The most popular choice is the Incomplete LU factorisation (later named ILU, see [1] for more details). The error made by the approximate factorisation using an ILU preconditioner depends on the size of the off diagonal coefficients of the matrix. For a better performance of the preconditioner, it is desirable that off diagonal entries of the matrix have small magnitudes.

Here, we use the Scaling strategy (see details in [3]) to improve the condition number of the matrix. This strategy is a similarity transformation. Combined with the classical ILU preconditioner this strategy has reduced significantly the GMRES iterations for local systems and the computational time.

4 Domain Decomposition Method

The object of the present work is to solve the compressible fluids by a nonoverlapping domain decomposition methods [9, 11, 12, 14], and more precisely by a Schur complement method. A simple attempt is to adapt the principle of the domain decomposition method for elliptic problems [10, 13] to our problems. As in the case of elliptic problems, the principle is that we decompose the global problem into independent subproblems which are solved by each processor. However, the implementation of these ideas in hyperbolic problems raise some technical difficulties such as:

  • The scheme must be conservative.

  • In the finite volume formulation, there is no unknown defined at the interface.

  • The boundary condition of hyperbolic systems must depend on the characteristics of the problem.

Those difficulties are solved in [5] for the Euler equations by replacing the interface variables in the context of elliptic problems by the interface fluxes in the context of hyperbolic problems. In this paper, we introduce a new interface variable which make the Schur complement method easy to build and allows us to treat diffusion terms.

4.1 Implicit Coupling

We recall the linear system at each Newton iteration of the implicit scheme (8):

$$\displaystyle\begin{array}{rcl} & & \frac{\delta \mathbf{U}_{i}^{k+1}} {\varDelta t} +\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ]\left (\delta \mathbf{U}_{ j}^{k+1} -\delta \mathbf{U}_{ i}^{k+1}\right ) {}\\ & & \qquad \qquad = -\frac{\mathbf{U}_{i}^{k} -\mathbf{U}_{i}^{n}} {\varDelta t} -\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ](\mathbf{U}_{ j}^{k} -\mathbf{U}_{ i}^{k}). {}\\ \end{array}$$

We would like to solve (8) on N processors and each processor work on one subdomain. We see that it lacks \(\delta \mathbf{U}_{j}^{k+1}\) to the computational unit of the subdomain I if the cell j belongs to another subdomain, and it is not calculable by the system since \(\delta \mathbf{U}_{j}^{k+1}\) is to be calculated. Then the processor I needs from the processor J the value \(\delta \mathbf{U}_{j}^{k+1}\) which is not yet available. Conversely, the processor J needs \(\delta \mathbf{U}_{i}^{k+1}\) from the processor I.

4.2 A New Interface Variable

In order to include diffusion terms in the model and to use various schemes and various systems, we introduce a new interface flux variable δ ϕ ij (see [4]) at the domain interface between two neighboring cells C i and C j which belong to different subdomains:

$$\displaystyle{ \delta \phi _{\mathit{ij}} =\delta \mathbf{U}_{j} -\delta \mathbf{U}_{i} }$$
(10)

In the case where the cell i of the subdomain I is at the boundary and has to communicate with the neighboring subdomains, we can rewrite the system (8) as:

$$\displaystyle\begin{array}{rcl} & & \frac{\delta \mathbf{U}_{i}^{k+1}} {\varDelta t} +\sum _{j\in I,j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ]\left (\delta \mathbf{U}_{ j}^{k+1} -\delta \mathbf{U}_{ i}^{k+1}\right ) {}\\ & & \qquad \qquad = -\frac{\mathbf{U}_{i}^{k} -\mathbf{U}_{i}^{n}} {\varDelta t} -\sum _{j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ](\mathbf{U}_{ j}^{k} -\mathbf{U}_{ i}^{k}) {}\\ & & \qquad \quad \quad \quad \quad -\sum _{j\not\in I,j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [(A^{-} + D)(\mathbf{U}_{ i}^{k},\mathbf{U}_{ j}^{k})\right ]\delta \phi _{\mathit{ ij}}^{k+1} {}\\ \end{array}$$

We define \(\mathbf{U}_{I} = (\mathbf{U}_{1},\ldots,\mathbf{U}_{m})^{t}\) the unknown vector of the subdomain I,

$$\displaystyle{ \delta \phi _{I} = (\delta \phi _{\mathit{ij}})_{i\in I,j\in J,j\in N(i)}, }$$
(11)

\(\mathcal{A}_{I}\) the local Neumann matrix of the subdomain I, and \(P_{I} =\sum _{j\not\in I,j\in N(i)}\frac{s_{\mathit{ij}}} {v_{i}} \left [A^{-}(\mathbf{U}_{\mathit{Roe}}^{k}) + D(\mathbf{U}_{\mathit{diff }}^{k})\right ]\), we can write the linear system as:

$$\displaystyle{ \mathcal{A}_{I}(\mathbf{U}^{k})\delta \mathbf{U}_{ I}^{k+1} = b_{ I}(\mathbf{U}^{n},\mathbf{U}^{k}) - P_{ I}\delta \phi _{I} }$$
(12)

By taking into account Eqs. (10)–(12), and denoting δ Φ = (δ ϕ I ), \(I = 1\ldots N\) we can build an extended system that distinguishes the internal unknowns from the interface ones:

$$\displaystyle{ \left (\begin{array}{cccc|c} \mathcal{A}_{1} & 0 & \ldots & \ldots & P_{1} \\ 0 &\mathcal{A}_{2} & 0& \ldots & P_{2}\\ \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & 0 & \ldots & \mathcal{A}_{N} &P_{N} \\ \hline M_{1} & \ldots & \ldots & M_{N}& \mathbb{I} \end{array} \right )\left (\begin{array}{c} \delta \mathbf{U}_{1} \\ \delta \mathbf{U}_{2}\\ \ldots \\ \delta \mathbf{U}_{N}\\ \delta \varPhi \\ \end{array} \right ) = \left (\begin{array}{c} b_{1} \\ b_{2}\\ \ldots \\ b_{N} \\ b_{\varPhi }\\ \end{array} \right ) }$$
(13)

where \(\mathcal{A}_{I}\) is the matrix that couples the unknowns associated with internal cells of Ω I whereas M I links δ U I to δ Φ through (10). Then, in our method, M I comprises only 0 or ± 1.

The internal unknowns in (13) can be eliminated in favor of the interface ones to yield the following interface system:

$$\displaystyle{ S\delta \varPhi = b_{\varPhi }, }$$
(14)

with \((S\delta \varPhi ) =\delta \varPhi +\sum _{I=1}^{N}M_{I}\mathcal{A}_{I}^{-1}P_{I}\delta \phi _{I}\) and \((b_{\varPhi }) =\sum _{ I=1}^{N}M_{I}A_{I}^{-1}b_{I}.\)

The computation of the matrix S is so costly as we have to inverse the local matrix \(\mathcal{A}_{I}\). Fortunately, we do not have to compute explicitly the coefficients of S. All we need is to design the operator δ Φ → S δ Φ. Then Eq. (14) can be solved by, e.g., GMRES, BICGStab, or the Richardson methods. Once we solved the interface system, we know δ Φ and then we can solve the internal unknowns on each processor using Eq. (12).

5 Numerical Results

We have implemented our method for the compressible Navier-Stokes equations and the isentropic two-fluid model and compared the results obtained using single and multiple domains. After this validation, we compare the computation time of the ILU preconditioner, our method and our method with strategy Scaling [3].

Figure 1 presents the computational time required to perform a time step of a fixed global problem of one million cells using upwind scheme. We compare the computational time required using the classical distributed method (red curve), the domain decomposition method (blue curve) and the domain decomposition method with scaling (green curve). We vary the number of processors up to 128. One can see that the domain decomposition method is comparable with classical distributed method and using scaling [3] is better.

Fig. 1
figure 1

Upwind scheme, single-phase flow, global mesh = 96 × 96 × 96, CFL 20

Fig. 2
figure 2

Centered scheme, single-phase flow, global mesh = 96 × 96 × 96, CFL 10

Fig. 3
figure 3

Upwind scheme, two-phase flow, global mesh = 96 × 96 × 96, CFL 20

Figure 2 shows the computational time required to perform the previous test but using centered scheme. We can see only two curves. This is because, in this case the classical distributed method does not converge like we use the centered scheme. Domain decomposition is the only one method that converges.

Fig. 4
figure 4

Centered scheme, two-phase flow, global mesh = 96 × 96 × 96, CFL 20

Similarly, Figs. 3 and 4 show the computational time required to perform a time step in the case of the two-phase flow for the upwind and centered schemes.

6 Conclusion

We have presented a new interface variable which allows for the treatment of diffusion terms and the use of various numerical schemes for two-phase flows. We also introduced the Scaling strategy to improve the conditioner number of the matrix and reduce the computational time. We compared the scalability of our method with the classical distributed computations. Numerical results showed that our method is more robust and efficient.