#### Abstract

The empirical Colebrook equation from 1939 is still accepted as an informal standard way to calculate the friction factor of turbulent flows (4000 < Re < 10^{8}) through pipes with roughness between negligible relative roughness (*ε*/*D *⟶* *0) to very rough (up to *ε*/*D* = 0.05). The Colebrook equation includes the flow friction factor *λ* in an implicit logarithmic form, *λ* being a function of the Reynolds number Re and the relative roughness of inner pipe surface *ε*/*D*: *λ* = *f*(*λ*, Re, *ε*/*D*). To evaluate the error introduced by the many available explicit approximations to the Colebrook equation, *λ* ≈ *f*(Re, *ε*/*D*), it is necessary to determinate the value of the friction factor *λ* from the Colebrook equation as accurately as possible. The most accurate way to achieve that is by using some kind of the iterative method. The most used iterative approach is the simple fixed-point method, which requires up to 10 iterations to achieve a good level of accuracy. The simple fixed-point method does not require derivatives of the Colebrook function, while the most of the other presented methods in this paper do require. The methods based on the accelerated Householder’s approach (3rd order, 2nd order: Halley’s and Schröder’s method, and 1st order: Newton–Raphson) require few iterations less, while the three-point iterative methods require only 1 to 3 iterations to achieve the same level of accuracy. The paper also discusses strategies for finding the derivatives of the Colebrook function in symbolic form, for avoiding the use of the derivatives (secant method), and for choosing an optimal starting point for the iterative procedure. The Householder approach to the Colebrook’ equations expressed through the Lambert W-function is also analyzed. Finally, it is presented one approximation to the Colebrook equation with an error of no more than 0.0617%.

#### 1. Introduction

To evaluate flow resistance in turbulent flow through rough or smooth pipes, the empirical Colebrook equation is in common use [1]:

In the Colebrook equation, *λ* represents Darcy flow friction factor, Re Reynolds number, and *ε*/*D* relative roughness of inner pipe surfaces (all three quantities are dimensionless).

The experiment performed by Colebrook and White [2] dealt with flow of air through a pipe, diameter *D* = 53.5 mm, and length *L* = 6 m, with six different roughness of inner surface of the pipe artificially simulated with various mixtures of two sizes of sand grain (0.035 mm and 0.35 mm diameter) to simulate conditions of inner pipe surface from almost smooth to very rough. The sand grains were fixed using a sort of bituminous adhesive waterproof insulating compound to form five types of relatively uniform roughness of inner pipe surfaces while the sixth one was without sand, that is, it was left smooth. The experiment revealed, contrary to the previous, that the flow friction, *λ*, does not have a sharp transition from the smooth to the fully rough law of turbulence. This evidence Colebrook [1] later captured in today famous and widely used empirical equation, Equation (1).

The Colebrook function relates the unknown flow friction factor *λ* as function of itself, the Reynolds number Re, and the relative roughness of inner pipe surface *ε*/*D*, *λ* = *f*(*λ*, Re, *ε*/*D*). It is valid for 4000 < Re < 10^{8} and for 0 < *ε*/*D* < 0.05. The Colebrook equation is transcendent and thus cannot be solved in terms of elementary functions [3–6]. Although empirical, and therefore with questionable accuracy, its precise solution is sometimes essential in order to repeat or to evaluate the previous findings in a concise way [7–9].

Few approaches are available today for solving the Colebrook equation:(1)*Graphical solution—Moody diagram*: To represent the Colebrook equation graphically, Rouse in 1942 had developed an appropriate diagram which Moody later adapted in 1944 in the famous diagram widely used in the past in engineering practice [10, 11]. The diagram was preferred because the Colebrook equation is implicitly given. Today, graphical solution has only value for educational purposes.(2)*Iterative solution of the Colebrook equation*:(a)*Simple fixed-point iterative method.* The simple fixed-point iterative method [12] is in common use for solving accurately the Colebrook equation (special case of the Colebrook equation for Re ⟶ ∞ gives explicit form valid only for the fully turbulent flow in rough pipes [13–16] but which can be used as initial starting point for all cases covered by the Colebrook equation *λ*_{0} = *f*(*ε*/*D*)* *⟶* *Equation (2); now using the Colebrook equation, new value can be calculated *λ*_{1} = *f*(*λ*_{0}; Re; *ε*/*D*); starting from *i* = 1, the procedure *λ*_{i+1} = *f*(*λ*_{i}; Re; *ε*/*D*); *i* = *i* + 1 goes until *λ*_{i} ≈ *λ*_{i+1}, where we set *λ*_{i+1} − *λ*_{i} ≤ 10^{−8}). It usually reaches the satisfied accuracy after no more than 10 iterations.(b)*Householder’s iterative methods.* On the other hand, Newton’s method (also known as the Newton–Raphson method [17–19]) needs few iterations less compared to the fixed-point method to reach the same level of accuracy. A shortcoming of Newton’s method is that it additionally requires the first derivative of the Colebrook function (here we show analytical form of the first derivative including the symbolic form generated in MATLAB [20]). Also knowing that the Newton–Raphson method is the 1st order of Householder’s method [21, 22], here we also analyze the 2nd order, which is known as the Halley [23] and the Schröder [24, 25] method, and also the 3rd order. The third-order methods use the third, the second, and the first derivative, the 2nd order use the second and the first, while the 1st order use only the first derivative. Today, all mentioned types of iterative solutions can easily be implemented in software codes and they are accepted as the most accurate way for solving the Colebrook equation, and hence, they are preferred compared to the graphical solution.(c)*Three-point iterative methods.* Three-point iterative methods need only 1 to 3 iterations in three points *x*_{0}, *y*_{0}, and *z*_{0} (three internal iterations) to achieve the high level of accuracy [26–28]. *x*_{0} is initial starting point, *y*_{0} is auxiliary step, while *z*_{0} is the solution. Three-point methods are very accurate and can reach high accuracy in some cases even after 1 to 2 iterations. Also slightly less fast two-point methods in terms of required number of iterations to reach the demanded accuracy do exist.(3)*Approximations of the Colebrook equation*: Colebrook’s equation can be expressed in the explicit form only in an approximate way: *λ *≈* f*(Re, *ε*/*D*) [29–36]. Numerous explicit approximations to the Colebrook equation are available in the literature [29–32, 34–36]. The iterative solutions as the most accurate methods are used for evaluation of accuracy of such approximations. Also, based on our findings, we provide an approximation, Equation (28), with the error of no more than 0.69% and 0.0617%. The Colebrook equation can also be approximately simulated using Artificial Neural Networks [37–39].(4)*Lambert W-function*: Until now, the only one known way to express the Colebrook equation exactly in explicit way is through the Lambert W-function, *λ* = *W*(Re, *ε*/*D*) [3, 8, 40–43], where further evaluation of the Lambert W-function can be only approximated [44–48]. Here, we show the procedure how to solve the Lambert W-function using the Householder iterative procedure (2nd order: Halley’s method and 1st order: Newton–Raphson). Also approach with the shifted Lambert W-function in terms of the Wright Ω-function exists [40, 43].

