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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,18 @@ All notable changes to CableDyn are recorded in this file. The format follows
`EI = 0` lines and line systems. Outputs are unchanged to the bit; with the three line totals
the VIV examples run about 11 % faster (`viv_taut_cable_inline.dat` 2.39 s to 2.14 s; the same
line with 200 elements at 100 steps per cycle 18.1 s to 16.1 s).
- The output channels of one row evaluate the line-wide values a finite-EI cable's channels
share once per row instead of once per channel: the element twists and torsion state behind
every `Twist<L>N<J>`, the node torques of `Torq<L>N<J>`, the section curvature of
`CurvX`/`CurvY` and the VIV amplitude. This applies to every `CalcOutput` of the OpenFAST
module (`CompMooring = 5`) and FAST.Farm, their committed-step `.CD.out` row and
linearization, and to the standalone mixed, multibody and cubic-Hermite routes. A supercycled
module's `.CD.out` row also takes the channels the same call has just evaluated on the
committed state. Outputs, `.CD.out`, linearization files and restarts are unchanged to the
bit. On the IEA-15MW UMaine model with the three chains and a 600-element lazy-wave cable
restrained in torsion (nine `Twist` and nine `BendMom` channels, `DT = 0.01 s`), `CalcOutput`
takes 12.3 ms per step instead of 26.6 ms (the channels 1.0 ms instead of 9.9 ms, the `.CD.out`
row 0.6 ms instead of 5.1 ms), and CableDyn as a whole 26 ms instead of 42 ms.
- The bending damping of a finite-EI cable (`EI|Bb`, `EI|-zeta|f`) evaluates the second
derivatives of the curvature only where the position Jacobian needs them, not in every residual
evaluation. Results are unchanged to the bit; the Delta Flume case 9 deck of
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2785,6 +2785,14 @@ target_link_libraries(test_coupled_torsion PRIVATE cabledyn_core)
add_test(NAME coupled_torsion COMMAND test_coupled_torsion WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(coupled_torsion PROPERTIES LABELS "fortran;unit;static;dynamic;openfast")

# The channels of one output row evaluated together (CD_AGG_EvalChannels, the line-wide twists
# and torques once per row) against one at a time, bit for bit, through a rolling march and a
# probe transfer: a row value kept from another state would fail.
add_executable(test_channel_row tests/test_channel_row.f90)
target_link_libraries(test_channel_row PRIVATE cabledyn_core)
add_test(NAME channel_row COMMAND test_channel_row WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(channel_row PROPERTIES LABELS "fortran;unit;dynamic;openfast")

# OpenFAST linearisation of a line restrained in torsion, by the shell's lin_eval recipe on the
# aggregate: the twist modes of A against n pi/L sqrt(GJ/Irn), the reduced roll stiffness GJ/L
# (nodal twist and condensed), the damping and inertia columns of the platform's angular rates.
Expand Down
19 changes: 12 additions & 7 deletions app/cabledyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PROGRAM cabledyn
CD_AGG_NMovingPoints, CD_AGG_GetMovingPointMesh, &
CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_End, &
CD_AGG_NumChannels, CD_AGG_ChannelHeader, &
CD_AGG_EvalChannel, CD_AGG_WriteStaticProfile, &
CD_AGG_EvalChannels, CD_AGG_WriteStaticProfile, &
CD_AGG_GetInitMetadata, CD_AGG_GetInitLine, &
CD_AGG_Range_Sample, CD_AGG_Range_Write, CD_AGG_OK, CD_AGG_BADINPUT, &
CD_AGG_UpdateStates_Moving, CD_AGG_MotionKinematics, &
Expand Down Expand Up @@ -854,22 +854,27 @@ SUBROUTINE write_mixed_row(unit, time, aggregate, stat, msg)
TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: aggregate
INTEGER, INTENT(OUT) :: stat
CHARACTER(*), INTENT(OUT) :: msg
INTEGER :: i, ios
REAL(wp) :: value
INTEGER :: i, ios, n_done, eval_stat
REAL(wp) :: values(CD_AGG_NumChannels(aggregate))
CHARACTER(LEN(msg)) :: eval_msg

! full-precision time column (the deck-driver writers use the same format)
WRITE (unit, '(ES25.16E3)', ADVANCE='NO', IOSTAT=ios) time
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
END IF
DO i = 1, CD_AGG_NumChannels(aggregate)
CALL CD_AGG_EvalChannel(aggregate, i, value, stat, msg)
IF (stat /= CD_AGG_OK) RETURN
WRITE (unit, CD_CHANNEL_FMT, ADVANCE='NO', IOSTAT=ios) CHAR(9), value
! the row's channels in one evaluation (their shared line-wide values once); a failed channel
! ends the row after the channels before it, as a channel-by-channel loop would
CALL CD_AGG_EvalChannels(aggregate, values, n_done, eval_stat, eval_msg)
DO i = 1, n_done
WRITE (unit, CD_CHANNEL_FMT, ADVANCE='NO', IOSTAT=ios) CHAR(9), values(i)
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
END IF
END DO
IF (eval_stat /= CD_AGG_OK) THEN
stat = eval_stat; msg = eval_msg; RETURN
END IF
WRITE (unit, '(A)', IOSTAT=ios) ''
IF (ios /= 0) THEN
stat = CD_AGG_BADINPUT; msg = 'cannot write mixed output row'; RETURN
Expand Down
Loading
Loading