landlab.components.stream_power.stream_power¶
- class StreamPowerEroder[source]¶
Bases:
Component
Erode where channels are.
Implemented as:
\[E = K A^m S^n - sp_{crit},\]and if \(E < 0\), \(E = 0\).
If
channel_width_field
is declared andTrue
, the module instead implements:\[E = K A^m S^n / W - sp_{crit}\]Note that although the Braun-Willett (2013) scheme that underlies this component is nominally implicit, and will reach a numerically-correct solution under topographic steady state regardless of timestep length, the accuracy of transient solutions is not timestep independent (see Braun & Willett 2013, Appendix B for further details). Although the scheme remains significantly more robust and permits longer timesteps than a traditional explicit solver under such conditions, it is still possible to create numerical instability through use of too long a timestep while using this component. The user is cautioned to check their implementation is behaving stably before fully trusting it.
Examples
>>> import numpy as np >>> from landlab import RasterModelGrid >>> from landlab.components import FlowAccumulator, StreamPowerEroder
>>> mg = RasterModelGrid((5, 5), xy_spacing=10.0) >>> z = np.array( ... [ ... [7.0, 7.0, 7.0, 7.0, 7.0], ... [7.0, 5.0, 3.2, 6.0, 7.0], ... [7.0, 2.0, 3.0, 5.0, 7.0], ... [7.0, 1.0, 1.9, 4.0, 7.0], ... [7.0, 0.0, 7.0, 7.0, 7.0], ... ] ... ) >>> z = mg.add_field("topographic__elevation", z, at="node") >>> fr = FlowAccumulator(mg, flow_director="D8") >>> sp = StreamPowerEroder(mg, K_sp=1.0) >>> fr.run_one_step() >>> sp.run_one_step(dt=1.0) >>> z array([7. , 7. , 7. , 7. , 7. , 7. , 2.92996598, 2.02996598, 4.01498299, 7. , 7. , 0.85993197, 1.87743897, 3.28268321, 7. , 7. , 0.28989795, 0.85403051, 2.42701526, 7. , 7. , 0. , 7. , 7. , 7. ])
>>> mg2 = RasterModelGrid((3, 7)) >>> z = np.array(mg2.node_x**2.0) >>> z = mg2.add_field("topographic__elevation", z, at="node") >>> mg2.status_at_node[mg2.nodes_at_left_edge] = mg2.BC_NODE_IS_FIXED_VALUE >>> mg2.status_at_node[mg2.nodes_at_top_edge] = mg2.BC_NODE_IS_CLOSED >>> mg2.status_at_node[mg2.nodes_at_bottom_edge] = mg2.BC_NODE_IS_CLOSED >>> mg2.status_at_node[mg2.nodes_at_right_edge] = mg2.BC_NODE_IS_CLOSED >>> fr2 = FlowAccumulator(mg2, flow_director="D8") >>> sp2 = StreamPowerEroder(mg2, K_sp=0.1, m_sp=0.0, n_sp=2.0, threshold_sp=2.0) >>> fr2.run_one_step() >>> sp2.run_one_step(dt=10.0) >>> z.reshape((3, 7))[1, :] array([ 0. , 1. , 4. , 8.52493772, 13.29039699, 18.44367949, 36. ])
>>> mg3 = RasterModelGrid((5, 5), xy_spacing=2.0) >>> z = mg.node_x / 100.0 >>> z = mg3.add_field("topographic__elevation", z, at="node") >>> mg3.status_at_node[mg3.nodes_at_left_edge] = mg3.BC_NODE_IS_FIXED_VALUE >>> mg3.status_at_node[mg3.nodes_at_top_edge] = mg3.BC_NODE_IS_CLOSED >>> mg3.status_at_node[mg3.nodes_at_bottom_edge] = mg3.BC_NODE_IS_CLOSED >>> mg3.status_at_node[mg3.nodes_at_right_edge] = mg3.BC_NODE_IS_CLOSED >>> mg3.at_node["water__unit_flux_in"] = mg3.node_y >>> fr3 = FlowAccumulator(mg3, flow_director="D8") >>> sp3 = StreamPowerEroder( ... mg3, ... K_sp=1.0, ... sp_type="Unit", ... a_sp=1.0, ... b_sp=0.5, ... c_sp=1.0, ... discharge_field="surface_water__discharge", ... ) >>> fr3.run_one_step() >>> sp3.run_one_step(1.0) >>> z array([0. , 0.1 , 0.2 , 0.3 , 0.4 , 0. , 0.02898979, 0.0859932 , 0.17463772, 0.4 , 0. , 0.02240092, 0.06879049, 0.14586033, 0.4 , 0. , 0.01907436, 0.05960337, 0.12929386, 0.4 , 0. , 0.1 , 0.2 , 0.3 , 0.4 ])
References
Required Software Citation(s) Specific to this Component
None Listed
Additional References
Braun, J., Willett, S. (2013). A very efficient O(n), implicit and parallel method to solve the stream power equation governing fluvial incision and landscape evolution. Geomorphology 180-181(C), 170-179. https://dx.doi.org/10.1016/j.geomorph.2012.10.008
Initialize the StreamPowerEroder.
- Parameters:
grid (ModelGrid) – A grid.
K_sp (float, array, or field name) – K in the stream power equation (units vary with other parameters).
threshold_sp (positive float, array, or field name, optional) – The threshold stream power, below which no erosion occurs. This threshold is assumed to be in “stream power” units, i.e., if sp_type is ‘Shear_stress’, the value should be tau**a.
sp_type ({'set_mn', 'Total', 'Unit', 'Shear_stress'}) –
Controls how the law is implemented. If ‘set_mn’, use the supplied values of m_sp and n_sp. Else, component will derive values of m and n from supplied values of a_sp, b_sp, and c_sp, following Whipple and Tucker:
If
'Total'
,m = a * c
,n = a
.If
'Unit'
,m = a * c *(1 - b)
,n = a
.If
'Shear_stress'
,m = 2 * a * c * (1 - b) / 3
,n = 2 * a / 3
.
m_sp (float, optional) – m in the stream power equation (power on drainage area). Overridden if a_sp, b_sp, and c_sp are supplied.
n_sp (float, optional, ) – n in the stream power equation (power on slope). Overridden if a_sp, b_sp, and c_sp are supplied.
a_sp (float, optional) – The power on the SP/shear term to get the erosion rate; the “erosional process” term. Only used if sp_type is not ‘set_mn’.
b_sp (float, optional) – The power on discharge to get width; the “hydraulic geometry” term. Only used if sp_type in (‘Unit’, ‘Shear_stress’).
c_sp (float, optional) – The power on area to get discharge; the “basin hydology” term. Only used if sp_type is not ‘set_mn’.
channel_width_field (None, float, array, or field name, optional) – If not None, component will look for node-centered data describing channel width or if an array, will take the array as the channel widths. It will use the widths to implement incision ~ stream power per unit width. If sp_type is ‘set_mn’, follows the equation given above. If sp_type in (‘Unit’, ‘Shear_stress’), the width value will be implemented directly. W has no effect if sp_type is ‘Total’.
discharge_field (float, field name, or array, optional) – Discharge [L^2/T]. The default is to use the grid field ‘drainage_area’. To use custom spatially/temporally varying rainfall, use ‘water__unit_flux_in’ to specify water input to the FlowAccumulator and use “surface_water__discharge” for this keyword argument.
erode_flooded_nodes (bool (optional)) – Whether erosion occurs in flooded nodes identified by a depression/lake mapper (e.g., DepressionFinderAndRouter). When set to false, the field flood_status_code must be present on the grid (this is created by the DepressionFinderAndRouter). Default True.
- property K¶
Erodibility (units depend on m_sp).
- __init__(grid, K_sp=0.001, threshold_sp=0.0, sp_type='set_mn', m_sp=0.5, n_sp=1.0, a_sp=None, b_sp=None, c_sp=None, channel_width_field=1.0, discharge_field='drainage_area', erode_flooded_nodes=True)[source]¶
Initialize the StreamPowerEroder.
- Parameters:
grid (ModelGrid) – A grid.
K_sp (float, array, or field name) – K in the stream power equation (units vary with other parameters).
threshold_sp (positive float, array, or field name, optional) – The threshold stream power, below which no erosion occurs. This threshold is assumed to be in “stream power” units, i.e., if sp_type is ‘Shear_stress’, the value should be tau**a.
sp_type ({'set_mn', 'Total', 'Unit', 'Shear_stress'}) –
Controls how the law is implemented. If ‘set_mn’, use the supplied values of m_sp and n_sp. Else, component will derive values of m and n from supplied values of a_sp, b_sp, and c_sp, following Whipple and Tucker:
If
'Total'
,m = a * c
,n = a
.If
'Unit'
,m = a * c *(1 - b)
,n = a
.If
'Shear_stress'
,m = 2 * a * c * (1 - b) / 3
,n = 2 * a / 3
.
m_sp (float, optional) – m in the stream power equation (power on drainage area). Overridden if a_sp, b_sp, and c_sp are supplied.
n_sp (float, optional, ) – n in the stream power equation (power on slope). Overridden if a_sp, b_sp, and c_sp are supplied.
a_sp (float, optional) – The power on the SP/shear term to get the erosion rate; the “erosional process” term. Only used if sp_type is not ‘set_mn’.
b_sp (float, optional) – The power on discharge to get width; the “hydraulic geometry” term. Only used if sp_type in (‘Unit’, ‘Shear_stress’).
c_sp (float, optional) – The power on area to get discharge; the “basin hydology” term. Only used if sp_type is not ‘set_mn’.
channel_width_field (None, float, array, or field name, optional) – If not None, component will look for node-centered data describing channel width or if an array, will take the array as the channel widths. It will use the widths to implement incision ~ stream power per unit width. If sp_type is ‘set_mn’, follows the equation given above. If sp_type in (‘Unit’, ‘Shear_stress’), the width value will be implemented directly. W has no effect if sp_type is ‘Total’.
discharge_field (float, field name, or array, optional) – Discharge [L^2/T]. The default is to use the grid field ‘drainage_area’. To use custom spatially/temporally varying rainfall, use ‘water__unit_flux_in’ to specify water input to the FlowAccumulator and use “surface_water__discharge” for this keyword argument.
erode_flooded_nodes (bool (optional)) – Whether erosion occurs in flooded nodes identified by a depression/lake mapper (e.g., DepressionFinderAndRouter). When set to false, the field flood_status_code must be present on the grid (this is created by the DepressionFinderAndRouter). Default True.
- 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 = (('drainage_area', "Upstream accumulated surface area contributing to the node's discharge"), ('flow__link_to_receiver_node', 'ID of link downstream of each node, which carries the discharge'), ('flow__receiver_node', 'Node array of receivers (node that receives flow from current node)'), ('flow__upstream_node_order', 'Node array containing downstream-to-upstream ordered list of node IDs'), ('topographic__elevation', 'Land surface topographic elevation'))¶
- 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 = ('drainage_area', 'flow__link_to_receiver_node', 'flow__receiver_node', 'flow__upstream_node_order', 'topographic__elevation')¶
- name = 'StreamPowerEroder'¶
- optional_var_names = ()¶
- output_var_names = ('topographic__elevation',)¶
- run_one_step(dt)[source]¶
A simple, explicit implementation of a stream power algorithm.
If you are routing across flooded depressions in your flow routing scheme, be sure to set erode_flooded_nodes flag in the instantiation of the component to ensure erosion cannot occur in the lake. Erosion is always zero if the gradient is adverse, but can still procede as usual on the entry into the depression unless this flag is set.
- Parameters:
dt (float) – Time-step size
- property shape¶
Return the grid shape attached to the component, if defined.
- unit_agnostic = True¶
- units = (('drainage_area', 'm**2'), ('flow__link_to_receiver_node', '-'), ('flow__receiver_node', '-'), ('flow__upstream_node_order', '-'), ('topographic__elevation', 'm'))¶
- 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 = (('drainage_area', 'node'), ('flow__link_to_receiver_node', 'node'), ('flow__receiver_node', 'node'), ('flow__upstream_node_order', 'node'), ('topographic__elevation', 'node'))¶