Skip to content

Wave Particle Kinematics

The fluidmec.waves.kinematics module provides first-order fluid velocities, accelerations and particle orbital trajectories for linear progressive gravity waves.

Coordinate convention

  • Horizontal coordinate \(x\) is positive in the propagation direction.
  • Vertical coordinate \(z\) is positive upwards.
  • Still water level is located at \(z=0\).
  • The impermeable seabed is located at \(z=-h\).
  • All dimensional inputs and outputs use SI units.

Governing equations

The linear dispersion relation is

\[ \omega^2 = gk\tanh(kh). \]

The wave phase is

\[ \theta = kx-\omega t+\theta_0. \]

Orbital semi-axes

\[ A_x = a\frac{\cosh[k(z+h)]}{\sinh(kh)} \]
\[ A_z = a\frac{\sinh[k(z+h)]}{\sinh(kh)} \]

Particle velocity

\[ u=\omega A_x\cos\theta \]
\[ w=\omega A_z\sin\theta \]

First-order acceleration

\[ a_x=\omega^2 A_x\sin\theta \]
\[ a_z=-\omega^2 A_z\cos\theta \]

Particle displacement

\[ \xi=-A_x\sin\theta \]
\[ \zeta=A_z\cos\theta \]

The approximate instantaneous particle coordinates are

\[ x_p=x_0+\xi \]
\[ z_p=z_0+\zeta. \]

Basic usage

from fluidmec.waves import (
    particle_velocity,
    particle_acceleration,
    particle_position,
    solve_wave_number,
)

a = 1.0
T = 8.0
h = 20.0

k = solve_wave_number(T, h)

u, w = particle_velocity(
    a, 10.0, -5.0, 0.0, k, h
)

ax, az = particle_acceleration(
    a, 10.0, -5.0, 0.0, k, h
)

xp, zp = particle_position(
    a, 10.0, -5.0, 0.0, k, h
)

Vectorised depth profiles

import numpy as np

from fluidmec.waves import (
    orbital_velocity_amplitudes,
    solve_wave_number,
)

h = 20.0
k = solve_wave_number(8.0, h)

z = np.linspace(-h, 0.0, 200)

u_max, w_max = orbital_velocity_amplitudes(
    1.0, k, z, h
)

Numerical stability

The module reuses the stable exponential depth factors implemented in fluidmec.waves.airy.

This avoids direct evaluation of overflowing hyperbolic functions for large dimensionless water depths.

The supported numerical range remains limited by the floating-point representation of the inputs and intermediate quantities. Nonfinite calculated results are rejected.

Assumptions and limitations

  • First-order linear Airy wave theory.
  • Incompressible, inviscid and irrotational fluid.
  • Constant depth and a horizontal impermeable seabed.
  • No background current.
  • No surface tension.
  • No nonlinear convective acceleration.
  • No second-order Stokes drift.
  • No wave stretching above the mean water level.
  • No automatic enforcement of wave-theory applicability.

Particle position is a first-order analytical approximation, not numerical integration of the full Lagrangian equations.

Returned particle coordinates are not clipped to the mean water column.

Validation

The accompanying tests verify:

  • Analytical velocity and acceleration equations.
  • Impermeable seabed boundary conditions.
  • Free-surface kinematic boundary conditions.
  • Velocity potential gradients.
  • Incompressibility and irrotationality.
  • Temporal differentiation of velocity and displacement.
  • Elliptical orbital trajectories.
  • Deep-water and shallow-water limits.
  • NumPy broadcasting and scalar return types.
  • Invalid input and numerical overflow handling.

Visualisation

From the project root:

python examples/wave_kinematics_example.py
python examples/wave_kinematics_example.py --animate

Generated files:

  • outputs/wave_kinematics_analysis.png
  • outputs/wave_particle_orbits.gif

API reference

First-order particle kinematics beneath linear progressive gravity waves.

This module evaluates Eulerian fluid velocity, first-order acceleration, and approximate Lagrangian orbital displacement using Airy wave theory.

Coordinate convention

x : horizontal coordinate, positive in the propagation direction. z : vertical coordinate, positive upwards from still water level. h : positive water depth, with the seabed located at z = -h.

Physical assumptions
  • Incompressible, inviscid and irrotational fluid.
  • Small-amplitude, two-dimensional progressive gravity waves.
  • Constant water depth and an impermeable horizontal seabed.
  • No background current or surface tension.
  • First-order linearisation of the free-surface boundary conditions.
  • Convective acceleration and second-order Stokes drift are neglected.

All dimensional inputs and outputs use SI units. NumPy broadcasting is supported throughout the public API.

References

Dean, R. G. and Dalrymple, R. A. (1991). Water Wave Mechanics for Engineers and Scientists. World Scientific.

ENGINEERING_GRAVITY module-attribute

ENGINEERING_GRAVITY: Final[float] = 9.81

ScalarOrArray module-attribute

ScalarOrArray = float | np.ndarray

ComponentPair module-attribute

ComponentPair = tuple[ScalarOrArray, ScalarOrArray]

as_float_array

as_float_array(value: ArrayLike, name: str) -> np.ndarray

Convert input to a finite floating-point array.

Source code in src/fluidmec/core/_validation.py
13
14
15
16
17
18
19
20
21
22
23
24
def as_float_array(
    value: ArrayLike,
    name: str,
) -> np.ndarray:
    """Convert input to a finite floating-point array."""

    array = np.asarray(value, dtype=float)

    if not np.all(np.isfinite(array)):
        raise ValueError(f"{name} must be finite.")

    return array

format_output

format_output(result: ArrayLike) -> float | np.ndarray

Return a Python float for scalar results.

Source code in src/fluidmec/core/_validation.py
69
70
71
72
73
74
75
76
77
78
79
def format_output(
    result: ArrayLike,
) -> float | np.ndarray:
    """Return a Python float for scalar results."""

    result = np.asarray(result, dtype=float)

    if result.ndim == 0:
        return float(result)

    return result

validate_non_negative

validate_non_negative(value: ArrayLike, name: str) -> np.ndarray

Validate non-negative numerical inputs.

Source code in src/fluidmec/core/_validation.py
41
42
43
44
45
46
47
48
49
50
51
52
def validate_non_negative(
    value: ArrayLike,
    name: str,
) -> np.ndarray:
    """Validate non-negative numerical inputs."""

    array = as_float_array(value, name)

    if np.any(array < 0):
        raise ValueError(f"{name} must be non-negative.")

    return array

validate_positive

validate_positive(value: ArrayLike, name: str) -> np.ndarray

Validate strictly positive numerical inputs.

Source code in src/fluidmec/core/_validation.py
27
28
29
30
31
32
33
34
35
36
37
38
def validate_positive(
    value: ArrayLike,
    name: str,
) -> np.ndarray:
    """Validate strictly positive numerical inputs."""

    array = as_float_array(value, name)

    if np.any(array <= 0):
        raise ValueError(f"{name} must be positive.")

    return array

cosh_depth_factor

cosh_depth_factor(wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike) -> float | np.ndarray

Calculate the stable hyperbolic cosine depth factor.

Parameters:

Name Type Description Default
wave_number array_like

Positive wave number in rad/m.

required
z array_like

Vertical coordinate in metres, satisfying -h <= z <= 0.

required
depth array_like

Positive still-water depth in metres.

required

Returns:

Type Description
float or ndarray

Dimensionless cosine depth attenuation factor.

Notes

Governing expression:

C = cosh(k*(z+h))/cosh(k*h)

Stable exponential formulation:

C = exp(k*z)*(1 + exp(-2*k*(z+h)))
    / (1 + exp(-2*k*h))

All exponential arguments are non-positive within the mean water column.

At z = 0, C = 1.

Source code in src/fluidmec/waves/airy.py
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
def cosh_depth_factor(
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
) -> float | np.ndarray:
    """Calculate the stable hyperbolic cosine depth factor.

    Parameters
    ----------
    wave_number : array_like
        Positive wave number in rad/m.
    z : array_like
        Vertical coordinate in metres, satisfying -h <= z <= 0.
    depth : array_like
        Positive still-water depth in metres.

    Returns
    -------
    float or numpy.ndarray
        Dimensionless cosine depth attenuation factor.

    Notes
    -----
    Governing expression:

        C = cosh(k*(z+h))/cosh(k*h)

    Stable exponential formulation:

        C = exp(k*z)*(1 + exp(-2*k*(z+h)))
            / (1 + exp(-2*k*h))

    All exponential arguments are non-positive within
    the mean water column.

    At z = 0, C = 1.
    """
    k = validate_positive(wave_number, "Wave number")
    z, h = _validate_vertical_coordinates(z, depth)

    with np.errstate(over="ignore", under="ignore"):
        q = k * (z + h)
        b = k * h

        numerator = 1.0 + np.exp(-2.0 * q)
        denominator = 1.0 + np.exp(-2.0 * b)

        result = np.exp(k * z) * numerator / denominator

    return _finite_result(result, "Cosine depth factor")

