Skip to main content
Ctrl+K
WNTR documentation - Home WNTR documentation - Home
  • User Guide
  • API documentation
  • User community
  • GitHub
  • Sandia National Laboratories
  • U.S. Environmental Protection Agency
  • User Guide
  • API documentation
  • User community
  • GitHub
  • Sandia National Laboratories
  • U.S. Environmental Protection Agency

Section Navigation

  • wntr.epanet
    • wntr.epanet.exceptions
      • EN_ERROR_CODES
      • ENKeyError
      • ENSyntaxError
      • ENValueError
      • EpanetException
    • wntr.epanet.io
      • BinFile
      • InpFile
      • NoSectionError
    • wntr.epanet.libepanet
    • wntr.epanet.msx
      • set_msx_path
      • wntr.epanet.msx.enums
        • TkAreaUnits
        • TkCompiler
        • TkCouplingType
        • TkExpressionType
        • TkFileMode
        • TkFlowUnits
        • TkHydVar
        • TkMassUnits
        • TkMixType
        • TkObjectType
        • TkOption
        • TkRateUnits
        • TkSolverType
        • TkSourceType
        • TkSpeciesType
        • TkTstat
        • TkUnitSystem
        • TkUnits
      • wntr.epanet.msx.exceptions
        • MSX_ERROR_CODES
        • EpanetMsxException
        • MSXKeyError
        • MSXSyntaxError
        • MSXValueError
      • wntr.epanet.msx.io
        • MsxBinFile
        • MsxFile
      • wntr.epanet.msx.toolkit
        • MSXepanet
    • wntr.epanet.toolkit
      • ENgetwarning
      • runepanet
      • ENepanet
    • wntr.epanet.util
      • NoteType
      • from_si
      • to_si
      • ControlType
      • EN
      • ENcomment
      • FlowUnits
      • FormulaType
      • HydParam
      • InitHydOption
      • LinkTankStatus
      • MassUnits
      • MixType
      • PressureUnits
      • QualParam
      • QualType
      • ResultType
      • SizeLimits
      • SourceType
      • StatisticsType
  • wntr.gis
    • wntr.gis.geospatial
      • connect_lines
      • intersect
      • sample_raster
      • snap
    • wntr.gis.network
      • WaterNetworkGIS
  • wntr.graphics
    • wntr.graphics.color
      • custom_colormap
      • random_colormap
    • wntr.graphics.curve
      • plot_fragility_curve
      • plot_pump_curve
      • plot_tank_volume_curve
    • wntr.graphics.layer
      • plot_valve_layer
    • wntr.graphics.network
      • network_animation
      • plot_interactive_network
      • plot_leaflet_network
      • plot_network
  • wntr.library
    • wntr.library.demand_library
      • DemandPatternLibrary
    • wntr.library.msx
  • wntr.metrics
    • wntr.metrics.economic
      • annual_ghg_emissions
      • annual_network_cost
      • pump_cost
      • pump_energy
      • pump_power
    • wntr.metrics.hydraulic
      • average_expected_demand
      • entropy
      • expected_demand
      • modified_resilience_index
      • tank_capacity
      • todini_index
      • water_service_availability
    • wntr.metrics.misc
      • population
      • population_impacted
      • query
    • wntr.metrics.topographic
      • algebraic_connectivity
      • bridges
      • central_point_dominance
      • critical_ratio_defrag
      • spectral_gap
      • terminal_nodes
      • valve_segment_attributes
      • valve_segments
    • wntr.metrics.water_security
      • extent_contaminant
      • mass_contaminant_consumed
      • volume_contaminant_consumed
  • wntr.morph
    • wntr.morph.link
      • break_pipe
      • reverse_link
      • split_pipe
    • wntr.morph.node
      • convert_node_coordinates_UTM_to_longlat
      • convert_node_coordinates_longlat_to_UTM
      • convert_node_coordinates_to_UTM
      • convert_node_coordinates_to_longlat
      • rotate_node_coordinates
      • scale_node_coordinates
      • translate_node_coordinates
    • wntr.morph.skel
      • skeletonize
  • wntr.msx
    • wntr.msx.base
      • HYDRAULIC_VARIABLES
      • EXPR_FUNCTIONS
      • RESERVED_NAMES
      • arccot
      • cot
      • coth
      • ExpressionType
      • NetworkDataBase
      • QualityModelBase
      • ReactionBase
      • ReactionSystemBase
      • ReactionType
      • SpeciesType
      • VariableBase
      • VariableType
      • VariableValuesBase
    • wntr.msx.elements
      • Constant
      • HydraulicVariable
      • InitialQuality
      • MathFunction
      • Parameter
      • ParameterValues
      • Reaction
      • ReservedName
      • Species
      • Term
    • wntr.msx.io
      • from_dict
      • read_json
      • read_msxfile
      • to_dict
      • write_json
      • write_msxfile
    • wntr.msx.model
      • MsxVariable
      • MsxModel
      • MsxNetworkData
      • MsxReactionSystem
    • wntr.msx.options
      • MsxReportOptions
      • MsxSolverOptions
  • wntr.network
    • wntr.network.base
      • AbstractModel
      • Link
      • LinkStatus
      • LinkType
      • Node
      • NodeType
      • Observer
      • Registry
      • Subject
    • wntr.network.controls
      • AndCondition
      • BaseControlAction
      • Comparison
      • Control
      • ControlAction
      • ControlBase
      • ControlChangeTracker
      • ControlChecker
      • ControlCondition
      • ControlPriority
      • FunctionCondition
      • Observer
      • OrCondition
      • RelativeCondition
      • Rule
      • SimTimeCondition
      • Subject
      • TankLevelCondition
      • TimeOfDayCondition
      • ValueCondition
    • wntr.network.elements
      • Curve
      • Demands
      • FCValve
      • GPValve
      • HeadPump
      • Junction
      • PBValve
      • PRValve
      • PSValve
      • Pattern
      • Pipe
      • PowerPump
      • Pump
      • Reservoir
      • Source
      • TCValve
      • Tank
      • TimeSeries
      • Valve
    • wntr.network.io
      • from_dict
      • from_gis
      • read_geojson
      • read_inpfile
      • read_json
      • read_shapefile
      • to_dict
      • to_gis
      • to_graph
      • valid_gis_names
      • write_geojson
      • write_inpfile
      • write_json
      • write_shapefile
    • wntr.network.layer
      • generate_valve_layer
    • wntr.network.model
      • CurveRegistry
      • LinkRegistry
      • NodeRegistry
      • PatternRegistry
      • SourceRegistry
      • WaterNetworkModel
    • wntr.network.options
      • EnergyOptions
      • GraphicsOptions
      • HydraulicOptions
      • Options
      • QualityOptions
      • ReactionOptions
      • ReportOptions
      • TimeOptions
      • UserOptions
  • wntr.scenario
    • wntr.scenario.earthquake
      • Earthquake
    • wntr.scenario.fragility_curve
      • FragilityCurve
      • State
  • wntr.sim
    • wntr.sim.aml
      • wntr.sim.aml.aml
        • Constraint
        • ConstraintDict
        • Model
        • ParamDict
        • VarDict
      • wntr.sim.aml.evaluator
      • wntr.sim.aml.expr
        • abs
        • acos
        • asin
        • atan
        • cos
        • exp
        • if_else
        • inequality
        • is_variable_type
        • log
        • sign
        • sin
        • tan
        • value
        • AbsOperator
        • AcosOperator
        • AddOperator
        • AsinOperator
        • AtanOperator
        • BinaryOperator
        • ConditionalExpression
        • CosOperator
        • DivideOperator
        • ExpOperator
        • ExpressionBase
        • Float
        • IfElseOperator
        • InequalityOperator
        • Leaf
        • LogOperator
        • MultiplyOperator
        • NegationOperator
        • Node
        • OperationEnum
        • Operator
        • Param
        • PowerOperator
        • SignOperator
        • SinOperator
        • SubtractOperator
        • TanOperator
        • UnaryOperator
        • Var
        • expression
    • wntr.sim.core
      • WNTRSimulator
      • WaterNetworkSimulator
    • wntr.sim.epanet
      • EpanetSimulator
    • wntr.sim.hydraulics
      • create_hydraulic_model
      • get_results
      • initialize_results_dict
      • save_results
      • store_results_in_network
      • update_model_for_controls
      • update_model_for_isolated_junctions_and_links
      • update_network_previous_values
      • update_tank_heads
    • wntr.sim.models
      • wntr.sim.models.constants
        • darcy_weisbach_constants
        • hazen_williams_constants
        • head_pump_constants
        • leak_constants
        • pdd_constants
      • wntr.sim.models.constraint
        • get_pump_line_params
        • get_pump_poly_coefficients
        • plot_constraint
        • approx_hazen_williams_headloss_constraint
        • fcv_headloss_constraint
        • head_pump_headloss_constraint
        • leak_constraint
        • mass_balance_constraint
        • pdd_constraint
        • pdd_mass_balance_constraint
        • piecewise_hazen_williams_headloss_constraint
        • power_pump_headloss_constraint
        • prv_headloss_constraint
        • psv_headloss_constraint
        • tcv_headloss_constraint
      • wntr.sim.models.param
        • expected_demand_param
        • source_head_param
        • elevation_param
        • hw_resistance_param
        • leak_area_param
        • leak_coeff_param
        • leak_poly_coeffs_param
        • minor_loss_param
        • pdd_poly_coeffs_param
        • pmin_param
        • pnom_param
        • pump_power_param
        • tcv_resistance_param
        • valve_setting_param
      • wntr.sim.models.utils
        • Definition
        • ModelUpdater
      • wntr.sim.models.var
        • demand_var
        • flow_var
        • head_var
        • leak_rate_var
    • wntr.sim.network_isolation
      • wntr.sim.network_isolation.network_isolation
    • wntr.sim.results
      • ResultsStatus
      • SimulationResults
    • wntr.sim.solvers
      • NewtonSolver
      • SolverStatus
  • wntr.utils
    • wntr.utils.disjoint_mapping
      • DisjointMapping
      • DisjointMappingGroup
      • KeyExistsError
      • WrongGroupError
    • wntr.utils.doc_inheritor
      • DocInheritor
    • wntr.utils.enumtools
      • add_get
    • wntr.utils.logger
      • start_logging
    • wntr.utils.ordered_set
      • OrderedSet
    • wntr.utils.polynomial_interpolation
      • cubic_spline

