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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ All notable changes to CableDyn are recorded in this file. The format follows
- Under a bend stiffener, `BendMom<L>N<J>` (and the `BendMoment` columns of the static profile,
range graphs and element file) report the cable's own moment, the line type's EI times the
curvature; lines without stiffeners are unchanged.
- A run whose outputs name line nodes (`L<L>N<J>…`, `Ten<L>N<J>` and the other node channels, or a
LINES `Outputs` flag) notes that CableDyn numbers line nodes from 1 at End A while MoorDyn
numbers them from 0, so a MoorDyn deck's `N<J>` is CableDyn's `N<J+1>`, or `N<NumSegs+1-J>` on
a line written anchor-first. The numbering itself is unchanged; the outputs and migration pages
state it.

### Fixed

Expand Down
9 changes: 7 additions & 2 deletions doc/migrating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,13 @@ What differs on purpose
* - Unsupported input
- rejected at parse time with a message naming the feature, never silently ignored
* - Node identity
- CableDyn meshes are its own; MoorDyn node numbers and rod-node histories are not
reproduced
- line nodes are numbered from 1 at End A, MoorDyn's from 0 at its End A, so a MoorDyn
deck's ``L<L>N<J>`` names another node here: MoorDyn's ``N<J>`` is CableDyn's ``N<J+1>``
on a line kept in the order written, and ``N<NumSegs+1-J>`` on a line written
anchor-first, which CableDyn runs from its fairlead (see above and
:ref:`node numbering <outputs-moordyn-node-numbers>`). A run reporting line nodes notes
the difference. Rod nodes keep MoorDyn's numbering (node 0 = End A); rod-node histories
are not reproduced

Inside OpenFAST
~~~~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion doc/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ These names exist so a migrated MoorDyn deck fails less often at the syntax boun

Other MoorDyn constructs that fail by name rather than as unknown input: ``CoupledPinned`` bodies,
and ``CoupledPinned``/``VesselPinned`` rods outside a coupled host (they run in OpenFAST, see
:doc:`openfast`). Line-node output channels start at node 1 (``N0`` is rejected), and a number
:doc:`openfast`). Line-node output channels start at node 1 (``N0`` is rejected; MoorDyn numbers from 0, see
:ref:`node numbering <outputs-moordyn-node-numbers>`), and a number
with a sign inside its mantissa (such as ``1+2``) is rejected instead of being read up to the sign.

Water-kinematics sources
Expand Down
9 changes: 9 additions & 0 deletions doc/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,15 @@ numeric id written with leading zeros (``Ten1N02`` = ``Ten1N2``), or an alias sp
``LINES`` and ``POINTS`` ids (not array positions); ``<J>`` is a node number on line ``<L>``,
1 = End A to ``N`` = End B, where ``N`` = 1 + the total ``NumSegs`` of the line's sections.

.. _outputs-moordyn-node-numbers:

This is **not MoorDyn's numbering**. MoorDyn numbers a line's nodes from 0 at its End A
(``AttachA``) to ``NumSegs``, so on a line kept in the order written ``L<L>N<J>`` here is MoorDyn's
``L<L>N<J-1>``. A line written anchor-first (``AttachA`` a ``Fixed`` anchor, ``AttachB`` the
fairlead) runs from its fairlead here (:doc:`migrating`), so its ``N<J>`` is MoorDyn's
``N<NumSegs+1-J>``. The per-line files (``Node<J>…`` columns) number the same way. A run whose
outputs name line nodes says so in a note, and ``N0`` is rejected rather than read as another node.

.. _outputs-refined-nodes:

Node channels on a refined line
Expand Down
22 changes: 22 additions & 0 deletions src/CableDyn_DeckDriver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ MODULE CableDyn_DeckDriver
REAL(wp), SAVE :: probe_v0(3) = 0.0_wp, probe_w0(3) = 0.0_wp
REAL(wp), ALLOCATABLE, SAVE :: probe_rec(:, :)
INTEGER, PARAMETER, PUBLIC :: CD_DECKDRV_OK = 0, CD_DECKDRV_BADINPUT = 1, CD_DECKDRV_SOLVEFAIL = 2
! Printed by a run that reports line nodes (an OUTPUTS channel CD_Is_Line_Node_Channel names, or
! a LINES Outputs flag): CableDyn numbers a line's nodes from 1 = End A, MoorDyn from 0 = its End
! A, and CableDyn runs a line written anchor-first from its fairlead (normalize_stock_endpoint_order),
! so a MoorDyn deck's line-node channels would otherwise name other nodes without notice.
CHARACTER(*), PARAMETER, PUBLIC :: CD_LINE_NODE_NUMBERING_NOTE = 'line nodes are numbered from 1 = End '// &
'A in the channels and line files, MoorDyn''s from 0: N<J> here is '// &
'MoorDyn''s N<J-1>, or N<NumSegs+1-J> on a line written anchor-first, '// &
'which CableDyn runs from its fairlead (End A)'
PUBLIC :: CD_Is_Line_Node_Channel

