The "WaveSpectrum" plugin is a medium interface that is used specifically with a water medium as defined as part of the "medium_list" in a JSIM style simulation (see jsim documentation). It is based on generating a "virtual" height field model by transforming from the frequency domain of the spectrum to a spatial height field.
Introduction
The wave height model provides a mechanism to generate a winddriven wave surface in DIRSIG based on a wave frequency spectrum. The approach taken in DIRSIG is based on the work of Mastin et al ("Fourier Synthesis of Ocean Scenes" [1987]). The wave frequency spectrum is usually based on point samples of wave heights (e.g. buoy measurements) and represents waves traveling in all possible directions. Therefore it is necessary to define a spreading function that describes how that spectrum is distributed angularly (the spread). Finally, we also need to drive the wind speed as measured from a particular height. This is currently taken as a set of parameters defining the speed and direction and is currently independent from any other wind speeds in DIRSIG (e.g. as defined in a weather file).
After constructing a fully directional frequency spectrum of the wave surface, it is used to filter the Fourier transform of a random surface. Once we return from frequency space, we’re left with a surface that is representative of the frequencies in the model. Additionally, by carefully manipulating the phase of each wave (based on wave dispersion relations since they travel at different speeds), we can animate the surface as a function of time. A typical wave spectrum model definition might look like:
... { "name" : "WaveSpectrum", "inputs" : { "width" : 500, "nelements" : 1024, "seed" : 2384921, "wind" : { "name" : "CONST", "speed" : 4.21, "direction" : 0 }, "spectrum" : { "name" : "PM" }, "spread" : { "name" : "COS2S", "s" : 20 } } }, ...
All wave height models are currently described for a square area (to simplify some of the internal calculations) with the side of the square defined by "width"
in meters. The number of actual elements used (i.e. the number of height sample points) is driven by the "nelements"
entry which gives the number of samples along one dimension. The number of sample points dictates the resolution of the height field and is usually selected such that the facetization is subpixel (in this case the longest edge of a triangle would be 500/1024 = 49cm). The "seed"
can be used to guarantee the same pseudorandom generation of the surface.
Each of the input subsections have a mandatory "name"
tag and are described below.
Wave spectra
The wave spectral section is denoted by a "spectrum"
tag and consists of the spectrum model name and, in some cases, (optional) parameters.

"PM"
(Pierson and Moskowitz 1964)
this is a classic first generation wave model that assumes a fully developed sea state and does not represent nonlinear wavetowave interactions

no parameters are supplied to this model (except for the wind speed generated by the wind component)


"JONSWAP"
(JOint North Sea WAve observation Project — Hasselmann et al. 1973)
this spectrum is a popular correction to the PiersonMoskowitz spectrum that incorporates nonlinear effects via a peakenhancement factor and the fetch length (distance along which the wind has blown at a constant rate)

the JONSWAP spectrum is parametrized by the
"fetch"
length (in meters, though it is usually on the order of km) and the peak enhancement factor,"gamma"
. The default values are1e6
(100km) and3.3
, respectively. 
the effect of varying the two JONSWAP spectra parameters is shown below (note that a gamma value of one results in a PiersonMoskowitz spectrum)

Spreading functions
This section is indicated by a "spread"
tag and only a single model is available:

The
"COS2S"
(cosine of the angle from the wind vector to an even power)
this is a simple power of the cosine of the angle parametrized by an integer value
"s"
such that the spread is calculated as \(\cos{}^{2s}\) 
by default, the value of
"s"
is20

Wind speed
This section is indicated by a "wind"
tag and only a constant, externally defined wind is currently available as a model "name"
:

The
"CONST"
(constant wind speed and direction) model has options:
"speed"
in m/s measured at 10 m above the water surface
conversion from a wind speed measured at 19.5m above the surface (another common value) to 10m above the surface can be done by multiplying by roughly 0.975

note that this wind model is for the wave surface generation only and won’t be used elsewhere in the simulation


"direction"
sets the source of the wind measured in degrees clockwise from North 
The default option values are
2
[m/s] from the North (0
degrees).
