Introduction

The study of rivers’ water quality is extremely important. This issue is more important when the rivers are one of the main sources of water supply for drinking, agriculture, and industry. Unfortunately, river pollution has become one of the most important problems in the environment (Benedini and Tsakiris 2013). When a source of pollution is transfused into the river, due to molecular motion, turbulence, and non-uniform velocity in cross section of flow, it quickly spreads and covers all around the cross section and moves along the river with the flow (Holzbecher 2012; Chanson 2004). Defining the mechanism of pollutant transmission in various types of rivers' geometry helps reduce the effects of water pollution on public health in human societies. The study of the mechanism of pollutant transmission in the rivers has become a major part of the knowledge of environmental engineering (Riahi-Madvar et al. 2009). The governing equation of pollutant transmission in river is advection dispersion equation (ADE). This equation is a partial differential equation, named Convection Equation in general (Aleksander and Morton 1995; Chau 2010; Portela and Neves 1994). Computer simulation of pollution transmission in rivers needs to solve the ADE by analytical or numerical approaches. The ADE has analytical solution under simple boundary and initial conditions but when the flow geometry and hydraulic conditions become more complex such as practical engineering problems, the analytical solutions are not applicable. Therefore, to solve this equation, several numerical methods have been proposed (Kumar et al. 2009; Buske et al. 2011; Chanson 2004; Holzbecher 2012; Zoppou and Knight 1997). In this regard, using the finite difference method (FDM), finite volume method (FVM), and finite element method (FEM), etc. can be stated. Numerical modeling of pollution transmission in rivers in addition to numerical solution of the ADE included the LDC estimation. Fortunately, recently suitable numerical methods have provided. The major part of studies on the river water quality has focused on the  measurement, calculating and estimation of the LDC (Kashefipour and Falconer 2002; Deng et al. 2001, 2002). Nowadays, by advancing the soft computing  techniques in water engineering, researchers try to use these methods to predict LDC (Najafzadeh and Sattar 2015). Based on the scientific reports, the precision all of these methods were better than the empirical formulas. In the field of soft computing, using the multilayer perceptron neural network (MLP), adaptive neuro-fuzzy inference system (ANFIS), support vector machine (SVM), neuro-fuzzy GMDH, and genetic programming (GP) has been reported (Riahi-Madvar et al. 2009; Tayfur and Singh 2005; Toprak and Cigizoglu 2008; Azamathulla and Ghani 2011; Sahay 2011; Najafzadeh and Azamathulla 2013; Parsaie et al. 2015). The conclusions derived from the review of past researches suggest that studying the river water quality has been individually conducted by studying the numerical solution of the ADE and LDC measurement or prediction. In this paper, by getting the idea of research which was conducted by Parsaie and Haghiabi (2015), a novel approach is proposed for computer simulation of engineering phenomena. In this paper, both of the FVM and MLP model is used together in computer simulation.

Materials and methods

The one-dimensional ADE is present in the Eq. (1).

$$\frac{\partial C}{\partial t} + u\frac{\partial C}{\partial x} = D_{\text{L}} \frac{{\partial^{2} C}}{{\partial x^{2} }},$$
(1)

where C is the concentration, u is the mean flow velocity, and x is the distance from the place of perfect mixing in the cross section of flow. The ADE includes two different parts advection and dispersion. The pure advection is given in Eq. (2) and the pure dispersion term is given in Eq. (3).

$$\frac{\partial C}{\partial t} + u\frac{\partial C}{\partial x} = 0$$
(2)
$$\frac{\partial C}{\partial t} = D_{\text{L}} \frac{{\partial^{2} C}}{{\partial x^{2} }}$$
(3)

The pure advection term is related to transmission modeling without any dispersing and the dispersion term is related to the dispersion without any transmission. To discrete the ADE, the FVM was used. According to physical properties of these two terms and the recommendation of researchers, a suitable scheme should be considered for numerical solution of ADE terms. Among the finite volume schemes, the Fromm scheme was selected to discrete the advection term, because of this scheme has suitable ability to model the pure advection term. The Fromm scheme is an explicit scheme and the stability condition must be considered. Discretizing process and extracting the Fromm scheme for Advection term are given in Eqs. (4, 5).

