Numerical and ANFIS modeling of flow over an ogee-crested spillway

The main aim of this study was to investigate the flow over an ogee spillway experimentally and simulating by both ANFIS and numerical model. An experimental study was conducted in order to obtain discharges and flow depths over an ogee spillway. Discharges and flow depths of flow in physical model were measured for 16 different total heads. A computational fluid dynamics program, which uses the Reynolds averaged Navier–Stokes equations to solve fluid problems, was used to simulate the flow over ogee spillway. As artificial intelligence methods have also been used with increasing the computer technology in all engineering problems, it was also used in this study in estimating the flow over the spillway. Finally, the flow parameters observed by physical study, numerical simulation and ANFIS model were compared with each other. Nondimensional discharge and flow depth curves are used to compare the results. Numerical and ANFIS models provide a cost-efficient simulating flow over spillways. The results show that there is reasonably good agreement between the physical, numerical and ANFIS models. Numerical solution methods and ANFIS models are also useful tools to design and analyze flow over an ogee spillway.


Introduction
The ogee spillway is one of the most studied hydraulic structures because of its superb hydraulic characteristics. Ogee spillways are used for controlling the discharges and water levels in reservoir in dams. A spillway should have an economical and functional design; therefore, the hydraulic parameters such as discharge, flow depth and velocity should be known accurately. Although much of information about ogee spillways is understood, any derivation from standard parameters such as flow depths and crest shape can change flow parameters. It should be known whether these small changes affect spillway performances.
In the process of designing of hydraulic structures, as there are many variables it is not possible to define all parameters mathematically. Physical model studies enable it possible to avoid the inaccuracies and to find the most appropriate solution in advance. The problems that can be seen during the operation stage of hydraulic structures can cause the loss of life and property which cannot be compensated. A physical model study was investigated in the laboratory in order to determine the problems of ogee spillways that may arise in the field. However, physical models may be expensive if it is compared with numerical models because it requires professional labor work, construction time, laboratory and special materials. Scale effect is another disadvantage of physical models as there may be differences between results of model and prototype especially in turbulent flow.
Computational fluid dynamics (CFD) is a type of numerical modeling technique developed to find solutions for problems including fluid flow (Hirt and Nichols 1981) and solves problems including fluid-fluid and fluid-solid relations. Duration of analysis time of a numerical model on computer can take too much time depending on type of problem and mesh numbers; however, 3-D flow data such as velocity can be obtained from numerical model easily especially in turbulent flows which cannot be obtained from 2-D models. Moreover, there is no need for expensive equipments to obtain results.
Many researchers made considerable works to determine most efficient parabolic crest shape of the ogee spillway, and 1 3 90 Page 2 of 10 different methods are used depending on the relative height (P/H). Many of these methods are based on an extensive series of experiments conducted on weirs at the US Bureau of Reclamation Laboratory (Bradley 1952) defining the profile of the lower nappe of flow over a sharp-crested weir for a wide range of relative heights and upstream face slopes. The design methods presented by the US Army Engineer Waterways Experiment Station, Corps of Engineers (Maynord 1985) and the USBR (1987) are probably the most widely used methods in the hydraulic engineering.
Some researchers used computer programs which have advanced use of CFD to simulate flow over an ogee spillway. Savage and Johnson (2001) compared the discharge characteristics and pressure distributions for flow over an ogee spillway obtained by the physical model and the numerical model. Dargahi (2006) used a physical and a numerical model in order to compare water surface profiles and discharge coefficients. Hu et al. (2018) used a numerical model to analyze performance of piano key weirs. According to results of numerical model, some new formulas are driven to improve accuracy of the design and structural optimization of piano key weirs. Fathi-Moghaddam et al. (2018) conducted some studies on gabion weirs, and hydraulic parameters of flow on gabion weirs are investigated by using a numerical model. They validated the results of numerical model studies by physical model studies.
In recent years, it has been shown that fuzzy logic and artificial intelligence are useful tools for modeling complex nonlinear systems. In the context of predicting flow behavior, adaptive neuro-fuzzy inference systems (ANFIS) have also been proven to be an efficient alternative to traditional methods for hydraulic engineering. Parsaie et al. (2017) tried to estimate discharge in compound open channel by using an ANFIS model. They divided channel to horizontal divisions to make estimation and calculated coefficient of determination and root mean squares to find error in their model. ANFIS model shows good performance for predicting discharge values, and also they found that relative depth, hydraulic and area mostly influence parameters in ANFIS model. Moharana et al. (2015) investigated variation in roughness for meandering channels with flow depths. They created ANFIS model to estimate the roughness coefficient of a meandering channel in terms of Chezy's C. Their ANFIS model shows a high level of accuracy for predicting Chezy's C. Azimi et al. (2018) tried to find roller length of a hydraulic jump by using an ANFIS model. According to their results, ANFIS model predicted 40% of the results with more than 95% success and 36% results with more than 90% success.
In this study, a physical model of standard ogee spillway which was built in the laboratory is used in order to verify the numerical and ANFIS models of the ogee spillway. The results show that all the model results overlap each other and reliable for solving fluid problems. The data observed by experimental study are also compared by the data observed by USBR (1987) and Maynord (1985).

