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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ All notable changes to CableDyn are recorded in this file. The format follows

### Added

- Deck currents on the standalone mixed `EI = 0` + finite-EI deck: a `current` OPTION (uniform or
profile), a WaterKin `CurrentMod 1` table and MoorDyn-C `Currents 1`/`2`/`5`, which the mixed
route refused, are taken in the static start of the chains and cables and sampled at every node
before each step with the single-line routes' updaters. Against the single-line routes on a
chain and a cable in a cross current: the static start agrees exactly for the chain and to
4.9e-6 of the range for the cable (the coupled build's static polish), the march with the
same Newton controls to 4.9e-6 (cable) and 2.1e-5 (chain); a `Currents 2` table wrapping past
its last sample equals the unrolled table bit for bit; a uniform `Currents 1` profile and a
uniform `Currents 5` grid equal `uniform` to round-off (at most 3.9e-8); a correction rewind repeats the
step bit for bit; the march allocates nothing per step. Deck waves stay refused; the coupled
route keeps taking the host's field.
- Finite-EI lines with two moving ends on the cubic-Hermite route: a line whose End B is a
`Coupled`/`Vessel` point (a cable shared by two floaters, a FAST.Farm shared line) is driven at
both ends standalone, in OpenFAST, FAST.Farm and the C API (End B on a moving column of its
Expand Down
26 changes: 24 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,10 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_ID STREQUAL "GN
set_tests_properties(step_allocations_motion_roll PROPERTIES LABELS "fortran;dynamic;memory")
add_test(NAME step_allocations_motion_vessel COMMAND test_step_allocations motion_vessel)
set_tests_properties(step_allocations_motion_vessel PROPERTIES LABELS "fortran;dynamic;memory")
# And with the deck's own current on that march (a Currents 5 grid that varies in time).
add_test(NAME step_allocations_mixed_current COMMAND test_step_allocations mixed_current)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/step_alloc_mixed_current)
set_tests_properties(step_allocations_mixed_current PROPERTIES LABELS "fortran;dynamic;memory")
# And with the nodal twist of a line free in torsion at one end.
add_test(NAME step_allocations_torsion_one_end COMMAND test_step_allocations free)
set_tests_properties(step_allocations_torsion_one_end PROPERTIES LABELS "fortran;dynamic;memory")
Expand Down Expand Up @@ -2256,6 +2260,19 @@ target_link_libraries(test_mixed_route_torsion PRIVATE cabledyn_core)
add_test(NAME mixed_route_torsion COMMAND test_mixed_route_torsion $<TARGET_FILE:cabledyn>)
set_tests_properties(mixed_route_torsion PROPERTIES LABELS "fortran;driver;integration;dynamic")

# Deck currents on the standalone mixed route (the aggregate samples the deck current at every
# node before each step): OPTION uniform and profile and MoorDyn-C Currents 1/2/5 against the
# single-line routes, the wrap of a time-varying table, uniform writings of one field, snapshot
# and restore, and the refusals that remain (deck waves, double counting, no dtM).
add_executable(test_mixed_route_currents tests/test_mixed_route_currents.f90)
target_link_libraries(test_mixed_route_currents PRIVATE cabledyn_core)
add_test(NAME mixed_route_currents COMMAND test_mixed_route_currents $<TARGET_FILE:cabledyn>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mixed_route_currents_work)
set_tests_properties(mixed_route_currents PROPERTIES LABELS "fortran;driver;integration;dynamic")
foreach(_mrc_case uni prof still wav c1 c2 c2u c2h c2d c5 c1u c5u)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/mixed_route_currents_work/${_mrc_case})
endforeach()

