Computational Intelligence and Neuroscience

Volume 2016, Article ID 5242596, 10 pages

http://dx.doi.org/10.1155/2016/5242596

## Intelligent Flow Friction Estimation

^{1}European Commission, DG Joint Research Centre (JRC), Institute for Energy and Transport (IET), Energy Security, Systems and Market Unit, Via Enrico Fermi 2749, 21027 Ispra, Italy^{2}Faculty of Mechanical Engineering in Niš, University of Niš, Aleksandra Medvedeva 14, 18000 Niš, Serbia

Received 1 December 2015; Revised 5 February 2016; Accepted 7 February 2016

Academic Editor: Reinoud Maex

Copyright © 2016 Dejan Brkić and Žarko Ćojbašić. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Nowadays, the Colebrook equation is used as a mostly accepted relation for the calculation of fluid flow friction factor. However, the Colebrook equation is implicit with respect to the friction factor (). In the present study, a noniterative approach using Artificial Neural Network (ANN) was developed to calculate the friction factor. To configure the ANN model, the input parameters of the Reynolds Number (Re) and the relative roughness of pipe () were transformed to logarithmic scales. The 90,000 sets of data were fed to the ANN model involving three layers: input, hidden, and output layers with, 2, 50, and 1 neurons, respectively. This configuration was capable of predicting the values of friction factor in the Colebrook equation for any given values of the Reynolds number (Re) and the relative roughness () ranging between 5000 and 10^{8} and between 10^{−7} and 0.1, respectively. The proposed ANN demonstrates the relative error up to 0.07% which had the high accuracy compared with the vast majority of the precise explicit approximations of the Colebrook equation.

#### 1. Introduction

To date, the Colebrook equation (1) is used as a mostly accepted standard for the calculation of fluid flow friction factor in pipeswhere is the Darcy friction factor (dimensionless); Re is Reynolds number (dimensionless), and is relative roughness of inner pipe surface (dimensionless).

The Colebrook equation is also somewhere known as the Colebrook-White equation or simply the CW equation [1]. Classifying the available data and those from experiment conducted in 1937 by himself and his professor White [2], Colebrook developed a curve fit which was describing transitional roughness, between the smooth and the rough turbulent zone [3]. The Colebrook equation is also considered as a proper base for the widely used Moody diagram with the exception of its laminar zone [4]. In other words, drawing his present famous diagram, Moody used Colebrook’s equation for the whole turbulent zone and for the laminar zone defined by . The Moody chart or Moody diagram is a graph in nondimensional form that relates the Darcy friction factor (*λ*), the Reynolds number (Re), and the relative roughness () for fully developed flow in a circular pipe. It can be used to determine pressure drop or flow rate in such pipes. Although the accuracy of empirical equation of Colebrook can be disputable, it is sometimes essential to produce a fast, accurate, and robust resolution of this equation, which is particularly necessary for the scientific intensive computations and very often for comparisons [5]. Unfortunately, the Colebrook equation suffers from being implicit with respect to the friction factor (*λ*). It cannot be rearranged to derive the friction factor directly with no approximate calculation. Many different strategies are used to calculate or to estimate the friction factor accurately [1, 6–8].

There are a group of studies investigating the use of Artificial Neural Network (ANN) to estimate the friction factor. For instance, the intelligent estimation of hydraulic resistance for Newtonian fluids has been investigated in some of recent studies [9–13]. For the other types of fluids used in agriculture, food engineering, petroleum engineering, and so forth, such as power-law, Bingham, Herschel-Bulkley, and other types of non-Newtonian fluids, the shown ANN cannot be used in the most cases. However, the developed methodology for training can be used with appropriate dataset or appropriate equations to produce relevant solution in such cases where the aforementioned ANN cannot be used [14–16]. Application of ANN for simulation of other types of friction factor rather than Colebrook, namely, Hazen–Williams friction coefficient for small-diameter polyethylene pipes, can also be found in the literature [17], while more recently other attempts of ANN usage for modeling friction factors in pipes have been reported [18, 19].

Nowadays, not only can the ANN approach be used in hydraulics and for simulation of fluid flow, but also it can be widely applied in the various branches of engineering, such as for the control systems [19, 20], as an auxiliary tool in medicine [21–25], a flow pattern indicator for gas-liquid flow in a microchannel [26], and an extension of structural mechanics tools for fast determination of structural response [27]. Also combined neurofuzzy systems (NFS) approach can be used for different purposes such as student modeling system, medical system, economic system, electrical and electronics system, traffic control, image processing and feature extraction, manufacturing and system modeling, forecasting and predictions, and social sciences [28].

#### 2. Definition of the Problem

In the present study, in order to produce an efficient and accurate procedure for estimation of the flow friction factor (), an approach based on the computationally intelligent system was used. The Artificial Neural Network (ANN) for the solution of the problem is developed. The ANN models like the one shown here can be easily generated in the MATLAB software.

