# Fluid mechanics - how to calculate flow distribution in piping network?

I am trying to build flexible, visual tool to calculate flow distribution through the piping network (mobile hydraulics).

I have root node of the network which has defined flow and pressure inputs. Each node (of course including root one) can have multiple children - lines, connectors or outputs. Each branch ends up with outlet to atmospheric pressure. So far I know that I have to calculate losses at each node going from the bottom of the tree, but losses are flow dependent... When I would have losses at each node, I could somehow (how?) calculate flow distribution going from the root node I would get flow to each child, then for each child flow to each of its children etc. Not sure if it helps, but I know the target flow for each output.

The main issue is probably the fact that there is no particular example as it suppose to be generic tool.

Any help?

I though it is pretty simple (I still believe it is) but I got stuck and cannot find the way out.

• You should search before posting : this is very relevant to your question : engineering.stackexchange.com/q/18840/10902 Mar 20, 2018 at 9:48
• I did search, but I stated the problem differently and this topic did not come up. Going to read it right now Mar 20, 2018 at 9:50
• the solution in the link that Solar Mike provides is a network of resistors. To solve for that unknowns in a resistor network, you can represent them as a matrix (series of linear equations) and RREF. Try something like that, only with head loss instead of resistance. Enter random values for head loss, and see if you get output P = 0. Then you can use gradient descent to adjust head losses. Mar 20, 2018 at 19:14
• Look at this en.wikipedia.org/wiki/Pipe_network_analysis and then the hardy cross method.
– mart
Sep 2, 2019 at 7:59