Ogee spillway design
The ogee spillway is a control weir having an ogee (S-shaped) overflow profile. It is one of the most used spillway types in hydraulic structures because of its ability to pass flood flow out of reservoir safely. Ogee spillway idea was first recommended by Muller in 1908 (Micheal and Walker 1948). A typical ogee spillway is shown in Fig. 1.
The general equation for discharge over an ogee-crested spillway is given as: where Q, discharge; L, crest width; C o , discharge coefficient; and H o , total head over ogee spillway.
The relationship of discharge coefficient, C o , versus various values of P/H o is given in Fig. 2. Discharge coefficient values are valid only when the ogee is formed to the ideal nappe shape and H e /H o = 1 (USBR 1987). Figure  x y ratio C o /C continues to increase with H e /H o . While the crest shape is getting narrower, negative pressures along the contact surface will occur and the discharge increases. However, if the crest pressure may be allowed to decrease below the vapor pressure, cavitation damage can occur and it may cause fragmentations on crest surface of ogee spillway and destabilization of structure. Discontinuities in crest shape can also cause negative pressure.
In the laboratory, the ogee spillway model was placed in a test flume. The test flume is an open channel which was made of Plexiglas. The open channel is 400 cm long, 7, 5 cm wide and 15 cm high and has a zero bottom slope. The overview of the open channel and experimental setup including ogee spillway used in the tests is shown in Fig. 4. The open channel has a closed water circulation system, and the flow is supplied by an upstream reservoir tank via a pump. Screens are placed at the upstream face of the reservoir tank in order to prevent waves and to obtain uniform flow conditions along the channel. The screens are behaving as wavebreaking and provide a smooth water surface profile before the ogee spillway.
Flow depths and flow rates are adjusted by a valve. Total head over the ogee spillway is measured by limnimeter, and discharges are calculated by measuring volume changes depending on time in measurement tank (Fig. 5).
A control valve was used for controlling discharge in the model. Experiments are conducted for 16 different total heads (or effective height, H e ) over the ogee spillway ranging from H e /H o = 0.28 to H e /H o = 1.43. Effective heights are measured by using limnimeter from top of the crest to water surfaces. Limnimeter is placed at the distance of 0.06 m back from the ogee spillway in order to neglect approach velocity. In order to get more accurate results, discharge-total head relation curve is obtained (Fig. 6). The curve that shows increment in discharge is compatible with the increase in total head.
Physical model of the ogee spillway used in experiments is fabricated from stainless steel. A model of a typical ogee spillway was used in the study. Dimensions and real view of the ogee spillway are shown in Fig. 7. Design head of the ogee spillway chosen H o = 0.036 m. Ogee spillway model is 0.07 m high (crest height), 0.075 m wide same as with channel width and 0.085 m long.
While determining profile of ogee spillway, two specifications, which are upstream and downstream profiles, are considered (Fig. 8). Upstream portion of the ogee spillway is determined according to constants given in Table 1, where H o = 0.036 m. X and Y coordinate values of upstream profile are determined by using these constants.
Downstream portion of ogee profile is determined by using parabola Eq. 2 (USACE 1987). Horizontal Y values are obtained by assuming some X values. To get a smooth parabola, x values are incremented in small range from 0 up to p = 0.07 m (crest height).
where K is a constant chosen 0.5 from Fig. 9 according to h a /H o ratio which is 0. Value of n is chosen 1.87 from Fig. 10 because h a /H o ratio is 0. Here, h a shows approach velocity head; it is negligible because of the very small approach velocity before the ogee spillway taken as zero. Design head over the ogee is chosen as H o = 0.036.

