landlab.components.potentiality_flowrouting.route_flow_by_boundary¶
This is an implementation of Vaughan Voller’s experimental boundary method reduced complexity flow router. Credit: Voller, Hobley, Paola.
Created on Fri Feb 20 09:32:27 2015
@author: danhobley (SiccarPoint), after volle001@umn.edu
- class PotentialityFlowRouter[source]¶
Bases:
Component
Multidirectional flow routing using a novel method.
This class implements Voller, Hobley, and Paola’s experimental matrix solutions for flow routing. The method works by solving for a potential field at all nodes on the grid, which enforces both mass conservation and flow downhill along topographic gradients. It is order n and highly efficient, but does not return any information about flow connectivity.
Options are permitted to allow “abstract” routing (flow enforced downslope, but no particular assumptions are made about the governing equations), or routing according to the Chezy or Manning equations. This routine assumes that water is distributed evenly over the surface of the cell in deriving the depth, and does not assume channelization. You will need to back- calculate channel depths for yourself using known widths at each node if that is what you want.
It is VITAL you initialize this component AFTER setting boundary conditions.
If Manning or Chezy specified, the surface_water__depth is the depth of flow in the cell, calculated assuming flow occurs over the whole surface.
Note that this component offers the property discharges_at_links. This returns the discharges at all links. If method==’D8’, this list will include diagonal links after the orthogonal links, which is why this information is not returned as a field.
Discharges at nodes are recorded as the outgoing total discharge (i.e., including any contribution from ‘water__unit_flux_in’).
The primary method of this class is
run_one_step
.Notes
This is a “research grade” component, and is subject to dramatic change with little warning. No guarantees are made regarding its accuracy or utility. It is not recommended for user use yet!
Examples
>>> from landlab import HexModelGrid >>> import numpy as np >>> mg = HexModelGrid( ... (4, 6), spacing=2.0, node_layout="rect", orientation="vertical" ... ) >>> z = mg.add_zeros("topographic__elevation", at="node") >>> Q_in = mg.add_ones("water__unit_flux_in", at="node") >>> z += mg.node_y.copy() >>> potfr = PotentialityFlowRouter(mg) >>> potfr.run_one_step() >>> mg.at_node["surface_water__discharge"][mg.core_nodes] array([11.70706863, 11.5709712 , 10.41329927, 9.24959728, 6.65448576, 6.39262702, 5.71410162, 5.04743495])
References
Required Software Citation(s) Specific to this Component
None Listed
Additional References
None Listed
- Parameters:
grid (ModelGrid) – A grid.
method ({'D8', 'D4'}, optional) – Routing method (‘D8’ is the default). This keyword has no effect for a Voronoi-based grid.
flow_equation ({'default', 'Manning', 'Chezy'}, optional) – If Manning or Chezy, flow is routed according to the Manning or Chezy equation; discharge is allocated to multiple downslope nodes proportional to the square root of discharge; and a water__depth field is returned. If default, flow is allocated to multiple nodes linearly with slope; and the water__depth field is not calculated.
Chezys_C (float (optional)) – Required if flow_equation == ‘Chezy’.
Mannings_n (float (optional)) – Required if flow_equation == ‘Manning’.
- __init__(grid, method='D8', flow_equation='default', Chezys_C=30.0, Mannings_n=0.03)[source]¶
- Parameters:
grid (ModelGrid) – A grid.
method ({'D8', 'D4'}, optional) – Routing method (‘D8’ is the default). This keyword has no effect for a Voronoi-based grid.
flow_equation ({'default', 'Manning', 'Chezy'}, optional) – If Manning or Chezy, flow is routed according to the Manning or Chezy equation; discharge is allocated to multiple downslope nodes proportional to the square root of discharge; and a water__depth field is returned. If default, flow is allocated to multiple nodes linearly with slope; and the water__depth field is not calculated.
Chezys_C (float (optional)) – Required if flow_equation == ‘Chezy’.
Mannings_n (float (optional)) – Required if flow_equation == ‘Manning’.
- static __new__(cls, *args, **kwds)¶
- cite_as = ''¶
- property coords¶
Return the coordinates of nodes on grid attached to the component.
- property current_time¶
Current time.
Some components may keep track of the current time. In this case, the
current_time
attribute is incremented. Otherwise it is set to None.- Return type:
current_time
- definitions = (('flow__potential', "Value of the hypothetical field 'K', used to force water flux to flow downhill"), ('surface_water__depth', 'Depth of water on the surface'), ('surface_water__discharge', 'Volumetric discharge of surface water'), ('topographic__elevation', 'Land surface topographic elevation'), ('water__unit_flux_in', 'External volume water per area per time input to each node (e.g., rainfall rate)'))¶
- property discharges_at_links¶
Return the discharges at links.
Note that if diagonal routing, this will return number_of_d8. Otherwise, it will be number_of_links.
- classmethod from_path(grid, path)¶
Create a component from an input file.
- property grid¶
Return the grid attached to the component.
- initialize_optional_output_fields()¶
Create fields for a component based on its optional field outputs, if declared in _optional_var_names.
This method will create new fields (without overwrite) for any fields output by the component as optional. New fields are initialized to zero. New fields are created as arrays of floats, unless the component also contains the specifying property _var_type.
- initialize_output_fields(values_per_element=None)¶
Create fields for a component based on its input and output var names.
This method will create new fields (without overwrite) for any fields output by, but not supplied to, the component. New fields are initialized to zero. Ignores optional fields. New fields are created as arrays of floats, unless the component specifies the variable type.
- Parameters:
values_per_element (int (optional)) – On occasion, it is necessary to create a field that is of size (n_grid_elements, values_per_element) instead of the default size (n_grid_elements,). Use this keyword argument to acomplish this task.
- input_var_names = ('topographic__elevation', 'water__unit_flux_in')¶
- name = 'PotentialityFlowRouter'¶
- optional_var_names = ()¶
- output_var_names = ('flow__potential', 'surface_water__depth', 'surface_water__discharge')¶
- run_one_step()[source]¶
Route surface-water flow over a landscape.
Both convergent and divergent flow can occur.
- property shape¶
Return the grid shape attached to the component, if defined.
- unit_agnostic = False¶
- units = (('flow__potential', 'm**3/s'), ('surface_water__depth', 'm'), ('surface_water__discharge', 'm**3/s'), ('topographic__elevation', 'm'), ('water__unit_flux_in', 'm/s'))¶
- classmethod var_definition(name)¶
Get a description of a particular field.
- Parameters:
name (str) – A field name.
- Returns:
A description of each field.
- Return type:
tuple of (name, *description*)
- classmethod var_help(name)¶
Print a help message for a particular field.
- Parameters:
name (str) – A field name.
- classmethod var_loc(name)¶
Location where a particular variable is defined.
- var_mapping = (('flow__potential', 'node'), ('surface_water__depth', 'node'), ('surface_water__discharge', 'node'), ('topographic__elevation', 'node'), ('water__unit_flux_in', 'node'))¶