sinh_depth_factor

sinh_depth_factor(wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike) -> float | np.ndarray

Calculate the stable hyperbolic sine depth factor.

Parameters:

Name Type Description Default
wave_number array_like

Positive wave number in rad/m.

required
z array_like

Vertical coordinate in metres, satisfying -h <= z <= 0.

required
depth array_like

Positive still-water depth in metres.

required

Returns:

Type Description
float or ndarray

Dimensionless sine depth attenuation factor.

Notes

Governing expression:

S = sinh(k*(z+h))/cosh(k*h)

Stable exponential formulation:

S = exp(k*z)*(1 - exp(-2*k*(z+h)))
    / (1 + exp(-2*k*h))

NumPy expm1 is used to reduce cancellation close to the seabed.

At z = -h, S = 0. At z = 0, S = tanh(k*h).

Source code in src/fluidmec/waves/airy.py
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
def sinh_depth_factor(
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
) -> float | np.ndarray:
    """Calculate the stable hyperbolic sine depth factor.

    Parameters
    ----------
    wave_number : array_like
        Positive wave number in rad/m.
    z : array_like
        Vertical coordinate in metres, satisfying -h <= z <= 0.
    depth : array_like
        Positive still-water depth in metres.

    Returns
    -------
    float or numpy.ndarray
        Dimensionless sine depth attenuation factor.

    Notes
    -----
    Governing expression:

        S = sinh(k*(z+h))/cosh(k*h)

    Stable exponential formulation:

        S = exp(k*z)*(1 - exp(-2*k*(z+h)))
            / (1 + exp(-2*k*h))

    NumPy expm1 is used to reduce cancellation
    close to the seabed.

    At z = -h, S = 0.
    At z = 0, S = tanh(k*h).
    """
    k = validate_positive(wave_number, "Wave number")
    z, h = _validate_vertical_coordinates(z, depth)

    with np.errstate(over="ignore", under="ignore"):
        q = k * (z + h)
        b = k * h

        numerator = -np.expm1(-2.0 * q)
        denominator = 1.0 + np.exp(-2.0 * b)

        result = np.exp(k * z) * numerator / denominator

    return _finite_result(result, "Sine depth factor")

wave_phase

wave_phase(x: ArrayLike, time: ArrayLike, wave_number: ArrayLike, angular_frequency: ArrayLike, phase_offset: ArrayLike = 0.0) -> float | np.ndarray

Calculate the phase of a progressive sinusoidal wave.

Parameters:

Name Type Description Default
x array_like

Horizontal position in metres.

required
time array_like

Time in seconds.

required
wave_number array_like

Positive wave-number magnitude in rad/m.

required
angular_frequency array_like

Positive angular frequency in rad/s.

required
phase_offset array_like

Initial phase offset in radians.

0.0

Returns:

Type Description
float or ndarray

Unwrapped wave phase in radians.

Notes

Equation:

theta = k*x - omega*t + phase_offset

Positive k and omega describe propagation in the positive x direction.

This general phase function does not independently enforce the gravity-wave dispersion relation.

Source code in src/fluidmec/waves/airy.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
def wave_phase(
    x: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    angular_frequency: ArrayLike,
    phase_offset: ArrayLike = 0.0,
) -> float | np.ndarray:
    """Calculate the phase of a progressive sinusoidal wave.

    Parameters
    ----------
    x : array_like
        Horizontal position in metres.
    time : array_like
        Time in seconds.
    wave_number : array_like
        Positive wave-number magnitude in rad/m.
    angular_frequency : array_like
        Positive angular frequency in rad/s.
    phase_offset : array_like, optional
        Initial phase offset in radians.

    Returns
    -------
    float or numpy.ndarray
        Unwrapped wave phase in radians.

    Notes
    -----
    Equation:

        theta = k*x - omega*t + phase_offset

    Positive k and omega describe propagation in the
    positive x direction.

    This general phase function does not independently
    enforce the gravity-wave dispersion relation.
    """
    x = as_float_array(x, "Horizontal position")
    t = as_float_array(time, "Time")
    k = validate_positive(wave_number, "Wave number")
    omega = validate_positive(
        angular_frequency,
        "Angular frequency",
    )
    offset = as_float_array(phase_offset, "Phase offset")

    with np.errstate(over="ignore", invalid="ignore"):
        result = k * x - omega * t + offset

    return _finite_result(result, "Wave phase")

dispersion_angular_frequency

