Skip to content

Structural Member Orientation

Overview

This module extends scalar Morison loading to fixed three-dimensional circular cylindrical members.

It supports arbitrary member orientations, vector projections, global force components and broadcast calculations over multiple members and time samples.

Coordinate convention

The global coordinate system is right-handed:

  • x: longitudinal horizontal direction.
  • y: transverse horizontal direction.
  • z: vertical direction, positive upwards.

The still water level is z = 0.

Vectors have shape (..., 3), with Cartesian components stored along the final array axis.

Member geometry

For endpoints A and B,

\[ \mathbf d=\mathbf r_B-\mathbf r_A \]
\[ L_m=\|\mathbf d\| \]
\[ \mathbf e=\frac{\mathbf d}{L_m} \]

Zero-length structural members are invalid.

Orientation angles

Inclination is measured above the horizontal xy plane.

Azimuth is measured from positive x towards positive y.

\[ \mathbf e= \begin{bmatrix} \cos\theta\cos\alpha\\ \cos\theta\sin\alpha\\ \sin\theta \end{bmatrix} \]

Angles are interpreted in degrees by default.

Vector projection

The axial component of a fluid vector is

\[ \mathbf U_\parallel= (\mathbf U\cdot\mathbf e)\mathbf e \]

The normal component is

\[ \mathbf U_\perp= \mathbf U-(\mathbf U\cdot\mathbf e)\mathbf e \]

The normal projection matrix is

\[ \mathbf P_\perp=\mathbf I-\mathbf e\mathbf e^T \]

The same projection is applied to fluid acceleration.

Vector Morison equation

The normal drag force per unit length is

\[ \mathbf f_D= \frac12\rho C_D D \|\mathbf U_\perp\|\mathbf U_\perp \]

The normal inertia force per unit length is

\[ \mathbf f_I= \rho C_M\frac{\pi D^2}{4}\mathbf a_\perp \]

The total force is

\[ \mathbf f=\mathbf f_D+\mathbf f_I \]

All force components are expressed in N/m of actual structural member length.

The existing scalar Morison functions are reused internally to calculate force magnitudes and multipliers.

Engineering example

from fluidmec.hydrodynamics import (
    unit_vector_from_angles,
    vector_morison_force_components,
)

direction = unit_vector_from_angles(
    inclination=45,
    azimuth=0,
)

drag, inertia, total = vector_morison_force_components(
    velocity=[2.0, 0.0, 0.0],
    acceleration=[1.0, 0.0, 0.0],
    direction=direction,
    diameter=4.0,
    drag_coefficient=1.0,
    inertia_coefficient=2.0,
    density=1025.0,
)

print(total)

Expected result in N/m:

[15779.67, 0.0, -15779.67]

Broadcasting

Vector inputs use shape (..., 3).

Physical scalar parameters broadcast against the leading vector dimensions.

For M members and T time samples, member directions can be represented by shape (M, 1, 3) and velocities by shape (T, 3).

The resulting force array has shape (M, T, 3).

Assumptions and limitations

  • Fixed circular cylindrical members.
  • Cross-flow independence approximation.
  • Undisturbed prescribed fluid kinematics.
  • User-specified hydrodynamic coefficients.
  • No axial skin friction or end-face loading.
  • No vortex-induced lift.
  • No structural motion or relative acceleration.
  • No diffraction or wake-interference modelling.
  • No distributed force integration in this module.

Forces are local values per unit actual member length.

The module does not calculate complete structural base shear or overturning moments.

The coefficients and geometric applicability must be assessed for each engineering application.

Verification

The test suite verifies:

  • Member geometry and unit vectors.
  • Projection orthogonality and reconstruction.
  • Projection matrix symmetry and idempotence.
  • Scalar Morison compatibility.
  • Inclined-member analytical solutions.
  • Coordinate rotation invariance.
  • Member endpoint reversal invariance.
  • Physical scaling and limiting cases.
  • Broadcasting and invalid inputs.
  • Integration with existing Airy wave kinematics.