First, the raw datasets calculated using the Colebrook equation were used to train the ANN model and then the unknown friction factors (*λ*) were predicted by obtaining the ANN structure with a low relative error. In this paper, the empirical Colebrook equation (1) and its accurate iterative solution will be treated as “accurate by the default” or “absolutely accurate” (sign “=” is used, while for the approximations listed in Appendix sign “≈” is used).

Hydraulic resistance depends on the flow rate which is considered as the main problem in determination of the hydraulic flow friction factor (*λ*). For a pipe, the hydraulic resistance usually is expressed through the Darcy friction factor (*λ*) which is not a constant quantity. Friction factor (*λ*) is related to the flow rate or more precisely to the Reynolds number (Re) and the relative roughness (). In addition, both of them, the Reynolds number (Re) and the relative roughness (), are dependent on the flow rate. In fact, the Reynolds number (Re) is affected by flow velocity while the relative roughness () depends on the thickness of a region of flow inside pipes, termed as boundary layer, which occurs closely to the inner surface of pipe wall [29, 30]. On the contrary, in this paper the relative roughness () retains its classical definition, which implies it should not vary with the flow rate (it will be treated effectively as a geometric quantity and thus should be constant regardless of flow rate with the caveat that the flow is turbulent). Furthermore, it is obvious that changes of the hydraulic resistance in the turbulent zone are governed by the nonlinear law. In general, these hydraulic resistances in turbulent zone can be modeled as logarithmic-law or power-law [31]. The Colebrook equation belongs to the logarithmic-law.

As it was mentioned, the main problem of the Colebrook equation is related to its implicit form with respect to the friction factor (*λ*) which cannot be evaluated without the approximate calculation (the Colebrook equation is a transcendent function). Therefore, different strategies are used to find adequate solution for Colebrook equation: iterative solution (in the present study, it was assumed that values calculated by this method are highly accurate) [6, 7], use of plenty of available explicit approximations of the Colebrook equation derived by numerous mathematical or numerical approaches [6, 8, 32, 33], using some graphical interpretations such as the Moody diagram [4], and so forth.

It should be taken into account that the Moody diagram cannot be used as a reliable and accurate replacement for the Colebrook equation as its reading error can be even more than few percent [10, 34, 35]. Using iterative methods, namely, the Newton-Raphson, the friction factor (*λ*) can be calculated from the Colebrook equation with high accuracy where the convergence of 0.01% requires less than 7 iterations. This accuracy (0.01%) should not be confused with the accuracy of the explicit approximations of the Colebrook equation [36]. Reviewing the relevant literature, one can realize that the vast majority of these approximations are extremely accurate and they can be used instead of implicit Colebrook equation to calculate the friction factor (*λ*). However, the final maximal error caused by approximation should be estimated as the sum of the real maximal error of certain approximation and the error caused by iterative procedure.

The two most accurate explicit approximations with the relative errors up to 0.0026% and 0.0083% are those implied by Ćojbašić and Brkić [37]. Moreover, there are plenty of other approximations with the relative errors above 0.13% [6]. Indeed, use of the highly accurate approximations could complicate the fluid flow calculations. However, use of the advanced and powerful computers and codes can partially solve this problem and reduce the computational burden [38].

In this study, the implied ANN structure led to a low relative error compared to the accurate iterative solution. In addition, the computational burden used to run the applied ANN structure was equal or lower than that of explicit approximations, and it, especially, was less than that of the iterative solution of the original Colebrook equation, while the accuracy of the ANN approach remains significantly high.

#### 3. Methodology

##### 3.1. Preparation of the Dataset

In order to generate the training set for the ANN model, the Colebrook equation was solved iteratively. The iterative solution is used because the highly accurate solution of the friction factor (*λ*) was required, while in the meantime the computational burden was irrelevant since it was a onetime effort to prepare the training data. The training dataset can be efficiently prepared using the spreadsheet solvers, such as MS Excel which is used in the particular case presented here [6, 7]. In order to obtain the highest accuracy in the calculation using MS Excel, the iterative calculation should be enabled and the maximum number of iterations (it is set to 32,767 iterations which was the maximum number of cycles allowed by the software with the highest precision) has to be set [7].

In order to train the presented ANN model, input dataset (Electronic Appendix : MS Excel spreadsheet with the set of 90 thousand combinations used for training of the Artificial Neural Network (ANN) (see Supplementary Material available online at http://dx.doi.org/10.1155/2016/5242596) involving 90,000 triplets was used in which the values of the Darcy friction factor (*λ*) were generated using values of the Reynolds number (Re) and the relative roughness () ranged 5000–10^{8} and 10^{−7}–0.1, respectively. In order to use input datasets, the values of the Reynolds number (Re) and the relative roughness () had to be normalized. The used approach will be comprehensively explained in the next parts.

##### 3.2. Structure and Training of the ANN

The feedforward neural network structure which consists of three layers is used (Figure 1). The first, input layer has two neurons, the second, hidden layer has fifty neurons, and the third, output layer has one neuron, with a sigmoid transfer function in the hidden layer and a linear transfer function in the output layer.