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
2 changes: 1 addition & 1 deletion VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ article's methods, are compared in
| **L2-V** | VolturnUS-S anchor tension | closed-form catenary | 0.77% | <3% | Pass |
| **L2-80** | Lozon 80 m all-chain mooring | catenary (H) / MoorDyn-F (fairlead) | 0.03% / 1.8% | <2% / <5% | Pass |
| **L2-arb** | Closed-form catenary reference check | OrcaFlex VolturnUS-S ref | 0.69% | <2% | Pass |
| **L2-VIV** | Cross-flow VIV lock-in of a taut 100 m line, U = 0.06–0.42 m/s | MoorDyn-F (OpenFAST v5 `moordyn_driver`, `dtM` 5e-4 s) | mode-1 and mode-3 lock-in (U ≤ 0.18 and ≥ 0.36 m/s): mid-span A/D within 1.2%, frequency within one spectral bin; same response at `dtM` 5e-4 to 1e-2 s; at 0.21–0.33 m/s the codes settle on different modes (MoorDyn-F mode 1, CableDyn mode 2) | A/D <3%, frequency within one spectral bin (`viv_lockin`) | Pass scoped |
| **L2-VIV** | Cross-flow VIV lock-in of a taut 100 m line, U = 0.06–0.42 m/s | MoorDyn-C v2.7.2 (RK2, `dtM` 5e-4 s) and MoorDyn-F (OpenFAST v5 `moordyn_driver`, `dtM` 5e-4 s) | mode-1 and mode-3 lock-in (U ≤ 0.18 and ≥ 0.36 m/s): mid-span A/D within 1.2% of MoorDyn-F, frequency within one spectral bin; same response at `dtM` 5e-4 to 1e-2 s. At 0.21–0.33 m/s two branches coexist (a run ramped up from 0.18 m/s stays in mode 1, one ramped down from 0.30 m/s stays in mode 2): from rest CableDyn and MoorDyn-C settle in mode 2 (U 0.24 m/s: A/D 0.575 against 0.574 at x/L 0.24, same frequency); MoorDyn-F, whose phases start at zero (it does not carry its seed into its state), in mode 1, which `zero VIVphaseSeed` reproduces (0.701 against 0.699, transient to four digits) | A/D <3%, frequency within one spectral bin; band: 3% (MoorDyn-C), 1% (MoorDyn-F) (`viv_lockin`) | Pass |
| **L2-VIV-riser** | Catenary riser of Thorsen et al. in a uniform 0.2 m/s current (MoorDyn-C's VIV test: D 0.024 m, EI 10.5 N m², 100 segments, `Cl` 0.7), deck written anchor first | measured cross-flow frequency 1.04 Hz; MoorDyn-C v2.7.2 (RK4, `dtM` 1e-4 s) | over 20–40 s at `dtM` 1e-3 s: mean fairlead tension 69.92 N against 69.93 N, range 3.73 N against 3.72 N, tension period 0.4853 s against the measured 0.4808 s and MoorDyn-C's 0.4811 s (0.4843 / 0.4829 s at `dtM` 5e-4 / 2.5e-4 s) | mean 0.2%, range 10%, period 1.5% (`viv_riser`) | Pass |
| **L2-VIV-EI** | Cross-flow VIV of a finite-EI cable: the L2-VIV line with EI = 1 N m², and a bending-stiff line (EA 5e9 N, EI 5e7 N m², β = π²EI/(TL²) ≈ 1, neutrally buoyant) against the EI = 0 string of equal first-mode frequency, U = 0.10–0.36 m/s | CableDyn `EI = 0` line (verification) | EI = 1: mid/quarter A/D 0.662/0.421 against 0.663/0.421, same frequency, at `dtM` 5e-4 to 1e-2 s; stiff line: mode-1 lock-in A/D within 2.5% of the string's at the same frequency for U ≤ 0.24 m/s; for U ≥ 0.27 m/s the string jumps to mode 2 while the stiff line stays in mode 1 (bending raises f₂/f₁ to 3.15) | EI = 1: A/D within 1% at `dtM` 0.01 and 0.002 s (5e-4 s run once over 200 s); stiff line at U 0.21 m/s: A/D within 3%; frequency within one spectral bin; at U 0.30 m/s stiff line A/D > 0.6, string < 0.15 (`viv_lockin`, `hermite_viv`) | Pass |
| **L3-1** | WD0050 static | OrcaFlex | 0.15 / 0.85% | <2% | Pass |
Expand Down
9 changes: 9 additions & 0 deletions doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,15 @@ Ambient fluid and prescribed motion
different ``dtM`` with the same averaging time
- lines with a LINE TYPES ``Cl > 0``, on every route
- ``0.25 VIVrmsWindow``
* - ``VIVphaseSeed`` / ``viv_phase_seed``
- mode
- ``spread``
- the initial phases of the VIV synchronisation model (:ref:`theory-viv`): ``spread`` starts
node ``i`` from the deck's End A at ``2 pi i/N``, as MoorDyn-C; ``zero`` starts every node
at zero, where MoorDyn-F in OpenFAST v5.0.0 starts (it does not carry its seed into its
state). Where two lock-in branches coexist, the seed selects the one a run settles on
- lines with a LINE TYPES ``Cl > 0``, on every route
- ``zero VIVphaseSeed``
* - ``motionFile``
- path, or ``0``/``none``
- absent
Expand Down
16 changes: 15 additions & 1 deletion doc/theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,24 @@ so the shedding frequency locks onto the cross-flow motion inside the band
:math:`c_F \pm d_F` (MoorDyn's defaults 0.18 and 0.08). The running RMS values average over
``VIVrmsWindow`` seconds, by default 500 steps of ``dtM`` as in MoorDyn, and the phases start at
:math:`2\pi i/N` at node :math:`i` counted from the deck's End A (MoorDyn's ``AttachA``), also on
a line written anchor first, which the reader turns around. On a finite-EI mesh the static solve
a line written anchor first, which the reader turns around. The node tangent
:math:`\mathbf{q}` runs from End A to End B, as MoorDyn's; turning it around turns the lift and
:math:`\mathbf{e}` around and starts the same motion from the phases plus :math:`\pi`, with
:math:`\phi_{\dot y} = \pi` instead of MoorDyn's 0 at a node with no cross-flow motion (a node at
rest, a held end of a finite-EI cable), so the lift field is MoorDyn's whichever end a deck writes
first. On a finite-EI mesh the static solve
refined, the deck nodes keep that seed and the nodes it added take the seed interpolated in
arc length. The static equilibrium carries no lift.

