A novel approach using CFD and neuro-fuzzy-firefly algorithm in predicting labyrinth weir discharge coefficient

  • 34 Accesses


In this paper, for the first time, to model the discharge coefficient of labyrinth weirs, the evolutionary firefly algorithm (FFA) is used for optimizing the membership functions of the adaptive neuro-fuzzy inference system (ANFIS). Also, to enhance the performance of the ANFIS and ANFIS-FFA models, the Monte Carlo simulations (MCs) are employed. Additionally, the k-fold cross-validation is utilized for training and testing the methods. Next, some input dimensionless parameters including the Froude number (Fr), the ratio of the head above the weir to the weir height (HT/P), cycle sidewall angle (α), the ratio of length of the weir crest to the channel width (Lc/W), the ratio of length of apex geometry to the width of a single cycle (A/w) and the ratio of the width of a single cycle to the weir height (w/P) are determined. After that, seven different models are developed for ANFIS and ANFIS-FFA. Then, by conducting a sensitivity analysis, the superior models (ANFIS-FFA 5 and ANFIS 5) and the most effective input parameter (Froude number) are identified. Moreover, the error distribution results exhibit that about 70% of the superior model results have errors less than 5%. Subsequently, the discharge coefficient is simulated by means of a computational fluid dynamics (CFD) model. Furthermore, a comparison of the CFD model with the ANFIS and ANFIS-FFA models reveals that the ANFIS-FFA model is significantly more accurate. Also, an uncertainty analysis is performed for the CFD, ANFIS and ANFIS-FFA models. Finally, a very simple code calculating the discharge coefficient of labyrinth wires is presented. This code can be easily employed without any knowledge on ANFIS, FFA and prior information about MATLAB.

This is a preview of subscription content, log in to check access.

Access options

Buy single article

Instant unlimited access to the full article PDF.

US$ 39.95

Price includes VAT for USA

Subscribe to journal

Immediate online access to all issues from 2019. Subscription will auto renew annually.

US$ 99

