A distinction is made between the definition of grids in horizontal and vertical directions. In the horizontal direction recti- or curvilinear
coordinates are used. The grid definition in vertical direction is defined by means of a fixed number of layers in a such a way that both the
bottom topography and the free surface can be accurately represented; see also Figure 5.1.

First we need to define the size and direction of the computational domain in the horizontal plane.
The area of interest should be kept at least two wave lengths away from the boundaries. Note that if a sponge layer needs to be included,
the computational domain needs to be extended with the size of that sponge layer.
It is always wise to choose the grid axes being aligned as much as possible with the dominant wave direction.
You may also generate a curvilinear grid.

An important aspect of specifying a computational grid is the spatial resolution. In principle, most energetic
wave components need to be resolved accurately on the grid. Basically, we take sufficient number of grid points per
wave length associated with the peak wave energy.
For low waves, i.e. *H*/*d* 1 with *H* a characteristic wave height (either significant or RMS) and *d* the
(still) water depth, it is sufficient to take 50 grid cells (or 51 grid points) per peak wave length. However, for relatively
high waves, it is better to take at least 100 grid cells per peak wave length.
So, at least, we need to know something about a typical water depth
and a typical peak period. Based on the linear dispersion relation the corresponding peak wave length can be found.

An example. We have a domain of 1500 m alongshore and 1200 m crosshore of which the deepest part is 20 m. We impose a wave spectrum
at the entrance with a significant wave height of 2 m and a peak period of 10 s. According to the linear dispersion relation
the peak wave length is about 120 m and
*H*_{s}/*d* = 0.1. Hence, the waves are not too low but also not too high either.
So, for safety, we choose 100 grid cells per peak wave length which implies a grid size of 1.2 m. Since the dominant wave direction is
crosshore, we may relax the grid size alongshore by choosing 3 m. So, the total number of grid
cells for the computational domain would be 500 `x` 1000.

Keep in mind, however, that waves become shorter when the water depth decreases. Hence, for a desired number of grid cells per
wave length the grid resolution must therefore be higher locally. In this respect, a curvilinear grid may be useful. The desired
number of grid cells for this case may be lesser than the one associated with the peak wave length. A rule of thumb is 15 to 20.

Another issue is the choice of the number of layers. This choice mainly depends on two types of application:

- vertical flow structures, and
- wave transformation.

Concerning the wave transformation, the number of layers is determined by the linear frequency dispersion. In particular, the dimensionless depth,

The range of applicability of the SWASH model to values of

K |
range | error |

1 | kd 0.5 |
1% |

1 | kd 2.9 |
3% |

2 | kd 7.7 |
1% |

3 | kd 16.4 |
1% |

a relative error in the normalized wave celerity (=

It is noted that SWASH uses its own dispersion relation, which is an approximate one of the exact linear dispersion relation, given by

= *gk* tanh(*kd* )

This approximate relation is derived using the Keller-box scheme (see Section 5.4.3) and depends on the number of equidistant layers
employed in the model. The linear dispersion relation of SWASH using one vertical layer, i.e. depth-averaged, is given
by

= *gk*

while for two and three equidistant layers, it is given by

= *gk*

and

= *gk*

respectively. Thus the approximate dispersion relation is consistent with the model,
particularly for relatively high wave frequencies. This will lead to more accurate results. The approximate dispersion relation in SWASH is
only available for one, two and three equidistant layers with variable thickness (i.e. sigma planes, not fixed layers).
SWASH shall indicate this in the So, for primary waves with

However, one must realized that, for a given number of layers, relatively high harmonics may propagate too slow at a given depth. For example, using one layer, SWASH is accurate up to a

d (m) |
K=1 |
K=2 |
K=3 |

1 | 0.82 | 1.37 | 2.00 |

5 | 0.37 | 0.61 | 0.89 |

10 | 0.26 | 0.43 | 0.63 |

15 | 0.21 | 0.35 | 0.52 |

20 | 0.18 | 0.31 | 0.45 |

25 | 0.16 | 0.27 | 0.40 |

30 | 0.15 | 0.25 | 0.36 |

35 | 0.14 | 0.23 | 0.34 |

40 | 0.13 | 0.22 | 0.32 |

45 | 0.12 | 0.20 | 0.30 |

50 | 0.12 | 0.19 | 0.28 |

100 | 0.08 | 0.14 | 0.20 |

This is particularly important when nonlinear effects are dominant

Ideally, the maximum frequency is about 1.5 to 2 times the peak frequency at a given depth. It is then assumed that all components above this maximum frequency have a little bit amount of energy (here the presuming spectrum shape is a Jonswap one). As a consequence, the phase differences between the

Referred to the example above, the peak frequency at the wavemaker boundary is 0.1 Hz, while the depth is 20 m. The required maximum frequency should be at least 0.15 Hz or preferably higher. So, the use of one layer would be critical when propagation of short waves with frequencies higher than 0.18 Hz needs to be modelled accurately.