dispersion_angular_frequency(wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY) -> float | np.ndarray

Calculate angular frequency from the dispersion relation.

Parameters:

Name Type Description Default
wave_number array_like

Wave-number magnitude k, in rad/m. Positive.

required
depth array_like

Still-water depth h, in metres. Positive.

required
gravity array_like

Gravitational acceleration, in m/s^2.

ENGINEERING_GRAVITY

Returns:

Type Description
float or ndarray

Angular frequency omega, in rad/s.

Notes

Equation:

omega = sqrt(g*k*tanh(k*h))

Assumes linear surface gravity waves.

Source code in src/fluidmec/waves/dispersion.py
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
def dispersion_angular_frequency(
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
) -> float | np.ndarray:
    """Calculate angular frequency from the dispersion relation.

    Parameters
    ----------
    wave_number : array_like
        Wave-number magnitude k, in rad/m. Positive.
    depth : array_like
        Still-water depth h, in metres. Positive.
    gravity : array_like, optional
        Gravitational acceleration, in m/s^2.

    Returns
    -------
    float or numpy.ndarray
        Angular frequency omega, in rad/s.

    Notes
    -----
    Equation:

        omega = sqrt(g*k*tanh(k*h))

    Assumes linear surface gravity waves.
    """
    k = validate_positive(wave_number, "Wave number")
    h = validate_positive(depth, "Water depth")
    g = validate_positive(gravity, "Gravity")

    omega = np.sqrt(g * k * np.tanh(k * h))

    return format_output(omega)

_finite_output

_finite_output(value: ArrayLike, name: str) -> ScalarOrArray

Return a finite scalar or array, rejecting numerical overflow.

Source code in src/fluidmec/waves/kinematics.py
49
50
51
52
53
54
55
56
57
58
59
def _finite_output(
    value: ArrayLike,
    name: str,
) -> ScalarOrArray:
    """Return a finite scalar or array, rejecting numerical overflow."""
    result = np.asarray(value, dtype=float)

    if not np.all(np.isfinite(result)):
        raise ValueError(f"{name} exceeds the supported numerical range.")

    return format_output(result)

_orbital_components

_orbital_components(amplitude: ArrayLike, wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike) -> tuple[np.ndarray, np.ndarray]

Calculate orbital semi-axes using stable Airy depth factors.

Source code in src/fluidmec/waves/kinematics.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
def _orbital_components(
    amplitude: ArrayLike,
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
) -> tuple[np.ndarray, np.ndarray]:
    """Calculate orbital semi-axes using stable Airy depth factors."""
    a = validate_non_negative(amplitude, "Wave amplitude")
    k = validate_positive(wave_number, "Wave number")
    h = validate_positive(depth, "Water depth")

    c = cosh_depth_factor(k, z, h)
    s = sinh_depth_factor(k, z, h)

    with np.errstate(
        over="ignore",
        under="ignore",
        divide="ignore",
        invalid="ignore",
    ):
        kh = k * h
        denominator = np.tanh(kh)

        if np.any(denominator <= 0.0):
            raise ValueError(
                "Dimensionless water depth is below the supported numerical range."
            )

        horizontal = a * (c / denominator)
        vertical = a * (s / denominator)

    horizontal = _finite_output(horizontal, "Horizontal orbital amplitude")
    vertical = _finite_output(vertical, "Vertical orbital amplitude")

    horizontal, vertical = np.broadcast_arrays(horizontal, vertical)

    return horizontal, vertical

_kinematic_state

_kinematic_state(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike, phase_offset: ArrayLike) -> tuple[np.ndarray, ...]

Return broadcast-compatible orbital and phase quantities.

Source code in src/fluidmec/waves/kinematics.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def _kinematic_state(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike,
    phase_offset: ArrayLike,
) -> tuple[np.ndarray, ...]:
    """Return broadcast-compatible orbital and phase quantities."""
    g = validate_positive(gravity, "Gravity")

    omega = validate_positive(
        dispersion_angular_frequency(wave_number, depth, g),
        "Angular frequency",
    )

    horizontal, vertical = _orbital_components(amplitude, wave_number, z, depth)

    theta = wave_phase(x, time, wave_number, omega, phase_offset)

    return tuple(
        np.broadcast_arrays(
            horizontal,
            vertical,
            omega,
            np.sin(theta),
            np.cos(theta),
        )
    )

horizontal_orbital_amplitude

horizontal_orbital_amplitude(amplitude: ArrayLike, wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike) -> ScalarOrArray

