module wntr.morph.link

split_pipe(wn, pipe_name_to_split, new_pipe_name, new_junction_name, add_pipe_at_end=True, split_at_point=0.5, return_copy=True)[source]#

Split a pipe by adding a junction and one new pipe segment.

This function splits the original pipe into two pipes by adding a new junction and new pipe to the model. The updated model retains the original length of the pipe section. The split occurs at a user specified distance between the original start and end nodes of the pipe (in that direction). The new pipe can be added to either end of the original pipe.

  • The new junction has a base demand of 0 and the default demand pattern. The elevation and coordinates of the new junction are based on a linear interpolation between the end points of the original pipe.

  • The new pipe has the same diameter, roughness, minor loss, and base status of the original pipe.

  • Check valves are not added to the new pipe. Since the new pipe can be connected at either the start or the end of the original pipe, the user can control if the split occurs before or after a check valve.

  • No controls are added to the new pipe; the original pipe keeps any controls.

  • wn (wntr WaterNetworkModel) – Water network model

  • pipe_name_to_split (string) – Name of the pipe to split.

  • new_pipe_name (string) – Name of the new pipe to be added as the split part of the pipe.

  • new_junction_name (string) – Name of the new junction to be added.

  • add_pipe_at_end (bool, optional) – If True, add the new pipe between the new node and the original end node. If False, add the new pipe between the original start node and the new node.

  • split_at_point (float, optional) – Between 0 and 1, the position along the original pipe where the new junction will be located.

  • return_copy (bool, optional) – If True, modify and return a copy of the WaterNetworkModel object. If False, modify and return the original WaterNetworkModel object.


Water network model with split pipe

Return type:

wntr WaterNetworkModel