scieee AI-readable full text Open interactive document viewer

Sampling the Darcy Friction Factor Using Halton, Hammersley, Sobol, and Korobov Sequences: Data Points from the Colebrook Relation

Brkić, Dejan; Milošević, Marko

Abstract

Journal article: https://doi.org/10.3390/data10110193 Datasets: https://doi.org/10.5281/zenodo.17280142

Full text

Academic Editor: André Bauer Received: 6 October 2025 Revised: 3 November 2025 Accepted: 12 November 2025 Published: 20 November 2025 Citation: Brki´c, D.; Miloševi´c, M. Sampling the Darcy Friction Factor Using Halton, Hammersley, Sobol, and Korobov Sequences: Data Points from the Colebrook Relation. Data 2025,10, 193. https://doi.org/10.3390/ data10110193 Copyright: © 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/ licenses/by/4.0/). Data Descriptor Sampling the Darcy Friction Factor Using Halton, Hammersley, Sobol, and Korobov Sequences: Data Points from the Colebrook Relation Dejan Brki´c 1,2,3,* and Marko Miloševi´c 1 1Faculty of Electronic Engineering, University of Niš, 18000 Niš, Serbia; [email protected] 2University of Belgrade, 11000 Beograd, Serbia 3IT4Innovations, VSB-Technical University of Ostrava, 708 00 Ostrava, Czech Republic *Correspondence: [email protected] or [email protected]cub.bg.ac.rs or [email protected] Abstract When the Colebrook equation is used in its original implicit form, the unknown pipe flow friction factor can only be obtained through time-consuming and computationally demanding iterative calculations. The empirical Colebrook equation relates the unknown Darcy friction factor to a known Reynolds number and a known relative roughness of a pipe’s inner surface. It is widely used in engineering. To simplify computations, a variety of explicit approximations have been developed, the accuracy of which must be carefully evaluated. For this purpose, this Data Descriptor gives a sufficient number of pipe flow friction factor values that are computed using a highly accurate iterative algorithm to solve the implicit Colebrook equation. These values serve as reference data, spanning the range relevant to engineering applications, and provide benchmarks for evaluating the accuracy of the approximations. The sampling points within the datasets are distributed in a way that minimizes gaps in the data. In this study, a Python Version v1 script was used to generate quasi-random samples, including Halton, Hammersley, Sobol, and deterministic lattice-based Korobov samples, which produce smaller gaps than purely random samples generated for comparison purposes. Using these sequences, a total of 2 20 = 1,048,576 data points were generated, and the corresponding datasets are provided in in the zenodo repositoryWhen a smaller subset of points is needed, the required number of initial points from these sequences can be used directly. Dataset: https://doi.org/10.5281/zenodo.17280142 Dataset License: CC-BY 4.0 Keywords: Colebrook formula; explicit approximations; Darcy friction factor; pipe liquid flow; Halton distribution; Hammersley distribution; Sobol distribution; Korobov distribution; Colebrook–White experiment; Moody chart 1. Summary The empirical Colebrook equation [ 1 ] is an implicit empirical relation for turbulent flow that relates the unknown Darcy friction factor λ to a known Reynolds number Re and a known relative roughness of a pipe’s inner surface ε /D. It is widely used in engineering. Its primary limitation is its implicit nature, which requires iterative numerical methods for solution rather than a direct analytical expression. To provide reliable reference values for Data 2025,10, 193 https://doi.org/10.3390/data10110193 Data 2025,10, 193 2 of 13 engineering applications, comprehensive datasets based on the Colebrook equation were generated and presented in this Data Descriptor. They are intended to serve as benchmarks for assessing the accuracy of numerous explicit approximations of the Colebrook equation and can also serve as a computational substitute for the Moody chart. These datasets cover the practically relevant parameter space encountered in engineering, spanning Reynolds numbers (Re) from 4000 to 108and relative pipe roughness values (ε/D) from 0 to 0.05. This Data Descriptor answers the following questions: 1. How were the data points generated? To obtain accurate values, a highly precise iterative solver of the Colebrook equation was applied. In this way, the datasets were generated by computing the unknown Darcy friction factor λ from a known Reynolds number Re and a known roughness of a pipe’s inner surface ε/D—(Re, ε/D)→λ. 2. How are the data points distributed? To minimize gaps in coverage, the data points were distributed using sampling methods. Specifically, Halton, Hammersley, Sobol, and Korobov sequences were employed. The Halton, Hammersley, and Sobol methods are quasi-random (low-discrepancy) techniques, while the Korobov method is a deterministic lattice-based approach. For each of these four sequences, 2 20 samples were generated, yielding 1,048,576 friction factor data points for each method. When a smaller subset of points is needed, the required number of initial points from these large sequences can be used directly. Appendix Aprovides a Python script that can be used to generate Halton, Hammersley, Sobol, and Korobov samples normalized for the Colebrook equation—{Sj→Re, Sk→ε/D}→λ. 2. Data Description 2.1. Generation of the Data Points The empirical Colebrook relation, given in Equation (1), dating from the 1930s [ 1 ], is widely accepted in engineering as an informal standard for calculating the flow friction factor in pipes: 1 √λ=−0.8686·ln2.51 Re ·1 √λ+1 3.71· ε D, (1) where λis the Darcy friction factor (dimensionless); Re is the Reynolds number (dimensionless); D is the inner diameter of a pipe (meters); ε/D is the relative roughness of a pipe’s inner surface (dimensionless); ln stands for natural logarithm. The Colebrook equation is based on an experiment performed by Colebrook and White [ 2 ] regarding the flow of a fluid through sets of pipes with different levels of roughness (starting from smooth). Unfortunately, the Colebrook equation is an implicit equation for the unknown friction factor λ , with λ appearing on both sides of the equals sign in a logarithmic form from which it cannot be extracted or transformed in explicit form without approximations (an exception is the Lambert W-function [ 3 – 8 ]—further evaluation of the Lambert W-function is also approximate but highly accurate when using various mathematical approaches to evaluate this function). Many such approximations have been developed, and they can be compared with respect to their accuracy and complexity [9–24]. Therefore, an iterative procedure, which can achieve practically any desired accuracy, is used in this Data Descriptor to compute the highly accurate values of the points employed in constructing the presented datasets available at https://doi.org/10.5281/ zenodo.17280142. The iterative solution, using recommendations from this Data Descriptor, Data 2025,10, 193 3 of 13 is treated as accurate, and therefore the Colebrook equation uses the sign ‘=’, while its approximations use ‘≈’. To start iterations, the initial step is estimated by omitting the 2.51 Re ·1 √λ term from Equation (1), yielding a reasonable initial guess, λ0, which is based only on the roughness of the inner surface of a pipe, ε , which is valid for a fully developed rough turbulent regime λ∞, as given in Equation (2): 1 √λ0 =1 √λ∞≈ −0.8686·ln1 3.71· ε D(2) The fixed-point iterative process [ 25 ] continues with the calculation of the values λ1 (a function of λ0 ), λ2 (a function of λ1 ), λi (a function of λi−1 ), ··· , λn (a function of λn−1 ) using Equation (1), where n typically ranges from a few iterations up to 100 iterations to reach an accuracy of 10 −9 (for highly accurate engineering applications, a precision of 10 −6 is sufficient). However, given the empirical nature of the Colebrook equation, an accuracy of about two significant digits is adequate for most calculations, while additional digits beyond that are essentially numerical noise. A limitation in accuracy can be noticed in cases where the roughness ε is very small (approaching zero) when the logarithm becomes problematic, leading to precision issues. Measurement and evaluation of pipe roughness also introduce a certain level of uncertainty [26,27]. The widely recognized Moody diagram [ 28 – 32 ] offers a graphical representation of the Colebrook relation. Instead of reading from the Moody diagram [ 33 , 34 ], datasets from https://doi.org/10.5281/zenodo.17280142 should be used. These data can also be used to redraw the Moody chart. Datasets similar to those given here, but with a uniform distribution (1000-by-1000 mesh), are available [35]. 2.2. Distributions of the Data Points The Colebrook equation involves two input parameters: the Reynolds number (Re) and relative roughness of a pipe’s inner surface ( ε /D). Therefore, a two-dimensional sequence of pairs (S j , S k ) is required as an input. Using Equation (3) [ 36 ], pairs (S j , S k ) , each between 0 and 1, are transformed into the Reynolds numbers Re (4000 < Re < 10 8 ) and relative roughness of a pipe’s inner surface, corresponding to 0 < ε /D < 0.05 (S j→ Re and Sk→ε/D). Rej=10Sj·(log10(108)−log10(4000))+log10(4000) ε/Dk=10−(Sk·(6.5−log10(1/0.05))+log10(1/0.05))), (3) where log10 denotes the base-10 (Briggs) logarithm. Figures 1–5show 2 8 = 256 data points, while Tables A1–A4 of Appendix Bshow the first 2 2 = 4 data points. The full datasets with 2 20 = 1,048,576 samples are available at https://doi.org/10.5281/zenodo.17280142. If a smaller dataset is required, one can be obtained by randomly selecting the desired number of data points by uniformly omitting points (e.g., every nth point), or, in some cases, by selecting the first portion of the data points when appropriate—always ensuring that no gaps in data coverage occur. In general, the first subset of points (e.g., 2 10 = 1024 from 2 20 = 1,048,576) generated by Halton, Hammersley, Sobol, and Korobov sequences can be used directly, as they already provide good spatial coverage; among them, the Sobol sequence typically yields the most uniform distribution, while the others exhibit only slightly lower uniformity. Halton, Hammersley, Sobol, and Korobov sequences were specifically chosen to generate the datasets provided at https://doi.org/10.5281/zenodo.17280142. These sequences Data 2025,10, 193 4 of 13 were employed to generate the points for the Colebrook dataset, ensuring thorough and reproducible coverage of the Reynolds number Re and relative roughness ε /D parameter space. Each method for sampling offers a different balance between uniformity, computational simplicity, and scalability. All are designed to generate well-distributed points in multidimensional space—being applied specifically to two-dimensional datasets for modeling purposes in this study. Unlike random distributions, quasi-random and deterministic lattice-based sequences provide coverage with minimized gaps and produce identical point arrangements across realizations, facilitating proper repetitions and reevaluations of computational experiments (in this Data Descriptor, the focus is on two-dimensional space—S i→ Re and S k→ε /D; the distribution of dots in random distribution changes as in Section 2.2.1, while that in Section 2.2.2 remains identical each time in each realization). Their practical value lies in generating well-distributed sampling points in multidimensional spaces; theoretical details on their construction are beyond the scope of this Data Descriptor. 2.2.1. Random Distributions The random distributions are inherently non-deterministic, resulting in different arrangements of data points across the spaces S 1 and S 2 in each realization (the distribution of dots from Figure 1will be different in each realization). This can cause certain problems regarding repetitions and reevaluations of the results of computational experiments. Figure 1. Random distribution. 2.2.2. Quasi-Random Distributions The Halton [ 37 – 40 ], Hammersley [ 40 , 41 ], and Sobol [ 42 – 47 ] methods are quasi-random (low-discrepancy) techniques designed to generate well-distributed points in multidimensional space—being applied specifically to two-dimensional datasets for modeling purposes in this case. •Halton Quasi-Random Distribution (Figure 2) The Halton sample is simple to implement; it provides good, uniform coverage in low-dimensional spaces such as those discussed here, where two dimensions are required (performance deteriorates beyond ~10 dimensions). Data 2025,10, 193 5 of 13 Figure 2. Halton quasi-random distributions. •Hammersley Quasi-Random Distribution (Figure 3) The Hammersley sample shows behavior similar to that of the Halton distribution, especially when a finite number of samples is predefined. Figure 3. Hammersley quasi-random distributions. •Sobol Quasi-Random Distribution (Figure 4) Sobol sequences can be extended dynamically, point by point, without losing uniformity. This characteristic makes them particularly well-suited for selecting a smaller subset of points from a larger dataset simply by truncating the sequence. Data 2025,10, 193 6 of 13 Figure 4. Sobol quasi-random distributions. 2.2.3. Deterministic Lattice-Based Korobov Distribution The Korobov sequence belongs to the broader family of lattice rules, which are based on modular arithmetic rather than randomization or discrepancy minimization in the quasi-Monte Carlo sense. The Korobov distribution generates structured, grid-like data distributions (which are less effective for non-periodic or irregular domains). While Korobov sequences can also produce evenly distributed points and are used for modeling similarly to quasi-random sequences, they are more accurately described as deterministic lattice-based or number-theoretic methods rather than quasi-random ones. They provide a compromise between uniformity and quasi-random sampling. Figure 5. Korobov deterministic lattice-based distribution. 3. Methods: Evaluation of Accuracy Using the Datasets The relative error δ%,jk of the evaluated explicit approximation of the Colebrook equation can be calculated using Equation (4): δ%,jk =λapr,jk −λjk λjk ×100%, (4) Data 2025,10, 193 7 of 13 where δ%,jk is the relative error (dimensionless); λapr is the Darcy friction factor (dimensionless) obtained from the observed approximation; λ is the accurate Darcy friction factor (dimensionless) derived from the datasets (available at https://doi.org/10.5281/zenodo.17280142); jk is the position of the accurate Darcy friction factor (dimensionless) with respect to the datasets from https://doi.org/10.5281/zenodo.17280142; || denotes the absolute value. Maximal relative error across 2 20 = 1,048,576 quasi-random samples from the datasets from https://doi.org/10.5281/zenodo.17280142 should be identified accordingly. Practical examples are given in Appendix C. Author Contributions: Conceptualization, D.B.; methodology, D.B.; software, M.M.; validation, D.B.; formal analysis, D.B.; investigation, D.B.; resources, D.B.; data curation, D.B.; writing—original draft preparation, D.B.; writing—review and editing, D.B.; visualization, D.B. and M.M.; supervision, D.B.; project administration, D.B. and M.M.; funding acquisition, D.B. and M.M. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported by the Ministry of Science, Technological Development, and Innovations of the Republic of Serbia under grant number 451-03-136/2025-03/200102 and by the European Union under the project “Increasing the resilience of power grids in the context of decarbonisation, decentralisation and sustainable socioeconomic development”, CZ.02.01.01/00/23_021/0008759 through the Operational Programme Johannes Amos Comenius. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: Data are contained within the article, and they are also available at https://doi.org/10.5281/zenodo.17280142. Conflicts of Interest: The authors declare no conflicts of interest. Appendix A import chaospy import math import csv import matplotlib.pyplot as plt import os def initial_guess_drop_term(eps): arg = eps/3.71 if arg <= 0: raise ValueError(“eps must be > 0”) inv_sqrt_f0 = -0.8686 * math.log(arg) if inv_sqrt_f0 <= 0: raise ValueError(“Computed 1/sqrt(f0) is non-positive (check eps).”) f0 = 1.0/(inv_sqrt_f0 * inv_sqrt_f0) return f0 def colebrook_refine(Re, eps, tol = 1e-9, max_iter = 100): if Re <= 0: raise ValueError(“Re must be > 0”) f = initial_guess_drop_term(eps) Data 2025,10, 193 8 of 13 for _ in range(max_iter): inv_sqrt_f = 1.0/math.sqrt(f) arg = (2.51/Re) * inv_sqrt_f + eps/3.71 if arg <= 0: raise ValueError(f“Non-positive argument to log: {arg}”) rhs = -0.8686 * math.log(arg) f_new = 1.0/(rhs * rhs) if abs(f_new - f) < tol: return f_new f = f_new raise RuntimeError(“Colebrook iteration did not converge”) def calc_Re(s1): return 10 ** (s1 * (math.log10(10 ** 8) - math.log10(4000)) + math.log10(4000)) def calc_eps(s2): return 10 ** (-(s2 * (6.5 - math.log10(1/0.05)) + math.log10(1/0.05))) def process_samples(samples, method_name): os.makedirs(method_name, exist_ok = True) csv_path = os.path.join(method_name, f“{method_name}_results.csv”) with open(csv_path, “w”, newline = ““) as csvfile: writer = csv.writer(csvfile) writer.writerow([“x”, “y”, “Re”, “epsilon”, “f0”]) for i in range(samples.shape[1]): s1, s2 = samples[:, i] Re = calc_Re(s1) eps = calc_eps(s2) f0 = colebrook_refine(Re, eps) writer.writerow([s1, s2, Re, eps, f0]) plt.scatter(*samples, s = 3, c = “red”) plt.title(method_name) plt.xlabel(“s1”) plt.ylabel(“s2”) plt.xlim(0, 1) plt.ylim(0, 1) plt.grid(True) plot_path = os.path.join(method_name, f“{method_name}_plot.png”) plt.savefig(plot_path, dpi = 300) plt.close() def main(): uniform_cube = chaospy.J(chaospy.Uniform(0, 1), chaospy.Uniform(0, 1)) Data 2025,10, 193 9 of 13 count = 2 ** 20 samples_dict = { “halton”: uniform_cube.sample(count, rule = “halton”), “hammersley”: uniform_cube.sample(count, rule = “hammersley”), “korobov”: uniform_cube.sample(count, rule = “korobov”), “sobol”: uniform_cube.sample(count, rule = “sobol”), } for method, samples in samples_dict.items(): process_samples(samples, method) if __name__ == “__main__”: main() Appendix B The first 2 2 = 4 data points of the Halton, Hammersley, and Sobol quasi-random sequences and the Korobov deterministic lattice-based sequence for the Colebrook equation are given in Tables A1–A4. Table A1. First 22= 4 data points of the Halton quasi-random sequence for the Colebrook equation. S1S2Re ε/D λ 0.125 0.444444444 14,184.12312 0.000244521 0.028646643 0.625 0.777777778 2,242,706.784 4.52 ×10−60.010356771 0.375 0.222222222 178,355.9058 0.003496579 0.027989349 0.875 0.555555556 28,200,544.83 6.47 ×10−50.011135324 Table A2. First 2 2 = 4 data points of the Hammersley quasi-random sequence for the Colebrook equation. S1S2Re ε/D λ 0.75 0.003891051 7,952,707.288 0.047724408 0.069941163 0.125 0.007782101 14,184.12312 0.045552382 0.07014454 0.625 0.011673152 2,242,706.784 0.043479209 0.067049409 0.375 0.015564202 178,355.9058 0.041500391 0.065798735 Table A3. First 22= 4 data points of the Sobol quasi-random sequence for the Colebrook equation. S1S2Re ε/D λ 0.5 0.5 632,455.532 0.000125743 0.014350582 0.75 0.25 7,952,707.288 0.002507422 0.024895569 0.25 0.75 50,297.33719 6.31 ×10−60.020886224 0.375 0.375 178,355.9058 0.000561508 0.019315882 Table A4. First 2 2 = 4 data points of the Korobov deterministic lattice-based sequence for the Colebrook equation. S1S2Re ε/D λ 0.003891051 0.249027237 4160.759355 0.002536792 0.041979229 0.007782101 0.498054475 4327.979604 0.000128706 0.039126016 0.011673152 0.747081712 4501.920406 6.53 ×10−60.038552156 0.015564202 0.996108949 4682.851862 3.31 ×10−70.038106614