! Deck token / OUTPUTS channel-name length. Public so the aggregate facade can declare its
! retained channel-name store with a matching length.
Expand Down Expand Up @@ -7924,6 +7933,9 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg)
CALL parse_deck(deck_path, types, bodies, rod_types, rods, points, lines, sections, opts, channels, &
ErrStat, ErrMsg, failures=fails)
IF (ErrStat /= 0) RETURN
IF (ANY([(CD_Is_Line_Node_Channel(channels(j)), j=1, SIZE(channels))]) .OR. &
ANY([(line_outputs_requested(lines(j)%outputs), j=1, SIZE(lines))])) &
WRITE (output_unit, '(A)') ' Note: '//CD_LINE_NODE_NUMBERING_NOTE//'.'
! Torsion (both ends of a line torsionally restrained) runs on the standalone cubic-Hermite
! route and the multibody march, in statics and dynamics (quasi-static torsion: no torsional
! inertia). One restrained end carries no torque (the other end is free to twist), so it is
Expand Down Expand Up @@ -32378,6 +32390,16 @@ SUBROUTINE check_channel(ch, lines, points, sections, ErrStat, ErrMsg, bodies, r
END IF
END SUBROUTINE check_channel

LOGICAL FUNCTION CD_Is_Line_Node_Channel(ch) RESULT(yes)
!! True for an OUTPUTS channel that names a node of a line (Ten<L>N<J>, Curv, BendMom, StfMom,
!! Torq, Twist<L>N<J>, L<L>N<J>...), whose node numbering differs from MoorDyn's
!! (CD_LINE_NODE_NUMBERING_NOTE); the line total Twist<L> names no node.
CHARACTER(*), INTENT(IN) :: ch
INTEGER :: line_id, node_id, kind, comp
CALL parse_line_node_channel(ch, line_id, node_id, kind, comp)
yes = kind /= 0 .AND. kind /= 11
END FUNCTION CD_Is_Line_Node_Channel

PURE LOGICAL FUNCTION names_node_zero(lo) RESULT(yes)
!! True when a lower-cased line-node channel names node 0 ("...n0" at the end or before
!! a letter), the MoorDyn End A numbering.
Expand Down
11 changes: 10 additions & 1 deletion src/openfast/CableDyn_OF.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ MODULE CableDyn
USE CableDyn_Precision, ONLY: wp
USE CableDyn_Conventions, ONLY: CD_NATIVE_CHANNEL_FMT
USE CableDyn_Hydro, ONLY: CD_Current_Profile_Velocity, CD_SeaState_Steady_Current, CD_HYDRO_OK
USE CableDyn_DeckDriver, ONLY: CD_Deck_Query_dtM, CD_DECKDRV_OK
USE CableDyn_DeckDriver, ONLY: CD_Deck_Query_dtM, CD_DECKDRV_OK, CD_Is_Line_Node_Channel, &
CD_LINE_NODE_NUMBERING_NOTE
USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_UpdateStates_Moving, &
CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_GetMovingPointMesh, &
CD_AGG_Snapshot, CD_AGG_Restore, &
Expand Down Expand Up @@ -306,6 +307,14 @@ SUBROUTINE open_native_outputs( id, root, t_start, ErrStat, ErrMsg, write_profil

nch = CD_AGG_NumChannels(Inst(id)%agg)
IF (nch <= 0) RETURN
! MoorDyn numbers line nodes from N0, CableDyn from N1: say so as the standalone driver does
DO ic = 1, nch
CALL CD_AGG_ChannelHeader(Inst(id)%agg, ic, hdr, unt, es, em)
IF (es /= CD_AGG_OK) EXIT
IF (.NOT. CD_Is_Line_Node_Channel(hdr)) CYCLE
CALL WrScr( ' Note: '//CD_LINE_NODE_NUMBERING_NOTE//'.' )
EXIT
END DO
! One run-level path has one owner. A rebuilt state must adopt the existing
! unit through restore_native_outputs rather than attempting a second OPEN.
DO owner = 1, SIZE(Inst)
Expand Down
8 changes: 8 additions & 0 deletions tests/test_ei0_slack_dynamics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,14 @@ SUBROUTINE case_run_audit()
CALL require(ok, 'audit:rhoinf-run')
CALL require(file_contains('ei0slack_audit_rho.log', 'Note: rhoInf = 0.990 leaves almost no numerical'), &
'audit:rhoinf-note')
! line nodes are numbered from 1 = End A, MoorDyn's from 0: noted when a run reports line nodes
CALL require(.NOT. file_contains('ei0slack_audit_rho.log', 'line nodes are numbered from 1'), &
'audit:no-node-numbering-note')
CALL light_cable_deck('ei0slack_audit_node.dat', 0.1_wp, 1.0_wp, '', 'p')
CALL run_driver_logged('ei0slack_audit_node.dat', 'ei0slack_audit_node', 'ei0slack_audit_node.log', ok)
CALL require(ok, 'audit:node-run')
CALL require(file_contains('ei0slack_audit_node.log', 'Note: line nodes are numbered from 1 = End A'), &
'audit:node-numbering-note')
! a 10 m sway at dtM 0.2 s turns the segments by several degrees per step: taken as given
! (off ei0_substeps) the run notes the turn
CALL write_motion('ei0slack_sway.txt', 1, [5.0_wp, 0.0_wp, -14.0_wp], 2, 10.0_wp, 10.0_wp, 10.0_wp, &
Expand Down
Loading