API reference

fluidmec.hydrodynamics.orientation

Three-dimensional hydrodynamic loading on fixed circular members.

Vectors use the final array axis for Cartesian components (x, y, z). All physical quantities use SI units.

member_vector

member_vector(start: ArrayLike, end: ArrayLike) -> np.ndarray

Calculate displacement from the start to the end.

Parameters:

Name Type Description Default
start array_like

Member endpoints in metres, shape (..., 3).

required
end array_like

Member endpoints in metres, shape (..., 3).

required

Returns:

Type Description
ndarray

Member displacement vector in metres.

Source code in src/fluidmec/hydrodynamics/orientation.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
def member_vector(
    start: ArrayLike,
    end: ArrayLike,
) -> np.ndarray:
    """Calculate displacement from the start to the end.

    Parameters
    ----------
    start, end : array_like
        Member endpoints in metres, shape (..., 3).

    Returns
    -------
    ndarray
        Member displacement vector in metres.
    """
    start = _validate_vector(start, "start")
    end = _validate_vector(end, "end")

    return end - start

member_length

member_length(start: ArrayLike, end: ArrayLike) -> float | np.ndarray

Calculate actual structural member length in metres.

Zero-length members are rejected.

Source code in src/fluidmec/hydrodynamics/orientation.py
104
105
106
107
108
109
110
111
112
113
114
115
116
117
def member_length(
    start: ArrayLike,
    end: ArrayLike,
) -> float | np.ndarray:
    """Calculate actual structural member length in metres.

    Zero-length members are rejected.
    """
    displacement = member_vector(start, end)
    length = _vector_norm(displacement)

    validate_positive(length, "member_length")

    return format_output(length)

member_unit_vector

member_unit_vector(start: ArrayLike, end: ArrayLike) -> np.ndarray

Calculate the unit vector along a structural member.

Reversing the endpoints reverses the unit vector, but does not change the normal projection.

Source code in src/fluidmec/hydrodynamics/orientation.py
120
121
122
123
124
125
126
127
128
129
130
131
def member_unit_vector(
    start: ArrayLike,
    end: ArrayLike,
) -> np.ndarray:
    """Calculate the unit vector along a structural member.

    Reversing the endpoints reverses the unit vector,
    but does not change the normal projection.
    """
    displacement = member_vector(start, end)

    return _normalise(displacement, "member_vector")

unit_vector_from_angles

unit_vector_from_angles(inclination: ArrayLike, azimuth: ArrayLike = 0.0, *, degrees: bool = True) -> np.ndarray

Construct unit vectors from orientation angles.

Parameters:

Name Type Description Default
inclination array_like

Elevation above the horizontal xy plane. Must lie between -90 and 90 degrees, or between -pi/2 and pi/2 radians.

required
azimuth array_like

Angle measured from positive x towards positive y.

0.0
degrees bool

Interpret angles in degrees when True.

True

Returns:

Type Description
ndarray

Unit vectors with shape (..., 3).

Source code in src/fluidmec/hydrodynamics/orientation.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
168
169
170
171
172
173
174
175
176
177
def unit_vector_from_angles(
    inclination: ArrayLike,
    azimuth: ArrayLike = 0.0,
    *,
    degrees: bool = True,
) -> np.ndarray:
    """Construct unit vectors from orientation angles.

    Parameters
    ----------
    inclination : array_like
        Elevation above the horizontal xy plane.
        Must lie between -90 and 90 degrees, or
        between -pi/2 and pi/2 radians.
    azimuth : array_like
        Angle measured from positive x towards positive y.
    degrees : bool
        Interpret angles in degrees when True.

    Returns
    -------
    ndarray
        Unit vectors with shape (..., 3).
    """
    inclination = as_float_array(inclination, "inclination")
    azimuth = as_float_array(azimuth, "azimuth")

    if degrees:
        inclination = np.deg2rad(inclination)
        azimuth = np.deg2rad(azimuth)

    if np.any(np.abs(inclination) > np.pi / 2):
        raise ValueError("inclination must be between -90 and 90 degrees.")

    inclination, azimuth = np.broadcast_arrays(inclination, azimuth)

    return np.stack(
        (
            np.cos(inclination) * np.cos(azimuth),
            np.cos(inclination) * np.sin(azimuth),
            np.sin(inclination),
        ),
        axis=-1,
    )

