Toggle Menu

Overview

XBeach_GPU is a lightweight version of the XBeack model that uses the Graphical Processing Unit (GPU) of computers to perform the calculations. XBeach_GPU is not as flexible or precise as the original XBeach but it can perform the calculation much quicker.

Input

This template has a responsive menu toggling system. The menu will appear collapsed on smaller screens, and will appear non-collapsed on larger screens. When toggled using the button below, the menu will appear/disappear. On small screens, the page content will be pushed off canvas.

Make sure to keep all page content within the #page-content-wrapper.

Param file

Just like with Xbeach the model parameters are controled with an input file that is necessary to run the model. To differenciate with XBeach, in XBGPU the file is called XBGPU_param.txt

Again the file structure is similar to XBeach so that it would be easy to switch from one to the other. However the 2 models are quite different and despite our effort you shouldn't expect that a given option or default values in one model is the same in the other. Model parameters can be modified in the file by specifiying the parameter name, the equal sign, the desired value for the parameter and optionally a semi-column ;


#My Dummy XBGPU param files
#Any lines starting with the Hash tag will be ignored

#You can also leave blank lines

# You can use the traditional XBeach way of specifying the parameter
# Remenber that you can only put one parameter per line
gamma = 0.4
#Any number of leading space or space between the parameter name and the equal sign will be accepted. Tabs are not acceptable
         beta       =      0.15
#Obviously you have to put the right name down (spelling and case sensitive) otherwise the line will be ignored
bbeettaa = 0.22

#If you want to add a comment at the end of a line with a parameter you can do it after putting a semi column
n = 9; Was 10 before

#XBGPU has only one required parameter and that is the bathymetry grid name

            

Parameters

all the parameters below can be assigned one or several values. The default is also highlighted here:

General Parameters

Parameter name Default Value Description
swave 1 Switch for using the short wave model. The wave group modulation comes from the wave boundary.
flow 1 Switch to use the coupled hydrodynamics model.
sedtrans 0 Switch to run the sediment transport module.
morphology 0 Switch to run the morphology modeule to apply the sediment source and sink to the bathymetry.
GPUDEVICE 0 What GPU device to use default is the firt one availabe (i.e. 0) and 1 for second GPU etc...
nx 0 Bathymetry grid size (columns). Only required when using XBeach style bathymetry. Will be overwritten when using .md or .nc bathy input. ny 0 Bathymetry grid size (rows). Only required when using XBeach style bathymetry. Will be overwritten when using .md or .nc bathy input.
dx 0.0 Bathymetry grid resolution. Only required when using XBeach style bathymetry need to be >0.0. Will be overwritten when using .md or .nc bathy input.
grdalpha 0.0 Bathymetry grid rotation. Only required when using XBeach style bathymetry or netcdf. Will be overwritten when using .md bathy input and can be included in the netcdf file explicitly.
posdown 1 1 means bathymetry is positive up. 0 means bathymetry is positive down and will result in zb values being multiplied by -1.

Flow Parameters

Parameter name Default Value Description
g 9.81 Acceleration of gravity [m/s^2]. For Mars use 3.71m/s^2.
rho 1025.0 Density of Water in kg/m^3. For rum use 940.0 kg/m^3.
eps 0.01 Drying height [m].
cf 0.01 Bottom friction (Chezy formulation). A specific value can be given to sand (cfsand) or reef (cfreef). cfsand 0.01 Bottom friction (Chezy formulation), specific to sand. cfreef 0.01 Bottom friction (Chezy formulation), specific to reef. The location of outcropping reef is determined with the sediment thickness file and updated at every Morphology step.
nuh 1.0 Eddy viscosity [m2/s]
nuhfac 1.0 Viscosity coefficient for roller induced turbulent horizontal viscosity [0 - 1].
usesmago 1 Uses Smagorynsky formulation to calculate viscosity 0: No 1: Yes.
smag 0.3 Smagorinsky coefficient, only used if usesmago = 1.
lat 0.0 Latitude of the grid.
fc 0.0 Coriolis force. Automatically calculated for earth when setting up lat.
Cd 0.002 Wind drag coefficient.
wci 0.0 Wave current interaction (0: no; 1: yes, 0.1-0.9: when model is not stable).
hwci 0.1 Minimum depth for wave current interaction (wci), i.e. no wci in water depth shallower than this.

Wave Parameters

