The idealisation of a wave
Update Notes  Reverse chronological order
July 2015  I have added some notes and comments
to the file Instructions.pdf.
Errors had crept into some of the figures, including the
incorrect dimensioning of wave height H on Figure
41. The corrected version of the figure is as shown above. I have
taken the opportunity to redefine the free surface
elevation eta with origin on the bed, as the output from
the program uses that. This required changes to the presentation of some of
the theory in the document, but is unimportant as far as program operation
is concerned. I added a little section on the value of
gravitational acceleration g to use. It is more
whimsical than anything else, but it does point out that the oftenused g
= 9.81 m/s^2 is actually not correct to that accuracy for
most of the world's population. The changes are described in the
comments which are included in that file.
March 2014  I have made cosmetic input/output
changes to all three programs. The screen output for all
three programs, Fourier, Stokes, and Cnoidal, has been
simplified and made consistent with each other. Similarly
the output files have had all headers made consistent. It
should now be easier to compare results between programs.
I have made a slight change to the Stokes program so as
to use the secant method to solve for wavelength if period
is known. The previous use of the bisection method could
fail in extreme cases. Also, one can now specify the order
of the Stokes theory without restriction, from 1 to 5.
May 2013  The header files of the source code for the
program have been simplified and a number of little
incompatibilities with correct C++ eliminated. It has now
been compiled without any warnings.
The introduction to the explanatory document Instructions.pdf has been
rewritten, putting the Fourier approach in context, and
introducing the StokesUrsell number for the boundary
between Stokes and cnoidal theories, even if that is
incidental to the present work.
29 May 2013  Much more importantly, I have discovered
that there has been an error in the program for some
years. It used a value of current that was roughly half of
the value specified. If the current specified was zero the
program was correct, also using zero. In general, there
was an error. I have corrected it in the current download
version. This is described rather more fully in the
instructions file.
3 June 2013  To help guard against such errors, I have
upgraded my cnoidal theory and Stokes theory packages, and
now distribute them with Fourier, to provide something of
a check on each. The two programs based on the
complementary theories uses the same data files as
Fourier, but each should be installed in a subdirectory of
the Fourier one. The two programs agree well with Fourier
for short waves in the case of Stokes and long waves in
the case of Cnoidal. In general, however, Fourier is to be
preferred.

Download programs and instruction manual
There are now threeprograms that can be used. The
instructions file for all is Instructions.pdf,
which is also included in Fourier.zip.
 A Fourier approximation method whose only
approximation lies in truncating the number of terms in
the approximating series: Fourier.zip
 current version, 20 March 2015.
 An implementation of cnoidal theory, which is based on
series expansions in shallowness, requiring that the
waves be long relative to the water depth : Cnoidal.zip  current version,
20 March 2015 (to be unpacked in a subdirectory of the
Fourier one). This is an approximation, and not as
applicable to higher waves as the Fourier method. It can
be used as a check on that method  for waves that are
not high, both should give the same results.
 An implementation of Stokes theory, requiring that the
waves be not too long relative to the water depth: Stokes.zip  current version 20
March 2015 (to be unpacked in a subdirectory of the
Fourier one). This is also an approximation, and not as
applicable to higher waves as the Fourier method. It can
be used as a check on that method  for waves that are
not high, both should give the same results.
Questions, problems: please email me here: John Fenton
Description
The main theories and methods for the steady wave problem
which have been used are: Stokes
theory, an explicit theory based on an assumption
that the waves are not very steep and which is best suited
to waves in deeper water; and cnoidal
theory, an explicit theory for waves in shallower
water. The accuracy of both depends on the waves not being
too high. In addition, both have a similar problem, that
in the inappropriate limits of shallower water for Stokes
theory and deeper water for cnoidal theory, the series
become slowly convergent and ultimately do not converge.
An approach which overcomes this is the Fourier
approximation method, which does not use series expansions
based on a small parameter, but obtains the solution
numerically. It could be described as a nonlinear spectral
approach, where a series is assumed, each term of which
satisfies the field equation, and then the coefficients
are found by solving a system of nonlinear equations.
This, originated by Chappelear in 1961, is the basis of
the computer program FOURIER. It has been widely used to
provide solutions in a number of practical and theoretical
applications, providing solutions for engineering and
geophysics. The method provides accurate solutions for
waves up to very close to the highest. Below is shown the
surface profile for a wave of length L/d=50 and a height
98% of the maximum for that length  for such a long and
high wave (approaching a sharp crest), the method is close
to its limits.
The original theory and Fortran code can be found here,
or a more recent presentation here.
The current download version Fourier
also contains the code in the language C++. A description
of the theory and program inputs and outputs is given in Instructions.
A package with programs for cnoidal theory is also
available: Cnoidal.zip, which
is also described in Instructions,
as is a package for Stokes theory: Stokes.zip.
There is also a numerical
cnoidal theory where long waves can be treated
without difficulty, however for wavelengths at least as
long as 50 times the depth, the Fourier method provides
good solutions.
