Introduction

Flow measurement structures are the main inseparable parts of irrigation and drainage projects. Weirs are the well-known hydraulic structures for measuring the discharge of flow. In addition to flow measurement weirs used to adjust the surface water level (Vatankhah 2012; Vatankhah 2010; Vatankhah and Khalili 2017). Weir when used on a large scale (dam projects) named spillway, have different components such as guide walls, approach channel, crest, chute, and energy dissipaters (Dehdar-behbahani and Parsaie 2016; Parsaie and Haghiabi 2018). Of course, it is worth mentioning that in watershed projects, most time weirs are used as a dam. In other words, the weir body can be the same as the dam body. These weirs, in addition to flow measurements, have great potential for depositing sediments (Parsaie et al. 2017a, b). Up to now, several types of weirs have been proposed such as labyrinth weir (Kabiri-Samani et al. 2013; Parvaneh et al. 2016), piano key weir (Kabiri-Samani and Javaheri 2012; Ribeiro et al. 2012), duckbill weir (Tajari et al. 2018), circular crested weir (Haghiabi 2012; Haghiabi et al. 2018; Heidarpour et al. 2008). The operating conditions and the Cd are the most important factors that are considered in selecting the type of weirs. The terms of operation condition mean that weirs are used with or without gates. If the goal is better management of the water level in the dam’s reservoir or the upstream channel using the gate installed on the weir, the labyrinth and piano key weirs no longer can be chosen. After the operation conditions, the Cd is the most important factor for choosing the type of weir. In the design of weirs, the Cd determines the elevation and length of the crest and the height of sidewalls, as well. Nowadays, a different type of circular crested weirs such as cylinder (Haghiabi et al. 2018), circular (Parsaie et al. 2018; Schmocker et al. 2011), semicircular (Niazkar and Afzali 2018) and quarter-circular crested weir (Mohammadzadeh-Habili et al. 2013) have been introduced as weirs having high Cd. A large number of theoretical and laboratory studies of hydraulic of flow including the distribution of pressure and velocity, the stage-discharge relation, and Cd of flow over the circular crested weirs have been carried out, while up to now, an uncertainty analysis has not been conducted on their stage discharge relation to provide a reliable design. In this study, using uncertainty analysis techniques including Monte Carlo and Bootstrap methods, the Cd of the CCW is uncertainty analyzed.

Materials and method

The sketch of the CCW is shown in Fig. 1. As shown in this figure, the curvature of the crest is defined via R. The slope of upstream and downstream ramps are defined with Φ1 and Φ2. In this figure, P is the height of weir, yup and H are the depth and head of flow over the crest at upstream, respectively. y1 and y2 are the conjugate depths of hydraulic jump at downstream of the CCW.

Fig. 1
figure 1

The sketch of the circular crested weir and its hydraulic and geometric parameters

The data related to Cd of the CCW and detail of tested laboratory models have been collected from Mohammadzadeh-Habili et al. (2013). The curve of the Cd of the CCW is shown in Fig. 2. The mathematical form of the Cd versus of relative upstream head (H/R) is presented in Eq. 1. In this study, using the MC and BM at 95% of confidence interval the variation of parameters of Eq. 1(i.e., a and b) are derived.

$${\text{Cd}} = a\left( \frac{H}{R} \right)^{b}$$
(1)
Fig. 2
figure 2

The values of Cd of circular crested weirs versus the H/R (Mohammadzadeh-Habili et al. 2013)

Uncertainty analysis techniques

The Monte Carlo method (or Monte Carlo simulation) refers to any technique that provides approximate answers for quantitative issues through statistical sampling. The MC simulation is further used to describe a method for releasing uncertainties in model inputs to uncertainties in model outputs. Therefore, the MC is a simulator that explicitly and quantitatively represents uncertainty. The MC simulation relies on the process of explicit uncertainty representation by specifying inputs as probability distributions. To calculate the distribution of the predicted efficiency probability, input uncertainties need to be transferred to the output uncertainties. There are various methods for transferring uncertainty. The MC simulation is probably the most commonly used technique for releasing uncertainties in various aspects of a system's performance. In the MC simulation, the whole system runs over many times (e.g., 1000 times). Each simulation is called the realization of the system. For each realization, all non-deterministic parameters are sampled (i.e., a random value of the specific distribution for each parameter is selected). The system is then simulated over time (with a given set of input parameters) so that system performance can be calculated. The results will be possible in the form of possible distributions of possible outputs. As a result, outputs are not single values, but the distribution of probabilities. The BM is similar to the MC. The MC is developed on a probability distribution of variables, while the BM has no assumption on the probability distribution of a variable and thus has no limits on sampling size (Hu et al. 2015).

Stepwise application of the Monte Carlo and Bootstrap methods

