Skip to main content
  • Original article
  • Open access
  • Published:

Low dimensional modeling of Double T-junctions in water distribution networks using Kriging interpolation and Delaunay triangulation

Abstract

Water distribution networks are subject to potential intentional contaminations to cause harm to the consumer. Reliable transport models are needed to detect, trace and follow any contaminant transported inside the network. For now, the transport of contaminants in pipes has been mostly modeled assuming perfect mixing conditions at T-junction. However, some studies have shown that it is not always the case when crosses or double T-junctions are involved. In this paper an imperfect mixing at Double T-junction model is developed considering 3-D mixing behavior. A reduced model is then constructed in the form of a 1-D law to apply it to current 1-D transport models for water distribution networks. The methodology to create such law is detailed and can be applied to any reduced model problem including multi parameters and time consuming simulations. The procedure is composed of three steps: first calibrate the Kriging interpolation method parameters; then couple it with the Delaunay triangulation method to select simulation points with maximum gain; and finally implement a 1-D law based on the simulation results and the interpolation.

1 Introduction

Security is an important topic for Water Distribution Networks (WDN), as water is an essential component of society. Real-time sensors are now installed in water network to monitor and better understand the behavior of water quality through the network. Improvements in technology require improvements in the precision of water quality modeling. This work has the dual objectives to develop and enhance methods to detect any contamination in the network and to get reliable real-time transport models for source contamination identification and proper countermeasures.

Water distribution systems are modeled by a graph composed of links transporting water for several pipes in series, pumps and valves, and nodes that can represent either water sources, consumers or junctions. A hydraulic model is used to compute the water velocities in links and the head at nodes. Then a transport model is applied to simulate the quality state of the water inside the network, such as the water chlorination concentration. The transport model equations that are usually used in water distribution hydraulic models are the 1-D advection-reaction equation and a perfect mixing law. Different resolution approaches exist. Epanet software [17] uses the Lagrangian transport model with an event-driven model [3], whereas Porteau software [16] resolves equations with an Eulerian approach and a time-driven model [9, 12]. Both are coupling a 1-D transport model for the water quality inside the links and a 0-D model for mixing at nodes.

Two imperfect mixing models exist in the literature. Ho and Khalsa [13] developed the Epanet BAM model for imperfect mixing at cross junction. They used both experiments and simulations to deduce an imperfect mixing law in between no mixing and imperfect mixing results, with a scale parameter that need to be calibrated depending on each real cross. Choi et al. [7] developed the AZRED model based on an experimental data filled lookup table with interpolation or extrapolation for inputs not in the table to model both imperfect mixing at crosses and Double T-junctions. It was validated on experimental values with a large range of flows. One limitation is the need for extrapolation for Reynolds number approaching zero or infinity. Also, a 2-D resolution has been proposed in [19] to better assess the mixing at the junction by applying adjoint method and resolving Stokes equation in laminar flow (Reynolds number (Re) < 2000).

The aim of this paper is to complement the previous models generating a generalized one-dimensional model. The approach uses a Computational Fluid Dynamics (CFD) based method [4, 18]. This study enhances the transport model with an accurate mixing model of contaminants at Double T-junctions. This is done by creating a lookup table with results from 3-D CFD simulations. These simulations are time costly, therefore an interpolating method is used to extract a global imperfect mixing behavior from this table. Two methods are needed for its creation and utilization, first a high order interpolation Kriging, and second a design algorithm based on the Delaunay triangulation. That table is finally used in a 1-D law that can be coupled to the existing transport models in real time computation.

It should be mentioned that here, the 3-D simulations are used to estimate both laminar and turbulent dynamics at Double T-junctions. They are performed solving Navier–Stokes equations with either the advection equation or mixture model. Each simulation represents the behavior of the mixing at double T-junctions at some design points depending on the 4 Double T-junction parameters: the length of the interpipe (the distance between two pipe junctions), the average interpipe Reynolds number and the input and output Reynolds number ratios (see Fig. 2). To get the solution for any other combination of the parameters’ value, a Kriging interpolation is performed.

This interpolation method is used because it is suitable for cloud point distribution [20], which conforms to limited number of CFD simulations. Firstly, the Kriging interpolation needs a calibration of its parameters and is solved with a maximum likelihood function. Then the solution of the interpolation is defined as a weighted sum of the CFD simulation results with these weights found through the resolution of a linear system. An example is then given to explain its application. That interpolation is also used to define the error of interpolation that is used in the Delaunay triangulation method. This algorithm allows us to know which simulation points to do next as to minimize the interpolation error. This maximizes the gain of each new CFD simulation, which is important as they are time consuming. The results of the CFD simulations are placed in a lookup table which is coupled to the Kriging interpolation to create a reduced model under the form of a 1-D law that can enhance current transport model reliability.

Such methodology can be used for any other reduced model problem that include multiple parameters and time consuming simulations. The two important steps in the procedure are to calibrate the Kriging interpolation parameters and to select the simulation points with the Delaunay triangulation design method.

The paper is organized as follows: we will describe first the problem equations as well as the CFD simulations procedure. Then the Kriging theory and calibration method is explained and the Delaunay triangulation design method is given. Afterwards, the generalization to the reduced 1-D model is discussed. The second part of this article is dedicated to the study of the results: first is given the Kriging calibration results on the mixing for the Double T-junction, then is explained how the Delaunay triangulation helps the design point choice and finally a discussion on CFD simulation results is given to explain the imperfect mixing behavior.

2 A theoretical model for mixing in WDN

In this part, first the imperfect mixing problem and equations as well as the CFD simulation parameters and procedures, are described. Then, a discussion on the design of experiment is written which explains the need for both an interpolation method and a design approach. Thereafter the Kriging interpolation is given in two parts: resolution and calibration connected to the Delaunay triangulation algorithm which is necessary to identify optimal simulation points. Finally, CFD simulation results are used to build a 1-D law that can be used in any case of flow rate and concentration for the mixing at Double T-junctions.

2.1 Transport model and CFD simulations

A 1-D advection-reaction equation is usually used together with the perfect mixing at junctions to simulate the propagation of a physicochemical agents inside the graph links and nodes of a water distribution network. The 1-D advection-reaction reads:

$$ \frac{\partial {C}_i\left(t,x\right)}{\partial t}+{u}_i\frac{\partial {C}_i\left(t,x\right)}{\partial x} + {K}_i{C}_i{\left(t,x\right)}^{\alpha_i} = 0;\ {C}_i\left(t,0\right)={C}_j $$
(1)

With C i is the mass concentration of the agent in link i, t is the time, x the space, u i the average velocity in the link i; and K i and α i are the kinetic constant and the order of the reaction respectively.

When the concentration is calculated in incident links, the following 0-D perfect mixing equation is used to update the concentration at the downstream node:

$$ {C}_j=\frac{{\displaystyle {\sum}_{i\in I{n}_j}}{Q}_i{C}_i}{{\displaystyle {\sum}_{i\in I{n}_j}}{Q}_i} $$
(2)

Where In j is the set of links with water entering node j; Q i is the flowrate of link i; and C j is the resulting concentration at node j. C j will be used as boundary condition for propagating the agent in the next adjacent links see Eq. (1).

In recent studies, Ho and Khalsa [13] and Choi et al. [7], showed that mixing at T-junctions is important with regards to security. It is therefore essential to add it when calculating the hydraulic quality state of the network. Ho and Khalsa [13] developed, and adjusted with experiments, the Bulk-Advective Mixing model BAM for the imperfect mixing at cross-junction that depends on the Reynolds number at the inlets and outlets.

In the cross-junction configuration of Fig. 1, there is a principal flow 1, where the inlet goes into the two outlet directions 3 and 4 and the secondary flow where the inlet 2 is only going to the nearest outlet 3. For this configuration and within steady state condition, the pure BAM model for cross junction element implies that:

