From 991ebd7f7ea41f9cacb7ad5d8d522755fd1c07fc Mon Sep 17 00:00:00 2001 From: ChristiaanDHoogervorst <145754988+ChristiaanDHoogervorst@users.noreply.github.com> Date: Thu, 21 Dec 2023 16:23:08 +0100 Subject: [PATCH] Add files via upload (#38) --- notebooks/week_2.ipynb | 688 +++++++++++++++++++++++++++++++++++++++++ notebooks/week_3.ipynb | 419 +++++++++++++++++++++++++ 2 files changed, 1107 insertions(+) create mode 100644 notebooks/week_2.ipynb create mode 100644 notebooks/week_3.ipynb diff --git a/notebooks/week_2.ipynb b/notebooks/week_2.ipynb new file mode 100644 index 0000000..72c9461 --- /dev/null +++ b/notebooks/week_2.ipynb @@ -0,0 +1,688 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "08b7ff1c-1e3c-4917-bc39-d046ecfa68eb", + "metadata": {}, + "source": [ + "
\n", + " \n", + "
\n", + "\n", + "Before you is the Jupiter Notebook of week 2. This notebook will be incorporated in a Jupiter Book, which has the option to hide the code of the cells. " + ] + }, + { + "cell_type": "markdown", + "id": "562c17ce-311a-46be-acdf-e360ce7dd3ee", + "metadata": {}, + "source": [ + "# Week 2 Oceanic waves and tide" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "593e05c2-cc9c-4c0d-a9bb-bf0fee870c29", + "metadata": {}, + "outputs": [], + "source": [ + "%run Initialize/Week_2_Initialize.ipynb" + ] + }, + { + "cell_type": "markdown", + "id": "ce68662a-75b4-482d-bb7f-81a4f8b5e1e1", + "metadata": {}, + "source": [ + "Wind-generated and tidal waves can travel great distances until they finally reach the coast. In this section, we discuss the propagation of both individual waves and the behaviour of a group of waves together. It is recommended to read chapter ?3? of the book Coastal Dynamics when studying this codebook." + ] + }, + { + "cell_type": "markdown", + "id": "aff5fd63-f3ea-44f8-9f8e-7f5d3093b220", + "metadata": {}, + "source": [ + "## 2.1) pre-knowledge on waves" + ] + }, + { + "cell_type": "markdown", + "id": "adc11ad6-a933-4eb2-ae1e-c3ccc9282a81", + "metadata": {}, + "source": [ + "This optional section focuses on the material studied in the course waves (CIE....) that is related to the dispersion relationship. We will discuss how the wavelength can be calculated through an iterative approach, by tables, and by an explicit formula and then ask you to calculate various wave parameters." + ] + }, + { + "cell_type": "markdown", + "id": "31bed71d-9b3b-4fa5-af1b-c10b831b92b4", + "metadata": {}, + "source": [ + "### 2.1.1) Dispersion relation" + ] + }, + { + "cell_type": "markdown", + "id": "7f0bd34e-08c4-4982-896f-2048a7d66d13", + "metadata": {}, + "source": [ + "We will discuss how the wavelength can be calculated through an iterative approach, by tables, and by an explicit formula. You may reuse the code you made for the course Waves." + ] + }, + { + "cell_type": "markdown", + "id": "2a114d05-5f24-4e67-9d96-db68b161b910", + "metadata": {}, + "source": [ + "#### Iterative approach" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "97b3d1ef-453f-4d14-8d9b-04f946859ff0", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q1()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "949fa014-71b0-4bab-a725-f4a9928c7a43", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "571d9f63-5282-4b09-945b-b15a1b9e7f41", + "metadata": {}, + "source": [ + "#### Wave length through table" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9d501454-fe56-4519-a24f-c67031a4218c", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q2()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6a6ed4f5-73a2-4608-9a0b-78604e6bb825", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "0be84b2b-bce7-49f1-9886-9319d134191b", + "metadata": {}, + "source": [ + "#### Explicit formula" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ee3b2444-0ade-4387-ae7a-97d86d803ec9", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q3()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "451e2351-93f3-48ba-85a5-d4da1023b2ea", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "6ed154de-80a9-4b69-ab37-07aa09da42ee", + "metadata": {}, + "source": [ + "### 2.1.2) Wave characteristics" + ] + }, + { + "cell_type": "markdown", + "id": "1396d7b3-fe65-4105-a1cc-03db7ff11489", + "metadata": {}, + "source": [ + "The dispersion relation can be used to calculate and interchange between the wave length and wave period and thereby asses their related parameters. Can you calculate the asked wave characteristics in the questions below? " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "426fe0d5-f7a5-4c7d-a5e7-8755c23a56f1", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q4()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d15a07ab-14be-4228-85c4-36d4f5c850ed", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "7f22d79a-8d43-4896-b945-60308b37e733", + "metadata": {}, + "source": [ + "### 2.1.3) Shallow, intermediate, and deep water" + ] + }, + { + "cell_type": "markdown", + "id": "d087bc0d-2be5-4acb-9eb2-e2a3472a1053", + "metadata": {}, + "source": [ + "The wave experiences deep, intermediate, or shallow water conditions. Can you asses which conditions the wave experiences? You can use the cell below for your computations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ce0a360e-4558-4ebc-8b1b-f161cdd66608", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q5()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fca378b7-7841-42a9-8f3f-83becd1a473c", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "9121657e-c30b-4690-a84c-cdc1719ebcb5", + "metadata": {}, + "source": [ + "## 2.2) Dispersion relation for tsunami waves" + ] + }, + { + "cell_type": "markdown", + "id": "ca701a8c-c317-479e-9286-70f894afe575", + "metadata": {}, + "source": [ + "The dispersion relation can be used for all kinds of waves, including tsunami waves. Can you asses the characteristic of tsunami waves at various water depth classifications? Previously created functions and the cell below can be used to answer the question." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cf276d18-2b08-445f-ae9a-60c76fc7e3f8", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q6()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9e71193-992a-4d51-8246-d8b5159c0426", + "metadata": {}, + "outputs": [], + "source": [ + "# You can use this cell for answering the question" + ] + }, + { + "cell_type": "markdown", + "id": "22671e3e-a2c0-4b12-883d-c405d476e939", + "metadata": {}, + "source": [ + "## 2.3) Dispersion relation in the cross-shore direction" + ] + }, + { + "cell_type": "markdown", + "id": "011ad064-a9f8-4da1-90e9-603a9e76a8f7", + "metadata": {}, + "source": [ + "The water depth can sometimes influence the wave propagation speed, as we have seen in the previous question. There are two types of exceptions, namely deep water and shallow water. In deep water is the depth so large that the orbital velocities of the wave do not reach the bottom and no interaction between the waves and the bed is possible. In this case, the wave celerity is only affected by the wave period. The other extreme is in shallow water, where only the water depth influences the wave celerity, and the wave period is irrelevant. This can lead to waves with the same celerity (non-dispersive waves) even though they have different characteristics. Both of these waves should meet the requirements for shallow water conditions. In other words, although both waves are in the same location, one can be in shallow water while the other is not, and so both waves have a different celerity. \n", + "\n", + "You check the wavelength and celerity for 3 wave components in the cross-shore direction in the interactive graph below. The wave celerity constant is at the deep water location, then the wave celerity decreases in the intermediate water depth. In one section of the graphs, the celerity for all 3 wave components is equal, which indicates that all the 3 wave components experience shallow water, where the wave period is irrelevant as only the water depth influences the propagation speed." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0faea40d-0f0d-4d05-a35a-9dbd53ee8e31", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q7()" + ] + }, + { + "cell_type": "markdown", + "id": "54250805-5302-4c09-a3f9-03f7b164d2c2", + "metadata": {}, + "source": [ + "## 2.4) Wave groups" + ] + }, + { + "cell_type": "markdown", + "id": "bc29525f-15a1-4458-a95a-259a1a7317f9", + "metadata": {}, + "source": [ + "Multiple waves (components) can coexist, influencing the sea surface elevation, currents, etc. The sea surface elevation can be described by substituting the harmonic components, as expressed in formula 2.4.1.\n", + "\n", + "\\begin{equation}\n", + "\\tag{2.4.1}\n", + "\\eta = a_1 sin(w_1t-k_1x) + a_2 sin(w_2t-k_2x)\n", + "\\end{equation}\n", + "\n", + "This can be rewritten to formula 2.4.2, when $a_1 = a_2 = a$.\n", + "\n", + "\\begin{equation}\n", + "\\tag{2.4.2}\n", + "\\eta = 2a sin(\\frac{\\omega_2+\\omega_1}{2}t - \\frac{k_2+k_1}{2}x)cos(\\frac{\\omega_2-\\omega_1}{2}t-\\frac{k_2-k_1}{2}x)\n", + "\\end{equation}\n", + "\n", + "Which can be expressed in terms of differences ($\\Delta$) and averaged values (indicated with a bar) for the radial frequency and wave number, resulting in:\n", + "\n", + "\\begin{equation}\n", + "\\tag{2.4.3}\n", + "\\eta = 2a sin(\\bar\\omega t - \\bar k x)cos(\\frac{\\Delta\\omega}{2}t - \\frac{\\Delta k}{2}x)\n", + "\\end{equation}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9e9f4ddc-98a1-4896-b19d-34297103384d", + "metadata": {}, + "outputs": [], + "source": [ + "W2_wave_groups()" + ] + }, + { + "cell_type": "markdown", + "id": "bdfbf043-583b-4ad4-92c5-9664e1d92a13", + "metadata": {}, + "source": [ + "### 2.4.1) Spatial and temporal wave group patterns" + ] + }, + { + "cell_type": "markdown", + "id": "89614265-870a-4c11-a7ce-5fabfaecb109", + "metadata": {}, + "source": [ + "#### Calculate wave group characteristics" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a575170-610d-4d4b-9471-5a686740c9c8", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q9()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43be3c3f-7d88-42e2-be25-d0812fd79751", + "metadata": {}, + "outputs": [], + "source": [ + "h = ...\n", + "T1, T2 = ...,...\n", + "\n", + "Delta_k = ...\n", + "Delta_w = ...\n", + "k_average = ...\n", + "w_average = ...\n", + "\n", + "Check_W2_Q9A()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "44823983-1707-4ca2-91e5-bc53f3bf51c7", + "metadata": {}, + "outputs": [], + "source": [ + "c_average = ...\n", + "c_group = ...\n", + "L_group = ...\n", + "T_group = ...\n", + "\n", + "Check_W2_Q9B()" + ] + }, + { + "cell_type": "markdown", + "id": "4f145774-f905-4991-ab99-833c77178371", + "metadata": {}, + "source": [ + " Temporarily, for showing, a made computation, the first answer checks a computational margin of 0.01%
\n", + "dont forget to set T1 and T2 correctly." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8ce476e0-35a7-40bb-9d8f-e550f3f49460", + "metadata": {}, + "outputs": [], + "source": [ + "def wave_length(T, h):\n", + " L = 9.81 * T**2 / (2 * np.pi)\n", + " L_all = [L]\n", + "\n", + " for i in range(1500):\n", + " L = 9.81 * T**2 / (2 * np.pi) * np.tanh(2 * np.pi * h / L)\n", + " L_all.append(L)\n", + "\n", + " if np.abs(L_all[-1] - L_all[-2]) < 0.0005:\n", + " #plt.plot(L_all)\n", + " break\n", + " \n", + " return round(L, 13)\n", + "\n", + "h = 20\n", + "T1, T2 = 6.5,8.1\n", + "\n", + "# The calculation, where the previously made wavelength formula can be used.\n", + "L1 = wave_length(T1, h)\n", + "L2 = wave_length(T2, h)\n", + "\n", + "k1 = 2*np.pi/L1\n", + "k2 = 2*np.pi/L2\n", + "w1 = 2*np.pi/T1\n", + "w2 = 2*np.pi/T2\n", + "\n", + "Delta_k = np.abs(k2-k1) * 0.9999\n", + "Delta_w = np.abs(w2-w1)\n", + "k_average = np.average([k1,k2])\n", + "w_average = np.average([w1,w2])\n", + "\n", + "Check_W2_Q9A()" + ] + }, + { + "cell_type": "markdown", + "id": "e8b49270-8780-4095-9d08-1a6fb5597cc8", + "metadata": {}, + "source": [ + "#### Visualize spatial and temporal patterns" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd1dcecc-d1a4-4d72-a182-e9f5d8f5cc01", + "metadata": {}, + "outputs": [], + "source": [ + "W2_Q10()\n", + "# [temporarily comment] The question loads information from question 9 if it is executed, otherwise, it will generate new random values. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "998f8906-8a26-415e-8797-5649bafd4f0b", + "metadata": {}, + "outputs": [], + "source": [ + "# Use this code to make a plot to make a time series of the water elevation. \n", + "# Define the function such that it will calculate the water elevation at an arbitrary time (t)\n", + "\n", + "def plot_eta_t(t,...):\n", + " ...\n", + " eta = ...\n", + " return eta\n", + "\n", + "Show_Q10A()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "554ee6af-2a51-4e8b-a37d-0ef6cb6e9e2c", + "metadata": {}, + "outputs": [], + "source": [ + "a1, a2, T1, T2, L1, L2, x_max, xp, t_max, tp, L_group, T_group = W2_Q10_param\n", + "def plot_eta_t(a1,a2,T1,T2,L1,L2,t,xp):\n", + " eta1_T_basic = a1*np.sin(2*np.pi/T1*t-2*np.pi/L1*xp)\n", + " eta2_T_basic = a2*np.sin(2*np.pi/T2*t-2*np.pi/L2*xp)\n", + " eta_T_basic = eta1_T_basic + eta2_T_basic\n", + " return eta_T_basic - 1\n", + "\n", + "Show_Q10A()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c78490db-45fa-412f-b368-b8af833fce52", + "metadata": {}, + "outputs": [], + "source": [ + "# Use this code to calculate the water elevation\n", + "# Define the function such that it will calculate the water elevation at an arbitrary location (x)\n", + "\n", + "def plot_eta_x(x...):\n", + " ...\n", + " eta =\n", + " return eta\n", + "\n", + "Show_Q10B()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "df21a37e-7657-41a2-8f8c-6b7dad839bb2", + "metadata": {}, + "outputs": [], + "source": [ + "a1, a2, T1, T2, L1, L2, x_max, xp, t_max, tp, L_group, T_group = W2_Q10_param\n", + "def plot_eta_x(a1,a2,T1,T2,L1,L2,tp,x):\n", + " eta1_T_basic = a1*np.sin(2*np.pi/T1*tp-2*np.pi/L1*x)\n", + " eta2_T_basic = a2*np.sin(2*np.pi/T2*tp-2*np.pi/L2*x)\n", + " eta_T_basic = eta1_T_basic + eta2_T_basic\n", + " return eta_T_basic - 1\n", + "\n", + "Show_Q10B()" + ] + }, + { + "cell_type": "markdown", + "id": "8ad1c1c2-0132-4915-8ed4-2a236320ed35", + "metadata": {}, + "source": [ + "### 2.4.2) Wavegroup composition" + ] + }, + { + "cell_type": "raw", + "id": "c47c7f62-9d2f-4edd-b453-0e46390adc9b", + "metadata": {}, + "source": [ + "Judith, can you think of questions and a way to build a narrative?\n", + "Below are some questions I could come up with." + ] + }, + { + "cell_type": "markdown", + "id": "4c4272cf-4a7e-42f4-a76c-4f0188b5535e", + "metadata": {}, + "source": [ + "Questions\n", + "- If you would measure the water elevation in deep water when these two wave conditions occur, are the measured time series identical to values calculated in the previous question?\n", + " - Yes, substitution is possible with 2 two identical wave components that have similar wave heights\n", + " - no, time series are also affected by the wave phase (correct)\n", + " - no, the harmonic wave components can not always be substituted\n", + " - no, the wave group itself is influencing the time series \n", + "- The speed of the carrier wave is related to the speed of:\n", + " - wave component 1, wave component 2, c_average, c_group (correct)\n", + "- How can the speed of the carrier wave be expressed?\n", + " - w_average/k_average (correct)\n", + " - The group velocity: c_group (Delta_omega/ Delta_k)\n", + " - The average celerity of the wave components, c_average\n", + " - The radial frequency based on the combined period w = 2 pi / (T1 + T2)\n", + "- How can the energy propagation be expressed in shallow water:\n", + " - w_average/k_average \n", + " - The group velocity: c_group (Delta_omega/ Delta_k) (correct)\n", + " - The average celerity of the wave components, c_average\n", + " - The radial frequency based on the combined period w = 2 pi / (T1 + T2)\n", + "- a question related to c_average" + ] + }, + { + "cell_type": "markdown", + "id": "01214996-52f0-42f6-bffb-83846b883785", + "metadata": {}, + "source": [ + "Number of waves on time and spatial plot, dispersive vs non-dispersive etc.\n", + "- questions?" + ] + }, + { + "cell_type": "markdown", + "id": "6bb6c545-0439-4ac5-81b6-70a4fb1b577e", + "metadata": {}, + "source": [ + "After these questions comes an animation with waves propagating over space. (2 wave components)\n", + "Can questions be asked about this?" + ] + }, + { + "cell_type": "markdown", + "id": "73d37211-208b-429a-8e54-306b5928ed45", + "metadata": {}, + "source": [ + "# Oude notities: Worden later verwijderd" + ] + }, + { + "cell_type": "raw", + "id": "0dcf251d-2664-458a-9f32-2860e1cd4b77", + "metadata": {}, + "source": [ + "# maak code veld\n", + "- commpute:\n", + "\n", + "+ delta w, delta k, omega gemmideld, k gemmideld\n", + "+ c_average, c_group, Lgroup, Tgroup\n", + "+ aantal golven in space (binnen golfgroep) <--\n", + "\n", + "- reflective question\n", + "\n", + "# c_average, reflective question (deze ook berekenen erboven = gemiddelde twee componenten). omega_gemiddeld/k_gemmiddeld. Ongeveer carierwave snelheid." + ] + }, + { + "cell_type": "markdown", + "id": "62bf6a94-2e34-4c9b-b6c2-b202572d69a6", + "metadata": {}, + "source": [ + "Hierna verder hoofdstuk 5, aanhaken Jaime bij Waves Notebook." + ] + }, + { + "cell_type": "raw", + "id": "2f797812-c9e0-4268-ba79-79766231817c", + "metadata": {}, + "source": [ + "ask questions on the code, what method is used...\n", + "\n", + "Volgende groups meeting: 3pm 19th Dec" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "97a5320d-f551-4283-869a-363d7cbae3ef", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "84df5754-bcdc-4179-9ea9-62c8c6d4baa3", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2470437f-5b38-41d7-be6e-9d956cb639f1", + "metadata": {}, + "outputs": [], + "source": [ + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/week_3.ipynb b/notebooks/week_3.ipynb new file mode 100644 index 0000000..794610b --- /dev/null +++ b/notebooks/week_3.ipynb @@ -0,0 +1,419 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a57196e5-eb53-4eab-8bb2-b11c2a313e56", + "metadata": {}, + "source": [ + "
\n", + " \n", + "
\n", + "\n", + "Before you is the Jupiter Notebook of week 3." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fcad68ab-a006-40c5-93ad-5eb0a10e41e8", + "metadata": {}, + "outputs": [], + "source": [ + "%run Initialize/Week_3_Initialize.ipynb" + ] + }, + { + "cell_type": "markdown", + "id": "9a3b7540-f1c8-4188-9321-c162619892e7", + "metadata": {}, + "source": [ + "## 3.1) Wave and tidal information" + ] + }, + { + "cell_type": "raw", + "id": "68cd6b43-9174-4862-a334-331835a54184", + "metadata": {}, + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "52d1bbf4-31a0-448d-86d8-a627eb550d41", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "raw", + "id": "d72a92e9-7ffb-45a9-9422-b41e2890ef77", + "metadata": {}, + "source": [ + "part 1 wel, figure pagian 186,187etc/. Hoeven nog niet te progermeeren, moeten wel snappen met tootlje." + ] + }, + { + "cell_type": "markdown", + "id": "55200145-c32c-444e-b925-9e73e173cf2a", + "metadata": {}, + "source": [ + "## 3.2) Wave transformation in the near-shore " + ] + }, + { + "cell_type": "markdown", + "id": "75e92d3c-f6b9-40c4-9fe1-3082483a6ff7", + "metadata": {}, + "source": [ + "We continue on the application of the dispersion relationship in the cross-shore, which was discussed in week 3 and the Wave course." + ] + }, + { + "cell_type": "markdown", + "id": "17205ca8-dfd6-4622-8482-c64cfd445857", + "metadata": {}, + "source": [ + "### 3.2.1) Normal indicent waves" + ] + }, + { + "cell_type": "markdown", + "id": "e5dd8576-5be2-40dd-916d-32d9d8453cfc", + "metadata": {}, + "source": [ + "In Waves you should have programmed a function to compute the wave height along the cross-shore for normal incident waves. A similar function is defined below, together with a function to calculate the wavelength. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a903c1f3-af10-46e5-bfc3-8d086a18923b", + "metadata": {}, + "outputs": [], + "source": [ + "def wave_length(T, h):\n", + " L = 9.81 * T**2 / (2 * np.pi)\n", + " L_all = [L]\n", + "\n", + " for i in range(1500):\n", + " L = 9.81 * T**2 / (2 * np.pi) * np.tanh(2 * np.pi * h / L)\n", + " L_all.append(L)\n", + "\n", + " # stop the iteration when the error is sufficiently small\n", + " if np.abs(L_all[-1] - L_all[-2]) < 0.0005:\n", + " break\n", + " \n", + " return round(L, 13)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6b4b0fb3-dbac-40cd-b494-57a143b711b4", + "metadata": {}, + "outputs": [], + "source": [ + "def W3_normal_indicent_waves(H0, T, d0, slope):\n", + "\n", + " # The environmental conditons\n", + " x = np.arange(0,900,.1) # the horizontal axis\n", + " zbed = -(d0 - slope * x) # bed elevation [m]\n", + " h = -zbed # still water depth [m]\n", + " h[h < 0] = 0 # no negative depths\n", + "\n", + " # given:\n", + " gamma = 0.8 # wave breaking ratio\n", + " \n", + " # The wave characteristics at every location in the cross-section\n", + " L = np.array([wave_length(T, h) for h in h]) # The wave length\n", + " c = L/T # The wave celerity\n", + " k = 2*np.pi/L # The wave number\n", + " n = 0.5 + (k*h/np.sinh(2*k*h)) \n", + " cg = n*c # The wave group celerity\n", + " Ksh = np.sqrt(cg[0]/cg) # The shoaling parameter \n", + " H = H0*Ksh # The wave height due to shoaling (only)\n", + " Hbreaking = gamma * h # The wave-breaking height\n", + " H[H>Hbreaking]=Hbreaking[H>Hbreaking] # The wave height" + ] + }, + { + "cell_type": "markdown", + "id": "d226190a-a118-413e-87cb-8237866feeff", + "metadata": {}, + "source": [ + "The graph below shows the outcome of the calculaten. Can you use it to answer the questions?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "aadfa6d4-c1f3-4cd6-a67e-0fba4638c737", + "metadata": {}, + "outputs": [], + "source": [ + "W3_plot_normal_indicent_waves()" + ] + }, + { + "cell_type": "raw", + "id": "cf5f44d1-465a-46bb-924e-6d49f470117e", + "metadata": {}, + "source": [ + "1) Which method is used to calculate the wave length? --> iterative approach\n", + "2) Various questions on the influence of H when parameters change." + ] + }, + { + "cell_type": "markdown", + "id": "42bbaabc-6522-4f63-91ef-82616506db41", + "metadata": {}, + "source": [ + "### 3.2.2) Wave height for oblique waves" + ] + }, + { + "cell_type": "markdown", + "id": "7514bb6e-75a4-4580-aff7-6809c44fc018", + "metadata": {}, + "source": [ + "The influence of refraction should also be considered for waves that approach the shore under an angle. This process should be considered in the functions for oblique waves, in contrast to normal incident waves. Can you include the impact of refraction on the wave height in the function below by completing the code at the dots? The function W3_plot_oblique_waves() will plot the wave height calculated in W3_oblique_waves(), together with the answer." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "29643432-a621-4d60-97ff-567b4226f77f", + "metadata": {}, + "outputs": [], + "source": [ + "def W3_oblique_waves(H0, T, d0, slope):\n", + "\n", + " # The environmental conditions\n", + " x = np.arange(0,900,.1) # the horizontal axis\n", + " zbed = -(d0 - slope * x) # bed elevation [m]\n", + " h = -zbed # still water depth [m]\n", + " h[h < 0] = 0 # no negative depths\n", + "\n", + " # given conditions\n", + " gamma = 0.8 # wave breaking ratio\n", + " \n", + " # The wave characteristics at every location in the cross-section\n", + " L = np.array([wave_length(T, h) for h in h]) # The wavelength\n", + " c = L/T # The wave celerity\n", + " k = 2*np.pi/L # The wave number\n", + " n = 0.5 + (k*h/np.sinh(2*k*h)) \n", + " cg = n*c # The wave group celerity\n", + " Ksh = np.sqrt(cg[0]/cg) # The shoaling parameter \n", + " H = H0*Ksh # The wave height due to shoaling (only)\n", + " Hbreaking = gamma * h # The wave-breaking height\n", + " H[H>Hbreaking]=Hbreaking[H>Hbreaking] # Adjusting the wave height\n", + " H = ..." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3d5fc846-4186-4c8a-95dc-56d587e73d3d", + "metadata": {}, + "outputs": [], + "source": [ + "#W3_plot_oblique_waves() " + ] + }, + { + "cell_type": "markdown", + "id": "a6835219-6247-45d7-a269-752c309909a5", + "metadata": {}, + "source": [ + "### 3.2.3) radiation stresses for oblique waves" + ] + }, + { + "cell_type": "raw", + "id": "7f7921f8-b65e-47ef-b205-2f7bfa926993", + "metadata": {}, + "source": [ + "Describe parameter, give how to calculate, ask to finish the function.\n", + " E= 1/8*1000*g*H**2 # The wave energy\n", + " Sxx = (2*n-0.5)*E # ? Radiant stesses?\n", + "\n", + "adjust for oblique incident waves" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1b8e0c4f-f24d-4311-a366-42f84cbe41f9", + "metadata": {}, + "outputs": [], + "source": [ + "def W3_oblique_waves(H0, T, d0, slope):\n", + "\n", + " # The environmental conditions\n", + " x = np.arange(0,900,.1) # the horizontal axis\n", + " zbed = -(d0 - slope * x) # bed elevation [m]\n", + " h = -zbed # still water depth [m]\n", + " h[h < 0] = 0 # no negative depths\n", + "\n", + " # given conditions\n", + " gamma = 0.8 # wave breaking ratio\n", + " \n", + " # The wave characteristics at every location in the cross-section\n", + " L = np.array([wave_length(T, h) for h in h]) # The wavelength\n", + " c = L/T # The wave celerity\n", + " k = 2*np.pi/L # The wave number\n", + " n = 0.5 + (k*h/np.sinh(2*k*h)) \n", + " cg = n*c # The wave group celerity\n", + " Ksh = np.sqrt(cg[0]/cg) # The shoaling parameter \n", + " H = H0*Ksh # The wave height due to shoaling (only)\n", + " Hbreaking = gamma * h # The wave-breaking height\n", + " H[H>Hbreaking]=Hbreaking[H>Hbreaking] # Adjusting the wave height\n", + " \n", + " '''Complete the code here'''" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b1aa6e2b-95bd-4e49-b39e-2ee263be2339", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "raw", + "id": "4877cc39-712f-4539-8d3f-1eeb94cf1d36", + "metadata": {}, + "source": [ + "1.\tContinue from the notebook in week 3 on Application of dispersion relationship in the cross-shore (could make sense to have it in the same notebook). \n", + "2.\tProvide students with the code that they should have programmed in Waves to obtain the cross-shore distribution of H for normally incident waves.\n", + "3.\tVisualize their answers\n", + "4.\tAsk students to reflect on H(x) for different variables (slope, H0, gamma, T, mean water level) by means of multiple choice or multiple selection questions. In order to answer these questions let students vary their code in step 2. and redo step 3 (or if handier with sliders). For instance: which of the following changes in parameters will increase the width of the surf zone (give multiple answer options, more than one can be correct, for instance increase H, decrease slope)\n", + "5.\tNow change to obliquely incident waves and ask students to add the effect of refraction in the code and replot H(x). \n", + "6.\tAsk a reflective question about the effect of refraction (we will add this later)\n", + "7.\tContinue with same wave conditions or repeat. Provide students with the code that they should have programmed in Waves to obtain the cross-shore distribution of Sxx. Ask them to adjust this for obliquely incident waves. \n", + "8.\tVisualize their code\n", + "9.\tProvide students with the code that they should have programmed to obtain the cross-shore distribution of mean water level eta (discretizing forward Euler from week 1.5 MUDE) and visualize this. Ask them to:\n", + "a.\tAdjust this for obliquely incident waves. \n", + "b.\tAdd the computation and plot of Fx as intermediate step. \n", + "10.\tAsk some reflective questions (we will add these later)\n", + "11.\tLet students add code and plot Syx and Fy (varying on the above code)\n", + "12.\tAdd reflective questions\n", + "13.\tLet students add code and plot V(x) according to Eq. 5.82\n", + "14.\tAdd reflective question\n", + "15.\tLet students add code and plot orbital velocity magnitude in cross-shore direction \n", + "16.\tTo be detailed: provide code and plot for undertow velocity (Eq. 5.41, the latter needs an estimation of the roller energy dissipation and roller area, I will provide the equations)\n", + "--> 16 Doet Judith uitdenken (dus voor nu evne)" + ] + }, + { + "cell_type": "raw", + "id": "c9b72d80-1bf1-4693-a1ef-a152395802c1", + "metadata": {}, + "source": [ + "tot 2.7 computerlab, maak functies, daarna reflective . what is the effect of ...\n", + "refraction coeficient for refraction. refractie op golfhoogte --> wordt kleiner\n", + "3.1 gegeven, aanpassen... \n", + "8) plot tegenoverelkaar.\n", + "9) 3.3 (computerlab) eta --> pagina 215. Fx --> daarna eta uitrekenenen.\n", + "11) uit boek/slides. (voorkeur zelfde waar als slides.)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5588ebbe-8d34-4bb9-8cd6-2350c0fb5b9d", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "raw", + "id": "3bf06788-3e36-43b1-8380-697d2988057e", + "metadata": {}, + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b3b47a7c-339f-46db-a607-8293c85de50b", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "raw", + "id": "2f134374-25cf-4d5e-b889-989ed4bb5ec6", + "metadata": {}, + "source": [ + "gebouw gesloten tot ma 8 januari" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "271860fc-886d-4193-a3b7-a4adf2ea1715", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "1091162f-11da-40d7-84ed-e21911f92e6a", + "metadata": {}, + "source": [ + "# week 4" + ] + }, + { + "cell_type": "raw", + "id": "53970be3-e2b2-4f18-89df-14b0e7d18971", + "metadata": {}, + "source": [ + "slide 21\n", + "slide 22-> fluctuatie enegery golfgroepschaal (zelf codereren --> plot)\n", + "slide 26, sxx --> formule foto\n", + "als voor 9 januari klaar, laat weten.\n", + "\n", + "deze week status update. op 9e " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3206e466-84e8-450e-9552-eb5937bbf349", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "211e97dc-15ac-40c1-a459-e5445e8cdf26", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}