$$\begin{aligned} &\frac{\partial C}{\partial t} + u\frac{\partial C}{\partial x} = 0 \hfill \\& \int_{t}^{t + \Delta t} {\frac{\partial C}{\partial t}} + u\int_{x - \Delta x/2}^{x + \Delta x/2} {\frac{\partial C}{\partial x}} = 0 \hfill \\ &\frac{{C_{i}^{n + 1} - C_{i}^{n} }}{\Delta t} = \frac{{\left( {uC} \right)^{n}_{i + 1/2} - \left( {uC} \right)^{n}_{i - 1/2} }}{\Delta x} \hfill \\ \end{aligned}$$
$$C_{i}^{n + 1} = C_{i}^{n} - \frac{\Delta t}{\Delta x}\left( {F_{i + 1/2} - F_{i - 1/2} } \right)$$
(4)
$$\begin{aligned} F = &\frac{{C_{i + 1} - C_{i - 1} }}{\Delta x} \\ c_{i}^{n + 1} =& \left( {\frac{1}{6}\left| \varepsilon \right|^{3} - \frac{1}{6}\left| \varepsilon \right|} \right)c_{i - 2}^{n} + \left( { - \frac{1}{2}\left| \varepsilon \right|^{3} + \frac{1}{2}\varepsilon^{2} + \left| \varepsilon \right|} \right)c_{i - 1}^{n} + \left( {\frac{1}{2}\left| \varepsilon \right|^{3} - \varepsilon^{2} - \frac{1}{2}\left| \varepsilon \right| + 1} \right)c_{i}^{n} \\ &+ \left( { - \frac{1}{6}\left| \varepsilon \right|^{3} + \frac{1}{2}\varepsilon^{2} - \frac{1}{3}\left| \varepsilon \right|} \right)c_{i + 1}^{n} \\ \varepsilon = & u\frac{\Delta t}{\Delta x} \\ \end{aligned}$$
(5)

To discrete the dispersion term, the central implicit scheme was selected. This scheme is unconditionally stable. Discretizing process and extracting the central implicit scheme for dispersion term are given in Eqs. (6, 7).

$$\begin{aligned} \frac{\partial C}{\partial t} \,=\, & D_{\text{L}} \frac{{\partial^{2} C}}{{\partial x^{2} }} \\ \int\limits_{t}^{t + \Delta t} {\frac{\partial C}{\partial t}} \,=\, & D_{\text{L}} \int\limits_{x}^{x + \Delta x} {\frac{\partial C}{\partial x}} \left( {D_{\text{L}} \frac{\partial C}{\partial x}} \right) \\ C_{i}^{n + 1} \,=\,& C_{i}^{n} - \frac{\Delta t}{\Delta x}\left( {F_{i + 1/2} - F_{i - 1/2} } \right) \\ C_{i}^{n + 1}\,=\,& C_{i}^{n} - \frac{\Delta t}{\Delta x}\left[ {\left( {D_{{{\text{L}}_{i + 1/2} }} \frac{{C_{i + 1}^{n + 1} - C_{i}^{n + 1} + C_{i + 1}^{n} - C_{i}^{n} }}{{2\Delta x_{i + 1/2} }}} \right) - \left( {D_{{{\text{L}}_{i - 1/2} }} \frac{{C_{i - 1}^{n + 1} - C_{i}^{n + 1} + C_{i - 1}^{n} - C_{i}^{n} }}{{2\Delta x_{i - 1/2} }}} \right)} \right] \\ \end{aligned}$$
(6)
$$\begin{aligned} A_{j}^{1} =& - \frac{1}{2}\frac{{D_{x} \Delta t}}{{\left( {\Delta x} \right)^{2} }} \hfill \\ A_{j}^{2} = &1 + \frac{{D_{x} \Delta t}}{{\left( {\Delta x} \right)^{2} }} \hfill \\ A_{j}^{3} =& - \frac{1}{2}\frac{{D_{x} \Delta t}}{{\left( {\Delta x} \right)^{2} }} \hfill \\ A_{j}^{0} =& c_{j}^{n} + \frac{1}{2}\frac{{D_{x} \Delta t}}{{\left( {\Delta x} \right)^{2} }}\left( {c_{j - 1}^{n} - 2c_{j}^{n} + c_{j + 1}^{n} } \right) \hfill \\ \end{aligned}$$
$$A_{i}^{1} C_{i - 1}^{n + 1} + A_{i}^{2} C_{i}^{n + 1} + A_{i}^{3} C_{i + 1}^{n + 1} = A_{i}^{0}$$
(7)

Here F is the flow flux and DL is the longitudinal dispersion coefficient. The results of advection and dispersion term will be combined by the time splitting technique. To calculate the LDC, several ways as empirical formulas and artificial intelligent techniques have been proposed and development of these is based on dimensionless parameters that are derived using the Buckingham theory, which will be explained in the next section.

Longitudinal dispersion coefficient

The longitudinal dispersion coefficient is proportional to the properties of fluid, hydraulic condition, and the river's geometry (cross sections and path line). All the effective parameters can be written as follows:

$$D_{\text{L}} = f_{1} \left( {\rho ,\;\mu ,\;u,\;u_{*} ,\;h,\;w,\;s_{f} ,\;s_{n} } \right),$$
(8)

