1 Introduction

Labyrinth and Piano-Key (PK) weirs are hydraulic structures applied for discharge measurement, flood controlling, water saving, flow diverting, and altering the flow regime in streams. Flow discharge over the weirs show a direct proportion with the crest length, so if the channel width does not allow the passing of high flow discharge over the weirs, the weirs crest length must be increased (Vayghan et al. 2019). The main advantage of these weirs is the possibility of installing them on a dam crest directly (Erpicum et al. 2011). The PK weirs might be considered as suitable and efficient alternatives for linear and traditional weirs (Laugier et al. 2009). The utilization of PK weirs is growing more rapidly, particularly for spillway rehabilitation around the world. The PK weir can be considered basically as a Rectangular Labyrinth Weir (RLW) with cantilevered upstream and/or downstream apexes and ramped floors in the inlet and outlet cycles or keys. Cantilevered apexes of the PK weir’s extent the weir crest length compared to a RLW with the same footprint. This advantage of PK weirs makes them a good option for spillway applications with limited footprint space (i.e., on top of a narrow concrete gravity dam). Apart from the top-of-dam applications, recent interest has attached particular importance to the use of PK weirs in river and channel applications (Dabling 2014).

Blance and Lemperiere (2001) introduced the PK weirs in order to enhance the performance of labyrinth weirs. Studies of the first model demonstrated that a PK weir increases the discharge capacity by four times of conventional frontal weirs under similar heads (Lempérière and Ouamane 2003). The first prototype PK weir was built in France at the Goulours Dam (Laugier 2007). The second PK weir was built on the St. Marc Dam. The role of geometric parameters on the hydraulic performance of PK weirs was described in many experimental studies (Machiels et al. 2011; Pralong et al. 2011; Li et al. 2020a, b). So far, no universal approach has been proposed for the design of PK weirs, although Anderson (2011) made efforts for deriving the PK head-discharge relationships. The flow through PK weirs is commonly categorized as free and submerged flow conditions according to the tail water depth. For the submerged flow condition, a higher upstream head is needed for flow passing relative to free flow conditions. Many researchers have investigated the submergence of sharp-crested linear weir and developed submergence equations based on a flow reduction factor (Fteley and Stearns 1883; Francis 1884; Dabling and Tullis 2012). Tullis et al. (2007) investigated head discharge relationships for submerged labyrinth weirs. Dabling (2014) studied the submergence of PK weir in channel applications. The obtained results showed that for both the PK standard and PK modified, as Ho/P increased, the modular submergence range also increased, where Ho and P stand for the total hydraulic head in upstream and weir height, respectively.

There are mainly two geometric groups of PK weirs, namely, type (A) length of inlet/outlet cantilever overhangs are equal (Bi/Bo = 1), and type (B) where the downstream overhang is zero. In this classification, Bi is the downstream or inlet key overhang length, and Bo is the upstream or outlet key hang length. Lempérière and Jun (2005) and Barcouda et al. (2006) proposed that the value of inlet to outlet width ratio Wi/Wo = 1.2 is the optimum state for designing the PK weirs. Ouamane and Lempérière (2006) stated that increasing the Wi/Wo ratios would provide better efficiency for PK weirs. Also Zerihun and Fenton (2007) and Kabiri-Samani et al. (2010) found that by increasing the submergence ratio (Hd/Ho) the efficiency of the upstream apex are reduced due to the effects of the local submergences at outlet upstream, where Hd is the total downstream head. Dabling (2014) stated that with increasing Ho/P in both the modified and non-modified weirs, the submergence ratio would increase for a given downstream depth, the flow depth at upstream of the modified weir will be greater than those of a non-modified weir. Mehboudi et al. (2016) proposed a 22% increase in the discharge capacity of trapezoidal PK weir with the same length of crest centerline (Lc) as of rectangular PK weir. Seyedjavad et al. (2019) conducted a laboratory study to comprehend hydraulic performance of type-A PK weirs. Having developed several experimental models with different pier heights (10, 15 and 20 cm), they found more encouraging performance of the side trapezoidal PK weirs as compared to labyrinth triangular and trapezoidal weirs. Abhash and Pandey (2021) confirmed high capability of rectangular PK weir for sediment transportation in comparison with trapezoidal PK weir. In addition to experimental and hydraulic studies, the implementation of Artificial Intelligence (AI) as desirably efficient and accurate methods for modeling the hydraulic behavior of weirs is notable. Among various AI methods, utilization of Artificial Neural Networks (ANN) and Adaptive Neuro-Fuzzy Inference System (ANFIS), remain in the forefront of this complementary modeling process (Emiroglu and Kisi 2013; Khatibi et al. 2014; Parsaie and Haghiabi 2015). More recently, Roushangar et al. (2018) investigated the capability of Support Vector Machine (SVM) for the prediction of discharge coefficient of the labyrinth and arced labyrinth weirs. Akbari et al. (2019) found that Gaussian Process Regression (GPR) surpasses the Generalized Regression Neural Networks (GRNN), Multi-Layer Perceptron (MLP), and SVM in terms of discharge coefficient prediction of gated PK weir. Zounemat-Kermani and Mahdavi-Meymand (2019) developed AI-based methods coupled with several meta-heuristic algorithms. They concluded that a combination of ANFIS and the Particle Swarm Optimization (PSO) enjoyed greater accuracy when it came to modeling passing flow over PK weirs. Olyaie et al. (2019) conducted research on a PK weir under subcritical condition and found that Extreme Learning Machine (ELM) and Bayesian ELM excels any other machine learning approaches that are being used for discharge coefficient prediction. Kumar et al. (2020) confirmed the higher predictive capability of random forest regression over the M5 tree model in determining the discharge coefficient of PK weirs.

