Junction#
module wntr.network.elements
- class Junction[source]#
Bases:
Node
Junction class, inherited from Node.
Junctions are the nodes that contain demand, emitters, and water quality sources.
Constructor
This class is intended to be instantiated through the
add_junction()
method. Direct creation through the constructor is highly discouraged.- Parameters:
name (string) – Name of the junction.
wn (
WaterNetworkModel
) – WaterNetworkModel object the junction will belong to
Attributes
The name of the node (read only)
"Junction"
(read only)Get the base_value of the first demand in the demand_timeseries_list.
list of demand patterns and base multipliers
elevation of the junction
The node coordinates, (x,y)
if not None, then activate an emitter with the specified coefficient
The initial quality (concentration) at the node
The minimum pressure attribute is used for pressure-dependent demand simulations.
The required pressure attribute is used for pressure-dependent demand simulations.
The pressure exponent attribute is used for pressure-dependent demand simulations.
A tag or label for the node
Read-only simulation results
(read-only) the current simulation demand at the node (actual demand)
(read-only) the current simulation head at the node (total head)
(read-only) the current simulation pressure at the node
(read-only) the current simulation quality at the node
(read-only) the current simulation leak demand at the node
(read-only) the current simulation leak status at the node
(read-only) the current simulation leak area at the node
(read-only) the current simulation leak discharge coefficient
- add_fire_fighting_demand(wn, fire_flow_demand, fire_start, fire_end, pattern_name=None)[source]#
Add a new fire flow demand entry to the Junction
- Parameters:
wn (
WaterNetworkModel
) – Water network modelfire_flow_demand (float) – Fire flow demand
fire_start (int) – Start time of the fire flow in seconds.
fire_end (int) – End time of the fire flow in seconds.
pattern_name (str or None) – Pattern name. If pattern name is None, the pattern name is assigned to junction name + ‘_fire’
- add_leak(wn, area, discharge_coeff=0.75, start_time=None, end_time=None)[source]#
Add a leak control to the water network model
Leaks are modeled by:
Q = discharge_coeff*area*sqrt(2*g*h)
- where:
Q is the volumetric flow rate of water out of the leak g is the acceleration due to gravity h is the gauge head at the junction, P_g/(rho*g); Note that this is not the hydraulic head (P_g + elevation)
- Parameters:
wn (
WaterNetworkModel
) – Water network model containing the junction with the leak. This information is needed because the WaterNetworkModel object stores all controls, including when the leak starts and stops.area (float) – Area of the leak in m^2.
discharge_coeff (float) – Leak discharge coefficient; Takes on values between 0 and 1.
start_time (int) – Start time of the leak in seconds. If the start_time is None, it is assumed that an external control will be used to start the leak (otherwise, the leak will not start).
end_time (int) – Time at which the leak is fixed in seconds. If the end_time is None, it is assumed that an external control will be used to end the leak (otherwise, the leak will not end).
- remove_fire_fighting_demand(wn)[source]#
Removes a fire flow demand entry to the Junction
- Parameters:
wn (
WaterNetworkModel
) – Water network model
- remove_leak(wn)[source]#
Remove a leak control from the water network model
- Parameters:
wn (
WaterNetworkModel
) – Water network model
- to_dict()#
Dictionary representation of the node
- to_ref()#
- property base_demand#
Get the base_value of the first demand in the demand_timeseries_list.
This is a read-only property.
- property demand_category#
Get the category of the first demand in the demand_timeseries_list.
This is a read-only property.
- property demand_pattern#
Get the pattern_name of the first demand in the demand_timeseries_list.
This is a read-only property.
- property emitter_coefficient#
if not None, then activate an emitter with the specified coefficient
- Type:
- property leak_discharge_coeff#
(read-only) the current simulation leak discharge coefficient
- Type:
- property minimum_pressure#
The minimum pressure attribute is used for pressure-dependent demand simulations. Below this pressure, the junction will not receive any water. If set to None, the global value in wn.options.hydraulic.minimum_pressure is used.
- Type:
- property nominal_pressure#
deprecated - use required pressure
- property pressure_exponent#
The pressure exponent attribute is used for pressure-dependent demand simulations. If set to None, the global value in wn.options.hydraulic.pressure_exponent is used.
- Type:
- property required_pressure#
The required pressure attribute is used for pressure-dependent demand simulations. This is the lowest pressure at which the junction receives the full requested demand. If set to None, the global value in wn.options.hydraulic.required_pressure is used.
- Type: