\chapter{SWASH model}

\section{1D model}

In order to find out if the reflection induced by the breakwater has an
influence on the sea state at the buoy's location, a one-dimensional model of
the zone between the buoy and the breakwater was created.

The considered domain is \SI{1450}{\m} long, with \SI{1250}{\m} between the
buoy and the breakwater, and a further \SI{200}{\m} offshore of the buoy.
The model is a 10 layers swash model accounting for porous media in near the
breakwater. The model was adapted from PA Poncet.

\subsection{Model 1}

A first run was produced in order to test the model with a water level of
\SI{0.5}{\m} using the measured spectrum from 2017-02-28 as the offshore
boundary condition and a sommerfeld radiation condition on the breakwater
boundary. The model was run over a duration of 30 minutes.

The same model was implemented without the breakwater (by forcing a minimum
depth) with an added \SI{250}{\m} sponge layer at the shorewards boundary.

The reflection coefficient at the buoy's location was computed using
a PUV method \parencite{huntley1999use}.

The results are displayed in \autoref{fig:swash_1_R}. Two methods of
calculating the reflection were used \parencite{huntley1999use}, the second one
might be wrongly implemented, and the first one might be subject to
noise-induced bias.

\begin{figure}
	\centering
	\includegraphics{R1.png}
	\includegraphics{R2.png}
	\caption{Reflection coefficient computed with Swash. 1: With breakwater; 2:
	Without breakwater.}\label{fig:swash_1_R}
\end{figure}

\subsection{Model 2}

An attempt at running the model with the correct water level (\SI{4.5}{\m}) was
made without success, as the model does not seem to be able to compute
overtopping. Changing the boundary condition at the breakwater does not fix the
issue, and the model is not able to run with water on both sides of the
breakwater as the initial condition.

\paragraph{SWASH overtopping} \cite{suzuki2011applicability,zhang2020numerical} It seems like computing wave overtopping
should be possible using the SWASH model.

Implemented model with longer domain, with water behind the breakwater; currently, model crashes when overtopping
happens.

The model DOES NOT crash if layers are disabled (depth-averaged model). No overtopping seems to appear in the results.

Resulting reflection coefficient in \autoref{fig:swash_nolay}: very high reflection coefficient, probably inaccurate.

\begin{figure}
	\centering
	\includegraphics{R_singlelayer.png}
	\caption{Reflection coefficient computed with Swash without layers (method 1, probable noise-induced
	bias.}\label{fig:swash_nolay}
\end{figure}

Model does also work with 2 layers; overtopping does appear \autoref{fig:swash_2lay}.

\begin{figure}
	\centering
	\includegraphics{R_2lay.png}
	\caption{Reflection coefficient computed with Swash 2 layers (method 1, probable noise-induced
	bias.}\label{fig:swash_2lay}
\end{figure}

Model crashes with 3 or more layers.

\subsection{Model 3}
Model: \SI{1450}{\m} offshore, \SI{300}{\m} shorewards. \SI{250}{\m} sponge layer. \SI{4.5}{\m} water level. 2 layers.
\autoref{fig:bathy}

\begin{figure}
	\centering
	\includegraphics{bathy_b.pdf}
	\includegraphics{bathy_nb.pdf}
	\caption{Bathymetry.}\label{fig:bathy}
\end{figure}

Results \autoref{fig:res45}.
\begin{figure}
	\centering
	\includegraphics{R_2lay_45.pdf}
	\caption{Results (1: breakwater; 2: no breakwater).}\label{fig:res45}
\end{figure}

Comparison with reflex3s (array method adapted from PA Poncet) \autoref{fig:reflex3s2lay}.
\begin{figure}
	\centering
	\includegraphics{reflex3s_2lay.pdf}
	\caption{Reflection coefficient with array method.}\label{fig:reflex3s2lay}
\end{figure}

\subsection{Model with measured time-series}
Using raw buoy data. Model crashes with 2 layers. Works when layers are disabled. \textbf{No overtopping!}
\autoref{fig:rests}. \SI{1}{\hour} computation time.

\begin{figure}
	\centering
	\includegraphics{R_ts.pdf}
	\caption{Results with real timeseries, no layers.}\label{fig:rests}
\end{figure}

Model runs with 2 layers after adjusting some parameters. \autoref{fig:rests2lay}. Overtopping is computed.

\begin{figure}
	\centering
	\includegraphics{R_ts_2lay.pdf}
	\caption{Results with real timeseries, 2 layers.}\label{fig:rests2lay}
\end{figure}

Model runs with 4 layers. \autoref{fig:rests4lay}.

\begin{figure}
	\centering
	\includegraphics{R_ts_4lay.pdf}
	\caption{Results with real timeseries, 4 layers.}\label{fig:rests4lay}
\end{figure}

\section{Reflection coefficient verification}

A small Python script has been written to generate theoretical wave height and homogenized velocity for a combination of
incident and reflected waves.

The method was taken from \parencite{huntley1999use}. Incident waves are modelled by white noise, reflected waves are
incident waves shifted and multiplied by the reflection coefficient. Water level is the sum of incident waves and
reflected waves, velocity is the difference of reflected waves and incident waves. Additionnal noise is added to the
water level and velocity.

Results are displayed in \autoref{fig:r_test}.

\begin{figure}
	\centering
	\includegraphics{r_test.pdf}
	\caption{Reflection coefficient testing (puv method from \cite{huntley1999use}).}\label{fig:r_test}
\end{figure}

\section{Plotting orbitals from buoy measurements}
\autoref{fig:orbitals}. Orbital for the large wave have been plotted in the average motion plane of the buoy.

\begin{figure}
	\centering
	\includegraphics{orbitals.pdf}
	\caption{2Dv buoy trajectory for wave event of 20170228.}\label{fig:orbitals}
\end{figure}

\subsection{Buoy spectrum}

The swash model was run over 4 hours with the spectrum obtained from the buoy, with and without the breakwater. (2
layers).

A zero-crossing methods was implemented to find the largest waves.

%\subsection{2D Model}
%Working on 2D model which might work with overtopping.
