Water flow - automation of pipe diameters

I’m working on a way to calculate the diameters of a pipe network as I increase its flow rate with the addition of new pipes. However, I don’t know if there’s any code or node that can understand this flow and calculate the flow rate from each pipe to the end point. The yellow dots are the water inlets, while the red ones are the outlets. I’d like to know if I can automate this calculation or if I can only do it manually.

1 Like

I don’t know if a node to do this, but if you can do the calculation manually then you can do the calculation in Dynamo. It’s just math after all. :slight_smile:

1 Like

Hi @Kanon i would do it in revit analysis-pipe,duct sizing, but it should be easy just calculate manuel or use dynamo for that as well

PS but normally i use 3rd part software like magicad etc….just better control for sizing and balance…IMO :wink:

1 Like

Hi,

  1. For each yellow dot (input flow), calculate the shortest path to the final red dot using the Dijkstra’s algorithm.

  2. Then, for each edge (pipe), add up the flows passing through it using the previous list of paths .

there is a good AU Class by @Cesare_Caoduro3 about Dijkstra’s algorithm

https://www.autodesk.com/autodesk-university/class/MEP-Modeling-Made-Easy-Dynamo-2017#video

3 Likes

Thank you very much, I will try to do that! It’s a great solution!

1 Like

@Kanon

to sum flows in pipes, you can use a pandas DataFrame or dictionaries

here an simple example with dictionnaries

flow1 = {"network_flow" : 20.8, "pipeIds_by_Dijkstra" : [53537,483838,374635,94948,537202,635252]}
flow2 = {"network_flow" : 30.9, "pipeIds_by_Dijkstra" : [53537,483838,674635,94948,837343,636665]}

lst_flows = [flow1, flow2]

out_dict_pipe_flow = {}
for pipe in lst_pipe:
	total_flow_pipe = 0
	for dict_flow in lst_flows:
		if pipe.Id.IntegerValue in dict_flow["pipeIds_by_Dijkstra"]: # use 'pipe.Id.Value' for Revit 2024+
			total_flow_pipe += dict_flow["network_flow"]

	out_dict_pipe_flow[pipe.Id] = total_flow_pipe
3 Likes

This is great! I was able to do it using Python shortly after. But this is a great alternative, thanks again!

1 Like