SSGW: steady surface gravity waves in any depth

Four steady waves in deep water, of steepness kH/2 = 0.1, 0.2, 0.3 and 0.4, computed with the default tolerance and
4096 Fourier modes. Panel (a) shows the free surface over one wavelength: the crest sharpens and the trough flattens as
the steepness grows. Panel (b) shows the moduli of the Fourier coefficients of the elevation, which fall exponentially
to the level of rounding errors, so that each wave is obtained to about fourteen digits.
SSGW is a MATLAB function, which also runs unchanged in GNU Octave, that computes irrotational two-dimensional periodic
surface gravity waves of permanent form in water of any depth, from short Stokes waves in deep water to long cnoidal
waves in shallow water, for all but the (almost) highest waves. It recasts the free-surface problem as the Babenko
equation in conformal variables, discretises it with a Fourier pseudo-spectral method and solves it by Petviashvili
iterations. The method, its accuracy and its limits are described in the article by Didier Clamond and Denys Dutykh in
the Journal of Fluid Mechanics (2018), cited below.
The problem
The fluid is ideal and incompressible, the flow is irrotational, and the wave is periodic and steady in the frame of
reference that moves with it. Two dimensionless numbers define the wave:
kd = k d relative depth: the wavenumber k times the mean depth d (kd = inf for deep water)
kH2 = k H / 2 steepness: the wavenumber times half the total wave height H
In conformal variables the unknown free surface becomes the solution of a single nonlinear equation for the
elevation, the Babenko equation. The elevation is expanded in N positive Fourier modes, and the equation is solved by
the Petviashvili iteration until the residual falls below the tolerance tol.
Quick start
From the folder of SSGW.m, in MATLAB or GNU Octave:
[zs, ws, PP] = SSGW(inf, 0.3); % deep water, steepness kH/2 = 0.3
Hd = 0.5; Ld = 100; % cnoidal wave with H/d = 0.5 and L/d = 100
[zs, ws, PP] = SSGW(2*pi/Ld, pi*Hd/Ld);
Hd = 0.7; Ld = 10000; % long and steep: more Fourier modes
[zs, ws, PP] = SSGW(2*pi/Ld, pi*Hd/Ld, 2^19);
Each call plots the free surface and the spectrum of its elevation, prints the numerical and physical parameters, and
returns the complex abscissas zs of the free surface at the computational nodes, the complex velocity ws there, and
the vector PP of physical parameters listed below. The optional third and fourth arguments are the number N of
positive Fourier modes (2048 by default) and the tolerance tol (10⁻¹⁴ by default).
Physical parameters returned in PP
| Entry |
Quantity |
PP(1) |
mean depth d |
PP(2) |
wavenumber k |
PP(3) |
wave height H |
PP(4) |
phase speed c_e (Stokes’ first definition) |
PP(5) |
phase speed c_s (Stokes’ second definition) |
PP(6) |
Bernoulli constant B |
PP(7) |
crest height a |
PP(8) |
trough height b, counted downwards from the mean level |
PP(9) |
impulse I |
PP(10) |
potential energy V |
PP(11) |
kinetic energy K |
PP(12) |
radiation stress Sxx |
PP(13) |
momentum flux S |
PP(14) |
energy flux F |
PP(15) |
group velocity c_g |
All quantities are dimensionless, with ρ = g = k = 1 in deep water and ρ = g = d = 1 in finite depth. The integral
quantities PP(9) to PP(15) are given in the frame of reference with zero circulation, where the kinetic energy is
K = c_e I / 2 (appendix B of the article).
A check of the outputs
The version of 8 February 2017 left PP(11) at zero through a misprint; it now returns the kinetic energy, and the
list of outputs in the header of SSGW.m matches the code. For small waves the kinetic and potential energies must
become equal (the equipartition of linear waves), and the outputs show it. In deep water:
kH/2 K/V − 1 (K/V − 1)/(kH/2)²
0.001 5.0000 × 10⁻⁷ 0.500000
0.01 5.0003 × 10⁻⁵ 0.500025
0.05 1.2516 × 10⁻³ 0.500629
0.1 5.0256 × 10⁻³ 0.502560
0.3 4.7571 × 10⁻² 0.528568
The energies V and K are computed independently, the first from the shape of the free surface and the second from the
impulse and the phase speed, and their ratio tends to one like 1 + (kH/2)²/2.
Contents
The repository holds the function SSGW.m and, in docs/figures/, the two scripts that make the figure of this page:
ssgw_readme_data.m (MATLAB or GNU Octave) computes the four waves and writes their profiles and spectra, and
plot_readme_figure.py (Python 3 with NumPy and Matplotlib, and the style file beside it) draws them. Both are run
from docs/figures/, in this order.
Requirements
MATLAB or GNU Octave (tested with Octave 11.1); no toolbox is needed.
How to cite
If you use this code, please cite the article:
D. Clamond and D. Dutykh, Accurate fast computation of steady two-dimensional surface gravity waves in arbitrary
depth, Journal of Fluid Mechanics 844, 491–518 (2018).
https://doi.org/10.1017/jfm.2018.208
@article{Clamond2018b,
author = {Clamond, Didier and Dutykh, Denys},
title = {Accurate Fast Computation of Steady Two-Dimensional Surface Gravity Waves in Arbitrary Depth},
journal = {Journal of Fluid Mechanics},
year = 2018,
month = jun,
volume = {844},
pages = {491--518},
doi = {10.1017/jfm.2018.208},
eprint = {1702.04132},
archiveprefix = {arXiv}
}
The button “Cite this repository” in the right-hand column of this page gives the same reference, read from
CITATION.cff. A free copy of the article is kept by HAL:
https://hal.science/hal-01465813/
Licence
GNU General Public License, version 3 (see LICENSE).
Authors
Didier Clamond (Université Côte d’Azur, Laboratoire J.A. Dieudonné, Nice) and Denys Dutykh (Mathematics Department,
Khalifa University of Science and Technology, Abu Dhabi).
https://www.denys-dutykh.com/
评论