1. Introduction
Pipelines are one of the most economical means of transporting liquids. They are widely used to carry water, fuels, and other substances in the process industries. Pipeline monitoring generally consists of measuring pressures and flow rates at some strategic points in the pipeline, frequently including the ends of the line. The changes in the hydraulic variables, mainly the pressures, make it possible to identify disturbances and faults in the system, e.g., blockages and leaks, as well as the implementation of control loops that allow regulating or changing the operating point [
1]. Since many of the diagnosis/control algorithms are based on a mathematical model of the hydraulic system, fine-tuning such algorithms requires precise knowledge of their parameters [
2,
3]. For example, to diagnose leaks through pressure variations, it is essential to know how much pressure variation is caused by a reasonable pressure drop due to friction in the pipeline, which is only possible if the roughness and head loss coefficients of the pipe are known [
4,
5].
The Colebrook–White equation is the primary reference for calculating the friction factor in pressurized pipes. Since there are no known explicit solutions to this nonlinear equation in terms of elementary functions, many works have focused on studying its numerical solution [
6,
7] or by proposing different explicit approaches with varying degrees of accuracy [
8,
9,
10,
11,
12].
Since many pipelines operate with turbulent flow, most publications focus on the study of friction for this regime. However, there are some works in which explicit formulas have been proposed to calculate the friction factor for the three regimes: laminar, transitional, and turbulent, considering both smooth and rough pipes [
13]. There are also works where only friction in smooth pipes is studied, neglecting the roughness [
14], and others where pipes with ribs are considered [
15].
Then, by considering the importance of friction in head losses, it could be said that the reports on the investigation of physical measurements and mathematical modeling of pipe roughness are scarce in the technical literature [
16]. Direct measurement of roughness is not a simple process. However, current developments in profilometry and surface engineering have achieved accurate measures of a pipe’s internal roughness, but only in a laboratory setting, usually with new pipes. In this way, Farshad and Pesecreta evaluated the roughness of different pipes’ rough surfaces using linear surface profilometers [
17]. However, Kang and Lansey point out that, in practice, the roughness of the pipe cannot be measured in the field, so it must be estimated indirectly [
18]. In this context, the research in [
19] addresses the estimation of roughness in a straight water supply pipe from flow measurements and head losses measured by piezometric pipes. Since the experimental pipe they used in this work is approximately straight, the minor head losses due to the fittings were not considered.
The works above focus on calculating the friction factor, which is the critical element in determining head losses in long-distance pipelines. Fittings and valves contribute very little to the total pressure drop in the pipeline. Therefore, in such cases, pressure losses through fittings, valves, and other restrictions are generally classified as “minor losses” and are neglected. However, in shorter pipelines, the pressure loss in valves, fittings, etc., can be a substantial part of the total pressure loss, so these must be included for correct engineering calculations [
16]. Therefore, it is necessary to know the head loss coefficients (for local losses, accessories, and valves), and the roughness coefficients related to friction (for distributed losses, in the entire pipeline).
During the design of the piping system, it may be sufficient to know the nominal value of the roughness and head loss coefficients provided by the manufacturer. The calculations consider a safety factor that guarantees the operation of the system with an oversized pumping power [
17]. However, during system operation, the implementation of model-based monitoring and diagnosis algorithms require an accurate estimate of both roughness and head loss coefficients. It should be considered that, even under the same pumping pressure, the head losses change over time because, with continuous use, the pipelines show natural wear and aging. Particles can also accumulate on the pipe walls, changing the roughness and effective diameter of the pipes [
18,
19]. Therefore, a periodic recalibration is necessary to update the parameter values.
Recently, in [
20], both major losses (due to roughness) and minor losses (due to fittings) are independently studied. However, as will be explained in
Section 3, when these are calculated separately, a small overestimate in one of them leads to an overestimate in the other one, and vice versa. This article proposes a procedure to simultaneously estimate the roughness and minor loss coefficients in a pipeline based on these considerations. The proposed calculation requires some measurements of flow and pressure at the pipeline ends.
This work’s main contribution is the simultaneous computation of the coefficients of both components of the pressure loss: the major losses associated with roughness and the minor losses related to the fittings in the pipeline. In this proposal, it is possible to jointly estimate both coefficients assuming the minor losses as equivalent pipe lengths and looking for the coefficients that minimize the fitting error in the Colebrook–White equation. In order to demonstrate the applicability of the proposed technique, a series of tests on a prototype pipeline is described.
2. Background on Turbulent Flow in Pipelines
There is a general assumption that the head loss (
) due to friction depends on the inner diameter (
D) of the pipe, the length
in which the head loss is measured, the average flow velocity (
V), the absolute roughness of the pipe wall (
), the gravity acceleration (
g), and the density and the viscosity of the fluid. Through force balance and dimensional analysis, it is possible to determine the head losses due to friction as [
21,
22]:
where
is the Reynolds number, which measures flow turbulence as a function of viscosity and velocity, and
is the so-called relative roughness coefficient. The expression
in (
1) is the “friction factor”, and is abbreviated hereinafter with the shortcut
. In this way, Equation (
1) is represented in the following simplified form called the Darcy–Weisbach equation [
21,
23]:
where
Q is the volumetric flow rate in the pipeline. Compared to other formulas for calculating friction losses, Equation (
2) has the advantage of being a dimensionally homogeneous equation, so that the friction factor
f is a dimensionless number consistent with any system of units [
21]. There are works where some variants of the Darcy–Weisbach equation are considered. For example, [
24] suggests an improvement in the calculation of the friction factor by assuming a periodicity of the roughness in the longitudinal direction of the pipe. However, in this work only the classical form (
2) is considered.
In general, the friction factor depends on the flow turbulence (measured with Re) and also on the physical characteristics of the pipe (diameter and roughness of the interior walls). However, when the flow is laminar, at low velocity, the friction factor depends only on the Reynolds number, and is given by for . Instead, at high speeds where the flow is turbulent (), the friction factor also depends on the roughness of the pipe walls. In the interval, , after the laminar regime and before the turbulent regime, the values of the friction factor are not very predictable. Therefore this transitional regime will not be considered in this work.
One of the most widely accepted models for expressing the relationship between friction, turbulence, and roughness in pressurized flows is the Colebrook–White equation:
where the Reynolds number given by
measures flow turbulence in terms of kinematic viscosity
and flow rate
Q, while the friction factor
is expressed in terms of the head loss
(
) along the pipe.
Explicit solutions for
f of the DW equation using elementary functions are not known, because due to their nonlinearity, it is impossible to isolate
f in terms of
and Re. However, it is possible to find approximate solutions using iterative numerical methods. For this, the DW equation is rewritten as:
The problem is then reduced to iteratively find the zero of
or, equivalently, the minimum of
.
Figure 1 shows the numerical solution of (
6) obtained using the C
olebrook MATLAB-routine, which can be consulted in [
20]. It is also possible to estimate the solution of the CW equation, with different percentages of error, using explicit non-iterative approximations, such as those proposed by [
25,
26,
27], among others. The surface plot in
Figure 1 shows the general behavior that friction factor increases with roughness and decreases with the Reynolds number. However, for high turbulence (very large Re) the friction factor depends only on the roughness.
On the other hand, in addition to the pressure losses due to friction, which are distributed throughout the pipeline, the pressure losses due to flow disturbance caused by elbows, valves, and other fittings must be quantified. These are not distributed losses, but rather local losses that can be located in a well-defined position. Head losses due to singularities or fittings are commonly called “minor losses” because, for very long pipes, their value can be neglected compared to that due to friction. However, their effect can be significant for short pipes [
28].
Equation (
2) only predicts major losses due to fluid friction on the pipe wall and due to the effects of fluid viscosity and does not include minor losses on inputs, elbows, and other fittings. Minor losses in accessories are defined in terms of a loss coefficient
K, by
which has some similarity with Equation (
2) used for friction losses. There are some empirical formulas to estimate the minor loss coefficient (
K) for valves, elbows, and other fittings [
16]. In practice, the values obtained in this way can differ considerably from the true values, so it is convenient to determine them experimentally. For example, for 90° elbows, the minor loss coefficient is typically in the interval
, according to [
29]; on the other hand, in [
16] it is suggested to use the empirical formula
, where
is the turbulent friction factor. In general, the minor loss coefficient is a function of both the fitting geometry and the Reynolds number. However, when
is large enough,
K can be assumed as a function of the fitting geometry only.
Given the similarity between Equations (
2) and (
7), in some applications it has been proposed to combine distributed losses with local losses, expressing the latter as if they were friction losses in an additional length of pipe. The “equivalent length” of pipe associated with a local head loss is the length of pipe that would produce a friction head loss equal to the corresponding local head loss. By matching Equations (
2) and (
7), the equivalent length
can be obtained as
so, if the additional length of pipe that would equal the local losses is known, the minor loss coefficient is given by
The above equations are the basis for addressing the problem under study. Formally, the problem whose solution is proposed in the next section can be expressed as follows: “Given a list of flow-rate and pressure measurements at pipeline ends, find simultaneously the roughness coefficient and the minor loss coefficient K—as equivalent length—so that for the friction factor values obtained experimentally, via the Darcy–Weisbach equation, the fitting error in the Colebrook–White equation is minimized”.
3. Proposed Methodology
Consider the simultaneous estimation of the roughness coefficient and the minor loss coefficient. The strategy used to integrate the minor losses together with the friction (major losses) is to assume them as an additional length of pipe, so that the total length used in the calculations is a “computational length” that integrates both the physical length of the pipeline as the equivalent length of the fittings.
If the pipe length
L is assumed to be known, the friction factor
f can be determined by measuring the flow rate
Q and the head loss
between the pipeline ends and substituting these values (
5). Then, the roughness can be obtained by substituting
f in the nonlinear Equation (
3) and solving for
. However, when starting from an underestimated length, if the roughness is overestimated, then the pipeline appears to be rougher when its length is shortened for a given friction factor.
Additionally, in practice, the roughness
obtained by the numerical solution of (
3) is sensitive to variations in the computed value of
f due to measurement noise on
Q and
. Therefore, a single value of
does not completely satisfy (
3) for different measurements, even if they correspond to the same operating point. Consequently, for each measurement, the right side of (
3) is not exactly zero, but there is a residual or fitting error
. However, if we consider a length-dependent friction factor,
, it is possible to minimize the error
by adjusting the parameters
and
L in (
3). In this way, the Colebrook–White equation expresses the friction factor in terms of flow rate and head loss but is parameterized by the roughness coefficient and the total length of the pipeline.
Thus, for each value of flow rate and head loss (for each operating point), there is a fitting error
where
and
are calculated as specified in (
4) and (
5), using the flow rate and head loss measurements in the
k-th operating point.
Considering a nonlinear least squares optimization problem, with
N measurements (
), the optimal roughness and total length estimates have been defined as follows:
where
is the vector of fitting errors in the Colebrook–White equation. One way to solve the optimization problem (
11), the one proposed in this work, is through the Levenberg–Marquardt (LM) method [
30,
31].
In the context of curve fitting, the LM method, also known as the damped least squares (DLS) method, is formulated as follows: Given a set of
N pairs of empirical data
of independent and dependent variables, find the parameters
of the model
so that the sum of the squares of the deviations is minimized:
There is a correspondence between the optimization form (
12) and the problem of calculating the roughness and length in (
11), assuming the following equivalence:
In order to find the optimal value of
, the LM algorithm iterates from an initial approximation
. In each iteration, the parameter vector,
, is replaced by a new estimate,
. The increment
is calculated, according to [
32], by solving
where
is the Jacobian matrix,
,
, and
is a damping factor updated at each iteration. The iterations start with an empirical value
. Then if the sum in (
12) decreases fast, a smaller value
is used in the subsequent iteration. When the step size,
, or the decrease in the sum of squares for the last parameter vector,
, falls below predefined limits, the iteration stops, and the last parameter vector
is considered the solution. The box in
Figure 2 summarizes the complete calculation procedure.
The solution to the problem (
11), using the LM method as described in
Figure 2, was coded into a MATLAB subroutine. This subroutine, named Pipeline Parameter Calibration (
PPC), receives inlet and outlet pressures, flow rate, and viscosity measurements at each operating point of the pipeline, and returns the estimated optimal values for
and
L. The head loss coefficient
K can be obtained from the excess length of
over the straight length using (
9). In slightly turbulent flows, measurements should be taken over a small operating interval, because the minor loss coefficient could vary significantly between widely separated operating points. However, for completely turbulent flows the minor loss coefficient remains approximately constant. The range of
in the test measurements described in the next section corresponds to a sufficiently high turbulence.
4. Experimental Setup
The procedure described in the preceding section has been tested on a prototype serpentine-shaped pipeline [
33] (see
Figure 3). This experimental pipeline is part of the Hydroinformatics Laboratory of the National Institute of Technology of Mexico, located in Tuxtla Gutiérrez. This pipeline has a straight length of
and uses 90° elbows to give it a serpentine shape, as shown in
Figure 4. The flow is driven from a 2500
tank using a 5 hp centrifugal pump whose power is controlled by a frequency inverter. Pressure and flow sensors/transmitters are available at the pipeline ends. Although the prototype pipeline has two flow sensors, only one of them is used to obtain the flow-rate measurements required by the algorithm, because the measurements are made in a steady state with no leaks. There are no pressure sensors before and after each change in flow direction, so it is not possible to calculate the head loss on each direction change individually. In order to change the operating point of the pipeline, the frequency inverter was driven at the following working frequencies: 30
, 35
, 40
, 45
, 50
and 55
. Other parameters of the experimental pipeline used in calculations are
, and
.
Table 1 shows the first dataset containing the pressure and flow measurements used to estimate the roughness and equivalent length of the prototype pipe. The kinematic viscosity in the fourth column was calculated from the measured water temperature by spline interpolation using the NIST Standard Reference Data, according to [
34]. Pressure and flow measurements at each operating point were obtained by averaging the sensor signals over a time interval (1000 samples, corresponding to 10 s) to minimize the effect of measurement noise. In order to test the Algorithm of
Figure 2, five datasets with the same structure as
Table 1 were built, named
pipeline_data_1 :
pipeline_data_5. Each dataset contains measurements at six operating points within the typical working range in the prototype pipeline, limited by the available pumping power. In practice, in other pipelines, the measurements used should consider their specific operating region, provided that it corresponds to the turbulent regime because the Colebrook–White equation does not correctly represent the laminar and transitional regimes.
5. Results and Discussion
The box in
Figure 5 shows the result of running the PPC subroutine with the measurements reported in
Table 1. The best fit of the measurements to the Colebrook–White equation was obtained for a roughness coefficient
and a total length
. This result corresponds to an excess length of
, compared to the physical length, due to minor losses.
Figure 6 graphically shows the existence of the minimum, evidencing the behavior of the cost function in the neighborhood of the optimal estimate
. Starting from the initial approximation
, the LM procedure converges to the optimal value in eight iterations, when the norm of the increment,
, reaches the value of 5.1559 × 10
−9.
The PPC subroutine was run in each of the five available datasets; the results are summarized in
Table 2. It can be seen that the roughness estimate was more sensitive than the length estimate concerning the change in pressure and flow-rate measurements. This is evidenced by the fact that the roughness varies from the third significant digit between different datasets, while the length only varies from the fourth significant digit. More precisely, the root-mean-square deviation (RMSD) was 1.929 × 10
−6 (0.56%) for roughness, and
(0.04%) for length.
The variation in the results obtained with different datasets could be attributed, at least partially, to the measurement error of the sensors, which is between 0.01% and 0.04% (maximum) according to the manufacturer’s datasheets. This has the consequence that the computation of the friction factor, based on an inaccurate estimate of the roughness coefficient, is also inaccurate. Sensitivity analysis in the working region of the prototype pipeline showed that
where
can be taken approximately equal to the flow-rate measurement error,
, considering the relationship (
4). These results show that the friction factor calculation is considerably sensitive to flow measurement errors.
The final estimates of
and
L were obtained by averaging the estimates from the five experiments on the prototype pipeline, resulting in
and
. On the Moody chart in
Figure 7, the interval of the friction factor in the prototype pipeline has been represented in red, according to the calculated roughness coefficient. This can be considered as the “working region” of the pipeline. The solid orange line in
Figure 7 is the theoretical curve according to the estimated roughness
, while the discrete red points represent the specific values of
and
f obtained from the measurements (via Equations (
4) and (
5), respectively), confirming a good parameterization of the Colebrook–White equation to fit the data.
In the prototype pipeline, minor losses are primarily due to the elbows used to give it the serpentine shape, so that the equivalent length of each elbow is determined by
where
n is the number of elbows, and
is the true length, also termed “straight length” of the pipeline.
Finally, the minor loss coefficient for each elbow can be obtained from (
9). As noted in
Section 2, the
K values change slightly with the operating point. For example, for the fifth operating point in
Table 1 (corresponding to
) it was obtained:
These
K values obtained for the elbows of the prototype pipeline are close to those obtained with the empirical formula in [
16] and fall outside the interval suggested by [
29]. Due to the proximity between each elbows pair, it might be desirable to assign combined loss coefficients in pairs, since possibly the energy loss at the inlet elbow is different from the energy loss at the outlet elbow. In this case, the combined loss coefficient for each flow return,
, is twice that calculated by (
17), since the number of elbows doubles the number of return bends.