Parameter name Default Value Description
breakmodel 1 Wave dissipation model 1: Roelvink 2: Baldock. use 1 for unsteady runs (i.e. with wave group) and use 2 when not forcing wave group.
gamma 0.6 Wave breaking gamma parameter.
n 8.0 Exponential in Roelvink breaking model.
alpha 1.0 Calibration factor for wave dissipation (should be 1.0).
gammax 2.0 Maximum ratio Hrms/hh.
beta 0.15 Roller slope dissipation parameter.
fw 0.001 Wave bottom dissipation parameter. A specific value can be given to sand (fwsand) or reef (fwreef). fwsand 0.001 Wave bottom dissipation parameter, specific to sand. fwreef 0.001 Wave bottom dissipation parameter, specific to reef. The location of outcropping reef is determined with the sediment thickness file and updated at every Morphology step.
roller 1 Switch for roller model.
thetamin -90 Minimum value for directional space in the wave model. This is only required when using wave boundary type 1, 4 and 5.
thetamax 90 Maximum value for directional space in the wave model. This is only required when using wave boundary type 1, 4 and 5.
dtheta N/A Directional space resolution [degrees]. Value calculated from ntheta. If specified ntheta will be calculated from dtheta instead.
ntheta 1 Number of directional bins. If ntheta is not specified but dtheta is specified by the user then ntheta will be calculated from dtheta. This is only required when using wave boundary type 1, 4 and 5.

Sediment Parameters

(Only needed when sedtrans=1)