axial_projection

axial_projection(vector: ArrayLike, direction: ArrayLike) -> np.ndarray

Project vectors parallel to a member axis.

Parameters:

Name Type Description Default
vector array_like

Cartesian vectors with shape (..., 3).

required
direction array_like

Nonzero member direction vectors.

required

Returns:

Type Description
ndarray

Axial vector components in the input units.

Source code in src/fluidmec/hydrodynamics/orientation.py
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
def axial_projection(
    vector: ArrayLike,
    direction: ArrayLike,
) -> np.ndarray:
    """Project vectors parallel to a member axis.

    Parameters
    ----------
    vector : array_like
        Cartesian vectors with shape (..., 3).
    direction : array_like
        Nonzero member direction vectors.

    Returns
    -------
    ndarray
        Axial vector components in the input units.
    """
    vector = _validate_vector(vector, "vector")
    axis = _normalise(direction, "direction")

    component = np.sum(
        vector * axis,
        axis=-1,
        keepdims=True,
    )

    return component * axis

normal_projection

normal_projection(vector: ArrayLike, direction: ArrayLike) -> np.ndarray

Project vectors onto the plane normal to a member.

Returns vectors in the original input units.

Source code in src/fluidmec/hydrodynamics/orientation.py
210
211
212
213
214
215
216
217
218
219
220
def normal_projection(
    vector: ArrayLike,
    direction: ArrayLike,
) -> np.ndarray:
    """Project vectors onto the plane normal to a member.

    Returns vectors in the original input units.
    """
    vector = _validate_vector(vector, "vector")

    return vector - axial_projection(vector, direction)

normal_projection_matrix

normal_projection_matrix(direction: ArrayLike) -> np.ndarray

Return the normal projection matrix I - e e^T.

Returns:

Type Description
ndarray

Projection matrices with shape (..., 3, 3).

Source code in src/fluidmec/hydrodynamics/orientation.py
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
def normal_projection_matrix(
    direction: ArrayLike,
) -> np.ndarray:
    """Return the normal projection matrix I - e e^T.

    Returns
    -------
    ndarray
        Projection matrices with shape (..., 3, 3).
    """
    axis = _normalise(direction, "direction")

    outer = axis[..., :, None] * axis[..., None, :]

    return np.eye(3) - outer

flow_incidence_angle

flow_incidence_angle(velocity: ArrayLike, direction: ArrayLike, *, degrees: bool = True) -> float | np.ndarray

Calculate the acute angle between flow and member.

Parallel or antiparallel flow gives zero degrees. Perpendicular flow gives 90 degrees.

Zero velocity is rejected because its angle is undefined.

Source code in src/fluidmec/hydrodynamics/orientation.py
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
def flow_incidence_angle(
    velocity: ArrayLike,
    direction: ArrayLike,
    *,
    degrees: bool = True,
) -> float | np.ndarray:
    """Calculate the acute angle between flow and member.

    Parallel or antiparallel flow gives zero degrees.
    Perpendicular flow gives 90 degrees.

    Zero velocity is rejected because its angle
    is undefined.
    """
    flow = _normalise(velocity, "velocity")
    axis = _normalise(direction, "direction")

    cosine = np.abs(np.sum(flow * axis, axis=-1))

    sine = _vector_norm(np.cross(flow, axis))

    angle = np.arctan2(sine, cosine)

    if degrees:
        angle = np.rad2deg(angle)

    return format_output(angle)

