Set-up model
XBeach is configured using a collection of failes that hold information on the bathymertry, boundary conditions, model settings, etcetera. All files are plain text files that should be in a single directory, the model run directory. Running the XBeach executable in this directory, will make XBeach use those files and save the model output in the very same directory.
Using the Matlab Toolbox, setting up your model is made much easier. On this page we explain how to set-up a simple model using the Matlab Toolbox. The toolbox creates a bunch of files, which we will explain. Setting up a model manually, without the toolbox, implies creating these files in any other way of your preference. A collection of example models can be found in the Download section.
My First XBeach Model
Having started Matlab and incuded the Matlab XBeach Toolbox to your path, you should be able to run the following command:
Believe it or not, the xbo variable now contains a structure with a full XBeach model set-up. You can write the model to disk by running the following command:
The file params.txt, which contains all model settings, is now written to your current directory along with several other files which are referred to from the params.txt file. The different files are listed below:
| File | Description | |
|---|---|---|
| params.txt | File with model settings. Each line containing an =-sign and not starting with a %-sign is interpreted as a model setting in the form "name = value". This file is obligatory when running XBeach. It also refers to the other files. | |
| bed.dep | File with bathymetry information. It simply contains the heights for all grid points. On row corresponds to one cross-shore transect. This file is obligatory when running XBeach. | |
| x.grd | File with x-coordinates of the grid. This file is only used with a non-equidistant grid. | |
| y.grd | File with y-coordinates of the grid. This file is only used with a non-equidistant two-dimensional grid. | |
| jonswap.txt | File with boundary condition information. In this case the description of a JONSWAP spectrum. Severel flavours exist for this file. This one has a syntax similar to the params.txt file. | |
| swtable.txt | Deprecated. This file is built-in in XBeach and only used by older versions of the model. |
The files describe a simple one-dimensional model with a schematized dune profile (see Figure) and a statistically constant boundary conditions described by a JONSWAP spectrum with a significant wave height of 7.6m and a peak wave period of 12s.
Altering My First XBeach Model
The model created in the previous example uses default settings only, which is not very interesting. Altering the model is done by supplying preferences to the xb_generate_model function as shown in the next example:
xbi = xb_generate_model( ...
'bathy', { 'x', x, 'z', z, 'xgrid', {'vardx', 0} }, ...
'waves', { 'Hm0', 9, 'Tp', 18 }, ...
'tide', { 'front', 5, 'back', 0 }, ...
'wavegrid', { 'nbins', 5 }, ...
'settings', { 'tstop', 7200, 'morfac', 5 });
Now, two vectors x and z with bathymetry information are supplied. The toolbox generates a grid based on the bathymetry and wave conditions. In this case the grid will not vary in x-direction (vardx=0). The boundary conditions in terms of significant wave height and peak wave period are changed and the tidal surge is now different for the offshore and onshore boundary. The number of wave direction grids is increased to 5 in order to support directional spreading. The simulation end time is set to 7200 seconds morphological time with a morphological factor of 5. For all possible settings is referred to the documentation of the Matlab Toolbox and the XBeach model.
In the next example the tidal surge and wave boundary conditions are made varying by supplying multiple values for several parameters:
xbi = xb_generate_model( ...
'bathy', { 'x', x, 'z', z, 'xgrid', {'vardx', 0} }, ...
'waves', { 'Hm0', [5 7 9 7 5], 'Tp', [12 14 18 14 12], 'duration', 1800 }, ...
'tide', { 'front', [4 5 4], 'back', 0, 'time', [0 3000 6000] }, ...
'wavegrid', { 'nbins', 5 }, ...
'settings', { 'tstop', 45000, 'morfac', 5 });