Parameter name Default Value Description
D50 0.00038 D50 sediment size in [m].
D90 0.00053 D90 sediment size in [m].
rhosed 2650.0 Sand density in kg/m^3.
wws 0.0509 Sand fall velocity (should be calculated) m/s.
drydzmax 1.0 Dry maximum slope in avalanching model. wetdzmax 2.0 Wet maximum slope in avalanching model.
maxslpchg 0.01 Maximum change within a step to avoid avalanching tsunami.
por 0.4 Sand porosity (%).
morfac 1.0 Morphological factor 0 no changes in morphology 1 normal changes in morpho >1 accelerated morphological changes (beware this doesn't accelerate the bnd you have to do this manually).
sus 1.0 Calibration coefficient for suspended load.
bed 1.0 Calibration coefficient for bed load.
facsk 0.2 Calibration factor for wave skewness.
facas 0.2 Calibration factor for wave asymmetry.

Files

Parameter name Default Value Description
bathy "" Bathymetry file, positive down [m]. See details below.
depfile "" Bathymetry file, positive down [m]. See details below.
wavebndfile "" Filename of the wave boundary file. See below for details.
SedThkfile "" Sediment thickness file. Same format as the bathymetry file but with sediment layer thickness values in m.
slbndfile "" Sea level boundary file (see below for details).
windbndfile "" Wind boundary file (see below for details).
outfile XBGPU_output.nc Netcdf output file name for area series output.
TSOfile "" Output txt file name for Time series output of a single location. There can be as many TSOfile as specific location to output. With this option you will output zs and H at every step in the model.
TSnode x,y Location in nodes for extracting a time series. You need as many TSnode=x,y (x and y should be integers smaller than nx and ny respectively) as you have TSOfile=myfile.txt
outvars "zb", "zs", "uu", "vv", "H", "thetamean", "D", "urms", "ueu", "vev", "C", "dzb", "Fx", "Fy", "hh", "Hmean", "uumean", "vvmean", "hhmean", "zsmean", "Cmean", "ueumean", "vevmean" Name of output variables. See below for the full list. Any number of variable can be selected. You can specify the same variable twice but you would be a fool. Specifying an empty lits will revert back to default. outvars may be specified multiple time in the param file to add more variable and keep the file clean.

Time Keeping

Parameter name Default Value Description
CFL 0.7 CFL value used to calculate the model timestep. If the model becomes unstable use a smaller value.
endtime 0.0 Model end time in seconds (start time is 0.0). Default value will find the shortest time in boundary input.
outputtimestep 0.0 Output time step in seconds. If 0.0s then no output is produced.
sedstart 3600.0 Delay start for sediment transport (seconds) to allow hydrodynamics warm up.

Wave boundary variables

There are 4 different type of wave boundary input. For type 4 (and 5) the wave groups are internally generated. The wave goup and Low frequency bpound wave generation can be controlled with some of the parameters below.

Parameter name Default Value Description
wavebndtype 2 Wave boundary type [1, 2, 3, 4, or 5]. See below for details.
dtbc 1.0 Time step for wave group forcing (generation and reading). Only used for wavebndtype 2, 4 and 5. Automatic for wavebndtype=3.
sprdthr 0.8 Threshold cut off for spectral sample in boundary generation (in % of peak energy).
rtlength 3600.0 Duration of wave group chunks (seconds).
random 0 Switch for resetting random sampling. 0 means the random sample will be the same every run. 1 mean the sample is different at evry run.
nmax 0.8 Factor to reduce long wave variance in shallow water.
fcutoff 0.0 Low-freq cutoff frequency.

Bathymetry

3 types of bathymetry files are recognize by XBGPU.

  1. XBeach style bathymetry file *.dep or *.bot. This type of file require the user to explicitely define nx, ny, dx, dy (dy=dx for now) and grdalpha (grid rotation of the y axis from the North same as XBeach alfa) in the XBGPU_Param.txt. Please also note that nx in XBGPU is the number of elements in x (same for y) as oposed to XBeach where its is 1 less thand the number of elements.

  2. Mid Depth file *.md. Essentially similar to the XBeach format but with a header. The content of the header will override any specified nx,ny,dx,dy,grdalpha specified in the XBGPU_param.txt

  3. Netcdf file containing the variables x y and z

Bathymetry needs to be set using the oceanographic convention as positive down.

Offshore wave boundary

There are 4 options to specify wave boundary condition to XBGPU. The boundary type is specified in the XBGPU_param file as : wavebndtype = 1 the boundary condition require one files, wavebndfile = Mywavebndfile.txt

wavebndtype Description
1 Constant wave boundary (no wave group).
2 Reuse XBeach boundary files, this requires several specific input file.
3 Reuse XBGPU boundary. Similar to XBeach but in netcdf format and all self explanatory.
4 Generate wave group for JONSWAP parameters
5 Generate wave group from an input spectrum (not fully tested).

Constant wave input wavebndtype = 1;

The wave boundary file must contain a timeseries of Wave height and peak period, peak direction and directional spread as presented below:


# Constant wave input example
0.0,1.0,15.0,255.0,100.0
100.0,1.2,14.33,220.0,100.0
3600.0,1.0,12.78,200.0,100.0

            

The model then calculate the wave energy and representative wave period at the boundary as linearly varying between timeseries line

Reuse XBeach boundary files wavebndtype = 2;

You can also use wave boundary condition previously generated by XBeach. In this particular case you need to specify in the wavebndfile:

  • Header speciying: thetamin, thetamax, dtheta, dtbc, rtlength

  • a time series with each line containing : time, Trep, qfile, Efile


-60.0,60.0,10.0,0.5,3600.0
0.0,12.452,q_reuse.bcf,ee_reuse.bcf
3600.0,12.452,q_reuse.bcf,ee_reuse.bcf

            

Reuse XBGPU boundary file wavebndtype = 3;

When a boundary is generated for say a JONSWAP spectra, XBGPU saves a netcdf file XBGPU_bnd_reuse.nc. This file contains all the information necessary to reuse this file as boundary condition. simply put teh file name as your wavebndfile: wavebndfile = XBGPU_bnd_reuse.nc

When a timeseries of JONSWAP spectra has been used as an input. each Wave group timeseries and long bond wave will be save in the reuse netcdf file.

Generate wave group for JONSWAP parameters wavebndtype = 4;

Wave group and long bound waves can be generated with XBGPU using the same algorithm as XBeach. To generate the conditions the user need to specify 1 or more JONSWAP spectra in the wavebndfile. The file needs to contain a timeseries of : time, HS, Tp, Dp, s (spread), gamma (usually 3.3)


# JONSWAP wave input example
0.0,1.0,15.0,255.0,100.0,3.3
100.0,1.2,14.33,240.0,200.0,3.3
3600.0,1.0,12.78,200.0,400.0,3.3

            

Offshore water level

Offshore water level is uniform along the boundary. The water level boundary file contains a time series of water level in two column. The first column is time in seconds and the second column is water level in meter above the bathymetry datum. The time series can be tab delimited, space delimited or comma delimited. Simply make sure it is consistent. The time vector needs to be monotonically increasing but the time step can be variable (but >0.0). See the example below.


# Offshore water level boundary example
0.0,1.0
100.0,1.2
3600.0,1.0

            

If no sea level files are specified teh water level will be set to 0.0 throughout the duration of the model.

Wind boundary

Wind is applied uniformly accross the grid. By default no wind is applied but the user can specify a file which contains a time series fo time (s) speed (m/s) and direction (degree true North). The wind direction is automatically corrected to the angle of the grid. The time series can be tab delimited, space delimited or comma delimited. Simply make sure it is consistent. The time vector needs to be monotonically increasing but the time step can be variable (but >0.0). See the example below.


# Wind boundary example
0.0,5.0,250.0
150.0,12.0,252.0
4000.0,5.0,340.0

            

Side boundaries

In XBGPU the side boundaries are automatically fixed as Neumann on the v velocity only. This means that you have to have the first rows identical to the second and the last row identical to the second to last. To avoid instabilities at the boundary it is safe to have multiple identical rows at each boundare sthat smoothly transitionned to the real bathymetry.

Output

XBGPU is capable of producing 4 types of outputs:

  • Log file is systematically created as soon as you start the software. The log file contains information generated when the model is setup and as the model runs. It is the first place to look if the model terminate unexpectedly.
  • Gridded variable extrated at selected setps and stored in a netcdf variable (see below).
  • Variable timeseries from selected point(s) output extracted at every model step and stored in a txt file (see below).
  • Reusable boundary in Netcdf format When generating a wave goups and long bound waves from a JONSWAP spectra or an given spectra. XBGPU porduces a Netcdf output containin all the information necessary to rerun the model using the same wave group. This is usefull when the wave group take a long time to generate.

Gridded variables

gridded variables can be extracted from the model at regular time interval.

  • outputtimestep = 3600.000000; controls the interval between output of the gridded variables.
  • outfile = XBGPU_output.nc; controls the name of the Netcdf file that will contain the gridded variables. The file cannot be overwritten by XBGPU so data is appended to the file if it already exits.
  • outvars = H,uu,vv,zs,zb controls which gridded variable will be saved (See below).

Output Variables list

  • zb: Bathymetry, [m] positive down

  • uu: U velocity [m/s] at u-point of the cell

  • vv: V velocity [m/s] at v-point of the cell

  • zs: Water level above datum [m]

  • hh: Water depth [m]

  • H: RMS wave height [m]

  • thetamean: Mean wave direction [Deg to, math convention, 0 is perpendicular to the offshore boundary traveling to the shore]

  • ee: Wave energy []

  • rr: Roller energy []

  • cfm: Bottom friction cf

  • dzb: Relative change in the bathymetry [m since last step] (only when morphology is on)

  • stdep: Sediment Thickness [m]

  • Fx: Wave force in the x direction []

  • Fy: Wave force in the y direction []

  • cgx: Group wave celerity in the x direction [m/s]

  • cgy: Group wave celerity in the y direction [m/s]

  • cx: Wave celerity in the x direction [m/s]

  • cy: Wave celerity in the y direction [m/s]

  • ctheta: Wave celerity in the directional space [deg/s]

  • D: Wave energy dissipation rate

  • E: Wave energy integrated over directional bins []

  • urms: RMS bottom orbital velocity [m/s]

  • ueu: Eulerian velocity at u-point [m/s]

  • vev: Eulerian velocity at v-points [m/s]

  • hhmean: Mean water depth since last output [m]

  • uumean: Mean u velocity at u-points since last output [m/s]

  • vvmean: Mean v velocity at v-points since last output [m/s]

  • zsmean: Mean water elevation since last output [m]

  • zsmax: Max water elevation since last output [m]

  • Hmean: Mean RMS wave height since last output [m]

  • Cmean: Mean Sediment concentration since last output [g/l]

  • sigm:Angular frequency [rad/s]

  • k: Wave number [rad/m]

  • c: Wave celerity [m/s]

  • kh:Wave number x depth [rad]

  • cg:Group velocity [m/s]

  • sinh2kh:

  • dhdx:

  • dhdy:

  • dudx:

  • dudy:

  • dvdx:

  • dvdy:

  • C:

  • R:

  • DR:

  • wci:

  • vmageu:

  • vmagev:

  • dzsdx:

  • dzsdy:

  • dzsdt:

  • fwm:

  • hu:

  • hv:

  • hum:

  • hvm:

  • uv:

  • vu:

  • ududx:

  • vdvdy:

  • udvdx:

  • vdudy:

  • ust:

  • kturb:

  • rolthick:

  • ceqsg: