From Gerris

Jump to: navigation, search

GfsInitWave is used within the GfsWave spectral wave model to create an initial wave spectrum.

The syntax in parameter files is:

[ GfsGenericInit ] [ GfsFunction ] [ GfsFunction ]

where the first GfsFunction returns the product of the frequency and direction distributions and the second GfsFunction returns the spatial distribution of the significant wave height. The first GfsFunction typically depends on two arguments specific to the wave model (in addition to the usual variables usable within GfsFunctions):

the frequency (Hz) of the given wave component.
the direction of propagation (radians) of the given wave component.


  • "Garden sprinkler effect" in wave model
  •     InitWave {} {
            /* This function defines the spectral distribution:
             * a gaussian in frequency space and 
             * a cos(theta)^2 distribution in direction space 
            return gaussian (Frequency, 0.1, 0.02)*
                   costheta (Direction, 30.*M_PI/180., 2.);
        } {
            /* This function defines the significant wave height:
             * the energy is a gaussian bump in (x,y) space,
             * the maximum significant wave height is 2.5 
            x -= -2000.;
            y -= -2000.;
            double Hsmax = 2.5;
            double E = (Hsmax*Hsmax/16.)*gaussian (sqrt (x*x + y*y), 0., 150.);
            return 4.*sqrt (E);

Personal tools