Interface
#include <codecogs/engineering/fluid_mechanics/waves/analytic/stokes.h>
using namespace Engineering::Waves::Analytic;
| class | Stokes
| double | m_depth | | double | m_g | | int | m_sign | | double | m_amplitude | | double | m_k | | double | m_phase | | double** | A | | double* | tmpp | | [constructor] | Stokes () Default constructor | | [constructor] | Stokes (double k, double amplitude, double phase=0, double depth=0,double gravity=9.8066, int sign=1) Constructor for Stokes Wave class | | void | init (double k, double amplitude, double phase=0, double depth=0,double gravity=9.8066, int sign=1) Reinitialises the class with for a different set of wave conditions and depth | | double | component (int i) Returns the amplitude of the ith wave component | | double | getEta (double x, double time) Computes the surface elevation at the at x. | | double | getKin (double x, double z, double time, Derivative derivative=norm) Returns the requested Kinematics | | double | getMaxVel () Returns the maximum possible values at all spatial and temporal locations |
|
| double | Stokes_eta (double k, double amplitude, double x, double time=0, double depth=0)
Computes the surface elevation for a single point |
| double | Stokes_kin (double k, double amplitude, double x, double z, double time=0, Derivative derivative=norm, double depth=0)
Computes the surface kinematics at a single point |
| double | Stokes_surface_kin (double k, double amplitude, double x, double time=0, Derivative derivative=norm, double depth=0)
Compute the kinematics at the surface of the waves only |
| double | Stokes_maxVel (double k, double amplitude)
The Maximum horizontal velocities for a specific wave condition |
| double | Stokes_component (int i, double k, double amplitude, double depth=0)
Returns the ith component behind a Stokes Wave |
Use the following HTML code to embed the calculators within other websites:
| Name | HTML Code |
|---|
Stokes_eta
Computes the surface elevation for a single point | |
Stokes_kin
Computes the surface kinematics at a single point | |
Stokes_surface_kin
Compute the kinematics at the surface of the waves only | |
Stokes_maxVel
The Maximum horizontal velocities for a specific wave condition | |
Stokes_component
Returns the ith component behind a Stokes Wave | |
Overview
The Stokes wave is an analytical model for regular (each wave looks identical), steady (the wave form doesn't change with time) and unidirectional (all travelling in the same direction) waves.
In such an environment, the Stoke's solution provides an accurate description of both the surface elevation and all the underlying kinematics. In particular it is the first model to demonstrate that:
- the wave velocity increases slightly with increase of wave steepness.
- the wave profile is more peaked at the crests with wide, less shallow, troughs.
- the trajectories of water particles are not closed, leading to a mass transport in the direction of the waves, often called Stoke's drift.
- the waves break when the wave crest angle reached
.
In forming this solutions, Stokes (1874) assumed the fluid was inviscid and therefore irrotational, and also incompressible. Using the mathematical technique of series expansions (also called Stokes' expansion) he was able to derive a solution to the boundary conditions.
Class Stokes
This Stokes class provides a rapid mechanism for computing the surface elevation and internal kinematics within a wave. It is optimised on the assumption that many requests will be made for different spatial and temporal locations, where as the wave properties and water depth will be varied less frequently.
Example 1
- To following example outputs the surface elevation and then the velocities beneath the central wave:
#include <codecogs/engineering/fluid_mechanics/waves/analytic/stokes.h>
#include <stdio.h>
int main()
{
double Length=200; // Wave length [m]
double Amplitude=15; // Wave Height [m]
double Depth=30; // Depth [m]
double time=0; // Time [seconds]
Engineering::Waves::Analytic::Stokes water(2*pi()/Length, amplitude, 0, depth);
for(double x=-200;x<=200;x+=10)
printf("\n Eta(%lf)=%lf",x, water.getEta(x, time);
double eta=water.getEta(0,0);
for(double z=eta;z>-30;z--)
printf("\n Phi(%lf)=%lf\tu(%lf)=%lf\tv(%lf)=%lf",
z, water.getKin(0,z,time),
z, water.getKin(0,z,time,ddx),
z, water.getKin(0,z,time,ddz);
}
Authors
- William Bateman (April 2010)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
Members of Stokes
Stokes
Constructor for this class.
Call the init(...) function, below, with the supplied sea conditions and depth
Init
Computes a number of constants for the given sea state, which allow rapid evaluation of water surface at different temporal and spatial locations.| k | Wave number of dominant wave component [ ] |
| amplitude | Amplitude of the dominant wave component [m] |
| phase | Phase adjustment for the wave in radians |
| depth | Depth of water, from sea bed to still water level [m] |
| gravity | Acceleration due to gravity [ ] |
| sign | The Direction the wave propagate in. 1=left to right. -1=right to left. |
Component
Returns the amplitude of underlying frequency components| i | the ith component from 1 to 5 |
GetEta
Computes the surface elevation at the point
for the given Stokes 5th wave profile with wave-number(k) and an amplitude.| x | Spatial location at which to compute the elevation [m] |
| time | Temporal location at which to compute the elevation [sec] |
Returns
- The surface elevation about still water level [m]
GetKin
Computes the kinematics at the point
for the given Stokes 5th wave profile with wave-number(k) and an amplitude.
The derivate term allows different kinematics to be returns:
- Norm return Phi(
) - ddx, computes
or the horizontal velocity (u) - ddz, computer
or the vertical Velocity (v)
| x | Spatial location at which to compute the kinematics[m] |
| z | Depth at which to compute the kinematics [m] |
| time | Temporal location at which to compute the elevation [sec] |
| derivative | The derivative of Phi to compute |
Returns
- Velocity Potential [
] or Horizontal/Vertical velocity potential [
]
Stokes Eta