Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ All notable changes to CableDyn are recorded in this file. The format follows

## [Unreleased]

### Changed

- In OpenFAST, a coupled run whose lines take their wave or current kinematics from the SeaState grid now
stops when the grid cannot give them those kinematics, where it warned once and ran on. It stops at the
static start or at the first CableDyn step at which a line node in the water lies outside the grid,
where SeaState gives it the kinematics of the grid boundary; the message gives the time and, line by
line, the number of such nodes and the deepest and shallowest of them. It also stops at the start when
the grid has `NX = 2` or `NY = 2` (three points across that axis) under waves that vary along the axis
(a long-crested sea not along the other axis, within 1e-4 deg, a short-crested sea, or supplied
`WaveMod 6` kinematics that differ across the axis, judged from the data) while the lines
sample the grid in the water: SeaState then interpolates across a large part of a wavelength for every
line node and hull member, also near a grid line, from which the sea sways the lines.
A grid with `NY = 2` under waves along x, or `NX = 2` under waves along y, still runs. The new
`OPTIONS waveGridCheck warn` turns both checks into the former warnings (`error`, the default, stops).
The r-test `MD_Shared` SeaState file of the OpenFAST tutorial, which covers only the platform, now stops
until its grid is enlarged as the tutorial describes. Runs that pass the checks give the same results,
bit for bit.

### Fixed

- A Syrope rope at its running maximum had a band of slow strains, up to 9e-7 wide on the shipped table,
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ add_library(cabledyn_obj OBJECT
src/CableDyn_FatalReport.f90
src/CableDyn_Profile.f90
src/CableDyn_LoadPredictor.f90
src/CableDyn_WaveGrid.f90
src/CableDyn_PathIO.f90
src/CableDyn_Banner.f90
src/CableDyn_Linalg.f90
Expand Down Expand Up @@ -1294,6 +1295,16 @@ target_link_libraries(test_load_predictor PRIVATE cabledyn_core)
add_test(NAME load_predictor COMMAND test_load_predictor)
set_tests_properties(load_predictor PROPERTIES LABELS "fortran;unit;openfast")

# The rules of the coupled wave-grid guard (OPTION waveGridCheck): which wave directions a
# SeaState grid with NX or NY = 2 represents, and which nodes lie between its points; the option
# reaches the coupled aggregate from the mixed example deck.
add_executable(test_wave_grid tests/test_wave_grid.f90)
target_link_libraries(test_wave_grid PRIVATE cabledyn_core)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/wave_grid)
add_test(NAME wave_grid COMMAND test_wave_grid ${CMAKE_SOURCE_DIR}/examples/iea15mw_umaine_mixed_cabledyn.dat
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/wave_grid)
set_tests_properties(wave_grid PROPERTIES LABELS "fortran;unit;openfast")

# The same deck initialises without a static compression/mesh note: the touchdown
# contact kink is element-local, the smoothed element-mean axial force is tensile.
add_executable(test_flagship_compression_note tests/test_flagship_compression_note.f90)
Expand Down
7 changes: 7 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ stack overflow while ElastoDyn initialises.
checks that the CableDyn banner appears in the log, that the executable names itself
`OpenFAST-<OpenFAST base>-CableDyn-<CableDyn version>`, and that the output is finite.

The SeaState wave-grid checks of the OpenFAST module (`OPTIONS waveGridCheck`) run only inside
OpenFAST. `validation/scripts/openfast_wave_grid_guard.py --exe <openfast.exe> --case-dir <dir>
--work <dir>` runs the IEA-15 MW model of the OpenFAST tutorial (the r-test `MD_Shared` turbine-1
files in `<dir>`) under grids that must stop the run by default and run with `waveGridCheck warn`,
and under grids that must run; with `--base-exe` (an `openfast.exe` built from the previous CableDyn
sources) it also requires the same output as that build where the run passes.