vector_drag_force_per_unit_length

vector_drag_force_per_unit_length(velocity: ArrayLike, direction: ArrayLike, diameter: ArrayLike, drag_coefficient: ArrayLike = 1.0, density: ArrayLike = SEAWATER_DENSITY) -> np.ndarray

Calculate cross-flow Morison drag vectors.

Parameters:

Name Type Description Default
velocity array_like

Undisturbed fluid velocity, m/s, shape (..., 3).

required
direction array_like

Nonzero member axis vectors.

required
diameter array_like

Circular cylinder diameter, m.

required
drag_coefficient array_like

Nonnegative dimensionless drag coefficient.

1.0
density array_like

Positive fluid density, kg/m^3.

SEAWATER_DENSITY

Returns:

Type Description
ndarray

Global drag force components, N/m.

Notes

Axial skin friction is excluded. The scalar Morison function is reused to calculate the drag magnitude.

Source code in src/fluidmec/hydrodynamics/orientation.py
269
270
271
272
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
def vector_drag_force_per_unit_length(
    velocity: ArrayLike,
    direction: ArrayLike,
    diameter: ArrayLike,
    drag_coefficient: ArrayLike = 1.0,
    density: ArrayLike = SEAWATER_DENSITY,
) -> np.ndarray:
    """Calculate cross-flow Morison drag vectors.

    Parameters
    ----------
    velocity : array_like
        Undisturbed fluid velocity, m/s, shape (..., 3).
    direction : array_like
        Nonzero member axis vectors.
    diameter : array_like
        Circular cylinder diameter, m.
    drag_coefficient : array_like
        Nonnegative dimensionless drag coefficient.
    density : array_like
        Positive fluid density, kg/m^3.

    Returns
    -------
    ndarray
        Global drag force components, N/m.

    Notes
    -----
    Axial skin friction is excluded. The scalar Morison
    function is reused to calculate the drag magnitude.
    """
    normal = normal_projection(velocity, direction)
    speed = _vector_norm(normal)

    magnitude = drag_force_per_unit_length(
        velocity=speed,
        diameter=diameter,
        drag_coefficient=drag_coefficient,
        density=density,
    )

    normal_direction = np.divide(
        normal,
        speed[..., None],
        out=np.zeros_like(normal),
        where=speed[..., None] > 0,
    )

    return np.asarray(magnitude)[..., None] * normal_direction

vector_inertia_force_per_unit_length

vector_inertia_force_per_unit_length(acceleration: ArrayLike, direction: ArrayLike, diameter: ArrayLike, inertia_coefficient: ArrayLike = 2.0, density: ArrayLike = SEAWATER_DENSITY) -> np.ndarray

Calculate normal Morison inertia force vectors.

Parameters:

Name Type Description Default
acceleration array_like

Fluid acceleration, m/s^2, shape (..., 3).

required
direction array_like

Nonzero member axis vectors.

required
diameter array_like

Circular cylinder diameter, m.

required
inertia_coefficient array_like

Nonnegative dimensionless inertia coefficient.

2.0
density array_like

Positive fluid density, kg/m^3.

SEAWATER_DENSITY

Returns:

Type Description
ndarray

Global inertia force components, N/m.

Source code in src/fluidmec/hydrodynamics/orientation.py
321
322
323
324
325
326
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
def vector_inertia_force_per_unit_length(
    acceleration: ArrayLike,
    direction: ArrayLike,
    diameter: ArrayLike,
    inertia_coefficient: ArrayLike = 2.0,
    density: ArrayLike = SEAWATER_DENSITY,
) -> np.ndarray:
    """Calculate normal Morison inertia force vectors.

    Parameters
    ----------
    acceleration : array_like
        Fluid acceleration, m/s^2, shape (..., 3).
    direction : array_like
        Nonzero member axis vectors.
    diameter : array_like
        Circular cylinder diameter, m.
    inertia_coefficient : array_like
        Nonnegative dimensionless inertia coefficient.
    density : array_like
        Positive fluid density, kg/m^3.

    Returns
    -------
    ndarray
        Global inertia force components, N/m.
    """
    normal = normal_projection(acceleration, direction)

    # Reuse the existing scalar inertia equation
    # to obtain its linear acceleration multiplier.
    multiplier = inertia_force_per_unit_length(
        acceleration=1.0,
        diameter=diameter,
        inertia_coefficient=inertia_coefficient,
        density=density,
    )

    return np.asarray(multiplier)[..., None] * normal

