mercredi 26 août 2020

Solving the Colebrook Equation Iteratively inside and If statement with excel

I am trying to solve the Colebrook equation iteratively in excel in an if statement.

Here is my if statement so far, but I'm not sure how to implement the iterative calculation with the coding in excel.

A1 = 2500
A2 = IF(A1<2300,64/A1,"")

The value of A1 is the Reynolds number, which would make the if statement go to the false side of the calculation.

Here is the colebrook equation.

Colebrook

B2 = 7.00E-05
C2 = 7.94E-04

B2 is the roughness epsilon, and C2 is the diameter D.

Normally I could just do the following iteration technique in the cell A2

A2 = 64/A1 % initial guess, this is for the laminar case but I need the turbulent value for Re > 2300
A3 = 1/(-2*LOG10((B2/C2)/3.7 + 2.51/(A1*SQRT(A2))))^2

and then just set A2 = A3 with the iteration feature turned on with max iterations 100, and max change 0.001. But I'm not sure how to implement this in an if statement since I have other Re values less than 2300 where f = 64/Re. Is there a way to use the iteration technique similar to this but in an if statement.

Aucun commentaire:

Enregistrer un commentaire