$$ \left\{\begin{array}{c}\hfill {C}_4^{bulk}={C}_1\hfill \\ {}\hfill {C}_3^{bulk}=\frac{Q_2{C}_2+\left({Q}_1-{Q}_4\right){C}_1}{Q_3}\hfill \end{array}\right. $$
(3)

with Q i and C i respectively the flow rate and the concentration at inlet i of Fig. 1. The concentration at outlet 4, \( {C}_4^{bulk}, \) is the same as inlet 1 and the concentration at outlet 3, \( {C}_3^{bulk}, \) is calculated from the mass balance (from Fig. 1, it can be seen that Q 4 < Q 1, therefore Q 1 - Q 4 is positive). However, this configuration does not represent correctly the reality. The complete BAM model [13] consists of combining the pure BAM model and the perfect mixing with the following equation:

$$ \left\{\begin{array}{c}\hfill {C}_j={C}_j^{bulk}+s\left({C}_j^{perfect}-{C}_j^{bulk}\right)\hfill \\ {}\hfill {C}_j^{perfect} = \frac{Q_1{C}_1+{Q}_2{C}_2}{Q_1+{Q}_2}\hfill \end{array}\right. $$
(4)
Fig. 1
figure 1

Cross junction (from [14]) with 2 inlets and 2 outlets

Where s is a coefficient to calibrate, which depends on the real state of the cross-junction; C j the imperfect mixing condition concentration at either outlet j = 3 or j = 4 in Fig. 1; \( {C}_j^{perfect} \) is the concentration computed with perfect mixing hypothesis at outlets 3 and 4 using Eq. (2); and \( {C}_{\mathrm{j}}^{bulk} \) is calculated with Eq. (3). Ho and Khalsa [13] proposed to calibrate the s coefficient from experiments. Their results for X and N-junctions (or double T-junctions) is implemented in the Epanet-BAM module [13].

Another research study, The AZRED model [7] proposes the use of a lookup table with interpolation or extrapolation for inputs not in the table to model both imperfect mixing at crosses and Double T-junctions. It was validated on experimental values with a large range of flows. One limitation is the need for extrapolation for Reynolds number approaching zero or infinity. What is proposed is to complete the two previous models into another one-dimensional model. The approach is to use a Computational Fluid Dynamics (CFD) based method with some results published in [4, 18].

A double T-junction (Fig. 2) is a special kind of junction composed of an interpipe connecting two T-junctions. In case of two inflows on one side and two outflows on the other side, the mixing may not be perfect depending on four parameters: The first one is the length of the interpipe, noted L, the longer it is the more likely the mixing will be perfect as the two inlet streams will have time to mix; the second is Re average , the average Reynolds number in the interpipe, which also corresponds through the flow rate balance to the sum of both Reynolds numbers at the inlets and also at the outlets; the third one corresponds to how much flow comes from both inlets. And because the averaged Reynolds numbers can vary, it was decided to use the ratio:

$$ {R}_1^{in} = \frac{R{e}_{In1}}{R{e}_{average}}\times 100=\frac{R{e}_{In1}}{R{e}_{In1}+R{e}_{In2}}\times 100=100-{R}_2^{in} $$
Fig. 2
figure 2

Double T-junction configuration with 2 inlets and 2 outlets

Therefore, the third parameter chosen is \( {R}_1^{in} \), which represents how much flow goes in inlet 1 compared to the average Reynolds number. By fixing this parameter, it also determines \( {R}_2^{in} \). Finally, the fourth parameter is like the third one and corresponds to the outlets, it is noted \( {R}_1^{out} \). To summarize, the four parameters which are expected to modify the behavior of the mixing in the simulations, are: L, Re average , \( {R}_1^{in} \) and \( {R}_1^{out} \).

It is proposed to use 3-D CFD simulations to create a 1-D law based on a lookup table and a 4-D Kriging interpolation method. Code Saturne [2] has been used to simulate laminar flows and ANSYS Fluent for turbulent flows. Some common simulations have been completed on both software for turbulent cases and have given similar results, which justifies that they can both be used to model the phenomenon. They have been computed on the Mésocentre de Calcul Intensif Aquitain (MCIA) and Irstea computation grid respectively. The Jade supercomputer of Centre Informatique National de l’Enseignement Supérieur (CINES) has been used to assure the validity of the grid convergence.

The CFD simulations that have been carried out are composed of 2 types:

  • The first one is composed of the laminar flow (Re ≤ 2000) and transitional flow (2000 < Re < 4000) cases. Direct Numerical Simulations (DNS) have been used and the transport model is the resolution of the advection equation for a concentration. In Fig. 2, the boundary conditions are 0 mg/L for the straight inlet (In1) and 1 mg/L for the other one (In2). The velocities at 3 boundary surfaces are calculated from the laminar velocity formula:

    $$ v(r) = 2*vm*\left(1-\frac{r2}{R2}\right) $$

    With v the velocity that is calculated, vm the average velocity, r the radius from the center of the pipe and R the internal radius of the pipe. The last boundary surface is set as pressure outflow.

  • The second one is composed of the turbulent cases (Re ≥ 4000). Large Eddy Simulation (LES) has been applied with Smagorinsky model. The Mixture model of ANSYS Fluent has been used. Two fluids are defined to be water with similar properties but different limit conditions, the volume fraction of each fluid is set to 0 and 1 respectively at each input. Turbulent profiles have been developed and injected at the inlet and flow percentages are defined for each output.

Additionally, LES and DNS simulations are transient and therefore results need to be averaged for a sufficient period (e.g., several dozen minutes) when converged (see Fig. 3).

Fig. 3
figure 3

Example of simulation result: curve of mass flux (left: Out1, right: Out2) with averaging range

It was determined in a previous study [13] that for Re > 10,000, no further change in behavior is observed. Additionally, it has been shown by [13] that after 20 diameters for the length between 2 T-junctions, perfect mixing occurs (Eq. 2). A discussion with operating partners has permitted fixing the low boundary for distance between T-junctions. Indeed, crosses and double T-junctions cannot be compared easily, because for double T-junctions some space is needed to put a valve at the interpipe. Therefore, we have chosen the initial domain for parameters as in Table 1.

Table 1 Parameters’ range

An important issue is the choice of boundary conditions (cases when either \( {R}_1^{in} \) or \( {R}_1^{out} \) equals 0 or 100): contrary to previous studies, the boundary conditions are fixed to be the perfect mixing case (Eq. 2).

Initially 180 simulations were carried out but some grid refinement was necessary for better capturing the variations of the concentration at outlets. In this paper, we have placed iteratively new simulation points to minimize the error of interpolation by the Delaunay method. The interpolation is first described and kriging method is used.

2.2 Kriging interpolation

The Kriging method is a well-known method [5, 11, 14] invented in geological sciences by Matheron and Krige. It gives an effective way of interpolating non-structured points outside the initial Cartesian grid.

Spatial inference of the mass flux Z, at an unobserved location s 0 in the space of parameters defined in Table 1, is calculated from a linear combination of the observed values z i  = Z(s i ) and weights λ i as follows:

$$ \widehat{Z}\left({s}_0\right)={\displaystyle \sum_i}{\lambda}_i\left({s}_0,{s}_i\right)Z\left({s}_i\right) $$

There are two objectives for estimating the weights: to obtain minimal variance of estimation and to constrain the minimal variance objective.

Kriging is a minimum variance method based on the definition of a probability distribution at each of the n sample points xi. It is based on the theory of regionalized variables and provides best results when data points are not evenly spread. Compared to radial-based interpolation, it gives more predominance to closer nodes [20]. It also has the advantage to be a generalization of radial-based function [10]. A comparison of 12 different types of interpolations is accomplished in [6] and Kriging interpolation gives a very good approximation but is quite slow. However, the time of interpolation can be neglected in this study compared to the CFD simulation time, therefore Kriging interpolation is a good choice. The method chosen is the universal Kriging that we detail below.

2.2.1 Kriging interpolation solution

Z is taken as the sum of a polynomial function F and a stochastic scalar function Y. The first part explains the mean behavior of the function we interpolate and the second part is a stochastic function with known mean and variance. Considering n points of observation s i and the interpolation point s the following stochastic model reads:

$$ Z(s) = {\displaystyle \sum_{l=1}^p}{f}_l(s){\beta}_l+Y(s) $$
(5)

With fl the polynomial component functions, βl the unknown coefficients of the polynomial and p the polynomial order.

We set

$$ \begin{array}{ccc}\hfill \mathbf{F}(s)=\left({f}_1(s),..,{f}_p(s)\right)\hfill & \hfill \mathrm{and}\hfill & \hfill \boldsymbol{\upbeta} =\left(\begin{array}{c}\hfill {\beta}_1\hfill \\ {}\hfill \vdots \hfill \\ {}\hfill {\beta}_p\hfill \end{array}\right)\hfill \end{array} $$

Therefore (5) can be written,

$$ Z(s) = Y(s) + \mathbf{F}(s)\boldsymbol{\upbeta} $$

Remark: if the row-vector F(s) is only composed of one element equal to 1, the method is called ordinary Kriging, otherwise it is universal Kriging.

In the theory, it is also supposed that the stochastic part is of expectation zero.

$$ E\left(\mathbf{Y}(s)\right)=0 $$

It implies:

$$ \begin{array}{c}\hfill Cov\left(\mathbf{Z}\right)=Cov\left(\mathbf{Y}\right)=E\left[\mathbf{Y}{\mathbf{Y}}^T\right]\hfill \\ {}\hfill E\left[Z(s)\right] = \mathbf{F}(s)\boldsymbol{\upbeta} \hfill \end{array} $$

Where Z and Y are the column n-vectors with components (Z(s i)) and (Y(s i))

Finally, the covariance of the noise Y is set as:

$$ \begin{array}{c}\hfill \mathbf{K}=Cov\left(\mathbf{Y}\right) = {\sigma}^2\mathbf{R}\left(\mathbf{Y}\right)\hfill \\ {}\hfill R\left(Y\left({s}_i\right),Y\left({s}_j\right)\right)={\displaystyle \prod_{k=1}^m} \exp \left(-{\theta}_k{\left|{s}_{ik}-{s}_{jk}\right|}^{\gamma_k}\right)\hfill \end{array} $$
(6)

Where m is the dimension of the problem (here 4) and θk and γk are to be estimated. The same equation is used when calculating R(Y(s0),Y(sj)) with the coordinates of the estimation point s0 instead of any observation point si.

The Kriging function is solved by setting the estimation of Z at the point s 0 by taken it as a linear combination of the value Z takes on the observation points.

$$ \widehat{Z}\left({s}_0\right)={\displaystyle \sum_i}{\lambda}_i\left({s}_0,{s}_i\right)Z\left({s}_i\right) $$
(7)

Where the λi are the unknowns of the problem.

Moreover, we consider an unbiased predictor:

$$ E\left[\widehat{Z}\left({s}_0\right)\right]=E\left[Z\left({s}_0\right)\right] $$

This leads to:

$$ \forall {s}_0,{\displaystyle \sum_i}{\lambda}_i\mathbf{F}\left({s}_i\right)\boldsymbol{\upbeta} =\mathbf{F}\left({s}_0\right)\boldsymbol{\upbeta} $$

Which is satisfied if:

$$ \forall l\in \left[1,p\right],{\displaystyle \sum_i}{\lambda}_i{f}_l\left({s}_i\right)={f}_l\left({s}_0\right) $$

We seek λi that minimizes the variance of the error term:

$$ \min e\left(\boldsymbol{\uplambda} \right) = Var\left[\widehat{Z}\left({s}_0\right)-Z\left({s}_0\right)\right] $$

By expanding the error term:

$$ \begin{array}{l}\widehat{Z}\left({s}_0\right)-Z\left({s}_0\right) = {\displaystyle \sum_i}{\lambda}_i\left(Y\left({s}_i\right) + \mathbf{F}\left({s}_i\right)\boldsymbol{\upbeta} \right)-Y\left({s}_0\right) - \mathbf{F}\left({s}_0\right)\boldsymbol{\upbeta} \hfill \\ {} = {\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right) - Y\left({s}_0\right)\hfill \end{array} $$

It follows:

$$ \begin{array}{l}Var\left[\widehat{Z}\left({s}_0\right)-Z\left({s}_0\right)\right]=Var\left[{\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right) - Y\left({s}_0\right)\right]\hfill \\ {}=E\left[{\left({\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right) - Y\left({s}_0\right)\right)}^2\right]-{\left(E\left[{\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right) - Y\left({s}_0\right)\right]\right)}^2\hfill \\ {}=E\left[{\left({\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right) - Y\left({s}_0\right)\right)}^2\right]\hfill \\ {}=E\left[{\left({\displaystyle \sum_i}{\lambda}_iY\left({s}_i\right)\right)}^2\right]-2{\displaystyle \sum_i}{\lambda}_iE\left[Y\left({s}_i\right)Y\left({s}_0\right)\right]+E\left[{\left(Y\left({s}_0\right)\right)}^2\right]\hfill \\ {}={\displaystyle \sum_i}{\displaystyle \sum_j}{\lambda}_i{\lambda}_iCov\left(Y\left({s}_i\right),Y\left({s}_j\right)\right)-2{\displaystyle \sum_i}{\lambda}_iCov\left(Y\left({s}_i\right),Y\left({s}_0\right)\right)+Var\left(Y\left({s}_0\right),Y\left({s}_0\right)\right)\hfill \end{array} $$

We recall that:

$$ {K}_{ij}=Cov\left(Y\left({s}_i\right),Y\left({s}_j\right)\right) $$

We have found that the function to minimize is quadratic in lambda with Hessian K that is symmetrical definite positive (under mild conditions of θ). It is therefore strongly convex.

The convex minimization problem states:

$$ \left\{\begin{array}{c}\hfill \min Var\left[\widehat{Z}\left({s}_0\right)-Z\left({s}_0\right)\right]\hfill \\ {}\hfill \forall l\in \left[1,p\right],{\displaystyle \sum_i}{\lambda}_i{f}_l\left({s}_i\right)={f}_l\left({s}_0\right)\hfill \end{array}\right. $$
(8)

It is possible to define a problem without constraint by defining the Lagrangian function and the Lagrange multipliers μl such that:

$$ L\left(\boldsymbol{\uplambda}, \boldsymbol{\upmu} \right)={\displaystyle \sum_i}{\displaystyle \sum_j}{\lambda}_i{\lambda}_i{K}_{ij}-2{\displaystyle \sum_i}{\lambda}_i{k}_i\left({s}_0\right)+{k}_{00} + 2{\displaystyle \sum_l}{\upmu}_{\mathrm{l}}\left({\displaystyle \sum_i}{\lambda}_i{f}_l\left({s}_i\right)-{f}_l\left({s}_0\right)\right) $$
(9)

Or

$$ L\left(\ \boldsymbol{\uplambda}, \boldsymbol{\upmu} \right)=\langle \langle \boldsymbol{\uplambda} \Big|\mathbf{K}\boldsymbol{\uplambda } \rangle -2\langle \langle \boldsymbol{\uplambda} \Big|\mathbf{k}\left({s}_0\right)\rangle +{\sigma}^2+2\langle \langle \boldsymbol{\upmu} \Big|{\displaystyle \sum_i}{\lambda}_i{\mathbf{F}}^{\boldsymbol{T}}\left({s}_i\right)-{\mathbf{F}}^{\boldsymbol{T}}\left({s}_0\right)\rangle $$

With ki(s0) = Cov(Y(s0), Y(si)) and k00 = Cov(Y(s0), Y(s0)) = σ2 are given by Eq. (6).

The sufficient and necessary optimality conditions are:

$$ \left\{\begin{array}{c}\hfill \forall l\in \left[1,p\right],{\displaystyle \sum_i}{\widehat{\lambda}}_i{f}_l\left({s}_i\right)={f}_l\left({s}_0\right)\hfill \\ {}\hfill \forall i\in \left[1\dots n\right],\ {\displaystyle \sum_j}{\widehat{\lambda}}_j{K}_{ij}-{k}_i\left({s}_0\right) + {\displaystyle \sum_l}\widehat{\upmu_{\mathrm{l}}}{f}_l\left({s}_i\right)=0\hfill \end{array}\right. $$
(10)

These last equations can be written as the saddle point equation:

$$ \left(\begin{array}{cc}\hfill \mathbf{K}\hfill & \hfill \mathbf{F}\hfill \\ {}\hfill {\mathbf{F}}^T\hfill & \hfill 0\hfill \end{array}\right)\left(\begin{array}{c}\hfill \widehat{\boldsymbol{\uplambda}}\hfill \\ {}\hfill \widehat{\boldsymbol{\upmu}}\hfill \end{array}\right)=\left(\begin{array}{c}\hfill {\mathbf{K}}_0\hfill \\ {}\hfill \mathbf{F}{\left({s}_0\right)}^T\hfill \end{array}\right) $$
(11)

Using the Schur complement of K in the full matrix, it leads to the expression of optimal λ and μ:

$$ \widehat{\boldsymbol{\upmu}}={\left[{\mathbf{F}}^T{\mathbf{K}}^{-1}\mathbf{F}\right]}^{-1}\left({\mathbf{F}}^T{\mathbf{K}}^{-1}{\mathbf{K}}_0-\mathbf{F}{\left({s}_0\right)}^T\right) $$
(12)
$$ \widehat{\boldsymbol{\uplambda}}={\mathbf{K}}^{-1}\left({\mathbf{K}}_0-\mathbf{F}\widehat{\boldsymbol{\upmu}}\right) $$
(13)

Moreover, we also obtain an estimation of the error variance by using Eq. (10) in the Eq. (9):

$$ Var\left[\widehat{Z}\left({s}_0\right)-Z\left({s}_0\right)\right] = {\widehat{\sigma}}^2 - \widehat{\lambda}{\mathbf{K}}_0 - {\widehat{\boldsymbol{\uplambda}}}^T\mathbf{F}\widehat{\boldsymbol{\upmu}} $$

The parameters σ, βθ (Eqs. 5 and 6) are estimated at maximum-likelihood sense and calibrated in different process that is detailed in Appendix. The γk are fixed to 1 s; a regularization term α is added to the diagonal of the correlation matrix.

The interpolation is used in the 1-D law based on the lookup-table of the results, and to determine the errors of interpolation used with a Delaunay triangulation to choose new points of simulation from an initial set.

2.3 Delaunay triangulation

One limitation of such a study is the limited number of simulations to be performed. Indeed, DNS and LES simulations are computationally demanding, therefore a method is needed to find the best point of simulation. One well-known method is the Latin-Square design [1] consisting in dividing the space into a fixed number of squares and then randomly picking points in each square. However, for numerical simulations, a major drawback is that it requires a lot of simulation points, at least one for each region defined. In this study we have selected the Delaunay triangulation method. It consists of the calculation of interpolation error sums (based on the Krigging as described before) in the triangulation domain to define the region the most susceptible to be poorly modelled. It was made to enrich the database of principal components analysis basis functions used in oscillating airfoils in a compressible flow context. Points of simulations could have been chosen from structured method or Latin Hypercube method [15] which is a generalization of the Latin-Square design, however more points of simulation would have been needed.

The Delaunay triangulation is in general used for space partitioning. It defines a list of triangles from a list of points where no points are strictly inside any circumcircle of any triangle. Here it is used to determine new points of simulations by a greedy algorithm:

  • For each point of the design plan, we define the interpolation error as the absolute difference between its value and the interpolated value at that point when it is not considered;

  • For every Delaunay triangle the sum of the interpolation error of its vertices multiplied by its area is calculated;

  • The best point candidates to include in the design plan are the centers of gravity for triangles with the highest weight; then, in this research, the selected point is the closest point with rounded coordinates, which is more convenient for simulation.

A simple example is given in Fig. 4 taking into account nine points, which are given in Table 2. The function M is the list of the measurements and E is the list of errors of interpolation when discarding the point.

Fig. 4
figure 4

Result of the Delaunay method with: left) Delaunay triangles and new design points; middle) full interpolation; right) interpolation without point (1,0)

Table 2 Example of the Delaunay method with associated errors

The method divides the space in eight triangles of equal area. The maximum error is found at the points (0,0) and (2,0) equal to 1.75. In this case, the two-bottom triangles will most likely be chosen for new simulations (blue crosses), this is where more accuracy is needed. The method detects the most problematic point, here the only point not in the plan z = y + 1, and refines around it.

To summarize, the Delaunay triangulation method and a greedy algorithm are used here to select appropriate new simulation points. With such a formulation, the gain of the selected point is maximized.

2.4 1-D law

Once the appropriate simulation points are selected and computed (the lookup table is filled), a 1-D law can be developed to couple it with current transport models which are all one dimensional. Simulations are time consuming and therefore can only be done in a very small network, but it is impossible in a real one. So, a 1-D model should be designed in order to predict the transport in an operating network that can be used in real time. It uses the lookup table of the simulations results and determines the proportion of mixing with the help of the Kriging interpolation. The simulations are executed based on the following scenario: pure water coming from In1 and contaminated water coming from In2. The law first needs to be generalized in case of any water concentration at each inlet.

Let’s consider C1, C2, C3 and C4 the mean concentrations on the cross sections for the following pipes In1, In2, Out1 and Out2 (cf. Fig. 2). In the CFD simulation, C1 = 0 mg/L, C2 = 1 mg/L have been chosen. We calculate the ratio θ of the average mass flux Q3C3 going out of the output 1 divided by the introduced mass flux:

$$ \uptheta = \frac{{\mathrm{Q}}_3{\mathrm{C}}_3}{{\mathrm{Q}}_1{\mathrm{C}}_1+{\mathrm{Q}}_2{\mathrm{C}}_2} $$

And in the case C1 =0 mg/L, C2 = 1 mg/L:

$$ \uptheta = \frac{{\mathrm{Q}}_3{\mathrm{C}}_3}{{\mathrm{Q}}_2{\mathrm{C}}_2}=\frac{{\mathrm{Q}}_3{\mathrm{C}}_3}{{\mathrm{Q}}_2} $$

We then define θ* as the deviation from the perfect mixing ratio:

$$ {\uptheta}^{*}=\uptheta -\frac{{\mathrm{Q}}_3\times \frac{\left({\mathrm{Q}}_1{\mathrm{C}}_1+{\mathrm{Q}}_2{\mathrm{C}}_2\right)}{{\mathrm{Q}}_1+{\mathrm{Q}}_2}}{{\mathrm{Q}}_1{\mathrm{C}}_1+{\mathrm{Q}}_2{\mathrm{C}}_2}=\uptheta -\frac{{\mathrm{Q}}_3}{{\mathrm{Q}}_1+{\mathrm{Q}}_2}=\uptheta -\frac{{\mathrm{Q}}_3}{{\mathrm{Q}}_3+{\mathrm{Q}}_4} $$
(14)

θ* is the coefficient saved in the lookup table. θ* is bounded from below by −1 and from above by +1. In practice θ* was found in the range [−0.056, 0.361].

From \( {\uptheta}^{*}\left({R}_1^{in},{R}_1^{out},\ \mathrm{R}\mathrm{e},\frac{\mathrm{L}}{\mathrm{D}}\right) \), that is interpolated at values which are not in the table by the Kriging method, \( \uptheta \left({R}_1^{in},{R}_1^{out},\ \mathrm{R}\mathrm{e},\frac{\mathrm{L}}{\mathrm{D}}\right) \) is calculated from Eq. (14).

Therefore, if C1 = 0 mg/L, C2 = 1 mg/L:

$$ {\mathrm{Q}}_3{\mathrm{C}}_3 = \uptheta\ \left({R}_1^{in},{R}_1^{out},\ \mathrm{R}\mathrm{e},\ \mathrm{L}/\mathrm{D}\right)\times {\mathrm{Q}}_2 $$

This can be generalized for any C1 and C2. The mass flux leaving by outlet Out1 is composed of a part coming from In1 and another one from In2, the same for Out2.

$$ \left\{\begin{array}{c}\hfill \begin{array}{c}\hfill {\mathrm{Q}}_3{\mathrm{C}}_3 = {\uptheta}_{13}\times {\mathrm{Q}}_1{\mathrm{C}}_1+{\uptheta}_{23}\times {\mathrm{Q}}_2{\mathrm{C}}_2\hfill \\ {}\hfill {\mathrm{Q}}_4{\mathrm{C}}_4={\uptheta}_{14}\times {\mathrm{Q}}_1{\mathrm{C}}_1+{\uptheta}_{24}\times {\mathrm{Q}}_2{\mathrm{C}}_2\hfill \end{array}\hfill \\ {}\hfill {\uptheta}_{23}=\uptheta \hfill \end{array}\right. $$

We thus have a system of three equations and six unknowns (C3, C4, θ13, θ23, θ14, θ24), since we know the flows, C1 and C2. To resolve the system, we need three more constrains, they can be found as follows:

When C1 = 0, the mass-balance between inlets and outlets must be satisfied:

$$ \left({\mathrm{Q}}_1{\mathrm{C}}_1+{\mathrm{Q}}_2{\mathrm{C}}_2\right)={\mathrm{Q}}_2{\mathrm{C}}_2=\left({\mathrm{Q}}_3{\mathrm{C}}_3+{\mathrm{Q}}_4{\mathrm{C}}_4\right) $$

So

$$ {\mathrm{Q}}_2{\mathrm{C}}_2 = {\uptheta}_{23}\times {\mathrm{Q}}_2{\mathrm{C}}_2+{\uptheta}_{24}\times {\mathrm{Q}}_2{\mathrm{C}}_2 $$

Assuming that Q2C2 is not zero leads to:

$$ {\uptheta}_{24}=\left(1-{\uptheta}_{23}\right) $$

Similarly, when C1 = 0 and Q1 C1 is positive, we get:

$$ {\uptheta}_{14}=\left(1-{\uptheta}_{13}\right) $$

Finally, for C1 = C2 >0, the mixing of fluids of similar concentration should give a fluid of same concentration, C3 = C4 = C1 = C2 >0 :

$$ \begin{array}{c}\hfill \left\{\begin{array}{c}\hfill {\mathrm{Q}}_3 = {\uptheta}_{13}\times {\mathrm{Q}}_1+{\uptheta}_{23}\times {\mathrm{Q}}_2\hfill \\ {}\hfill {\mathrm{Q}}_4={\uptheta}_{14}\times {\mathrm{Q}}_1+{\uptheta}_{24}\times {\mathrm{Q}}_2\hfill \end{array}\right.\hfill \\ {}\hfill \begin{array}{cc}\hfill \mathrm{then}\hfill & \hfill \left\{\begin{array}{c}\hfill {\uptheta}_{13}=\frac{{\mathrm{Q}}_3 - {\uptheta}_{23}\times {\mathrm{Q}}_2}{{\mathrm{Q}}_1}\hfill \\ {}\hfill {\uptheta}_{14}=\frac{{\mathrm{Q}}_4 - {\uptheta}_{24}\times {\mathrm{Q}}_2}{{\mathrm{Q}}_1}\hfill \end{array}\right.\hfill \end{array}\hfill \end{array} $$

This gives four more equations from which three are independent, for example:

$$ \begin{array}{c}\hfill \left[{\uptheta}_{13}=\frac{{\mathrm{Q}}_3 - {\uptheta}_{23}\times {\mathrm{Q}}_2}{{\mathrm{Q}}_1};\ {\uptheta}_{24}=\left(1-{\uptheta}_{23}\right)\ \mathrm{and}\ {\uptheta}_{14}=\left(1-{\uptheta}_{13}\right)\right]\hfill \\ {}\hfill = > {\uptheta}_{14}=\frac{{\mathrm{Q}}_4 - {\uptheta}_{24}\times {\mathrm{Q}}_2}{{\mathrm{Q}}_1}\hfill \end{array} $$

We have six equations for six unknowns that can be reduced to four equations with four unknowns:

$$ \left\{\begin{array}{c}\hfill {\mathrm{Q}}_3{\mathrm{C}}_3 = {\uptheta}_1\times {\mathrm{Q}}_1{\mathrm{C}}_1+{\uptheta}_2\times {\mathrm{Q}}_2{\mathrm{C}}_2\hfill \\ {}\hfill {\mathrm{Q}}_4{\mathrm{C}}_4=\left(1-{\uptheta}_1\right)\times {\mathrm{Q}}_1{\mathrm{C}}_1+\left(1-{\uptheta}_2\right)\times {\mathrm{Q}}_2{\mathrm{C}}_2\hfill \\ {}\hfill {\uptheta}_2 = \theta \hfill \\ {}\hfill {\uptheta}_1=\frac{{\mathrm{Q}}_3 - {\uptheta}_2\times {\mathrm{Q}}_2}{{\mathrm{Q}}_1}\hfill \end{array}\right. $$
(15)

C3 and C4 can be calculated from θ, C1, C2 and the flows rates.

These equations allow the definition of a law that can be used for every double T-junction (with equal diameters). CFD simulation results have helped to fill a lookup table with a non-dimensional indicator of the deviation from the perfect mixing. A system of equations that generalizes the case of an introduction of a contaminant only at inlet 2 to both inlets is derived. Firstly the Kriging interpolation is used to determine the coefficient θ and then is put as input in Eq. (21) to get the concentration at the outlets.

For instance, let’s consider a Double T-junction with a diameter of 0.1 m and an interpipe of length L = 5D. The flow rates are for each input and output such that Reynolds numbers are Re1 = Re2 = Re3 = Re4 = 2500. The four parameters are respectively, Re = 5000, L = 5, \( {R}_1^{in} \) =50, \( {R}_1^{out} \) =50. The interpolation function returns θ = 0.6, then θ2 = 0.6 and θ1 = 0.4. Let’s say that a contaminated water comes from inlet1 with C1 = 1 mg/L and another water at inlet 2 with C2 = 4 mg/L then the concentration on both outputs are: C3 = 2.8 mg/L and C4 = 2.2 mg/L.

3 Results

In this part the results are given and interpreted. First the Kriging calibration and the explanation for the parameter choice are described. Then, it is shown how the Delaunay triangulation helps to choose the design points and reduces the computational overall cost. Finally, the CFD simulation results, for different Reynolds numbers and contaminant inlet-exit ratios (Fig. 14), are given and interpreted to explain the behavior of the imperfect mixing in Double T-junctions depending on the different entry parameters.

3.1 Kriging calibration

This part follows the theory on the calibration of the Kriging parameters. It has been shown that after simplification, the Eq. (15) can be used to determine the parameters (σ, θk and γ k ).

The problem is not convex, therefore to understand the behavior of the function \( \mathrm{f}\left(\tilde{\uptheta},\upalpha \right) \), it has been ploted on Fig. 5 with the generalized correlation parameter \( \tilde{\uptheta}\ \in \left[0,10\right] \), the regularization term α  [0, 1] and the polynomial degree k between 0 and 3 as well as no polynomial, k being the degree of the polynomial. With σ, β fixed as optimal values from Eqs. 11 and 12). When there is not a polynomial term it is called simple Kriging (SK), when k = 0 its name is ordinary Kriging, for k > 0 it is universal Kriging.

Fig. 5
figure 5

Contour plot of the log-likelihood function with respect to the shape parameter theta and the regularization parameter for polynomial equals to zero or its degree equals to 0, 1, 2 and 3

For k between 0 and 3 and SK, there are 3 regions for α. If α is too small (<0.45), the R matrix may not be invertible (because it is not regularized enough), therefore its determinant is zero and the function f equals infinity. On the other hand, if α is too large (>0.6), the correlation matrix may be too close to (1 + α)In, therefore its determinant is approximately (1 + α)n, the matrix is invertible but its determinant in floating-point arithmetic is +infinity.

To get the optimized parameters, the system presented in the Appendix (Eq. 24) has been resolved by choosing \( \tilde{\uptheta}=4 \) at first iteration (because visually near the minimum) and α = 0.5, for k =0, 1, 2, 3:

Table 3 sums up the result found by resolving Eq (21), final value of \( \tilde{\uptheta} \) increases with k. As σ, β are different for each k, the initial value of f gives different initial values. In this case the initial value of f is further away from the optimal value for lower values of k. The optimal value of f decreases with k. The average absolute error is the lowest for k = 0. Except for that, for average error and standard deviation, their values decrease with k increasing. Minimum errors are close to zero for all and maximum errors decrease with k increasing.

Table 3 Result of optimization of the Kriging parameters by resolving the log-likelihood function with respect to the shape parameter theta and the regularization parameter for no polynomial and polynomial degree equals to 0, 1, 2 and 3

Finally, we have chosen k =3, \( \widehat{\upsigma} \), \( \widehat{\upbeta} \), \( \tilde{\uptheta}=3.63 \) and α = 0.5 with γk components all being fixed to 1 that correspond to a minimal standard deviation in this case.

3.2 Delaunay triangulation

In the Theoretical part it was shown that the Delaunay triangulation can be used for the design of simulation points. Here, it is described how it can be also used to reduce the computational cost overall compared to a classical Structured design algorithm.

In Fig. 6, the behavior of the Delaunay method is highlighted with an application of the case L = 5D and Reynolds number = 1000. On the left can be seen the Delaunay triangles partitioning the domain space, the vertices being the point of simulation or the boundaries. The blue cross defines the new point of simulation to perform. On the right is plotted the interpolation result, initially and after multiple simulations chosen by the Delaunay method. The repartition of the simulation chosen points is not structured, most points are chosen on the right part where the straight inlet is dominating, \( {R}_1^{in} \) > 50. It is also where the simulations give imperfect mixing results and the derivates are bigger.

Fig. 6
figure 6

Example of Delaunay method application and interpolation of imperfect mixing for the distance = 5D, Reynolds = 1000: up) before, down) after simulations chosen by the triangulation of Delaunay

Table 4 sums up the different new simulation points to consider that were found for the case where distance = 5D and Re = 1000 are fixed. The first column refers to the order of the simulations made given the Delaunay method and the number 0 is for the initial simulations. The second and third columns give the percentage of inlet 1 Reynolds number and outlet 1 Reynolds number to the averaged Reynolds number 1000. Finally the fourth and fifth columns are the sum of the errors, either averaged (divided by current number of points) or the maximum, of all the points simulated at each stage.

Table 4 Delaunay points for distance = 5D and Re = 1000

In Table 4 and Fig. 7, it can be observed that for both types of error, it is globally decreasing. The error can increase when a particular point is found, in this example (80, 30), but then the Delaunay method will search for points around that will decrease the global error. Figure 6 on the left shows the points of Delaunay locations (vertices of the Delaunay triangle). At the end the method concentrates the points where there is a need for more information, here in the right part, when the straight inlet is dominating.

Fig. 7
figure 7

Comparison between structured and the Delaunay simulation point selection

The Delaunay method has been used for space partitioning for selecting new CFD simulations to perform. At each step, it calculates the absolute interpolation errors, which can be used as a stop criterion. For instance, if we have fixed the mean error at 3 as the criteria of convergence, there is no need to continue the simulations after the 19th simulation. It gives an effective way to consume less computational time, by favoring simulations that give the most information.

In order to show that the Delaunay method performs better than the Structured method in terms of design point selection, they are compared. Figure 7 shows the average and maximum error of interpolation (as explained before) when adding points of simulation. To compare both methods there is the need to define how the Structured algorithm was performed. The Structured selections have been made using the following sets of simulation points in Fig. 8: the groups go from 0 to 8 (each having its own color). Each number represents a set of points, whose number is between 8 and 12 points. For instance, at first, both methods begin with the set 0 composed of 9 points corresponding to Reynolds number combination ratios of 30/50/70. Then, 10/50/90 (set 1) combination is added to the precedent points. Henceforth it goes until set 8, when the domain is filled with a fully-structured repartition of points.

Fig. 8
figure 8

Structured selection of points

For both average and maximum interpolation error, the Delaunay method gives better results with a steady average behavior of error decreasing. For the average error, both methods give similar results at first, until a point when the Delaunay method error stays smaller compared to the Structured error. For maximum error, the Structured method doesn’t have a well-defined behavior compared to average steady decrease of the Delaunay method. Each new peak of increase can be explained by new regions of space not well modeled. The Delaunay triangulation is then selecting points in that region until the error decreases again. This justifies the use of the Delaunay method over the Structured method.

The Delaunay method has been used for space partitioning for selecting new CFD simulations to perform. At each step, it calculates the absolute interpolation errors, which can be used as a stop criterion. For instance, if we have fixed the mean error at 3 as the criteria of convergence, there is no need to continue the simulations after the 19th simulation. It gives an effective way to consume less computational time, by favoring simulations that give the most information.

3.3 Simulation results and interpretations

In this part, the CFD simulation results and the parameters influence on the behavior of the mixing in the Double T-junctions, are given and interpreted.

Table 5 gives a non-exhaustive list of the simulations performed. The first column is the distance between Ts (in diameters), the second is the average Reynolds number (in the center of the pipe), the third column is the Reynolds percentage of inlet 1 (straight inlet see Fig. 1) from the previous one, the fourth is for the outlet 1 (\( {R}_2^{in} \) and \( {R}_2^{out} \) can be found from 100 - \( {R}_1^{in} \) and 100 - \( {R}_1^{out} \) respectively). The last two columns give the repartition of contaminant for outlet 1 and 2 averaged in time.

Table 5 Results of the CFD simulations for different parameters (non-exhaustive)

For the interpretation of results, it is worth recalling that 100% of the contaminant comes from inlet 2 and 0% from inlet 1. One way of viewing Table 5 is by fixing two parameters and plotting the result with the two others varying. In Fig. 9 the distance is fixed to 5D and the Reynolds number is 1000. It shows Z, the difference between the result found in the simulations and the complete mixing plan (z = \( {R}_1^{out} \)). Therefore the values are inside the boundary space \( \left[0-{R}_1^{out};100-{R}_1^{out}\right] \). The difference is up to 30%, and therefore cannot be neglected. It can also be seen that for \( {R}_1^{in} \) <50, that is when the straight inlet is dominated, the mixing law is almost complete. The mixing is inversed when \( {R}_1^{in} \) >85, more concentration is detected at Outlet 2 than in perfect mixing condition. A peak is visible with its top around \( {R}_1^{in} \) =70 found in every configuration.

Fig. 9
figure 9

Interpolation result in case of distance = 5D and Reynolds number = 1000

Figure 10 shows the results when the Reynolds number is fixed at 5000 and the distance is increased from 5D to 10D. It can be observed that there is a peak situated in the right part (when the straight inlet is dominating). The effect of increasing the distance between the two T-junctions looks to be a reduction of the peak in height and width. More simulations are needed for the case 5D as well as tests for grid convergence when the straight inlet is dominating (\( {R}_1^{in} \) >80).

Fig. 10
figure 10

Comparison of interpolation results in case of Reynolds number = 5000 and distance = left) 5D, middle) 8D, right) 10D

