## Appendix A. Note on sound speed and bulk modulus

As mentioned earlier, under some circumstances the factor $\unicode[STIX]{x1D708}$ given in (3.5) can be related to the speed of sound in fluids. Note, however, that this approximate interpretation, applied by Isermann (Reference Isermann1982) (see also Isermann (Reference Isermann1984) and White (Reference White1986)) when deriving the base model (2.1)–(2.2), is only suitable for ideal incompressible gas flows.

In general, using the Newton–Laplace formula (Wang *et al.* Reference Wang, Nilsson, Yang and Petit2017) with the bulk modulus $K$, the velocity of sound in fluids can be given as

For all fluids the isentropic bulk modulus $K$ can be defined as (White Reference White1986)

which used in (A 1) leads to

To simplify the discussion below, let us focus on the expression $\unicode[STIX]{x2202}p/\unicode[STIX]{x2202}\unicode[STIX]{x1D70C}$, separately for gases and liquids.

### A.1 Gaseous media

At high temperatures and low pressures, all gases comply with the perfect gas law (White Reference White1986), using the universal gas constant $R$:

Assuming that $R$ and $T$ are approximately constant and independent of density and pressure, we can determine the derivative

According to (A 4), $RT=p/\unicode[STIX]{x1D70C}$, and we can conclude that the following approximation applies: $\unicode[STIX]{x2202}p/\unicode[STIX]{x2202}\unicode[STIX]{x1D70C}\approx p/\unicode[STIX]{x1D70C}$. It can thus be seen that for gases at low pressure and high temperatures the following approximate rule applies:

Another way to justify approximation (A 6) is based on the definition of the bulk modulus using a heat capacity factor $\unicode[STIX]{x1D6FE}$:

For perfect gases in isothermal conditions $\unicode[STIX]{x1D6FE}=1$, whereas in general $\unicode[STIX]{x1D6FE}$ is greater than 1. What is more, the bulk modulus used in (A 1) to calculate the ‘sound velocity’ occurs under the square root function, so the $\unicode[STIX]{x1D6FE}\cong 1$ effect is additionally suppressed, which means we can write the following:

which also leads to the previously determined approximation

Both methods, in the case of the isothermal and incompressible flow of gases, lead to the speed of sound (3.5) in gaseous media. In general, however, the coefficient $\unicode[STIX]{x1D708}$ can only be treated as a surrogate of sound speed; it is expressed in units of speed, but should not be identified with the speed of sound in fluids.

Note that the approximate equality $p/\unicode[STIX]{x1D70C}=\unicode[STIX]{x2202}p/\unicode[STIX]{x2202}\unicode[STIX]{x1D70C}$ is a special case of the Clairaut equation, with the linear solution $p(\unicode[STIX]{x1D70C})=C\unicode[STIX]{x1D70C}$ for the constant $C=RT$ (see (A 4) or White (Reference White1986)), which can be referred to a gas phase characteristic of relatively low pressure and relatively high temperature (relative to a critical point). Then it is certain that the pressure changes linearly with the density, $p/\unicode[STIX]{x1D70C}=C$, and also $\unicode[STIX]{x2202}p/\unicode[STIX]{x2202}\unicode[STIX]{x1D70C}=C$. In addition, in the general case of monotonic relationships in a vicinity of zero, the high pressure-to-density ratio ($p/\unicode[STIX]{x1D70C}$) also produces a large derivative there. It is instructive to see that at low pressure in the range of 1–100 bar the ratio $p/\unicode[STIX]{x1D70C}$ is about $10^{5}{-}10^{7}~(\text{m}^{2}~\text{s}^{-2})$, while $\unicode[STIX]{x2202}p/\unicode[STIX]{x2202}\unicode[STIX]{x1D70C}$ (square of actual sound velocity) is also in a similar range of $10^{4}{-}10^{6}~(\text{m}^{2}~\text{s}^{-2})$.

## Appendix B. Note on compressibility

In general, the assumption of incompressibility of the analysed experimental case is associated with a practical limitation imposed on the flow velocity, for instance. According to White (Reference White1986), the flow is considered incompressible if the Mach number is less than 0.3. Note that this boundary is not the exact point at which fluid behaviour drastically changes its nature, but rather a rational, practice-based indicator that allows one to distinguish when to use the appropriate model (this value is also approximate: for example Durst (Reference Durst2008) sets it to 0.2). Therefore, one has to take into account that there are cases when an incompressible fluid appears to be weakly compressible.

It is interesting to compare the model (3.6) in the following rearranged form:

with the isothermal stationary compressible flow equation (White Reference White1986):

