Civil Engineers with Experience Using the Colebrook Equation? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Civil Engineers with Experience Using the Colebrook Equation? (/thread-16287.html) |
Civil Engineers with Experience Using the Colebrook Equation? - MNH - 02-05-2021 10:02 PM Colebrook Equation [attachment=9074] I read that an iteration of the Colebrook Equation will test the values of 'f' that will result in the difference between the two sides to be zero or very close to zero. Also, generally three to four iterations are sufficient to converge on a reasonably good value of the friction factor. How was this conclusion reached? I've never worked with iterations before. Will a Do-While loop work well? RE: Civil Engineers with Experience Using the Colebrook Equation? - Namir - 02-05-2021 10:37 PM Code: function fx(f,Re,e,Dh) RE: Civil Engineers with Experience Using the Colebrook Equation? - Namir - 02-05-2021 10:43 PM Wikipoedia shows several ways to solve the equation without using iterations. Click here. Namir RE: Civil Engineers with Experience Using the Colebrook Equation? - trojdor - 02-05-2021 10:56 PM Also, as the Colebrook–White Equation is iterative in nature, it's a perfect fit for the (numeric) equation solver found in most modern-ish calculators....should you not wish to write a program. RE: Civil Engineers with Experience Using the Colebrook Equation? - MNH - 02-06-2021 08:55 PM (02-05-2021 10:43 PM)Namir Wrote: Wikipoedia shows several ways to solve the equation without using iterations. I'm aware it can be done without using iterations. I was looking for an iterative approach, which you have shown me. Is that HP Prime code? Thanks for your help! RE: Civil Engineers with Experience Using the Colebrook Equation? - MNH - 02-06-2021 09:10 PM (02-05-2021 10:56 PM)trojdor Wrote: Also, as the Colebrook–White Equation is iterative in nature, it's a perfect fit for the (numeric) equation solver found in most modern-ish calculators....should you not wish to write a program. I'm aware of such a program, however I was looking for the algorithm behind it. Thanks for your help! RE: Civil Engineers with Experience Using the Colebrook Equation? - toml_12953 - 02-06-2021 10:14 PM (02-05-2021 10:37 PM)Namir Wrote: Code: input function parameter What is Dh? Is that the same as Dn? RE: Civil Engineers with Experience Using the Colebrook Equation? - C.Ret - 02-06-2021 11:58 PM Hello everyone What is missing here a good numerical example so that we can check assumptions or simply correctness of our computations. Yesterday rain has fall all the day along. To avoid overflow in the installations, I had to open the valve and let charged water (sea water with decomposed biologic depots and organic mood) to flow through the canalization line (diam. 120 mm old iron coated with concrete) into the second main emergency retention basin. After 3 hours, I close the valve and notice that nearly 150 m3 of moody water stand now in the reservoir. From your formulae, I calculate that the friction factor of the canalization is about 0.59 Is this correct ? May I suggest to my company head director to change the canalization and have easier or faster flow rate ? RE: Civil Engineers with Experience Using the Colebrook Equation? - paul0207 - 02-07-2021 01:00 AM This open access article lists a number of iterative methods and approximations: What Can Students Learn While Solving Colebrook’s Flow Friction Equation? https://www.mdpi.com/2311-5521/4/3/114 Paul RE: Civil Engineers with Experience Using the Colebrook Equation? - Fred Lusk - 02-07-2021 04:17 AM I am a civil engineer with more than 40 year's consulting experience. My experience is mostly municipal infrastructure, including a lot of modeling and design of water distribution systems. I don't use Darcy-Weisbach and Colebrook-White all that often, sticking mostly with Hazen-Williams and Manning's. When I do use Colebrook-White, I sometimes iterate (HP-41CX, HP-42S, DM-42, Excel, and Mathcad), but I mostly use an the explicit approximation equation. About two dozen explicit approximation equations have been published--some excellent, some good, some fair, and some poor--and I have my favorites. I have had a long-time interest in the explicit approximations since running across the Blasius Equation in college. Back in 2014, I published on the PTC Mathcad forums a very thorough analysis of the explicit approximation equations I had found. Here is a link to that post: https://community.ptc.com/t5/PTC-Mathcad/Lusk-Darcy-Friction-Factors-v2-zip/m-p/450068 . The attached .zip file includes .pdf files for those who don't have Mathcad. The two worksheets (one for smooth pipe approximations and one for everything else) also solve Colebrook-White using Mathcad's solver and it's that solution that forms the basis for comparing the explicit approximations. While the Mathcad solution won't necessarily be useful for programming a calculator, you may find the rest of the analysis useful for practical hydraulic calculations. RE: Civil Engineers with Experience Using the Colebrook Equation? - MNH - 02-07-2021 01:05 PM (02-07-2021 04:17 AM)Fred Lusk Wrote: While the Mathcad solution won't necessarily be useful for programming a calculator, you may find the rest of the analysis useful for practical hydraulic calculations. Programming a calculator is secondary to my interest in using an iterative approach in problem solving. It's my understanding that the goal of an iterative approach is to make each side of an equation more equal to or equal to zero. In general, how many iterations are necessary to satisfy this requirement? I assume this requirement depends on what you're trying to approximate and on personal experience of what is "close enough." I want to extend this line of thinking to my line of work, surveying, in order to solve "what if" problems such as curve fitting. Thanks for responding! RE: Civil Engineers with Experience Using the Colebrook Equation? - Csaba Tizedes - 02-07-2021 02:29 PM My "ABC-method" from my university years (yes, I was VERY proud for my 12 steps fixed point iterative method ) - check the attached picture. I made a quick English printout with an example to show how fast the iteration is. There is no any accuracy checking and the program makes one step only, because these calculators had only few dozens of memory. Typically the first three-four iteration is good enough. You must to know this formula is used for pipe flows where the cross section fullfilled with fluid. Rule of thumb: for water f=0.025 is a good approximation and f=0.02 ... 0.03 range is typically OK, your 0.59 is too high. You made a mistake during calculation or used non-consistent units, maybe Reynolds-number calculated with wrong viscosity (kinematic vs. dynamic), etc... Csaba (a fluid flow mechanical engineer) [attachment=9077] RE: Civil Engineers with Experience Using the Colebrook Equation? - C.Ret - 02-07-2021 02:54 PM (02-07-2021 02:29 PM)Csaba Tizedes Wrote: My "ABC-method" from my university years (yes, I was VERY proud for my 12 steps fixed point iterative method ) - check the attached picture. Efficient ABC-method ! Thanks for the numerical example you provide. My own full personal HP-28'Solver-method is 100% in agreement with your numeric result. I must admit that entering the formulae in the HP-28S solver equation need more than 12 keystrokes. But this is the cost to pay for a more readable display and a full equation solver environment. Estimating f is no more complicated than entering all the parameter by pressing corresponding labels and then a final pression on [shift]( f ) soft menu key to get the numeric result in a flash ! C.Ret (Biochemist) RE: Civil Engineers with Experience Using the Colebrook Equation? - Albert Chan - 02-07-2021 04:56 PM (02-07-2021 02:29 PM)Csaba Tizedes Wrote: My "ABC-method" from my university years (yes, I was VERY proud for my 12 steps fixed point iterative method ) This can be made more efficient by letting x = -A/2 = -0.5/√f A := log10(1/(B+C*A)^2) → (-A/2) = log10(B - (2C)*(-A/2)) x = log10(b - c*x) f = 0.25/x^2 Redoing the same example: lua> eps, D, Re = 0.2, 105, 178500 lua> b = eps/(3.7*D) lua> c = 5.02/Re lua> x0 = -3 -- guess lua> x1 = log10(b-c*x0) --> x1 = -3.2224497491569166 lua> x2 = log10(b-c*x1) --> x2 = -3.2179387367766976 lua> x3 = log10(b-c*x2) --> x3 = -3.218029750749086 lua> 0.25 / x3^2 --> f3 0.02414125808712503 Fixed point iterations might converge very slowly, or not at all. We can improve convergence by putting a weight on it. lua> r = (x2-x3)/(x1-x2) -- rate of spiral ≈ -0.02 lua> w = 1/(1-r) -- weight ≈ 0.98 lua> x = x3 lua> x = x + (log10(b-c*x) - x)*w --> x4 = -3.2180279505869267 lua> x = x + (log10(b-c*x) - x)*w --> x5 = -3.2180279505905083 (converged) lua> 0.25 / x^2 --> f 0.02414128509627824 Update: we can also visualize w = 1/slope of 2 points, (x1, x2-x1), (x2, x3-x2) Since log10(b-c*x) is locally very flat, (log10(b-c*x) - x)' ≈ -1/w = r-1 Weighted iterations thus similar to Newton's method, but with constant slope. see https://www.hpmuseum.org/forum/thread-12423-post-125977.html#pid125977 RE: Civil Engineers with Experience Using the Colebrook Equation? - Csaba Tizedes - 02-07-2021 05:17 PM (02-07-2021 04:56 PM)Albert Chan Wrote: This can be made more efficient (...) Fixed point iterations might converge very slowly, or not at all. There is always a better solution and improved methods, but as an engineer I can decide it is converges or not (because I have experience which values right and which aren't) and 12 steps are really efficient. After three steps it converges for three significant figures which is good enough for a pressure drop calculation. But, OK, new methods are always welcome. In the evolution's tree the engineers and scientist sits on different branch and that is so right otherwise nothing would ever be built Csaba RE: Civil Engineers with Experience Using the Colebrook Equation? - Albert Chan - 02-08-2021 05:56 PM Here is another way, by shifting iterations to W(exp(x)). Argument inside W might be huge, we combine W(exp(x)) ≡ Wexp(x) w*e^w = e^x → w + ln(w) = x If x → +∞, (x-ln(x)) + ln(x-ln(x)) ≈ x-ln(x)+ln(x) = x If x → −∞, (e^x) + ln(e^x) ≈ 0 + x = x We use these 2 asymptotic solutions for guess of W(e^z). Code: function Wexp(x) Colebrook Equation: x = log10(b-c*x) = ln(b-c*x)/ln(10), where b = eps/(3.7*D), c = 5.02/Re, x = -0.5/√f Let X = x*ln(10), C = c/ln(10), B = b/C, we have: X = ln(C*(B-X)) B-X = B - (ln(C) + ln(B-X)) = W(e^(B-ln(C))) Redo previous example: lua> eps, D, Re = 0.2, 105, 178500 lua> C = 5.02/(log(10)*Re) --> C = 1.2213771984057835e-005 lua> B = eps/(3.7*D*C) --> B = 42.14918335404198 lua> X = B - Wexp(B-log(C)) --> X = -7.4097831878678875 lua> f = (0.5*log(10)/X)^2 --> f = 0.024141285096278223 RE: Civil Engineers with Experience Using the Colebrook Equation? - armandine2 - 02-14-2021 05:11 PM (02-05-2021 10:02 PM)MNH Wrote: Colebrook Equation I note, going to my Massey (1989) Mechanics of Fluids 6th Ed [see pages 278, 199-200], that f and lamda are related: lambda = 4f. And Massey's Colebrook formula is different: -4 for the -2 and numerator 1.26 for the 2.51. |