vector_morison_force_components

vector_morison_force_components(velocity: ArrayLike, acceleration: ArrayLike, direction: ArrayLike, diameter: ArrayLike, drag_coefficient: ArrayLike = 1.0, inertia_coefficient: ArrayLike = 2.0, density: ArrayLike = SEAWATER_DENSITY) -> tuple[np.ndarray, np.ndarray, np.ndarray]

Return drag, inertia and total force vectors.

All returned arrays have compatible broadcast shapes (..., 3) and units of N/m.

Source code in src/fluidmec/hydrodynamics/orientation.py
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
def vector_morison_force_components(
    velocity: ArrayLike,
    acceleration: ArrayLike,
    direction: ArrayLike,
    diameter: ArrayLike,
    drag_coefficient: ArrayLike = 1.0,
    inertia_coefficient: ArrayLike = 2.0,
    density: ArrayLike = SEAWATER_DENSITY,
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
    """Return drag, inertia and total force vectors.

    All returned arrays have compatible broadcast shapes
    (..., 3) and units of N/m.
    """
    drag = vector_drag_force_per_unit_length(
        velocity=velocity,
        direction=direction,
        diameter=diameter,
        drag_coefficient=drag_coefficient,
        density=density,
    )

    inertia = vector_inertia_force_per_unit_length(
        acceleration=acceleration,
        direction=direction,
        diameter=diameter,
        inertia_coefficient=inertia_coefficient,
        density=density,
    )

    drag, inertia = np.broadcast_arrays(drag, inertia)

    return drag, inertia, drag + inertia

vector_morison_force_per_unit_length

vector_morison_force_per_unit_length(velocity: ArrayLike, acceleration: ArrayLike, direction: ArrayLike, diameter: ArrayLike, drag_coefficient: ArrayLike = 1.0, inertia_coefficient: ArrayLike = 2.0, density: ArrayLike = SEAWATER_DENSITY) -> np.ndarray

Return total normal Morison force vectors in N/m.

Source code in src/fluidmec/hydrodynamics/orientation.py
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
def vector_morison_force_per_unit_length(
    velocity: ArrayLike,
    acceleration: ArrayLike,
    direction: ArrayLike,
    diameter: ArrayLike,
    drag_coefficient: ArrayLike = 1.0,
    inertia_coefficient: ArrayLike = 2.0,
    density: ArrayLike = SEAWATER_DENSITY,
) -> np.ndarray:
    """Return total normal Morison force vectors in N/m."""
    _, _, total = vector_morison_force_components(
        velocity=velocity,
        acceleration=acceleration,
        direction=direction,
        diameter=diameter,
        drag_coefficient=drag_coefficient,
        inertia_coefficient=inertia_coefficient,
        density=density,
    )

    return total

Visualisation

Run:

python examples/member_orientation_example.py

The dashboard and 3D jacket visualisation are saved under outputs/lesson29/.

The jacket model illustrates local midpoint force vectors. It is not a distributed structural solver.

References

  1. Morison, J. R., O'Brien, M. P., Johnson, J. W., and Schaaf, S. A. (1950). The Force Exerted by Surface Waves on Piles.

  2. Sarpkaya, T. (2010). Wave Forces on Offshore Structures.

  3. DNV-RP-C205. Environmental Conditions and Environmental Loads.