where $G=\unicode[STIX]{x1D70C}u$. The difference between these two equations is in the expression $2\ln (\unicode[STIX]{x1D709})$. For $\unicode[STIX]{x1D709}$ located in a small vicinity of 1, the logarithm is close to 0. On the other hand, as the pressure factor increases, this term becomes more significant (in relation to $\unicode[STIX]{x1D706}(L/D)$); it thus cannot be ignored, and one should consider compressibility effects. Furthermore, when we use the Taylor series expansion for this logarithm expression, whose centre is $\unicode[STIX]{x1D709}=1$, i.e. $2\ln (\unicode[STIX]{x1D709})\approx (\unicode[STIX]{x1D709}-1)+R(\unicode[STIX]{x1D709})$, after cutting the remainder $R(.)$, we get an easy-to-analyse form:

To sum up: when $\unicode[STIX]{x1D709}$ approaches 1, this expression can be omitted, but as $\unicode[STIX]{x1D709}$ increases, it becomes significant, and the flow should be considered compressible.

Note that figures 1–6 relate to various fluids, but not without restrictions. They are, for example, theoretical in the sense that not all of their scope (domain) is appropriate for the incompressible flow under consideration.

To get a quantitative view on the issue of the limiting pressure ratio differentiating incompressible from compressible flow, let us consider two cases of pipelines, for gas and liquid. To see the difference, in both cases the average velocity will be calculated using both equations, for the incompressible fluid (3.12), with the mean pressure calculated using the PM, and the compressible fluid (B 2), respectively.

Certainly, these calculations are rough, and therefore the results are also approximate. In both cases, the mean pressure will be calculated using the integral average (3.11). For simplicity, it is assumed that there is atmospheric pressure at the outlet: $p_{o}=1$ bar.

### B.1 Gaseous media

For gaseous media, we use the following parameters related to the flow of compressed natural gas through a relatively short pipe: $\unicode[STIX]{x1D70C}=0.8~(\text{kg}~\text{m}^{-3})$, $L=100~(\text{m})$, $D=0.2~(\text{m})$, $\unicode[STIX]{x1D706}=0.03$, $\unicode[STIX]{x1D708}=300~(\text{m}~\text{s}^{-1})$ (sound speed is only used here to calculate the Mach number). In this experimental setting, the Mach number is 0.3 at $\unicode[STIX]{x1D709}=p_{i}/p_{o}=2.16$, when using the compressible flow equation, while the incompressible formula results in $\unicode[STIX]{x1D709}=2.07$.

For the same fluid we can simulate flow through a long pipe characterized by the following parameters: $L=100~(\text{km})$, $D=1~(\text{m})$, $\unicode[STIX]{x1D706}=0.03$. In this experimental setting, the Mach number equal to 0.3 is obtained at $\unicode[STIX]{x1D709}=p_{i}/p_{o}=132.6$ based on compressible flow, and at $\unicode[STIX]{x1D709}=132.1$ while using incompressible flow. It is worth noting that the above simple analysis does not take into account the change in density or speed of sound due to the increase in pressure, and that the obtained critical pressure ratios are similarly high.

### B.2 Liquid media

The above examples of long and short pipes can also be converted for liquid media.

Let us first consider the example of a short pipe for the transport of liquefied natural gas characterized by the following parameters: $\unicode[STIX]{x1D70C}=468~(\text{kg}~\text{m}^{-3})$, $L=100~(\text{m})$, $D=0.2~(\text{m})$, $\unicode[STIX]{x1D706}=0.03$, $\unicode[STIX]{x1D708}=920~(\text{m}~\text{s}^{-1})$ (again, the speed of sound is used here only to calculate the Mach number). For this experimental setting, the critical pressure ratio causing the Mach number to be 0.3 is enormous: $\unicode[STIX]{x1D709}=3568$ and $\unicode[STIX]{x1D709}=3575$ for incompressible and compressible flows, respectively.

In the case of a long pipe with parameters $L=100~(\text{km})$, $D=1~(\text{m})$, $\unicode[STIX]{x1D706}=0.03$, the Mach number is 0.3 only at the unusually huge $\unicode[STIX]{x1D709}\cong 700\,000$ for both equations (the difference between the corresponding high ratios is practically insignificant).

The above cases show that for liquids or long pipelines, the pressure ratio would have to be very high to fall within the compressibility range. In turn, for gases and short pipes, the flow becomes compressible at a relatively low pressure ratio. This analysis is approximate, but shows the difference between liquid and gaseous media in terms of compressibility. It can also be seen that the difference between the cases of long and short pipes is due to the factor $\unicode[STIX]{x1D706}(L/D)$, which is one of the main determinants of whether a pipe can be considered long or not. Another factor affecting critical $\unicode[STIX]{x1D709}$ is the ratio of density to mean pressure.

