landlab.components.overland_flow.generate_overland_flow_kinwave

Landlab component for overland flow using the kinematic-wave approximation.

Created on Fri May 27 14:26:13 2016

@author: gtucker

class KinwaveOverlandFlowModel[source]

Bases: Component

Calculate water flow over topography.

Landlab component that implements a two-dimensional kinematic wave model. This is an extremely simple, unsophisticated model, originally built simply to demonstrate the component creation process. Limitations to the present version include: infiltration is handled very crudely, the called is responsible for picking a stable time step size (no adaptive time stepping is used in the run_one_step method), precipitation rate is constant for a given duration (then zero), and all parameters are uniform in space. Also, the terrain is assumed to be stable over time. Caveat emptor!

Examples

>>> from landlab import RasterModelGrid
>>> rg = RasterModelGrid((4, 5), xy_spacing=10.0)
>>> z = rg.add_zeros("topographic__elevation", at="node")
>>> s = rg.add_zeros("topographic__gradient", at="link")
>>> kw = KinwaveOverlandFlowModel(rg)
>>> kw.vel_coef
100.0
>>> rg.at_node["surface_water__depth"]
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0.])

References

Required Software Citation(s) Specific to this Component

None Listed

Additional References

None Listed

Initialize the KinwaveOverlandFlowModel.

Parameters:
  • grid (ModelGrid) – Landlab ModelGrid object

  • precip_rate (float, optional (defaults to 1 mm/hr)) – Precipitation rate, mm/hr

  • precip_duration (float, optional (defaults to 1 hour)) – Duration of precipitation, hours

  • infilt_rate (float, optional (defaults to 0)) – Maximum rate of infiltration, mm/hr

  • roughness (float, defaults to 0.01) – Manning roughness coefficient, s/m^1/3

__init__(grid, precip_rate=1.0, precip_duration=1.0, infilt_rate=0.0, roughness=0.01)[source]

Initialize the KinwaveOverlandFlowModel.

Parameters:
  • grid (ModelGrid) – Landlab ModelGrid object

  • precip_rate (float, optional (defaults to 1 mm/hr)) – Precipitation rate, mm/hr

  • precip_duration (float, optional (defaults to 1 hour)) – Duration of precipitation, hours

  • infilt_rate (float, optional (defaults to 0)) – Maximum rate of infiltration, mm/hr

  • roughness (float, defaults to 0.01) – Manning roughness coefficient, s/m^1/3

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 = (('surface_water__depth', 'Depth of water on the surface'), ('topographic__elevation', 'Land surface topographic elevation'), ('topographic__gradient', 'Gradient of the ground surface'), ('water__specific_discharge', 'flow discharge component in the direction of the link'), ('water__velocity', 'flow velocity component in the direction of the link'))
classmethod from_path(grid, path)

Create a component from an input file.

Parameters:
  • grid (ModelGrid) – A landlab grid.

  • path (str or file_like) – Path to a parameter file, contents of a parameter file, or a file-like object.

Returns:

A newly-created component.

Return type:

Component

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', 'topographic__gradient')
name = 'KinwaveOverlandFlowModel'
optional_var_names = ()
output_var_names = ('surface_water__depth', 'water__specific_discharge', 'water__velocity')
run_one_step(dt)[source]

Calculate water flow for a time period dt.

Default units for dt are seconds.

property shape

Return the grid shape attached to the component, if defined.

unit_agnostic = False
units = (('surface_water__depth', 'm'), ('topographic__elevation', 'm'), ('topographic__gradient', 'm/m'), ('water__specific_discharge', 'm2/s'), ('water__velocity', '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.

Parameters:

name (str) – A field name.

Returns:

The location (‘node’, ‘link’, etc.) where a variable is defined.

Return type:

str

var_mapping = (('surface_water__depth', 'node'), ('topographic__elevation', 'node'), ('topographic__gradient', 'link'), ('water__specific_discharge', 'link'), ('water__velocity', 'link'))
classmethod var_type(name)

Returns the dtype of a field (float, int, bool, str…).

Parameters:

name (str) – A field name.

Returns:

The dtype of the field.

Return type:

dtype

classmethod var_units(name)

Get the units of a particular field.

Parameters:

name (str) – A field name.

Returns:

Units for the given field.

Return type:

str

property vel_coef

Velocity coefficient.

(1/roughness)