pywatershed.FlowNode#

class pywatershed.FlowNode(control)[source]#

The FlowNode base class.

A FlowNode represents a spatial element of an explicit flow solution which does not (currently) include a head (water depth) term.

A FlowNode is instantiated with its own (optional) data and calculates outflow, storage_change, and sink_source properties on subtimesteps.

A FlowNode may have additional public variables provided by properties that can be requested to be collected by FlowGraph for output to NetCDF files. These variable names should just not overwrite any existing class attributes.

See FlowGraph for related examples and discussion.

__init__(control)[source]#

Initialize the FlowNode.

Parameters:

control (Control) – A Control object.

Methods

__init__(control)

Initialize the FlowNode.

advance()

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, ...)

Calculate the subtimestep.

finalize_timestep()

Finalize the current timestep at this FlowNode.

prepare_timestep()

Prepare the subtimestep for subtimestep calculations.

Attributes

outflow

The average outflow of the FlowNode over the current timestep.

outflow_substep

The outflow of the FlowNode over the sub-timestep.

sink_source

The sink or source amount of the FlowNode at the current subtimestep.

storage

The storage of the FlowNode at the current subtimestep.

storage_change

The storage change of the FlowNode at the current subtimestep.

advance()[source]#

Advance this FlowNode to the next timestep.

calculate_subtimestep(isubstep, inflow_upstream, inflow_lateral)[source]#

Calculate the subtimestep.

Parameters:
  • isubstep (int) – Zero-based integer indicating the index of the current substep.

  • inflow_upstream (float) – The in-channel flows to this FlowNode on the current substep.

  • inflow_lateral (float) – The later flows to this FlowNode on the current substep.

finalize_timestep()[source]#

Finalize the current timestep at this FlowNode.

property outflow: float64#

The average outflow of the FlowNode over the current timestep.

property outflow_substep: float64#

The outflow of the FlowNode over the sub-timestep.

prepare_timestep()[source]#

Prepare the subtimestep for subtimestep calculations.

property sink_source: float64#

The sink or source amount of the FlowNode at the current subtimestep.

property storage: float64#

The storage of the FlowNode at the current subtimestep.

property storage_change: float64#

The storage change of the FlowNode at the current subtimestep.