## References

Adiutori, E.2009 Why the fluid friction factor should be abandoned, and the moody chart transformed. Open Mech. Engng J. 3, 43–48.

Billmann, L. & Isermann, R.1987 Leak detection methods for pipelines. Automatica 23 (3), 381–385.

Brkić, D.2011 Review of explicit approximations to the colebrook relation for flow friction. J. Petrol. Sci. Engng 77 (1), 34–48.

Brown, G. O.2003 The history of the Darcy–Weisbach equation for pipe flow resistance. In Environmental and Water Resources History, pp. 34–43. American Society of Civil Engineers.

Colebrook, C. F.1939 Turbulent flow in pipes, with particular reference to the transition region between the smooth and rough pipe laws. J. Inst. Civil Engrs Lond. 11 (4), 133–156.

Durst, F.2008 Stationary, One-Dimensional Fluid Flows of Incompressible, Viscous Fluids. Springer.

Espinoza-Moreno, G., Begovich, O. & Sanchez-Torres, J.2014 Real time leak detection and isolation in pipelines: a comparison between sliding mode observer and algebraic steady state method. In 2014 World Automation Congress (WAC), pp. 748–753. IEEE.

Garcia, J., Leon, B. & Begovich, O.2009 Validation of a semiphysical pipeline model for multi-leak diagnosis spurposes. In Proceedings of the 20th IASTED International Conference. ACTA Press.

Genić, S., Arandjelović, I., Kolendić, P., Jarić, M., Budimir, N. & Genić, V.2011 A review of explicit approximations of Colebrook’s equation. FME Trans. 39 (2), 67–71.

Haaland, S. E.1983 Simple and explicit formulas for the friction factor in turbulent pipe flow. J. Fluids Engng 105 (1), 89.

Isermann, R.1982 Process fault detection based on modeling and estimation methods. In IFAC Proceedings, Vol. 15 (4), 6th IFAC Symposium on Identification and System Parameter Estimation, Washington USA, 7–11 June, pp. 7–30. Elsevier.

Isermann, R.1984 Process fault detection based on modeling and estimation methods – a survey. Automatica 20 (4), 387–404.

Kayode Coker, A.2007 Fluid flow. In Ludwig’s Applied Process Design for Chemical and Petrochemical Plants, 4th edn. (ed. Kayode Coker, A.), pp. 133–302. Gulf Professional Publishing.

Kowalczuk, Z. & Gunawickrama, K.2004 Detecting and locating leaks in transmission pipelines. In Fault Diagnosis, pp. 821–864. Springer.

Kowalczuk, Z. & Tatara, M.2018 Analytical steady-state model of the pipeline flow process. In 2018 23rd International Conference on Methods Models in Automation Robotics (MMAR), pp. 182–187. IEEE.

McAllister, E. W.2013 Pipeline Rules of Thumb Handbook: A Manual of Quick, Accurate Solutions to Everyday Pipeline Engineering Problems. Elsevier Science.

McGovern, J.2011 Technical note: friction factordiagrams for pipe flow. *Tech. Rep.* Dublin Institute of Technology.

Moody, L. F.1944 Friction factors for pipe flow. Trans. ASME 66, 671–684.

Navarro, A., Begovich, O., Sánchez, J. & Besancon, G.2017 Real-time leak isolation based on state estimation with fitting loss coefficient calibration in a plastic pipeline. Asian J. Control 19 (1), 255–265.

Reynolds, O.1883 An experimental investigation of the circumstances which determine whether the motion of water shall be direct or sinuous, and of the law of resistance in parallel channels. Phil. Trans. R. Soc. Lond. A 174 (XXIX), 935–982.

Romeo, E., Royo, C. & Monzón, A.2002 Improved explicit equations for estimation of the friction factor in rough and smooth pipes. Chem. Engng J. 86 (3), 369–374.

Swamee, P. & Jain, A. K.1976 Explicit eqations for pipe-flow problems. ASCE J. Hydraul. Div. 102, 657–664.

Torres, L., Besancon, G., Navarro, A., Begovich, O. & Georges, D.2011 Examples of pipeline monitoring with nonlinear observers and real-data validation. In 8th International IEEE Multi-Conference on Systems, Signals and Devices, p. s/n. Sousse, Tunisia. IEEE.

Wang, C., Nilsson, H., Yang, J. & Petit, O.2017 1D3D coupling for hydraulic system transient simulations. Comput. Phys. Commun. 210, 1–9.

White, F. M.1986 Fluid Mechanics. McGraw-Hill Ryerson.