Flow-3D
Flow-3D is one of the numerical modeling methods used for modeling flow over ogee spillway. Flow-3D is volume of fluid (VOF)-based computational fluid dynamic (CFD) program. In VOF method, cells are given values of 1 and 0 depending on whether they are full or empty with water, respectively. In some cases, cells may be half full and this represents free surface flow. In this situation, cells are given a value equal to the ratio of the fluid volume to cell volume. A rectangular main grid was defined 0.7 m long, 0.16 m high and 0.1 m wide. Numerical model is prepared in 3-D to present physical model accurately. The distance between ogee spillway and upstream boundary (− X) was set 0.5 m, which sufficiently prevents waves and gets more smooth reservoir. The distance between ogee spillway and downstream boundary (+ X) was set 0.11 m, which is relatively short distance compared with upstream condition. The aim of using a shorter distance is to keep out turbulent flow after ogee spillway and reduce analysis time.
The experimental setup including ogee spillway was drawn 3-D with the original size in AutoCAD and imported to Flow-3D with STL (StereoLithography) format. Dimensions of identical hexahedron cells in the computational volume (main grid) are determined as Δx = Δy = Δz = 3 mm, and same cell dimension is used for all domains. The main criteria while specifying cell size in computation domain is to protect a smooth parabolic shape of ogee spillway without any distortion on surface (Fig. 11). While fine cell size such as 1-2 mm provides smooth parabolic crest shape, course cell size such as 1 cm causes discontinuous on crest surface and stepped view appears on crest. However, smaller cell size is increasing duration of analysis time; therefore, Δx = Δy = Δz = 0.002 m cell size is determined as optimum size, resulting in 395,168 total number of mesh (Fig. 12). Coordinate of y-axis (cm) Coordinate of x-axis (cm)  Boundary and initial conditions should be determined carefully to represent the physical model accurately in numerical model in accordance with the real life. There are six boundary conditions representing the boundary of Cartesian system (+ x, + y, + z, − x, − y, −z). The boundary conditions were designed to be compatible with the psychical experiments in real conditions. The upstream boundary conditions (− X), which act as reservoir before the ogee spillway, were specified as hydrostatic pressure depending on total head over the ogee spillway with zero approach velocity. The side walls (+ Y, − Y) and bed (− Z) of open channel were defined as wall with no-slip or partial slip condition. Top (+ Z) of the channel was assigned as atmospheric pressure to describe the free surface open channel flow condition. In this application, it is assumed that total head is equal to the piezometric head mostly. It means that approach velocity before the ogee spillway is zero. However, at higher discharges values approach velocity may be significant. Therefore, stagnation pressure boundary condition is used for higher discharge values to employ approach velocity to get more accurate results. The solution time of the numerical model was selected as 40 s, which is enough time to get steady solution. The unit of length was set in SI system, and the type of temperature is chosen as degree celsius. Water with temperature of 20 °C and viscosity of 10 −3 Pa s was chosen from fluid database and used in model. Incompressible fluid flow mode was activated. Renormalized group (RNG) turbulence model is appropriate for the numerical model when past studies are examined and evaluated in terms of hydraulic engineering. Not a specific material characteristic is defined to ogee spillway in numerical model because model works as no-slip condition over surface of ogee.