add_executable(test_coupled_torsion tests/test_coupled_torsion.f90)
target_link_libraries(test_coupled_torsion PRIVATE cabledyn_core)
add_test(NAME coupled_torsion COMMAND test_coupled_torsion WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Expand Down Expand Up @@ -2741,8 +2758,13 @@ cabledyn_msg_test(shared_line_finite_ei msg_shared_line_finite_ei.dat 1
cabledyn_msg_test(pliant_connect_end_b msg_pliant_connect_end_b.dat 1
"finite-EI LINE 1 in a mixed-topology deck: End B is POINT 2 .connect.;is not supported on the multibody march;End the cable on a Fixed point"
"")
cabledyn_msg_test(mixed_current msg_mixed_current.dat 1
"the deck current OPTION is not supported for a standalone mixed EI=0/finite-EI deck;runs the mooring in STILL WATER;couple the deck to OpenFAST .CompMooring = 5. with SeaState"
# The standalone mixed route takes a deck current (here the static start of the lazy-wave deck)
# and refuses deck waves by name.
cabledyn_msg_test(mixed_current msg_mixed_current.dat 0
"CableDyn mixed standalone aggregate: 3 line.s. .2 EI=0, 1 finite-EI."
"STILL WATER")
cabledyn_msg_test(mixed_waves msg_mixed_waves.dat 1
"the deck waves OPTION is not supported for a standalone mixed EI=0/finite-EI deck;takes the deck current but evaluates no deck waves;couple the deck to OpenFAST .CompMooring = 5. with SeaState"
"this coupled mode;the C API;FAST.Farm")
cabledyn_msg_test(mixed_connect_coupled_cable msg_mixed_connect_coupled_cable.dat 1
"finite-EI LINE 3: a Coupled/Vessel End A .POINT 1. would need motionFile coupling to drive it;remove the Connect/Free points;held still .that route takes no motionFile either."
Expand Down
19 changes: 16 additions & 3 deletions VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,23 @@ stop with a named error.
**Standalone mixed aggregate.** `CableDyn_driver.exe` partitions and steps the
same aggregate used by OpenFAST. The IEA-15 three-chain + touchdown-cable deck
writes all four static profiles and a one-step `dtM=0.025 s` dynamic test with
progress/ETA. On this held-end mixed route (mixed lines without bodies, rods or
free points), `motionFile` and deck-owned waves/current stop with an error. Mixed
decks that also contain bodies, rods or free points run on the multibody march,
progress/ETA. On this mixed route (mixed lines without bodies, rods or free points)
the deck's prescribed motion (`motionFile`, `vesselMotion`; `mixed_route_torsion`) and
its current (`mixed_route_currents`, below) are marched; deck waves stop with an error.
Mixed decks that also contain bodies, rods or free points run on the multibody march,
which accepts deck waves and current (`mixed_body_rods_points.dat`).
`mixed_route_currents` runs a cable (100 m, 40 elements) and a chain (110 m) surging 1 m from
rest in cross currents (OPTION `uniform` and `profile`, MoorDyn-C `Currents 1`, `2` and `5`) on
the mixed route and on their single-line routes: the static start agrees exactly for the chain
and to 4.9e-6 of each channel's range for the cable (its out-of-plane offset, 4 um of 0.55 m, at
the stopping point of the coupled build's static polish; exactly in still water); the march
differs by 1.1e-3 for the cable on the coupled Newton controls (1.2e-3 in still water too) and
keeps the static start's 4.9e-6 with the deck's; the chain agrees to 2.1e-5 (exactly in a sheared
current; the row-1 transfer, 5.4e-5 in still water). A `Currents 2` table wrapping past its last
sample equals the unrolled table bit for bit and departs from the held one by 0.39 of the chain
tension range; a uniform `Currents 1` profile equals `uniform` to round-off (0 on Windows,
3.9e-8 on Linux), a uniform `Currents 5` grid to 3.9e-8; ten correction rewinds repeat their steps bit for bit; the march of a mixed deck
in a `Currents 5` grid makes no heap allocation per step (`step_allocations_mixed_current`).

### WaterKin and SeaState modes

Expand Down
17 changes: 10 additions & 7 deletions app/cabledyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,10 @@ SUBROUTINE run_mixed_held_deck(deck, root, dt, has_dt, run_time, has_run_time, h
!! motion as the standalone cubic-Hermite route does: the point rows' translations, the
!! vessel's rotation (the orientation and angular rates the fairlead end connection and
!! torsion frames turn with) and the motionFile roll column (the imposed twist of a line
!! restrained in torsion). Deck-owned ambient fields require separate updaters and
!! therefore remain an explicit fail-closed boundary.
!! restrained in torsion). The deck's own current (a current OPTION, a WaterKin CurrentMod 1
!! table, MoorDyn-C Currents 1/2/5) is the aggregate's deck_current: its static solves take
!! it and every step samples it at the nodes. Deck waves remain an explicit fail-closed
!! boundary.
CHARACTER(*), INTENT(IN) :: deck, root
REAL(wp), INTENT(IN) :: dt, run_time
LOGICAL, INTENT(IN) :: has_dt, has_run_time, has_motion, line_outputs
Expand Down Expand Up @@ -527,13 +529,14 @@ SUBROUTINE run_mixed_held_deck(deck, root, dt, has_dt, run_time, has_run_time, h
run_msg = 'CableDyn_driver: cannot allocate the mixed aggregate'
EXIT mixed_run
END IF
! The aggregate is caller-driven and cannot refresh standalone wave/current
! OPTIONS. Reject such decks by name instead of silently holding zero fluid. The driver
! holds the line end frames or turns them with the deck's vesselMotion table
! The aggregate is caller-driven and evaluates no deck waves: a waves OPTION is refused by
! name instead of silently holding zero fluid. The deck's own current is the aggregate's
! (deck_current), sampled at the nodes before every step at the step's t_committed. The
! driver holds the line end frames or turns them with the deck's vesselMotion table
! (host_orientation), and marches the deck's prescribed motion (prescribed_motion).
CALL CD_AGG_Init_From_Deck(aggregate, deck, step_dt, es, em, forbid_deck_ambient=.TRUE., &
run_tmax=MAX(CD_ZERO, run_time), range_files=.TRUE., host_orientation=.TRUE., &
prescribed_motion=has_motion, static_run=nstep == 0)
prescribed_motion=has_motion, static_run=nstep == 0, deck_current=.TRUE.)
IF (es /= CD_AGG_OK) THEN
CALL set_aggregate_error(es, em, run_stat, run_msg)
EXIT mixed_run
Expand Down Expand Up @@ -633,7 +636,7 @@ SUBROUTINE run_mixed_held_deck(deck, root, dt, has_dt, run_time, has_run_time, h
max_consecutive_miss = 0
first_miss_time = CD_ZERO
last_miss_time = CD_ZERO
! the march (no fluid sampled by the driver on this route) or, without one, finalisation
! the march (the aggregate samples the deck current itself) or, without one, finalisation
CALL CD_Profile_Enter(MERGE(CD_PROF_SOLVE, CD_PROF_FINAL, nstep > 0))
IF (nstep > 0) CALL start_standalone_progress(progress, nstep, step_dt)
DO step = 1, nstep
Expand Down
9 changes: 6 additions & 3 deletions doc/capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ Line and constitutive capability
- Supported with route limits
- a mixed deck of lines between held or coupled points only (no bodies, rods, or
``Free``/``Connect`` points) runs in OpenFAST and standalone as a static run or a dynamic
run with held ends or a ``motionFile``/``vesselMotion`` prescription, and rejects deck
waves standalone (so ``vesselRAO`` too); a mixed deck with bodies, rods, or
run with held ends or a ``motionFile``/``vesselMotion`` prescription; standalone it takes
the deck current (``current`` OPTION, WaterKin ``CurrentMod 1``, MoorDyn-C ``Currents``
``1``/``2``/``5``) as the single-line routes do and rejects deck waves (so ``vesselRAO``
too); a mixed deck with bodies, rods, or
``Free``/``Connect`` points runs standalone on the multibody march, with moving objects
and deck waves/current, but not with a ``motionFile``
* - Viscoelastic rope (MoorDyn ``ElasticMod`` 2/3)
Expand Down Expand Up @@ -173,7 +175,8 @@ Loads and environment
* - MoorDyn-C currents in time and space (``Currents 2``, ``Currents 5``)
- Standalone only
- ``current_profile_dynamic.txt`` and ``current_profile_4d.txt``, interpolated as MoorDyn-C
v2.7.1 does at every node's position and time, the static start included; see
v2.7.1 does at every node's position and time, the static start included, on every
standalone route (the mixed ``EI = 0`` + finite-EI deck too); see
:ref:`moordyn-c-wavekin`
* - Airy and JONSWAP waves
- Supported
Expand Down
10 changes: 8 additions & 2 deletions doc/driver_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,14 @@ first steps differ from that route's. A static run (`TMax = 0`) of a line restra
takes `False alpha_force_blend`, as on the single-line route.
The run writes the common `.out` and the all-line `.static.out` tables, plus the range graph of
every line with the `r` flag.
Mixed decks reject, by name, deck wave/current OPTIONS (so `vesselRAO`), WaterKin `WaveKinMod 1`,
MoorDyn-C `WaveKin 3`/`7` and `Currents 1`/`2`/`5`, and per-line `p`/`t` flags.
A mixed deck takes every deck current the single-line routes take: a `current` OPTION (uniform or
profile), a WaterKin `CurrentMod 1` table and MoorDyn-C `Currents 1`/`2`/`5`. The static start of
its `EI = 0` lines and finite-EI cables is solved in the current at `t = 0`, and before every step
the current at the step's end time is sampled at every node of the step-start state and held
over the step, as on the single-line routes and with the same field evaluation (a `Currents 2`/`5`
table that varies in time repeats past its last sample there too). Mixed decks reject, by name,
deck waves (so `vesselRAO`), WaterKin `WaveKinMod 1`, MoorDyn-C `WaveKin 3`/`7`, and per-line
`p`/`t` flags.

(multibody-march)=
**Multibody march** (bodies, rods, `Connect`/`Free` points, EI = 0 lines and finite-EI cables in
Expand Down
8 changes: 5 additions & 3 deletions doc/standalone_driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ to march held-end dynamics. A static-only mixed deck with no dynamic-only option
both ``dtM`` and ``TMax``; the time-step option becomes mandatory when a positive-duration march
is requested.

A mixed deck rejects deck-owned wave/current OPTIONS by name, and with them ``vesselRAO``,
which needs deck waves. A ``vesselMotion`` record moves every ``Coupled``/``Vessel`` point
rigidly with the vessel (translation and rotation of each hang-off); a ``motionFile`` gives the
A mixed deck takes the deck current (a ``current`` OPTION, a WaterKin ``CurrentMod 1`` table or
MoorDyn-C ``Currents 1``/``2``/``5``) in its static start and its march, as the single-line
routes do. It rejects deck waves by name, and with them ``vesselRAO``, which needs deck waves.
A ``vesselMotion`` record moves every ``Coupled``/``Vessel`` point rigidly with the vessel
(translation and rotation of each hang-off); a ``motionFile`` gives the
rows of each point. Row 1 is installed before ``t = 0``, also with ``TMax = 0``, after the
``.static.out`` of the static solve is written. On the ``EI = 0`` lines that transfer re-derives
the interior accelerations, which the ``EI = 0``-only route does not, so with row 1 off the deck
Expand Down
14 changes: 7 additions & 7 deletions doc/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ Model data
deck (the ``EI = 0`` lines on the Coupled point directly): a host (OpenFAST
``CompMooring = 5`` or the C API) drives its Coupled points, and the standalone driver
runs it with them held still (that route takes no ``motionFile`` either).
* - ``the deck current OPTION is not supported for a standalone mixed EI=0/finite-EI deck`` /
``the deck waves OPTION ...``
- the standalone driver runs a mixed ``EI = 0``/finite-EI deck in still water: no ambient
fluid field covers its span. Remove the ``waves``/``current`` OPTION, run a deck whose
lines are all ``EI = 0`` or all finite-EI (those standalone routes evaluate the deck waves
and current), or couple the deck to OpenFAST (``CompMooring = 5``) with SeaState, which
supplies them.
* - ``the deck waves OPTION is not supported for a standalone mixed EI=0/finite-EI deck`` /
``the MoorDyn-C WaveKin <n> waves are not supported for a standalone mixed EI=0/finite-EI
deck``
- the standalone driver marches the deck current of a mixed ``EI = 0``/finite-EI deck but no
deck waves. Remove the ``waves`` OPTION (or ``WaveKin``), run a deck whose lines are all
``EI = 0`` or all finite-EI (those standalone routes evaluate the deck waves), or couple
the deck to OpenFAST (``CompMooring = 5``) with SeaState, which supplies them.
* - ``the deck current OPTION is not supported in FAST.Farm`` / ``the deck waves OPTION ...``
- the shared mooring of a FAST.Farm farm runs in still water (no fluid field spans the
farm). Remove the ``waves``/``current`` OPTION.
Expand Down
24 changes: 13 additions & 11 deletions python/cabledyn/deck_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3756,18 +3756,20 @@ def end_key(token: str) -> str:
f"{self._label}: OPTION nModes is not supported for mixed EI=0/finite-EI "
"decks; remove it or set it to 0"
)
# native run_mixed_held_deck: the standalone mixed deck runs on the aggregate in
# still water and writes the main OUTPUTS only
if (
has_waves
or trains
or mdc_wave_kin
or (current is not None and current.values[0].lower() != "none")
or mdc_currents
):
# native run_mixed_held_deck: the standalone mixed deck runs on the aggregate, which
# marches the deck current (a current OPTION or Currents 1/2/5, deck_current) but
# evaluates no deck waves, and writes the main OUTPUTS only
if mdc_wave_kin:
raise DeckFormatError(
f"{self._label}: the MoorDyn-C WaveKin {mdc_wave_kin} waves are not supported "
"for a standalone mixed EI=0/finite-EI deck (it takes a deck current but no "
"deck waves)"
)
if has_waves or trains:
raise DeckFormatError(
f"{self._label}: a mixed EI=0/finite-EI deck runs in still water; remove "
"the deck waves and current"
f"{self._label}: the deck waves OPTION is not supported for a standalone mixed "
"EI=0/finite-EI deck: this route takes the deck current but evaluates no deck "
"waves"
)
if series_lines:
raise DeckFormatError(
Expand Down
5 changes: 2 additions & 3 deletions python/tests/test_deck_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,8 @@ def test_attachments_accept_an_axial_drag_area_and_a_deck_current(tmp_path):
# all finite-EI lines: the deck driver takes a deck current
path.write_text(text.replace("1.0e8 0.0 0.0 1.2", "1.0e8 0.0 1.0e3 1.2"), encoding="utf-8")
DeckFile.read(path)
# a mixed EI=0/finite-EI deck runs on the aggregate in still water
with pytest.raises(DeckFormatError, match="runs in still water"):
DeckFile.from_text(text)
# a mixed EI=0/finite-EI deck runs on the aggregate in its current too
DeckFile.from_text(text)


def test_viv_lift_flag_is_upper_case_and_standalone():
Expand Down
Loading
Loading