Indices

  • General Index
  • Python Module Index
  • API documentation
  • wntr.network
  • wntr.network.base
  • Link

Link#

module wntr.network.base

class Link[source]#

Bases: object

Base class for links.

For details about the different subclasses, see one of the following: Pipe, Pump, and Valve

Constructor

This is an abstract class and should not be instantiated directly.

Parameters:
  • wn (WaterNetworkModel) – WaterNetworkModel object

  • link_name (string) – Name of the link

  • start_node_name (string) – Name of the start node

  • end_node_name (string) – Name of the end node

Attributes

name

The link name (read-only)

link_type

the link type (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)

initial_status

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

initial_setting

The initial setting for the link (if Active)

initial_quality

a dict of species and quality if multispecies is active

tag

A tag or label for this link

vertices

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

Read-only simulation results

The following attributes are read-only. The values are the final calculated value from a simulation.

flow

(read-only) current simulated flow through the link

headloss

(read-only) current simulated headloss

quality

(read-only) current simulated average link quality

status

(abstract) current status of the link

setting

(read-only) current simulated setting of the link


__init__(wn, link_name, start_node_name, end_node_name)[source]#
to_dict()[source]#

Dictionary representation of the link

to_ref()[source]#
property end_node#

The end node object.

Type:

Node

property end_node_name#

The name of the end node (read only)

Type:

str

property flow#

(read-only) current simulated flow through the link

Type:

float

property headloss#

(read-only) current simulated headloss

Type:

float

property initial_quality#

a dict of species and quality if multispecies is active

Type:

float or dict

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

property link_type#

the link type (read only)

Type:

str

property name#

The link name (read-only)

Type:

str

property quality#

(read-only) current simulated average link quality

Type:

float

property setting#

(read-only) current simulated setting of the link

Type:

float

property start_node#

The start node object.

Type:

Node

property start_node_name#

The name of the start node (read only)

Type:

str

abstract property status#

(abstract) current status of the link

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.

previous

AbstractModel

next

LinkStatus

On this page
  • Link
    • __init__()
    • to_dict()
    • to_ref()
    • end_node
    • end_node_name
    • flow
    • headloss
    • initial_quality
    • initial_setting
    • initial_status
    • link_type
    • name
    • quality
    • setting
    • start_node
    • start_node_name
    • status
    • tag
    • velocity
    • vertices

This Page

  • Show Source

© Copyright 2024 National Technology & Engineering Solutions of Sandia, LLC (NTESS).

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.