HeadPump#

module wntr.network.elements

class HeadPump[source]#

Bases: Pump

Head pump class, inherited from Pump.

This type of pump uses a pump curve (see curves). The curve is set using the pump_curve_name attribute. The curve itself can be accessed using the get_pump_curve() method.

Constructor

This class is intended to be instantiated through the add_pump method. Direct creation through the constructor is highly discouraged.

Parameters:
  • name (string) – Name of the pump

  • start_node_name (string) – Name of the start node

  • end_node_name (string) – Name of the end node

  • wn (WaterNetworkModel) – The water network model this pump will belong to.

Attributes

name

The link name (read-only)

link_type

"Pump" (read only)

start_node

The start node object.

start_node_name

The name of the start node (read only)

end_node

The end node object.

end_node_name

The name of the end node (read only)

base_speed

base multiplier for a speed timeseries

speed_pattern_name

pattern name for the speed

speed_timeseries

timeseries of speed values (retrieve only)

initial_status

The initial status (Opened, Closed, Active) of the Link

initial_setting

The initial setting for the link (if Active)

pump_type

"HEAD" (read only)

pump_curve_name

the pump curve name

efficiency

pump efficiency

energy_price

energy price surcharge (only used by EPANET)

energy_pattern

energy pattern name

vertices

A list of curve points, in the direction of start node to end node.

tag

A tag or label for this link

Read-only simulation results

flow

(read-only) current simulated flow through the link

headloss

(read-only) current simulated headloss

velocity

(read-only) current simulated velocity through the link

quality

(read-only) current simulated average link quality

status

the current status of the pump

setting

Alias to speed for consistency with other link types


__init__(name, start_node_name, end_node_name, wn)#
add_outage(wn, start_time, end_time=None, priority=6, add_after_outage_rule=False)#

Add a pump outage rule to the water network model.

Parameters:
  • model (WaterNetworkModel) – The water network model this outage will belong to.

  • start_time (int) – The time at which the outage starts.

  • end_time (int) – The time at which the outage stops.

  • priority (int) – The outage rule priority, default = 6 (very high)

  • add_after_outage_rule (bool) – Flag indicating if a rule is added to open the pump after the outage. Pump status after the outage is generally defined by existing controls/rules in the water network model. For example, the pump opens based on the level of a specific tank.

get_design_flow()[source]#

Returns the design flow value for the pump. Equals to the first point on the pump curve.

get_head_curve_coefficients()[source]#

Returns the A, B, C coefficients pump curves.

  • For a single point curve, the coefficients are generated according to the following equation:

    \(A = 4/3 * H\)

    \(B = 1/3 * H/Q^2\)

    \(C = 2\)

  • For a two point curve, C is set to 1 and a straight line is fit between the points.

  • For three point and multi-point curves, the coefficients are generated using scipy.optimize.curve_fit with the following equation:

    \(H = A - B*Q^C\)

Returns:

  • Tuple of pump curve coefficient (A, B, C). All floats.

  • The coefficients are only calculated the first time this function

  • is called for a given HeadPump

get_pump_curve()[source]#

Get the pump curve object

Returns:

the head curve for this pump

Return type:

Curve

remove_outage(wn)#

Remove an outage control from the water network model

Parameters:

wn (WaterNetworkModel) – Water network model

to_dict()#

Dictionary representation of the link

to_ref()#
property base_speed#

base multiplier for a speed timeseries

Type:

float

property efficiency#

pump efficiency

Type:

float

property end_node#

The end node object.

Type:

Node

property end_node_name#

The name of the end node (read only)

Type:

str

property energy_pattern#

energy pattern name

Type:

str

property energy_price#

energy price surcharge (only used by EPANET)

Type:

float

property flow#

(read-only) current simulated flow through the link

Type:

float

property headloss#

(read-only) current simulated headloss

Type:

float

property initial_setting#

The initial setting for the link (if Active)

Type:

float

property initial_status#

The initial status (Opened, Closed, Active) of the Link

Type:

LinkStatus

"Pump" (read only)

Type:

str

property name#

The link name (read-only)

Type:

str

property pump_curve_name#

the pump curve name

Type:

str

property pump_type#

"HEAD" (read only)

Type:

str

property quality#

(read-only) current simulated average link quality

Type:

float

property setting#

Alias to speed for consistency with other link types

property speed_pattern_name#

pattern name for the speed

Type:

str

property speed_timeseries#

timeseries of speed values (retrieve only)

Type:

TimeSeries

property start_node#

The start node object.

Type:

Node

property start_node_name#

The name of the start node (read only)

Type:

str

property status#

the current status of the pump

Type:

LinkStatus

property tag#

A tag or label for this link

Type:

str

property velocity#

(read-only) current simulated velocity through the link

Type:

float

property vertices#

A list of curve points, in the direction of start node to end node.

The vertices should be listed as a list of (x,y) tuples when setting.