Skip to content

Commit

Permalink
corrected spelling mistakes in comments, changed eta to f to be consi…
Browse files Browse the repository at this point in the history
…stent with text, added tests, cleaned up notebooks
  • Loading branch information
keckje committed May 7, 2024
1 parent 6abe4d3 commit 44aa86e
Show file tree
Hide file tree
Showing 5 changed files with 464 additions and 186 deletions.
25 changes: 13 additions & 12 deletions landlab/components/mass_wasting_runout/mass_wasting_runout.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def __init__(
the runout path [m], used to estimate erosion_coefficient k using
erosion_coef_k function. Default value: 3
typical slope_of_erosion_zone: floatf
typical slope_of_erosion_zone: float
field or remote sensing estimated slope in the scour dominated reach
of the runout path [L/L], used to estimate erosion_coefficient k using
erosion_coef_k function. Default value: 0.4
Expand All @@ -318,7 +318,8 @@ def __init__(
The exponent of equation 11, that scales erosion depth as a function of
shear stress. Default value: 0.5
max_flow_depth_observed: maximum observed flow depth, over the entire
max_flow_depth_observed: float
Maximum observed flow depth, over the entire
runout path [m], h_max in equation 24. Only used effective_qsi is True.
Default value: 4
Expand Down Expand Up @@ -379,7 +380,7 @@ def __init__(
self.save = save
self.h = typical_flow_thickness_of_erosion_zone
self.s = typical_slope_of_erosion_zone
self.eta = erosion_exponent
self.f = erosion_exponent
self.qsi_max = max_flow_depth_observed_in_field
if self.effective_qsi and self.qsi_max is None:
raise ValueError(
Expand Down Expand Up @@ -745,7 +746,7 @@ def EAqA(qsi_r):
self.nudat = np.concatenate((arn_ur, ll), axis=1)

def _determine_rn_proportions_attributes(self):
"""determine how outgoing flux is partioned to downslope cells and
"""determine how outgoing flux is partitioned to downslope cells and
attributes of each parition"""

def rn_proportions_attributes(nudat_r):
Expand Down Expand Up @@ -1027,12 +1028,12 @@ def _erosion(self, n, depth, slpn, att_in=None):

Tau = shear_stress_grains(self.vs, self.ros, Dp, depth, slpn, self.g)

Ec = self._grid.dx * erosion_rate(self.k, Tau, self.eta, self._grid.dx)
Ec = self._grid.dx * erosion_rate(self.k, Tau, self.f, self._grid.dx)

else:
# quasi-static approximation
Tau = self.ro_mw * self.g * depth * (np.sin(theta))
Ec = self.k * (Tau) ** self.eta
Ec = self.k * (Tau) ** self.f
u = np.nan

dmx = self._grid.at_node["soil__thickness"][n]
Expand Down Expand Up @@ -1317,11 +1318,11 @@ def shear_stress_static(vs, ros, rof, h, s, g):
return tau


def erosion_rate(k, tau, eta, dx):
E_l = (k * tau**eta) / dx
return E_l
def erosion_coef_k(E_l, tau, f, dx):
k = E_l * dx / (tau**f)
return k


def erosion_coef_k(E_l, tau, eta, dx):
k = E_l * dx / (tau**eta)
return k
def erosion_rate(k, tau, f, dx):
E_l = (k * tau**f) / dx
return E_l
288 changes: 145 additions & 143 deletions notebooks/tutorials/mass_wasting_runout/landslide_runout_animation.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"id": "1",
"metadata": {},
"source": [
"## Simulate the runout extent, sediment transport and topographic change caused by a rectangular landslide released on a sythetic terrain using MassWastingRunout"
"## Simulate the runout extent, sediment transport and topographic change caused by the runout of a rectangular landslide over a synthetic terrain using MassWastingRunout"
]
},
{
"cell_type": "markdown",
"id": "2",
"metadata": {},
"source": [
"#### In this tutorial, the user defines the geometry of a landslide, parameterizes MassWastingRunout (MWR) and chooses one of 6 sythetic terrains on which the runout of the landslide is modeled using MWR."
"#### In this tutorial, the user defines the rectangular geometry of a landslide, parameterizes MassWastingRunout (MWR) and chooses one of 6 synthetic terrains on which the runout of the landslide is modeled."
]
},
{
Expand All @@ -37,14 +37,14 @@
"#### Model overview\n",
"- MWR models the downslope progression of mass wasting processes such as debris flows or dry debris avalanches.\n",
"\n",
"- Mass continuity is central to model conceptualization; at any node, the incoming flux (q_I) erosion (E) and aggradation A) determine outgoing flux (q_O) and ultimtely the runout extent and how the landscape evolves. \n",
"- Mass continuity is central to model conceptualization; at any node, the incoming flux (q_I), erosion (E) and aggradation (A) determine outgoing flux (q_O) and ultimately the runout extent and how the landscape evolves. \n",
"\n",
"<div> \n",
"<img src = \"attachment:image-2.png\" width=\"200\"/>\n",
"<div>\n",
" \n",
" \n",
"- MWR uses a set of rules and algorithms to numercally represent the release of the mass wasting source material and erosion, deposition and vegetation/debris impacts on the runout process as illustrated below:"
"- MWR uses a set of rules and algorithms to numerically represent the release of the mass wasting source material and erosion, deposition and vegetation/debris impacts on the runout process as illustrated below:"
]
},
{
Expand All @@ -67,15 +67,15 @@
"id": "5",
"metadata": {},
"source": [
"<strong><em>(a)</em></strong> Release of the initial mass wasting source material nodes (represented by red cells) <strong><em>(b)</em></strong> How q_O at node n is distributed downslope after incoming material q_I (here equal to q_Dj=1) has aggraded (A) or eroded (E) node n <strong><em>(c)</em></strong> Mass continuity determines the change in regolith/topographic surface. For a full description of the above parameters, see Keck et al. (2024). "
"<strong><em>(a)</em></strong> Release of the initial mass wasting source material nodes (represented by red cells); <strong><em>(b)</em></strong> How q_O at node n (n = 45) is distributed downslope after incoming material q_I (here equal to flux from node 51) has aggraded (A) or eroded (E) node n; <strong><em>(c)</em></strong> Mass continuity determines the change in regolith thickness/topographic elevation. For a full description of the above parameters, see Keck et al. (2024). "
]
},
{
"cell_type": "markdown",
"id": "6",
"metadata": {},
"source": [
"#### First import packages and components necessary to run MWR and visualize results"
"#### To begin, first import packages and components necessary to load MWR inputs, run MWR and visualize model results."
]
},
{
Expand All @@ -100,8 +100,8 @@
"id": "8",
"metadata": {},
"source": [
"#### Next, define the mass wasting source area (landslide) geometry <br>\n",
"In this notebook, we define the landslide as a rectanglar prism. In later notebooks, we will use an actual landslide body."
"#### Next, define the mass wasting source area (landslide) geometry. <br>\n",
"In this notebook, we define the geometry of the landslide as a rectangular prism. In later notebooks, we will use the geometry of a landslide body observed in the field."
]
},
{
Expand All @@ -113,17 +113,17 @@
"source": [
"ls_width = 3 # number of cells wide, must be odd number\n",
"ls_length = 5 # number of cells long\n",
"ls_h = 3 # thickness\n",
"soil_thickness = 2 # thickness of soil (regolith) covering synthetic terrain"
"ls_h = 3 # thickness, m\n",
"soil_thickness = 2 # thickness of soil (regolith) covering synthetic terrain, m"
]
},
{
"cell_type": "markdown",
"id": "10",
"metadata": {},
"source": [
"#### Then, define key MWR parameters, MassWastingRunout parameters S_c, q_c and k.<br>\n",
"In MWR, S_c is a critical slope constraint. For some flows, S_c can be approximated from the surface slope of observed deposits. q_c is the threshold flux for deposition, that conceptually represents the flow depth below which flow resistance is large enough to cease the forward momentum of the flow, whether in the form of frictional resistance along the base of the flow or debris and vegetation in the path of the flow. Parameter k scales the erosion rate. We also specify the typical partical diameter found in the regolith because in this example, we will use an erosion rule that varies as a function of grain size."
"#### Then, define key MWR parameters S_c, q_c and k.<br>\n",
"In MWR, S_c is a critical slope constraint. For some flows, it may be possible to approximate S_c from the surface slope of observed deposits. The parameter q_c is the threshold flux for deposition, that conceptually represents the flow depth below which flow resistance is large enough to cease the forward momentum of the flow, whether in the form of frictional resistance along the base of the flow or debris and vegetation in the path of the flow. Parameter k scales the erosion rate.<br> We also specify the typical particle diameter found in the regolith because in this example, we will use an erosion rule that varies as a function of the flow grain size."
]
},
{
Expand All @@ -133,21 +133,20 @@
"metadata": {},
"outputs": [],
"source": [
"q_c = 0.2 # threshold flux\n",
"q_c = 0.2 # threshold flux, m\n",
"S_c = 0.03 # critical slope\n",
"k = 0.01 # erosion coefficient\n",
"Dp = 0.2 # particle diameter"
"Dp = 0.2 # particle diameter, m"
]
},
{
"cell_type": "markdown",
"id": "12",
"metadata": {},
"source": [
"#### Now, pick which terrain to model runout on: <br>\n",
"The convergence of each terrain ranges from divergent to steeply convergent.<br> \n",
"Model results using ls_width = 3, ls_length = 5, ls_h = 3, soil_thickness = 2, qs_max = ls_h, q_c = .25, S_c = 0.03, k = 0.005, and Dp = 0.2 are shown on each terrain below, shaded according to the DEM of Difference. Red indicates a positive change in the elevation of the terrain (aggradation) and blue indicates a negative change (erosion).<br>\n",
"The terrains were created in an external script and are loaded as an ascii file.\n"
"#### Now, pick which terrain the landslide will runout on. <br>\n",
"The planimetric curvature of each terrain ranges from divergent to steeply convergent. In profile, the terrains include concave-up, convex-up, planar and broken.<br> \n",
"Terrains are shaded with the DEM of Difference (DoD) of previous model results using ls_width = 3, ls_length = 5, ls_h = 3, soil_thickness = 2, qs_max = ls_h, q_c = .25, S_c = 0.03, k = 0.005, and Dp = 0.2. Red indicates a positive change in the elevation of the terrain (aggradation) and blue indicates a negative change (erosion).<br>"
]
},
{
Expand Down Expand Up @@ -199,7 +198,7 @@
"metadata": {},
"source": [
"#### Now, define a few functions that will create the landslide from the given dimensions and plot model results.<br>\n",
"These functions are not necessary to run the model and are only included in this notebook for visualizing and setting up the sythetic terrains."
"These functions are not necessary to run the model and are only included in this notebook for visualizing and setting up the synthetic terrains."
]
},
{
Expand All @@ -209,7 +208,7 @@
"metadata": {},
"outputs": [],
"source": [
"# ploting functions, adapted from flow-director notebooks\n",
"# plotting functions, adapted from flow-director notebooks\n",
"\n",
"\n",
"def surf_plot(mg, surface=\"topographic__elevation\", title=\"\", zlim=None):\n",
Expand Down Expand Up @@ -337,9 +336,8 @@
"# set boundary conditions\n",
"mg.set_closed_boundaries_at_grid_edges(\n",
" True, True, True, False\n",
") # close all boundaries except end of flucme\n",
") # close all boundaries except end of flume\n",
"dem = mg.at_node[\"topographic__elevation\"]\n",
"# mg.set_watershed_boundary_condition_outlet_id(cc,dem)\n",
"\n",
"# run flow director, add slope and receiving node fields\n",
"fd = FlowDirectorMFD(mg, diagonals=True, partition_method=\"square_root_of_slope\")\n",
Expand Down Expand Up @@ -412,7 +410,7 @@
"id": "22",
"metadata": {},
"source": [
"#### Now set up an instance of MWR using the newly defined raster model grid and the landslide and run the model! "
"#### Now set up an instance of MWR using the newly defined raster model grid and landslide and run the model! "
]
},
{
Expand All @@ -422,7 +420,7 @@
"metadata": {},
"outputs": [],
"source": [
"# setting up the model\n",
"# set up the model\n",
"MWRu = MassWastingRunout(\n",
" mg,\n",
" critical_slope=[S_c],\n",
Expand All @@ -435,7 +433,7 @@
" grain_shear=True,\n",
" settle_deposit=False,\n",
")\n",
"# running the model\n",
"# run the model\n",
"MWRu.run_one_step()"
]
},
Expand All @@ -444,8 +442,8 @@
"id": "24",
"metadata": {},
"source": [
"#### Once the model has finished running, view the runout extent and how the topography changed. <br>\n",
"Here the terrain is shown following the runout of the slide and is now colored according to the DEM of Difference. Notice how the landslide removed material at its source, and except for lateral levees, eroded over most of the runout path. The runout material deposited once the slope of the terrain << Sc. Again, red indicates a positive change in the elevation of the terrain (aggradation) and blue indicates a negative change (erosion)."
"#### Once the model has finished running, view the runout extent and how the landslide runout modified the terrain. <br>\n",
"Here the terrain is shown following the runout of the landslide and is now colored according to the DoD. Notice how the landslide removed material at its source, and except for lateral levees, eroded over most of the runout path. The runout material deposited once the slope of the terrain << S_c. Again, red indicates a positive change in the elevation of the terrain (aggradation) and blue indicates a negative change (erosion)."
]
},
{
Expand Down Expand Up @@ -481,7 +479,7 @@
"id": "26",
"metadata": {},
"source": [
"#### Finally, watch an animation of the runout process that created the final erosion and depostional pattern shown above."
"#### Finally, watch an animation of the runout process that created the final erosion and depositional pattern shown above. The runout is visualized as the DoD of each model iteration. <br>"
]
},
{
Expand Down Expand Up @@ -547,7 +545,7 @@
"id": "28",
"metadata": {},
"source": [
"#### Now that you've seen an example model run, try re-running this notebook with different parameter values and landslide geometry to see how it responds!"
"#### Now that you've seen an example, try re-running this notebook with different parameter values, terrains and landslide geometries to see how MWR responds!"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion tests/components/mass_wasting_runout/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def flume_maker(
length of landslide in number of cells, must be <= than rows-2
dxdy : float
side length of sqaure cell, [m]. The default is 10.
double_flume : boolean
double_flume : bool
False: makes just one flume; True: makes two flumes and puts attaches the
lower end of one to the upper end of the other to make one long flume with
a slope break in the middle of the flume
Expand Down
Loading

0 comments on commit 44aa86e

Please sign in to comment.