class pyDeltaRCM.sed_tools.BaseRouter


Defines common methods for jitted routers.

Subclasses need to define run, _route_one_parcel, and _deposit_or_erode.


Although this class is configured with @abc.abstractmethod methods, we cannot actually enforce the implementation of this BaseRouter as an abstract class, because Numba does not support abstract classes (yet; The classes are included in the base class with abstract decorators to help make it clear that these methods need to be implemented in subclassing Router.


Initialize self. See help(type(self)) for accurate signature.



Initialize self.

run(*args, **kwargs)

_compute_Vp_ero(Vp_sed, U_loc, U_ero, beta)

Compute volume erorded based on velocity.

The volume of sediment eroded depends on the local flow velocity (U_loc), the critical velocity for erosion (U_ero), and beta.

Function is used by both sand and mud pathways, but the input value of U_ero depends on the pathway.

  • Vp_sed (float) – Volume of a sediment parcel.

  • U_loc (float) – Local flow velocity.

  • U_ero (float) – Critical velocity for erosion.

  • beta (float) – unknown.


Vp_ero – Volume of eroded sediment.

Return type


abstract _deposit_or_erode(px, py)

Determine whether to erode or deposit.

This is the decision making component of the routine, and will be different for sand vs mud.

_limit_Vp_change(Vp, stage, eta, dx, dep_ero)

Limit change in volume to 1/4 of a cell volume.

Function is used by multiple pathways in mud_dep_ero and sand_dep_ero but with different inputs for the sediment volume (Vp).

dep_ero indicates which pathway we are in, dep==0, ero==1

_update_fields(Vp_change, px, py)

Execute deposit of sand or mud.

Deposit sediment volume Vp_change. The change in bed elevation depends on the sediment mass conservation (i.e., Exner equation) and is equal to:

Vp_change / (dx * dx)

Following the sediment deposition/erosion, the new values for flow depth and flow velocity fields are determined.


Total sediment mass is preserved, but individual categories of sand and mud are not. I.e., it is assumed that there is infinite sand and/or mud to erode at any location where erosion is occurring.

  • Vp_change (float) – Volume of sediment to deposit / erode. If erosion, Vp_change should be negative.

  • px (int) – Index.

  • py (int) – Index.