Now, CFD simulations are plotted and interpreted. First is given the repartition of simulations that have been carried out for the four parameters (Re, L, \( {R}_1^{in} \) and \( {R}_1^{out} \)). Then, two ways of interpreting the results are presented. One is by fixing the Reynolds number and the distance, the other by fixing the inlet and outlet Reynolds ratios.

All simulation points have been gathered on

Figure 11 that shows the list of simulations that have been realized, here represented by points. Each point is defined by its Reynolds number and its intermediate pipe length as well as its value of \( {R}_1^{in} \) and \( {R}_1^{out} \) respectively in x-axis and y-axis. The Delaunay method has been mostly used on the space Re = 1000/L = 5D and Re = 5000/L = 5D to ensure the validity of the interpolation.

Fig. 11
figure 11

Points of simulations summary

The results of the four parameter interpolation have been drawn on Figs. 12 and 13. The first figure gives a lot of information on the behavior of this law. We may observe that when the second input (see Fig. 2) is dominating (\( {R}_1^{in} \) < 50%), the mixing is almost perfect. On the other hand, when it is the first input that is dominating, the mixing is not perfect. And it converges toward the perfect mixing with the increase of the distance and the Reynolds number. The case Re = 30,000, L = 5D, \( {R}_1^{in} \) = 70 was additionally computed and is showing that the function converges to a stable equilibrium for high Reynolds number, which may not be the perfect mixing depending on the distance. In case 5D, 70/50 it tends to Z =10, that means that in this case where the ratio at the output is 60% of mass introduced goes into Out1 (instead of 50%) and 40% in Out2. When D is increased, a slow converging to perfect mixing in the laminar case can be seen. Figure 13 shows that for different configurations of Reynolds fractions in input and output, the behavior law is very different. As seen in Fig. 12, when \( {R}_1^{in} \) is lower than 50 the mixing is mostly perfect. In the laminar case the mixing has a clear behavior, under \( {R}_1^{in} \) = 50 it is perfect mixing and above 70 it is imperfect mixing. In the turbulent case it is more progressive.