ANFIS
Adaptive neuro-fuzzy inference system (ANFIS), first introduced by Jang (1993), is a universal approximation methodology and, as such, is capable of approximating any real continuous function on a compact set to any degree of accuracy (Jang et al. 1997). The structure of ANFIS is similar to ANN having five layers. The layers of the model are composed by nodes, including rules. Sugeno fuzzy model is the most frequently used (Takagi and Sugeno 1985). A typical rule set for first-order Sugeno fuzzy model that includes two fuzzy If-Then rules can be expressed as:   Figure 13 shows the Sugeno fuzzy reasoning system for this Sugeno fuzzy model, while Fig. 14 shows the corresponding equivalent ANFIS architecture. Nodes at the same layer have similar function for this ANFIS structure. It can be summarized as follows, the first layer is input layer, the second layer is rule layer, the third layer is normalization layer, the fourth layer is consequent layer and the fifth layer is output layer. More detail about ANFIS structure can be found in Chang and Chang (2006).

Results and discussion
Discharge values and flow depths investigated by experimental study which is conducted in laboratory were compared with numerical model analyzed by Flow-3D and ANFIS (5) Rule 1 ∶ If x is A 1 and y is B 1 , then f 1 = p 1 x + q 1 y + r 1

(6)
Rule 2 ∶ If x is A 2 and y is B 2 , then f 2 = p 2 x + q 2 y + r 2 model. The main objective of the comparison of models was to determine success of models and to see the differences and similarities of them. Maynord (1985) and USBR (1987) data have also been added to the comparison. The experiments observed from laboratory tests are modeled by numerical models of Flow-3D in 3-D as shown in Fig. 15. Besides the difference between physical model and USBR method, physical model and numerical model show good agreement with each other for all dataset. Results of physical model and numerical model investigated that they don't have same total head (H e ), because of upstream boundary condition (− X) in numerical modeling. Upstream boundary condition (− X) is set static pressure and same water level with physical model; however, same total head cannot be achieved because of water surface slope and meshing. Therefore, results are nondimensionalized to make a more objective comparison between models. To nondimensionalized results, design head H 0 = 0.036 m and design discharge Q d = 1.10 × 10 −3 m 3 /s   (Fig. 16). ANFIS modeling was done by writing m-file codes in MATLAB software. The head and the discharge values obtained from the experimental setup were used for the modeling. Different epoch numbers and diameter values were tried to obtain best results. The head over the spillway was used as input, and the discharge was used as output. Ten data of 16 datasets were used for training process, and the other six datasets were used for the testing process (Table 3).
The results obtained from ANFIS model are evaluated by root mean squared error (RMSE) between the experimental and model output values. The best result was obtained with 1000 epoch number and it was found to be 0.23 × 10 −4 . And R 2 was also calculated and found around 0.99. It is concluded that the ANFIS model shows reasonable results and the model can be used for this kind of studies (Fig. 17).

Conclusions
In this study, an experimental setup was used to obtain discharge values and total heads over an ogee spillway. Total heads and corresponding discharge values are measured for 16 different water levels at the approach channel of the ogee spillway. Flow-3D is used to simulate flow over an ogee spillway, and discharge values were observed by three-dimensional numerical model. As artificial intelligence  Physical ANFIS methods have also been used for estimating the flow over the spillway, study was completed by comparing the flow parameters observed by experimental setup, numerical simulation and ANFIS model. Nondimensional discharge and flow depth curves are used to compare the results. The results show that there is reasonably good agreement between the physical, numerical and ANFIS models. Results show that numerical methods and ANFIS models are useful tools to design and analyze flow over an ogee spillway.
Funding This study was not funded by any Institution.

Compliance with ethical standards
Conflict of interest The authors declare that they have no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.