where \(\rho\) is fluid density; \(\mu\) is dynamic viscosity; \(w\) is the width of cross section; h is flow depth; \(u_{*}\) is share velocity; \(s_{f}\) is longitudinal bed shape; and \(s_{n}\) is sinuosity. To derive the dimensionless parameter on \(D_{\text{L}}\), the Buckingham theory as dimensional analysis approach was considered and dimensionless parameter will be derived as follows (Seo and Cheong 1998):

$$\frac{{D_{\text{L}} }}{{hu_{ *} }} = f_{2} \left( {\rho \frac{uh}{\mu },\frac{u}{{u_{ *} }},\frac{w}{h},s_{f} ,s_{n} } \right)$$
(9)

The nature of the flow especially in the river is always turbulent. Therefore, the Reynolds number \(\rho \frac{uh}{\mu }\) can be ignored and the bed form and sinusitis path parameters cannot be measured clearly, as well. Therefore, the effect of them can be considered as flow resistant, which is seen in the flow depth. The dimensionless parameters that can be clearly measured are given as follows (Seo and Cheong 1998; Seo and Baek 2004):

$$\frac{{D_{\text{L}} }}{{hu_{*} }} = f_{2} \left( {\frac{u}{{u_{*} }},\frac{w}{h}} \right)$$
(10)

Developing the empirical formulas and soft computing models is based on these dimensionless parameters. Table 1 presents the most famous empirical formulas for LDC calculation.

Table 1 Empirical equations for estimating the longitudinal dispersion coefficient

Preparing the soft computing techniques are based on the dataset so for preparing the multilayer perceptron (MLP) neural network about 150 dataset related to the Eq. (10) was collected and these range is given in Table 2.

Table 2 Range of collected data related to the LDC

Artificial neural network (ANN)

ANN is a nonlinear mathematical model, which is able to simulate arbitrarily complex nonlinear processes that relate the inputs and outputs of any system. In many complex mathematical problems that lead to solve complex nonlinear equations, Multilayer Perceptron Networks are common types of ANN, which are widely used in the researches. To use MLP model, definition of appropriate functions, weights, and bias should be considered. Due to the nature of the problem, different activity functions in neurons can be used. An ANN has maybe one or more hidden layers. Figure 1 demonstrates a three-layer neural network consisting of input layer, hidden layer(s), and output layer. As shown in Fig. 1, \(W_{i}\) is the weight and \(b_{i}\) is the bias for each neuron. Weight and biases’ values will be assigned progressively and corrected during training process comparing the predicted outputs with known outputs. Such networks are often trained using back propagation algorithm. In the present study, ANN was trained by Levenberg–Marquardt technique, since this technique is more powerful and faster than the conventional gradient descent technique (Aleksander and Morton 1995; Sivanandam and Deepa 2006).

Fig. 1
figure 1

A three-layer ANN architecture

Results and discussion

The ADE is an important equation in hydraulic engineering and several hydraulic phenomena such as pollution transmission, suspended sediment transport modeling, etc are involved. Therefore, several methods such as analytical and numerical solution have been proposed for solution of this equation. The simple analytical solution is considering the velocity and dispersion coefficient parameters as a constant value. Figure (2) shows the simplest solution of the ADE which leads to Gaussian curve.

Fig. 2
figure 2

Gaussian curve and initial condition

To understand the important role of LDC in computer modeling, a sensitivity analysis was conducted on the result of analytical solution. To do so, LDC was varied between −20 and +20 %. As shown in Fig. 3, a small change in LDC causes an obvious change in the maximum concentration.

Fig. 3
figure 3

The concentration profile with three values for LDC

It is notable that based on the reports, most empirical formulas have poor accuracy to calculate LDC. For computer simulation of pollutant transmission, firstly, the advection term was solved by Fromm scheme. The result of the Fromm scheme with regarding to Fig. 2 as initial condition is shown as Fig. 4.

Fig. 4
figure 4

Result of Fromm scheme for Advection term

As shown in Fig. 4, the concentration profile along 3000 m after injection does not have any change and any decay. This figure shows that the Fromm scheme has suitable ability to model the advection term. After solving the advection term, the dispersion term is solved. For this term, the central implicit scheme was selected. The result of the numerical solution of the pure dispersion with regarding to Fig. 2 as initial condition is shown in Fig. 5. As shown in Fig. 5, this scheme has suitable ability to model the dispersion term.

Fig. 5
figure 5

Result of central implicit scheme for Dispersion term

Fig. 6
figure 6

Numerical and analytical solution of ADE

Fig. 7
figure 7

Structure of MLP model

Combination of the numerical solution of the advection and dispersion coefficient is shown in Fig. 6. Figure 6 also compares the numerical solution and analytical solution of the ADE. It is notable that the initial condition to better visualization was considered much higher than the Fig. 2. As shown in Fig. 6, it is clear that the accuracy of the numerical model is very suitable.