Fig. 12
figure 12

Interpolation 4-D Kriging in space \( \raisebox{1ex}{${R}_1^{\mathrm{in}}$}\!\left/ \!\raisebox{-1ex}{${R}_1^{\mathrm{out}}$}\right. \), case Re [1, 000; 20, 000] and L [5D; 20D]

Fig. 13
figure 13

Interpolation 4-D Kriging in space L/Re, case \( {R}_1^{\mathrm{in}} \) and \( {R}_1^{\mathrm{out}} \) = 20/30/50/70/80

To understand the behavior of the mixing, Fig. 14 shows the longitudinal section of the double T-junction in the case Re = 1000, L = 5D and \( {R}_1^{in} \) and \( {R}_1^{out} \) = 30/50/70 and plots the scalar. It can be seen that when the percentage of inlets at the first input is lower than \( {R}_1^{in} \) = 30%, the contaminated water coming from In2 hits the opposite wall, creating turbulence. When \( {R}_1^{in} \) = 50%, the turbulence is caused by the corner of the second T-junction. The more fluid going into the second output, the less stable is the flow. For \( {R}_1^{in} \) = 70, most of the contaminated water goes into the first output regardless of the output velocity repartition.

Fig. 14
figure 14

Representation of scalar on longitudinal section of Double T in cases Re = 1000 fixed, L = 5D fixed, and \( {R}_1^{\mathrm{in}} \) and \( {R}_1^{\mathrm{out}} \) = 30/50/70

