Friday, 26 December 2014

Fluid dynamics: pressure drop modelling

Likely the last post of the year, on a rather intriguing subject: fluid dynamics.

Recently I’ve been asked to model a simulation for a series of pipes through which water flows out of a reservoir. The task seems quite easy at first, however many factors must be taken into account. Pressure drop due to friction is one of the things that need to be addressed. Therefore, I documented myself a little on the subject and developed a simple model to take friction into account. Pressure drop depends both by the speed of the water and the pipes diameter.

Here is a short piece of code to calculate pressure drop. Note that we are using the average speed of the water. For each average speed we can draw a line that shows the pressure drop versus the pipe’s diameter.

figure_1

Considering the fact that this was my first attempt I think the results are pretty good when compared with an actual diagram such as this (note that on this graph you’ll need to multiply pressure drop by 10 to compare pears to pears and apples to apples):

1

Here is the code I used. I should mention, I had a hard time finding out how to do this and furthermore I couldn’t find a comprehensive piece lecture where fluid dynamics is analysed in depth. Online there is a lot of material on Bernoulli’s equation and Torricelli’s special case but it is definitely harder to find out how to model real fluids, friction and fluid dynamics in general. Hope someone will upload some good material.

1 comment:

  1. This is a great example of where theory meets reality and things immediately get more interesting. Pressure drop due to friction is often glossed over in introductory material, so it is refreshing to see a first principles attempt to model it instead of relying purely on ideal assumptions.

    I especially like that you validated your results against a real world reference chart. That comparison step is critical and often missing in early simulations. Even if the model is simplified, showing that the trends line up with empirical data is what builds confidence that you are on the right track.

    Your observation about the lack of practical, end to end resources on real fluid behaviour is spot on. There is plenty on Bernoulli and Torricelli, but far less that walks through friction factors, diameter sensitivity, and how assumptions like average velocity affect results. This is exactly the gap where small, focused models like yours are valuable learning tools.

    From a quality perspective, documenting assumptions and validating outputs against known references is very similar to how engineering teams test software models and simulations. Using something like Tuskr test management software can help structure those validation cases, expected ranges, and comparison data so experiments remain traceable as the model evolves.

    ReplyDelete