In this paper, we show the three-point and the Householder iterative procedures (the 3rd order, the 2nd order: Halley’s [49] and Schröder’s method, and the 1st order: Newton–Raphson) with the additional recommendations in order to solve the empirical Colebrook equation implicitly given in respect of the flow friction factor *λ*. The goal of this paper is to show the improved iterative solutions which can obtain the value of the unknown friction factor *λ* accurately after the least possible number of iterations. Additionally, we developed a strategy how to choose the best starting point [50] for the iterative procedure in the domain of interest of the Colebrook equation, how to generate required symbolic derivatives to the Colebrook equation in MATLAB, and how to avoid use of the derivatives (secant method). Finally, we use findings from our paper to present a novel explicit approximation of the Colebrook equation, which would be interesting for engineering practice. We also present distribution of the relative error in respect of the presented approximation over the applicability domain of the Colebrook equation.

To evaluate the efficiency of the presented methods, the unknown flow friction factor *λ* is calculated for two pairs of the Reynolds number Re and relative roughness of inner pipe surfaces *ε*/*D*: (1) (Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5})* *⟶* λ* = 0.010279663295529 and (2) (Re = 3·10^{4}, *ε*/*D* = 9·10^{−3})⟶* λ* = 0.038630738574792.

#### 2. Initial Estimate of Starting Point for the Iterative Procedures

The starting point is a significant factor in convergence speed in the three-point and the Householder methods [50], and there are the different methods to choose a good start, but here we examine (1) starting point as function of the input parameters and (2) initial starting point with the fixed value.

