Xbeach Grid Tutorial: Joost Den Bieman June 3, 2013
Xbeach Grid Tutorial: Joost Den Bieman June 3, 2013
June 3, 2013
Contents
1 Introduction 2
1
Chapter 1
Introduction
This tutorial describes two different methods for creating a rectilinear XBeach
model grid. Chapter 2 describes the different methods and associated XBeach
keywords and parameters. Chapter 3 contains examples for each method.
The examples featured in this tutorial make use of the XBeach toolbox for
Matlab. This toolbox is part of the OpenEarth [van Koningsveld et al., 2010]
toolbox, which can be found here: http://publicwiki.deltares.nl/display/
OET/Join+OpenEarth (register for an account, then checkout using subverion).
2
Chapter 2
Both methods are explained in this chapter. For both methods, the x and
y coordinates of the grid points are specified in seperate files, using the key-
words xfile and yfile respectively. These keywords contain the names of ASCII
files with a m ∗ n matrix (see equation 2.1) with x- or y-values, correspond-
ing to the bed level elevation information specified in the depfile. The size of
both dimensions of the matrix is 1 element larger than specified in nx and ny
(nx = n − 1, ny = m − 1), because the model needs an extra row and column
of ‘dummy’ grid points. In the xfile and yfile, the first element of the matrix
(x11 ) contains the coordinates of the grid origin (this does not have to be 0,0).
Furthermore, the leftmost column (x11 . . . xm1 ) always has represents the coor-
dinates of the offshore boundary (thus x11 . . . x1n and xm1 . . . xmn are the two
lateral boundaries, and x1n . . . xmn is the landward boundary).
x11 x12 . . . x1n
x21 . . .
X= . (2.1)
.. . ..
xm1 xmn
The model assumes Neumann conditions on the lateral boundaries (no gra-
dient in velocity and water level). These assumptions are more robust when
there is no (alongshore) gradient in the bed level on the cells close to those
lateral boundaries. The xb grid finalise.m function takes care of this by adding
a few grid cells to each lateral boundary with the same bed level as the former
boundary cell.
3
2.1.1 Model coordinates
A sketch of the definitions used in XBeach is given in figure 2.1.
In the XBeach coordinate system, the origin is located on the offshore model
boundary, the x-axis is positive in landward direction and the y-axis is pointed
alongshore. The XBeach model coordinates are related to a coordinate system
by specifying the coordinates of the origin (using keywords xori and yori ) and
the angle alfa between the East and the direction of the x-axis (defined counter-
clockwise).
4
shoreward, y-axis pointed alongshore, etc.). This is no problem, as long as
x11 contains the origin and x11 . . . xm1 define the offshore boundary (see equa-
tion 2.1). However, be aware that the output parameters related to a specific
direction are actually related to the directions of the grid axes, so their actual
orientation depends on how the grid is defined. For instance the wave forces Fx
and Fy are related to the xfile and yfile respectively. This means that Fx isn’t
necessarily in shoreward direction and the same holds for Fy.
When using world coordinates, xori, yori and alfa do not have to be used
(can all be set to 0), since no rotation or translation is needed.
2.4 Overview
An overview of all above mentioned grid related properties can be found in
figure 2.2.
5
Figure 2.2: XBeach grid orientations, by B.M. Hoonhout.
6
Chapter 3
The examples in this tutorial show simple model of part of the barrier island
Terschelling in the Netherlands, see figure 3.1. The two models are identical,
except that one grid is defined in XBeach model coordinates and the other in
the Dutch RD coordinate system. Note that the bathymetric data set does not
extend too far inland, so the missing values have been replaced with a dummy
value of 1.5 m.
The files needed for this tutorial can be downloaded from: dummy.url
The XBeach binary can be downloaded from: http://oss.deltares.nl/
web/xbeach/source-code-and-exe. After downloading, it should be extracted
in the xbeach binary directory (within the tutorial directory). The scripts in this
tutorial make use of relative paths, so make sure the scripts are run with the
tutorial directory as working directory. Additionally, the scripts make use of
the XBeach tools in the OpenEarth toolbox, so oetsettings.m needs to be run
before running any of the scripts in the tutorial.
7
becomes evident when the initial bathymetry is plotted, see figure 3.2. The
visualize input.m scripts plots and saves this figure in the tutorial folder.
8
for the same grid line in both models (see figure 3.3). As can be seen from the
figures, the hydrodynamic results are the same.
0.5
0
−4500 −4000 −3500 −3000 −2500 −2000 −1500 −1000 −500 0
x (m)
0.5
−4500 −4000 −3500 −3000 −2500 −2000 −1500 −1000 −500 0
x (m)
Figure 3.3: Comparison of wave height and water level in both models.
The xb view script allows for visualization all output variables from a single
model run and is an easy way to make a first assessment based on the simulation
results.
9
3.4.1 Grid creation
To create a model using other bathymetric or hydrodynamic data, load the data
into Matlab and adapt the input of the xb generate model script to use that data
instead. Be aware that the crop keyword should be set to ‘select’, so the extent
of the model domain can be defined by selecting the opposite corner points.
Within the xb generate model script, an optimized model grid is created
based on the bathymetry supplied. This is done by the xb grid xgrid and
xb grid ygrid scripts. The parameters governing optimizing the grid are ex-
plained in the help text of both functions (accessible by typing help xb grid xgrid ).
10
Bibliography
[van Koningsveld et al., 2010] van Koningsveld, M., de Boer, G., Baart, F.,
Damsma, T., den Heijer, C., van Geer, P., and de Sonneville, B. (2010). Ope-
nEarth - inter-company management of: data, models, tools & knowledge. In
Proceedings WODCON XIX Conference. Beijing, China.
11