from pathlib import Path
import numpy as np
import panel as pn
import coastal_dynamics as cd
# Activate Panel extension to make interactive visualizations
pn.extension()
8c: Equilibrium concentration versus lag effects
You have reached the third notebook of this week. As mentioned in the previous notebook, things get a little more complicated when we consider finer sediment travelling in suspension. Finer sediment takes relatively longer to settle, meaning that it does not respond instantaneously to the tidal flow and our quasi-steady assumption does not hold - we discussed this in Chapter 6. This makes estimating fine sediment concentrations a bit more challenging.
This notebook consists of two parts. In the first part, we will recreate Figure 9.32 of the Coastal Dynamics Open Textbook. This part contains three coding exercises and five multiple-choice and multiple-selection questions. You will amongst others: - Consider the equilibrium concentration. This is the concentration that would be reached if the sediment is able to instantaneously adjust to the time-varying tidal current - Include a lag effect, which represents that fine sediment concentrations not only depend on the instantaneous flow conditions, but on the conditions upstream and in the past as well.
In the second part of the notebook, you can explore the effect of using different parameter values using an interactive figure. With this figure, you can create alternatives to Figure 9.32 with different settings of some of the important parameters. To help you interpret the effect of the various settings, this part comes with six multiple-choice and multiple-selection questions.
Before starting this notebook, make sure you followed the lectures on Chapter 9 (or read the slides) and read Section 9.7.3 of the book, which is on fine sediment transport and siltation. Specifically, study Figure 9.32 in the book, since we are going to reproduce that figure in this notebook!
First import some necessary packages
Let’s first import the libraries that we use for our analysis by running the next cells.
import sys
sys.path.append('../')
from modules import mod_8# read questions locally
questions = cd.read_questions(Path("../hashed_questions/8_tidal_basins_hashed.json"))
question_industry = cd.QuestionIndustry(questions)
cd.UseAnswersApp("Q8c").serve()Part 1: Recreate Figure 9.32
In this notebook, we will step-by-step reproduce Figure 9.32 in the book. This means we need to determine the tidal velocity signal \(u\), the equilibrium concentration \(c_{eq}\), the actual concentration and the sediment flux \(uc\).
The velocity signal
As before, we assume that the tidal current velocity is given by the M2 component and its first overtide:
\[\begin{equation} \tag{1} u(t) = {u}_{M2}(t) + {u}_{M4}(t) = \hat{u}_{M2} \cos(\omega_{M2} t) + \hat{u}_{M4} \cos(\omega_{M4} t - \phi_{M4-2}) \end{equation}\]
with \(\phi_{M4-2}\) the phase of M4 relative to M2.
Figure 9.32 assumes that \(\frac{\hat{u}_{M4}}{\hat{u}_{M2}} = 0.25\) and \(\phi_{M4-2} = \frac{3}{2} \pi\). In line with this, we choose the following values for the amplitude and phase of the M2 and M4 tidal current components:
| Component | Amplitude [cm/s] | Phase [degrees] | Phase [rad] |
|---|---|---|---|
| M2 | \(\hat{u}_{M2}\) = 100 | - | - |
| M4 | \(\hat{u}_{M4}\) = 25 | φ₄₂ = 270 | φ₄₂ = 3/2 π |
On a side note: we choose these relatively large current velocities, since having \(\left|u\right| \sim 1\) implies \(u \sim \left|u\right|^{n-1}\). This will proof to be handy when plotting the concentrations and make the comparison with Figure 9.32 easier.
Coding exercise 1: the velocity signal
Complete the code below to plot the tidal velocities during three M2 periods. Run also the subsequent cell to get the plot. Note that the horizontal axis of Figure 9.32 shows a single M2 period, in rad, whereas the figure we create here shows three M2 periods, in hrs.
## Use this code cell to compute your answer.
t = np.linspace(-1 * (12 * 3600 + 25 * 60), 2 * (12 * 3600 + 25 * 60), 1000)
u = np.zeros(t.shape)
################# ADD CODE HERE ####################
# u = ...
####################################################mod_8.plot_u_int(u)The equilibrium concentration
As a next step, we will use Equation 9.29 in the book to plot the equilibrium concentration c\(_{eq}\). It reads:
\[\begin{equation} \tag{2} c_{eq}(t) = \beta \left|u(t)\right|^{n-1} \end{equation}\]
You can see that the equilibrium concentration c\(_{eq}\) responds quasi-steadily to some power of the velocity, with \(n\) = 3 to 5. The power \(n\) is thought to depend on the type of sediment. With c\(_{eq}\) expressed as a volume concentration with units m\(^3\)/m\(^3\), the coefficient \(\beta\) has units m\(^{1-n}\)s\(^{n-1}\). Note that it is non-trivial to determine an appropriate \(\beta\)-value and that we have not made an explicit choice in Figure 9.32 (there are no magnitudes on the vertical axis!).
Coding exercise 2: the equilibrium concentration
Now add your own solution for the equilibrium concentration c\(_{eq}\) to the code cell below. Note that: 1. In the code, you can see that we use \(n = 5\) in accordance with the value used to create Figure 9.32 in the book. 2. For the computations, we arbitrarily choose a value of \(10^{-4}\) m\(^{-4}\)s\(^{4}\) for \(\beta\). 3. For the plots, we scale the concentration with our chosen value of \(\beta\), so the concentrations are given in units \(\beta\) m\(^3\)/m\(^3\) or \(10^{-4}\) m\(^3\)/m\(^3\).
## Use this code cell to compute your answer.
beta = 10**-4
n = 5
c_eq = np.zeros(t.shape)
################# ADD CODE HERE ####################
# c_eq = ...
####################################################mod_8.plot_c_eq(c_eq, beta, n)Questions about velocity and equilibrium concentration
Reflect on the plots you created by answering the questions below.
q = [
"Q8c-quasi-steady",
"Q8c-fine_equilibrium_concentration",
]
question_industry.serve(q)Actual sediment concentration
Fine sediment concentrations (typically mud (silt/clay)), do not only depend on the instantaneous flow conditions, but on the conditions upstream and in the past as well. Looking at Equation 9.28 in the book, we can see that the equation for the actual concentration contains a material time derivative (\(\frac{D c}{D t}\)), because we are describing a spatially/temporally-varying scalar concentration field as it is transported by a flow vector field (we are moving along with the sediment flow).
Here, we are not considering the spatial gradients and use the following equation to express the delayed response of the sediment:
\[\begin{equation} \tag{3} \frac{d c}{d t} = \frac{1}{T_{Sed}} \left( c_{eq}(t) - c(t) \right) \end{equation}\]
with \(T_{Sed}\) the adjustment or relaxation timescale: the timescale for which the suspended sediment concentration approaches the equilibrium concentration. Although we should in principle distinguish between the adjustment timescales for sedimentation \(T_{Se}\) and for erosion \(T_{Er}\), we are going to assume they are the same in the following and only discuss the sedimentation time scale (so we assume \(T_{Sed} = T_{Se}\)).
The sedimentation timescale \(T_{Se}\) implictly relates to the time required for a particle to settle a depth of \(h\) at velocity \(w_s\) and is therefore proportional to \(\frac{h}{w_s}\). The table below indicates typical settling or sedimentation timescales for sand and fine sediment, assuming \(h\) = 5 m: | | \(w_s\) | \(T_{Se}\) | |——-|———-|———| | 200 \(\mu\)m sand | 2 cm/s | 4 min | | Fines | 0.5 mm/s | 2.8 hrs |
These values were taken from p.83 of Winterwerp et al., 2022. Note that this book on fine sediments is available as an e-book in the TU Delft Library!
How does the timescale for the sand and for the fines relate to typical tidal periods? Let’s find out what implies for sediment concentrations and sediment transport.
Coding exercise 3: the actual concentration.
Use Eq. 3 to account for the delayed sediment response. In order to obtain a solution for the concentration, a discretization is required. Use the following discretization (Forward Euler) for quantity \(c\) in order to model the sediment concentration:
\[\begin{equation} \tag{4} \frac{d c}{d t} \approx \frac{c_{j+1} - c_{j}}{\Delta t} \end{equation}\]
We are starting at a concentration \(c = c_{eq}\) for the first time in the time record (this is already given in the code). The relaxation timescale \(T_{sed}\) is also already given in the code as 8,940 seconds (i.e., 2 hrs 29 mins, or 20% of the M2 period). This is the same value that we used to create Figure 9.32.
Continue from your solution for the equilibrium concentration from earlier, and complete the code below to plot the concentration as a function of time. Use the timestep \(\Delta t\) as already coded for you.
# determine timestep from above defined time array
dt = t[1]-t[0]
Tsed = 8940
# initialize concentration array and set initial concentration equal to equilibrium concentration
c = np.zeros(t.shape)
c[0] = c_eq[0]
for j in range(len(c)-1):
################# ADD CODE HERE ####################
# c = ...
####################################################
passmod_8.plot_c(c, beta, n)Questions about the actual concentration
Reflect on the plot you created by answering the questions below.
q = [
"Q8c-initial_concentration1",
"Q8c-actual_versus_equilibrium",
]
question_industry.serve(q)Sediment flux
We’ve seen how to compute the velocity \(u\), equilibrium concentration \(c_{eq}\), and concentration \(c\). Now it is trivial to also compute the time-dependent sediment flux as the product of the velocity \(u\) and the concentration \(c\). Let’s combine everything in one plot, including the flux \(uc\), and compare the resulting figure with Figure 9.32 in the book! Just run the next cell to get the plot.
In order to facilitate comparison with Figure 9.32, we have converted the horizontal axis from \(t\) [hrs] to \(\omega_{M2} t\) [rad]. Also, we selected the last of the three M2 periods to plot, such that we have the same axis range as in Figure 9.32. When you zoom out, you can still see all three M2 periods for which we performed the calculation, to include sufficient spin-up time.
mod_8.plot_fig932()Question about the sediment flux
You can see that the above plot is as good as identical to Figure 9.32. This of course also holds for the areas A1 and A2 between the green line and the horizontal axis; A1 is 30% larger in size than A2.
Reflect on the plot above / Figure 9.32, by answering the question below.
q = [
"Q8c-net_sediment_flux_figure932",
]
question_industry.serve(q)Part 2: Changing parameter values using interactive figure
Finally, we created an app so you can try different values for each of the variables. Run the cell below to generate it! Using this app, try to answer the questions that you get when running the subsequent cell.
(mod_8.velocity_concentration_app())q = [
"Q8c-increase_sediment_size",
"Q8c-shallow_intertidal_flats",
"Q8c-settling_velocity",
"Q8c-importPhases_instantaneous",
"Q8c-importPhases_lagged",
"Q8c-initial_concentration2",
]
question_industry.serve(q)The end
You have reached the end of this Notebook 8c: Equilibrium concentration versus lag. You can continue to work on the other notebooks for this week.