landlab.components.nonlinear_diffusion.Perron_nl_diffuse

class PerronNLDiffuse[source]

Bases: Component

Nonlinear diffusion, following Perron (2011).

This module uses Taylor Perron’s implicit (2011) method to solve the nonlinear hillslope diffusion equation across a rectangular, regular grid for a single timestep. Note it works with the mass flux implicitly, and thus does not actually calculate it. Grid must be at least 5x5.

Boundary condition handling assumes each edge uses the same BC for each of its nodes. This component cannot yet handle looped boundary conditions, but all others should be fine.

This component has KNOWN STABILITY ISSUES which will be resolved in a future release; use at your own risk.

The primary method of this class is run_one_step.

Examples

>>> from landlab.components import PerronNLDiffuse
>>> from landlab import RasterModelGrid
>>> import numpy as np
>>> mg = RasterModelGrid((5, 5))
>>> z = mg.add_zeros("topographic__elevation", at="node")
>>> nl = PerronNLDiffuse(mg, nonlinear_diffusivity=1.0)
>>> dt = 100.0
>>> nt = 20
>>> uplift_rate = 0.001
>>> for i in range(nt):
...     z[mg.core_nodes] += uplift_rate * dt
...     nl.run_one_step(dt)
...
>>> z_target = [
...     [0.0, 0.0, 0.0, 0.0, 0.0],
...     [0.0, 0.00778637, 0.0075553, 0.00778637, 0.0],
...     [0.0, 0.0075553, 0.0078053, 0.0075553, 0.0],
...     [0.0, 0.00778637, 0.0075553, 0.00778637, 0.0],
...     [0.0, 0.0, 0.0, 0.0, 0.0],
... ]
>>> np.allclose(z.reshape(mg.shape), z_target)
True

References

Required Software Citation(s) Specific to this Component

None Listed

Additional References

Perron, J. (2011). Numerical methods for nonlinear hillslope transport laws. Journal of Geophysical Research 116(F2), 23 - 13. https://dx.doi.org/10.1029/2010jf001801

Parameters:
  • grid (RasterModelGrid) – A Landlab raster grid

  • nonlinear_diffusivity (float, array or field name) – The nonlinear diffusivity

  • S_crit (float (radians)) – The critical hillslope angle

  • rock_density (float (kg*m**-3)) – The density of intact rock

  • sed_density (float (kg*m**-3)) – The density of the mobile (sediment) layer

__init__(grid, nonlinear_diffusivity=0.01, S_crit=0.5759586531581288, rock_density=2700.0, sed_density=2700.0)[source]
Parameters:
  • grid (RasterModelGrid) – A Landlab raster grid

  • nonlinear_diffusivity (float, array or field name) – The nonlinear diffusivity

  • S_crit (float (radians)) – The critical hillslope angle

  • rock_density (float (kg*m**-3)) – The density of intact rock

  • sed_density (float (kg*m**-3)) – The density of the mobile (sediment) layer

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 = (('topographic__elevation', 'Land surface topographic elevation'),)
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',)
name = 'PerronNLDiffuse'
optional_var_names = ()
output_var_names = ('topographic__elevation',)
run_one_step(dt)[source]

Run the diffuser for one timestep, dt.

This is the primary method of the class.

Parameters:

dt (float (time)) – The imposed timestep.

property shape

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

unit_agnostic = True
units = (('topographic__elevation', 'm'),)
updated_boundary_conditions()[source]

Call if grid BCs are updated after component instantiation.

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 = (('topographic__elevation', 'node'),)
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