Fig. 8
figure 8

Performance of MLP models during the training stage

After preparing the numerical model, the LDC is calculated. Based on the scientific research, the precision of soft computing techniques are much more than the empirical formulas; therefore, to achieve more accuracy in predicting the LDC, the MLP model has been developed. The dimensionless parameter, derived in the dimensional analysis stage, was considered as input parameter to the MLP model. As shown in Fig. 7, the MLP model contains two hidden layers. The first hidden layer contains eighteen neurons and five neurons are exist in the second hidden layer. The tangent sigmoid (tansig) function was considered as transfer functions. Training the MLP model was performed through Levenberg–Marquat technique. 85 % of data were used for training, 15 % for validation, and 15 % for model testing. The performance of MLP model in each stage of development (training, validation and testing) is shown in Figs. 8, 9, and 10. As shown in Figs. 8, 9, and 10, the accuracy of the MLP model for predicting the LDC is so suitable.

Fig. 9
figure 9

Performance of MLP models during the validation stage

Fig. 10
figure 10

Performance of MLP models during the testing stage

Model validation

To assess the performance of computer model in real engineering problem, a field study, conducted by Atkinson and Davis (1999) on pollutant transmission mechanism in Severn River, was simulated. They considered about 14 km length of the river to study the pollution transport mechanism and show the effect of some hydraulic conditions such as bed form and reverse flow and geometry of the river such as dead zone, on the pollution concentration profile. They considered six stations after the location of injection to take the samples from the river water. Figure 11 shows a schematic map of the Severn River and the location of the sampling stations. Universal coordinates of sampling station and hydraulic condition of the river in each station are given in Table 3 (Davis and Atkinson 1999; Davis et al. 1999). The LDC was calculated from the concentration profile (Fig. 12) through Dispersion Routing Method (DRM) (Disley et al. 2015). DRM includes four stages: (1) considering the initial value for LDC, (2) calculating the concentration profile at the downstream station using the upstream concentration profile and LDC, (3) performing a comparison between the calculated profile and measurement profile, and (4) if the calculated profile does not suitably cover the measurement profile, the process will be repeated until the calculated profile has a good coverage of the measurement profile.

Fig. 11
figure 11

Schematic map of the Severn River and sampling stations

Table 3 Universal coordinates of sampling stations
Fig. 12
figure 12

Concentrations’ value measurement at Severn River sampling stations

Results of the LDC calculation for the Severn River by Dispersion Routing Method are given in Table 4. After calculating LDC by DRM, the empirical formulas and MLP model as well were used to calculate the LDC and these results are given in the Table 5. With a review of Table 5, it is clear that most empirical formulas do not have suitable ability to calculate LDC. Therefore, using these formulas in practical engineering problems results in obvious error in the water quality modeling.

Table 4 Result of LDC calculation by routing method for Severn River
Table 5 Calculating LDC by empirical formulas and MLP model

To use the final computer model for simulation of pollution transmission in the Severn River, first, the initial condition was defined. The properties of cross section and hydraulic conditions were given to MLP model as input parameters and LDC was predicted. Then, according to the LDC, a calibration was conducted to determine the computational concentration profile at the station A and then the concentration profile was simulated and derived to each sampling station. The results of computer modeling and observed data are shown in Figs. 13 and 14. As shown in Figs. 13 and 14, the final model has good ability to simulate the pollution transmission in Severn River and it is related to the predicting LDC by neural network.

Fig. 13
figure 13

Results of computer modeling and measurement data

Fig. 14
figure 14

Results of computer modeling and measurement data

Conclusion

Rivers are one of the main sources of water supply for drinking, agricultural, and industrial usage. Therefore, controlling the quality of them is important, since the water quality of the rivers is directly related to human and environment health. Unfortunately, sometimes it seems that river has been considered as a place for injection of sewages. One method to manage the water quality is mathematical modeling of pollution transmission in the river. In mathematical modeling, governing partial differential equations is solved by suitable and powerful methods. In some governing equations, there are coefficients that researchers have measured and calculated, and they have also proposed some empirical formulas to calculate them. Recently, the soft computing techniques were used as powerful tools to predict these coefficients by researchers. It seems that, for developing software or commercial computer models, in addition to using a suitable numerical method, the coefficients could be predicted using soft computing methods. This approach leads to the increase the performance of mathematical modeling of phenomena, especially when the coefficients are very sensitive and the range variation of them is much more. In other words, these coefficients may be probability. In this paper, for numerical solution of ADE, the finite volume has been used and to predict the longitudinal dispersion coefficient, the MLP model was prepared. It is shown that the results are suitable, when the AI models have been used as a powerful tool to predict the LDC.