To use Excel to perform the MC simulations, the following steps will be considered. Firstly, the observed data related to independent (in this study: H/R) and dependent (Cd) variables are sorted in Excel. In this study, the observed data including H/R and Cd were sorted in columns A and B in a worksheet. Then, the mathematical model (Eq. 1) is written next to the output column (Cd) (column C). Using the solver excel the coefficients of the mathematical model are justified. This is accomplished by minimizing the error value between the measured values and the mathematical model results. This operation is called model calibration. After calibration of the model, uncertainty analysis will begin. Next to the column of the mathematical model, random numbers are generated. This is done with the following command.

$${\text{Cd}}_{{{{\rm rg}}}} = \$ {\text{I8}} + {\hbox{NORM}}{\hbox{.INV}}\left( {{\text{RAND}}(),0,{\hbox{SQRT}}\left( {{\hbox{SSE}}/{\text{df}}} \right)} \right)$$
(2)

where Cdrg: randomly generated values of Cd, $I8 refers to the column of results of the mathematical model. SSE is the sum of squared residuals that is calculated by SUMXMY2 in excel. Notably, the SSE is calculated in the model calibration stage. df is the degree of freedom that is equal to the number of measurements mines of the number of parameters. The RAND command is used to produce random numbers. This operation is performed for all observations and is repeated for 100 next columns. This process is performed only for 100 columns since the excel solver in the noncommercial version only can solve problems including 200 variables. Then, using the Excel solver and based on the same equation (Eq. 1), the mathematical model is fitted on these columns (generated data). After, that coefficients of fitted models are derived (a and b). This process is shown in Fig. 3.

Fig. 3
figure 3

The process of uncertainty analysis of Cd based on the MC method of circular crested weirs

To use BM for resampling, firstly the difference between the observed data and model results should be prepared. The process of resampling using BM is shown in Fig. 4. The resampling formula used in the BM is given in Eq. 3.

$${\text{Cd}}_{{{{\rm rg}}}} = \$ {\text{I8}} + {\hbox{INDEX}}\left( {\$ {\text{D}}:\$ {\text{D}},{\hbox{INT}}\left( {{\text{RAND}}\left( {} \right) \times {\text{df}} + {2}} \right)} \right)$$
(3)
Fig. 4
figure 4

The process of uncertainty analysis of Cd based on the Bootstrap method of circular crested weirs

Results and discussion

In this section, the results of the uncertainty analysis of the parameters of the Cd of the CCW are presented. As given in the materials and method section, the MC and BM were applied for this purpose. The stepwise of application of both methods for one simulation is shown in Figs. 3 and 4. As stated, in a simulation, 100 columns of simulate data are generated. In this study, more than ten times the process was implemented, and more than one thousand data for each of the parameters (a and b) has been obtained. The 95% confidence interval obtained from both uncertainty analysis methods were calculated for each observed data. The results of the calculation of 95% confidence interval for the Cd curve are shown in Fig. 5. In this figure, the results of MC and BM are shown separately. As shown in this figure, by increasing the H/R the bound of confidence interval is increased. This is due to increased data dispersion and reduced measurement accuracy in experiments. The comparison of the results of the MC method with BM shows that the MC method calculates a wider range for confidence intervals. This is due to the use of normal distribution in generating data. The BM seems to be better than the MC method in calculating the confidence interval. In these figures, the fitted mathematical model having the a and b parameters equal to 1.187 and 0.140 (\({\text{Cd}} = 1.187{ }\left( {H/R} \right)^{0.140}\)) are shown with a dashed line. The root-mean-square error (RMSE) and coefficient of determination (R2) of fitted model are 0.06 and 0.92.

Fig. 5
figure 5

Ninety-five percent confidence interval for the modeled Cd using MC and BM

The histogram of the a and b values obtained from each of the uncertainty analysis methods is shown in Figs. 6 and 7. Figs. 6 and 7 show the histogram of obtained a and b values form MC simulation and BM, respectively. In these figures, in addition to the histogram, normal distribution also has been fitted. Results of MC simulation indicated that the range of parameters of the Cd (a and b) with 95% confidence interval are (1.179, 1.194) and (0.134, 0.146) and at the same confidence interval the Bootstrap method indicated that the range of a and b changes between the (1.187, 1.200) and (0.133, 0.147), respectively.

Fig. 6
figure 6

The histogram of obtained values of a and b from MC simulation

Fig. 7
figure 7

The histogram of obtained values of a and b from the Bootstrap method

Conclusion

In this study, the uncertainty analysis was performed on the parameters of the Cd of circular crested weirs. The Cd of CCW is proportional to relative upstream head (H/R). For this purpose, the two of the most popular methods of uncertainty analysis, including MC and BM were used. The dataset of the Cd of CCW was collected from the literature. This paper discusses how to use both methods step by step in Excel software. In this way, the necessary functions were written. The mathematical formula proposed for the prediction of the Cd was calibrated using Excel’s Solver. Achieved results declared that MC and BM can be used to estimate the parameter uncertainties. Due to the high utilization of Excel software in engineering and environmental problems, it is suggested that, in curve fitting problems, be sure to use uncertainty analysis methods to provide additional information.