Skip to content

A Python implementation of SSGW (Steady Surface Gravity Waves) by Clamond & Dutykh (2018)

License

MIT, BSD-2-Clause licenses found

Licenses found

MIT
LICENSE
BSD-2-Clause
LICENSE.matlab
Notifications You must be signed in to change notification settings

wavesgroup/ssgw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssgw

A Python implementation of SSGW (Steady Surface Gravity Waves) by Clamond and Dutykh (2018).

The original (MATLAB) implementation is available here.

This Python implementation is a close translation of the original MATLAB code, and thus the original license is included in LICENSE.matlab.

Installation

pip install git+https://github.com/wavesgroup/ssgw

Usage

import numpy as np
from ssgw import SSGW

wave = SSGW(kd=np.inf, kH2=0.1)
x, z = wave.zs.real, wave.zs.imag
u, w = wave.ws.real, wave.ws.imag

Notes

  • This program computes waves of arbitrary length for all heights up to about 99% of the maximum one. It is not designed to compute (near) limiting waves.

  • The output quantities are dimensionless with the following scaling:

    • In deep water: rho = g = k = 1.
    • In finite depth: rho = g = d = 1.

Examples

  1. To compute a wave of steepness kH2 = 0.3 in infinite depth:
wave = SSGW(np.inf, 0.3)
  1. To compute a cnoidal wave with height-over-depth=0.5 and length-over-depth=100:
Hd = 0.5
Ld = 100
kd = 2 * np.pi / Ld
kH2 = np.pi * Hd / Ld
wave = SSGW(kd, kH2)
  1. For steep and long waves, the default number of Fourier modes must be increased. For instance, in order to compute a cnoidal wave with height-over-depth=0.7 and length-over-depth=10000:
Hd = 0.7
Ld = 10000
kd = 2 * np.pi / Ld
kH2 = np.pi * Hd / Ld
wave = SSGW(kd, kH2, 2**19)

Issues?

Please report any issues here.

About

A Python implementation of SSGW (Steady Surface Gravity Waves) by Clamond & Dutykh (2018)

Resources

License

MIT, BSD-2-Clause licenses found

Licenses found

MIT
LICENSE
BSD-2-Clause
LICENSE.matlab

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages