This post is complementary to an early one to show an iterative procedure to estimate the friction factor $f_F$ from the well known Colebrook equation.
Therefore, the reader is referred to the following post for further details:
Solving the Colebrook equation
A short comment on the procedure
If you have already read the prevous post on the solution procedure to the Cole brook equation it is straight to see that the iterative process fetis very well for a for loop.
Since the friction factor is used for several calculations where it is estimated more than once it is convenient to find a way to avoid having a large number of sheets (one for each calculation). This is true for calculation of flow rates in pipe networks.
One way of going around this technical issue is by using an available tool from Excel. This is called: user defined function. The user defined function needs to be programmed in Visual Basic.
Building the user defined function
For short, the user defined function shall be written from 3 inputs common to the Colebrook equation. These input data are,
- the pipe roughness $\epsilon$
- the internal pipe diameter $ID$
- the Reynolds number $N_{Re}$
Since the friction factor is to be estimated starting from a guess, our user defind function will need an already set value for the friction factor (just to start the calcultion).
Having given the most important details, the process of creation of this function in Excel is as follows,
- first, open an excel document where the data for $\epsilon$, $ID$ and $N_{Re}$ has already been placed or calculated
- second, press the keys ALT + F11 to open the Visual Basic Editor and in the Insert menu click on Module
- third, in the module window insert the following code for the user defined function
- save the created function and close the Visual Basic Editor. That is it.
How to use the created function
Once, this function has been created, repeated calculations as for pipe networks, should be much more easy.
This is the end. I hope, you find this post very useful.
Other stuff of interest
- LE01 - AC and DC voltage measurement and continuity test
- LE 02 - Start and stop push button installation 24V DC
- LE 03 - Turn on/off an 24V DC pilot light with a push button
- LE 04 - Latch contact with encapsulated relay for turning on/off an AC bulb light
- LE 05 - Emergency stop button installation
- About PID controllers
- Ways to control a process
- About pilot lights
- Solving the Colebrook equation
==========
Ildebrando.
No comments:
Post a Comment