Skip to main content
14-Alexandrite
May 15, 2014
Solved

Is there a more efficient way to solve the Colebrook-White Equation?

  • May 15, 2014
  • 2 replies
  • 5102 views

Please see the attached MC Prime 3.0 worksheet (I also included a PDF copy for users of other versions of MC).

Introduction (for those who don't know the Colebrook White Equation)


The empirical Colebrook-White Equation (CW) is the standard way to estimate friction factors for use with the Darcy Equation for determining energy (head) loss in fluid flow. CW has three variables: the relative roughness (k), the Reynolds Number (NR), and the friction factor (f). The relative roughness describes the pipe condition, the Reynolds Number describes the fluid condition, and the friction factor is based on these two. CW is normally solved for f based on input values of k and NR. CW is implicit for f and requires an iterative solution.

Instead of interating CW, it is possible to use the Moody Diagram to find f. The Moody Diagram has NR as the independent varaible and f as the dependent variable. A family of curves, each based on a constant value of k is plotted in the turbulent flow region. Knowing k reduces the problem to just two variables, NR and f.

The Problem

I am working on plotting my own Moody Diagram in Mathcad. I have done this in Excel and CurveExpert Pro, but now I want to do it Mathcad. Also, I am comparing various explicit approximations to CW for accuracy (I have already completed the smooth pipe analysis for k=0). For both tasks, I need an efficient way to solve CW over the ranges of k and NR. For example, I have a data set consisting of 21 values for k and 45 values for NR, which gives me 945 data points for f in 21 cuves (in the attached worksheet, I reduced the data set for NR to 23).

As you can see in the attached worksheet, I was able to solve CW. However, I am looking for a more efficient and more elegant method. I tried various combinations of subscripts, vectorize operations, etc. both inside and outside the solve block, but this is the best I was able to do. Any suggestions would be greatly appreciated.

Best answer by Werner_E

If a 2D matrix is plotted the plot type in Prime 2 had to be set to waterfall plot explicitely to make it work the way we are used from older Mathcad. In Prime 3 waterfallplot is chosen automatically in that case.

2 replies

19-Tanzanite
May 15, 2014

How about the attached? In MC15 format I'm afraid as I don't have Prime 3.

Alan

Edit: Just realised that, if Prime 3 is like Prime 2, the 2D plotting won't be possible using the single friction factor variable in the way that is possible in MC15.

Werner_E25-Diamond IAnswer
25-Diamond I
May 15, 2014

If a 2D matrix is plotted the plot type in Prime 2 had to be set to waterfall plot explicitely to make it work the way we are used from older Mathcad. In Prime 3 waterfallplot is chosen automatically in that case.

25-Diamond I
May 15, 2014

Here is a bit late pretty much the same as Alan showed done in Prime with your data. MC15 plots just look better, though, and are much easier to format.

15.05.png

FredLusk14-AlexandriteAuthor
14-Alexandrite
May 15, 2014

Thanks, Werner. Now to apply this to the bigger worksheet I am working on.

25-Diamond I
May 15, 2014

You are welcome.

In case you want to retain the alternating colors in your plot, you may consider using a routine to split the matrix f accordingly.

15.05.png