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 theget_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
The link name (read-only)
"Pump"
(read only)The start node object.
The name of the start node (read only)
The end node object.
The name of the end node (read only)
base multiplier for a speed timeseries
pattern name for the speed
timeseries of speed values (retrieve only)
The initial status (Opened, Closed, Active) of the Link
The initial setting for the link (if Active)
a dict of species and quality if multispecies is active
"HEAD"
(read only)the pump curve name
pump efficiency
energy price surcharge (only used by EPANET)
energy pattern name
A list of curve points, in the direction of start node to end node.
A tag or label for this link
Read-only simulation results
(read-only) current simulated flow through the link
(read-only) current simulated headloss
(read-only) current simulated velocity through the link
(read-only) current simulated average link quality
the current status of the pump
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:
- 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 initial_quality#
a dict of species and quality if multispecies is active
- property initial_status#
The initial status (Opened, Closed, Active) of the Link
- Type:
- property setting#
Alias to speed for consistency with other link types
- property speed_timeseries#
timeseries of speed values (retrieve only)
- Type:
- property status#
the current status of the pump
- Type:
- 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.