2014-08-07 Update — In this update I include timing the calculation speed of each formula using an HP-41CX programmable scientific calculator. I also renamed a few variables and functions, modified the statistics a little based on subsequent comments by Harvey Henlsey, and made various other changes, corrections, and improvements. I also added a "Bang For The Buck" statistic that takes into account both accuracy and calculation speed. The attached .zip file contains two significantly updated worksheets (one for smooth pipe and one for rough pipe) and their PDF files plus the two previous worksheets (for historical reasons).
2014-05-23 Update — Harvey Henlsey posted some good comments on the copy of this epic that I posted in the MechEngr section and that prompted this update. I redefined S4 and I coordinated the secondary function definitions between GS1 and VK. I also added some more horizontal lines to the plots to make them easier to read.
This might be my Mathcad Magnum Opus…
In steady pipe flow, energy (head) loss due to friction is calculated using the Darcy-Weisbach Equation (DW). DW includes a dimensionless friction factor (f) to account for pipe and fluid conditions. Because friction factors must be determined experimentally, this introduces an empirical element into an otherwise rational formula. The two standard methods for finding the Darcy friction factor for turbulent flow are by solving the empirical and implicit (iterative) Colebrook-White Equation (CW) or by looking at the Moody Diagram (also empirical), which plots a family of CW curves to cover the turbulent flow region.
Because CW must be iterated, a cottage industry of sorts has developed that attempts to find explicit (direct solution) formulas that accurately approximate CW. The purpose of these expllicit approximation formulas (XAFs) is to match CW as closely as possible numerically, not to match hydraulic test results. CW itself is simply a good approximation of hydraulic test results from various researchers over the years. But, CW has long been considered the gold standard for hydraulic calculations and is thus worthy of this attention.
I have just completed a numerical evaluation of more than two dozen XAFs for the purpose of finding the most accurate formulas and the formulas that best balance accuracy and complexity. I am not the first person to make such an evaluation, nor will I be the last. However, my list of formulas is larger than most of the other evaluations I found on-line (primarily websites and published papers) and—as best I can tell—is the only one done in Mathcad.
I split my evaluation into two parts (and two worksheets), one for hydraulically smooth pipe and one for rough pipe. Separate treatment for the smooth pipe condition is warranted because many real-world applications approximate a smooth pipe, such as natural gas flow in HDPE pipe, and the smooth pipe versions of CW and the various XAFs are much simpler than the rough pipe versions. Even with this split, both worksheets are very long compared to my usual work.
The attached .zip file contains two Mathcad Prime 3.0 worsheets—one for hydraulically smooth pipe and one for rough pipe—and (for users of other versions of Mathcad) Adobe Acrobat .pdf files of these two worksheets. The worksheets include functions for each formula evaluated, simple statistical results and comparisons (including ranking by accuracy), and various related plots.
Great work! I had no idea there were so many explicit formulas for the friction factor. I think my new favorite will be Zigrang & Sylvester #2.
For your next assignment, wouldn't it be nice to see how some of these fit the original data used by Colebrook-White? I suppose the data are not in the public domain?
But if the data are available, then your final assignment, if you accept, is to refit the data using some of these formulas using genfit. In your spare time.
FYI, there is a minor problem that doesn't affect your results. In the Vatankhah & Kouchakzadeh (2008) formula, you define a mu function, but you actually use an identical sigma function from a previous method.
In a nitpicking manner, I would prefer that your S4 measure not have the absolute value operation. In this example, everything was okay but it seems there could be cases where the sum of the chi squares was greater than 1. This could lead to cases where S4 was the same for both a low error and a high error method. Without the absolute value, you can just say that lower, more negative values are better.
This is a great addition to the Community document library. Thanks.
Thanks, Harvey. Those are great comments. As you can see, I fixed the two problems you mentioned. I also added a few more horizontal lines to the graphs to make them easier to read.
I have seen flow data (e.g. Moody's 1944 paper), but I don't know if it's original or representative. I suspect original data can be found in some other published papers from back in the day. Rather than go back to the old data, though, the real thing to do next is to do my own experiments and come up with my own data. If only I owned a hydraulics lab.
I do plan a follow-up along the lines of Lipovka (my Reference . I want to time all of these formulas, then compare accuracy with calculation speed. My tool of choice will be my HP-41CX calculator, which has a built-in clock/stopwatch. Back in the day, I did a lot of subroutine timing to optimize calculator programs. Even though my daily driver is the newer HP-42S, my HP-41CX still works…it just needs new N-size batteries. Computers are so fast now, that function timing for computers is irrelevant for my purposes (it mattered to Lipovka). However, because calculators are relative slow devices, it is still relevant for my calculator programs.
BTW, Lipovka has at least one formula not included here and I didn't include Tsal as mentioned in the worksheets. This game is a bit like the Four Fours Game…there is no end to it. BTW, my contribution to the Four Fours Game is posted on Scribd: http://www.scribd.com/doc/81083786/The-Four-Fours-Game
Even though it's not a Mathcad worksheet, maybe I will post it under Puzzles and Games later.
You aroused my curiosity about the development of the Colebrook-White equation. It looks like they took the Prandtl-Karman formula for smooth pipes and the Karman-Nikuradse formula for rough pipes in highly turbulent flow (high Reynolds numbers) and combined them by summing the arguments of the log term.
The smooth pipe formula was developed from data on the radial velocity profile. This profile was then integrated across the pipe cross section to get the average velocity. Then, constants in this equation were further adjusted to fit pressure drop and flow rate data. This process resulted in the the 2.51 constant.
The Karman-Nikuradse formula was based on the data of Nikuradse for sand roughened pipes. Although data were obtained in the transition between low Reynolds numbers and high Reynolds numbers, the formula is for the fully turbulent, Reynolds number independent region. The 3.7 constant came from this step.
As said above, Colebrook and White created a single formula by summing the arguments of the log terms in both formulas. They did not sum the terms themselves. This step involved no curve fitting, because no constants were changed or added. Thus, it appears the Colebrook-White formula is backed by data only for the smooth pipe (all flows) and rough pipes at high flows. There is no reason to believe that the transitions shown by the CW formula are correct. Note that this means even the values at Reynolds = 4000 for the rough pipes can be incorrect when compared to data. In other words, the curved portion of all of the rough pipe curves are in question.
Therefore, a statistic that weights the chi square sum for the smooth pipe and the chi squares at the rough pipe high flow end points (summed over the k values) might be of more meaning. This might mean some of the simple methods are better than they now appear.
One caution: I haven't gone to the original CW paper to see if I'm right about the lack of fitting in the transition region. Possiby they tried different mathematical forms and chose the one that best fit in all regions. If so, was this a qualitative or statistical selection of method?
Names of formulas vary in the literature, so the names above may not be those that you use. You probably can figure out which formulas are being discussed, but let me know if you need clarification.
I created the new statistic based on the chi squared for the smooth pipe and the sum of the squared errors at the high N_Re end of the rough pipe curves. Ranking based on this statistic is almost identical to the original ranking based on S4. The biggest change was the EPT formula fell from 10th to 18th. All other rank values were within 3 of their original ranking, most with even less change.
I can't attach a file in this space, but I can open a new discussion and attach the file if you wish.
I found a good set of data for the transition and full turbulent regions using wrought iron pipe. The reference: Freeman, J.R., "Experiments Upon the Flow of Water in Pipe and Fittings", Am. Soc. Mech. Eng., 1941. The experiments were performed in 1892.
The wrought iron pipe appears to have a roughness value similar to carbon steel pipe. I computed that roughness using the CW equation and the highest flow data.
Using the computed relative roughness for each pipe size, I then computed f values at NRe of 4000 and 10000 using CW formula. The predictions agreed very well with the data. Thus, it appears that the CW formula does represent the behavior of commercial pipes in the transition region.
I do not know if the book Idel'cik-Memento-The-Loss-of-Charges may interest you.
Unfortunately this item is out of stock.
But you can see here:
I would be interested in seeing your work. The story you present matches what my textbooks and other references say. Moody's 1994 paper says something about 5%-10% errors between Colebrook-White (and the other formulas) and the data, which means that approximations within tiny fractions of a percent are meaningful mostly as an academic exercise.
I chose to split smooth and rough pipes because they are different conditions and the rough pipe formulas simplify for use with smooth pipes. I then chose a single chi-square for each case because I wanted one number to signify the overall accuracy of each formula for its full range of applicability. But, I also provided individual percent errors for smooth pipe and individual chi-squares for each relative roughness curve. With these results, I was able to make graphs that show where the approximating formulas are best and worst compared to Colebrook-White. I have found other evaluations (not all are listed in my worksheets (that use a variety of different statistics to judge accuracy. I chose simple, mostly because I'm lazy. Hard working, but lazy.
BTW, I am working on timing calculation speeds for the various formulas. It gave me a chance to break out my old HP-41CX calculator, which is the level of machine where this really matters (and it has a built-in stopwatch). I finished timing the smooth pipe formulas last night. I need to add some text about formula timing and add another graph or two. Then I will tackle the rough pipes. When all this is done, I will post updates.
I apologize for being incommuncado for several weeks. I've been out-of-town quite a bit lately and just haven't had time to get back to this…except for plodding along timing the functions which is now almost complete. I downloaded your file and will be looking at it this week (I hope).