This is the net price. Taxes to be calculated in checkout.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Box 1
Fig. 11


  1. 1.

    Crookston BM (2010) Labyrinth weirs. Ph.D. thesis. Utah State University, USA

  2. 2.

    Crookston BM, Tullis BP (2012) Hydraulic design and analysis of labyrinth weirs. I: discharge relationships. J Irrig Drain Eng 139(5):363–370

  3. 3.

    Seamons TR (2014) Labyrinth weirs: a look into geometric variation and its effect on efficiency and design method predictions. Master of Science thesis, Utah State University, USA

  4. 4.

    Carollo FG, Ferro V, Pampalone V (2017) Testing the outflow process over a triangular labyrinth weir. J Irrig Drain Eng 143(8):06017007

  5. 5.

    Sangsefidi Y, Mehraein M, Ghodsian M (2018) Experimental study on flow over in-reservoir arced labyrinth weirs. Flow Meas Instrum 59:215–224

  6. 6.

    Monjezi R, Heidarnejad M, Masjedi A, Purmohammadi MH, Kamanbedast A (2018) Laboratory investigation of the discharge coefficient of flow in arced labyrinth weirs with triangular plans. Flow Meas Instrum 64:64–70

  7. 7.

    Saleh OK, Elnikhely EA, Ismail F (2019) Minimizing the hydraulic side effects of weirs construction by using labyrinth weirs. Flow Meas Instrum 66:1–11

  8. 8.

    Emiroglu ME, Kisi O, Bilhan O (2010) Predicting discharge capacity of triangular labyrinth side weir located on a straight channel by using an adaptive neuro-fuzzy technique. Adv Eng Softw 41(2):154–160

  9. 9.

    Emiroglu ME, Kisi O (2013) Prediction of discharge coefficient for trapezoidal labyrinth side weir using a neuro-fuzzy approach. Water Resour Manag 27(5):1473–1488

  10. 10.

    Ebtehaj I, Bonakdari H, Zaji AH, Azimi H, Sharifi A (2015) Gene expression programming to predict the discharge coefficient in rectangular side weirs. Appl Soft Comput 35:618–628

  11. 11.

    Khoshbin F, Bonakdari H, Ashraf Talesh SH, Ebtehaj I, Zaji AH, Azimi H (2016) Adaptive neuro-fuzzy inference system multi-objective optimization using the genetic algorithm/singular value decomposition method for modelling the discharge coefficient in rectangular sharp-crested side weirs. Eng Optim 48(6):933–948

  12. 12.

    Zaji AH, Bonakdari H, Khodashenas SR, Shamshirband S (2016) Firefly optimization algorithm effect on support vector regression prediction improvement of a modified labyrinth side weir’s discharge coefficient. Appl Math Comput 274:14–19

  13. 13.

    Azimi H, Shabanlou S, Ebtehaj I, Bonakdari H, Kardar S (2017) Combination of computational fluid dynamics, adaptive neuro-fuzzy inference system, and genetic algorithm for predicting discharge coefficient of rectangular side orifices. J Irrig Drain Eng 143(7):04017015

  14. 14.

    Azimi H, Bonakdari H, Ebtehaj I, Michelson DG (2018) A combined adaptive neuro-fuzzy inference system–firefly algorithm model for predicting the roller length of a hydraulic jump on a rough channel bed. Neural Comput Appl 29(6):249–258

  15. 15.

    Salazar F, Crookston BM (2019) A performance comparison of machine learning algorithms for arced labyrinth spillways. Water 11(3):544

  16. 16.

    Baylar A, Hanbay D, Ozpolat E (2008) An expert system for predicting aeration performance of weirs by using ANFIS. Expert Syst Appl 35(3):1214–1222

  17. 17.

    Haghiabi AH, Parsaie A, Ememgholizadeh S (2017) Prediction of discharge coefficient of triangular labyrinth weirs using adaptive neuro fuzzy inference system. Alex Eng J 57:1773–1782

  18. 18.

    Roushangar K, Alami MT, MajediAsl M, Shiri J (2017) Modeling discharge coefficient of normal and inverted orientation labyrinth weirs using machine learning techniques. ISH J Hydraul Eng 23(3):331–340

  19. 19.

    Roushangar K, Alami MT, Shiri J, Asl MM (2018) Determining discharge coefficient of labyrinth and arced labyrinth weirs using support vector machine. Hydrol Res 49(3):924–938

  20. 20.

    Bilhan O, Emiroglu ME, Miller CJ, Ulas M (2019) The evaluation of the effect of nappe breakers on the discharge capacity of trapezoidal labyrinth weirs by ELM and SVR approaches. Flow Meas Instrum 64:71–82

  21. 21.

    Zaji AH, Bonakdari H, Shamshirband S, Qasem SN (2015) Potential of particle swarm optimization based radial basis function network to predict the discharge coefficient of a modified triangular side weir. Flow Meas Instrum 45:404–407

  22. 22.

    Ebtehaj I, Bonakdari H (2016) A support vector regression-firefly algorithm-based model for limiting velocity prediction in sewer pipes. Water Sci Technol 73(9):2244–2250

  23. 23.

    Yaseen ZM, Ebtehaj I, Bonakdari H, Deo RC, Mehr AD, Mohtar WHMW, Singh VP (2017) Novel approach for streamflow forecasting using a hybrid ANFIS-FFA model. J Hydrol 554:263–276

  24. 24.

    Muzzammil M (2010) ANFIS approach to the scour depth prediction at a bridge abutment. J Hydroinform 12(4):474–485

  25. 25.

    Ranković V, Radulović J, Radojević I, Ostojić A, Čomić L (2012) Prediction of dissolved oxygen in reservoirs using adaptive network-based fuzzy inference system. J Hydroinform 14(1):167–179

  26. 26.

    Sharghi E, Nourani V, Behfar N (2018) Earthfill dam seepage analysis using ensemble artificial intelligence based modeling. J Hydroinform 20:1071–1084

  27. 27.

    Beliakov G, King M (2006) Density based fuzzy c-means clustering of non-convex patterns. Eur J Oper Res 173(3):717–728

  28. 28.

    Xie XL, Beni G (1991) A validity measure for fuzzy clustering. IEEE Trans Pattern Anal Mach Intell 8:841–847

  29. 29.

    Yang X-S (2010) Firefly algorithm, stochastic test functions and design optimisation. Int J Bio-Ins Comput 2(2):78–84

  30. 30.

    Yang X-S (2010) Nature-inspired metaheuristic algorithms. Luniver Press, Bristol

  31. 31.

    Hirt CW, Nichols BD (1981) Volume of fluid (VOF) method for the dynamics of free boundaries. J Comput Phys 39(5):201–225

  32. 32.

    Kumar S, Ahmad Z, Mansoor T (2011) A new approach to improve the discharging capacity of sharp-crested triangular plan form weirs. J Flow Meas Instrum 22(3):175–180

  33. 33.

    Ebtehaj I, Bonakdari H, Shamshirband S (2016) Extreme learning machine assessment for estimating sediment transport in open channels. Eng Comput 32(4):691–704.

  34. 34.

    Ebtehaj I, Bonakdari H, Sharifi A (2014) Design criteria for sediment transport in sewers based on self-cleansing concept. J Zhejiang Univ Sci A 15(11):914–924.

Download references

Author information

Correspondence to Mohsen Najarchi.

Ethics declarations

Conflict of interest

All authors declare they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Technical Editor: Daniel Onofre de Almeida Cruz, D.Sc.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Shafiei, S., Najarchi, M. & Shabanlou, S. A novel approach using CFD and neuro-fuzzy-firefly algorithm in predicting labyrinth weir discharge coefficient. J Braz. Soc. Mech. Sci. Eng. 42, 44 (2020).

Download citation


  • Computational fluid dynamics
  • Discharge coefficient
  • Firefly algorithm
  • Labyrinth weir