More than 250 simulations have been made to describe the phenomenon in four directions (Reynolds, inter T distance, \( {R}_1^{in} \) and \( {R}_1^{out} \)). The results have been interpolated and projected on two different spaces (\( {R}_1^{in} \), \( {R}_1^{out} \)) and (Re, L). When the first input is dominated (\( {R}_1^{in} \) < 50) the mixing is perfect. The mixing becomes imperfect when \( {R}_1^{in} \) increases. This behavior shift is more pronounced for laminar cases whatever the inter T-junction distance, and progressive in turbulent cases. There is a maximum of imperfect mixing around \( {R}_1^{in} \) = 70. The mixing tends to perfect mixing when the inter T-junction distance increases, it is almost perfect for L = 20D in the turbulent case. It also decreases when the Reynolds number is increased but tends to equilibrium that may not be perfect mixing (tends to 10 when L = 5D, % \( {R}_1^{in} \) =70, \( {R}_1^{out} \) = 50). The behavior described can be explained by looking into the longitudinal section of the double T-junction. The mixing is created by hitting the walls, which depends on the ratios of the flow rates in input and output.

4 Conclusions

In this paper, the objective was to improve water distribution quality transport modeling for security management in case of contamination events. The focus was made on mixing conditions at Double T-junctions. Numerous 3-D CFD simulations of different configurations of Double T-junction mixing were performed and a 1-D law for imperfect mixing was derived that is added to the full network transport model. The mixing was explored using four input parameters: Reynolds number in the interpipe, the length between the two T-junctions and the ratio of Reynolds number at the inlets and at the outlets. As it is impossible to perform computations at every point, a problem-specific Kriging method was developed for interpolating mixing percentages at non-simulated configurations. For sampling design we adapted a Delaunay triangulation method to determine new configurations to simulate.

