23. Guidelines for simulation setup¶
In this chapter, guidelines are given about how to choose values of the grid parameters and parameters that control the time step. Hereby, the focus is on the accurate simulation of waves.
23.1. Grid resolution and grid stretching¶
When a simulation of an undisturbed wave is performed, the rule is to
use at least 60 cells per wavelength and at least 6 cells in the wave height. For
higher waves, the number of cells in the wave height can be increased
to (at least) 10.
Note that as a consequence many cells are needed in the deeper part of the water, so
some stretching may be applied in vertical direction, typically sz
is between 1.01 and 1.03.
When an object is put into the wave and someone is interested in the local wave loads on the object, more cells are needed in the neighborhood of the object. There are two ways to take care of a fine grid near the object.
- Use a small domain around the object (less than a wavelength)
and simulate only a short time (one wave period or less). Then, a
fine grid can be defined in this small domain. No stretching is
needed, or only a very small level of stretching (
sx,sy,sz
\(\leq 1.01\)}). The central point of stretching should be placed at the point where the most interesting wave impact will occur. At the end of the domain, a Sommerfeld boundary condition or a simple Neumann condition (io=4
orio=2
}, respectively) can be used, because reflections are less important when a short simulation time is used. In y-direction, solid walls are used, which are placed far enough from the object (typically 1 or 2 times the width on both sides of the object). In vertical direction, the total depth of the water can be taken, but for deep water, the domain can be cut off at about 2/3rd of the water depth. - When a longer simulation time is preferred, reflections against the outflow boundary require a careful choice of the domain length. Upon application of a GABC at the outflow boundary, the outflow can be chosen relatively close to the area of interest. It is also possible to use other outflow boundary conditions, but then a longer domain should be used. A damping zone can be added at the end of the domain, because the waves should be damped properly to prevent reflections. A a result the total domain (including a damping zone) is about two wave lengths or more. Take care that at least 60 cells per wavelength are used. In vertical direction, the total depth of the water can be taken, but in deep water, the domain can be cut off at about 2/3rd of the water depth.
When a grid study of a simulation is performed, the grid is mostly
refined with a factor two each time. When a uniform grid is used,
this is very easy, just increase imax
, jmax
and kmax
with a factor 2 (or any factor you like). When a stretched grid is
used (defined in ${INPUT}/comflow.in
using parameters sx
, sy
and sz
), special care has to be taken that grid refinement is done well.
Not only imax
, jmax
and kmax
have to be doubled, but also the stretch factors have
to be adjusted. When the grid is refined with a factor two, the new
stretch factors should have values of the square root of the old factors. For example:
when using a grid of 30x30x30 grid points with
sx=1.0
, sy=1.0
and sz=1.0201
, the refined grid should have
values: 60x60x60 with sx=1.0
, sy=1.0
and sz=1.01
. In
general, the value of sx^imax
should remain constant for
proper stretching in the x-direction.
23.2. Time integration and numerical stability¶
The time step is controlled during the run of the program using the following criteria:
- The time step of the very first cycle is given by the user
in
${INPUT}/comflow.in
. At the start of this first cycle, it is checked if this time step satisfies the diffusive restriction for the time step. If this criterion is not satisfied, the time step is adjusted. - After the first cycle, the following criterion holds for
changing the time step (if automatic time step adjustment is enabled):
If the CFL number is larger than
cflmax
, the time step size is subsequently reduced by a factor of 2 in order to become smaller thancflmax
again. If the CFL number is smaller thancflmin
for a duration of at least 10 subsequent time steps the time is increased by a factor of 2 under the condition that the CFL number remains smaller thancflmax
.
Hence, the time step can be controlled by the user by means of the parameters
dtmax
, cflmin
and cflmax
. When performing a wave
simulation, there is a clear restriction of the time step for accuracy
reasons. This restriction can be taken into account by setting
dtmax=T/250
, where T
is the wave period.
For cflmin
and cflmax
the following must hold:
0< cflmin
< cflmax
<=1. The parameter cflmax
is bounded
by 1 to ensure stability, but for safety
a smaller value should be taken.
Useful values are cflmin=0.2
and
cflmax=0.5
when the Forward Euler method is used. In case of
Adams-Bashforth (see fixed_form_input/numerical
)
cflmin=0.04
and
cflmax=0.1
is advised. When the influence of the time step is investigated,
cflmin
and cflmax
can be used to tune the time step.