One of the essential issues in every iterative procedure is to choose the good starting point [51, 52]. Here, we try to find the fixed starting point (the initial value of the flow friction factor *λ*_{0} or the related transmission factor ) valid for all cases from the practical domains of applicability of the Colebrook equation which is for the Reynolds number Re, 4000 < Re < 10^{8}, and for the relative roughness *ε*/*D*, 0 < *ε*/*D* < 0.05. In the cases when this approach does not work efficiently, we show how to choose the starting value in function of the Reynolds number Re and the relative roughness *ε*/*D*, that is, using some kind of the rough approximations to the Colebrook equation which can be relatively inaccurate but simply and which put the initial value reasonable close to the final and accurate solution. This initial guess then needs to be plugged into the shown numerical methods and iterated recursively few times (usually two or three times and up to ten in the worst case) to converge upon the final solution. In any case, a sample of size 65536 was considered for analysis of the iteration methods. The input sample was generated according to the uniform density function of each input variable. The low-discrepancy Sobol sequences were employed [53]. These so-called quasirandom sequences have useful properties. In contrary to the random numbers, quasirandom numbers cover the space more quickly and evenly. Thus, they leave very few holes.

The Colebrook equation can also be expressed in terms of the Lambert W-function analytically, *λ* = *f*(*λ*, Re, *ε*/*D*)* *⟶* λ* = *W*(Re, *ε*/*D*) [41, 42, 54]. The Lambert W-function further can be evaluated only approximately through the Householder iterative procedures which also require the appropriate initial starting point. The analysis of this initial starting point has wider applicability, because the Lambert W-function has extensive use in many branches of physics and technology [55, 56].

##### 2.1. Starting Point as Function of Input Parameters

###### 2.1.1. Starting Point as Function of the Relative Roughness *ε*/*D* (When Re* *⟶* *∞)

The special case of the Colebrook equation when Re* *⟶* *∞ physically means that the flow friction factor *λ* in that case depends only on *ε*/*D*, for Re* *⟶* *∞, *λ* = *f*(*ε*/*D*), that is, the flow friction factor *λ* is not implicitly given [14]. In that way, the starting point can be calculated using the explicit equation which has only one variable, *λ*_{0} = *f*(*ε*/*D*) (Equation (2)). The results obtained in that way are accurate only for the case Re* *⟶* *∞ but for the smaller values of the Reynolds number Re which corresponds to the smooth turbulent flow, the error can goes up to 80% [13, 57]. Anyway, in that way, calculated value can be efficiently used as an initial starting guess for the iterative procedures for the whole domain of applicability of the Colebrook equation.

The initial starting point obtained using the previous equation is referred as “traditional,” and it introduces the maximal relative error of 80% over the domain of applicability of the Colebrook equation where the error can be neglected in case of fully developed turbulent flow through the pipes with very rough inner surface. To reach the accuracy of *λ*_{i+1} − *λ*_{i} ≤ 10^{−8}, usually 6 steps are enough regarding the Newton–Raphson method (Figure 1).

###### 2.1.2. Starting Point Obtained Using Approximations to the Colebrook Equation

Every approximation to the Colebrook equation, *λ* ≈ *f*(Re, *ε*/*D*), can be used to put the initial starting point as close as possible near the final accurate solution [30]. For example, using one of the approximations with the error of up to 10% for calculation of the initial starting point , the final accurate value of the flow friction factor *λ* is reached in the worst-case scenario after 3 iterations using the Colebrook equation and one of the procedures from Section 3.2. After 3 iterations, the whole practical domain of applicability of the Colebrook equation is covered with the difference between the two final iterations less than 10^{−8}, *λ*_{i+1} − *λ*_{i} ≤ 10^{−8} (Figure 2). In average, the method requires 2.7 iterations in average for all cases with the set precision (stopping criterion) very close to zero (about 10^{−8}) when calculation goes through the transmission factor *x*. The results from Figure 1 are from the 65536 pairs of the Reynolds number Re and the relative roughness *ε*/*D* over the domain of applicability of the Colebrook equation domain (values of the Reynolds number Re between 4000 and 10^{8} and the relative roughness *ε*/*D* between 0 and 0.05, dividing them into 256 points each).

##### 2.2. Fixed Initial Starting Point

An idea from geometry to find “center of gravity” is used for the points for which the Newton–Raphson, the Halley, Schröder, and the three-point methods converge slowly. If we put the initial starting point in this zone, the less number of iterations is required to reach the final solution [58].

###### 2.2.1. Fixed Initial Starting Point for the Newton–Raphson Method

The “center of gravity” for the “slow area” in which the Newton–Raphson method requires the increased number of iterations is shown in Figure 1. The “center of gravity” has coordinates: log(Re) = 4.4322* *⟶* *Re ≈ 27000 and –log(*ε*/*D*) = 5.7311* *⟶* ε*/*D* ≈ 1.85·10^{−6} for which the flow friction factor *λ* and the corresponding transmission factor can be calculated using any of the available methods. In that way, calculated *x* became the starting point *x*_{0} for all combinations of the Reynolds number Re and the relative roughness *ε*/*D* in the domain of applicability of the Colebrook equation. With this new starting point *x*_{0}, the maximal required number of iterations is 4 (Figure 3), while before in the worst case was 6 (Figure 1) when the starting point *x*_{0} was obtained through the “traditional formula” for this purpose, Equation (2), all valid for the case when the flow friction factor *λ* is calculated with the accuracy of *λ*_{i+1} − *λ*_{i} ≤ 10^{−8} using the Colebrook equation solved in Newton’s procedure when calculation goes through the transmission factor *x*.

The physical interpretation of this “slow area” is in the fact that this area corresponds to the initial zone of the turbulent flow through the smooth pipes, while Equation (2) is accurate only for the fully developed turbulent flow through the rough pipes. So, Equation (2) can already obtain accurate solution in the case of the fully developed turbulent flow through the rough pipes even without the iterative process, where Equation (2) introduces the relative error of almost 80% in the case of initial phases of the turbulent flow through the smooth pipes.

With the initial starting point fixed at the “center of gravity” of the “slow area,” in the worst cases, maximum 4 iterations as shown in Figure 3 are enough for the required accuracy of 10^{−8} (before with the “traditional” version of the initial value provided using Equation (2) was 6 as indicated in Figure 1). The new fixed starting point is set as *λ*_{0} = 0.024069128765100981, that is, *x*_{0} = 6.44569593948452. It corresponds to log(Re) = 4.4322* *⟶* *Re ≈ 27000 and –log (*ε*/*D*) = 5.7311* *⟶* ε*/*D* ≈ 1.85·10^{−6}.

The new starting point *x*_{0} = 6.44569593948452 is very robust and it seems to be an optimal starting point for all combinations when calculation goes through the transmission factor as explained in Section 3.2.

###### 2.2.2. Fixed Initial Starting Point for the Halley and Schröder Method

The starting point for calculation through the Halley and the Schröder method using Equation (2) requires in the worst cases up to 4 iterations to reach the required accuracy (Figure 4). Compared with the Newton–Raphson method, it is improvement of two iterations: up to 6 iterations required in Figure 1 and up to 4 iterations in Figure 4. The “worst-case” area for Halley’s and Schröder’s method that requires 4 iterations using staring point Equation (2) has coordinates: (log_{10} (Re) = 5.3108* *⟶* *Re ≈ 204550; –log_{10} (*ε*/*D*) = 4.9431* *⟶* ε*/*D* ≈ 1.14·10^{−5})* *⟶* λ*_{0} = 0.015663210285978339, that is, *x*_{0} = 7.990256504. This value is the new optimal initial starting point in the case of the Halley and the Schröder method.

With the new initial starting point *x*_{0} = 7.990256504, three iterations are required at maximum to reach the required accuracy in case of the Halley and the Schröder method (Figure 5) as described in Section 3.2.

###### 2.2.3. Fixed Initial Starting Point for the Three-Point Iterative Methods

The optimal normalized parameters for the fixed initial starting point for the three-point iterative methods explained in Section 3.4. of this paper [26–28] are as follows: (log_{10} (Re) = 4.90060379974617* *⟶* *Re = 79543.33576; –log (*ε*/*D*) = 5.33355157079189* * ⟶* ε*/*D* = 4.63926·10^{−6})* *⟶* λ*_{0} = 0.018904186734624* *⟶* x*_{0} = 7.273124147. The Džunić–Petković method is shown in Section 3.4. Additional recommendations about the initial starting point regarding the three-point iterative methods can be found in [59].

##### 2.3. Starting Point for the Lambert W-Expressed Colebrook Equation

The friction factor *λ* in the Colebrook equation can be expressed in the explicit way through the Lambert W-function [3, 5, 8, 30, 42, 60, 61]. The Lambert W-function can further be evaluated using some types of the Householder iterative methods as shown in Section 3.5 of this paper.

The Colebrook equation in a closed form through the Lambert W-function can be expressed in two ways, Equations (3) and (4). The first expression is [3, 30, 60, 62] as follows:where .

The argument of the Lambert W-function in this case depends only on the Reynolds number, *λ*_{0} = Re/2.18. Knowing that the practical range of the Reynolds number goes from 4000 to 10^{8}, the argument of the Lambert W-function is goes from about 1835 to 45871560, where *W*(1835) = 5.763291081 and *W*(45871560) = 14.93748223. The Halley procedure is fast and any initial starting point can be chosen between 5 and 15, but the Newton–Raphson method is very slow and we found that, for the best results, the initial starting point 15 has to be chosen. Note that for *W*(45871560) = 14.93748223, the Newton–Raphson procedure does not work in Excel for the values of initial starting point lower than 8.814.

Due to transformations of coefficients, Equation (3) can introduce the relative error up to 2% and should be considered as explicit approximation to the Colebrook equation rather to its equivalent [63].

The second expression is as follows [42, 54]:where

Argument of the Lambert W-function in this case is *e*^{α} which for the certain combinations of the Reynolds number Re and the relative roughness *ε*/*D* from the practical domain of the Colebrook equation is too big to be calculated in registers of computers [6, 41, 54]. This can be overwhelmed with the Wright Ω-function, [40, 43, 64–66].

The argument of the Lambert W-function in this case, exp(*α*_{0}), depends on both Re and *ε*/*D*, but as explained due to exponential form, the calculation is not always possible and because of that limited possibility of use the appropriate starting point in this case is not evaluated [41, 54, 67, 68].

#### 3. Iterative Methods Adopted for the Colebrook Equation

The Householder method [22] is a numerical algorithm for solving the nonlinear equation such as Colebrook’s. During the Householder procedure, in successive calculation, that is, in iterative cycles, the original assumed value of the unknown quantity (the initial starting point [50]) needs to be brought as much as possible close to the real value of the quantity using the least possible number of iterations. The same situation is with the three-point methods [28].

The following types of the method are used in this paper: the first-order Householder method (Newton–Raphson [18, 19]), the 2nd order (Halley [69, 70] and Schröder [25]), and the 3rd order, as well as the three-point methods [28]. All these methods require the calculation of the derivatives which is usually underlined as the most important shortcoming of the Householder and the three-point methods compared with the simple fixed-point procedure in respect of the Colebrook equation. The Newton–Raphson and the three-point methods (in most cases) require only the first derivative, the Halley and the Schröder method requires the first and the second derivative, while the 3rd requires the first, the second, and the third derivative. In addition to the first derivate in analytical form, all required derivatives of the Colebrook function were present also in a simple and computationally inexpensive symbolic form. The derivatives in symbolic form were generated in MATLAB. In addition, the secant method which does not require derivatives is shown as a variant of the Newton–Raphson method [71].

All shown approaches with the Householder methods in our case usually require only 2 to 4 iterations to reach the final accurate solution [72]. This number can be slightly higher depending on the chosen method where the secant method requires by default 1-2 iterations more. Also some simple transformations of the Colebrook equation, such as introduction of the transmission factor in form of the shift , can reduce the number of required iterations. Knowing that the right form of equation is essential for all types of the Householder methods, here are examined the two at first look very similar options: (1) direct calculation of *λ* in Section 3.1 and (2) indirect calculation of *λ* through transmission factor in Section 3.2.

Finally, the Colebrook equation can be rewritten in an explicit form through the Lambert W-function [41, 42, 54, 73] and the Lambert W-function is solved in Section 3.5 using the Newton–Raphson and the Halley procedure.

##### 3.1. Direct Calculation of *λ* with Derivative Calculated in Analytical Way

The proposed technique requires the Colebrook equation in the form *f*(*λ*, Re, *ε*/*D*) = 0, Equation (5), where *λ* is treated as variable, the first derivative *f*′(*λ*, Re, *ε*/*D*), Equation (6) of the Colebrook equation with respect to *λ* and the initial value of the friction factor *λ*_{0} as starting point. Most probably, the function will have residue *f*/*f′* ≠ 0 which needs to be minimized through the iterative process.

Here are the required steps for the Newton–Raphson procedure:

The Colebrook equation in the form *f*(*λ*, Re, *ε*/*D*) = 0:

The first derivative *f′* with respect to *λ* in exact analytical way:

Initial value *λ*_{0} is selected as explained in Section 2 of this paper in order to calculate the residue *f*/*f′* and start the iterative procedure:

The procedure *λ*_{i+1} = *λ*_{i} − *f*(*λ*_{i})/*f′*(*λ*_{i}) needs to be followed until the residue *f*(*λ*_{i})/*f′*(*λ*_{i}) ≈ 0.

The explained Newton–Raphson procedure is shown in Tables 1 and 2 for two numerical examples: (1) (Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5})* *⟶* λ* = 0.010279663295529 and (2) (Re = 3·10^{4}, *ε*/*D* = 9·10^{−3})* *⟶* λ* = 0.038630738574792. As explained in Section 2 of this paper, the initial starting point *λ*_{0} in Table 1 depends on the input parameters, while in Table 2 it is with the fixed value.

Here shown direct calculation of the unknown flow friction factor *λ* is sensitive on the chosen initial starting point *λ*_{0} [50]. The fixed initial point *λ*_{0} chosen as in Section 2.2 in some cases requires the increased number of iterations to reach the final solution although the procedure still maintains very good convergent properties [71, 72]. To reduce the number of the required iterations, use of some of the explicit approximations to the Colebrook equation is advised in order to bring the initial starting point *λ*_{0} as close as possible near the final calculated value. Therefore, the approach with the fixed starting point as explained in Section 2.2 of this paper, in this case, cannot be advised in comparison with the approach with the starting point obtained using approximations as explained in Section 2.1.

Comparing the same approach but with the different starting points (Tables 1 and 2), we can conclude that the one single calculated negative value for flow friction factor *λ* can increase the number of required iterations significantly. These negative values can occur if the initial starting point is chosen too far away from the final calculated solution. This problem can be overwhelmed with the Colebrook function slightly rearranged as in Section 3.2.

##### 3.2. Indirect Calculation of *λ* through the Transmission Factor

The appropriate form of the function is essential to reduce the number of required iteration to reach the final solution. In order to accelerate the procedure, an appropriate shift is used to provide some kind of linearization of the problem.

The Newton–Raphson procedure with these changes has similar steps as already shown:

Shift in form of the transmission factor should be introduced in order to transform the Colebrook equation in form *f*(*x*, Re, *ε*/*D*) = 0:

The first derivative of Equation (8) in respect of the transmission factor *x* can be calculated analytically, but also in symbolic form (where both approaches give identical results), Sections 3.2.1 and 3.2.2.

###### 3.2.1. Indirect Calculation of *λ* through the Transmission Factor with the Derivative Calculated Analytically

The first derivative *f′* with respect to *x* can be obtained analytically, Equation (9) (also Equation (11) gives the same results):

Initial value of the flow friction factor *λ*_{0} should be chosen and the residue *f*/*f′* is calculated in order to start the Newton–Raphson procedure:

The procedure *x*_{i+1} = x_{i} − *f*(*x*_{i})/*f′*(*x*_{i}) should be followed until the residue *f*(*x*_{i})/*f′*(*x*_{i}) ≈ 0. Then, the final solution is , where *n* = *i* + 1 is the final iteration.

Approach with the indirect calculation of *λ* through the transmission factor *x* is much more stable compared with the direct calculation of *λ* as can be seen from Tables 2 and 3 comparing the number of required iterations to reach the same accuracy (11 iterations for the direct approach compared with only 3 iterations in the indirect approach using fixed starting point *x*_{0} = 6.445695939 for Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5}).

###### 3.2.2. Indirect Calculation of *λ* through the Transmission Factor with the Symbolic Derivative

The exact analytical expression of the first derivative *f′* with respect to *x* can be obtained in MATLAB, Equation (11); results are the same as using Equation (9):

Initial value of the flow friction factor *λ*_{0} should be chosen and the residue *f*/*f′* is calculated in order to start the Newton–Raphson procedure:

The procedure *x*_{i+1} = x_{i} − *f*(*x*_{i})/*f′*(*x*_{i}) should be followed until the residue *f*(*x*_{i})/*f′*(*x*_{i}) ≈ 0. Then, the final solution is , where *n* = *i* + 1 is the final iteration.

The iterative procedure can be accelerated using Halley’s formula instead of the Newton–Raphson:

In general, *x*_{1} = *x*_{i+1} and *x*_{0} = *x*_{i}; *i* = 0 to *n*, where *n* + 1 is the final iteration in which *x*_{n} ≈ *x*_{n+1}.

The second derivative *f*″(*x*) in respect of *x* is required:

The Newton–Raphson method belongs to the 1st order and the Halley to the 2nd order of Householder’s method, while the 3rd order can be expressed using the following equation:

Again, *x*_{1} = *x*_{i+1} and *x*_{0} = *x*_{i}; *i* = 0 to *n*, where *n* + 1 is the final iteration in which *x*_{n} ≈ *x*_{n+1}.

The required 3rd derivative f‴(x) can be expressed using the following equation:

Also here one has to be underlined that the Halley method [74] is not the unique Householder method of the 2nd order [22]. For example, the Schröder method [25] also belongs to the group:

Further, *x*_{1} = *x*_{i+1} and *x*_{0} = *x*_{i}; *i* = 0 to *n*, where *n* + 1 is final iteration in which *x*_{n} ≈ *x*_{n+1}.

Using the presented Householder procedures, the 1st order: the Newton–Raphson, the 2^{nd} order: Halley, and the 3rd order, the unknown flow friction factor *λ* should be calculated for the two given pairs of the Reynolds number Re and the relative roughness *ε*/*D*: (1) (Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5})* *⟶* λ* = 0.010279663295529 and (2) (Re = 3·10^{4}, *ε*/*D* = 9·10^{−3})* *⟶* λ* = 0.038630738574792. The calculation presented in Tables 4–7 is through the transmission factor *x*, using the symbolic derivative *f*′(*x*), but with the different initial starting point *λ*_{0}.

##### 3.3. Secant Method

The secant method is similar to the Newton–Raphson; it requires two starting points *λ*_{0} and *λ*_{−1} but does not require calculation of the derivatives [71]. The approach with the direct calculation of *λ* with the two required starting points *λ*_{0} and *λ*_{−1} is formulated:

Counter *i* starts from *i* − 1 and goes to *n* + 1 in which *λ*_{n} = *λ*_{n+1}.

The approach through the transmission factor x is as follows:

As already described, counter *i* also starts from i − 1 and goes to *n* + 1 in which *x*_{n} = *x*_{n+1}.

The flow friction factor *λ* is calculated in Tables 8 and 9 for two pairs of the Reynolds number and the relative roughness (1) Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5}, and (2) Re = 3·10^{4}, *ε*/*D* = 9·10^{−3}, using the secant procedure with direct calculation of *λ* and indirect through the transmission factor *x*.

Calculation using the secant procedure also confirms that the indirect calculation of *λ* through the transmission factor *x* requires in general less number of iterations to reach the same level of accuracy. In the case from Tables 8 and 9, the required number of iterations is 6 in direct calculation and 5 in indirect for Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5}, and the required number of iterations is 4 in direct calculation and 3 in indirect for Re = 3·10^{4}, *ε*/*D* = 9·10^{−3}.

##### 3.4. Three-Point Methods

Three-point iterative methods require in every iteration an evaluation of the function *f* at three points: *x*_{0}, *y*_{0}, and *z*_{0}. However, these methods converge very fast to the accurate solution. The mathematical background of the three-point iterative methods is given by Sharma and Arora [28]. Here, we will apply the Džunić–Petković–Petković three-point iterative method to the Colebrook equation [26, 28]. It requires only one iteration (up to 2 in the worst cases) to reach the final accurate solution and we will show all steps to calculate the friction factor *λ*, Equation (20), where the numerical values are for Re = 5·10^{6}, *ε*/*D* = 2.5·10^{−5}. The initial starting point is *x*_{0} = 7.273124147 as described in Section 2.2.3.

Three-point methods are also shown in detail in Praks and Brkić [75].

##### 3.5. Expressed through the Lambert W-Function

The mathematical background of the Lambert W-function is presented in the literature [44–46]. Moreover, an application of the Lambert W-function in hydraulic problems is given by [41, 54, 73].

The Lambert W-function *W*(*y*) [46] is the solution of , which needs to be in the appropriate form:

The first derivative *f′*(*z*) is as follows:

Choose initial value *z*_{0}, calculate the residue *f*/*f′*, and start the procedure:

Then follow the procedure *z*_{i+1} = z_{i} − *f*(*z*_{i})/*f′*(*z*_{i}) until the residue *f*(*z*_{i})/*f′*(*z*_{i})≈0, where *n* = *i* + 1 in final iteration.

Halley’s procedure:

where the second derivative is

The Schröder expression is as follows:

Further, in all cases, the Newton–Raphson, the Halley, and the Schröder; *z*_{1} = *z*_{i+1} and *z*_{0} = *z*_{i}; *i* = 0 to *n*, where *n* + 1 is final iteration in which *z*_{n} ≈ *z*_{n+1}.

The argument of the Lambert W-function *y*, in our case defined by Equation (3), is *y* = Re/2.18. Therefore, it does not depend on the relative roughness *ε*/*D* but only on the Reynolds number Re. In Table 10, *z* is calculated in the iterative procedure using the Newton–Raphson and the Halley method for Re = 5·10^{6} and Re = 3·10^{4} where initial starting point is set as *z*_{0} = 15 as recommended in Section 2.3 of this paper (for *z*_{0} < 8.814, the Newton–Raphson procedure cannot start).

#### 4. Approximations: Simplified Equations for Engineering Practice

Using the optimal fixed initial starting point for the Halley and the Schröder method as explained in Section 2.2.2, the first iteration of the procedures from Section 3.2.2, the simplification using the fact that the first derivative of the Colebrook function is almost always near one, *f′* ≈ 1, and using acceleration through Equation (28) [76, 77], the following approximations, Equation (27), can be formed. Using Equation (27), the maximal relative error in the domain of applicability of the Colebrook equation is 8.29% (Figure 6), and using acceleration Equation (28), that is, single fixed-point iterative method [12], the maximal relative error is 0.69% (Figure 7), 0.0617% (Figure 8), etc.

Then, *λ*_{0} from Equation (27) is used in

where *A*, *B*, and *C* arewhere

The shown procedure is efficient and does not require extensive computing resources since the accuracy of more than 0.69% can be reached using only two logarithmic forms, while very high accuracy of 0.0617% can be reached using only three logarithmic forms (in all cases, exponents are only whole numbers) [6, 8, 33].

The error analysis is in the domain of applicability of the Colebrook equation and can be further reduced using one more accelerating step as shown, genetic algorithms [31, 78, 79], Excel fitting tool [80], or Monte Carlo [81, 82].

Zigrang and Sylvester [77] used the similar approach. They use an iterative procedure to produce an approximation, Equation (31), where and represent internal iterative steps, while constant 13 in is fixed starting point. Shacham [83] used the same approach, but he set the fixed starting point as 14.5, while [31] also optimized that parameter which makes clear that it does not to be fixed.

Equation (31) includes three logarithmic forms and produces the maximal relative error of 0.114%. The same approach is used by Schorle et al. [83]. However, although Equation (31) and also the here presented Equation (28) include three logarithmic forms, the maximal relative error of Equation (28) for *i* = 1 is only 0.0617%. Thus, the here presented approach reduced the maximal relative error of the three logarithmic form approximation by factor 0.114/0.0617∼1.8.

#### 5. Conclusions

The paper presents a fast but reliable approximations and iterative methods for pipeline hydraulics, useful for the reliable modelling of water and gas distribution networks where a large number of network simulations of random component failures and their combinations need to be automatically evaluated and statistically analyzed [84–89]. Accurate, fast, and reliable estimation of the flow friction factor is essential for the evaluation of pressure drops and flows in large network of pipes, because, for example, compression station failures can be only approximated in the transmission level by user-defined logic rules obtained from hydraulic software [81, 82, 90–92]. Iterative solutions and approximations for the calculation of the flow friction factor are implemented in software packages which are in common use in everyday engineering practice [88]. So in this paper, we analyzed selected iterative procedures in order to solve the Colebrook equation [93, 94], and we found that up 2 to 3 iterations of the Halley and the Schröder method are suitable for the accuracy required by engineering practice, when the fixed initial starting point described in Section 2.2.2 is applied. On the other hand, using a three-point iterative method with the same initial conditions, the required high accuracy can be reached after only 1 iteration (2 in the worst case) but using three internal steps [26–28].

Moreover, for implementing simplified engineering calculations, we recommend taking into consideration the following:(1)The indirect calculation of *λ* through the transmission factor *x* in most cases accelerates the iterative procedures.(2)Knowing that the Colebrook equation is used in engineering practice only in the limited domain of the Reynolds number Re between 4000 and 10^{8}, and for relative roughness of inner pipe surface *ε*/*D* up to 0.05, we evaluated the number of iterations required to reach sufficient accuracy. We detected zones of input parameters, in which iterative methods converge slowly, and thus, additional number of iterations is required. Therefore, we put the fixed initial point to start the iterative procedure in those zones in order to decrease the number of required iterations.(3)Using the simplified Halley and the simplified Schröder procedure with the fixed starting point, after only one iteration, one can reach results with good accuracy (error up to 8.29%). This is near the accurate value, and therefore, the simplified Newton–Raphson method can be used from the second iteration to reach an accuracy of 0.69%. Moreover, one can reach an accuracy of 0.0617% using the third iteration. With the methods proposed herein, the first derivative of the Colebrook function is always near one, *f′*≈1 (for *f′ *⟶* *1, the Newton–Raphson method becomes the fixed-point method). Consequently, accuracy of 0.69% can be reached using only two logarithmic forms and of 0.0617% with only three logarithmic forms without requiring extensive computational efforts (the goal being to use the least possible number of logarithmic functions or functions with noninteger power) [6, 33]. Moreover, the computational cost of iterations can also be reduced by Padé polynomials [95, 96]. We also analyzed the Colebrook equation expressed through the Lambert W-function, and we found that the Halley and the Schröder method can be advised in comparison with the Newton–Raphson method (where the problem with the initial starting point exists).

The Colebrook equation is valid only for turbulent flow, while to include also laminar regime, different models should be used [98].

#### Data Availability

The data used to support the findings of this study are included within the article.

#### Disclosure

The views expressed are those of the authors and may not in any circumstances be regarded as stating an official position of the affiliated authors’ employers, European Commission, Alfatec, and VŠB–Technical University of Ostrava. The paper is registered within the European Commission system for publication Pubsy JRC112754.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

#### Authors’ Contributions

Pavel Praks and Dejan Brkić contributed equally to this study.

#### Acknowledgments

We thank Marcelo Masera for the careful reading of our manuscript and for his insightful comments and suggestions. The European Commission covers the Article Processing Charges to make this paper available to all interested parties through the gold open access model. Part of the research is from project iii44006 of the Ministry of Education, Science and Technological Development of the Republic of Serbia.

#### Supplementary Materials

For the purpose of easier use of the methods described in the manuscript, all used equations are listed in the Supplementary Materials. In that way, the readers who want to transpose the presented methods into software codes would have a list of all required formulas in one place and in a condensed manner.* (Supplementary Materials)*