An `openfast.exe` built this way through CMake does not embed the UTF-8
active-code-page manifest (`app/utf8_code_page.manifest`), so on Windows it may not
open input files in folders whose names the system code page cannot spell. The
Expand Down
64 changes: 54 additions & 10 deletions doc/openfast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ only the platform. The r-test ``MD_Shared`` file used in :doc:`tutorial_openfast
grid; and
* ``NX``, ``NY`` and ``NZ`` raised with the extents to keep the grid spacing: a horizontal
spacing of about a tenth of the peak wavelength or less. A long-crested sea (``WaveDirMod =
0``) that travels along x does not vary in y, so ``NY = 2`` is enough for it.
0``) that travels along x (``WaveDir`` 0° or 180°) does not vary in y, so ``NY = 2`` is enough
for it, and ``NX = 2`` for one along y (90° or 270°). Any other sea, a long-crested one at
another heading or a short-crested one, varies along both axes and needs both resolved.

SeaState holds the whole time history of the grid in memory, so memory and initialisation time
grow with (2 ``NX`` − 1)(2 ``NY`` − 1) ``NZ`` ``WaveTMax`` / ``WaveDT``. For the
Expand All @@ -172,18 +174,60 @@ or using ``NZ = 16`` changes the 10–70 s platform and fairlead-tension statist
0.1 %. The ``MD_Shared`` grid gives a line-1 fairlead tension standard deviation 18 % too high
(0.136 MN instead of 0.115 MN).

CableDyn compares its nodes with the grid at the static equilibrium and at every CableDyn step.
At the first node found outside it prints one warning and continues:
CableDyn compares its nodes with the grid at the static equilibrium and at every CableDyn step,
and by default (``OPTIONS waveGridCheck error``) stops the run at the first step that finds a
node outside it, at initialisation for the ``MD_Shared`` grid:

.. code-block:: text

WARNING: CableDyn mooring module: 147 of the 153 CableDyn sampling nodes in the water lie
outside the SeaState wave-kinematics grid at t = 0 s (warned once). SeaState clamps them to
the grid boundary, so their fluid kinematics and loads are not physical. Farthest: x = -837.6
m (grid |x| <= X_HalfWidth = 100 m); y = 725.38 m (grid |y| <= Y_HalfWidth = 100 m); z =
-200.01 m (grid z >= -Z_Depth = -40 m). In the SeaState input file enlarge X_HalfWidth,
Y_HalfWidth and Z_Depth (Z_Depth at most WtrDpth + MSL2SWL, its default) to cover the lines
with margin for their motion, and raise NX, NY and NZ to keep the grid spacing.
CableDyn mooring module: 147 of the 153 CableDyn sampling nodes in the water lie outside the
SeaState wave-kinematics grid at t = 0 s, where SeaState would give them the kinematics of the
grid boundary, which are not physical there. By line: line 1, 49 nodes, deepest at (x, y, z) =
(-735.56, 0, -200.01) m, shallowest at (x, y, z) = (-77.518, 0, -41.866) m; line 2, 49 nodes,
deepest at (x, y, z) = (367.78, 637.01, -200.01) m, shallowest at (x, y, z) = (38.759, 67.132,
-41.866) m; line 3, ... . Farthest: x = -837.6 m (grid |x| <= X_HalfWidth = 100 m); y = 725.38
m (grid |y| <= Y_HalfWidth = 100 m); z = -200.01 m (grid z >= -Z_Depth = -40 m). In the SeaState
input file enlarge X_HalfWidth, Y_HalfWidth and Z_Depth (Z_Depth at most WtrDpth + MSL2SWL, its
default) to cover the lines with margin for their motion, and raise NX, NY and NZ to keep the
grid spacing. To run on with those kinematics, set waveGridCheck warn in the OPTIONS of the
CableDyn deck.

The message gives the time and, line by line, the number of nodes outside the grid with the
deepest and the shallowest of them. A node that leaves the grid during the run, as a line swings
out with the platform, stops the run at that step. With ``waveGridCheck warn`` the message is a
warning, given once per run (also after a restart), and the run continues with the boundary
kinematics at those nodes.

At initialisation CableDyn also checks the grid against the directions of the sea. A grid with
``NX = 2`` or ``NY = 2`` has three points along that axis, ``X_HalfWidth`` (or ``Y_HalfWidth``)
apart, and SeaState interpolates the kinematics across the axis between them. That is exact only
for waves that do not vary along the axis: ``NY = 2`` for a long-crested sea along x and
``NX = 2`` for one along y, each within 1e-4°. Under any other sea, when the lines sample the grid
in the water at all, the run stops by default:

.. code-block:: text

CableDyn mooring module: the SeaState wave-kinematics grid has NY = 2 (3 points 900 m apart in y)
under long-crested waves at 30 deg, which vary along that axis: SeaState interpolates them
between the three grid points, over distances that are a large part of a wavelength or more,
for the hull members and for the lines, which sample the grid in the water at 153 CableDyn
nodes. By line: line 1, 51 nodes, deepest at (x, y, z) = (-735.56, 0, -200.01) m, shallowest at
(x, y, z) = (-58, 0, -14) m; line 2, ... ; line 3, ... . A grid with NY = 2 represents only
waves along x (0 or 180 deg) and one with NX = 2 only waves along y (90 or 270 deg), within
1e-4 deg; in the SeaState input file raise the count so that the spacing resolves the shortest
wavelength that matters at the lines (a tenth of it or finer). To run on with the interpolated
kinematics, set waveGridCheck warn in the OPTIONS of the CableDyn deck.

The directions are those of SeaState's wave components (the spread of ``WaveDirMod = 1``, the
component directions of ``WaveMod = 7``). Externally supplied kinematics (``WaveMod = 6``) have no
components, and SeaState does not use ``WaveDir`` in that mode, so there the supplied ``WaveVel``
and ``WaveAcc`` are compared across the three grid points of the coarse axis: the check stops the
run when they differ by more than 1e-5 of their largest magnitude, and passes a field that is the
same at every point along that axis (waves along the other axis). A line lying on a
grid line across the coarse axis, such as one along ``y = 0``, is no exception: a node off it by a
small part of the half-width is already wrong in phase, and the sea sways the line off it. The
hull's Morison members read the same grid, so their kinematics are interpolated across the axis
too. ``waveGridCheck warn`` turns this check into a warning.

Only nodes in the water are checked: a node above the free surface carries no fluid load,
whatever kinematics SeaState would give it, so a suspended cable or jumper above the water may
Expand Down
11 changes: 11 additions & 0 deletions doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,17 @@ Finite-EI cable controls
(see :doc:`openfast`)
- OpenFAST
- ``False predictLoads``
* - ``waveGridCheck`` / ``wave_grid_check``
- mode
- ``error``
- ``error`` or ``warn`` (case-insensitive). The checks of the SeaState grid the lines take their
wave and current kinematics from: a line node in the water outside the grid (at the static
start or at any CableDyn step), and ``NX = 2`` or ``NY = 2`` under waves that vary along that
axis while the lines sample the grid in the water (at the start). ``error`` stops the
run with a message that gives the time and, by line, the nodes concerned; ``warn`` warns once
and runs on with SeaState's kinematics there (see :ref:`openfast:SeaState grid`)
- OpenFAST (a run that samples SeaState); accepted and unused elsewhere
- ``warn waveGridCheck``
* - ``CDOutDt`` / ``cd_out_dt``
- real, s
- ``0``
Expand Down
29 changes: 20 additions & 9 deletions doc/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -698,17 +698,28 @@ Warnings and notes that do not stop a run
line takes up by its shape; the torque follows from it. A non-zero descent count means the
straight or untwisted branch was unstable at the imposed twist and the solve moved to a
buckled shape; check the shape and the ``Twist<L>`` channel.
* - ``WARNING: CableDyn mooring module: <n> of the <N> CableDyn sampling nodes in the water
lie outside the SeaState wave-kinematics grid at t = ... s (warned once)`` (OpenFAST)
* - ``CableDyn mooring module: <n> of the <N> CableDyn sampling nodes in the water lie outside
the SeaState wave-kinematics grid at t = ... s`` (OpenFAST; an error, or with
``waveGridCheck warn`` a warning given once)
- the SeaState grid (``X_HalfWidth``, ``Y_HalfWidth``, ``Z_Depth``) does not cover the
lines in the water (nodes above the free surface carry no fluid load and are not
counted), and SeaState gives the nodes outside it the kinematics of the grid boundary: waves
out of phase beyond a half-width, kinematics that are too strong below ``Z_Depth``. The
message names the farthest node in each direction. Enlarge the listed inputs in the
SeaState file past the farthest anchor (``Z_Depth`` to the water depth, its default) and
raise ``NX``, ``NY``, ``NZ`` to keep the spacing. A SeaState file written for the
platform alone, such as the r-test ``MD_Shared`` file, triggers it. See
:ref:`openfast:SeaState grid` for sizes and memory.
counted), and SeaState would give the nodes outside it the kinematics of the grid boundary:
waves out of phase beyond a half-width, kinematics that are too strong below ``Z_Depth``.
The message lists the nodes outside by line, with the deepest and shallowest of them, and
the farthest node in each direction. Enlarge the listed inputs in the SeaState file past
the farthest anchor (``Z_Depth`` to the water depth, its default) and raise ``NX``, ``NY``,
``NZ`` to keep the spacing. A SeaState file written for the platform alone, such as the
r-test ``MD_Shared`` file, triggers it. ``OPTIONS waveGridCheck warn`` runs on with the
boundary kinematics. See :ref:`openfast:SeaState grid` for sizes and memory.
* - ``CableDyn mooring module: the SeaState wave-kinematics grid has NY = 2 (3 points ... m apart
in y) under ...`` (OpenFAST; an error, or with ``waveGridCheck warn`` a warning)
- the grid has three points across an axis along which the waves vary: ``NY = 2`` under a
sea not along x, or ``NX = 2`` under a sea not along y (a long-crested sea at another
heading, or a short-crested sea), while the lines sample the grid in the water. SeaState
interpolates across a large part of a wavelength for every line node and hull member, also
near a grid line, from which the sea sways the lines. Raise ``NY`` (or ``NX``) so
that the spacing resolves the shortest wavelength that matters at the lines. See
:ref:`openfast:SeaState grid`.
* - ``Note: LINE <L> is stretched to a static strain of ... % at the fairlead``
- the fairlead tension over the EA of the End A section exceeds ``maxStrain`` (when the
OPTION is given and positive) or 10 % (when it is not given or is ``0``, which disables
Expand Down
13 changes: 7 additions & 6 deletions doc/tutorial_openfast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ outside the grid the kinematics of the grid boundary. Enlarge the grid to cover
This sets ``X_HalfWidth`` and ``Y_HalfWidth`` to 900 m, ``Z_Depth`` to the water depth, 37 grid
points along each half of x (25 m spacing) and 11 in depth. ``NY`` stays 2 because the
long-crested sea travels along x and does not vary in y. SeaState then needs about 4.6 GB of
memory and several seconds to generate the grid. Without this step the run still completes, but
CableDyn warns that 147 of its 153 line nodes lie outside the SeaState wave-kinematics grid, and
the line-1 fairlead tension standard deviation comes out 18 % too high. Grid sizing is
described in :ref:`openfast:SeaState grid`.
memory and several seconds to generate the grid. Without this step CableDyn stops at
initialisation: 147 of its 153 line nodes lie outside the SeaState wave-kinematics grid. With
``waveGridCheck warn`` in the deck's OPTIONS it runs on with the boundary kinematics, and the
line-1 fairlead tension standard deviation comes out 18 % too high. Grid sizing is described in
:ref:`openfast:SeaState grid`.

4. How CableDyn is wired in
---------------------------
Expand Down Expand Up @@ -201,8 +202,8 @@ Check, in order:

#. ``Running CableDyn (`` — the CableDyn-enabled executable is in use. A stock OpenFAST rejects
``CompMooring = 5`` during input validation.
#. The line inventory (3 lines, 6 points) and ``dtM``, and no ``WARNING: CableDyn mooring module:
... lie outside the SeaState wave-kinematics grid`` line (step 3).
#. The line inventory (3 lines, 6 points) and ``dtM``. A SeaState grid that does not cover the
lines stops the run at initialisation (step 3).
#. The initial fairlead tensions: 2.437 MN per line, with the line tangent 55.7° below
horizontal, as in the standalone ``spread_3line_chain.dat`` of :doc:`tutorial_spread`. The
tension is the magnitude of the line-end force, which includes the fairlead node's share of
Expand Down
1 change: 1 addition & 0 deletions examples/cabledyn_options_reference.dat
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ none waves - Wave model and parameters (m, s, deg) {none; airy;
-- 0 WriteLog - MoorDyn logging compatibility only; accepted and ignored
-- 0.1 dtOut - MoorDyn output-cadence compatibility only; accepted and ignored
-- 0.1 CDOutDt - OpenFAST/FAST.Farm: .CD.out row interval, a whole multiple of the CableDyn step [default: 0 = every step]
-- warn waveGridCheck - OpenFAST: a SeaState grid that misses or under-resolves the line nodes {error=stop; warn} [default: error]
-- 0 Currents - MoorDyn-C current mode {0=none; 1=current_profile.txt} [default: 0]
-- 0.25 dtWave - MoorDyn-C WaveKin 3 resampling step (s) [default: 0.25]
-- 3.14159 WvHiCOff - High cut-off of an elevation record, WaveKinMod 1 or WaveKin 3 (rad/s) {value; none} [default: 3.14159]
Expand Down
3 changes: 2 additions & 1 deletion examples/openfast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ The initial CableDyn fairlead tensions are then the ~2.4 MN chain pretension.
The `MD_Shared` `SeaState.dat` computes the wave kinematics on a grid that covers only the
platform (`X_HalfWidth = Y_HalfWidth = 100 m`, `Z_Depth = 40 m`), while the anchors lie 838 m
away on the 200 m seabed. SeaState gives every line node outside the grid the kinematics of the
grid boundary, and CableDyn warns about it. Enlarge the grid:
grid boundary, and CableDyn stops at initialisation (`OPTIONS waveGridCheck warn` runs on with
a warning instead). Enlarge the grid:

```powershell
$ss = 'SeaState.dat'
Expand Down
4 changes: 4 additions & 0 deletions python/cabledyn/deck_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@
"cd_out_dt": "cd_out_dt",
"vivphaseseed": "viv_phase_seed",
"viv_phase_seed": "viv_phase_seed",
"wavegridcheck": "wave_grid_check",
"wave_grid_check": "wave_grid_check",
"rangestart": "range_start",
"range_start": "range_start",
"waveseed": "wave_seed",
Expand Down Expand Up @@ -1414,6 +1416,8 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None:
)
if key == "viv_phase_seed":
return None if value.lower() in {"spread", "zero"} else "must be spread or zero"
if key == "wave_grid_check":
return None if value.lower() in {"error", "warn"} else "must be error or warn"
if key == "cable_statics":
return (
None
Expand Down
4 changes: 4 additions & 0 deletions python/tests/test_deck_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ def test_unknown_scalar_option_keyword_fails_closed(tmp_path):
("relaxed", "cable_statics", "continuation or sequenced"),
("random", "VIVphaseSeed", "spread or zero"),
("0", "viv_phase_seed", "spread or zero"),
("strict", "waveGridCheck", "error or warn"),
("1", "wave_grid_check", "error or warn"),
("nodal", "OutputRecovery", "equilibrium or element"),
("mode2", "axialDampingRatio", "segment or mode1"),
("element", "axial_damping_ratio", "segment or mode1"),
Expand Down Expand Up @@ -762,6 +764,8 @@ def test_zero_e_exponent_waterkin_mode_is_accepted(tmp_path):
"sequenced cableStatics",
"spread VIVphaseSeed",
"ZERO viv_phase_seed",
"warn waveGridCheck",
"ERROR wave_grid_check",
"equilibrium OutputRecovery",
"element output_recovery",
"segment axialDampingRatio",
Expand Down
Loading
Loading