Calculate the horizontal particle orbital semi-axis.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude a [m].

required
wave_number array_like

Positive angular wave number k [rad/m].

required
z array_like

Mean vertical particle coordinate [m], satisfying -h <= z <= 0.

required
depth array_like

Positive still-water depth h [m].

required

Returns:

Type Description
float or ndarray

Horizontal displacement amplitude Ax [m].

Notes

Ax = acosh(k(z+h))/sinh(k*h).

Stable exponential depth factors are used instead of directly evaluating potentially overflowing hyperbolic functions.

Source code in src/fluidmec/waves/kinematics.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def horizontal_orbital_amplitude(
    amplitude: ArrayLike,
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
) -> ScalarOrArray:
    """Calculate the horizontal particle orbital semi-axis.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude a [m].
    wave_number : array_like
        Positive angular wave number k [rad/m].
    z : array_like
        Mean vertical particle coordinate [m], satisfying -h <= z <= 0.
    depth : array_like
        Positive still-water depth h [m].

    Returns
    -------
    float or ndarray
        Horizontal displacement amplitude Ax [m].

    Notes
    -----
    Ax = a*cosh(k*(z+h))/sinh(k*h).

    Stable exponential depth factors are used instead of directly
    evaluating potentially overflowing hyperbolic functions.
    """
    horizontal, _ = _orbital_components(amplitude, wave_number, z, depth)

    return format_output(horizontal)

vertical_orbital_amplitude

vertical_orbital_amplitude(amplitude: ArrayLike, wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike) -> ScalarOrArray

Calculate the vertical particle orbital semi-axis.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude a [m].

required
wave_number array_like

Positive angular wave number k [rad/m].

required
z array_like

Mean vertical coordinate [m], satisfying -h <= z <= 0.

required
depth array_like

Positive water depth h [m].

required

Returns:

Type Description
float or ndarray

Vertical displacement amplitude Az [m].

Notes

Az = asinh(k(z+h))/sinh(k*h).

Az is zero at the impermeable seabed and equals a at the still-water level, within floating-point accuracy.

Source code in src/fluidmec/waves/kinematics.py
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
def vertical_orbital_amplitude(
    amplitude: ArrayLike,
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
) -> ScalarOrArray:
    """Calculate the vertical particle orbital semi-axis.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude a [m].
    wave_number : array_like
        Positive angular wave number k [rad/m].
    z : array_like
        Mean vertical coordinate [m], satisfying -h <= z <= 0.
    depth : array_like
        Positive water depth h [m].

    Returns
    -------
    float or ndarray
        Vertical displacement amplitude Az [m].

    Notes
    -----
    Az = a*sinh(k*(z+h))/sinh(k*h).

    Az is zero at the impermeable seabed and equals a at the
    still-water level, within floating-point accuracy.
    """
    _, vertical = _orbital_components(amplitude, wave_number, z, depth)

    return format_output(vertical)

particle_velocity