To complement this study, two CFD simulation tools were mainly used, Code Saturne for direct numerical simulations (DNSs) and Fluent for Large Eddy Simulation (LESs). The results of the simulations were included in a lookup table and were interpolated with the interpolation Kriging method.

The parameters of this method were optimized for the problem by minimizing a log-likelihood function. As the problem is not strictly convex and not defined everywhere, choices were made to simplify the problem allowing a linear system of equations to be solved.

Moreover, a Delaunay method was used to optimize the repartition of simulation points and therefore the sampling design. The Kriging interpolation was then coupled with the Delaunay triangulation method and was compared to a Structured algorithm and performed better with fewer points. It shows that the Delaunay triangulation is a simple and efficient method to find new points of simulation reducing the number of calculations to be made.

The results were interpreted by fixing both the Reynolds number and the length of the interpipe, or both the Reynolds number ratio at the inputs and at the outputs. The contamination was introduced through one of the two inlets, namely inlet In2. The results show that perfect mixing still occurs when inlet In2 is dominating. It is due to the fluid coming from the input 2 going straight to the wall, creating a lot of turbulence. In the other cases, we observe imperfect mixing with a peak at around \( {R}_2^{in} \) =30. It can also be seen that when the length increases the mixing becomes perfect for all configurations, except in laminar cases where imperfect mixing can still be observed for a length of 20 diameters. In the same way, the increase of the Reynolds number decreases the imperfect mixing impact, but at some point, it converges to a value that may not be the complete mixing.