Based on the above-mentioned description, the main contribution of the present study can be described as: 1) although some studies have been carried out to experimentally explore the hydraulic aspect of PK weirs, comprehensively investigating the hydraulic behavior of PK weirs through altering the geometric parameters are rare. Hence, the performances of the PK weirs under free (without contraction and with contraction) and submerged flow conditions were studied through increasing the weir height, fillet installation at overhangs, changing the inlet/outlet slopes, and changing the weir crest shape. 2) To the best of author's knowledge, there is no report presenting the application of Kernel Extreme Learning Machine (KELM) method in modeling hydraulic characteristics of this type of weir.

The main aim of the present study is to experimentally investigate the variations of PK weirs discharge coefficient (Cd) through altering the geometric parameters. Eighteen different experimental models were built, and total 706 experiments were carried out for analyzing the free flow and submerged flow conditions. Afterward, the prediction capability of Cd will be investigated through proposed KELM and SVM approaches. For this purpose, some well-known statistical indices and a total of five related data sources corresponded to the discharge coefficient of PK weirs are considered for the modeling process.

2 Materials and Methods

2.1 Dimensional Analysis

The geometric characteristics of PK-weir models are shown in Figs. 1 and 2. The total discharge over a PK-Weir is a function of several parameters, e.g., length of crest centerline (Lc = N × (2B + Wi + Wo), inlet slope (Si), outlet slope (So), weir width (W), weir length (B), overhang length at upstream (outlet) (Bo), overhang length at downstream (inlet) (Bi), base length (Bb), inlet width (Wi), outlet width (Wo), wall thickness (Ts), cycle width (W = Wi + Wo-Ts), and cycles number (N), height of the inlet at entrance measured from the PK weir crest (Pi), height of the outlet at entrance measured from the PK weir crest (Po), height of the apron level at inlet key and outlet key intersection (Pb) and height of parapet wall in modified PK weir (Pp):

Fig. 1
figure 1

Geometric parameters of the PK weir- 3D view

Fig. 2
figure 2

Geometric parameters of the PK weir- plan view (left) and cross-section (right)

$${C}_{d}=f({H}_{0},{ P}_{0}, {P}_{b}, {P}_{P}, {W}_{i}, {W}_{O},B, {H}_{0},{B}_{i},{B}_{O}, g, v, \sigma ,\rho , {S}_{i}, {S}_{o}, {T}_{s}, N)$$
(1)

Nonetheless, the most important ratios are: magnification (n = Lc/W), upstream to downstream overhangs ratio (Bo/Bi), inlet to outlet width ratio (Wi/Wo), and relative wall thickness (Ts/P0). The fluid is characterized by its density ρ, the kinematic viscosity ν, and the surface tension σ; g is the acceleration of gravity; and H0 represents the total upstream hydraulic head, which was calculated by adding the velocity head (V2/2 g) corresponding to the average cross-sectional velocity at the respective measurement locations.

As the effect of Ts is trivial, it can be neglected. Moreover, the effect of viscosity can be neglected compared the gravity effect as the Reynolds number in open channel flow is generally large enough, (Henderson 1966). The effect of surface tension is also negligible. Accordingly, σ and ν could be omitted from the equation. The other parameters are constant and could be neglected (Novák and Čábelka 1981).

The discharge coefficient (Cd) of the PK-Weir can then be defined as a function of dimensionless hydraulic and geometric parameters as represented in Eq. 2.

$${C}_{d}=f({H}_{0}/P, {L}_{c}/W, {W}_{i}/{W}_{O},{B}_{i}/{B}_{O}, {S}_{i}/{S}_{o}, {T}_{s}/P)$$
(2)

2.2 Experimental Data

The original data sets of laboratory experiments of PK weirs were collected in the Hydraulic Lab of the Tabriz University. It is not possible to use the Froude number and Reynolds number simultaneously to scale a model (e.g., if Fr-m = Fr-p then Re-m ≠ Re-p for a given location). The Froude dynamic similarity as a commonly employed scaling method with the following limitations is used in the present study to physical model the PK weirs: (1) the geometric scale should be large enough to repress the effect of viscous; and (2) turbulence intensity in the model must have adequate kinetic energy to make the effects of surface tension negligible. Froude models are usually “shifted” to the hydraulic rough regime in order to better reflect losses. This is due to the fact that most flows at prototype are both turbulent and in the hydraulic rough regime (Mousavimehr et al. 2021). The experiments were conducted in a rectangular flume with a length of 10 m, width of 1 m, and a depth of 0.8 m. The flume walls were made by Plexiglas sheets. Flow passing the flume was discharged to a reservoir at downstream and the cycle was repeated for recycling the water (Fig. 3).

Fig. 3
figure 3

Overview of experimental flume and water circulation system (a) side view and (b) plan view

Flow discharge was measured using an ultrasonic flow meter which had been calibrated using the volume balance method. According to Dabling (2004), the flume was equipped with a bathometer (readable to ± 0:1 mm) at a distance of 4P times the weir height upstream of the weir for measuring the water depth. A second bathometer connected to the flume 10P downstream of the weir was used to measure the downstream water depth. In the present study, in order to reduce measurement errors, two additional points were considered at distances of one meter from the previous locations to measure the flow depth. The flume slope was set as zero (horizontal bed) for all the experiments. All PK models were installed on a 10 cm height platform, and a ramp with an angle of 5° (with respect to horizontal plane) was used to connect the flume bottom to the platform. This would provide parallel movement of the flow streamlines from flume bed to the platform. In order to ensure about establishing the steady- state flow in the flume, all hydraulic parameters were checked every 10-min. Figure 4 shows the hydraulic parameters for the free and submerged flow conditions. 18 different experimental models were built and total 706 experiments were carried out for analyzing the free flow (377 experiments) and submerged flow (329 experiments) conditions. Table 1 summarizes the conducted experiments.

Fig. 4
figure 4

Hydraulic parameters of the PK weir under the free and submerged flow conditions

Table 1 Summary of physical models tested

Crest length magnification ratio (n = Lc/W) was considered as constant (4.92) for all experiments. The number of cycles was 4, and all the investigated weirs were from Type A, where the upstream and downstream overhangs lengths were 12.5 cm, and total crest length (B) was 50 cm. PK weirs were installed at a distance of 7 m from the channel upstream point. The flow discharge values were changed between 10 to 70 L/sec, and Eq. 3 was used to determine the weir discharge coefficient:

$$Q={C}_{d}\frac{2}{3}\sqrt{2g{L}_{c}{H}_{0}^{{3}\left/{2}\right.}}$$
(3)

where Q = flow discharge passing over the PK weir (m3/s), Lc = length of crest centerline (m), Ho = total upstream energy head above crest (m), Cd = discharge coefficient, and g = gravitational acceleration (m/s2). According to Table 1, four different ratios of Wi/Wo (1.4, 1.25, 1, and 0.75) were applied to analyze the effect of outlet/inlet ratios as well as the inlet and outlet slopes ratios (1:1, 1:1.5). Nonetheless, the effects of inlet/outlet slopes will be compared with those of the circle-quarter state as well as the modified PK weirs. The modified PK is the same as the PK weir design with the addition of rounded abutments on the upstream apexes and a parapet wall (Pp) featuring a half-round crest on top of the weir, as depicted in Fig. 5. As pointed out by Anderson (2011), 10–15% increase in the weir height via parapet walls (Pp) led to a 13% increase in the weir discharge efficiency. According to the findings of Anderson (2011) and experimental conditions of this study, Pp is designed to be 2.3 cm (11.5% increase in the weir height via parapet walls). The influence of a 11.5% increase in weir height and changing the weir shape from flat to quadrant and fillet installation on the hydraulic performance of the PK weirs will be analyzed. Figure 6 shows the tested physical models in this study.

Fig. 5
figure 5

Three-dimensional views of investigated weirs: (a) standard piano key, (b) modified piano key

Fig. 6
figure 6

(a) PK weir, (b) modified Pk weir, (c) submerged flow PK1.25, (d) submerged flow PKC1

2.3 Machine Learning-based Modeling

2.3.1 Support Vector Machine

Many studies have been conducted in different fields of engineering through support vector machine. Suppose that that for dataset \(\left({x_i},{y_i}\right)\) , Support Vector Machine (SVM) equations founded on Vapnik (1998) theory approximates the function as:

$$f\left(x\right)=W\varphi \left(x\right)+b$$
(4)
$${R}_{{SVM}_{s}}\left(C\right)=\frac{1}{2}{\Vert w\Vert }^{2}+C\frac{1}{2}{\textstyle\sum_{i=1}^n}L({x}_{i},{y}_{i})$$
(5)

where φ (χ) is a nonlinear function in feature of input x, W vector is the weight factor, b is the bias, and\(C\frac12{\textstyle\sum_{i=1}^n}\;L(x_i,\;y_i)\) denotes the empirical risk. The parameters w and b are calculated through the minimization process of regularized risk function after bringing positive slack variables \({\xi }_{i}\) and \({\xi }_{i}^{*}\) as representative of upper and lower excess deviation.

$$Minimize\;{R}_{{SVM}_{s}}\left(w,{\xi }^{*},\xi \right)=\frac{1}{2}{\Vert w\Vert }^{2}+C{\textstyle\sum_{i=1}^n}({\xi }_{i},{\upxi }_{i}^{*})$$
(6)
$$Subject\;to\;\left\{\begin{array}{c}{y}_{i}-w\varphi \left({x}_{i}\right)-{b}_{i}\le \varepsilon -{\xi }_{i}\\ w\varphi \left({x}_{i}\right)+{b}_{i}-{y}_{i}\le \varepsilon +{\xi }_{i}^{*}\\ {\xi }_{i}\text{+}{\xi }_{i}^{*}\ge 0, i=1,\dots ,n\end{array}\right.$$

where \(\frac{1}{2}{\Vert w\Vert }^{2}\) stands for the regularization term, C is the cost factor, ɛ is known as the loss function, and n is the number of elements.

Lagrange multiplier and optimality constraints is introduced in order to solve Eq. 4; therefore, a general form of function can be obtained as:

$$f\left(x\right)={\textstyle\sum_{i=1}^n}\left({\beta }_{i}-{\beta }_{i}^{*}\right)K\left({x}_{i},{x}_{j}\right)+b$$
(7)

where \(K\left({x}_{i},{x}_{j}\right)=\varphi ({x}_{i})\varphi ({x}_{j})\) and the term \(K\left({x}_{i},{x}_{j}\right)\) stands as the kernel function, which is an inner product of two vector \({x}_{i}\) and \({x}_{j}\) in the feature space \(\varphi ({x}_{i})\) and \(\varphi ({x}_{j})\), respectively.

2.3.2 Kernel Extreme Learning Machine

In recent years, Extreme Learning Machine (ELM) approach as a fast learning algorithm with better prediction ability has drawn huge attention from researchers in engineering science. The main merit of the ELM is the randomly specification of the weights in the hidden layer. N samples are \(({x}_{i}, {t}_{i})\in {R}^{n\times m}\), the output function of the ELM can be expressed as:

$${f}_{L}\left(x\right)={\textstyle\sum_{i=1}^n}{L}{\beta }_{i}{h}_{i}\left(x\right)=h\left(x\right)\beta ,$$
(8)

where L is the hidden neurons, \(\beta =[{\beta }_{1},{\beta }_{2},\dots ,{\beta }_{L}]\) is known as the output weight vector and \(h\left(x\right)=[{h}_{1}(x),{h}_{2}(x),\dots ,{h}_{L}(x)]\) denotes the output vector of the hidden layer with regard to the input x, which maps the data from input space to the ELM feature space. The training error and the output weights should be minimized at the same time for reducing the training error and improving the generalization ability of neural networks, that is:

$$\mathrm{Minimize}: \Vert {H}_{\beta }-T\Vert , \Vert \beta \Vert$$
(9)

The following solution is provided to solve the least squares (Huang et al. 2011):

$$\beta ={H}^{T}{\left(\frac{1}{\rho }+H{H}^{T}\right)}^{-1}T,$$
(10)

where H is the hidden layer output matrix, ρ is the regulation coefficient, and T is the expected output matrix of samples. Then, the output function of the ELM learning algorithm is:

$$f\left(x\right)=h\left(x\right){h}^{T}{\left(\frac{1}{\rho }+H{H}^{T}\right)}^{-1}T,$$
(11)

If the feature mapping h(x) is unknown and the kernel matrix of ELM based on Mercer’s conditions can be defined as follows:

$$M=H{H}^{T}: {m}_{ij}=h\left({x}_{i}\right) h\left({x}_{j}\right)=k\left({x}_{i},{x}_{j}\right),$$
(12)

Therefore, the output function f(x) of the kernel-based ELM can be represented as:

$$f\left(x\right)=\left[k\left(x,{x}_{1}\right),\dots , K\left(x,{x}_{N}\right)\right]{\left(\frac{1}{\rho }+M\right)}^{-1}T$$
(13)

where \(M=H{H}^{T}\) and \(k(x,y)\) is the kernel function of hidden neurons of single hidden layer feed-forward neural networks (Huang et al. 2011).

Among the various traditional kernel functions, great performance of RBF kernel function has been proved in the literature (Pal and Goel 2007; Azamathulla et al. 2016; Roushangar and Shahnazi 2019).

3 Results and Discussions

3.1 Free Flow Over the PK Weirs

3.1.1 PK Weirs in Channel

In this section, the free flow conditions over the PK weirs are assessed. Here, 4 cycles with weir heights of 20 and 22.3 cm using various ratios of Wi/Wo and different inlet and outlet slopes were considered.

Figure 7a presents the head-discharge relations of all studied weirs. For a given head value, there are considerable differences between the discharge magnitudes of the PK and linear weirs as can be clearly seen from the figure. Among the studied weirs, the PK1.25 and PK1.4 M showed the highest discharge passing capacity. In Fig. 7b, the discharge coefficient (Cd) variations of all studied weirs are plotted against the head water ratio (Ho/P) which shows that the maximum discharge coefficient is corresponding to a head water ratio of 0.075. In contrary to the PK weirs, the discharge coefficient of the linear weirs increases by increasing the head water ratio. Nonetheless, the discharge coefficient of the linear modified weir (Linear M) "which is built by increasing the weir height by 11.5% and changing its shape from a flat to a quadrant state" is increased by 10% with respect to the standard linear weir. Figure 7c illustrates the Cd variations of the standard PK weirs (non-modified weirs) compared to the Ho/P amounts. The plot clearly represents that the PK1.4 gives the highest Cd values for the lowest Ho/P values, while by increasing this ratio more than 0.1 (Ho/P > 0.1), the maximum Cd values are observed in the PK1.25 weir. Such a situation for PK1.5 and PK1.25 at H0/P = 0.6 is observed in the findings of Andesron (2011), and it is coordinated with the results of Ouamane and Lemperiere (2006). The variations of Cd values of the modified PK weirs are given in Fig. 7d, which shows that the PK1.4 M, PK1.25 M, PKC1M, and PK1M give the highest Cd values, respectively. The PK1.25 M and PK1.4 M give almost the same values of Cd for Ho/P > 0.10. Comparing Figs. 7c and d shows that the modified weirs presented the Cd values about 5–15% higher than those of the standard (non-modified) weirs. Nonetheless, by increasing the width of the inlet cycle, the outlet cycle width decreases, so more flow discharge would be passed to the adjacent inlet cycle, which will reduce the local submergence at outlet cycles and increase the Cd values. Experimental observations also showed that increasing flow discharge magnitudes in these weirs would reduce the efficiency of the upstream apex due to the local submergence at upstream of the outlet cycles.

Fig. 7
figure 7

(a) Weirs discharge variations with respect to the hydraulic head, and weirs discharge coefficient variations with respect to head water ratio to (b) all weirs (c) standard weirs (d) modified weirs

Figure 8a presents data for all of the standard PK weirs and Rectangular Labyrinth Weirs (RLW). The data show that except PK1 (in the Ho/P < 0.1 domain), the Cd values of the PK weirs are considerably greater than those of the RLW Weirs. It can be seen that considering the overhangs and inlet/outlet slopes resulted in an increase in weir discharge efficiency. The results are consistent with the findings of Anderson and Tullis (2013). Their comparison of a PK weir and a RLW with the same geometrical parameters showed more efficiency of PK weir (around 10%) than RLW. They also proved the effectiveness of overhangs on the discharge efficiency of a PK weir. Figure 8b shows the effect of modifying the PK weirs with respect to the RLW (with the same crest length). Tables 2 and 3 Summarized the results of Piano Key weirs.

Fig. 8
figure 8

Variations of Cd values of developed PK weirs compared to the rectangular labyrinth weir, (a) Standard PK weirs (b) Modified PK weirs

Table 2 Summary of results of Piano Key weirs (Ho/P, Cd)
Table 3 Summary of results of Modified Piano Key weirs (Ho/P, Cd)

In this section, Root Mean Square (RMS) is utilized to specify the intensity or amplitude of the discharge coefficient with respect to different values of the inlet to outlet width ratio (Wi/Wo). RMS always has a positive value, and this positive value is proportional to the intensity level of the discharge coefficient fluctuation. Particularly, a large RMS value shows high intensity of discharge coefficient fluctuation, and on the other hand, a small RMS value demonstrates low intensity of discharge coefficient fluctuation or small amplitude. RMS value is determined as follows:

$$RMS=\left[\frac1N{\textstyle\sum_{min\frac{H_0}Pi}^{max\frac{H_0}Pi}}\left(C_{d_i}-C_{d_{mean}}\right)^2\right]^{0.5}$$
(14)

where \({C}_{{d}_{mean}}\) is the average discharge coefficient, \({C}_{{d}_{i}}\) is the discharge coefficient for different head water ratio, and N is the number of data. Figure 9 illustrates the variation of RMS values via different values of the inlet to outlet ratio. According to this figure, the variation trend of RMS for both types of PK weirs is similar. Comparing the variation curve of developed PK weirs showed that the intensity of discharge coefficient fluctuation of the modified PK weir is less than that of the standard form of PK weir. The maximum value of discharge coefficient fluctuation occurred when Wi/Wo = 1, and also, minimum value of the RMS occurred when Wi/W0 = 1.25.

Fig. 9
figure 9

Variation of RMS values via different values of the inlet to outlet ratio (Wi/Wo)

Generally, it can be concluded that the Wi/W0 = 1.25 is the optimum inlet to outlet ratio, in which the intensity of discharge coefficient fluctuation is lower, and the average discharge coefficient is higher in compare to other inlet to outlet ratios.

3.1.2 Contracted PK Weirs in Flume

The results corresponded to the PK weirs with a 25 cm contraction comprising two cycles with a height of 20 cm in flume are presented in this section. These weirs have different Wi/Wo ratios and inlet/outlet slopes. Figure 10a plots the PK weirs Cd variations in relation to the head water ratios. From the figure it can be clearly seen that at the lower flow discharge magnitudes the Cd values of the PK1.25 weir are higher than the other studied variants, while by increasing the discharge, its Cd value decreases and falls to its minimal at Ho/P > 0.3. Moreover, when Wi/Wo is more than unity, the magnitude of the entering flow to the inlet is more than those corresponded to Wi/Wo < 1, so the outlets will reach to local submergence which would reduce the Cd values (Due to the high approaching flow from the canal walls). In the contrast, when Wi/Wo < 1, the outlet keys would be greater, so lower magnitude of submergence will be occurred which will increase the weir efficiency. Figure 10b shows the Cd variations of different studied weirs in relation to the PK1 weir with the benchmark slope (1:1.5). PK0.75 weir with a slope of 1:1 presents the highest Cd at Ho/P > 0.2. Similarly, PK1.25 weir shows better performance at lower discharges, but increasing the discharge amount decreases its hydraulic performance to a great extent. Finally, the Cd values of the other studied weirs are higher than the benchmark weir for Ho/P > 0.3.

Fig. 10
figure 10

(a) Cd variations with respect to head water ratio, (b) Cd variations of various weirs with respect to PK1 weir with a 1:1.5 slope

3.2 Submerged Flow Over the PK Weirs

Four models, namely, PK1، PK1M، PKC1 and PKC1M with four different Ho/P ratios are selected here, and a total of 329 experiments were performed to evaluate the effects of submergence on weirs’ efficiency. Different data sets corresponding to H0/P values were collected for each test weir. Before submergence testing, H0 (free flow upstream total head) was determined as a reference for each flow rate tested. After at least 5 min for stabilization of the flow condition, H0 (or H* for submerged conditions) was obtained utilizing the upstream point gauge and velocity head data. Under submerged flow condition, Hd was obtained at the downstream measurement location. Once the free-flow head-discharge condition was obtained, various submerged flow conditions developed utilizing the adjustable tailgate were assessed and recorded for each flow rate tested. For each submergence test condition, H* and Hd were nondimensionalized using the corresponding H0 value. Figure 11 presents the variations of H*/Ho in relation to the Hd/Ho for PK1 and PK1M weirs. According to Dabling (2014), for a given Hd/Ho value, H*/Ho values increase with reducing the Ho/P for both weirs. From Fig. 11a it might be stated that for the submergence ratios lower than 0.48 (S = Hd/H* < 0.48), the downstream flow depth makes no changes on the upstream flow characteristics (Ho = H*). Such state can be observed in Fig. 11b for PK1M weir with S < 0.33. So, it might be concluded that modifying the PK1 weirs would start the submergence condition faster than those of the standard PK1 weirs, while the complete submergence will be occurred later than standard PK1. Variations of Hd/Ho compared with the H*/Ho changes for PKC and PKC1M weirs have been plotted in Fig. 12, which shows that H*/Ho has an inverse relation with Ho/P so that for the lower values of Ho/P, the PKC1 and PKC1M find more submergence when compared to higher Ho/P values. From Fig. 12a, for PKC1 weir, when S < 0.33, the depth of the downstream flow cannot affect the upstream depth (H* = Ho). A similar result might be considered for PKC1M when S < 0.44. Therefore, it can be deduced that modifying the PK weirs causes a delay in starting the submergence conditions while their complete submergence is almost the same.

Fig. 11
figure 11

Variations of H*/H0 in relation to Hd/H0 & S for (a) PK1 weir (b) PK1M weir

Fig. 12
figure 12

Variations of H*/H0 in relation to Hd/H0 and S for (a) PKC1 weir (b) PKC1M weir

3.3 Machine learning-based Modeling

This parLt of the study focused on comparing the generalization capability of Kernel Extreme Learning Machine (KELM) and Support Vector Machine (SVM) for modeling the discharge coefficient with the data sets obtained from performed experiments (for both standard and modified PK weirs). From 466 experiments, 303 data set was relevant to the submerged flow condition, and 163 data set was obtained under free flow condition. Owing to the fact that employing more datasets from varied hydraulic conditions can challenge the machine learning methods and enjoy more reliable evaluation, a total of five related data sources corresponded to the discharge coefficient of PK weirs under free flow condition were explored, and the relevant data were considered for the modeling process. The sources of data as well as the ranges of dimensionless parameters are presented in Table 4. In the present study, the discharge coefficient (Cd) as a dependent variable is described through a function of dimensionless geometrical variables as the following general relationship, in which Cd is the output parameter and five available dimensionless geometrical variables were considered as input parameters of machine learning techniques.

Table 4 Employed experimental data od PK weirs under free flow condition
$${C}_{d}=f(\frac{{H}_{0}}{P}, \frac{{W}_{i}}{{W}_{o}}, \frac{W}{P}\text{, }\frac{L}{W}, \frac{{T}_{s}}{P})$$
(15)

It is worthy of mentioning that the experimental model of Dabling (2014), which contains 116 data points for submerged flow has been used in order to challenge the proposed modeling techniques. As a result, the data sets containing 723 records for free flow, and 419 records for submerged flow conditions were separated into two subsets. The first separation as 75% of total data included the training set, and the remaining 25% of data set was employed for testing purposes.

For the verifying of the results given by the employed KELM and SVM techniques, different statistical indices such as correlation coefficient (R), Nash–Sutcliffe efficiency (NSE) and Root Mean Squared Error (RMSE) were used as defined below:

$$\mathrm{R}=\frac{{\sum }_{\mathrm{i}=1}^{\mathrm{N}}({\mathrm{X}}_{\mathrm{i}}-\overline{\mathrm{X} })\times ({\mathrm{Y}}_{\mathrm{i}}-\overline{\mathrm{Y} })}{{\sum }_{\mathrm{i}=1}^{\mathrm{N}}{({\mathrm{X}}_{\mathrm{i}}-\overline{\mathrm{X} })}^{2}\times {({\mathrm{Y}}_{\mathrm{i}}-\overline{\mathrm{Y} })}^{2}}$$
(16)
$$\mathrm{NSE}=1-\frac{{\sum }_{\mathrm{i}=1}^{\mathrm{N}}{({\mathrm{X}}_{\mathrm{i}}-{\mathrm{Y}}_{\mathrm{i}})}^{2}}{{\sum }_{\mathrm{i}=1}^{\mathrm{N}}{({\mathrm{X}}_{\mathrm{i}}-\overline{\mathrm{X} })}^{2}}$$
(17)
$$\mathrm{RMSE}=\sqrt{{\sum }_{\mathrm{i}=1}^{\mathrm{N}}\frac{{({\mathrm{X}}_{\mathrm{i}}-{\mathrm{Y}}_{\mathrm{i}})}^{2}}{\mathrm{N}}}$$
(18)

where N indicates the number of data, Xi is the observed value, Yi is the modeled value \(\overline{X}\) and \(\overline{Y}\) stand for the mean values of the observed and modeled values. A high value of R and NSE demonstrates a good correlation between the observed and modeled values, and lower values of RMSE represent a better performance of employed modeling techniques.

Since a well-advised application of kernel-based modeling methods is to find an appropriate kernel function and tune associated hyper parameters, various kernel functions were used as a core tool of the employed KELM and SVM methods. Here, the determination of the kernel parameters and ρ (regularization coefficient of KELM) was done after trial-and-error process while optimization of C and ε (hyper parameters of SVM) were performed by a systemic grid search of the parameters using cross-validation on the training set. The predicted output values, obtained from the KELM approach after setting user defined parameters presented in Table 5. Comparing different kinds of kernels indicated that polynomial, RBF and wavelet kernel functions performed equally well as a core tool of the KELM technique and the linear kernel led to poor performance. However, Polynomial and Wavelet kernels are the most complex of the four commonly used kernels, which introduce three kernel parameters and are more difficult to calculate. On the other hand, based on the results of Table 6, it can be clearly seen that RBF performance is considerably better than other kernel functions in the case of SVM. Figure 13 displays the prediction discharge coefficients as presented by the two models in this study against the experimental results. Poor performance of the sigmoid kernel-based SVM model is obvious in this figure. Implementation of the KELM model through polynomial kernel led to more reliable results compared to the polynomial kernel-based SVM model. Therefore, it may be desirable to train a more flexible KELM by utilizing different kernel functions to solve a given problem. Moreover, it was attempted to assess the effectiveness of employed kernel-based techniques in predicting the submerged upstream total head (H*/H0). To this purpose, 415 samples were prepared, and parameter Hd/H0 was used as a predictor input variable. Obtained results reveal the best performance of both KELM and SVM with respect to statistical indices (R = 0.997, NSE = 0.993 and RMSE = 0.001) for the testing part.

Table 5 Results of KELM model with different kernel functions
Table 6 Results of SVM model with different kernel functions
Fig. 13
figure 13

Scatter plots of observed and predicted Cd for KELM and SVM models (test series)

In RBF kernel-based methods, model behavior is largely dependent on the RBF kernel parameter (γ), which can lead to under-fitting and over-fitting in the prediction process. Figure 14 illustrates the statistical indices via gamma values of the employed kernel-based methods. From the figure it is observed that the statistical indices fluctuate with changing the Gamma values, and the lowest RMSE and highest NSE are achieved when the Gamma values are chosen 0.07 and 18 for the KELM and SVM, respectively. It can be stated that the KELM demonstrated great performance with minimum complexity of the model at the same time since large values of Gamma values increase the complexity of the model (Han et al. 2007). Variation of Gamma values had major impact on the model performance of SVM and varied from NSE = 0.272 to NSE = 0.972. Results revealed that the KELM model was less sensitive to the variations of Gamma values.

Fig. 14
figure 14

Variation of NSE and RMSE vs. gamma values

3.3.1 Sensitivity Analysis

A simple sensitivity analysis of the input parameters on the prediction accuracy of employed machine learning approaches for the discharge coefficient of PK weirs under free flow condition is presented in order to investigate the significance of each dimensionless parameter. The KELM model with RBF kernel has also been selected for the sensitivity analysis of inputs. The sensitivity analysis was implemented by successively omitting of each input from the model. Consequently, the statistical behavior of the eliminated input is reduced in terms of employed criteria such as R and NSE, allowing the prediction models to quantify the effect of excluded input on the prediction targets. Table 7 lists the results of the sensitivity analysis. Based on the analysis results, presented in Table 6, it can be deduced that H0/P is the most sensitive input parameter and caused the NSE to decrease to 0.853. Parameter W/P was the second most effective parameter on the discharge coefficient of the PK weirs. With its elimination NSE decreased to 0.967.

Table 7 Obtained results of sensitivity analysis

4 Conclusions

In the current paper, the hydraulic performance of the PK weirs under free and submerged flow conditions was assessed through alerting the geometric parameters. The results showed that:

  1. 1.

    Comparison of a standard PK weir and a Rectangular Labyrinth Weirs (RLW) with the same geometrical parameters showed more efficiency of standard PK weir (around 10%) compared to RLW. It was also observed that under free flow condition and for the standard PK weirs, the PK1.4 weir had the optimum performance for 0.05 < Ho/P < 0.1, while for Ho/P > 0.1 the PK1.25 showed the better hydraulic performance than the other weirs. For a given Wo/Wi ratio, the Cd value of the PKC weir was about 3% more than those of PK weirs with 1:1.5 slopes.

  2. 2.

    Modified PK weirs demonstrated significant better hydraulic performance, experiment results showed. Modified PK weirs increase the discharge coefficient about 5–15% compared with the standard PK weirs. Detailed investigation of experimental results obtained from the modified PK weirs revealed that the Cd values of PK1.4 M were greater than those of the other studied weirs for Ho/P < 0.1, but for Ho/P > 0.1, The PK1.25 M and PK1.4 M gave almost the same values of Cd.

  3. 3.

    Comparison of different developed PK weir models showed that PK weir with Wi/Wo = 1.25 has the best performance.

  4. 4.

    For the contracted weirs, with increasing the ratio of Wi/Wo, the Cd values decrease. The cycle efficiency of the PK weirs was about 2.5 to 4.5 times more than the linear weirs, and for Ho/P > 0.15 the cycle efficiency of the contracted weirs was better than those of non-contracted weirs.

  5. 5.

    For PK1 weir under the submergence ratios lower than 0.48, the downstream flow depth made no changes on the upstream flow characteristics (H* = Ho) and for PKC1 weir when S was less than 0.33, the downstream flow depth could not affect the upstream depth (H* = Ho).

  6. 6.

    Comparison of the achieved results by two kernel-based models confirm their same ability and competency as effective techniques in predicting discharge coefficient and submerged upstream total head of PK weirs. The obtained results showed that KELM with fewer complexity can provide adequate results for both standard and modified PK weirs. However, it is worthy of mentioning that the employed kernel-based methods are data sensitive, so it is hoped that further researches will be carried out using data ranges beyond this study and field data to prove the advantages of the employed models to predict the discharge coefficient of PK weirs. Furthermore, the potential of numerical methods can be used to model PK weirs.