The seed decides which response the line settles on where two lock-in branches coexist. On the
taut line of the ``viv_lockin`` test, between about 0.21 and 0.33 m/s, a line locked in its first
mode at 0.18 m/s stays there as the current rises, while one coming down from 0.30 m/s stays in
its second mode, and a start from rest with the spread seed settles in the second mode, as
MoorDyn-C does. MoorDyn-F (v2.3.8, OpenFAST v5.0.0) sets the same seed but does not copy it into
the state vector it integrates, so its phases start at zero at every node: a uniform lift that
excites the symmetric modes only, after which the line stays in its first mode. ``zero
VIVphaseSeed`` starts every phase at zero, and reproduces that start (:doc:`options`).

In the implicit step the phase is explicit: the step's lift takes the phase predicted at
:math:`t_{n+1}` from the step-start rate (the generalised-α level under the configuration blend),
and the committed phase is the trapezoidal (Heun) update with the rate at the converged end
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 @@ -231,6 +231,8 @@
"max_strain": "max_strain",
"vivrmswindow": "viv_rms_window",
"viv_rms_window": "viv_rms_window",
"vivphaseseed": "viv_phase_seed",
"viv_phase_seed": "viv_phase_seed",
"rangestart": "range_start",
"range_start": "range_start",
"waveseed": "wave_seed",
Expand Down Expand Up @@ -1332,6 +1334,8 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None:
if _strip_quotes(value).lower() in _STATICS_FRICTION_POLICIES
else "must be asLaid or none"
)
if key == "viv_phase_seed":
return None if value.lower() in {"spread", "zero"} else "must be spread or zero"
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 @@ -672,6 +672,8 @@ def test_unknown_scalar_option_keyword_fails_closed(tmp_path):
("1.5", "wave_seed", "must be an integer"),
("maybe", "alpha_force_blend", "native boolean"),
("relaxed", "cable_statics", "continuation or sequenced"),
("random", "VIVphaseSeed", "spread or zero"),
("0", "viv_phase_seed", "spread or zero"),
("nodal", "OutputRecovery", "equilibrium or element"),
("on", "ei0_substeps", "auto or off"),
("0", "ei0_substep_angle", r"\(0, 90\] deg"),
Expand Down Expand Up @@ -756,6 +758,8 @@ def test_zero_e_exponent_waterkin_mode_is_accepted(tmp_path):
"True alphaForceBlend",
"continuation cable_statics",
"sequenced cableStatics",
"spread VIVphaseSeed",
"ZERO viv_phase_seed",
"equilibrium OutputRecovery",
"element output_recovery",
"auto ei0_substeps",
Expand Down
90 changes: 53 additions & 37 deletions src/CableDyn_DeckDriver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ MODULE CableDyn_DeckDriver
! of the synchronisation model (OPTION VIVrmsWindow, s); 0 = MoorDyn's 500 time steps of
! the deck dtM (or of the run's step when the deck has none).
REAL(wp) :: viv_rms_window = CD_ZERO
! Initial VIV phases (OPTION VIVphaseSeed): spread over a turn along the line, 2 pi i/N
! (MoorDyn-C), or zero at every node (.TRUE.: the start of MoorDyn-F in OpenFAST v5.0.0).
LOGICAL :: viv_phase_zero = .FALSE.
! WaveKinMod-1 elevation history reduced once to its real Fourier components.
! These feed the same arbitrary-component Airy kernel used by reference-matched
! irregular seas; wave_eta_mean carries the zero-frequency waterline offset.
Expand Down Expand Up @@ -3468,27 +3471,23 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
! coupled host may step the cable at a dt adjusted from the deck dtM.
IF (PRESENT(install_viv)) THEN
IF (install_viv .AND. ANY(viv_cl > CD_ZERO)) THEN
! MoorDyn's phase seed counts the deck nodes from the deck's End A: a line the reader turned
! around, or a mesh the static solve refined, takes it node by node (CD_Deck_VIV_Phase_Seed)
IF (ln%ends_swapped .OR. ALLOCATED(cable%deck_node)) THEN
BLOCK
REAL(wp) :: seed(cable%line%nn)
IF (ALLOCATED(cable%deck_node)) THEN
CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed, deck_map=cable%deck_node)
ELSE
CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed)
END IF
CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, &
MERGE(opts%viv_rms_window, &
REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
opts%viv_rms_window > CD_ZERO), es, em, phase_seed=seed)
END BLOCK
ELSE
! MoorDyn's phase seed counts the deck nodes from the deck's End A, with its node tangent
! towards the deck's End B; CD_Deck_VIV_Phase_Seed takes it node by node to the model's
! nodes and tangent (a line the reader turned around, a mesh the static solve refined)
BLOCK
REAL(wp) :: seed(cable%line%nn)
IF (ALLOCATED(cable%deck_node)) THEN
CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed, deck_map=cable%deck_node, &
zero=opts%viv_phase_zero)
ELSE
CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed, zero=opts%viv_phase_zero)
END IF
CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, &
MERGE(opts%viv_rms_window, &
REAL(CD_VIV_NM, wp)*MERGE(opts%dtM, dt, opts%has_dtm), &
opts%viv_rms_window > CD_ZERO), es, em)
END IF
opts%viv_rms_window > CD_ZERO), es, em, phase_seed=seed, &
tangent_reversed=.NOT. ln%ends_swapped)
END BLOCK
IF (es /= CD_HCDYN_OK) THEN
CALL fail(ErrStat, ErrMsg, 'finite-EI cable VIV wiring failed: '//TRIM(em)); RETURN
END IF
Expand Down Expand Up @@ -10379,17 +10378,14 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er
END IF
tw = opts%viv_rms_window
IF (.NOT. (tw > CD_ZERO) .AND. opts%has_dtm) tw = REAL(CD_VIV_NM, wp)*opts%dtM
IF (ln%ends_swapped) THEN
! MoorDyn counts the phase seed from the deck's End A, which the reader turned around
BLOCK
REAL(wp) :: seed(model%n_dof/3)
CALL CD_Deck_VIV_Phase_Seed(model%l0, .TRUE., seed)
CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, hydro_diam, viv_cf, viv_df, tw, es, em, &
phase_seed=seed)
END BLOCK
ELSE
CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, hydro_diam, viv_cf, viv_df, tw, es, em)
END IF
! MoorDyn counts the phase seed from the deck's End A, with its node tangent towards the
! deck's End B: CD_Deck_VIV_Phase_Seed takes it to the model's nodes and tangent
BLOCK
REAL(wp) :: seed(model%n_dof/3)
CALL CD_Deck_VIV_Phase_Seed(model%l0, ln%ends_swapped, seed, zero=opts%viv_phase_zero)
CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, hydro_diam, viv_cf, viv_df, tw, es, em, &
phase_seed=seed, tangent_reversed=.NOT. ln%ends_swapped)
END BLOCK
IF (es == CD_MODEL_OK) CALL CD_Recompute_Model_Acceleration(model, es, em)
IF (es /= CD_MODEL_OK) THEN
ErrStat = CD_DECKDRV_BADINPUT
Expand Down Expand Up @@ -17154,6 +17150,15 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg)
opts%has_max_strain = ErrStat == 0
CASE ('vivrmswindow', 'viv_rms_window')
CALL rd(val, opts%viv_rms_window, ErrStat, ErrMsg)
CASE ('vivphaseseed', 'viv_phase_seed')
SELECT CASE (TRIM(to_lower(val)))
CASE ('spread')
opts%viv_phase_zero = .FALSE.
CASE ('zero')
opts%viv_phase_zero = .TRUE.
CASE DEFAULT
CALL fail(ErrStat, ErrMsg, 'OPTION VIVphaseSeed "'//TRIM(val)//'" must be spread or zero')
END SELECT
CASE ('streamorder', 'stream_order')
CALL rd(val, x1, ErrStat, ErrMsg)
IF (ErrStat == 0) THEN
Expand Down Expand Up @@ -38444,18 +38449,25 @@ PURE FUNCTION cable_frame_is_identity(cable) RESULT(is_id)
is_id = .NOT. (ABS(cable%frame_s) > CD_ZERO .OR. ABS(cable%frame_c - CD_ONE) > CD_ZERO)
END FUNCTION cable_frame_is_identity

PURE SUBROUTINE CD_Deck_VIV_Phase_Seed(l0, swapped, seed, deck_map)
!! MoorDyn's VIV phase seed i/N (phase 2 pi i/N at node i = 0 .. N counted from the deck's
!! End A, N the deck's segment count) at every node of a line, in the model's internal node
!! order (node 1 = End B; element e of length l0(e) joins nodes e and e + 1). swapped: the
!! reader turned the line's ends around, so the deck's End A is the model's End B. deck_map:
!! the mesh node (public order, End A = 1) of each deck node, on a mesh the static solve
!! refined; a node it added takes the seed interpolated linearly in unstretched arc length
!! between its two deck nodes. Without deck_map the mesh is the deck's.
PURE SUBROUTINE CD_Deck_VIV_Phase_Seed(l0, swapped, seed, deck_map, zero)
!! The initial VIV phase of every node of a line, as a fraction of a turn, in the model's
!! internal node order (node 1 = End B; element e of length l0(e) joins nodes e and e + 1).
!!
!! MoorDyn starts node i = 0 .. N (counted from the deck's End A, N the deck's segment count)
!! at the phase 2 pi i/N (MoorDyn-C; zero: at 0, where MoorDyn-F in OpenFAST v5.0.0 starts),
!! with the node tangent from the deck's End A to its End B. The model's node tangent runs from
!! its End B to its End A: against MoorDyn's on a line the reader keeps in the deck order,
!! which turns the lift and the cross-flow axis of the synchronisation model around. That
!! motion is MoorDyn's from the phases half a turn on, which the seed adds there; a line the
!! reader turned around (swapped: the deck's End A is the model's End B) has MoorDyn's tangent.
!! deck_map: the mesh node (public order, End A = 1) of each deck node, on a mesh the static
!! solve refined; a node it added takes the seed interpolated linearly in unstretched arc
!! length between its two deck nodes. Without deck_map the mesh is the deck's.
REAL(wp), INTENT(IN) :: l0(:)
LOGICAL, INTENT(IN) :: swapped
REAL(wp), INTENT(OUT) :: seed(:)
INTEGER, INTENT(IN), OPTIONAL :: deck_map(:)
LOGICAL, INTENT(IN), OPTIONAL :: zero
REAL(wp) :: s(SIZE(l0) + 1), f
INTEGER :: ne, nn, p, j, nd
ne = SIZE(l0)
Expand All @@ -38479,6 +38491,10 @@ PURE SUBROUTINE CD_Deck_VIV_Phase_Seed(l0, swapped, seed, deck_map)
f = REAL(p - 1, wp)/REAL(ne, wp)
END IF
IF (swapped) f = CD_ONE - f
IF (PRESENT(zero)) THEN
IF (zero) f = CD_ZERO
END IF
IF (.NOT. swapped) f = MODULO(f + 0.5_wp, CD_ONE)
Comment thread
SMI-Lab-Inha marked this conversation as resolved.
Resolved
seed(nn + 1 - p) = f
END DO
END SUBROUTINE CD_Deck_VIV_Phase_Seed
Expand Down
Loading
Loading