Finally, a 1-D transport model was created and implemented. It considers advection/reaction along pipes, imperfect mixing for Double T-junctions, and perfect mixing for simple junction nodes. For imperfect mixing the mean cross-sectional concentration at the two outlets was calculated. The result depends on the Reynolds number at half distance, on the two inlet and outlet flow rate ratios and on the interpipe length. A lookup table was deduced from the CFD simulations, and the Kriging method was used for points that are not in the table. In cases of imperfect mixing, the interpipe length is most likely small and therefore the transport inside such pipe is neglected. The concentrations at the beginning of the outlet pipes depend directly on the flow rates and concentration of the end of the inlet pipes based on the 1-D law defined in this paper.

This article gives a procedure to create a reduced order model for any problem with high computing demanding simulations and multiple parameters. The first step is to define a basic design of experiment, for instance a coarse design of points. From those simulations, the Kriging parameters are calibrated solving an optimization problem. Then the Delaunay triangulation method is used to get new simulation points that reduce the overall error of interpolation. Afterward, a lookup table is filled for values with smallest numerical error. Finally, this table is used with the Kriging interpolation to define a 1-D law that defines the reduced order model. This model can be used in real time as contrary to the simulations.

This study was performed for the general case of Double T-junctions, composed of pipes with the same diameter, and no slip-wall condition in CFD simulations. Future research will consist of generalization of the mixing law to pipes of unequal diameters and for pipes with large roughness that influences the turbulence inside the Double T-junctions.

References

  1. Abraham, W.: On the efficient design of statistical investigations. Ann. Math. Stat. 14(2), 134–140 (1943)

    Article  MathSciNet  MATH  Google Scholar 

  2. Archambeau, F., Méchitoua, N., Sazik, M. Code Saturne: A Finite Volume code for the computation of turbulent incompressible flows – Industrial Applications. International Journal on Finite Volumes (2004)

  3. Boulos, P.F., Altman, T., Jarrige, P.A., Collevati, F.: An event-driven method for modeling contaminant propagation in water networks. Appl. Math. Modelling. 18, 84–92 (1994)

    Article  MATH  Google Scholar 

  4. Braun, M., Bernard, T., Ung, H., Piller, O., Gilbert, D.: Model based investigation of transport phenomena in water distribution networks for contamination scenarios. Procedia Engineering. 70, 191–200 (2014)

    Article  Google Scholar 

  5. Chauvet, P., Galli, A.: Universal kriging, Centre de Géostatistique - Ecole des Mines de Paris (France). (1982)

    Google Scholar 

  6. Yang, C.-S., Kao, S.-P., Lee, F.-B., Hung, P.-S. Twelve different interpolation methods: a case study of surfer 8.0. National Chung Hsing University, Taichung, Taiwan, ROC and Feng Chia University, Taichung, Taiwan, ROC (2004)

  7. Choi, C.Y., Shen, J.Y., Austin, R.G.: Development of a Comprehensive Solute Mixing Model (AZRED) for Double-Tee, Cross, and Wye Junctions. Water Distribution Systems Analysis 2008, 1–10 (2008)

    Article  Google Scholar 

  8. Conn, A.R., Gould, N.I.M., Toint, P.L.: Global convergence of a class of trust region algorithms for optimization with simple bounds. SIAM J. Numer. Anal. 25(2), 433–460 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  9. Constans, S., Bremond, B., Morel, P.: Simulation and control of chlorine levels in water distribution networks. J. Water Resour. Plann. Manag. 129(2), 135–145 (2003)

    Article  Google Scholar 

  10. Costa, J.-P., Pronzato, L., Thierry, E. A comparison between Kriging and Radial Basis Function networks for nonlinear prediction. Conference: Proceedings of the IEEE-EURASIP Workshop on Nonlinear Signal and Image Processing (NSIP’99), Antalya, Turkey, June 20–23, 1999.

  11. Cressie: Statistics for spatial data. Wiley, New York (1993)

    MATH  Google Scholar 

  12. Fabrie, P., Gancel, G., Mortazavi, I., Piller, O.: Quality modeling of water distribution systels using sensitivity equations. J. Hydraul. Eng. 136(1), 34–44 (2010)

    Article  Google Scholar 

  13. Ho, C.K., Khalsa, S.S.: EPANET-BAM: water quality modeling with incomplete mixing in pipe junctions. In: Proceedings of the Water Distribution System Analysis Conference, Kruger National Park, South Africa. (SAND2008-3065C), p. 11. (2008)

    Google Scholar 

  14. Yin, J., Ng, S.H., Ng, K.M. A study on the effects of parameter estimation on kriging model’s prediction error in stochastic simulations. Proceedings of the Winter Simulation Conference (2009)

  15. Kay, M.D., Beckman, R.J., Conover, W.J.: A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics 21(2), 239–245 (1979)

    MathSciNet  MATH  Google Scholar 

  16. Porteau, http://porteau.irstea.fr/. Accessed on 22 Nov 2016.

  17. Rossman, L.A. EPANET users’ manual. U.S. Environmental Protection Agency, National Risk Management Research Laboratory, Office of Research and Development, Cincinnati (2000)

  18. Ung, H., Piller, O., Gilbert, D.: Quasi-real time modeling for security of a drinking water distribution network. Procedia Engineering. 70, 800–809 (2014)

    Article  Google Scholar 

  19. Waeytens, J., Chatellier, P., Bourquin, F.: Inverse computational fluid dynamics: influence of discretisation and model errors on flows in water network including junctions. J. Fluids Eng. 137(9), 17 (2015)

    Article  Google Scholar 

  20. Wim C.M. van Beers, Jack P.C. Kleijnen. Kriging interpolation in simulation; a survey. Proceedings of the Winter Simulation Conference (2004)

Download references

Acknowledgments

We wish to acknowledge the three following institutes for letting us use their computation cluster to carry out the simulations performed in this project:

- Mésocentre de Calcul Intensif Aquitain (MCIA), Avakas supercomputer.

- Centre Informatique National de l’Enseignement Supérieur (CINES), Jade supercomputer.

- Irstea Clermont computation grid.

This work has been performed in the framework of the SMaRT-OnlineWDN project. The SMaRT-OnlineWDN project is supported by the German Federal Ministry of Education and Research (BMBF; project: 13 N12180) and by the French Agence Nationale de la Recherche (ANR; project: ANR-11-SECU-006).

Authors’ contributions

All authors read and approved the final manuscript.

Competing interests

The authors declare that they have no competing interests.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Iraj Mortazavi.

Appendix

Appendix

Regression model and maximum-likelihood parameter estimation

In the section Kriging Interpolation solution, we have seen how to solve the Kriging interpolation. In this Appendix the calibration of different parameters σ, β, θk is clarified. Some elements about such a procedure have been given in the literature [11], but details are missing. We show here how the calibration of the Kriging interpolation parameters is applied in our case.

The Kriging parameters (σ, θl and γ k ) need to be calibrated. For that, it is supposed that the probability density function associated to Y on the sample points s 1, s 2,…, s n is a multidimensional Gaussian:

$$ \frac{1}{{\left(2\pi \right)}^{\frac{n}{2}} \det {(K)}^{\frac{1}{2}}}{e}^{-\frac{1}{2}{\left(Z-F\beta \right)}^T{K}^{-1}\left(Z-F\beta \right)} $$
(16)

With

$$ K={\left({K}_{ij}\right)}_{i,j\in \left[1,n\right]},\ Z={\left(Z\left({s}_i\right)\right)}_{i\in \left[1,n\right]},\ et\ F={\left({F}_l\left({s}_i\right)\right)}_{i\in \left[1,n\right],\ l\in \left[1,p\right]} $$

The Y probability density function can be rewritten as:

$$ \frac{1}{{\left(2\pi {\sigma}^2\right)}^{\frac{n}{2}} \det {(R)}^{\frac{1}{2}}}{e}^{-\frac{1}{2{\sigma}^2}{\left(Z-F\beta \right)}^T{R}^{-1}\left(Z-F\beta \right)} $$

With

$$ R={\left(R\left(Y\left({s}_i\right),Y\left({s}_j\right)\right)\right)}_{i,j\in \left[1,n\right]} $$

σ, β, θk γk (k  [1, m]) are estimated with the help of a maximum likelihood optimisation. The function log-likelihood to minimise is:

$$ f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)=\frac{n}{2} \log \left(2\pi {\sigma}^2\right)+\frac{1}{2} \log \left( \det (R)\right)+\frac{1}{2{\sigma}^2}{\left(Z-F\beta \right)}^T{R}^{-1}\left(Z-F\beta \right) $$
(17)

The function f is differentiated with respect to σ and β to calculate optimality condition by cancelling the gradient function:

$$ \frac{\partial f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)}{\partial \sigma }=\frac{n}{\sigma }-\frac{1}{\sigma^3}{\left(Z-F\beta \right)}^T{R}^{-1}\left(Z-F\beta \right) $$

Therefore,

$$ \frac{\partial f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)}{\partial \sigma }=0\ \Rightarrow {\hat{\sigma}}^2=\frac{1}{n}{\left(Z-F\beta \right)}^T{R}^{-1}\left(Z-F\beta \right)>0 $$
(18)

And

$$ \begin{array}{c}\hfill \begin{array}{cc}\hfill {\nabla}_{\beta }f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)=\frac{1}{2{\sigma}^2}2{F}^T{R}^{-1}\left(Z-F\beta \right)\hfill & \hfill \mathrm{then}\hfill \end{array}\hfill \\ {}\hfill \frac{\partial f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)}{\partial \beta }=0\ \Rightarrow \hat{\beta}={\left({F}^T{R}^{-1}F\right)}^{-1}{F}^T{R}^{-1}Z\hfill \end{array} $$
(19)

The gradients of function f with respect to θk and γk are given by:

$$ \frac{\partial \mathrm{f}\left(\upsigma,\ \upbeta, {\uptheta}_{\mathrm{k}},{\upgamma}_{\mathrm{k}}\right)}{\partial {\uptheta}_{\mathrm{k}}}=\frac{1}{2}\mathrm{t}\mathrm{r}\left({\mathrm{R}}^{-1}\left[\mathrm{R}\circ {\mathrm{D}}_{\mathrm{k}}\right]\right)-\frac{1}{2{\upsigma}^2}{\left(\mathrm{Z}-\mathrm{F}\upbeta \right)}^{\mathrm{T}}{\mathrm{R}}^{-1}\left[\mathrm{R}\circ {\mathrm{D}}_{\mathrm{k}}\right]\left(\mathrm{Z}-\mathrm{F}\upbeta \right) $$
(20)

Where tr is the matrix operator trace;

$$ {\left[\mathrm{R}\circ {\mathrm{D}}_{\mathrm{k}}\right]}_{\mathrm{ij}}={\mathrm{R}}_{\mathrm{ij}}\times {\left({\mathrm{D}}_{\mathrm{k}}\right)}_{\mathrm{ij}} $$

with o the product of Hadamard; and

$$ \begin{array}{c}\hfill {\left({\mathrm{D}}_{\mathrm{k}}\right)}_{\mathrm{ij}}=-{\left|{\mathrm{s}}_{\mathrm{ik}}-{\mathrm{s}}_{\mathrm{jk}}\right|}^{\upgamma_{\mathrm{k}}}\hfill \\ {}\hfill \frac{\partial f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)}{\partial {\gamma}_k}=\frac{1}{2}tr\left({R}^{-1}\left[R\circ {\mathrm{E}}_k\right]\right)-\frac{1}{2{\sigma}^2}{\left(Z-F\beta \right)}^T{R}^{-1}\left[R\circ {E}_k\right]\left(Z-F\beta \right)\hfill \end{array} $$
(21)

Where

$$ {\left({\mathrm{E}}_{\mathrm{k}}\right)}_{\mathrm{ij}}=-{\uptheta}_{\mathrm{k}} \log \left(\left|{\mathrm{s}}_{\mathrm{ik}}-{\mathrm{s}}_{\mathrm{jk}}\right|\right){\left|{\mathrm{s}}_{\mathrm{ik}}-{\mathrm{s}}_{\mathrm{jk}}\right|}^{\upgamma_{\mathrm{k}}} $$

Finally, σ, β, θk γk are estimated by solving the following minimization problem:

$$ \left\{\begin{array}{c}\hfill \min f\left(\sigma,\ \beta, {\theta}_k,{\gamma}_k\right)=\frac{n}{2} \log \left(2\pi {\sigma}^2\right)+\frac{1}{2} \log \left( \det \left(R\left(\uptheta, \upgamma \right)\right)\right)+\frac{1}{2{\sigma}^2}{\left(Z-F\beta \right)}^TR{\left(\uptheta, \upgamma \right)}^{-1}\left(Z-F\beta \right)\hfill \\ {}\hfill \sigma \in {\mathrm{\mathbb{R}}}^{+},\beta \in {{\mathrm{\mathbb{R}}}^{+}}^{\mathrm{p}},\theta \in {{\mathrm{\mathbb{R}}}^{+}}^{\mathrm{m}},\gamma \in {{\mathrm{\mathbb{R}}}^{+}}^{\mathrm{m}}\hfill \end{array}\right. $$
(22)

It is solved using the Trust Region Optimization [8] by giving it the gradients which permits finding the minimum of an unconstrained multivariable function. From a first trust region it then expands or contracts the region by comparing the predicted and actual improvement of the objective function realization. As the problem is not strictly convex and not defined everywhere as seen in the Result parts, choices are needed to simplify the problem. σ and β are taken as optimal, values of γk components have all been fixed arbitrary to 1, as no significant change has been seen around this value, and the θk have been expressed with regards to a non-dimensional parameter scaled by the maximum distance in all four directions.

$$ {\uptheta}_k=\tilde{\uptheta}/ \max {\left(\left|{s}_{ik}-{s}_{jk}\right|\right)}^{\gamma_k} $$
(23)

With \( \tilde{\uptheta} \) the non-dimensional parameter that needs to be optimized. This last equation is chosen arbitrary and implies a scale relationship between the θk that reduce by four the problem dimension.

A second one is the regularization term defined thereafter. In this case, and considering the observations collected, the objective function may be undefined, due to the correlation matrix R for small θ, which is not an invertible matrix. Therefore, a regularization term is added to the diagonal of the correlation matrix R:

$$ {\mathrm{R}}_{\upalpha}=\mathrm{R}+\upalpha\ {\mathrm{I}}_{\mathrm{n}} $$

With α the regularization term. This is equivalent to making a ridge regression or using a Tikhonov regularization technique, it is also called nugget effect.

The new problem to solve becomes:

$$ \left\{\begin{array}{c}\hfill \min f\left(\tilde{\uptheta}\right)=\frac{n}{2} \log \left(2\pi {\widehat{\sigma}}^2\right)+\frac{1}{2} \log \left( \det \left({R}_{\alpha}\left(\uptheta \right)\right)\right)+\frac{1}{2{\widehat{\sigma}}^2}{\left(Z-F\widehat{\beta}\right)}^T{R}_{\alpha }{\left(\uptheta \right)}^{-1}\left(Z-F\widehat{\beta}\right)\hfill \\ {}\hfill\ \tilde{\uptheta}>0,\ \theta = \tilde{\uptheta}/ \max {\left(\left|{s}_{ik}-{s}_{jk}\right|\right)}^{\gamma_k}\ \hfill \end{array}\right. $$
(24)

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Gilbert, D., Mortazavi, I., Piller, O. et al. Low dimensional modeling of Double T-junctions in water distribution networks using Kriging interpolation and Delaunay triangulation. Pac. J. Math. Ind. 9, 2 (2017). https://doi.org/10.1186/s40736-016-0026-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s40736-016-0026-8

Keywords