particle_velocity(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ComponentPair

Calculate horizontal and vertical Eulerian fluid velocities.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude a [m].

required
x array_like

Horizontal evaluation coordinate [m].

required
z array_like

Vertical coordinate [m], satisfying -h <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number k [rad/m].

required
depth array_like

Positive water depth h [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial wave phase offset [rad].

0.0

Returns:

Type Description
tuple of float or ndarray

Horizontal velocity u and vertical velocity w [m/s].

Notes

theta = kx - omegat + phase_offset. u = omegaAxcos(theta). w = omegaAzsin(theta).

Angular frequency is calculated from the linear dispersion relation. Evaluation is restricted to the mean water column.

Source code in src/fluidmec/waves/kinematics.py
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
def particle_velocity(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ComponentPair:
    """Calculate horizontal and vertical Eulerian fluid velocities.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude a [m].
    x : array_like
        Horizontal evaluation coordinate [m].
    z : array_like
        Vertical coordinate [m], satisfying -h <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number k [rad/m].
    depth : array_like
        Positive water depth h [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial wave phase offset [rad].

    Returns
    -------
    tuple of float or ndarray
        Horizontal velocity u and vertical velocity w [m/s].

    Notes
    -----
    theta = k*x - omega*t + phase_offset.
    u = omega*Ax*cos(theta).
    w = omega*Az*sin(theta).

    Angular frequency is calculated from the linear dispersion relation.
    Evaluation is restricted to the mean water column.
    """
    ax, az, omega, sine, cosine = _kinematic_state(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset,
    )

    with np.errstate(over="ignore", invalid="ignore"):
        u = ax * omega * cosine
        w = az * omega * sine

    return (
        _finite_output(u, "Horizontal particle velocity"),
        _finite_output(w, "Vertical particle velocity"),
    )

horizontal_particle_velocity

horizontal_particle_velocity(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ScalarOrArray

Calculate the horizontal Eulerian velocity u [m/s].

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Horizontal and vertical coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
z array_like

Horizontal and vertical coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
float or ndarray

u = omegaAxcos(theta), in m/s.

See Also

particle_velocity : Evaluate both velocity components.

Source code in src/fluidmec/waves/kinematics.py
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
def horizontal_particle_velocity(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ScalarOrArray:
    """Calculate the horizontal Eulerian velocity u [m/s].

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Horizontal and vertical coordinates [m].
        The vertical coordinate must satisfy -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    float or ndarray
        u = omega*Ax*cos(theta), in m/s.

    See Also
    --------
    particle_velocity : Evaluate both velocity components.
    """
    u, _ = particle_velocity(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset=phase_offset,
    )

    return u

vertical_particle_velocity

vertical_particle_velocity(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ScalarOrArray

Calculate the vertical Eulerian velocity w [m/s].

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Horizontal and vertical coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
z array_like

Horizontal and vertical coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
float or ndarray

w = omegaAzsin(theta), in m/s.

Notes

Vertical velocity is zero at the impermeable seabed.

Source code in src/fluidmec/waves/kinematics.py
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
def vertical_particle_velocity(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ScalarOrArray:
    """Calculate the vertical Eulerian velocity w [m/s].

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Horizontal and vertical coordinates [m].
        The vertical coordinate must satisfy -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    float or ndarray
        w = omega*Az*sin(theta), in m/s.

    Notes
    -----
    Vertical velocity is zero at the impermeable seabed.
    """
    _, w = particle_velocity(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset=phase_offset,
    )

    return w

particle_acceleration

particle_acceleration(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ComponentPair

Calculate first-order horizontal and vertical accelerations.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Horizontal and vertical evaluation coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
z array_like

Horizontal and vertical evaluation coordinates [m]. The vertical coordinate must satisfy -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
tuple of float or ndarray

Horizontal and vertical accelerations [m/s^2].

Notes

ax = omega^2Axsin(theta). az = -omega^2Azcos(theta).

These are local time derivatives of the Eulerian velocity. They approximate material acceleration to first order in wave amplitude. Convective acceleration is not included.

Source code in src/fluidmec/waves/kinematics.py
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
def particle_acceleration(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ComponentPair:
    """Calculate first-order horizontal and vertical accelerations.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Horizontal and vertical evaluation coordinates [m].
        The vertical coordinate must satisfy -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    tuple of float or ndarray
        Horizontal and vertical accelerations [m/s^2].

    Notes
    -----
    ax = omega^2*Ax*sin(theta).
    az = -omega^2*Az*cos(theta).

    These are local time derivatives of the Eulerian velocity.
    They approximate material acceleration to first order in
    wave amplitude. Convective acceleration is not included.
    """
    ax, az, omega, sine, cosine = _kinematic_state(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset,
    )

    with np.errstate(over="ignore", invalid="ignore"):
        horizontal = (ax * omega) * omega * sine
        vertical = -(az * omega) * omega * cosine

    return (
        _finite_output(horizontal, "Horizontal acceleration"),
        _finite_output(vertical, "Vertical acceleration"),
    )

horizontal_particle_acceleration

horizontal_particle_acceleration(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ScalarOrArray

Calculate first-order horizontal acceleration [m/s^2].

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Evaluation coordinates [m], with -depth <= z <= 0.

required
z array_like

Evaluation coordinates [m], with -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
float or ndarray

Horizontal local acceleration du/dt [m/s^2].

See Also

particle_acceleration : Evaluate both acceleration components.

Source code in src/fluidmec/waves/kinematics.py
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
def horizontal_particle_acceleration(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ScalarOrArray:
    """Calculate first-order horizontal acceleration [m/s^2].

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Evaluation coordinates [m], with -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    float or ndarray
        Horizontal local acceleration du/dt [m/s^2].

    See Also
    --------
    particle_acceleration : Evaluate both acceleration components.
    """
    horizontal, _ = particle_acceleration(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset=phase_offset,
    )

    return horizontal

vertical_particle_acceleration

vertical_particle_acceleration(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ScalarOrArray

Calculate first-order vertical acceleration [m/s^2].

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Evaluation coordinates [m], with -depth <= z <= 0.

required
z array_like

Evaluation coordinates [m], with -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
float or ndarray

Vertical local acceleration dw/dt [m/s^2].

Notes

Vertical acceleration is zero at the mean seabed. Convective acceleration is neglected.

Source code in src/fluidmec/waves/kinematics.py
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
def vertical_particle_acceleration(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ScalarOrArray:
    """Calculate first-order vertical acceleration [m/s^2].

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Evaluation coordinates [m], with -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    float or ndarray
        Vertical local acceleration dw/dt [m/s^2].

    Notes
    -----
    Vertical acceleration is zero at the mean seabed.
    Convective acceleration is neglected.
    """
    _, vertical = particle_acceleration(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset=phase_offset,
    )

    return vertical

particle_displacement

particle_displacement(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ComponentPair

Calculate first-order displacement from mean particle position.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Mean particle coordinates [m], with -depth <= z <= 0.

required
z array_like

Mean particle coordinates [m], with -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
tuple of float or ndarray

Horizontal displacement xi and vertical displacement zeta [m].

Notes

xi = -Axsin(theta). zeta = Azcos(theta).

The integration constants are chosen to produce zero-mean displacements over one complete wave period.

This is a first-order analytical orbital approximation, not numerical integration of the full Lagrangian particle equations. Stokes drift is excluded.

Source code in src/fluidmec/waves/kinematics.py
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
def particle_displacement(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ComponentPair:
    """Calculate first-order displacement from mean particle position.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Mean particle coordinates [m], with -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    tuple of float or ndarray
        Horizontal displacement xi and vertical displacement zeta [m].

    Notes
    -----
    xi = -Ax*sin(theta).
    zeta = Az*cos(theta).

    The integration constants are chosen to produce zero-mean
    displacements over one complete wave period.

    This is a first-order analytical orbital approximation, not
    numerical integration of the full Lagrangian particle equations.
    Stokes drift is excluded.
    """
    ax, az, _, sine, cosine = _kinematic_state(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset,
    )

    return (
        _finite_output(-ax * sine, "Horizontal displacement"),
        _finite_output(az * cosine, "Vertical displacement"),
    )

particle_position

particle_position(amplitude: ArrayLike, x: ArrayLike, z: ArrayLike, time: ArrayLike, wave_number: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY, *, phase_offset: ArrayLike = 0.0) -> ComponentPair

Calculate approximate first-order particle coordinates.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
x array_like

Mean particle coordinates [m], with -depth <= z <= 0.

required
z array_like

Mean particle coordinates [m], with -depth <= z <= 0.

required
time array_like

Evaluation time [s].

required
wave_number array_like

Positive wave number [rad/m].

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY
phase_offset array_like

Initial phase offset [rad].

0.0

Returns:

Type Description
tuple of float or ndarray

Instantaneous first-order coordinates xp and zp [m].

Notes

xp = x + xi. zp = z + zeta.

The returned coordinates are not clipped to the mean water column. In particular, surface particles may move above z = 0.

The approximation does not enforce nonlinear free-surface geometry or detect particle crossings outside its validity range.

Source code in src/fluidmec/waves/kinematics.py
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
def particle_position(
    amplitude: ArrayLike,
    x: ArrayLike,
    z: ArrayLike,
    time: ArrayLike,
    wave_number: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
    *,
    phase_offset: ArrayLike = 0.0,
) -> ComponentPair:
    """Calculate approximate first-order particle coordinates.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    x, z : array_like
        Mean particle coordinates [m], with -depth <= z <= 0.
    time : array_like
        Evaluation time [s].
    wave_number : array_like
        Positive wave number [rad/m].
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].
    phase_offset : array_like, optional
        Initial phase offset [rad].

    Returns
    -------
    tuple of float or ndarray
        Instantaneous first-order coordinates xp and zp [m].

    Notes
    -----
    xp = x + xi.
    zp = z + zeta.

    The returned coordinates are not clipped to the mean water
    column. In particular, surface particles may move above z = 0.

    The approximation does not enforce nonlinear free-surface
    geometry or detect particle crossings outside its validity range.
    """
    xi, zeta = particle_displacement(
        amplitude,
        x,
        z,
        time,
        wave_number,
        depth,
        gravity,
        phase_offset=phase_offset,
    )

    with np.errstate(over="ignore", invalid="ignore"):
        xp = as_float_array(x, "Horizontal coordinate") + xi
        zp = as_float_array(z, "Vertical coordinate") + zeta

    return (
        _finite_output(xp, "Horizontal particle position"),
        _finite_output(zp, "Vertical particle position"),
    )

orbital_velocity_amplitudes

orbital_velocity_amplitudes(amplitude: ArrayLike, wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY) -> ComponentPair

Calculate maximum absolute component velocities over a cycle.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
wave_number array_like

Positive wave number [rad/m].

required
z array_like

Vertical coordinate [m], with -depth <= z <= 0.

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY

Returns:

Type Description
tuple of float or ndarray

Horizontal and vertical velocity amplitudes [m/s].

Notes

Umax = omegaAx. Wmax = omegaAz.

The two component maxima generally occur at different phases. They must not be combined as simultaneous velocity components.

Source code in src/fluidmec/waves/kinematics.py
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
def orbital_velocity_amplitudes(
    amplitude: ArrayLike,
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
) -> ComponentPair:
    """Calculate maximum absolute component velocities over a cycle.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    wave_number : array_like
        Positive wave number [rad/m].
    z : array_like
        Vertical coordinate [m], with -depth <= z <= 0.
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].

    Returns
    -------
    tuple of float or ndarray
        Horizontal and vertical velocity amplitudes [m/s].

    Notes
    -----
    Umax = omega*Ax.
    Wmax = omega*Az.

    The two component maxima generally occur at different phases.
    They must not be combined as simultaneous velocity components.
    """
    ax, az = _orbital_components(amplitude, wave_number, z, depth)

    omega = validate_positive(
        dispersion_angular_frequency(wave_number, depth, gravity),
        "Angular frequency",
    )

    with np.errstate(over="ignore", invalid="ignore"):
        u_max = ax * omega
        w_max = az * omega

    return (
        _finite_output(u_max, "Horizontal velocity amplitude"),
        _finite_output(w_max, "Vertical velocity amplitude"),
    )

orbital_acceleration_amplitudes

orbital_acceleration_amplitudes(amplitude: ArrayLike, wave_number: ArrayLike, z: ArrayLike, depth: ArrayLike, gravity: ArrayLike = ENGINEERING_GRAVITY) -> ComponentPair

Calculate maximum absolute first-order accelerations.

Parameters:

Name Type Description Default
amplitude array_like

Non-negative wave amplitude [m].

required
wave_number array_like

Positive wave number [rad/m].

required
z array_like

Vertical coordinate [m], with -depth <= z <= 0.

required
depth array_like

Positive water depth [m].

required
gravity array_like

Positive gravitational acceleration [m/s^2].

ENGINEERING_GRAVITY

Returns:

Type Description
tuple of float or ndarray

Horizontal and vertical acceleration amplitudes [m/s^2].

Notes

Ax_acceleration = omega^2Ax. Az_acceleration = omega^2Az.

The results exclude nonlinear convective acceleration.

Source code in src/fluidmec/waves/kinematics.py
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
def orbital_acceleration_amplitudes(
    amplitude: ArrayLike,
    wave_number: ArrayLike,
    z: ArrayLike,
    depth: ArrayLike,
    gravity: ArrayLike = ENGINEERING_GRAVITY,
) -> ComponentPair:
    """Calculate maximum absolute first-order accelerations.

    Parameters
    ----------
    amplitude : array_like
        Non-negative wave amplitude [m].
    wave_number : array_like
        Positive wave number [rad/m].
    z : array_like
        Vertical coordinate [m], with -depth <= z <= 0.
    depth : array_like
        Positive water depth [m].
    gravity : array_like, optional
        Positive gravitational acceleration [m/s^2].

    Returns
    -------
    tuple of float or ndarray
        Horizontal and vertical acceleration amplitudes [m/s^2].

    Notes
    -----
    Ax_acceleration = omega^2*Ax.
    Az_acceleration = omega^2*Az.

    The results exclude nonlinear convective acceleration.
    """
    u_max, w_max = orbital_velocity_amplitudes(
        amplitude, wave_number, z, depth, gravity
    )

    omega = validate_positive(
        dispersion_angular_frequency(wave_number, depth, gravity),
        "Angular frequency",
    )

    with np.errstate(over="ignore", invalid="ignore"):
        ax_max = np.asarray(u_max) * omega
        az_max = np.asarray(w_max) * omega

    return (
        _finite_output(ax_max, "Horizontal acceleration amplitude"),
        _finite_output(az_max, "Vertical acceleration amplitude"),
    )

References

Dean, R. G. and Dalrymple, R. A. (1991). Water Wave Mechanics for Engineers and Scientists. World Scientific.