How do I solve the colbrooke equation by iteration in Excel?

  • Thread starter Thread starter Steve M.
  • Start date Start date
S

Steve M.

I want to program excel to check whether fluid flow is laminar, transitional,
or turbulent and use corresponding equations to solve for friction.

Laminar (re<2300) - friction = Re/64
Transitional (2300<re<4000) - friction use Churcill equation
Turbulent (re>4000) - friction use colebrooke iterative equation

I have the flow type listed in one column and I would like the corresponding
friction factor to be listed in the adjacent column.

--Steve
 
I would use a UDF. Use the mode either 1 or 2 to return the value or the type

Function Fluid_Flow(mode As Integer, re As Single)

Select Case mode
Case 1
Select Case re
Case Is < 2300
Fluid_Flow = "Laminar"
Case Is >= 4000
Fluid_Flow = "Transitional"
Case Else
Fluid_Flow = "Turbulent"
End Select
Case 2
Select Case re
Case Is < 2300
Fluid_Flow = "add formula"
Case Is >= 4000
Fluid_Flow = "add formula"
Case Else
Fluid_Flow = "add formula"
End Select

End Select

End Function
 
Does your code use the visual basic editor in excel?

How would I write a simple do loop to perform the iteration for the
colbrooke equation?

Thank,

--Steve M.
 
What caught my eye was the Excel spreadsheet download that they have in zip
file format. I didn't check it but it could answer all of your questions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top