Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Andrey Ivashov  
#1 Posted : 01 April 2016 21:37:18(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello, Jean.

Thank you for this sample! Just a small hint: if you do not want (for any reason) to use units in your calculations you can still use real units in results - just specify output units and use Ignore units item in region's context menu.

ignore_units_1.png

Best regards!
thanks 2 users thanked Andrey Ivashov for this useful post.
on 02/04/2016(UTC),  on 02/04/2016(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mikekaganski  
#2 Posted : 02 April 2016 02:31:22(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
My include file I use for hydraulics.
Its Colebrook implementation uses own iterative solver, and is MUCH faster (on my machine, Jean's Colebrook matrix of 100 rows takes ~7.8s to calculate, while replacing Find() with my λ.Cb() makes this in ~0.3s).

hydr_incl.sm (64kb) downloaded 59 time(s).

The solver takes its initial guess from Altshul equation. I experimented with many other approximations (e.g. Swamee-Jain, that is included too), and found that Colebrook performance is best with Altshul (although Altshul is worst in quality, but it is fastest). The precision of solving is about 1*10^-13 (Jean's is about 1*10^-6).

In my version, I use Δ as roughness, and ε as reduced roughness (Δ/d).
All functions are unit-safe.

Edit: here is updated version - includes English descriptions (sorry, I forgot about this in first): hydr_incl.sm (67kb) downloaded 38 time(s).

Edited by user 02 April 2016 03:32:44(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
thanks 2 users thanked mikekaganski for this useful post.
on 02/04/2016(UTC),  on 02/04/2016(UTC)
Offline Jean Giraud  
#3 Posted : 02 April 2016 06:59:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Thanks Mike,

Very interesting your Colebrook iterative solver. In that kind of stuff,
"accuracy" does not mean much. Pumps/motors are 15 % oversised by practice.
Next, to complete the tour: valve sizing [hope Smath will like it as well].
It's the plot that takes time. Smath solve block is much faster than the
user iterative. "solve" is built-in < 0.1 sec.

Thanks Kamarad Mike. I think "Spoutnik" means "Companion" ?

I got familiarised with Russian 50 years ago ... all gone !
My GrandKids are acustomed to visit friends from Russia.

Just reposted the "Colebrook Project"

Jean
Offline mikekaganski  
#4 Posted : 02 April 2016 07:59:10(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
In that kind of stuff, "accuracy" does not mean much. Pumps/motors are 15 % oversised by practice.

Good You are partially right. In practical applications, there's no value to have great precision here.
But! There exist scientific value in this. You may look here for an example: A Review of Explicit Approximations of Colebrook’s Equation.
If accuracy is of no value, then it's impractical to use real Colebrook implicit equation here. There exist many much faster equations that give satisfactory precision (see review above, or Wikipedia article). And my mentioning of accuracy was meant to emphasize that the speed comes without sacrificing accuracy, that's all.

Quote:
Next, to complete the tour: valve sizing [hope Smath will like it as well].
It's the plot that takes time. Smath solve block is much faster than the
user iterative. "solve" is built-in < 0.1 sec.

Well, see - no plot here: comparison.sm (60kb) downloaded 36 time(s).

Quote:
Thanks Kamarad Mike. I think "Spoutnik" means "Companion" ?

I got familiarised with Russian 50 years ago ... all gone !
My GrandKids are acustomed to visit friends from Russia.

Just reposted the "Colebrook Project"

Jean


Good Nice to meet you.
Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 02/04/2016(UTC)
Offline Jean Giraud  
#5 Posted : 03 April 2016 02:09:01(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
In the range tested [...Re 10^6]
Haaland leading coefficient 1.7935
Swamee leading coefficient 0.249
They are all interesting for pocket calculators. Colebrook solves iteratively Torricelli law.
In 3 terms it solves for the 3 variates ε, D, R. There are physical boundary conditions,
otherwise Colebrook is the golden bullet. The 19 approximations are reverse engineering by approximtion of Colebrook.

Jean

Inst_Colebrook_Haaland.sm (199kb) downloaded 50 time(s).
Offline Jean Giraud  
#6 Posted : 03 April 2016 04:18:37(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Good occasion to test Smath latest "computes faster"

Jean

Inst_Colebrook MOODY.sm (12kb) downloaded 68 time(s).

Offline mikekaganski  
#7 Posted : 03 April 2016 05:14:19(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
You seem to ignore what you are told.

Assigning "Colebrook:=line(...)", and measuring the time that this assignment took, ISN'T productive. SMath DOESN'T do actual calculations at this point. It only stores the formula, to be used later. Only when you USE the previously-created "Colebrook" variable somewhere (e.g., by plotting, or by taking nth member), SMath does actually grinds numbers, and takes its time! Only then may you actually measure its performance.

And BTW, what is that "Torricelli's law" that Colebrook solves??? (Hint: Torricelli idealized the flow, ignoring the friction.)

Edited by user 03 April 2016 05:36:27(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
Offline Jean Giraud  
#8 Posted : 03 April 2016 06:36:19(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
https://en.wikipedia.org/wiki/Torricelli%27s_law

Sure: any programmed function is dead until it is demanded.
I was curious about the timing of "Moody" up to it finishes plotting.
Pretty slow in Smath 5346 ... what about the latest version.

Jean
Offline mikekaganski  
#9 Posted : 03 April 2016 07:41:27(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
https://en.wikipedia.org/wiki/Torricelli%27s_law

Well, then.
Colebrook formula does not solve any law. It is empirical formula that approximates experimental data that Colebrook and others were gathering in 1930s, working with pipes having real roughness. His formula gives Darcy factor to empirical Darcy-Weisbach formula.

In 1920s-1930s, Nikuradze, while working at Prandtl's laboratory and experimenting with pipes with artificial roughness, made his semi-empirical formulas for turbulent flow: one for smooth walls, other for rough walls. His smooth-walls formula was implicit, and differed from theoretical logarithmic law formula by its coefficients (to better match experimental data; thus semi-empirical).
Later, Colebrook and others had conducted a number of experiments to find out if the Nikuradze formulas hold true for real-life rough pipes, i.e. if artifical roughness is adequate model for real roughness.
It turned out that the relation holds only approximately, real data being more smooth in transitional region. So, Colebrook took Nikuradze's approach to create his own formula, that would combine both of Nikuradze's formulas in one, and to select coefficients that would better approximate real pipes experimental data.
His formula isn't particularily precise, and substantially overestimates real Darcy factor for transitional region. But traditionally, it is used as reference in this area.

Torricelli, on the other side, didn't deal with duct flow, but rather studied discharge through nozzles. He ignored friction (that is essential for Colebrook) completely.

So, bottom line is, they have nothing in common, except both relate to hydraulics.

Wrt timing. Unfortunately, I cannot tell if solve() efficiency has improved. My computer with last SMath (5935) takes 2.4 min. to process your Moody chart implementation, that's less than your 6.1 min. But taking into account that you have rather slow laptop, this doesn't say much, because we have incomparable hardwares. Anyway, in his release notes, Andrey didn't tell anything about solve() speed-up...

Edited by user 03 April 2016 10:02:53(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 03/04/2016(UTC)
Offline Jean Giraud  
#10 Posted : 03 April 2016 15:01:22(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Thanks Mike for refrehing my brain that starts diluting. Years ago [30+] I had in hands the
great Russian book [in French] "Iceldik" ... considered "Hydraulic Bible". The other point is
about possible speed up of the solve block. As is, "solve" restarts from each scan. That's
very inefficient. Some functions reputed not solvable by Mathematica did solve in Mathcad 11
at the speed of the light based on a "seeded root scanner". Tried to implement in Smath 5346
but refused ... like hard to thight a left turn bolt by turning clockwise ... is it !
Thanks for the timing.

Jean
Offline mikekaganski  
#11 Posted : 03 April 2016 15:13:11(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Years ago [30+] I had in hands the great Russian book [in French] "Iceldik" ... considered "Hydraulic Bible".


Oh! I suppose it's Idelchik's reference book (I.E.Idelchik is its author). There hydraulic resistances (both from pipes and local - such as fittings) were given very precise formulations. Its second edition went in 1975, and third in 1992. Unfortunately, I don't have it in other languages, but Russian. I agree, that's really fundamental work!
Best regards,
Mike Kaganski
Offline Jean Giraud  
#12 Posted : 03 April 2016 22:46:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: mikekaganski Go to Quoted Post
Oh! I suppose it's Idelchik's reference book (I.E.Idelchik is its author)


Yes, that's the book. The name was just "frenchised".
I used it to determine the depth of insertion of turbine
meter in large size duct at high velocity.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.