From 0c624857782b52792d129ac2cd85b5ba07bae451 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 16 Oct 2026 12:23:40 +0900 Subject: [PATCH 1/5] fix: seabed contact for clump points; note EI = 0 folds Connect/Free points (clump weights, buoys) had no seabed contact of their own: a 50 t clump on polyester ended 2.8 m below the seabed, carried only by the penalty of its line-end nodes, silently. A deck Free/Connect point now rests on the seabed with the line contact law (stiffness kBot A, downward-only damping cBot A, the C1 touchdown blend, along the surface normal on a slope) over the footprint A = V^(2/3), V its Vol or Mass/7850 when Vol is 0 (OrcaFlex's 3D-buoy default for a cube); a massless junction has none. Statics, the monolithic multibody residual, the staggered/OpenFAST/C API point step and the point/body static equilibrium use the same law, so a grounded point starts at rest. Penetration: 50 t clump 2.81 -> 0.95 m, 20 t on chain 1.02 -> 0.67 m. Every deck without a grounded point is byte-identical (1024 of 1031 decks); clump_weight_free_point.dat now rests 4.7 cm deep instead of 6.6 cm and its AnchTen falls from 186 to 92 kN, the lines no longer holding the clump up. EI = 0 lines converged silently to folded layouts (a frictionless line pushed 20 m past its anchor by a 2 m/s current, a run sliding down a slope). A note now names the fold, its cause and remedies, once per line, on the static, TMax = 0, point-system and multibody routes and in the OpenFAST aggregate's line report; no example or test deck triggers it. Results do not change. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 24 ++ CMakeLists.txt | 35 +++ doc/driver_format.md | 8 +- doc/options.rst | 3 +- doc/theory.rst | 49 +++- doc/troubleshooting.rst | 12 +- src/CableDyn_DeckDriver.f90 | 353 +++++++++++++++++++++++++++- src/CableDyn_Model.f90 | 68 ++++++ src/CableDyn_System.f90 | 92 +++++++- tests/data/ei0_fold_slope.dat | 29 +++ tests/data/ei0_fold_slope_bathy.txt | 27 +++ tests/data/ei0_hairpin_current.dat | 32 +++ tests/test_point_seabed_contact.f90 | 318 +++++++++++++++++++++++++ tests/test_shared_anchor.f90 | 24 +- tests/test_statics_robustness.py | 10 +- 15 files changed, 1055 insertions(+), 29 deletions(-) create mode 100644 tests/data/ei0_fold_slope.dat create mode 100644 tests/data/ei0_fold_slope_bathy.txt create mode 100644 tests/data/ei0_hairpin_current.dat create mode 100644 tests/test_point_seabed_contact.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5da378e2..3dd34ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -183,6 +183,16 @@ All notable changes to CableDyn are recorded in this file. The format follows still reject `CONTROL`. A zero command, with a `DeltaLdot` of either sign, leaves the run bit-identical to an uncontrolled one, and a checkpoint restart continues bit-identically. See the manual's deck format page (CONTROL). +- A note when the static layout of an `EI = 0` line folds back on the seabed (a hairpin), the + twin of the finite-EI note. A current toward the anchor or a seabed falling past it can carry + the grounded run of a tension-only line past its anchor on a frictionless seabed, where it + folds back with zero tension at the fold: a 2 m/s current carried a chain 20 m past its anchor, + a 5° slope 24 m, without a word. The equilibrium is kept, and one note per line names the fold + (the distance past the anchor, or a turn above 150° of the grounded run), its cause at the + fold (the current, the slope, or a slack run) and the remedy (seabed friction or a shorter + line). It is printed on the static, `TMax = 0`, point-system and multibody routes and returned + in the line report of the OpenFAST aggregate. No example deck prints it, and no result + changes. See the manual's theory page (EI = 0 path) and Troubleshooting. ### Changed @@ -635,6 +645,20 @@ All notable changes to CableDyn are recorded in this file. The format follows OPTION); an anchor below the seabed by more than the tolerance gives the depth, the tolerance rule, and the Z to use. These messages change no acceptance rule. +- `Free` and `Connect` points (clump weights, buoys) now have their own seabed contact. Until + now only the end nodes of the attached lines held a point on the seabed, over their + tributary length, so a heavy clump sank silently into it: a 50 t clump between two polyester + lines ended 2.8 m below the seabed, a 20 t clump on chain 1.0 m. A point with `Mass` or `Vol` + now rests on a footprint `A = V^(2/3)` (`V` = `Vol`, or `Mass`/7850 kg/m³ for a clump declared + by its mass alone) with the line contact law, stiffness `kBot·A` and damping `cBot·A`, along + the surface normal on a bathymetry, in the point static equilibrium and in the monolithic, + staggered and OpenFAST point steps; MoorDyn points have no seabed contact. The 50 t clump now + rests 0.95 m deep (its weight alone presses its 3.44 m² footprint in by 1.43 m) and the 20 t + clump 0.67 m. The point routes still reject `frictionMu`, so the contact is frictionless. + Results change only where a point touches the seabed: of the examples only + `clump_weight_free_point.dat`, whose clump now rests 4.7 cm deep instead of 6.6 cm and whose + anchor tension falls from 186 kN to 92 kN; decks whose points stay clear of the seabed give + identical output. See the manual's theory page (Seabed contact). - The development environment (`environment.yml`) excludes OpenBLAS 0.3.34, which caused the access violation in the modal analysis tests listed under Known issues for 0.1.1. On AMD Zen 4 and Zen 5 CPUs that expose AVX-512, OpenBLAS 0.3.34 enlarges the GEMM blocking, diff --git a/CMakeLists.txt b/CMakeLists.txt index a4c6c0e6..0ef297f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -986,6 +986,14 @@ target_link_libraries(test_deck_massless_connect PRIVATE cabledyn_core) add_test(NAME deck_massless_connect COMMAND test_deck_massless_connect WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_tests_properties(deck_massless_connect PROPERTIES LABELS "fortran;driver;integration;dynamic") +# Seabed contact of Free/Connect points: a clump weight rests on its own footprint in the +# statics and stays at rest in the monolithic and staggered marches, on a flat and a sloped +# seabed; the fold note of an EI = 0 line reaches the OpenFAST aggregate's line report. +add_executable(test_point_seabed_contact tests/test_point_seabed_contact.f90) +target_link_libraries(test_point_seabed_contact PRIVATE cabledyn_core) +add_test(NAME point_seabed_contact COMMAND test_point_seabed_contact WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +set_tests_properties(point_seabed_contact PROPERTIES LABELS "fortran;driver;integration;dynamic;static") + add_executable(test_openfast_shell tests/test_openfast_shell.f90) target_link_libraries(test_openfast_shell PRIVATE cabledyn_core) add_test(NAME openfast_shell COMMAND test_openfast_shell) @@ -2098,6 +2106,33 @@ add_test(NAME driver_advisories -DSEABED_DECK=${CMAKE_CURRENT_SOURCE_DIR}/examples/chain_catenary_shallow_30m.dat -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_advisories.cmake) set_tests_properties(driver_advisories PROPERTIES LABELS "fortran;driver;integration") +# The fold note of an EI = 0 line, once per folded line and never on a usual layout: a current +# that pushes the grounded run 20 m past its anchor (TMax = 0, the line-model route), a seabed +# sloping down past the anchor (static run over a bathymetry), and a grounded chain that does +# not fold. +add_test(NAME driver_ei0_fold_note_current + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_hairpin_current.dat|hairpin" + "-DONCE=Note: line 1: the static layout carries the grounded run 20\\.[0-9]+ m past its anchor, where it folds back;the current drives the run along the seabed, which holds it only by friction" + "-DMUST_MATCH=seabed friction or a shorter line prevents it" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_current + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_ei0_fold_note_current PROPERTIES LABELS "fortran;driver;integration;static") +add_test(NAME driver_ei0_fold_note_slope + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_fold_slope.dat|slope" + "-DONCE=Note: line 1: the static layout carries the grounded run 2[0-9]\\.[0-9]+ m past its anchor, where it folds back;the seabed slope drives the run downhill" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_slope + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_ei0_fold_note_slope PROPERTIES LABELS "fortran;driver;integration;static") +add_test(NAME driver_ei0_no_fold_note + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/examples/chain_catenary_shallow_30m.dat|shallow" + "-DONCE=converged run written" + "-DMUST_NOT=folds back|a hairpin" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_no_fold_note + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_ei0_no_fold_note PROPERTIES LABELS "fortran;driver;integration;static") # A clamped finite-EI cable with a buoyant section on a Rigid6 body: the body static solve # holds the objects at their deck poses, warns once, and reports no balanced clamped end loads. add_test(NAME driver_clamped_buoyant_held diff --git a/doc/driver_format.md b/doc/driver_format.md index e5240eef..458a8132 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -621,7 +621,11 @@ A POINTS row has 9 columns, `ID Type X Y Z Mass Vol CdA Ca`, or the short 5-colu For dynamic `Connect`/`Free` points, `Mass` is inertial mass and `(rhoW·Vol − Mass)·g` is a constant vertical load. A `Mass = 0` junction is accepted; it moves with the end-node mass of its lines. `CdA` adds lumped drag and `Ca` lumped added mass in EI = 0 dynamic runs with uniform or -profile current or deck waves. `Connect`/`Free` points require `dtM`/`TMax` in the +profile current or deck waves. A `Connect`/`Free` point with `Mass` or `Vol` (a clump weight or +a buoy) has its own seabed contact, the line contact law with stiffness `kBot·A` and damping +`cBot·A` over the footprint `A = V^(2/3)`, where `V = Vol`, or `Mass/7850` (solid steel) when +`Vol = 0`; a point with neither has none (see the theory manual, Seabed contact). +`Connect`/`Free` points require `dtM`/`TMax` in the standalone driver. Non-zero `Mass`/`Vol`/`CdA`/`Ca` on `Fixed`, `Coupled`, `Vessel`, `Body`, `RodA/B`, or `Turbine` points is rejected. @@ -1041,7 +1045,7 @@ syntax form. The most frequently edited keywords are: | `rhoW` / `WtrDnsty` | water density [kg/m³] | 1025.0 | | `WtrDpth` | water depth [m]; seabed plane z = −WtrDpth. Omit for a suspended or taut line with no bottom contact | none | | `bathymetryFile` / `bathymetry_file` / `seafloorFile` | structured bathymetry file (rows `x y depth`); mutually exclusive with `WtrDpth`. Supported for static EI = 0, independent-line EI = 0 dynamic, EI = 0 `Connect`/`Free` point-system line contact, cubic-Hermite finite-EI dynamic with held or prescribed-translation ends, free/fixed rod dynamic, and Rigid6 dynamic decks | none | -| `kBot` | seabed penalty stiffness base [Pa/m = N/m³], scaled per line node and rod contact station by diameter × tributary length, and by a fixed 1 m² reference area at a Rigid6 reference point (only with `WtrDpth`/`bathymetryFile`) | 1.0e5 | +| `kBot` | seabed penalty stiffness base [Pa/m = N/m³], scaled per line node and rod contact station by diameter × tributary length, at a Free/Connect point with Mass or Vol by its footprint `V^(2/3)` (`V` = Vol, or Mass/7850), and by a fixed 1 m² reference area at a Rigid6 reference point (only with `WtrDpth`/`bathymetryFile`) | 1.0e5 | | `cBot` | seabed normal damping base [Pa·s/m = N·s/m³], scaled like `kBot`; active only on contacting nodes moving downward | 1.0e4 | | `bodyIC` | `static`: free `Rigid6` bodies and free rods, with `Free`/`Connect` points, start at their static equilibrium; `deck`: they start at their deck pose (for example a free-decay test) | `static` | | `frictionMu` / `mu` | isotropic seabed friction coefficient: stick-slip springs on line nodes (held by the static solve too in a deck current, from the still-water laid shape, or toward the as-laid position with `staticsFriction asLaid`), regularised kinetic friction on rods and bodies; requires `WtrDpth` or `bathymetryFile`, and `dtM`/`TMax` in the standalone driver. Rejected on some routes (decks with `Connect`/`Free` points, `Point3` buoys or `FAILURE` rows, and body or rod decks off the default monolithic march); see the [OPTIONS reference](options.rst) | 0 | diff --git a/doc/options.rst b/doc/options.rst index a257318a..8d6c4349 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -89,7 +89,8 @@ Environment and seabed - real, Pa/m (N/m³) - ``1.0e5`` - finite, > 0 when a seabed is present. Mapped to each line node and rod contact station by - local diameter × tributary length; a Rigid6 reference point uses a fixed 1 m² area + local diameter × tributary length; a Free/Connect point with Mass or Vol over its footprint + (Vol, or Mass/7850 kg/m³, to the power 2/3); a Rigid6 reference point uses a fixed 1 m² area - both - ``1.0e5 kBot`` * - ``cBot`` / ``cb`` diff --git a/doc/theory.rst b/doc/theory.rst index 5f9d41e8..cf9f42de 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1070,6 +1070,30 @@ component :math:`w\sin\theta` per unit length, and a run pushed down the slope i is compressed there. On the Hermite path the contact acts on the nodal position DOFs only, not on the tangent DOFs. +**Free and Connect points.** A clump weight or a buoy (a ``Free`` or ``Connect`` point with +``Mass`` or ``Vol``) has its own seabed contact, the line law above with the stiffness +:math:`k_p = k_\text{Bot} A` and the damping :math:`c_p = c_\text{Bot} A` over its contact +footprint + +.. math:: + + A = V^{2/3}, \qquad V = \begin{cases} \text{Vol}, & \text{Vol} > 0, \\ + \text{Mass}/\rho_s, & \text{otherwise}, \end{cases} + +the area of a cube of the point's volume (the OrcaFlex 3D-buoy default contact area, volume +over height, for a cube), with :math:`\rho_s = 7850\ \mathrm{kg/m^3}`: a clump declared by its +mass alone, its buoyancy left out, takes the volume of solid steel of that mass. A point with +neither (a massless line junction) has no footprint. Without it only the end nodes of the +attached lines held a point on the bed, over their tributary length: a 50 t clump between two +polyester lines (``kBot = 1e5``) sank 2.8 m into the seabed; on its 3.44 m² footprint it rests +0.95 m deep, within the 1.43 m that its weight alone would press it in, and the lines no longer +hang it from the seabed. MoorDyn points have no seabed contact. The contact acts along the +surface normal of a sloped or rounded bathymetry, in the point static equilibrium and in the +monolithic and staggered point steps alike (in the staggered step its stiffness and damping are +linearly implicit, like the end blocks of the attached lines), so a grounded point starts at +rest. The contact is frictionless: the point routes reject ``frictionMu``. A point clear of the +seabed sees exactly no contact load, and its results are unchanged. + Static equilibrium ------------------ @@ -1135,8 +1159,26 @@ march) enters the static equilibrium as Morison drag on the line at rest, so the offset is part of the initial condition. ``Connect`` and ``Free`` points are then placed at their static force balance: a trust-region Newton iteration on the point positions whose residual sums the attached lines' end forces (each line re-solved for the moving ends), the -point's weight and buoyancy, and its current drag. It is the rigid-body equilibrium solve -described under *Rigid-body initial condition* below, with points as the only unknowns. +point's weight and buoyancy, its current drag, and its own seabed contact (see Seabed +contact above). It is the rigid-body equilibrium solve described under *Rigid-body initial +condition* below, with points as the only unknowns. + +A tension-only line on a frictionless seabed can reach a folded (hairpin) equilibrium: a +current toward the anchor, or a seabed falling past it, drives the grounded run beyond the +anchor, and the run folds back to it with zero tension at the fold; a slack line can likewise +be laid out and back. The equilibrium is kept, and the driver prints one note per such line, +on every ``EI = 0`` route (static, ``TMax = 0`` and the dynamic initial condition, the point +and multibody systems, and the line report of the OpenFAST aggregate), naming the fold and its +cause at the fold node (the current, the seabed slope, or a slack run): ``the static layout +carries the grounded run ... m past its anchor, where it folds back (a hairpin)`` when grounded +nodes lie more than 1 % of the horizontal span plus 0.5 m beyond a grounded end whose other +end is suspended, measured along the horizontal chord (the criterion of the finite-EI note +below), or ``the static layout folds the grounded run back on itself (a ... deg turn at node +...)`` when the run turns by more than 150° at a node whose two neighbours are also grounded +(within 5 cm of the floor). Seabed friction holds the run in a current, but the static solve +applies it against a deck current only, so on a slope only a shorter line prevents the fold. +The note never changes a result. No example deck and no ``EI = 0`` line of the statics test +matrices prints it except the folded layouts it describes. Hermite path ~~~~~~~~~~~~ @@ -1787,7 +1829,8 @@ Deck ``POINTS``, ``BODIES``, and ``RODS`` records follow the MoorDyn object mode - **Fixed, coupled, and vessel points** prescribe the position, velocity, and acceleration of line ends. - **Free points** (``Point3`` buoys, clump weights, connectors) have three translational DOFs. - Each carries its weight and buoyancy :math:`(\rho V - m)\,g\,\mathbf{e}_z`, point loads, and, + Each carries its weight and buoyancy :math:`(\rho V - m)\,g\,\mathbf{e}_z`, point loads, its + own seabed contact (a ``Free`` or ``Connect`` point, see Seabed contact above), and, while below the surface, lumped Morison terms :math:`\tfrac{1}{2}\rho\,C_dA\,\lvert\mathbf{u}_r\rvert\mathbf{u}_r + \rho V(1 + C_a)\,\dot{\mathbf{u}}_f` with added mass :math:`\rho V C_a`. Points are advanced around the implicit line step with diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index cc83934a..c861e5e8 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -652,7 +652,17 @@ Warnings and notes that do not stop a run it folds back to it (see :doc:`theory`). The layout is a valid, stable equilibrium of the deck as written, but not the usual one. If the real seabed holds the line, declare ``frictionMu``; otherwise check the line length and the current, and inspect - ``.static.out`` before using the layout. + ``.static.out`` before using the layout. On an ``EI = 0`` line the note names + the cause at the fold: the current, a seabed sloping down past the anchor (the static + solve applies ``frictionMu`` against a deck current only, so there only a shorter line + prevents the fold), or neither, when the folded run carries no tension (a slack line laid + out and back; a shorter line removes it). + * - ``Note: line ...: the static layout folds the grounded run back on itself (a ... deg turn + at node ..., a hairpin) ...`` + - an ``EI = 0`` line whose grounded run turns back by more than 150° at a node, away from + its ends (for example a slack line whose excess length the static solve lays out and back + on the seabed). As above, the layout is an equilibrium of the deck as written; check the + line length before using it. * - ``Note: line ...: the equilibrium in the current is held in the vertical plane of the line; it is unstable out of that plane ...`` - in a current along the plane of the line the static state is a planar equilibrium that a diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index a72d2fac..ed97c474 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -65,7 +65,7 @@ MODULE CableDyn_DeckDriver CD_Get_System_CoupledMotion, CD_Update_System_Point_States, & CD_Calc_System_CoupledLoads, CD_Step_System, CD_Step_System_DynamicPoints, & CD_Step_System_Junction, CD_System_Junction_Rewind, CD_System_Point_Base, & - CD_System_Point_Environment, & + CD_System_Point_Environment, CD_System_Point_Seabed, & CD_Calc_System_CoupledAccelDerivative, & CD_Detach_System_LineEnds, & CD_SYSTEM_OK, CD_POINT_FIXED, CD_POINT_COUPLED, CD_POINT_FREE, CD_POINT_CONNECT, & @@ -132,7 +132,8 @@ MODULE CableDyn_DeckDriver CD_Morison_Drag_Element_Load, & CD_Morison_Drag_Element_Force, CD_Froude_Krylov_Element_Load, & CD_Froude_Krylov_Element_Force, CD_HYDRO_OK - USE CableDyn_SeabedContact, ONLY: CD_Seabed_Normal_Law, CD_Seabed_Contact_Gate + USE CableDyn_SeabedContact, ONLY: CD_Seabed_Normal_Law, CD_Seabed_Normal_Contact, CD_Seabed_Contact_Gate, & + CD_SEABED_CONTACT_BLEND USE CableDyn_Modal, ONLY: CD_Modal_Bar_Band, CD_Modal_Hermite_Band, CD_Modal_Solve_Band, & CD_Modal_Write_Header, CD_Modal_Write_Line, CD_MODAL_OK USE CableDyn_StreamWave, ONLY: CD_StreamWaveType, CD_Stream_Solve, CD_Stream_Kinematics @@ -1355,6 +1356,13 @@ SUBROUTINE init_deck_system_from_parsed(types, points, lines, sections, opts, sy sys_points(i)%cda = pts(i)%cda sys_points(i)%ca = pts(i)%ca sys_points(i)%force = [CD_ZERO, CD_ZERO, (opts%rhoW*pts(i)%vol - pts(i)%mass)*opts%g] + ! a deck Free/Connect point's own seabed contact over its footprint (point_contact_area), + ! with the line contact coefficients kBot and cBot per unit area. Body and rod attachment + ! points also step as system Free points, but their object carries the contact. + IF (TRIM(pts(i)%ptype) == 'free' .OR. TRIM(pts(i)%ptype) == 'connect') THEN + sys_points(i)%seabed_k = opts%kbot*point_contact_area(pts(i)) + sys_points(i)%seabed_c = opts%cbot*point_contact_area(pts(i)) + END IF END DO IF (nres > 0) THEN maxid = 0 @@ -6720,6 +6728,19 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi IF (ErrStat /= CD_DECKDRV_OK) THEN CALL CD_End_Deck_Aggregate(agg); RETURN END IF + ! the static fold note of each EI = 0 line (the finite-EI cables carry their own notes), + ! appended to the notes the line already has + IF (agg%has_sys) THEN + BLOCK + CHARACTER(1024) :: fold_note + DO c = 1, SIZE(lines) + IF (agg%line_is_cable(lines(c)%id)) CYCLE + CALL ei0_fold_note(lines(c), points, opts, agg%sys%lines(agg%line_obj_index(lines(c)%id))%q, & + fold_note, model=agg%sys%lines(agg%line_obj_index(lines(c)%id))) + IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(agg%init_lines(c)%note, fold_note) + END DO + END BLOCK + END IF ! A static strain above the note level is named in the line's initialisation note (every route that ! prints the notes of this summary shows it), and the standalone mixed route -- the caller that ! asks for the range graphs -- also warns about coarse sections, as the single-topology driver does. @@ -7612,7 +7633,8 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) RETURN END IF - CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg) + CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg, & + opts=opts) IF (ErrStat /= CD_DECKDRV_OK) THEN CALL CD_End_System(point_system, es, em) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) @@ -7646,7 +7668,8 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) RETURN END IF - CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg) + CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg, & + opts=opts) IF (ErrStat /= CD_DECKDRV_OK) THEN CALL CD_End_System(point_system, es, em) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) @@ -7680,7 +7703,8 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) RETURN END IF - CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg) + CALL collect_system_init_summaries(lines, points, point_system, init_summaries, ErrStat, ErrMsg, & + opts=opts) IF (ErrStat /= CD_DECKDRV_OK) THEN CALL CD_End_System(point_system, es, em) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) @@ -7702,7 +7726,7 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) RETURN END IF - CALL collect_model_init_summaries(lines, points, models, init_summaries, ErrStat, ErrMsg) + CALL collect_model_init_summaries(lines, points, models, init_summaries, ErrStat, ErrMsg, opts=opts) IF (ErrStat /= CD_DECKDRV_OK) THEN CALL end_models(models) IF (opts%has_bathymetry_file) CALL CD_End_Bathymetry(bathymetry) @@ -7771,6 +7795,15 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) IF (converged) THEN CALL collect_raw_init_summaries(lines, points, ne, q_all, q_off, ten_all, ten_off, init_summaries, & end_ten=end_all, end_force=end_vec) + BLOCK + CHARACTER(1024) :: fold_note + DO li = 1, nl + IF (line_is_finite_ei(lines(li), types, sections)) CYCLE + CALL ei0_fold_note(lines(li), points, opts, q_all(q_off(li) + 1:q_off(li + 1)), fold_note, & + bathymetry=bathymetry) + IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(init_summaries(li)%note, fold_note) + END DO + END BLOCK CALL print_deck_init_report(deck_path, lines, points, sections, n_finite, init_summaries, & types=types, opts=opts) IF (.NOT. (opts%has_wtrdpth .OR. opts%has_bathymetry_file)) & @@ -9787,6 +9820,197 @@ SUBROUTINE warn_line_below_anchor(lines, points, sections, q_all, q_off) END DO END SUBROUTINE warn_line_below_anchor + SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) + !! Initialisation note for an EI = 0 line whose static layout folds its grounded run back + !! on itself (a hairpin), the twin of the finite-EI anchor_overshoot_note: a current or a + !! seabed slope along a frictionless seabed drives the run past its anchor, or a slack run + !! that carries no tension is laid out and back. Such a layout is an equilibrium of the + !! tension-only line and is kept; the note names it so that it is not mistaken for the + !! usual one. q is the line's static state in the internal node order (node 1 = End B). + !! A node is grounded within GROUNDED_TOL of the floor: model's floor when model is + !! present, otherwise the deck's (bathymetry, else WtrDpth). The layout folds when + !! (a) the grounded run lies beyond a grounded line end whose other end is suspended, on + !! the side away from that other end, by more than 1 % of the horizontal span plus + !! 0.5 m (anchor_overshoot_note), or + !! (b) the run turns by more than FOLD_TURN_DEG at a node whose neighbours are grounded too. + !! note is empty otherwise, and on a line without a floor. + TYPE(DeckLine), INTENT(IN) :: ln + TYPE(DeckPoint), INTENT(IN) :: points(:) + TYPE(DeckOptions), INTENT(IN) :: opts + REAL(wp), INTENT(IN) :: q(:) + CHARACTER(*), INTENT(OUT) :: note + TYPE(CD_ModelType), INTENT(IN), OPTIONAL :: model + TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry + REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp, FOLD_TURN_DEG = 150.0_wp + LOGICAL, ALLOCATABLE :: grounded(:) + REAL(wp), ALLOCATABLE :: slope(:) + REAL(wp) :: total, span, e_h(2), past, past_e, d, u1(3), u2(3), l1, l2, turn, turn_max, zf, dfdx, dfdy, u(3) + INTEGER :: n, k, ie, k_end, k_oth, k_past, k_turn, k_at, end_id, jp, es + LOGICAL :: has_floor, by_current, by_slope + CHARACTER(512) :: em + CHARACTER(200) :: what, cause, remedy + + note = '' + n = SIZE(q)/3 + IF (n < 3) RETURN + ALLOCATE (grounded(n), slope(n)) + DO k = 1, n + CALL floor_at(q(3*k - 2), q(3*k - 1), has_floor, zf, dfdx, dfdy) + IF (.NOT. has_floor) RETURN + grounded(k) = q(3*k) <= zf + GROUNDED_TOL + slope(k) = SQRT(dfdx*dfdx + dfdy*dfdy) + END DO + IF (COUNT(grounded) < 2) RETURN + total = CD_ZERO + DO k = 1, n - 1 + total = total + NORM2(q(3*k + 1:3*k + 3) - q(3*k - 2:3*k)) + END DO + ! (a) the grounded run beyond a grounded end (node 1 is End B, node n End A) + past = CD_ZERO + k_past = 0 + k_at = 0 + end_id = 0 + DO ie = 1, 2 + k_end = MERGE(1, n, ie == 1) + k_oth = MERGE(n, 1, ie == 1) + ! A grounded end below a suspended span: the span pulls the run toward the other end, so + ! on a frictionless seabed a run past the end is folded back to it. (Between two + ! grounded ends a slack run may bow behind an end without folding; (b) covers those.) + IF (.NOT. grounded(k_end) .OR. grounded(k_oth)) CYCLE + span = NORM2(q(3*k_oth - 2:3*k_oth - 1) - q(3*k_end - 2:3*k_end - 1)) + IF (span <= 1.0e-6_wp*MAX(CD_ONE, total)) CYCLE + e_h = (q(3*k_oth - 2:3*k_oth - 1) - q(3*k_end - 2:3*k_end - 1))/span + past_e = CD_ZERO + DO k = 1, n + IF (.NOT. grounded(k)) CYCLE + d = -DOT_PRODUCT(q(3*k - 2:3*k - 1) - q(3*k_end - 2:3*k_end - 1), e_h) + IF (d > past_e) THEN + past_e = d + k_at = k + END IF + END DO + IF (past_e > 0.01_wp*span + 0.5_wp .AND. past_e > past) THEN + past = past_e + k_past = k_at + end_id = MERGE(ln%nodeB, ln%nodeA, ie == 1) + END IF + END DO + ! (b) a fold of the grounded run onto itself + turn_max = CD_ZERO + k_turn = 0 + DO k = 2, n - 1 + IF (.NOT. ALL(grounded(k - 1:k + 1))) CYCLE + u1 = q(3*k - 2:3*k) - q(3*k - 5:3*k - 3) + u2 = q(3*k + 1:3*k + 3) - q(3*k - 2:3*k) + l1 = NORM2(u1) + l2 = NORM2(u2) + IF (l1 <= 1.0e-9_wp*MAX(CD_ONE, total) .OR. l2 <= 1.0e-9_wp*MAX(CD_ONE, total)) CYCLE + turn = ACOS(MAX(-CD_ONE, MIN(CD_ONE, DOT_PRODUCT(u1, u2)/(l1*l2))))*CD_RAD2DEG + IF (turn > turn_max) THEN + turn_max = turn + k_turn = k + END IF + END DO + IF (k_past == 0 .AND. turn_max <= FOLD_TURN_DEG) RETURN + IF (k_past > 0) THEN + jp = find_point(points, end_id) + IF (jp > 0) THEN + IF (TRIM(points(jp)%ptype) == 'fixed') THEN + WRITE (what, '(A,F0.2,A)') 'the static layout carries the grounded run ', past, & + ' m past its anchor, where it folds back (a hairpin)' + ELSE + WRITE (what, '(A,F0.2,A,I0,A)') 'the static layout carries the grounded run ', past, & + ' m past its end at point ', end_id, ', where it folds back (a hairpin)' + END IF + ELSE + WRITE (what, '(A,F0.2,A)') 'the static layout carries the grounded run ', past, & + ' m past its end, where it folds back (a hairpin)' + END IF + k_at = k_past + ELSE + WRITE (what, '(A,I0,A,I0,A)') 'the static layout folds the grounded run back on itself (a ', & + NINT(turn_max), ' deg turn at node ', n + 1 - k_turn, ', a hairpin)' + k_at = k_turn + END IF + ! the cause at the fold: a current there, a sloping seabed there, or neither (a slack run) + by_current = .FALSE. + IF (opts%has_current) THEN + u = deck_current_velocity(opts, q(3*k_at), es, em) + IF (es == CD_HYDRO_OK) by_current = NORM2(u) > CD_ZERO + END IF + by_slope = slope(k_at) > 1.0e-6_wp + IF (by_current .AND. by_slope) THEN + cause = 'the current and the seabed slope drive the run along the seabed, which holds it only by friction' + ELSE IF (by_current) THEN + cause = 'the current drives the run along the seabed, which holds it only by friction' + ELSE IF (by_slope) THEN + cause = 'the seabed slope drives the run downhill, which the seabed holds only by friction' + ELSE + cause = 'the run carries no tension, so nothing sets its layout on the seabed' + END IF + IF (.NOT. (by_current .OR. by_slope)) THEN + remedy = 'a shorter line prevents it' + ELSE IF (opts%has_friction) THEN + remedy = 'a shorter line prevents it; the static solve holds the run with seabed friction against a deck '// & + 'current only' + ELSE + remedy = 'seabed friction or a shorter line prevents it' + END IF + note = 'line '//TRIM(int_to_str(ln%id))//': '//TRIM(what)//'; '//TRIM(cause)//'. Check that it is the '// & + 'intended layout ('//TRIM(remedy)//')' + + CONTAINS + + SUBROUTINE floor_at(x, y, ok, z, gx, gy) + !! The floor elevation and gradient at (x, y); ok is .FALSE. without a floor (or on a + !! failed bathymetry query, where no note is made). + REAL(wp), INTENT(IN) :: x, y + LOGICAL, INTENT(OUT) :: ok + REAL(wp), INTENT(OUT) :: z, gx, gy + LOGICAL :: ready + INTEGER :: esb + CHARACTER(160) :: emb + ok = .FALSE. + z = CD_ZERO + gx = CD_ZERO + gy = CD_ZERO + IF (PRESENT(model)) THEN + IF (.NOT. model%has_seabed) RETURN + IF (model%has_bathymetry) THEN + CALL CD_Bathymetry_Floor_Gradient(model%bathymetry, x, y, z, gx, gy, esb, emb) + ok = esb == CD_BATHY_OK + ELSE + z = model%seabed_z_floor + ok = .TRUE. + END IF + RETURN + END IF + ready = .FALSE. + IF (PRESENT(bathymetry)) ready = CD_Bathymetry_Is_Initialized(bathymetry) + IF (ready) THEN + CALL CD_Bathymetry_Floor_Gradient(bathymetry, x, y, z, gx, gy, esb, emb) + ok = esb == CD_BATHY_OK + ELSE IF (opts%has_wtrdpth) THEN + z = -opts%wtrdpth + ok = .TRUE. + END IF + END SUBROUTINE floor_at + END SUBROUTINE ei0_fold_note + + SUBROUTINE add_model_fold_notes(lines, points, opts, models, summaries) + !! ei0_fold_note of every EI = 0 line model (index-aligned with lines) into its summary. + TYPE(DeckLine), INTENT(IN) :: lines(:) + TYPE(DeckPoint), INTENT(IN) :: points(:) + TYPE(DeckOptions), INTENT(IN) :: opts + TYPE(CD_ModelType), INTENT(IN) :: models(:) + TYPE(CD_LineInitSummary), INTENT(INOUT) :: summaries(:) + INTEGER :: i + DO i = 1, MIN(SIZE(lines), SIZE(models), SIZE(summaries)) + IF (.NOT. ALLOCATED(models(i)%q)) CYCLE + CALL ei0_fold_note(lines(i), points, opts, models(i)%q, summaries(i)%note, model=models(i)) + END DO + END SUBROUTINE add_model_fold_notes + SUBROUTINE solve_one_line(ln, sections, types, points, opts, q, tension, converged, ErrStat, ErrMsg, bathymetry, & end_ten, end_force) !! Solve one EI=0 line (Fixed anchor -> Coupled/held fairlead) built from its ordered @@ -18292,7 +18516,7 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod CALL init_deck_system_from_parsed(types, pc, sys_lines, sections, opts, mb%system, ErrStat, ErrMsg, & bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) RETURN - CALL collect_system_init_summaries(sys_lines, points, mb%system, sum_sys, ErrStat, ErrMsg) + CALL collect_system_init_summaries(sys_lines, points, mb%system, sum_sys, ErrStat, ErrMsg, opts=opts) IF (ErrStat /= CD_DECKDRV_OK) GOTO 900 ELSE ALLOCATE (sum_sys(0)) @@ -19889,6 +20113,8 @@ SUBROUTINE mb_imp_group_residual(mb, points, opts, g, time, res, ErrStat, ErrMsg INTEGER :: lo, hi, idx, nc, k, ir, base, n INTEGER, ALLOCATABLE :: kids(:) REAL(wp) :: fx(3), mx(3), m6b(6, 6), rhsb(6), x6(6), fenv(3), meff, arm(3), z6(6) + REAL(wp) :: fsea(3), ksea(3, 3), csea(3, 3) + LOGICAL :: sea_contact REAL(wp), ALLOCATABLE :: m6c(:, :, :), rhsc(:, :), pinw(:, :), rc(:, :), wc(:, :), amat(:, :), bvec(:), xg(:) ErrStat = CD_DECKDRV_OK @@ -19958,7 +20184,19 @@ SUBROUTINE mb_imp_group_residual(mb, points, opts, g, time, res, ErrStat, ErrMsg CALL fail_solve(ErrStat, ErrMsg, 'Free/Connect point load failed: '//TRIM(ErrMsg)); RETURN END IF ErrStat = CD_DECKDRV_OK - res(lo:hi) = meff*mb%pt_af(idx)%a - (mb%pt_af(idx)%force + fenv + mb%loads(base + 1:base + 3)) + ! the point's own seabed contact at the alpha-level state (the finite-difference + ! Jacobian of this residual carries its stiffness and damping) + CALL CD_System_Point_Seabed(mb%system, idx, mb%pt_af(idx)%q, mb%pt_af(idx)%v, sea_contact, fsea, ksea, & + csea, ErrStat, ErrMsg) + IF (ErrStat /= CD_SYSTEM_OK) THEN + CALL fail_solve(ErrStat, ErrMsg, 'Free/Connect point seabed contact failed: '//TRIM(ErrMsg)); RETURN + END IF + ErrStat = CD_DECKDRV_OK + IF (sea_contact) THEN + res(lo:hi) = meff*mb%pt_af(idx)%a - (mb%pt_af(idx)%force + fenv + fsea + mb%loads(base + 1:base + 3)) + ELSE + res(lo:hi) = meff*mb%pt_af(idx)%a - (mb%pt_af(idx)%force + fenv + mb%loads(base + 1:base + 3)) + END IF END SELECT CONTAINS SUBROUTINE cable_load(kind, obj, f, m) @@ -23036,6 +23274,7 @@ SUBROUTINE own_loads(xs, fk, mk, cen, sc_out, good) INTEGER :: kk, es_l, ib CHARACTER(1024) :: em_l TYPE(DeckRod) :: rg + LOGICAL :: ok_sea good = .FALSE. sc_out = TINY(CD_ONE)**0.25_wp @@ -23123,6 +23362,11 @@ SUBROUTINE own_loads(xs, fk, mk, cen, sc_out, good) END IF fk(:, kk) = fk(:, kk) + 0.5_wp*opts%rhoW*pts(idx(kk))%cda*NORM2(u)*u END IF + ! the point's own seabed contact (a grounded clump weight), as in the dynamics + CALL deck_point_seabed_force(pts(idx(kk))%pos, point_contact_area(pts(idx(kk))), opts, f2, ok_sea, & + ErrStat, ErrMsg, bathymetry) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + IF (ok_sea) fk(:, kk) = fk(:, kk) + f2 END SELECT END DO ! the extra (clamped-end correction) loads, at their points carried by the objects @@ -26122,6 +26366,74 @@ SUBROUTINE deck_seabed_floor_at(x, y, opts, has_floor, z_floor, ErrStat, ErrMsg, END IF END SUBROUTINE deck_seabed_floor_at + PURE REAL(wp) FUNCTION point_contact_area(pt) RESULT(area) + !! Seabed contact footprint [m^2] of a Free/Connect point (a clump weight or a buoy): the + !! area of a cube of the point's volume, V^(2/3) (the OrcaFlex 3D-buoy default contact + !! area, volume over height, for a cube), with V the displaced volume Vol or, for a point + !! declared with Mass only (a clump weight whose buoyancy is left out), the volume of + !! solid steel of that mass, Mass/7850 kg/m^3. A point with neither (a massless line + !! junction) has no footprint: its lines' end nodes carry its contact. + TYPE(DeckPoint), INTENT(IN) :: pt + REAL(wp), PARAMETER :: STEEL_DENSITY = 7850.0_wp + REAL(wp) :: vol + area = CD_ZERO + vol = pt%vol + IF (.NOT. (vol > CD_ZERO)) vol = pt%mass/STEEL_DENSITY + IF (vol > CD_ZERO) area = vol**(2.0_wp/3.0_wp) + END FUNCTION point_contact_area + + SUBROUTINE deck_point_seabed_force(pos, area, opts, force, in_contact, ErrStat, ErrMsg, bathymetry) + !! Static seabed reaction on a Free/Connect point at pos with contact footprint area: the + !! line nodes' normal penalty law (C1 touchdown blend, along the surface normal on a + !! slope, with the bathymetry crease rounding) with stiffness kBot*area, the static twin of + !! CD_System_Point_Seabed (no velocity, so no damping). in_contact is .FALSE., with force + !! exactly zero, without a seabed or footprint or clear of the floor. + REAL(wp), INTENT(IN) :: pos(3), area + TYPE(DeckOptions), INTENT(IN) :: opts + REAL(wp), INTENT(OUT) :: force(3) + LOGICAL, INTENT(OUT) :: in_contact + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry + REAL(wp) :: z_floor, dfdx, dfdy, curv(3), gap, kp, normal, tangent, jac3(3, 3) + LOGICAL :: bathy_ready + INTEGER :: es + CHARACTER(160) :: em + + force = CD_ZERO + in_contact = .FALSE. + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + kp = opts%kbot*area + IF (.NOT. (kp > CD_ZERO)) RETURN + bathy_ready = .FALSE. + IF (PRESENT(bathymetry)) bathy_ready = CD_Bathymetry_Is_Initialized(bathymetry) + dfdx = CD_ZERO + dfdy = CD_ZERO + curv = CD_ZERO + IF (bathy_ready) THEN + CALL CD_Bathymetry_Floor_Gradient(bathymetry, pos(1), pos(2), z_floor, dfdx, dfdy, es, em, & + crease_curvature=curv) + IF (es /= CD_BATHY_OK) THEN + CALL fail_solve(ErrStat, ErrMsg, 'point seabed contact: bathymetry query failed: '//TRIM(em)) + RETURN + END IF + ELSE IF (opts%has_wtrdpth) THEN + z_floor = -opts%wtrdpth + ELSE + RETURN + END IF + gap = z_floor - pos(3) + IF (gap <= -CD_SEABED_CONTACT_BLEND*SQRT(CD_ONE + dfdx*dfdx + dfdy*dfdy)) RETURN + IF (ABS(dfdx) > CD_ZERO .OR. ABS(dfdy) > CD_ZERO .OR. ANY(ABS(curv) > CD_ZERO)) THEN + CALL CD_Seabed_Normal_Contact(gap, dfdx, dfdy, kp, force, jac3, curvature=curv) + ELSE + CALL CD_Seabed_Normal_Law(gap, kp, normal, tangent) + force(3) = normal + END IF + in_contact = .TRUE. + END SUBROUTINE deck_point_seabed_force + SUBROUTINE rigid6_wet_fraction(body, opts, time, phi, ErrStat, ErrMsg) !! Submerged fraction phi of a Rigid6 body. bodyWetting sphere (default): an equivalent !! sphere of the body volume, r_e = (3 V/(4 pi))^(1/3), centred at the centre of buoyancy, @@ -31655,13 +31967,15 @@ SUBROUTINE collect_raw_init_summaries(lines, points, ne, q_all, q_off, ten_all, END DO END SUBROUTINE collect_raw_init_summaries - SUBROUTINE collect_model_init_summaries(lines, points, models, summaries, ErrStat, ErrMsg) + SUBROUTINE collect_model_init_summaries(lines, points, models, summaries, ErrStat, ErrMsg, opts) TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(CD_ModelType), INTENT(IN) :: models(:) TYPE(CD_LineInitSummary), ALLOCATABLE, INTENT(OUT) :: summaries(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg + !! opts (optional): add each line's static fold note (ei0_fold_note) + TYPE(DeckOptions), INTENT(IN), OPTIONAL :: opts TYPE(ModelOutputWorkspace) :: work INTEGER :: i, es REAL(wp) :: tension, declination, azimuth, f_first(3), fair_force(3) @@ -31687,15 +32001,18 @@ SUBROUTINE collect_model_init_summaries(lines, points, models, summaries, ErrSta END IF CALL set_init_summary(lines(i)%id, tension, declination, azimuth, summaries(i), fair_force=fair_force) END DO + IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, models, summaries) END SUBROUTINE collect_model_init_summaries - SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrStat, ErrMsg) + SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrStat, ErrMsg, opts) TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(CD_SystemType), INTENT(IN) :: system TYPE(CD_LineInitSummary), ALLOCATABLE, INTENT(OUT) :: summaries(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg + !! opts (optional): add each line's static fold note (ei0_fold_note) + TYPE(DeckOptions), INTENT(IN), OPTIONAL :: opts TYPE(ModelOutputWorkspace) :: work INTEGER :: i, es REAL(wp) :: tension, declination, azimuth, f_first(3), fair_force(3) @@ -31721,6 +32038,7 @@ SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrSt END IF CALL set_init_summary(lines(i)%id, tension, declination, azimuth, summaries(i), fair_force=fair_force) END DO + IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, system%lines, summaries) END SUBROUTINE collect_system_init_summaries SUBROUTINE collect_finite_init_summaries(lines, points, models, summaries, ErrStat, ErrMsg) @@ -31785,7 +32103,7 @@ SUBROUTINE print_deck_init_report(deck_path, lines, points, sections, n_finite, TYPE(CD_LineInitSummary), INTENT(IN) :: summaries(:) TYPE(DeckLineType), INTENT(IN), OPTIONAL :: types(:) TYPE(DeckOptions), INTENT(IN), OPTIONAL :: opts - INTEGER :: i + INTEGER :: i, a, b REAL(wp) :: f_incl CHARACTER(1024) :: strain_note @@ -31813,6 +32131,19 @@ SUBROUTINE print_deck_init_report(deck_path, lines, points, sections, n_finite, WRITE (error_unit, '(A,F9.3,A,F9.3,A,F9.3,A)') ' line tangent: inclination=', & summaries(i)%fair_inclination, ' deg, declination=', summaries(i)%fair_declination, & ' deg, azimuth=', summaries(i)%fair_azimuth, ' deg' + ! the line's static-initialisation notes (ei0_fold_note), one per text line + IF (LEN_TRIM(summaries(i)%note) > 0) THEN + a = 1 + DO + b = INDEX(summaries(i)%note(a:), NEW_LINE('a')) + IF (b == 0) THEN + WRITE (error_unit, '(A)') ' Note: '//TRIM(summaries(i)%note(a:))//'.' + EXIT + END IF + WRITE (error_unit, '(A)') ' Note: '//summaries(i)%note(a:a + b - 2)//'.' + a = a + b + END DO + END IF IF (PRESENT(types) .AND. PRESENT(opts)) THEN CALL static_strain_note(summaries(i)%line_id, summaries(i)%fair_tension, sections, types, opts, strain_note) IF (LEN_TRIM(strain_note) > 0) WRITE (error_unit, '(A)') ' Note: '//TRIM(strain_note)//'.' diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index 8bb49c75..10554bec 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -25,6 +25,7 @@ MODULE CableDyn_Model USE CableDyn_Line, ONLY: CD_Nodal_Seabed_Stiffness USE CableDyn_CableElem, ONLY: CD_Compute_Cable_Element USE CableDyn_SeabedContact, ONLY: CD_Seabed_Normal_Law, CD_Seabed_Normal_Contact, CD_Seabed_Contact_Gate, & + CD_SEABED_CONTACT_BLEND, & CD_Seabed_Friction_Stick_Slip, CD_Seabed_Friction_Aniso, & CD_Seabed_Friction_Mu_Dir, CD_FRICTION_STICK_SLIP USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Init_Bathymetry, CD_Bathymetry_Is_Initialized, & @@ -95,6 +96,7 @@ MODULE CableDyn_Model PUBLIC :: CD_Get_Model_EndNodeMassDiag PUBLIC :: CD_Get_Model_EndNodeAddedMass PUBLIC :: CD_Get_Model_EndNodeTangent + PUBLIC :: CD_Model_Seabed_Point_Load PUBLIC :: CD_Set_Model_EndQuery PUBLIC :: CD_Get_Model_EndQuery PUBLIC :: CD_Update_Model_SegmentLength @@ -7993,6 +7995,72 @@ SUBROUTINE seabed_normal_velocity_gradient(model, x, y, z, vel, node, dn_dv, Err dn_dv = dn_dvn*nvec END SUBROUTINE seabed_normal_velocity_gradient + SUBROUTINE CD_Model_Seabed_Point_Load(model, x, vel, k_n, c_n, in_contact, force, jac_q, jac_v, ErrStat, ErrMsg) + !! The line's own nodal seabed law evaluated for a point that is not one of its nodes (a + !! Free/Connect point the line is attached to): normal stiffness k_n [N/m] and one-sided + !! normal damping c_n [N.s/m] against this model's floor (flat or bathymetry, along the + !! surface normal on a slope, with the crease rounding), exactly as a line node with those + !! coefficients. force is the seabed load on the point, jac_q = -d(force)/dq and + !! jac_v = -d(force)/dv its residual tangents. in_contact is .FALSE. (and every output + !! exactly zero) when the model has no seabed or the point is clear of the contact. + TYPE(CD_ModelType), INTENT(IN) :: model + REAL(wp), INTENT(IN) :: x(3), vel(3), k_n, c_n + LOGICAL, INTENT(OUT) :: in_contact + REAL(wp), INTENT(OUT) :: force(3), jac_q(3, 3), jac_v(3, 3) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: z_floor, dfdx, dfdy, curv(3), gap, normal, tangent, gap_n, vn, nvec(3) + REAL(wp) :: damp_force, damp_dgap, damp_dvz + LOGICAL :: sloped + INTEGER :: a, b + + in_contact = .FALSE. + force = CD_ZERO + jac_q = CD_ZERO + jac_v = CD_ZERO + ErrStat = CD_MODEL_OK + ErrMsg = '' + IF (.NOT. model%has_seabed) RETURN + IF (.NOT. (k_n > CD_ZERO .OR. c_n > CD_ZERO)) RETURN + IF (model%has_bathymetry) THEN + CALL model_floor_gradient(model, x(1), x(2), z_floor, dfdx, dfdy, ErrStat, ErrMsg, curvature=curv) + IF (ErrStat /= CD_MODEL_OK) RETURN + ELSE + z_floor = model%seabed_z_floor + dfdx = CD_ZERO + dfdy = CD_ZERO + curv = CD_ZERO + END IF + gap = z_floor - x(3) + ! The normal penetration is the vertical one over s >= 1, so a point more than the + ! touchdown blend above the floor (vertically) is clear of every term below. + IF (gap <= -CD_SEABED_CONTACT_BLEND*SQRT(CD_ONE + dfdx*dfdx + dfdy*dfdy)) RETURN + IF (ABS(dfdx) > CD_ZERO .OR. ABS(dfdy) > CD_ZERO .OR. ANY(ABS(curv) > CD_ZERO)) THEN + CALL CD_Seabed_Normal_Contact(gap, dfdx, dfdy, k_n, force, jac_q, curvature=curv) + ELSE + CALL CD_Seabed_Normal_Law(gap, k_n, normal, tangent) + force(3) = normal + jac_q(3, 3) = tangent + END IF + IF (c_n > CD_ZERO) THEN + CALL node_contact_normal(model, x(1), x(2), x(3), vel, gap_n, vn, nvec, sloped, ErrStat, ErrMsg) + IF (ErrStat /= CD_MODEL_OK) THEN + force = CD_ZERO + jac_q = CD_ZERO + RETURN + END IF + CALL seabed_normal_damping_terms(gap_n, vn, c_n, damp_force, damp_dgap, damp_dvz) + force = force + damp_force*nvec + DO b = 1, 3 + DO a = 1, 3 + jac_q(a, b) = jac_q(a, b) + damp_dgap*nvec(a)*nvec(b) + jac_v(a, b) = -damp_dvz*nvec(a)*nvec(b) + END DO + END DO + END IF + in_contact = .TRUE. + END SUBROUTINE CD_Model_Seabed_Point_Load + PURE SUBROUTINE seabed_normal_damping_terms(gap, vz, c_n, force, dforce_dgap, dforce_dvz) !! One-sided normal seabed damping at normal penetration gap and normal velocity vz !! (vertical on a level floor): force = -c_n*gate(gap)*vz for vz < 0. diff --git a/src/CableDyn_System.f90 b/src/CableDyn_System.f90 index 0c33d7f4..b34ef6de 100644 --- a/src/CableDyn_System.f90 +++ b/src/CableDyn_System.f90 @@ -20,6 +20,7 @@ MODULE CableDyn_System CD_Model_Has_Friction, CD_Get_Model_Friction_Anchors, CD_Set_Model_Friction_Anchors, & CD_Get_Model_EndNodeMassDiag, CD_Get_Model_EndNodeAddedMass, & CD_Get_Model_EndNodeTangent, CD_Set_Model_EndQuery, CD_Get_Model_EndQuery, & + CD_Model_Seabed_Point_Load, & CD_Update_Model_SegmentLength, CD_ModelControlSaveType, CD_Save_Model_Control, & CD_Restore_Model_Control, & CD_Update_Model_CoupledMotion, CD_Update_Model_Interior_State, CD_Step_Model, & @@ -97,6 +98,7 @@ MODULE CableDyn_System PUBLIC :: CD_System_Junction_Rewind PUBLIC :: CD_System_Point_Base PUBLIC :: CD_System_Point_Environment + PUBLIC :: CD_System_Point_Seabed PUBLIC :: CD_Detach_System_LineEnds PUBLIC :: CD_Update_System_Line_SegmentLength PUBLIC :: CD_Save_System_Line_Control, CD_Restore_System_Line_Control @@ -152,6 +154,13 @@ MODULE CableDyn_System REAL(wp) :: fluid_acceleration(3) = CD_ZERO REAL(wp) :: waterline_z = CD_ZERO REAL(wp) :: fluid_density = CD_ZERO + ! Seabed contact of a Free/Connect point (a clump weight or a grounded buoy): normal + ! stiffness seabed_k = kBot*A [N/m] and one-sided normal damping seabed_c = cBot*A + ! [N.s/m] over its contact footprint A, applied with the line nodes' contact law + ! against the floor of a line bound to the point (CD_System_Point_Seabed). Zero: no + ! contact (the default, and every point not built from a deck footprint). + REAL(wp) :: seabed_k = CD_ZERO + REAL(wp) :: seabed_c = CD_ZERO END TYPE CD_SystemPointType TYPE :: CD_LineEndpointBinding @@ -1623,6 +1632,66 @@ SUBROUTINE CD_System_Point_Environment(point, point_velocity, force, effective_m CALL point_environment_force(point, point_velocity, force, effective_mass, ErrStat, ErrMsg) END SUBROUTINE CD_System_Point_Environment + SUBROUTINE CD_System_Point_Seabed(system, point_index, q, v, in_contact, force, jac_q, jac_v, ErrStat, ErrMsg) + !! Seabed contact load of system point point_index at position q and velocity v: the line + !! nodes' normal contact law (CD_Model_Seabed_Point_Load) with the point's own stiffness + !! seabed_k and damping seabed_c, against the floor of the first bound line that has a + !! seabed, else of any line of the system (every line of a deck shares the deck's floor). + !! jac_q = -d(force)/dq and jac_v = -d(force)/dv. in_contact is .FALSE., with every output + !! exactly zero, for a point without a footprint, in a system without a seabed, or clear of + !! the floor. + TYPE(CD_SystemType), INTENT(IN) :: system + INTEGER, INTENT(IN) :: point_index + REAL(wp), INTENT(IN) :: q(3), v(3) + LOGICAL, INTENT(OUT) :: in_contact + REAL(wp), INTENT(OUT) :: force(3), jac_q(3, 3), jac_v(3, 3) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER :: k, li, es + CHARACTER(160) :: em + + in_contact = .FALSE. + force = CD_ZERO + jac_q = CD_ZERO + jac_v = CD_ZERO + ErrStat = CD_SYSTEM_OK + ErrMsg = '' + IF (.NOT. ALLOCATED(system%points) .OR. .NOT. ALLOCATED(system%bindings)) RETURN + IF (point_index < 1 .OR. point_index > SIZE(system%points)) RETURN + IF (.NOT. (system%points(point_index)%seabed_k > CD_ZERO .OR. system%points(point_index)%seabed_c > CD_ZERO)) & + RETURN + IF (.NOT. ALLOCATED(system%lines)) RETURN + ! the floor of a bound line, or of any line of the system for a point whose lines have all + ! been detached (a line failure): a clump left without lines still rests on the seabed + li = 0 + DO k = 1, SIZE(system%bindings) + IF (system%bindings(k)%point_id /= system%points(point_index)%id) CYCLE + IF (system%bindings(k)%line_index < 1 .OR. system%bindings(k)%line_index > SIZE(system%lines)) CYCLE + IF (.NOT. system%lines(system%bindings(k)%line_index)%has_seabed) CYCLE + li = system%bindings(k)%line_index + EXIT + END DO + IF (li == 0) THEN + DO k = 1, SIZE(system%lines) + IF (.NOT. system%lines(k)%has_seabed) CYCLE + li = k + EXIT + END DO + END IF + IF (li == 0) RETURN + CALL CD_Model_Seabed_Point_Load(system%lines(li), q, v, system%points(point_index)%seabed_k, & + system%points(point_index)%seabed_c, in_contact, force, jac_q, jac_v, es, em) + IF (es /= CD_MODEL_OK) THEN + in_contact = .FALSE. + force = CD_ZERO + jac_q = CD_ZERO + jac_v = CD_ZERO + WRITE (ErrMsg, '(A,I0,A)') 'CableDyn_System: seabed contact of point ', system%points(point_index)%id, & + ' failed: '//TRIM(em) + ErrStat = system_status_from_model(es) + END IF + END SUBROUTINE CD_System_Point_Seabed + INTEGER FUNCTION CD_System_Point_Base(system, point_index) RESULT(base) !! Zero-based coupled-DOF offset of system point point_index (-1 when unbound). TYPE(CD_SystemType), INTENT(IN) :: system @@ -1646,7 +1715,8 @@ SUBROUTINE CD_Step_System_DynamicPoints(system, dt, converged, stalled, n_iter, INTEGER :: p, base, es, k REAL(wp) :: ma_blk(3, 3), k_blk(3, 3), c_blk(3, 3), rhs3(3), kv_nbr(3) - LOGICAL :: solve_ok + REAL(wp) :: sea_f(3), sea_k(3, 3), sea_c(3, 3) + LOGICAL :: solve_ok, sea_contact LOGICAL, ALLOCATABLE :: integ(:) CHARACTER(1024) :: em @@ -1798,6 +1868,19 @@ SUBROUTINE CD_Step_System_DynamicPoints(system, dt, converged, stalled, n_iter, MATMUL(ma_blk, system%a_work(base + 1:base + 3)) - & dt*(MATMUL(k_blk, system%v_work(base + 1:base + 3)) - kv_nbr) ma_blk = ma_blk + dt*c_blk + dt*dt*k_blk + ! The point's own seabed contact, linearised about the step start like the end + ! blocks: F(q+, v+) = F - K (dt v + dt^2 a+) - C dt a+ (K = -dF/dq, C = -dF/dv), so + ! a light point on a stiff footprint does not bounce. Nothing is added off the floor. + CALL CD_System_Point_Seabed(system, p, system%q_work(base + 1:base + 3), system%v_work(base + 1:base + 3), & + sea_contact, sea_f, sea_k, sea_c, es, em) + IF (es /= CD_SYSTEM_OK) THEN + CALL restore_failed_dynamic_points(system, system%point_rollback, es, em, ErrStat, ErrMsg) + RETURN + END IF + IF (sea_contact) THEN + rhs3 = rhs3 + sea_f - dt*MATMUL(sea_k, system%v_work(base + 1:base + 3)) + ma_blk = ma_blk + dt*sea_c + dt*dt*sea_k + END IF DO k = 1, 3 ma_blk(k, k) = ma_blk(k, k) + system%point_mass_work(p) END DO @@ -2866,7 +2949,8 @@ SUBROUTINE validate_points(points, ErrStat, ErrMsg) CD_All_Finite(points(i)%a) .AND. CD_All_Finite(points(i)%force) .AND. & CD_Is_Finite(points(i)%mass) .AND. & CD_Is_Finite(points(i)%volume) .AND. CD_Is_Finite(points(i)%cda) .AND. & - CD_Is_Finite(points(i)%ca))) THEN + CD_Is_Finite(points(i)%ca) .AND. CD_Is_Finite(points(i)%seabed_k) .AND. & + CD_Is_Finite(points(i)%seabed_c))) THEN CALL fail(ErrStat, ErrMsg, 'point state and load properties must be finite') RETURN END IF @@ -2883,6 +2967,10 @@ SUBROUTINE validate_points(points, ErrStat, ErrMsg) CALL fail(ErrStat, ErrMsg, 'point volume, CdA, and Ca must be non-negative') RETURN END IF + IF (points(i)%seabed_k < CD_ZERO .OR. points(i)%seabed_c < CD_ZERO) THEN + CALL fail(ErrStat, ErrMsg, 'point seabed contact stiffness and damping must be non-negative') + RETURN + END IF DO j = i + 1, SIZE(points) IF (points(j)%id == points(i)%id) THEN CALL fail(ErrStat, ErrMsg, 'point ids must be unique') diff --git a/tests/data/ei0_fold_slope.dat b/tests/data/ei0_fold_slope.dat new file mode 100644 index 00000000..436e7e3d --- /dev/null +++ b/tests/data/ei0_fold_slope.dat @@ -0,0 +1,29 @@ +--------------------- CableDyn Input File ------------------------------------ +Chain on a 5 deg frictionless slope falling past its anchor: the grounded run slides 24 m past the anchor and folds back (noted) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -10.0 +2 Fixed 450.0 0.0 -300.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 700.0 70 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +ei0_fold_slope_bathy.txt bathymetryFile +1.0e5 kBot +1.0e4 cBot +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ---------------------------------------------------- diff --git a/tests/data/ei0_fold_slope_bathy.txt b/tests/data/ei0_fold_slope_bathy.txt new file mode 100644 index 00000000..4b3d924b --- /dev/null +++ b/tests/data/ei0_fold_slope_bathy.txt @@ -0,0 +1,27 @@ +# x y depth: a plane falling 5 deg toward +x, depth = 260.630101 + tan(5 deg) x +-300.0 -300.0 234.383502 +-300.0 300.0 234.383502 +-200.0 -300.0 243.132369 +-200.0 300.0 243.132369 +-100.0 -300.0 251.881235 +-100.0 300.0 251.881235 +0.0 -300.0 260.630101 +0.0 300.0 260.630101 +100.0 -300.0 269.378968 +100.0 300.0 269.378968 +200.0 -300.0 278.127834 +200.0 300.0 278.127834 +300.0 -300.0 286.876700 +300.0 300.0 286.876700 +400.0 -300.0 295.625567 +400.0 300.0 295.625567 +500.0 -300.0 304.374433 +500.0 300.0 304.374433 +600.0 -300.0 313.123300 +600.0 300.0 313.123300 +700.0 -300.0 321.872166 +700.0 300.0 321.872166 +800.0 -300.0 330.621032 +800.0 300.0 330.621032 +900.0 -300.0 339.369899 +900.0 300.0 339.369899 diff --git a/tests/data/ei0_hairpin_current.dat b/tests/data/ei0_hairpin_current.dat new file mode 100644 index 00000000..4dd89a1f --- /dev/null +++ b/tests/data/ei0_hairpin_current.dat @@ -0,0 +1,32 @@ +--------------------- CableDyn Input File ------------------------------------ +Chain pushed 20 m past its anchor by a 2 m/s current along its plane on a frictionless seabed (a hairpin, noted) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -10.0 +2 Fixed 450.0 0.0 -100.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 520.0 52 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +100.0 WtrDpth +1.0e5 kBot +1.0e4 cBot +0.05 dtM +0.0 TMax +uniform 2.0 0 0 current +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ---------------------------------------------------- diff --git a/tests/test_point_seabed_contact.f90 b/tests/test_point_seabed_contact.f90 new file mode 100644 index 00000000..6184ae69 --- /dev/null +++ b/tests/test_point_seabed_contact.f90 @@ -0,0 +1,318 @@ +! File: tests/test_point_seabed_contact.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_point_seabed_contact + !! Seabed contact of Free/Connect points, and the fold note of EI = 0 lines. + !! + !! A 50 t clump weight (Mass only, Vol = 0) joins two polyester lines on the seabed. Its + !! footprint is A = (Mass/7850)^(2/3) (the volume of solid steel of that mass), so its own + !! contact has the stiffness kBot*A. Without it only the two line end nodes held the clump + !! and it sank 2.8 m below the seabed. Checked on every route that steps the point: + !! * the static equilibrium (TMax = 0, multibody march): the clump rests within the + !! penetration of its own footprint, 0 < pen <= W/(kBot*A), and its contact reaction + !! kBot*A*pen balances its weight with the line forces on it (Point

Fz); + !! * the dynamic march, monolithic and staggered (the point system step), from that + !! equilibrium: the clump stays at rest; + !! * the OpenFAST aggregate (the coupled point step): the clump stays at rest; + !! * a sloped structured seabed: the clump rests on the bathymetry, also at rest in the + !! march. + !! An EI = 0 line pushed past its anchor by a current on a frictionless seabed (a hairpin) + !! is kept and named by a note; through the OpenFAST aggregate the note is returned with + !! the line's initialisation report (CD_AGG_GetInitLine). + USE CableDyn_Precision, ONLY: wp + USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK + USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_GetInitLine, & + CD_AGG_EvalChannel, CD_AGG_GetMovingPointMesh, CD_AGG_Step_Moving, & + CD_AGG_CalcOutput, CD_AGG_End, CD_AGG_OK + USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE + IMPLICIT NONE + + REAL(wp), PARAMETER :: G = 9.80665_wp, KBOT = 1.0e5_wp, MASS = 50000.0_wp, STEEL = 7850.0_wp + ! columns of the .out rows: Time, FairTen1, AnchTen1, FairTen2, AnchTen2, Point3Fx/Fy/Fz, Point3px/py/pz + INTEGER, PARAMETER :: NCOL = 11 + INTEGER :: failures + REAL(wp) :: area, k_clump, w_clump + + failures = 0 + area = (MASS/STEEL)**(2.0_wp/3.0_wp) + k_clump = KBOT*area + w_clump = MASS*G + + CALL case_flat_static() + CALL case_flat_march('monolithic') + CALL case_flat_march('staggered') + CALL case_slope() + CALL case_flat_aggregate() + CALL case_fold_note_aggregate() + + IF (failures /= 0) THEN + WRITE (*, '(A,I0,A)') 'test_point_seabed_contact: ', failures, ' failure(s)' + ERROR STOP 1 + END IF + WRITE (*, '(A)') 'test_point_seabed_contact: all checks passed' + +CONTAINS + + SUBROUTINE case_flat_static() + REAL(wp), ALLOCATABLE :: rows(:, :) + REAL(wp) :: pen, residual + INTEGER :: es + LOGICAL :: conv + CHARACTER(512) :: em + + CALL write_clump_deck('point_seabed_flat_static.dat', '0.0', '', .FALSE.) + CALL CD_Run_Deck_Driver('point_seabed_flat_static.dat', 'point_seabed_flat_static', conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'flat static: run: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) RETURN + CALL read_rows('point_seabed_flat_static.out', rows) + IF (SIZE(rows, 2) < 1) THEN + CALL require(.FALSE., 'flat static: no output row') + RETURN + END IF + pen = -200.0_wp - rows(11, 1) + WRITE (*, '(A,F8.4,A,F8.4,A)') ' flat seabed: clump ', pen, ' m below the seabed (footprint limit ', & + w_clump/k_clump, ' m)' + ! base behaviour: 2.8 m, held by the two line end nodes only + CALL require(pen > 0.0_wp, 'flat static: the clump rests on the seabed') + CALL require(pen <= w_clump/k_clump, 'flat static: the clump rests within the penetration of its footprint') + ! weight = line forces on the point + the footprint's reaction (Point3Fz is printed to 8 digits) + residual = rows(8, 1) + k_clump*pen - w_clump + CALL require(ABS(residual) <= 1.0e-4_wp*w_clump, 'flat static: the footprint reaction kBot*A*pen balances '// & + 'the clump with its lines') + END SUBROUTINE case_flat_static + + SUBROUTINE case_flat_march(scheme) + CHARACTER(*), INTENT(IN) :: scheme + REAL(wp), ALLOCATABLE :: rows(:, :) + INTEGER :: es + LOGICAL :: conv + CHARACTER(512) :: em + CHARACTER(64) :: root + + root = 'point_seabed_flat_'//scheme + CALL write_clump_deck(TRIM(root)//'.dat', '2.0', scheme, .FALSE.) + CALL CD_Run_Deck_Driver(TRIM(root)//'.dat', TRIM(root), conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'flat '//scheme//' march: run: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) RETURN + CALL read_rows(TRIM(root)//'.out', rows) + CALL require(SIZE(rows, 2) > 10, 'flat '//scheme//' march: output rows') + IF (SIZE(rows, 2) < 2) RETURN + CALL require(ALL(IEEE_IS_FINITE(rows)), 'flat '//scheme//' march: finite outputs') + CALL require(-200.0_wp - rows(11, 1) > 0.0_wp .AND. -200.0_wp - rows(11, 1) <= w_clump/k_clump, & + 'flat '//scheme//' march: the clump starts on its footprint') + CALL require(MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))) < 1.0e-3_wp, & + 'flat '//scheme//' march: the clump stays at rest on the seabed') + END SUBROUTINE case_flat_march + + SUBROUTINE case_slope() + REAL(wp), ALLOCATABLE :: rows(:, :) + REAL(wp) :: floor_z, gap, s + INTEGER :: es, u + LOGICAL :: conv + CHARACTER(512) :: em + + ! a plane rising 2 % toward +x under the whole line, depth 200 m at x = 450 m + OPEN (NEWUNIT=u, FILE='point_seabed_slope_bathy.txt', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '-100.0 -100.0 211.0' + WRITE (u, '(A)') '-100.0 100.0 211.0' + WRITE (u, '(A)') '900.0 -100.0 191.0' + WRITE (u, '(A)') '900.0 100.0 191.0' + CLOSE (u) + CALL write_clump_deck('point_seabed_slope.dat', '1.0', 'staggered', .TRUE.) + CALL CD_Run_Deck_Driver('point_seabed_slope.dat', 'point_seabed_slope', conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'slope: run: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) RETURN + CALL read_rows('point_seabed_slope.out', rows) + CALL require(SIZE(rows, 2) > 10, 'slope: output rows') + IF (SIZE(rows, 2) < 2) RETURN + floor_z = -(211.0_wp - 0.02_wp*(rows(9, 1) + 100.0_wp)) + gap = floor_z - rows(11, 1) + s = SQRT(1.0_wp + 0.02_wp**2) + WRITE (*, '(A,F8.4,A)') ' sloped seabed: clump ', gap, ' m below the seabed' + ! the normal law pushes along the surface normal with k*gap/s, whose vertical part k*gap/s^2 + ! (with the lines' share) carries the weight + CALL require(gap > 0.0_wp .AND. gap <= s*s*w_clump/k_clump, 'slope: the clump rests on its footprint') + CALL require(MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))) < 1.0e-3_wp, & + 'slope: the clump stays at rest on the sloped seabed') + END SUBROUTINE case_slope + + SUBROUTINE case_flat_aggregate() + !! The OpenFAST aggregate (the coupled point step): the clump starts on its footprint and + !! stays at rest with the fairlead held. Channel 10 is Point3pz. + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), PARAMETER :: DT = 0.05_wp + REAL(wp) :: r0(3, 1), v0(3, 1), a0(3, 1), l0(3, 1), z0, z, zmax_dev + INTEGER :: es, s, n_iter + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_clump_deck('point_seabed_agg.dat', '0.0', '', .FALSE.) + CALL CD_AGG_Init_From_Deck(agg, 'point_seabed_agg.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'aggregate clump: init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_EvalChannel(agg, 10, z0, es, em) + CALL require(es == CD_AGG_OK, 'aggregate clump: Point3pz: '//TRIM(em)) + CALL require(-200.0_wp - z0 > 0.0_wp .AND. -200.0_wp - z0 <= w_clump/k_clump, & + 'aggregate clump: the clump starts on its footprint') + CALL CD_AGG_GetMovingPointMesh(agg, r0, v0, a0, l0, es, em) + CALL require(es == CD_AGG_OK, 'aggregate clump: moving mesh: '//TRIM(em)) + v0 = 0.0_wp + a0 = 0.0_wp + zmax_dev = 0.0_wp + DO s = 1, 40 + CALL CD_AGG_Step_Moving(agg, DT, r0, v0, a0, cv, st, n_iter, es, em) + CALL require(es == CD_AGG_OK .AND. cv, 'aggregate clump: step: '//TRIM(em)) + IF (es /= CD_AGG_OK) EXIT + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_EvalChannel(agg, 10, z, es, em) + zmax_dev = MAX(zmax_dev, ABS(z - z0)) + END DO + CALL require(zmax_dev < 1.0e-3_wp, 'aggregate clump: the clump stays at rest on the seabed') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_flat_aggregate + + SUBROUTINE case_fold_note_aggregate() + !! The hairpin of an EI = 0 line through the OpenFAST aggregate: kept, and named in the + !! line's initialisation report. + TYPE(CD_AGG_ModuleType) :: agg + INTEGER :: es, u, line_id + REAL(wp) :: ten, force(3), incl, decl, azi + CHARACTER(512) :: em + CHARACTER(1024) :: note + + OPEN (NEWUNIT=u, FILE='point_seabed_hairpin.dat', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '--------------------- CableDyn Input File ---' + WRITE (u, '(A)') 'Chain pushed past its anchor by a 2 m/s current on a frictionless seabed' + WRITE (u, '(A)') '--------------------- LINE TYPES ---' + WRITE (u, '(A)') 'TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'chain 0.216 286.56 1229760000 -1 0 1.37 0.64 1 0' + WRITE (u, '(A)') '--------------------- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Coupled 0 0 -10 0 0 0 0' + WRITE (u, '(A)') '2 Fixed 450 0 -100 0 0 0 0' + WRITE (u, '(A)') '--------------------- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--------------------- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 chain 520 52' + WRITE (u, '(A)') '--------------------- OPTIONS ---' + WRITE (u, '(A)') '100.0 WtrDpth' + WRITE (u, '(A)') 'uniform 2.0 0 0 current' + WRITE (u, '(A)') '--------------------- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1' + WRITE (u, '(A)') '--------------------- need this line ---' + CLOSE (u) + CALL CD_AGG_Init_From_Deck(agg, 'point_seabed_hairpin.dat', 0.05_wp, es, em) + CALL require(es == CD_AGG_OK, 'aggregate hairpin: init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetInitLine(agg, 1, line_id, ten, force, incl, decl, azi, es, em, note=note) + CALL require(es == CD_AGG_OK .AND. line_id == 1, 'aggregate hairpin: init report') + CALL require(INDEX(note, 'the static layout carries the grounded run') > 0 .AND. & + INDEX(note, 'past its anchor') > 0 .AND. INDEX(note, 'the current drives the run') > 0, & + 'aggregate hairpin: the line report carries the fold note: '//TRIM(note)) + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_fold_note_aggregate + + SUBROUTINE write_clump_deck(path, tmax, scheme, sloped) + !! The 50 t clump (deck point 3, Mass only) between two polyester lines on a 200 m seabed. + CHARACTER(*), INTENT(IN) :: path, tmax, scheme + LOGICAL, INTENT(IN) :: sloped + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '--------------------- CableDyn Input File ---' + WRITE (u, '(A)') 'Heavy clump weight resting on the seabed between two polyester lines' + WRITE (u, '(A)') '--------------------- LINE TYPES ---' + WRITE (u, '(A)') 'TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'poly 0.172 31.916 200000000 -1 0 1.2 0.008 1 0' + WRITE (u, '(A)') '--------------------- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Coupled 0 0 -10 0 0 0 0' + IF (sloped) THEN + WRITE (u, '(A)') '2 Fixed 800 0 -193 0 0 0 0' + ELSE + WRITE (u, '(A)') '2 Fixed 800 0 -200 0 0 0 0' + END IF + WRITE (u, '(A)') '3 Connect 450 0 -190 50000 0 0 0' + WRITE (u, '(A)') '--------------------- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 3 -' + WRITE (u, '(A)') '2 3 2 -' + WRITE (u, '(A)') '--------------------- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 poly 520 52' + WRITE (u, '(A)') '2 poly 360 36' + WRITE (u, '(A)') '--------------------- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + IF (sloped) THEN + WRITE (u, '(A)') 'point_seabed_slope_bathy.txt bathymetryFile' + ELSE + WRITE (u, '(A)') '200.0 WtrDpth' + END IF + WRITE (u, '(A)') '100000.0 kBot' + WRITE (u, '(A)') '1.0e4 cBot' + WRITE (u, '(A)') '0.05 dtM' + WRITE (u, '(A)') tmax//' TMax' + IF (LEN_TRIM(scheme) > 0) WRITE (u, '(A)') scheme//' bodyScheme' + WRITE (u, '(A)') '--------------------- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1' + WRITE (u, '(A)') 'AnchTen1' + WRITE (u, '(A)') 'FairTen2' + WRITE (u, '(A)') 'AnchTen2' + WRITE (u, '(A)') 'Point3Fx' + WRITE (u, '(A)') 'Point3Fy' + WRITE (u, '(A)') 'Point3Fz' + WRITE (u, '(A)') 'Point3px' + WRITE (u, '(A)') 'Point3py' + WRITE (u, '(A)') 'Point3pz' + WRITE (u, '(A)') '--------------------- need this line ---' + CLOSE (u) + END SUBROUTINE write_clump_deck + + SUBROUTINE read_rows(path, rows) + !! The numeric rows of a driver .out file (two header lines), one column per row entry. + CHARACTER(*), INTENT(IN) :: path + REAL(wp), ALLOCATABLE, INTENT(OUT) :: rows(:, :) + REAL(wp) :: row(NCOL) + REAL(wp), ALLOCATABLE :: tmp(:, :) + INTEGER :: u, ios, n + CHARACTER(4096) :: buf + ALLOCATE (rows(NCOL, 0)) + OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios) + CALL require(ios == 0, 'open '//path) + IF (ios /= 0) RETURN + READ (u, '(A)', IOSTAT=ios) buf + READ (u, '(A)', IOSTAT=ios) buf + n = 0 + DO + READ (u, '(A)', IOSTAT=ios) buf + IF (ios /= 0) EXIT + READ (buf, *, IOSTAT=ios) row + IF (ios /= 0) EXIT + n = n + 1 + ALLOCATE (tmp(NCOL, n)) + tmp(:, 1:n - 1) = rows + tmp(:, n) = row + CALL MOVE_ALLOC(tmp, rows) + END DO + CLOSE (u) + END SUBROUTINE read_rows + + SUBROUTINE require(ok, label) + LOGICAL, INTENT(IN) :: ok + CHARACTER(*), INTENT(IN) :: label + IF (ok) RETURN + failures = failures + 1 + WRITE (*, '(A)') 'FAIL: '//TRIM(label) + END SUBROUTINE require + +END PROGRAM test_point_seabed_contact diff --git a/tests/test_shared_anchor.f90 b/tests/test_shared_anchor.f90 index d45c27ed..f7bda633 100644 --- a/tests/test_shared_anchor.f90 +++ b/tests/test_shared_anchor.f90 @@ -7,8 +7,9 @@ PROGRAM test_shared_anchor !! anchor resultant Point4F equals the sum of the three single-line decks' anchor forces !! (a Fixed anchor couples nothing) in statics and in a dynamic run with one fairlead !! driven by a motionFile, and each single-line anchor force has the AnchTen magnitude; - !! 2. a Free clump shared by the three lines: its line resultant balances its submerged - !! weight, Point4F + (rhoW V - m) g e3 = 0. + !! 2. a Free clump shared by the three lines, resting on the seabed: its line resultant and + !! its own seabed reaction (kBot A pen over its footprint A = Vol^(2/3)) balance its + !! submerged weight, Point4F + kBot A pen e3 + (rhoW V - m) g e3 = 0. !! 3. the same three fairleads written as Turbine points of a TURBINES section (reference !! position, turbine-local fairlead) and driven by per-turbine rigid-body motion records !! reproduce the Coupled-point deck. @@ -18,7 +19,7 @@ PROGRAM test_shared_anchor USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE IMPLICIT NONE - REAL(wp), PARAMETER :: RHO_W = 1025.0_wp, GRAV = 9.80665_wp + REAL(wp), PARAMETER :: RHO_W = 1025.0_wp, GRAV = 9.80665_wp, KBOT = 1.0e5_wp ! the default kBot REAL(wp), PARAMETER :: FAIR(3, 3) = RESHAPE([0.0_wp, 0.0_wp, -10.0_wp, 600.0_wp, 0.0_wp, -10.0_wp, & 300.0_wp, 519.615242_wp, -10.0_wp], [3, 3]) REAL(wp), PARAMETER :: ANCHOR(3) = [300.0_wp, 173.205081_wp, -100.0_wp] @@ -128,6 +129,7 @@ SUBROUTINE write_deck(path, which, clump, dynamic, motion) IF (which(j)) WRITE (u, '(A,I0)') 'AnchTen', j END DO WRITE (u, '(A)') 'Point4Fx Point4Fy Point4Fz Point4FH' + IF (clump) WRITE (u, '(A)') 'Point4pz' WRITE (u, '(A)') '--- end ---' CLOSE (u) END SUBROUTINE write_deck @@ -328,15 +330,21 @@ END SUBROUTINE expect_reject SUBROUTINE check_free_clump() REAL(wp), ALLOCATABLE :: d(:, :) - REAL(wp) :: w_sub, err + REAL(wp) :: w_sub, err, pen LOGICAL :: ok CALL write_deck('shared_clump.dat', [.TRUE., .TRUE., .TRUE.], .TRUE., .TRUE., .FALSE.) - CALL run('shared_clump.dat', 'shared_clump', 8, d, ok) + CALL run('shared_clump.dat', 'shared_clump', 9, d, ok) IF (.NOT. ok) RETURN w_sub = (20000.0_wp - RHO_W*2.0_wp)*GRAV - err = NORM2(d(5:7, 1) + [0.0_wp, 0.0_wp, -w_sub])/w_sub - WRITE (*, '(A,ES11.3)') 'shared Free clump: |F_lines + submerged weight|/weight = ', err - CALL require(err <= 1.0e-6_wp, 'shared free point: line resultant balances the submerged weight') + ! the clump rests on the 100 m seabed on its own footprint, (2 m^3)^(2/3) + pen = -100.0_wp - d(9, 1) + CALL require(pen > 0.0_wp .AND. pen <= w_sub/(KBOT*2.0_wp**(2.0_wp/3.0_wp)), & + 'shared free point: the clump rests on its footprint') + err = NORM2(d(5:7, 1) + [0.0_wp, 0.0_wp, KBOT*2.0_wp**(2.0_wp/3.0_wp)*MAX(pen, 0.0_wp) - w_sub])/w_sub + WRITE (*, '(A,ES11.3)') 'shared Free clump: |F_lines + seabed reaction + submerged weight|/weight = ', err + ! the depth is printed to 8 digits (1e-5 m at 100 m), and kBot A 1e-5 m is 1e-5 of the weight + CALL require(err <= 2.0e-5_wp, 'shared free point: line resultant and seabed reaction balance the '// & + 'submerged weight') END SUBROUTINE check_free_clump END PROGRAM test_shared_anchor diff --git a/tests/test_statics_robustness.py b/tests/test_statics_robustness.py index 465a8ca1..4975d085 100644 --- a/tests/test_statics_robustness.py +++ b/tests/test_statics_robustness.py @@ -607,7 +607,8 @@ def evaluate(case, exe): def check_points(case, row): - """Every Free/Connect point is at rest: the line-end forces balance its weight/buoyancy.""" + """Every Free/Connect point is at rest: the line-end forces and its own seabed contact balance its + weight/buoyancy.""" for p in case["points"]: if p["type"] not in ("Free", "Connect"): continue @@ -633,6 +634,13 @@ def check_points(case, row): if P[end][2] < zf: net[2] += 0.5 * case["kbot"] * t["d"] * l0 * (zf - P[end][2]) scale = max(scale, te) + # ... and by its own contact over its footprint A = V^(2/3) (V = Vol, or Mass/7850 kg/m^3), + # the line law along the floor normal + vol = p.get("vol", 0.0) if p.get("vol", 0.0) > 0.0 else p.get("mass", 0.0) / 7850.0 + zf, gx, gy = case["floor"](*pos[:2]) + if vol > 0.0 and pos[2] < zf: + s = math.sqrt(1.0 + gx * gx + gy * gy) + net += case["kbot"] * vol ** (2.0 / 3.0) * (zf - pos[2]) / s * np.array([-gx, -gy, 1.0]) / s check(np.linalg.norm(net) < 1e-3 * scale, "%s: point %d force balance %.3g of %.3g N" % (case["name"], p["id"], np.linalg.norm(net), scale)) From 334e50acf57687bd6b2c106ab90a171107cbbe2a Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 16 Oct 2026 18:37:52 +0900 Subject: [PATCH 2/5] fix(points): seabed contact for Point3 buoys; fold-note remedy follows the static friction A Point3 buoy steps as the Free point of its Body attachment with the BODY Mass and Vol, but that point kept its body type and so had no seabed contact. It now carries the same footprint contact as a Free/Connect point, A = V^(2/3) with V = Vol or Mass/7850, in the staggered and monolithic marches and the coupled point step of the OpenFAST aggregate and the C API, with the same contact law and Jacobian. The static solve still does not place a Point3 buoy. The EI = 0 fold note now bases its remedy on the deck's static seabed friction and on what the route accepts: frictionMu against a current, staticsFriction asLaid on a slope (with the default policy the static solve applies friction against a deck current only), and a shorter line where friction already acts or the route rejects it. A run that staticsFriction asLaid lays past its end along layAzimuth is not noted. The cause names a deck current acting anywhere on the line, not only at the fold node, and a slope steeper than 0.5 degrees. The past-the-end test needs a horizontal span of at least a tenth of the water depth. The OpenFAST initialisation report prints each line's static-initialisation notes, so the fold note and the finite-EI cable notes reach OpenFAST users. The docstrings of the line summary note and CD_AGG_GetInitLine now describe both kinds of note. The footprint is described as CableDyn's own area-equivalent of a compact body, with no claim about another code's defaults. The options and driver-format pages name the point footprint for cBot as well as kBot. The header of clump_weight_free_point.dat says that the clump now rests on the seabed, with the chain carrying half its net weight. Tests: a Point3 buoy set at the clump's static position stays at rest in the staggered and monolithic marches and the aggregate step (it drifts 2.8 m without its contact), the clump rests on a slope in the monolithic march as well, a buoy tethered clear of the seabed sees no contact, and the fold note stays silent on a current deck with frictionMu, a slope with as-laid friction, a run laid past the anchor by layAzimuth, and two lines through a grounded clump. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 35 +++- CMakeLists.txt | 36 ++-- doc/driver_format.md | 7 +- doc/openfast.rst | 3 +- doc/options.rst | 10 +- doc/theory.rst | 75 +++++---- doc/troubleshooting.rst | 12 +- examples/clump_weight_free_point.dat | 9 +- src/CableDyn_DeckDriver.f90 | 157 ++++++++++++----- src/CableDyn_OpenFAST_Aggregate.f90 | 3 +- src/openfast/CableDyn_OF.f90 | 17 +- tests/data/ei0_aslaid_behind_anchor.dat | 34 ++++ tests/data/ei0_clump_no_fold.dat | 35 ++++ tests/data/ei0_fold_slope_aslaid.dat | 33 ++++ tests/data/ei0_hairpin_current_friction.dat | 33 ++++ tests/test_point_seabed_contact.f90 | 177 +++++++++++++++++--- 16 files changed, 543 insertions(+), 133 deletions(-) create mode 100644 tests/data/ei0_aslaid_behind_anchor.dat create mode 100644 tests/data/ei0_clump_no_fold.dat create mode 100644 tests/data/ei0_fold_slope_aslaid.dat create mode 100644 tests/data/ei0_hairpin_current_friction.dat diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dd34ce7..b6578055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -185,14 +185,21 @@ All notable changes to CableDyn are recorded in this file. The format follows the manual's deck format page (CONTROL). - A note when the static layout of an `EI = 0` line folds back on the seabed (a hairpin), the twin of the finite-EI note. A current toward the anchor or a seabed falling past it can carry - the grounded run of a tension-only line past its anchor on a frictionless seabed, where it - folds back with zero tension at the fold: a 2 m/s current carried a chain 20 m past its anchor, - a 5° slope 24 m, without a word. The equilibrium is kept, and one note per line names the fold - (the distance past the anchor, or a turn above 150° of the grounded run), its cause at the - fold (the current, the slope, or a slack run) and the remedy (seabed friction or a shorter - line). It is printed on the static, `TMax = 0`, point-system and multibody routes and returned - in the line report of the OpenFAST aggregate. No example deck prints it, and no result - changes. See the manual's theory page (EI = 0 path) and Troubleshooting. + the grounded run of a tension-only line past its anchor where no seabed friction holds it, + and it folds back with zero tension at the fold: a 2 m/s current carried a chain 20 m past its + anchor, a 5° slope 24 m, without a word. The equilibrium is kept, and one note per line names + the fold (the distance past the anchor, or a turn above 150° of the grounded run), its cause + (a deck current on the line, a seabed steeper than 0.5° at the fold, or a slack run) and the + remedy that fits the deck's static friction: `frictionMu` against a current, + `staticsFriction asLaid` on a slope (with the default `staticsFriction none` the static solve + applies friction against a deck current only), or a shorter line where friction already acts + or the route rejects it. A run that `staticsFriction asLaid` lays past its anchor along + `layAzimuth` is not noted, nor is a near-vertical line (horizontal span under a tenth of the + water depth) past its end. It is printed on the static, `TMax = 0`, point-system and + multibody routes and in the OpenFAST initialisation report, which now also prints the + initialisation notes of finite-EI cables, and returned in the line report of the OpenFAST + aggregate. No example deck prints it, and no result changes. See the manual's theory page + (EI = 0 path) and Troubleshooting. ### Changed @@ -655,6 +662,18 @@ All notable changes to CableDyn are recorded in this file. The format follows staggered and OpenFAST point steps; MoorDyn points have no seabed contact. The 50 t clump now rests 0.95 m deep (its weight alone presses its 3.44 m² footprint in by 1.43 m) and the 20 t clump 0.67 m. The point routes still reject `frictionMu`, so the contact is frictionless. +- `Free` and `Connect` points (clump weights, buoys) and `Point3` buoys now have their own + seabed contact. Until now only the end nodes of the attached lines held a point on the + seabed, over their tributary length, so a heavy clump sank silently into it: a 50 t clump + between two polyester lines ended 2.8 m below the seabed, a 20 t clump on chain 1.0 m. A + point with `Mass` or `Vol` (a `Point3` buoy: its BODY `Mass` and `Vol`) now rests on a + footprint `A = V^(2/3)` (`V` = `Vol`, or `Mass`/7850 kg/m³ for a clump declared by its mass + alone), the face area of a cube of its volume, with the line contact law, stiffness `kBot·A` + and damping `cBot·A`, along the surface normal on a bathymetry, in the point static + equilibrium (which does not place a `Point3` buoy) and in the monolithic, staggered and + OpenFAST/C API point steps. The 50 t clump now rests 0.95 m deep (its weight alone presses + its 3.44 m² footprint in by 1.43 m) and the 20 t clump 0.67 m. The point routes still reject + `frictionMu`, so the contact is frictionless. Results change only where a point touches the seabed: of the examples only `clump_weight_free_point.dat`, whose clump now rests 4.7 cm deep instead of 6.6 cm and whose anchor tension falls from 186 kN to 92 kN; decks whose points stay clear of the seabed give diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ef297f4..a1e6f380 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2108,13 +2108,16 @@ add_test(NAME driver_advisories set_tests_properties(driver_advisories PROPERTIES LABELS "fortran;driver;integration") # The fold note of an EI = 0 line, once per folded line and never on a usual layout: a current # that pushes the grounded run 20 m past its anchor (TMax = 0, the line-model route), a seabed -# sloping down past the anchor (static run over a bathymetry), and a grounded chain that does -# not fold. +# sloping down past the anchor (static run over a bathymetry), each with the remedy that fits +# the deck's friction, and no note on a grounded chain that does not fold, on the same current +# deck with frictionMu, on the same slope with as-laid friction, on a run the deck itself lays +# past its anchor (staticsFriction asLaid along layAzimuth), or on two lines through a clump +# resting on the seabed. add_test(NAME driver_ei0_fold_note_current COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_hairpin_current.dat|hairpin" "-DONCE=Note: line 1: the static layout carries the grounded run 20\\.[0-9]+ m past its anchor, where it folds back;the current drives the run along the seabed, which holds it only by friction" - "-DMUST_MATCH=seabed friction or a shorter line prevents it" + "-DMUST_MATCH=seabed friction \\(frictionMu\\) or a shorter line prevents it" -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_current -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) set_tests_properties(driver_ei0_fold_note_current PROPERTIES LABELS "fortran;driver;integration;static") @@ -2122,17 +2125,28 @@ add_test(NAME driver_ei0_fold_note_slope COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_fold_slope.dat|slope" "-DONCE=Note: line 1: the static layout carries the grounded run 2[0-9]\\.[0-9]+ m past its anchor, where it folds back;the seabed slope drives the run downhill" + "-DMUST_MATCH=frictionMu with staticsFriction asLaid\\) or a shorter line prevents it" -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_slope -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) set_tests_properties(driver_ei0_fold_note_slope PROPERTIES LABELS "fortran;driver;integration;static") -add_test(NAME driver_ei0_no_fold_note - COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 - "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/examples/chain_catenary_shallow_30m.dat|shallow" - "-DONCE=converged run written" - "-DMUST_NOT=folds back|a hairpin" - -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_no_fold_note - -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) -set_tests_properties(driver_ei0_no_fold_note PROPERTIES LABELS "fortran;driver;integration;static") +foreach(_deck IN ITEMS examples/chain_catenary_shallow_30m tests/data/ei0_hairpin_current_friction + tests/data/ei0_fold_slope_aslaid tests/data/ei0_aslaid_behind_anchor + tests/data/ei0_clump_no_fold) + get_filename_component(_name "${_deck}" NAME) + if(_name STREQUAL "chain_catenary_shallow_30m") + set(_test driver_ei0_no_fold_note) + else() + set(_test driver_ei0_no_fold_note_${_name}) + endif() + add_test(NAME ${_test} + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/${_deck}.dat|${_name}" + "-DONCE=converged run written" + "-DMUST_NOT=folds back|a hairpin" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${_test} + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) + set_tests_properties(${_test} PROPERTIES LABELS "fortran;driver;integration;static") +endforeach() # A clamped finite-EI cable with a buoyant section on a Rigid6 body: the body static solve # holds the objects at their deck poses, warns once, and reports no balanced clamped end loads. add_test(NAME driver_clamped_buoyant_held diff --git a/doc/driver_format.md b/doc/driver_format.md index 458a8132..7e336172 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -624,7 +624,8 @@ lines. `CdA` adds lumped drag and `Ca` lumped added mass in EI = 0 dynamic runs profile current or deck waves. A `Connect`/`Free` point with `Mass` or `Vol` (a clump weight or a buoy) has its own seabed contact, the line contact law with stiffness `kBot·A` and damping `cBot·A` over the footprint `A = V^(2/3)`, where `V = Vol`, or `Mass/7850` (solid steel) when -`Vol = 0`; a point with neither has none (see the theory manual, Seabed contact). +`Vol = 0`; a point with neither has none. A `Point3` buoy has the same contact over the footprint +of its BODY `Mass`/`Vol` (see the theory manual, Seabed contact). `Connect`/`Free` points require `dtM`/`TMax` in the standalone driver. Non-zero `Mass`/`Vol`/`CdA`/`Ca` on `Fixed`, `Coupled`, `Vessel`, `Body`, `RodA/B`, or `Turbine` points is rejected. @@ -1045,8 +1046,8 @@ syntax form. The most frequently edited keywords are: | `rhoW` / `WtrDnsty` | water density [kg/m³] | 1025.0 | | `WtrDpth` | water depth [m]; seabed plane z = −WtrDpth. Omit for a suspended or taut line with no bottom contact | none | | `bathymetryFile` / `bathymetry_file` / `seafloorFile` | structured bathymetry file (rows `x y depth`); mutually exclusive with `WtrDpth`. Supported for static EI = 0, independent-line EI = 0 dynamic, EI = 0 `Connect`/`Free` point-system line contact, cubic-Hermite finite-EI dynamic with held or prescribed-translation ends, free/fixed rod dynamic, and Rigid6 dynamic decks | none | -| `kBot` | seabed penalty stiffness base [Pa/m = N/m³], scaled per line node and rod contact station by diameter × tributary length, at a Free/Connect point with Mass or Vol by its footprint `V^(2/3)` (`V` = Vol, or Mass/7850), and by a fixed 1 m² reference area at a Rigid6 reference point (only with `WtrDpth`/`bathymetryFile`) | 1.0e5 | -| `cBot` | seabed normal damping base [Pa·s/m = N·s/m³], scaled like `kBot`; active only on contacting nodes moving downward | 1.0e4 | +| `kBot` | seabed penalty stiffness base [Pa/m = N/m³], scaled per line node and rod contact station by diameter × tributary length, at a Free/Connect point with Mass or Vol and a Point3 buoy by its footprint `V^(2/3)` (`V` = Vol, or Mass/7850), and by a fixed 1 m² reference area at a Rigid6 reference point (only with `WtrDpth`/`bathymetryFile`) | 1.0e5 | +| `cBot` | seabed normal damping base [Pa·s/m = N·s/m³], scaled like `kBot` (also over a point footprint); active only on contacting nodes and points moving downward | 1.0e4 | | `bodyIC` | `static`: free `Rigid6` bodies and free rods, with `Free`/`Connect` points, start at their static equilibrium; `deck`: they start at their deck pose (for example a free-decay test) | `static` | | `frictionMu` / `mu` | isotropic seabed friction coefficient: stick-slip springs on line nodes (held by the static solve too in a deck current, from the still-water laid shape, or toward the as-laid position with `staticsFriction asLaid`), regularised kinetic friction on rods and bodies; requires `WtrDpth` or `bathymetryFile`, and `dtM`/`TMax` in the standalone driver. Rejected on some routes (decks with `Connect`/`Free` points, `Point3` buoys or `FAILURE` rows, and body or rod decks off the default monolithic march); see the [OPTIONS reference](options.rst) | 0 | | `frictionMuAxial` / `frictionMuLateral` | anisotropic line friction: the coefficients along and across the local line axis (OrcaFlex axial/normal); an omitted one takes `frictionMu`; both positive or both zero; rods and bodies use the lateral one | `frictionMu` | diff --git a/doc/openfast.rst b/doc/openfast.rst index 09e82172..16c28992 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -178,7 +178,8 @@ Before trusting a run, confirm in the console: #. the ``dtM`` line and the model inventory (``Created CableDyn model: ... line object(s)``); #. for every line, the converged fairlead effective tension, force vector, inclination, declination, and azimuth at the static equilibrium — printed unconditionally, whether or not - ``OUTPUTS`` is present; + ``OUTPUTS`` is present — followed by the line's static-initialisation notes, if any + (``Note: line ...``, for example a folded ``EI = 0`` layout; see :doc:`troubleshooting`); #. ``Requested CableDyn OUTPUTS at t = 0 s``, the deck's channels in the first output row. With SeaState waves or current the header adds ``SeaState kinematics at t = 0``: the equilibrium is solved before the kinematics act, so a line-end tension at t = 0 can differ slightly from the diff --git a/doc/options.rst b/doc/options.rst index 8d6c4349..12acbe91 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -89,15 +89,17 @@ Environment and seabed - real, Pa/m (N/m³) - ``1.0e5`` - finite, > 0 when a seabed is present. Mapped to each line node and rod contact station by - local diameter × tributary length; a Free/Connect point with Mass or Vol over its footprint - (Vol, or Mass/7850 kg/m³, to the power 2/3); a Rigid6 reference point uses a fixed 1 m² area + local diameter × tributary length; a Free/Connect point with Mass or Vol, and a Point3 + buoy, over its footprint (Vol, or Mass/7850 kg/m³, to the power 2/3); a Rigid6 reference + point uses a fixed 1 m² area - both - ``1.0e5 kBot`` * - ``cBot`` / ``cb`` - real, Pa·s/m (N·s/m³) - ``1.0e4`` - - finite, ≥ 0 when a seabed is present; scaled like ``kBot`` and acts only on contacted - nodes moving downward + - finite, ≥ 0 when a seabed is present; scaled like ``kBot`` (per line node and rod contact + station, and over the footprint of a Free/Connect point with Mass or Vol or a Point3 + buoy) and acts only on contacting nodes and points moving downward - both - ``1.0e4 cBot`` * - ``frictionMu`` / ``mu`` / ``frictionCoefficient`` diff --git a/doc/theory.rst b/doc/theory.rst index cf9f42de..53ed7ea2 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1071,28 +1071,31 @@ is compressed there. On the Hermite path the contact acts on the nodal position on the tangent DOFs. **Free and Connect points.** A clump weight or a buoy (a ``Free`` or ``Connect`` point with -``Mass`` or ``Vol``) has its own seabed contact, the line law above with the stiffness -:math:`k_p = k_\text{Bot} A` and the damping :math:`c_p = c_\text{Bot} A` over its contact -footprint +``Mass`` or ``Vol``, or a ``Point3`` buoy, whose ``Body`` attachment point steps as a free +point with the BODY ``Mass`` and ``Vol``) has its own seabed contact, the line law above with +the stiffness :math:`k_p = k_\text{Bot} A` and the damping :math:`c_p = c_\text{Bot} A` over its +contact footprint .. math:: A = V^{2/3}, \qquad V = \begin{cases} \text{Vol}, & \text{Vol} > 0, \\ \text{Mass}/\rho_s, & \text{otherwise}, \end{cases} -the area of a cube of the point's volume (the OrcaFlex 3D-buoy default contact area, volume -over height, for a cube), with :math:`\rho_s = 7850\ \mathrm{kg/m^3}`: a clump declared by its -mass alone, its buoyancy left out, takes the volume of solid steel of that mass. A point with -neither (a massless line junction) has no footprint. Without it only the end nodes of the +the face area of a cube of the point's volume, CableDyn's own area-equivalent of a compact +body (a point carries no shape), with :math:`\rho_s = 7850\ \mathrm{kg/m^3}`: a clump declared +by its mass alone, its buoyancy left out, takes the volume of solid steel of that mass. A point +with neither (a massless line junction) has no footprint. Without it only the end nodes of the attached lines held a point on the bed, over their tributary length: a 50 t clump between two polyester lines (``kBot = 1e5``) sank 2.8 m into the seabed; on its 3.44 m² footprint it rests 0.95 m deep, within the 1.43 m that its weight alone would press it in, and the lines no longer -hang it from the seabed. MoorDyn points have no seabed contact. The contact acts along the -surface normal of a sloped or rounded bathymetry, in the point static equilibrium and in the -monolithic and staggered point steps alike (in the staggered step its stiffness and damping are -linearly implicit, like the end blocks of the attached lines), so a grounded point starts at -rest. The contact is frictionless: the point routes reject ``frictionMu``. A point clear of the -seabed sees exactly no contact load, and its results are unchanged. +hang it from the seabed. The contact acts along the surface normal of a sloped or rounded +bathymetry, in the point static equilibrium and in the monolithic and staggered point steps +alike (in the staggered step its stiffness and damping are linearly implicit, like the end +blocks of the attached lines), so a grounded point starts at rest. A ``Point3`` buoy is not +placed by the static solve (it starts at its deck position) but carries the same contact in +every march, the monolithic and staggered steps and the coupled point step of the OpenFAST +aggregate and the C API. The contact is frictionless: the point routes reject ``frictionMu``. A +point clear of the seabed sees exactly no contact load, and its results are unchanged. Static equilibrium ------------------ @@ -1163,22 +1166,34 @@ point's weight and buoyancy, its current drag, and its own seabed contact (see S contact above). It is the rigid-body equilibrium solve described under *Rigid-body initial condition* below, with points as the only unknowns. -A tension-only line on a frictionless seabed can reach a folded (hairpin) equilibrium: a -current toward the anchor, or a seabed falling past it, drives the grounded run beyond the -anchor, and the run folds back to it with zero tension at the fold; a slack line can likewise -be laid out and back. The equilibrium is kept, and the driver prints one note per such line, -on every ``EI = 0`` route (static, ``TMax = 0`` and the dynamic initial condition, the point -and multibody systems, and the line report of the OpenFAST aggregate), naming the fold and its -cause at the fold node (the current, the seabed slope, or a slack run): ``the static layout -carries the grounded run ... m past its anchor, where it folds back (a hairpin)`` when grounded -nodes lie more than 1 % of the horizontal span plus 0.5 m beyond a grounded end whose other -end is suspended, measured along the horizontal chord (the criterion of the finite-EI note -below), or ``the static layout folds the grounded run back on itself (a ... deg turn at node -...)`` when the run turns by more than 150° at a node whose two neighbours are also grounded -(within 5 cm of the floor). Seabed friction holds the run in a current, but the static solve -applies it against a deck current only, so on a slope only a shorter line prevents the fold. -The note never changes a result. No example deck and no ``EI = 0`` line of the statics test -matrices prints it except the folded layouts it describes. +A tension-only line on a seabed that does not hold it can reach a folded (hairpin) +equilibrium: a current toward the anchor, or a seabed falling past it, drives the grounded run +beyond the anchor, and the run folds back to it with zero tension at the fold; a slack line can +likewise be laid out and back. The equilibrium is kept, and the driver prints one note per such +line, on every ``EI = 0`` route (static, ``TMax = 0`` and the dynamic initial condition, the +point and multibody systems, and the OpenFAST aggregate, whose line report returns it and whose +OpenFAST initialisation report prints it): ``the static layout carries the grounded run ... m +past its anchor, where it folds back (a hairpin)`` when grounded nodes lie more than 1 % of the +horizontal span plus 0.5 m beyond a grounded end whose other end is suspended, measured along +the horizontal chord (the criterion of the finite-EI note below; only for a horizontal span of +at least a tenth of the water depth at that end, or of the height of the other end above it if +that is larger, so that a near-vertical line, whose side away from its other end is not +defined, is left to the next test), or ``the static layout folds the grounded run back on +itself (a ... deg turn at node ...)`` when the run turns by more than 150° +at a node whose two neighbours are also grounded (within 5 cm of the floor). The note names the +cause: a deck current acting on the line (a current profile that vanishes at the seabed still +pulls the run through the suspended span), a seabed steeper than 0.5° at the fold, or neither +(a slack run). Its remedy follows the deck's static friction. Without ``frictionMu``: friction +against a current, or friction toward the as-laid position (``staticsFriction asLaid``) on a +slope, since with the default ``staticsFriction none`` the static solve applies friction against +a deck current only. With ``frictionMu`` and ``staticsFriction none`` on a slope: +``staticsFriction asLaid``. With friction that already acts and still does not hold the run, or +on a deck whose route rejects ``frictionMu`` (``Connect``/``Free`` points, ``Point3`` buoys) or +``staticsFriction asLaid`` (bodies and rods): a shorter line. Under ``staticsFriction asLaid`` +with a ``layAzimuth`` that lays the line from its lower end away from its other end, the deck +itself lays the run past that end and no note is made. The note never changes a result. No +example deck and no ``EI = 0`` line of the statics test matrices prints it except the folded +layouts it describes. Hermite path ~~~~~~~~~~~~ @@ -1830,7 +1845,7 @@ Deck ``POINTS``, ``BODIES``, and ``RODS`` records follow the MoorDyn object mode line ends. - **Free points** (``Point3`` buoys, clump weights, connectors) have three translational DOFs. Each carries its weight and buoyancy :math:`(\rho V - m)\,g\,\mathbf{e}_z`, point loads, its - own seabed contact (a ``Free`` or ``Connect`` point, see Seabed contact above), and, + own seabed contact (with ``Mass`` or ``Vol``, see Seabed contact above), and, while below the surface, lumped Morison terms :math:`\tfrac{1}{2}\rho\,C_dA\,\lvert\mathbf{u}_r\rvert\mathbf{u}_r + \rho V(1 + C_a)\,\dot{\mathbf{u}}_f` with added mass :math:`\rho V C_a`. Points are advanced around the implicit line step with diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index c861e5e8..cfc457c7 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -653,10 +653,14 @@ Warnings and notes that do not stop a run deck as written, but not the usual one. If the real seabed holds the line, declare ``frictionMu``; otherwise check the line length and the current, and inspect ``.static.out`` before using the layout. On an ``EI = 0`` line the note names - the cause at the fold: the current, a seabed sloping down past the anchor (the static - solve applies ``frictionMu`` against a deck current only, so there only a shorter line - prevents the fold), or neither, when the folded run carries no tension (a slack line laid - out and back; a shorter line removes it). + the cause, the current, a seabed sloping down past the anchor, or neither (a slack line + laid out and back, which a shorter line removes), and the remedy that fits the deck: with + the default ``staticsFriction none`` the static solve applies ``frictionMu`` against a + deck current only, so on a slope the note points to ``staticsFriction asLaid``, which + holds the run toward its as-laid position; where friction already acts, or the deck's + route rejects it (``Connect``/``Free`` points, ``Point3`` buoys), it points to a shorter + line. A run that ``staticsFriction asLaid`` lays past its anchor along ``layAzimuth`` is + the deck's own layout and is not noted. * - ``Note: line ...: the static layout folds the grounded run back on itself (a ... deg turn at node ..., a hairpin) ...`` - an ``EI = 0`` line whose grounded run turns back by more than 150° at a node, away from diff --git a/examples/clump_weight_free_point.dat b/examples/clump_weight_free_point.dat index 7ecc37a1..dbedac6c 100644 --- a/examples/clump_weight_free_point.dat +++ b/examples/clump_weight_free_point.dat @@ -1,9 +1,12 @@ --------------------- CableDyn Input File ------------------------------------ CableDyn driver deck -- chain with a clump weight at a Free line end, dynamic run -- A single chain hangs from a fairlead at the surface down to a heavy clump weight modelled as a --- Free point (a 1-line terminal): Mass 20 t, Vol 1 m^3, so a net downward load (Mass - rhoW*Vol)*g --- pulls the line end down and sets the pretension. Free points carry Mass/Vol only on the dynamic --- point-system path, so the deck sets dtM/TMax; the static IC seeds the march, held here for 2 s. +-- Free point (a 1-line terminal): Mass 20 t, Vol 1 m^3, a net downward load (Mass - rhoW*Vol)*g of +-- 186 kN. The 250 m chain reaches the 250 m seabed, so the clump rests on it below the fairlead, on +-- its own footprint Vol^(2/3) = 1 m^2 (kBot*A = 2e6 N/m), about 5 cm deep: the seabed carries half +-- its net weight and the chain the other half (AnchTen 92 kN). Free points carry Mass/Vol only on +-- the dynamic point-system path, so the deck sets dtM/TMax; the static IC seeds the march, held +-- here for 2 s. -- Chain: R4 studless 155 mm, volume-equivalent diam 0.2791 m, dry mass 480.93 kg/m, EA 2.058e9 N. --------------------- LINE TYPES --------------------------------------- TypeName Diam MassDenInAir EA BA/-zeta EI Cd_n Cd_t Ca_n Ca_t diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index ed97c474..d05e2615 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -370,6 +370,9 @@ MODULE CableDyn_DeckDriver REAL(wp) :: turb_local(3) = CD_ZERO REAL(wp) :: body_offset(3) = CD_ZERO REAL(wp) :: mass = CD_ZERO, vol = CD_ZERO, cda = CD_ZERO, ca = CD_ZERO + ! the Body attachment of a Point3 BODY: stepped as a Free point with the BODY Mass/Vol/CdA/Ca + ! (copied into mass, vol, cda, ca above), its seabed contact included + LOGICAL :: point3 = .FALSE. INTEGER :: deck_line = 0 ! deck file line of the row, for error messages END TYPE @@ -976,9 +979,11 @@ MODULE CableDyn_DeckDriver REAL(wp) :: fair_declination = CD_ZERO REAL(wp) :: fair_azimuth = CD_ZERO LOGICAL :: force_is_total = .TRUE. - ! Static-initialisation notes of the line (finite-EI compression, mesh refinement, accepted - ! residual floor; the static strain note of any line), one per text line (append_note_line); - ! empty when there is nothing to report. It holds a whole cable note (1024) and a strain note. + ! Static-initialisation notes of the line, one per text line (append_note_line): those of a + ! finite-EI line (compression, mesh refinement, accepted residual floor, a run past its + ! anchor), the fold note of an EI = 0 line (ei0_fold_note) and the static strain note of any + ! line; empty when there is nothing to report. It holds a whole cable note (1024) and a + ! strain note. CHARACTER(2048) :: note = '' END TYPE CD_LineInitSummary @@ -1357,9 +1362,11 @@ SUBROUTINE init_deck_system_from_parsed(types, points, lines, sections, opts, sy sys_points(i)%ca = pts(i)%ca sys_points(i)%force = [CD_ZERO, CD_ZERO, (opts%rhoW*pts(i)%vol - pts(i)%mass)*opts%g] ! a deck Free/Connect point's own seabed contact over its footprint (point_contact_area), - ! with the line contact coefficients kBot and cBot per unit area. Body and rod attachment - ! points also step as system Free points, but their object carries the contact. - IF (TRIM(pts(i)%ptype) == 'free' .OR. TRIM(pts(i)%ptype) == 'connect') THEN + ! with the line contact coefficients kBot and cBot per unit area, and so a Point3 buoy's, + ! which is the Free point of its Body attachment with the BODY Mass/Vol. Rigid6 body + ! and rod attachment points also step as system Free points, but their object carries + ! the contact. + IF (TRIM(pts(i)%ptype) == 'free' .OR. TRIM(pts(i)%ptype) == 'connect' .OR. pts(i)%point3) THEN sys_points(i)%seabed_k = opts%kbot*point_contact_area(pts(i)) sys_points(i)%seabed_c = opts%cbot*point_contact_area(pts(i)) END IF @@ -6729,14 +6736,16 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi CALL CD_End_Deck_Aggregate(agg); RETURN END IF ! the static fold note of each EI = 0 line (the finite-EI cables carry their own notes), - ! appended to the notes the line already has + ! appended to the notes the line already has; the system rejects frictionMu beside + ! Connect/Free, Point3, body or rod points IF (agg%has_sys) THEN BLOCK CHARACTER(1024) :: fold_note DO c = 1, SIZE(lines) IF (agg%line_is_cable(lines(c)%id)) CYCLE CALL ei0_fold_note(lines(c), points, opts, agg%sys%lines(agg%line_obj_index(lines(c)%id))%q, & - fold_note, model=agg%sys%lines(agg%line_obj_index(lines(c)%id))) + fold_note, model=agg%sys%lines(agg%line_obj_index(lines(c)%id)), & + friction_support=MERGE(0, 2, deck_has_dynamic_points(points))) IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(agg%init_lines(c)%note, fold_note) END DO END BLOCK @@ -9820,19 +9829,29 @@ SUBROUTINE warn_line_below_anchor(lines, points, sections, q_all, q_off) END DO END SUBROUTINE warn_line_below_anchor - SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) + SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry, friction_support) !! Initialisation note for an EI = 0 line whose static layout folds its grounded run back !! on itself (a hairpin), the twin of the finite-EI anchor_overshoot_note: a current or a - !! seabed slope along a frictionless seabed drives the run past its anchor, or a slack run - !! that carries no tension is laid out and back. Such a layout is an equilibrium of the - !! tension-only line and is kept; the note names it so that it is not mistaken for the - !! usual one. q is the line's static state in the internal node order (node 1 = End B). + !! seabed slope drives the run past its anchor where no seabed friction holds it, or a + !! slack run that carries no tension is laid out and back. Such a layout is an equilibrium + !! of the tension-only line and is kept; the note names it so that it is not mistaken for + !! the usual one. q is the line's static state in the internal node order (node 1 = End B). !! A node is grounded within GROUNDED_TOL of the floor: model's floor when model is !! present, otherwise the deck's (bathymetry, else WtrDpth). The layout folds when !! (a) the grounded run lies beyond a grounded line end whose other end is suspended, on !! the side away from that other end, by more than 1 % of the horizontal span plus - !! 0.5 m (anchor_overshoot_note), or + !! 0.5 m (anchor_overshoot_note); only for a horizontal span of at least SPAN_MIN_FRAC + !! of the water depth at that end (or of the height of the other end above it), so + !! that the direction away from the other end is well defined; or !! (b) the run turns by more than FOLD_TURN_DEG at a node whose neighbours are grounded too. + !! The cause names a deck current that acts anywhere on the line and a seabed steeper than + !! SLOPE_MIN_DEG at the fold; the remedy follows the static seabed friction of the deck + !! (frictionMu, staticsFriction) and friction_support, what the route accepts: + !! 0 no frictionMu (decks with Connect/Free points, Point3 buoys, or body and rod points + !! stepped as system points), 1 frictionMu but not staticsFriction asLaid (the multibody + !! march with bodies or rods), 2 both (the default; line decks). Under staticsFriction + !! asLaid with a layAzimuth that lays the run from its laying end away from the other end + !! the deck itself lays the run past that end, and no note is made. !! note is empty otherwise, and on a line without a floor. TYPE(DeckLine), INTENT(IN) :: ln TYPE(DeckPoint), INTENT(IN) :: points(:) @@ -9841,24 +9860,33 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) CHARACTER(*), INTENT(OUT) :: note TYPE(CD_ModelType), INTENT(IN), OPTIONAL :: model TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry - REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp, FOLD_TURN_DEG = 150.0_wp + INTEGER, INTENT(IN), OPTIONAL :: friction_support + REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp, FOLD_TURN_DEG = 150.0_wp, SLOPE_MIN_DEG = 0.5_wp + REAL(wp), PARAMETER :: SPAN_MIN_FRAC = 0.1_wp + REAL(wp), PARAMETER :: DEG2RAD = 3.14159265358979323846264338327950288_wp/180.0_wp LOGICAL, ALLOCATABLE :: grounded(:) - REAL(wp), ALLOCATABLE :: slope(:) + REAL(wp), ALLOCATABLE :: slope(:), zfl(:), lay_az REAL(wp) :: total, span, e_h(2), past, past_e, d, u1(3), u2(3), l1, l2, turn, turn_max, zf, dfdx, dfdy, u(3) - INTEGER :: n, k, ie, k_end, k_oth, k_past, k_turn, k_at, end_id, jp, es - LOGICAL :: has_floor, by_current, by_slope + REAL(wp) :: laid_t + INTEGER :: n, k, ie, k_end, k_oth, k_past, k_turn, k_at, end_id, jp, es, support + LOGICAL :: has_floor, by_current, by_slope, as_laid CHARACTER(512) :: em - CHARACTER(200) :: what, cause, remedy + CHARACTER(200) :: what, cause + CHARACTER(320) :: remedy note = '' + support = 2 + IF (PRESENT(friction_support)) support = friction_support + as_laid = opts%has_friction .AND. opts%static_friction == CD_STATIC_FRICTION_AS_LAID .AND. support >= 2 n = SIZE(q)/3 IF (n < 3) RETURN - ALLOCATE (grounded(n), slope(n)) + ALLOCATE (grounded(n), slope(n), zfl(n)) DO k = 1, n CALL floor_at(q(3*k - 2), q(3*k - 1), has_floor, zf, dfdx, dfdy) IF (.NOT. has_floor) RETURN grounded(k) = q(3*k) <= zf + GROUNDED_TOL slope(k) = SQRT(dfdx*dfdx + dfdy*dfdy) + zfl(k) = zf END DO IF (COUNT(grounded) < 2) RETURN total = CD_ZERO @@ -9878,8 +9906,19 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) ! grounded ends a slack run may bow behind an end without folding; (b) covers those.) IF (.NOT. grounded(k_end) .OR. grounded(k_oth)) CYCLE span = NORM2(q(3*k_oth - 2:3*k_oth - 1) - q(3*k_end - 2:3*k_end - 1)) - IF (span <= 1.0e-6_wp*MAX(CD_ONE, total)) CYCLE + ! a near-vertical line has no well-defined side away from its other end + IF (span < SPAN_MIN_FRAC*MAX(-zfl(k_end), q(3*k_oth) - q(3*k_end)) .OR. & + span <= 1.0e-6_wp*MAX(CD_ONE, total)) CYCLE e_h = (q(3*k_oth - 2:3*k_oth - 1) - q(3*k_end - 2:3*k_end - 1))/span + ! staticsFriction asLaid lays the line from its lower end (node 1, or node n when that is + ! lower) along layAzimuth: laid away from the other end, the run lies past this end by + ! the deck's own lay, and friction holds it there + IF (as_laid .AND. k_end == MERGE(n, 1, q(3*n) < q(3))) THEN + CALL line_static_friction(opts, ln%id, lay_az, laid_t) + IF (ALLOCATED(lay_az)) THEN + IF (DOT_PRODUCT([COS(lay_az), SIN(lay_az)], e_h) < -1.0e-3_wp) RETURN + END IF + END IF past_e = CD_ZERO DO k = 1, n IF (.NOT. grounded(k)) CYCLE @@ -9932,13 +9971,21 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) NINT(turn_max), ' deg turn at node ', n + 1 - k_turn, ', a hairpin)' k_at = k_turn END IF - ! the cause at the fold: a current there, a sloping seabed there, or neither (a slack run) + ! the cause: a deck current on the line (its drag on the suspended span pulls the run as + ! well as the drag on the run itself, so a profile still at the seabed counts), a seabed + ! sloping at the fold, or neither (a slack run) by_current = .FALSE. IF (opts%has_current) THEN - u = deck_current_velocity(opts, q(3*k_at), es, em) - IF (es == CD_HYDRO_OK) by_current = NORM2(u) > CD_ZERO + DO k = 1, n + u = deck_current_velocity(opts, q(3*k), es, em) + IF (es /= CD_HYDRO_OK) CYCLE + IF (NORM2(u) > CD_ZERO) THEN + by_current = .TRUE. + EXIT + END IF + END DO END IF - by_slope = slope(k_at) > 1.0e-6_wp + by_slope = slope(k_at) > TAN(SLOPE_MIN_DEG*DEG2RAD) IF (by_current .AND. by_slope) THEN cause = 'the current and the seabed slope drive the run along the seabed, which holds it only by friction' ELSE IF (by_current) THEN @@ -9948,13 +9995,27 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry) ELSE cause = 'the run carries no tension, so nothing sets its layout on the seabed' END IF + ! the remedy, from the static seabed friction the deck has and the route accepts IF (.NOT. (by_current .OR. by_slope)) THEN remedy = 'a shorter line prevents it' - ELSE IF (opts%has_friction) THEN - remedy = 'a shorter line prevents it; the static solve holds the run with seabed friction against a deck '// & + ELSE IF (support <= 0) THEN + remedy = 'a shorter line prevents it; seabed friction (frictionMu) is not supported on this deck' + ELSE IF (as_laid) THEN + remedy = 'a shorter line prevents it; the as-laid seabed friction (staticsFriction asLaid) does not hold '// & + 'the run there' + ELSE IF (by_slope .AND. support >= 2 .AND. opts%has_friction) THEN + remedy = 'staticsFriction asLaid or a shorter line prevents it; with staticsFriction none the static solve '// & + 'applies frictionMu against a deck current only' + ELSE IF (by_slope .AND. support >= 2) THEN + remedy = 'seabed friction toward the as-laid position (frictionMu with staticsFriction asLaid) or a shorter '// & + 'line prevents it' + ELSE IF (by_slope) THEN + remedy = 'a shorter line prevents it; the static solve of this deck applies seabed friction against a deck '// & 'current only' + ELSE IF (opts%has_friction) THEN + remedy = 'a shorter line prevents it; frictionMu does not hold the run against this current' ELSE - remedy = 'seabed friction or a shorter line prevents it' + remedy = 'seabed friction (frictionMu) or a shorter line prevents it' END IF note = 'line '//TRIM(int_to_str(ln%id))//': '//TRIM(what)//'; '//TRIM(cause)//'. Check that it is the '// & 'intended layout ('//TRIM(remedy)//')' @@ -9997,17 +10058,22 @@ SUBROUTINE floor_at(x, y, ok, z, gx, gy) END SUBROUTINE floor_at END SUBROUTINE ei0_fold_note - SUBROUTINE add_model_fold_notes(lines, points, opts, models, summaries) - !! ei0_fold_note of every EI = 0 line model (index-aligned with lines) into its summary. + SUBROUTINE add_model_fold_notes(lines, points, opts, models, summaries, friction_support) + !! ei0_fold_note of every EI = 0 line model (index-aligned with lines), appended to the notes + !! of its summary; friction_support as in ei0_fold_note. TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(DeckOptions), INTENT(IN) :: opts TYPE(CD_ModelType), INTENT(IN) :: models(:) TYPE(CD_LineInitSummary), INTENT(INOUT) :: summaries(:) + INTEGER, INTENT(IN) :: friction_support INTEGER :: i + CHARACTER(1024) :: fold_note DO i = 1, MIN(SIZE(lines), SIZE(models), SIZE(summaries)) IF (.NOT. ALLOCATED(models(i)%q)) CYCLE - CALL ei0_fold_note(lines(i), points, opts, models(i)%q, summaries(i)%note, model=models(i)) + CALL ei0_fold_note(lines(i), points, opts, models(i)%q, fold_note, model=models(i), & + friction_support=friction_support) + IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(summaries(i)%note, fold_note) END DO END SUBROUTINE add_model_fold_notes @@ -15101,6 +15167,7 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio points(i)%vol = bodies(body_idx)%vol points(i)%cda = bodies(body_idx)%cda points(i)%ca = bodies(body_idx)%ca + points(i)%point3 = TRIM(bodies(body_idx)%btype) == 'point3' CYCLE ELSE IF (is_rod_point_type(points(i)%ptype)) THEN CALL parse_rod_point_type(points(i)%ptype, rod_id, idx) @@ -18516,7 +18583,10 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod CALL init_deck_system_from_parsed(types, pc, sys_lines, sections, opts, mb%system, ErrStat, ErrMsg, & bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) RETURN - CALL collect_system_init_summaries(sys_lines, points, mb%system, sum_sys, ErrStat, ErrMsg, opts=opts) + ! frictionMu is rejected beside Connect/Free points and Point3 buoys, and staticsFriction asLaid + ! on every multibody deck + CALL collect_system_init_summaries(sys_lines, points, mb%system, sum_sys, ErrStat, ErrMsg, opts=opts, & + friction_support=MERGE(0, 1, deck_has_dynamic_points(pc))) IF (ErrStat /= CD_DECKDRV_OK) GOTO 900 ELSE ALLOCATE (sum_sys(0)) @@ -26367,9 +26437,9 @@ SUBROUTINE deck_seabed_floor_at(x, y, opts, has_floor, z_floor, ErrStat, ErrMsg, END SUBROUTINE deck_seabed_floor_at PURE REAL(wp) FUNCTION point_contact_area(pt) RESULT(area) - !! Seabed contact footprint [m^2] of a Free/Connect point (a clump weight or a buoy): the - !! area of a cube of the point's volume, V^(2/3) (the OrcaFlex 3D-buoy default contact - !! area, volume over height, for a cube), with V the displaced volume Vol or, for a point + !! Seabed contact footprint [m^2] of a Free/Connect point or a Point3 buoy (a clump weight + !! or a buoy): the face area of a cube of the point's volume, V^(2/3), CableDyn's own + !! area-equivalent of a compact body, with V the displaced volume Vol or, for a point !! declared with Mass only (a clump weight whose buoyancy is left out), the volume of !! solid steel of that mass, Mass/7850 kg/m^3. A point with neither (a massless line !! junction) has no footprint: its lines' end nodes carry its contact. @@ -32001,18 +32071,21 @@ SUBROUTINE collect_model_init_summaries(lines, points, models, summaries, ErrSta END IF CALL set_init_summary(lines(i)%id, tension, declination, azimuth, summaries(i), fair_force=fair_force) END DO - IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, models, summaries) + IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, models, summaries, 2) END SUBROUTINE collect_model_init_summaries - SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrStat, ErrMsg, opts) + SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrStat, ErrMsg, opts, friction_support) TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(CD_SystemType), INTENT(IN) :: system TYPE(CD_LineInitSummary), ALLOCATABLE, INTENT(OUT) :: summaries(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - !! opts (optional): add each line's static fold note (ei0_fold_note) + !! opts (optional): add each line's static fold note (ei0_fold_note), with the route's + !! friction_support (default 0: a system of Connect/Free, Point3, body or rod points, whose + !! deck rejects frictionMu) TYPE(DeckOptions), INTENT(IN), OPTIONAL :: opts + INTEGER, INTENT(IN), OPTIONAL :: friction_support TYPE(ModelOutputWorkspace) :: work INTEGER :: i, es REAL(wp) :: tension, declination, azimuth, f_first(3), fair_force(3) @@ -32038,7 +32111,13 @@ SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrSt END IF CALL set_init_summary(lines(i)%id, tension, declination, azimuth, summaries(i), fair_force=fair_force) END DO - IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, system%lines, summaries) + IF (PRESENT(opts)) THEN + IF (PRESENT(friction_support)) THEN + CALL add_model_fold_notes(lines, points, opts, system%lines, summaries, friction_support) + ELSE + CALL add_model_fold_notes(lines, points, opts, system%lines, summaries, 0) + END IF + END IF END SUBROUTINE collect_system_init_summaries SUBROUTINE collect_finite_init_summaries(lines, points, models, summaries, ErrStat, ErrMsg) diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index a7ffb3ba..710bf0c5 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -2034,7 +2034,8 @@ END SUBROUTINE CD_AGG_GetInitMetadata SUBROUTINE CD_AGG_GetInitLine(self, i, line_id, tension, force, inclination, declination, azimuth, ErrStat, ErrMsg, & note) !! Return one line's unconditional converged-static fairlead result in deck order, and - !! (optional note) the static-initialisation notes of a finite-EI line ('' if none). + !! (optional note) its static-initialisation notes, one per text line: those of a finite-EI + !! cable, or the fold note of an EI = 0 line ('' if none). TYPE(CD_AGG_ModuleType), INTENT(IN) :: self INTEGER, INTENT(IN) :: i INTEGER, INTENT(OUT) :: line_id diff --git a/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90 index 1947d4fc..00f1adaa 100644 --- a/src/openfast/CableDyn_OF.f90 +++ b/src/openfast/CableDyn_OF.f90 @@ -482,7 +482,8 @@ SUBROUTINE CD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er REAL(wp) :: fair_ten, fair_force(3), fair_incl, fair_decl, fair_azi, force_incl LOGICAL :: has_dtm, has_ptfm, use_extf CHARACTER(ChanLen) :: chan_hdr, chan_unt - CHARACTER(1024) :: native_root + CHARACTER(1024) :: native_root, init_note + INTEGER(IntKi) :: note_at, note_end REAL(wp), PARAMETER :: DTM_DEFAULT = 0.1_wp ErrStat = ErrID_None @@ -1167,7 +1168,7 @@ SUBROUTINE CD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er CALL WrScr( ' Fairlead convention: force is on End A toward End B; inclinations are signed below horizontal.' ) DO il = 1, nreportlines CALL CD_AGG_GetInitLine( Inst(id)%agg, il, line_id, fair_ten, fair_force, fair_incl, fair_decl, & - fair_azi, es, em ) + fair_azi, es, em, note=init_note ) IF (es /= CD_AGG_OK) THEN CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: '//TRIM(em), ErrStat, ErrMsg, RoutineName ) RETURN @@ -1184,6 +1185,18 @@ SUBROUTINE CD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er CALL WrScr( ' line tangent: inclination='//TRIM(Num2LStr(REAL(fair_incl, DbKi)))// & ' deg, declination='//TRIM(Num2LStr(REAL(fair_decl, DbKi)))// & ' deg, azimuth='//TRIM(Num2LStr(REAL(fair_azi, DbKi)))//' deg' ) + ! The line's static-initialisation notes (a folded EI = 0 layout, the notes of a + ! finite-EI cable), one per text line, as the standalone driver prints them. + note_at = 1 + DO WHILE (LEN_TRIM(init_note(note_at:)) > 0) + note_end = INDEX(init_note(note_at:), NEW_LINE('a')) + IF (note_end == 0) THEN + CALL WrScr( ' Note: '//TRIM(init_note(note_at:))//'.' ) + EXIT + END IF + CALL WrScr( ' Note: '//init_note(note_at:note_at + note_end - 2)//'.' ) + note_at = note_at + note_end + END DO END DO CALL WrScr( ' CableDyn initialization completed.' ) diff --git a/tests/data/ei0_aslaid_behind_anchor.dat b/tests/data/ei0_aslaid_behind_anchor.dat new file mode 100644 index 00000000..08443ad3 --- /dev/null +++ b/tests/data/ei0_aslaid_behind_anchor.dat @@ -0,0 +1,34 @@ +--------------------- CableDyn Input File ------------------------------------ +A chain laid from its anchor away from the fairlead (layAzimuth 0, the fairlead lies along 180 deg) and held there by as-laid seabed friction: the deck lays the run past the anchor, so no fold note +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -10.0 +2 Fixed 450.0 0.0 -100.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 520.0 52 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +100.0 WtrDpth +1.0e5 kBot +1.0e4 cBot +0.5 frictionMu +asLaid staticsFriction +0.0 layAzimuth +0.05 dtM +0.0 TMax +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ---------------------------------------------------- diff --git a/tests/data/ei0_clump_no_fold.dat b/tests/data/ei0_clump_no_fold.dat new file mode 100644 index 00000000..0c121c6c --- /dev/null +++ b/tests/data/ei0_clump_no_fold.dat @@ -0,0 +1,35 @@ +--------------------- CableDyn Input File ------------------------------------ +A 50 t clump weight resting on the seabed between two polyester lines, each line grounded at the clump: no line folds (no note) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +poly 0.172 31.916 200000000 -1 0 1.2 0.008 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z Mass Vol CdA Ca +(-) (-) (m) (m) (m) (kg) (m3) (m2) (-) +1 Coupled 0 0 -10 0 0 0 0 +2 Fixed 800 0 -200 0 0 0 0 +3 Connect 450 0 -190 50000 0 0 0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 3 - +2 3 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 poly 520 52 +2 poly 360 36 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +200.0 WtrDpth +1.0e5 kBot +1.0e4 cBot +0.05 dtM +0.0 TMax +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +Point3pz +--------------------- END ---------------------------------------------------- diff --git a/tests/data/ei0_fold_slope_aslaid.dat b/tests/data/ei0_fold_slope_aslaid.dat new file mode 100644 index 00000000..7007f882 --- /dev/null +++ b/tests/data/ei0_fold_slope_aslaid.dat @@ -0,0 +1,33 @@ +--------------------- CableDyn Input File ------------------------------------ +The chain of ei0_fold_slope.dat held by as-laid seabed friction: mu = 0.5 exceeds tan(5 deg), so the run rests where it was laid and does not fold (no note) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -10.0 +2 Fixed 450.0 0.0 -300.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 700.0 70 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +ei0_fold_slope_bathy.txt bathymetryFile +1.0e5 kBot +1.0e4 cBot +0.5 frictionMu +asLaid staticsFriction +0.05 dtM +0.0 TMax +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ---------------------------------------------------- diff --git a/tests/data/ei0_hairpin_current_friction.dat b/tests/data/ei0_hairpin_current_friction.dat new file mode 100644 index 00000000..389d04e9 --- /dev/null +++ b/tests/data/ei0_hairpin_current_friction.dat @@ -0,0 +1,33 @@ +--------------------- CableDyn Input File ------------------------------------ +The chain of ei0_hairpin_current.dat on a seabed with friction: frictionMu holds the grounded run in the 2 m/s current, so it does not fold (no note) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -10.0 +2 Fixed 450.0 0.0 -100.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 520.0 52 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +100.0 WtrDpth +1.0e5 kBot +1.0e4 cBot +0.5 frictionMu +0.05 dtM +0.0 TMax +uniform 2.0 0 0 current +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ---------------------------------------------------- diff --git a/tests/test_point_seabed_contact.f90 b/tests/test_point_seabed_contact.f90 index 6184ae69..682c5ad6 100644 --- a/tests/test_point_seabed_contact.f90 +++ b/tests/test_point_seabed_contact.f90 @@ -15,7 +15,13 @@ PROGRAM test_point_seabed_contact !! equilibrium: the clump stays at rest; !! * the OpenFAST aggregate (the coupled point step): the clump stays at rest; !! * a sloped structured seabed: the clump rests on the bathymetry, also at rest in the - !! march. + !! staggered and monolithic marches (the monolithic residual along the surface normal); + !! * a Point3 buoy of the same mass (a BODY whose Body attachment is the system Free + !! point; the static solve does not place it) set at the clump's static position: it + !! stays at rest in the staggered and monolithic marches and the aggregate step, which + !! it would not without its own footprint; + !! * a buoy tethered 4 m above the seabed: its contact is inactive, so its line forces + !! balance its net buoyancy exactly and it stays at rest. !! An EI = 0 line pushed past its anchor by a current on a frictionless seabed (a hairpin) !! is kept and named by a note; through the OpenFAST aggregate the note is returned with !! the line's initialisation report (CD_AGG_GetInitLine). @@ -32,6 +38,10 @@ PROGRAM test_point_seabed_contact INTEGER, PARAMETER :: NCOL = 11 INTEGER :: failures REAL(wp) :: area, k_clump, w_clump + ! the clump's static position on the flat seabed (case_flat_static), where the Point3 buoy is set + REAL(wp) :: eq_x = 0.0_wp, eq_z = 0.0_wp + LOGICAL :: have_eq = .FALSE. + CHARACTER(160) :: p3_body failures = 0 area = (MASS/STEEL)**(2.0_wp/3.0_wp) @@ -41,8 +51,18 @@ PROGRAM test_point_seabed_contact CALL case_flat_static() CALL case_flat_march('monolithic') CALL case_flat_march('staggered') - CALL case_slope() - CALL case_flat_aggregate() + CALL case_slope('staggered') + CALL case_slope('monolithic') + CALL case_flat_aggregate('point_seabed_agg.dat', 'aggregate clump', '') + IF (have_eq) THEN + WRITE (p3_body, '(A,ES24.16,A,ES24.16,A)') '1 Point3 ', eq_x, ' 0.0 ', eq_z, ' 0 0 0 50000 0 0 0 0 0 0' + CALL case_point3_march('staggered') + CALL case_point3_march('monolithic') + CALL case_flat_aggregate('point_seabed_p3_agg.dat', 'aggregate Point3 buoy', TRIM(p3_body)) + ELSE + CALL require(.FALSE., 'Point3 buoy: no clump equilibrium to start from') + END IF + CALL case_clear_buoy() CALL case_fold_note_aggregate() IF (failures /= 0) THEN @@ -79,8 +99,81 @@ SUBROUTINE case_flat_static() residual = rows(8, 1) + k_clump*pen - w_clump CALL require(ABS(residual) <= 1.0e-4_wp*w_clump, 'flat static: the footprint reaction kBot*A*pen balances '// & 'the clump with its lines') + eq_x = rows(9, 1) + eq_z = rows(11, 1) + have_eq = ABS(rows(10, 1)) < 1.0e-9_wp END SUBROUTINE case_flat_static + SUBROUTINE case_point3_march(scheme) + !! A Point3 buoy of the clump's mass (BODY Mass 50000, Vol 0) set at the clump's static + !! position: no static solve places a Point3, so it starts there, and it stays at rest only + !! if its own footprint carries the share of its weight that the clump's did (about 1 m of + !! penetration's worth, 1.3e5 N: without it the buoy sinks centimetres in the first steps). + CHARACTER(*), INTENT(IN) :: scheme + REAL(wp), ALLOCATABLE :: rows(:, :) + INTEGER :: es + LOGICAL :: conv + CHARACTER(512) :: em + CHARACTER(64) :: root + + root = 'point_seabed_p3_'//scheme + CALL write_clump_deck(TRIM(root)//'.dat', '2.0', scheme, .FALSE., body_row=TRIM(p3_body)) + CALL CD_Run_Deck_Driver(TRIM(root)//'.dat', TRIM(root), conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'Point3 '//scheme//' march: run: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) RETURN + CALL read_rows(TRIM(root)//'.out', rows) + CALL require(SIZE(rows, 2) > 10, 'Point3 '//scheme//' march: output rows') + IF (SIZE(rows, 2) < 2) RETURN + CALL require(ALL(IEEE_IS_FINITE(rows)), 'Point3 '//scheme//' march: finite outputs') + CALL require(ABS(rows(9, 1) - eq_x) < 1.0e-6_wp .AND. ABS(rows(11, 1) - eq_z) < 1.0e-6_wp, & + 'Point3 '//scheme//' march: the buoy starts at the clump''s static position') + WRITE (*, '(A,ES10.2,A)') ' Point3 buoy ('//scheme//'): largest drift ', & + MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))), ' m' + CALL require(MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))) < 1.0e-3_wp, & + 'Point3 '//scheme//' march: the buoy stays at rest on its own footprint') + END SUBROUTINE case_point3_march + + SUBROUTINE case_clear_buoy() + !! A buoy (Mass 1 t, Vol 10 m^3) tethered 4 m above the seabed by a 4 m line to an anchor + !! below it: its contact is inactive (exactly zero), so the line forces on it balance its + !! net buoyancy alone, statically and through the march. + REAL(wp), ALLOCATABLE :: rows(:, :) + REAL(wp) :: b_net + INTEGER :: es, run + LOGICAL :: conv + CHARACTER(512) :: em + CHARACTER(64) :: root + + b_net = (1025.0_wp*10.0_wp - 1000.0_wp)*G + DO run = 1, 2 + IF (run == 1) THEN + root = 'point_seabed_clear_static' + CALL write_clump_deck(TRIM(root)//'.dat', '0.0', '', .FALSE., point_row='3 Connect 450 0 -190 1000 10 0 0', & + anchor_row='2 Fixed 450 0 -200 0 0 0 0', sec2='2 poly 4 4') + ELSE + root = 'point_seabed_clear_staggered' + CALL write_clump_deck(TRIM(root)//'.dat', '2.0', 'staggered', .FALSE., & + point_row='3 Connect 450 0 -190 1000 10 0 0', anchor_row='2 Fixed 450 0 -200 0 0 0 0', & + sec2='2 poly 4 4') + END IF + CALL CD_Run_Deck_Driver(TRIM(root)//'.dat', TRIM(root), conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'clear buoy: run: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) CYCLE + CALL read_rows(TRIM(root)//'.out', rows) + IF (SIZE(rows, 2) < 1) THEN + CALL require(.FALSE., 'clear buoy: no output row') + CYCLE + END IF + WRITE (*, '(A,F8.4,A)') ' tethered buoy: ', rows(11, 1) + 200.0_wp, ' m above the seabed' + CALL require(rows(11, 1) > -200.0_wp + 3.0_wp, 'clear buoy: the buoy is clear of the seabed') + ! Point3Fz, the line forces on the buoy, balances its net buoyancy with no seabed reaction + CALL require(ABS(rows(8, 1) + b_net) <= 1.0e-6_wp*b_net, 'clear buoy: the line forces balance the net '// & + 'buoyancy alone (no contact)') + IF (run == 2) CALL require(MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))) < 1.0e-3_wp, & + 'clear buoy: the buoy stays at rest') + END DO + END SUBROUTINE case_clear_buoy + SUBROUTINE case_flat_march(scheme) CHARACTER(*), INTENT(IN) :: scheme REAL(wp), ALLOCATABLE :: rows(:, :) @@ -104,12 +197,14 @@ SUBROUTINE case_flat_march(scheme) 'flat '//scheme//' march: the clump stays at rest on the seabed') END SUBROUTINE case_flat_march - SUBROUTINE case_slope() + SUBROUTINE case_slope(scheme) + CHARACTER(*), INTENT(IN) :: scheme REAL(wp), ALLOCATABLE :: rows(:, :) REAL(wp) :: floor_z, gap, s INTEGER :: es, u LOGICAL :: conv CHARACTER(512) :: em + CHARACTER(64) :: root ! a plane rising 2 % toward +x under the whole line, depth 200 m at x = 450 m OPEN (NEWUNIT=u, FILE='point_seabed_slope_bathy.txt', STATUS='REPLACE', ACTION='WRITE') @@ -118,27 +213,30 @@ SUBROUTINE case_slope() WRITE (u, '(A)') '900.0 -100.0 191.0' WRITE (u, '(A)') '900.0 100.0 191.0' CLOSE (u) - CALL write_clump_deck('point_seabed_slope.dat', '1.0', 'staggered', .TRUE.) - CALL CD_Run_Deck_Driver('point_seabed_slope.dat', 'point_seabed_slope', conv, es, em) - CALL require(es == CD_DECKDRV_OK .AND. conv, 'slope: run: '//TRIM(em)) + root = 'point_seabed_slope_'//scheme + CALL write_clump_deck(TRIM(root)//'.dat', '1.0', scheme, .TRUE.) + CALL CD_Run_Deck_Driver(TRIM(root)//'.dat', TRIM(root), conv, es, em) + CALL require(es == CD_DECKDRV_OK .AND. conv, 'slope '//scheme//': run: '//TRIM(em)) IF (es /= CD_DECKDRV_OK) RETURN - CALL read_rows('point_seabed_slope.out', rows) - CALL require(SIZE(rows, 2) > 10, 'slope: output rows') + CALL read_rows(TRIM(root)//'.out', rows) + CALL require(SIZE(rows, 2) > 10, 'slope '//scheme//': output rows') IF (SIZE(rows, 2) < 2) RETURN floor_z = -(211.0_wp - 0.02_wp*(rows(9, 1) + 100.0_wp)) gap = floor_z - rows(11, 1) s = SQRT(1.0_wp + 0.02_wp**2) - WRITE (*, '(A,F8.4,A)') ' sloped seabed: clump ', gap, ' m below the seabed' + WRITE (*, '(A,F8.4,A)') ' sloped seabed ('//scheme//'): clump ', gap, ' m below the seabed' ! the normal law pushes along the surface normal with k*gap/s, whose vertical part k*gap/s^2 ! (with the lines' share) carries the weight - CALL require(gap > 0.0_wp .AND. gap <= s*s*w_clump/k_clump, 'slope: the clump rests on its footprint') + CALL require(gap > 0.0_wp .AND. gap <= s*s*w_clump/k_clump, 'slope '//scheme//': the clump rests on its footprint') CALL require(MAXVAL(ABS(rows(9:11, :) - SPREAD(rows(9:11, 1), 2, SIZE(rows, 2)))) < 1.0e-3_wp, & - 'slope: the clump stays at rest on the sloped seabed') + 'slope '//scheme//': the clump stays at rest on the sloped seabed') END SUBROUTINE case_slope - SUBROUTINE case_flat_aggregate() - !! The OpenFAST aggregate (the coupled point step): the clump starts on its footprint and - !! stays at rest with the fairlead held. Channel 10 is Point3pz. + SUBROUTINE case_flat_aggregate(path, label, body_row) + !! The OpenFAST aggregate (the coupled point step): the clump (or the Point3 buoy of + !! body_row, when not empty) starts on its footprint and stays at rest with the fairlead + !! held. Channel 10 is Point3pz. + CHARACTER(*), INTENT(IN) :: path, label, body_row TYPE(CD_AGG_ModuleType) :: agg REAL(wp), PARAMETER :: DT = 0.05_wp REAL(wp) :: r0(3, 1), v0(3, 1), a0(3, 1), l0(3, 1), z0, z, zmax_dev @@ -146,28 +244,29 @@ SUBROUTINE case_flat_aggregate() LOGICAL :: cv, st CHARACTER(512) :: em - CALL write_clump_deck('point_seabed_agg.dat', '0.0', '', .FALSE.) - CALL CD_AGG_Init_From_Deck(agg, 'point_seabed_agg.dat', DT, es, em) - CALL require(es == CD_AGG_OK, 'aggregate clump: init: '//TRIM(em)) + CALL write_clump_deck(path, '0.0', '', .FALSE., body_row=body_row) + CALL CD_AGG_Init_From_Deck(agg, path, DT, es, em) + CALL require(es == CD_AGG_OK, label//': init: '//TRIM(em)) IF (es /= CD_AGG_OK) RETURN CALL CD_AGG_EvalChannel(agg, 10, z0, es, em) - CALL require(es == CD_AGG_OK, 'aggregate clump: Point3pz: '//TRIM(em)) + CALL require(es == CD_AGG_OK, label//': Point3pz: '//TRIM(em)) CALL require(-200.0_wp - z0 > 0.0_wp .AND. -200.0_wp - z0 <= w_clump/k_clump, & - 'aggregate clump: the clump starts on its footprint') + label//': it starts on its footprint') CALL CD_AGG_GetMovingPointMesh(agg, r0, v0, a0, l0, es, em) - CALL require(es == CD_AGG_OK, 'aggregate clump: moving mesh: '//TRIM(em)) + CALL require(es == CD_AGG_OK, label//': moving mesh: '//TRIM(em)) v0 = 0.0_wp a0 = 0.0_wp zmax_dev = 0.0_wp DO s = 1, 40 CALL CD_AGG_Step_Moving(agg, DT, r0, v0, a0, cv, st, n_iter, es, em) - CALL require(es == CD_AGG_OK .AND. cv, 'aggregate clump: step: '//TRIM(em)) + CALL require(es == CD_AGG_OK .AND. cv, label//': step: '//TRIM(em)) IF (es /= CD_AGG_OK) EXIT CALL CD_AGG_CalcOutput(agg, es, em) CALL CD_AGG_EvalChannel(agg, 10, z, es, em) zmax_dev = MAX(zmax_dev, ABS(z - z0)) END DO - CALL require(zmax_dev < 1.0e-3_wp, 'aggregate clump: the clump stays at rest on the seabed') + WRITE (*, '(A,ES10.2,A)') ' '//label//': largest vertical drift ', zmax_dev, ' m' + CALL require(zmax_dev < 1.0e-3_wp, label//': it stays at rest on the seabed') CALL CD_AGG_End(agg, es, em) END SUBROUTINE case_flat_aggregate @@ -218,11 +317,17 @@ SUBROUTINE case_fold_note_aggregate() CALL CD_AGG_End(agg, es, em) END SUBROUTINE case_fold_note_aggregate - SUBROUTINE write_clump_deck(path, tmax, scheme, sloped) + SUBROUTINE write_clump_deck(path, tmax, scheme, sloped, body_row, point_row, anchor_row, sec2) !! The 50 t clump (deck point 3, Mass only) between two polyester lines on a 200 m seabed. + !! body_row (not empty): point 3 is instead the Body1 attachment of this Point3 BODY row; + !! point_row, anchor_row and sec2 replace the rows of point 3, point 2 and line 2's section. CHARACTER(*), INTENT(IN) :: path, tmax, scheme LOGICAL, INTENT(IN) :: sloped + CHARACTER(*), INTENT(IN), OPTIONAL :: body_row, point_row, anchor_row, sec2 INTEGER :: u + LOGICAL :: p3 + p3 = .FALSE. + IF (PRESENT(body_row)) p3 = LEN_TRIM(body_row) > 0 OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') WRITE (u, '(A)') '--------------------- CableDyn Input File ---' WRITE (u, '(A)') 'Heavy clump weight resting on the seabed between two polyester lines' @@ -230,16 +335,30 @@ SUBROUTINE write_clump_deck(path, tmax, scheme, sloped) WRITE (u, '(A)') 'TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t' WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' WRITE (u, '(A)') 'poly 0.172 31.916 200000000 -1 0 1.2 0.008 1 0' + IF (p3) THEN + WRITE (u, '(A)') '--------------------- BODIES ---' + WRITE (u, '(A)') 'ID Type X Y Z Rot1 Rot2 Rot3 Mass Vol C33 C44 C55 CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (deg) (deg) (deg) (kg) (m3) (N/m) (Nm/rad) (Nm/rad) (m2) (-)' + WRITE (u, '(A)') TRIM(body_row) + END IF WRITE (u, '(A)') '--------------------- POINTS ---' WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' WRITE (u, '(A)') '1 Coupled 0 0 -10 0 0 0 0' - IF (sloped) THEN + IF (PRESENT(anchor_row)) THEN + WRITE (u, '(A)') anchor_row + ELSE IF (sloped) THEN WRITE (u, '(A)') '2 Fixed 800 0 -193 0 0 0 0' ELSE WRITE (u, '(A)') '2 Fixed 800 0 -200 0 0 0 0' END IF - WRITE (u, '(A)') '3 Connect 450 0 -190 50000 0 0 0' + IF (p3) THEN + WRITE (u, '(A)') '3 Body1 0 0 0 0 0 0 0' + ELSE IF (PRESENT(point_row)) THEN + WRITE (u, '(A)') point_row + ELSE + WRITE (u, '(A)') '3 Connect 450 0 -190 50000 0 0 0' + END IF WRITE (u, '(A)') '--------------------- LINES ---' WRITE (u, '(A)') 'ID NodeA NodeB Outputs' WRITE (u, '(A)') '(-) (-) (-) (-)' @@ -249,7 +368,11 @@ SUBROUTINE write_clump_deck(path, tmax, scheme, sloped) WRITE (u, '(A)') 'LineID LineType Length NumSegs' WRITE (u, '(A)') '(-) (-) (m) (-)' WRITE (u, '(A)') '1 poly 520 52' - WRITE (u, '(A)') '2 poly 360 36' + IF (PRESENT(sec2)) THEN + WRITE (u, '(A)') sec2 + ELSE + WRITE (u, '(A)') '2 poly 360 36' + END IF WRITE (u, '(A)') '--------------------- OPTIONS ---' WRITE (u, '(A)') '9.80665 g' WRITE (u, '(A)') '1025.0 rhoW' From bafeba2e1d9f4258c2710955a98e3431d3d58067 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 16 Oct 2026 18:45:45 +0900 Subject: [PATCH 3/5] fix(statics): finite-EI hairpin note follows the static friction The finite-EI note for a grounded run carried past its anchor named "seabed friction or a shorter line" as the remedy. Seabed friction acts in the static solve only with staticsFriction asLaid, so the note now names frictionMu with staticsFriction asLaid, or only a shorter line when asLaid is already on. With asLaid and a layAzimuth that lays the run from the anchor away from the fairlead, the deck itself lays the run past the anchor and no note is made, as for the EI = 0 fold note. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 3 ++- doc/theory.rst | 5 ++++- src/CableDyn_DeckDriver.f90 | 25 +++++++++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6578055..cbd62d47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -195,7 +195,8 @@ All notable changes to CableDyn are recorded in this file. The format follows applies friction against a deck current only), or a shorter line where friction already acts or the route rejects it. A run that `staticsFriction asLaid` lays past its anchor along `layAzimuth` is not noted, nor is a near-vertical line (horizontal span under a tenth of the - water depth) past its end. It is printed on the static, `TMax = 0`, point-system and + water depth) past its end. The finite-EI note now names the same remedy and skips the same + as-laid run. It is printed on the static, `TMax = 0`, point-system and multibody routes and in the OpenFAST initialisation report, which now also prints the initialisation notes of finite-EI cables, and returned in the line report of the OpenFAST aggregate. No example deck prints it, and no result changes. See the manual's theory page diff --git a/doc/theory.rst b/doc/theory.rst index 53ed7ea2..f0688d66 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1346,7 +1346,10 @@ seeded with the CableDyn shape converge to the same layout, and a dynamic run fr rest and returns to it after a disturbance. The standalone driver prints a note when the grounded run of the static layout lies past its anchor (``the static layout carries the grounded run ... m past its anchor``), because the layout differs from the usual one and a -real seabed with friction, or a shorter line, would not reach it. When the 3D solve also +real seabed with friction, or a shorter line, would not reach it. The note names static +seabed friction (``frictionMu`` with ``staticsFriction asLaid``) or a shorter line as the +remedy, only the shorter line when ``asLaid`` is already on, and is not made when ``asLaid`` +with a ``layAzimuth`` away from the fairlead lays the run past the anchor itself. When the 3D solve also fails, the solve stops with the diagnosis (the element-mean compression, where it sits, and its height above the seabed) and suggests ``frictionMu``; neither the pseudo-arclength continuation of the planar path diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index d05e2615..337586b4 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -4204,14 +4204,26 @@ SUBROUTINE anchor_overshoot_note() !! from the fairlead: the line is carried past its anchor and folds back to it (a !! hairpin). A strong current on a frictionless seabed holds such an equilibrium; it !! is reported so that it is not mistaken for the usual layout. Node 1 is the anchor - !! and q_static is in the solve frame, where anchor and fairlead are also given. + !! and q_static is in the solve frame, where anchor and fairlead are also given. With + !! staticsFriction asLaid and a layAzimuth that lays the run from the anchor away from + !! the fairlead, the deck itself lays the run past the anchor, and no note is made. REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp - REAL(wp) :: e_h(2), span, past, floor_z, xg, yg, pos(3) + REAL(wp) :: e_h(2), e_g(2), span, past, floor_z, xg, yg, pos(3), laid_t_n + REAL(wp), ALLOCATABLE :: lay_az_n INTEGER :: k, esb CHARACTER(1024) :: emb + CHARACTER(120) :: remedy span = NORM2(fairlead(1:2) - anchor(1:2)) IF (span <= 1.0e-9_wp*MAX(CD_ONE, SUM(l0))) RETURN e_h = (fairlead(1:2) - anchor(1:2))/span + IF (as_laid) THEN + CALL line_static_friction(opts, ln%id, lay_az_n, laid_t_n) + IF (ALLOCATED(lay_az_n)) THEN + ! the anchor-to-fairlead direction in the global frame of the lay azimuth + e_g = [frame_cs(1)*e_h(1) - frame_cs(2)*e_h(2), frame_cs(2)*e_h(1) + frame_cs(1)*e_h(2)] + IF (DOT_PRODUCT([COS(lay_az_n), SIN(lay_az_n)], e_g) < -1.0e-3_wp) RETURN + END IF + END IF past = CD_ZERO DO k = 1, SIZE(q_static)/6 pos = q_static(6*(k - 1) + 1:6*(k - 1) + 3) @@ -4228,10 +4240,15 @@ SUBROUTINE anchor_overshoot_note() past = MAX(past, -DOT_PRODUCT(pos(1:2) - anchor(1:2), e_h)) END DO IF (past <= 0.01_wp*span + 0.5_wp) RETURN + IF (as_laid) THEN + remedy = 'a shorter line prevents it' + ELSE + remedy = 'static seabed friction (frictionMu with staticsFriction asLaid) or a shorter line '// & + 'prevents it' + END IF WRITE (note_text, '(A,I0,A,F0.2,A)') 'line ', ln%id, ': the static layout carries the grounded run ', & past, ' m past its anchor, where it folds back (a hairpin); a strong current on a frictionless '// & - 'seabed can hold this equilibrium, but check that it is the intended layout (seabed friction or '// & - 'a shorter line prevents it)' + 'seabed can hold this equilibrium, but check that it is the intended layout ('//TRIM(remedy)//')' CALL report_note(note_text) END SUBROUTINE anchor_overshoot_note From 6c70dda7d2727f7472009078d9d77f4f0cbadb74 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 16 Oct 2026 19:26:41 +0900 Subject: [PATCH 4/5] fix(statics): one cause, remedy and as-laid rule for both fold notes The finite-EI note on a run carried past its anchor and the EI = 0 fold note now take their cause and remedy from one helper. The cause is a deck current on the line, a seabed steeper than 0.5 degrees at the fold, or a slack run. The remedy follows the deck's static friction and what the route accepts. The finite-EI static solve applies frictionMu against a deck current under staticsFriction none, so frictionMu answers a current and staticsFriction asLaid a slope; a shorter line remains where that friction already acts or the route rejects it (frictionMu beside Connect/Free points or Point3 buoys, asLaid on the multibody march). The static-only line solve, reached without dtM and TMax, carries no friction at all, so its note says that friction needs dtM and TMax. This replaces the remedy of the previous commit, which assumed that friction acts in the static solve only under asLaid. Both notes now share one as-laid rule: no note is made when the as-laid reference itself, the line laid from its lower end along layAzimuth (by default toward the other end) over its length, reaches past the grounded end by more than the note threshold. This covers a line laid from the anchor away from the fairlead and a line laid from a lower fairlead toward the anchor and beyond it; the finite-EI rule ignored the laying end and the EI = 0 rule only looked at it. Formal OpenFAST linearisation of a deck with a Point3 buoy now fails closed by name, like a deck with Rigid6 bodies or rods, because the quasi-static re-solve holds the buoy at its deck position. A new test checks the layouts behind the no-note tests: the frictionless current carries the run past its anchor, frictionMu holds it short of the threshold, and the as-laid run does lie past the anchor. A finite-EI current hairpin checks the shared cause and remedy, and the static-only slope test checks the new remedy. The docstring of the Point3 test now gives the footprint reaction and the measured sinking without it. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 16 +- CMakeLists.txt | 22 +- doc/openfast.rst | 5 +- doc/theory.rst | 25 ++- doc/troubleshooting.rst | 24 ++- src/CableDyn_DeckDriver.f90 | 314 ++++++++++++++++++---------- src/CableDyn_OpenFAST_Aggregate.f90 | 13 ++ src/openfast/CableDyn_OF.f90 | 11 +- tests/check_fold_layout.py | 78 +++++++ tests/data/fei_hairpin_current.dat | 37 ++++ tests/test_point_seabed_contact.f90 | 5 +- 11 files changed, 414 insertions(+), 136 deletions(-) create mode 100644 tests/check_fold_layout.py create mode 100644 tests/data/fei_hairpin_current.dat diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd62d47..7b20adfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -193,10 +193,13 @@ All notable changes to CableDyn are recorded in this file. The format follows remedy that fits the deck's static friction: `frictionMu` against a current, `staticsFriction asLaid` on a slope (with the default `staticsFriction none` the static solve applies friction against a deck current only), or a shorter line where friction already acts - or the route rejects it. A run that `staticsFriction asLaid` lays past its anchor along - `layAzimuth` is not noted, nor is a near-vertical line (horizontal span under a tenth of the - water depth) past its end. The finite-EI note now names the same remedy and skips the same - as-laid run. It is printed on the static, `TMax = 0`, point-system and + or the route rejects it; a run without `dtM` and `TMax` is told that friction needs them, + since the static-only line solve carries none. A run that the `staticsFriction asLaid` + reference itself lays past its end (laid from the lower end along `layAzimuth`) is not + noted, nor is a near-vertical line (horizontal span under a tenth of the water depth) past + its end. The finite-EI note on a run past its anchor, which named "seabed friction or a + shorter line" whatever the deck, now names the same cause and remedy by the same rule and + skips the same as-laid run. It is printed on the static, `TMax = 0`, point-system and multibody routes and in the OpenFAST initialisation report, which now also prints the initialisation notes of finite-EI cables, and returned in the line report of the OpenFAST aggregate. No example deck prints it, and no result changes. See the manual's theory page @@ -674,8 +677,9 @@ All notable changes to CableDyn are recorded in this file. The format follows equilibrium (which does not place a `Point3` buoy) and in the monolithic, staggered and OpenFAST/C API point steps. The 50 t clump now rests 0.95 m deep (its weight alone presses its 3.44 m² footprint in by 1.43 m) and the 20 t clump 0.67 m. The point routes still reject - `frictionMu`, so the contact is frictionless. - Results change only where a point touches the seabed: of the examples only + `frictionMu`, so the contact is frictionless. Formal OpenFAST linearisation of a deck with a + `Point3` buoy now fails closed by name, like a deck with Rigid6 bodies or rods: its + quasi-static re-solve held the buoy at its deck position. Results change only where a point touches the seabed: of the examples only `clump_weight_free_point.dat`, whose clump now rests 4.7 cm deep instead of 6.6 cm and whose anchor tension falls from 186 kN to 92 kN; decks whose points stay clear of the seabed give identical output. See the manual's theory page (Seabed contact). diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e6f380..7b58ec74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2125,7 +2125,7 @@ add_test(NAME driver_ei0_fold_note_slope COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_fold_slope.dat|slope" "-DONCE=Note: line 1: the static layout carries the grounded run 2[0-9]\\.[0-9]+ m past its anchor, where it folds back;the seabed slope drives the run downhill" - "-DMUST_MATCH=frictionMu with staticsFriction asLaid\\) or a shorter line prevents it" + "-DMUST_MATCH=frictionMu with staticsFriction asLaid, which need dtM and TMax: the static-only solve carries no seabed friction\\) or a shorter line prevents it" -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_slope -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) set_tests_properties(driver_ei0_fold_note_slope PROPERTIES LABELS "fortran;driver;integration;static") @@ -2147,6 +2147,26 @@ foreach(_deck IN ITEMS examples/chain_catenary_shallow_30m tests/data/ei0_hairpi -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) set_tests_properties(${_test} PROPERTIES LABELS "fortran;driver;integration;static") endforeach() +# The finite-EI twin of the current note: the same cause and remedy (fold_cause_remedy). +add_test(NAME driver_fei_fold_note_current + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/fei_hairpin_current.dat|fei_hairpin" + "-DONCE=Note: line 1: the static layout carries the grounded run [0-9.]+ m past its anchor, where it folds back;the current drives the run along the seabed, which holds it only by friction" + "-DMUST_MATCH=seabed friction \\(frictionMu\\) or a shorter line prevents it" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_fei_fold_note_current + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_fei_fold_note_current PROPERTIES LABELS "fortran;driver;integration;static") +# ... and the layouts behind those notes: the frictionless current carries the run past its +# anchor, frictionMu holds it short of the note threshold, and the as-laid run the note skips +# does lie past the anchor (so the no-note tests cannot pass on a layout that never got there). +if(Python3_Interpreter_FOUND) + add_test(NAME driver_ei0_fold_layouts + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_fold_layout.py + $ ${CMAKE_CURRENT_SOURCE_DIR}/tests/data) + set_tests_properties(driver_ei0_fold_layouts PROPERTIES + LABELS "python;driver;integration;static" + ENVIRONMENT "${_cabledyn_python_test_environment}") +endif() # A clamped finite-EI cable with a buoyant section on a Rigid6 body: the body static solve # holds the objects at their deck poses, warns once, and reports no balanced clamped end loads. add_test(NAME driver_clamped_buoyant_held diff --git a/doc/openfast.rst b/doc/openfast.rst index 16c28992..dad65c98 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -329,8 +329,9 @@ without an auxiliary process: the ``.lin`` matrices in the ``.fst`` ``OutFmt``; to compare them with MoorDyn's ``D - C A^-1 B``, use a full-precision format such as ``"ES24.15E3"``, because the usual 4-digit format cannot resolve that reduction. A deck with - Rigid6 bodies or rods is rejected at initialisation: the quasi-static reduction would hold - them at their deck pose instead of re-solving their equilibrium. + Rigid6 bodies, rods or ``Point3`` buoys is rejected at initialisation: the quasi-static + reduction would hold them at their deck pose instead of re-solving their equilibrium (a + ``Free`` point with the buoy's ``Mass``, ``Vol``, ``CdA`` and ``Ca`` is re-solved). * **FAST.Farm** selects CableDyn with ``Mod_SharedMooring = 5`` for shared lines and connections. Gravity, water density, depth, and ``TMax`` are host-owned and must agree across turbines, otherwise initialisation fails. diff --git a/doc/theory.rst b/doc/theory.rst index f0688d66..f41d3357 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1189,9 +1189,16 @@ slope, since with the default ``staticsFriction none`` the static solve applies a deck current only. With ``frictionMu`` and ``staticsFriction none`` on a slope: ``staticsFriction asLaid``. With friction that already acts and still does not hold the run, or on a deck whose route rejects ``frictionMu`` (``Connect``/``Free`` points, ``Point3`` buoys) or -``staticsFriction asLaid`` (bodies and rods): a shorter line. Under ``staticsFriction asLaid`` -with a ``layAzimuth`` that lays the line from its lower end away from its other end, the deck -itself lays the run past that end and no note is made. The note never changes a result. No +``staticsFriction asLaid`` (the multibody march): a shorter line. A run without ``dtM`` and +``TMax`` takes the static-only line solve, which carries no seabed friction at all, so there +the note adds that friction needs ``dtM`` and ``TMax`` (``TMax = 0`` for the statics alone). +Under ``staticsFriction asLaid`` no note is made when the as-laid reference itself (the line +laid on the seabed from its lower end, the anchor or the fairlead when that is lower, along +``layAzimuth`` or by default toward the other end, over its length) reaches past the grounded +end by more than the threshold above: the deck lays the run there, for example from the anchor +away from the fairlead, or from a lower fairlead toward the anchor and beyond it. The same rule +and the same causes and remedies apply to the finite-EI note below. The note never changes a +result. No example deck and no ``EI = 0`` line of the statics test matrices prints it except the folded layouts it describes. @@ -1346,10 +1353,14 @@ seeded with the CableDyn shape converge to the same layout, and a dynamic run fr rest and returns to it after a disturbance. The standalone driver prints a note when the grounded run of the static layout lies past its anchor (``the static layout carries the grounded run ... m past its anchor``), because the layout differs from the usual one and a -real seabed with friction, or a shorter line, would not reach it. The note names static -seabed friction (``frictionMu`` with ``staticsFriction asLaid``) or a shorter line as the -remedy, only the shorter line when ``asLaid`` is already on, and is not made when ``asLaid`` -with a ``layAzimuth`` away from the fairlead lays the run past the anchor itself. When the 3D solve also +real seabed with friction, or a shorter line, would not reach it. The note names the same +cause and remedy as the ``EI = 0`` fold note above (one rule for both): the finite-EI static +solve also applies ``frictionMu`` against a deck current under ``staticsFriction none``, so +``frictionMu`` answers a current and ``staticsFriction asLaid`` a slope, and a shorter line +remains where that friction already acts or the route rejects it (the multibody march rejects +``asLaid``, and a deck with ``Connect``/``Free`` points or ``Point3`` buoys ``frictionMu``). +Under ``asLaid`` no note is made when the as-laid reference itself, the line laid from its +lower end along ``layAzimuth``, reaches past the anchor. When the 3D solve also fails, the solve stops with the diagnosis (the element-mean compression, where it sits, and its height above the seabed) and suggests ``frictionMu``; neither the pseudo-arclength continuation of the planar path diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index cfc457c7..37b95b20 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -648,18 +648,20 @@ Warnings and notes that do not stop a run over one or two periods, as ``examples/data/lozon/generate_gomex80_heave.py`` does. * - ``Note: line ...: the static layout carries the grounded run ... m past its anchor, where it folds back (a hairpin) ...`` - - a very strong current on a frictionless seabed has pushed the line past its anchor, and - it folds back to it (see :doc:`theory`). The layout is a valid, stable equilibrium of the - deck as written, but not the usual one. If the real seabed holds the line, declare - ``frictionMu``; otherwise check the line length and the current, and inspect - ``.static.out`` before using the layout. On an ``EI = 0`` line the note names - the cause, the current, a seabed sloping down past the anchor, or neither (a slack line - laid out and back, which a shorter line removes), and the remedy that fits the deck: with + - a current, or a seabed sloping down past the anchor, has pushed the grounded run past its + anchor where no seabed friction holds it, and it folds back to it (see :doc:`theory`). + The layout is a valid, stable equilibrium of the deck as written, but not the usual one. + Check the line length, the current and the seabed, and inspect + ``.static.out`` before using the layout. The note, finite-EI or ``EI = 0``, + names the cause (the current, the slope, or on an ``EI = 0`` line neither: a slack line + laid out and back, which a shorter line removes) and the remedy that fits the deck: with the default ``staticsFriction none`` the static solve applies ``frictionMu`` against a - deck current only, so on a slope the note points to ``staticsFriction asLaid``, which - holds the run toward its as-laid position; where friction already acts, or the deck's - route rejects it (``Connect``/``Free`` points, ``Point3`` buoys), it points to a shorter - line. A run that ``staticsFriction asLaid`` lays past its anchor along ``layAzimuth`` is + deck current only, so a current points to ``frictionMu`` and a slope to + ``staticsFriction asLaid``, which holds the run toward its as-laid position; a run without + ``dtM`` and ``TMax`` has no seabed friction in its static solve at all; where friction + already acts, or the deck's route rejects it (``frictionMu`` beside ``Connect``/``Free`` + points or ``Point3`` buoys, ``asLaid`` on the multibody march), it points to a shorter + line. A run that the ``staticsFriction asLaid`` reference itself lays past the anchor is the deck's own layout and is not noted. * - ``Note: line ...: the static layout folds the grounded run back on itself (a ... deg turn at node ..., a hairpin) ...`` diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 337586b4..4f68bdea 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -299,6 +299,14 @@ MODULE CableDyn_DeckDriver REAL(wp), PARAMETER :: MAX_WAVE_SAMPLES = 1.0e6_wp ! a wave record above this many samples prints a setup-time note before its O(N^2) reduction INTEGER, PARAMETER :: LONG_WAVE_RECORD = 100000 + ! The static seabed friction a route accepts, for the remedy of a fold note (fold_cause_remedy): + ! none (decks with Connect/Free points or Point3 buoys reject frictionMu), frictionMu but not + ! staticsFriction asLaid (the multibody march), both (line decks), or both only with dtM and + ! TMax (the static-only line solve, which carries no seabed friction). + INTEGER, PARAMETER :: FOLD_FRICTION_NONE = 0, FOLD_FRICTION_NO_AS_LAID = 1, FOLD_FRICTION_FULL = 2, & + FOLD_FRICTION_NEEDS_MARCH = 3 + ! A fold note names the seabed slope as a cause above this gradient, TAN(0.5 deg). + REAL(wp), PARAMETER :: FOLD_SLOPE_MIN = 8.7268677907587893e-3_wp ! real_value_defect classes of an input number INTEGER, PARAMETER :: REAL_OK = 0, REAL_NONFINITE = 1, REAL_SUBNORMAL = 2 ! Admissible input magnitudes (documented in driver_format.md, "Admissible input ranges"). @@ -1075,6 +1083,8 @@ MODULE CableDyn_DeckDriver ! `sys` each mooring step. Populated only when the deck declares RODs (has_rod). LOGICAL :: has_rod = .FALSE. TYPE(CD_RodRuntimeType) :: rod + ! Point3 buoys: stepped as Free points of the EI=0 system, but not placed by the static solve + LOGICAL :: has_point3 = .FALSE. ! Range graphs (LINES flag r, standalone only) and the touchdown references of the ! TDP channels, keyed by deck line id and fixed at the converged initial state. TYPE(CD_RangeSet) :: ranges @@ -1601,7 +1611,7 @@ END SUBROUTINE init_one_finite_model RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, dt, cable, coupled_node, & ErrStat, ErrMsg, standalone_controls, bathymetry, & - fairlead_orientation, init_note, coarse_pass) + fairlead_orientation, init_note, coarse_pass, fold_support) !! Build one COUPLED cubic-Hermite lazy-wave cable (CD_HFMF) from a finite-EI deck !! LINE -- the production Hermite bending path shared by the coupled route and !! standalone and coupled finite-EI dynamics, including flat/structured seabed contact. @@ -1629,6 +1639,9 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, CHARACTER(*), INTENT(OUT), OPTIONAL :: init_note ! Set on the coarsened build of coarse_current_first (see there): no further coarsening. LOGICAL, INTENT(IN), OPTIONAL :: coarse_pass + ! The static seabed friction the calling route accepts (FOLD_FRICTION_*, default + ! FOLD_FRICTION_FULL), for the remedy of the note on a run past the anchor. + INTEGER, INTENT(IN), OPTIONAL :: fold_support INTEGER, ALLOCATABLE :: conn(:, :), fixed_dofs(:), dynamic_fixed_dofs(:) REAL(wp), ALLOCATABLE :: l0(:), ea(:), mpl(:), diam(:), ei(:), gas_in(:), gj_in(:), i_rt_in(:), i_rn_in(:) @@ -4202,56 +4215,76 @@ END SUBROUTINE fine_mesh_note SUBROUTINE anchor_overshoot_note() !! Note a static layout whose grounded run lies beyond the anchor, on the side away !! from the fairlead: the line is carried past its anchor and folds back to it (a - !! hairpin). A strong current on a frictionless seabed holds such an equilibrium; it - !! is reported so that it is not mistaken for the usual layout. Node 1 is the anchor - !! and q_static is in the solve frame, where anchor and fairlead are also given. With - !! staticsFriction asLaid and a layAzimuth that lays the run from the anchor away from - !! the fairlead, the deck itself lays the run past the anchor, and no note is made. + !! hairpin). A current or a seabed slope where no seabed friction holds the run reaches + !! such an equilibrium; it is reported so that it is not mistaken for the usual layout, + !! with the cause and remedy of the EI = 0 fold note (fold_cause_remedy, with the route's + !! fold_support). Node 1 is the anchor and q_static is in the solve frame, where anchor + !! and fairlead are also given (a rotation of the global frame by frame_cs). Under + !! staticsFriction asLaid no note is made when the as-laid reference itself reaches past + !! the anchor (as_laid_reference_past): the deck lays the run there. REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp - REAL(wp) :: e_h(2), e_g(2), span, past, floor_z, xg, yg, pos(3), laid_t_n + REAL(wp) :: e_h(2), e_g(2), span, past, d, floor_z, xg, yg, pos(3), gx, gy, slope_at, laid_t_n + REAL(wp) :: z_nodes(SIZE(q_static)/6) REAL(wp), ALLOCATABLE :: lay_az_n - INTEGER :: k, esb + INTEGER :: k, esb, support CHARACTER(1024) :: emb - CHARACTER(120) :: remedy + CHARACTER(200) :: cause + CHARACTER(320) :: remedy + support = FOLD_FRICTION_FULL + IF (PRESENT(fold_support)) support = fold_support span = NORM2(fairlead(1:2) - anchor(1:2)) IF (span <= 1.0e-9_wp*MAX(CD_ONE, SUM(l0))) RETURN e_h = (fairlead(1:2) - anchor(1:2))/span - IF (as_laid) THEN - CALL line_static_friction(opts, ln%id, lay_az_n, laid_t_n) - IF (ALLOCATED(lay_az_n)) THEN - ! the anchor-to-fairlead direction in the global frame of the lay azimuth - e_g = [frame_cs(1)*e_h(1) - frame_cs(2)*e_h(2), frame_cs(2)*e_h(1) + frame_cs(1)*e_h(2)] - IF (DOT_PRODUCT([COS(lay_az_n), SIN(lay_az_n)], e_g) < -1.0e-3_wp) RETURN + IF (as_laid .AND. support == FOLD_FRICTION_FULL) THEN + ! the reference is laid from the lower end: the fairlead when it lies below the anchor + IF (fairlead(3) < anchor(3)) THEN + d = as_laid_reference_past(opts, ln%id, to_global(fairlead(1:2)), to_global(anchor(1:2)), & + to_global(anchor(1:2)), to_global(e_h), SUM(l0)) + ELSE + d = as_laid_reference_past(opts, ln%id, to_global(anchor(1:2)), to_global(fairlead(1:2)), & + to_global(anchor(1:2)), to_global(e_h), SUM(l0)) END IF + IF (d > 0.01_wp*span + 0.5_wp) RETURN END IF past = CD_ZERO + slope_at = CD_ZERO DO k = 1, SIZE(q_static)/6 pos = q_static(6*(k - 1) + 1:6*(k - 1) + 3) + z_nodes(k) = pos(3) floor_z = contact_z + gx = CD_ZERO + gy = CD_ZERO IF (PRESENT(bathymetry)) THEN IF (.NOT. bathymetry_flat) THEN xg = frame_cs(1)*pos(1) - frame_cs(2)*pos(2) yg = frame_cs(2)*pos(1) + frame_cs(1)*pos(2) - CALL CD_Bathymetry_Floor(bathymetry, xg, yg, floor_z, esb, emb) + CALL CD_Bathymetry_Floor_Gradient(bathymetry, xg, yg, floor_z, gx, gy, esb, emb) IF (esb /= CD_BATHY_OK) RETURN END IF END IF IF (pos(3) > floor_z + GROUNDED_TOL) CYCLE - past = MAX(past, -DOT_PRODUCT(pos(1:2) - anchor(1:2), e_h)) + d = -DOT_PRODUCT(pos(1:2) - anchor(1:2), e_h) + IF (d > past) THEN + past = d + slope_at = SQRT(gx*gx + gy*gy) + END IF END DO IF (past <= 0.01_wp*span + 0.5_wp) RETURN - IF (as_laid) THEN - remedy = 'a shorter line prevents it' - ELSE - remedy = 'static seabed friction (frictionMu with staticsFriction asLaid) or a shorter line '// & - 'prevents it' - END IF + CALL fold_cause_remedy(opts, deck_current_on_line(opts, z_nodes), slope_at > FOLD_SLOPE_MIN, support, & + cause, remedy) WRITE (note_text, '(A,I0,A,F0.2,A)') 'line ', ln%id, ': the static layout carries the grounded run ', & - past, ' m past its anchor, where it folds back (a hairpin); a strong current on a frictionless '// & - 'seabed can hold this equilibrium, but check that it is the intended layout ('//TRIM(remedy)//')' + past, ' m past its anchor, where it folds back (a hairpin); '//TRIM(cause)//'. Check that it is the '// & + 'intended layout ('//TRIM(remedy)//')' CALL report_note(note_text) END SUBROUTINE anchor_overshoot_note + PURE FUNCTION to_global(v) RESULT(g) + !! A horizontal vector of the solve frame in the global frame (frame_cs, a rotation). + REAL(wp), INTENT(IN) :: v(2) + REAL(wp) :: g(2) + g = [frame_cs(1)*v(1) - frame_cs(2)*v(2), frame_cs(2)*v(1) + frame_cs(1)*v(2)] + END FUNCTION to_global + SUBROUTINE report_note(text) !! One initialisation note: printed on a standalone run, appended to init_note. CHARACTER(*), INTENT(IN) :: text @@ -6639,6 +6672,7 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi END IF agg%has_sys = .TRUE. END IF + agg%has_point3 = n_point3 > 0 ! Coupled Rigid6 runtime: build the body states + retain the deck options/points the ! per-step marcher needs (scope validated above -- pure EI=0, non-farm; CdA/Ca only with a ! host fluid field). @@ -6702,10 +6736,14 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi IF (opts%has_bathymetry_file) THEN CALL build_one_hermite_cable(lines(i), sections, types, points, opts, dt, agg%cables(c), cn, es, em, & bathymetry=bathymetry, fairlead_orientation=fairlead_dcm, & - init_note=agg%cable_note(c)) + init_note=agg%cable_note(c), & + fold_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_FULL, & + deck_has_dynamic_points(points))) ELSE CALL build_one_hermite_cable(lines(i), sections, types, points, opts, dt, agg%cables(c), cn, es, em, & - fairlead_orientation=fairlead_dcm, init_note=agg%cable_note(c)) + fairlead_orientation=fairlead_dcm, init_note=agg%cable_note(c), & + fold_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_FULL, & + deck_has_dynamic_points(points))) END IF IF (es /= CD_DECKDRV_OK) THEN ErrStat = es @@ -6762,7 +6800,8 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi IF (agg%line_is_cable(lines(c)%id)) CYCLE CALL ei0_fold_note(lines(c), points, opts, agg%sys%lines(agg%line_obj_index(lines(c)%id))%q, & fold_note, model=agg%sys%lines(agg%line_obj_index(lines(c)%id)), & - friction_support=MERGE(0, 2, deck_has_dynamic_points(points))) + friction_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_FULL, & + deck_has_dynamic_points(points))) IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(agg%init_lines(c)%note, fold_note) END DO END BLOCK @@ -7366,6 +7405,7 @@ SUBROUTINE CD_End_Deck_Aggregate(agg) agg%has_rigid6 = .FALSE. CALL CD_Rod_End(agg%rod) agg%has_rod = .FALSE. + agg%has_point3 = .FALSE. CALL CD_Range_End(agg%ranges) agg%gravity = CD_ZERO agg%rho_water = CD_ZERO @@ -7826,7 +7866,7 @@ SUBROUTINE run_deck_driver(deck_path, out_root, converged, ErrStat, ErrMsg) DO li = 1, nl IF (line_is_finite_ei(lines(li), types, sections)) CYCLE CALL ei0_fold_note(lines(li), points, opts, q_all(q_off(li) + 1:q_off(li + 1)), fold_note, & - bathymetry=bathymetry) + bathymetry=bathymetry, friction_support=FOLD_FRICTION_NEEDS_MARCH) IF (LEN_TRIM(fold_note) > 0) CALL append_note_line(init_summaries(li)%note, fold_note) END DO END BLOCK @@ -9861,14 +9901,12 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry, friction_ !! of the water depth at that end (or of the height of the other end above it), so !! that the direction away from the other end is well defined; or !! (b) the run turns by more than FOLD_TURN_DEG at a node whose neighbours are grounded too. - !! The cause names a deck current that acts anywhere on the line and a seabed steeper than - !! SLOPE_MIN_DEG at the fold; the remedy follows the static seabed friction of the deck - !! (frictionMu, staticsFriction) and friction_support, what the route accepts: - !! 0 no frictionMu (decks with Connect/Free points, Point3 buoys, or body and rod points - !! stepped as system points), 1 frictionMu but not staticsFriction asLaid (the multibody - !! march with bodies or rods), 2 both (the default; line decks). Under staticsFriction - !! asLaid with a layAzimuth that lays the run from its laying end away from the other end - !! the deck itself lays the run past that end, and no note is made. + !! The cause (a deck current on the line, a seabed steeper than 0.5 deg at the + !! fold, or a slack run) and the remedy come from fold_cause_remedy, shared with the + !! finite-EI note; friction_support (FOLD_FRICTION_*, default FOLD_FRICTION_FULL) is the + !! static seabed friction the route accepts. Under staticsFriction asLaid no note is made + !! when the as-laid reference itself reaches past the grounded end (as_laid_reference_past): + !! the deck lays the run there. !! note is empty otherwise, and on a line without a floor. TYPE(DeckLine), INTENT(IN) :: ln TYPE(DeckPoint), INTENT(IN) :: points(:) @@ -9878,32 +9916,31 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry, friction_ TYPE(CD_ModelType), INTENT(IN), OPTIONAL :: model TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry INTEGER, INTENT(IN), OPTIONAL :: friction_support - REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp, FOLD_TURN_DEG = 150.0_wp, SLOPE_MIN_DEG = 0.5_wp + REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp, FOLD_TURN_DEG = 150.0_wp REAL(wp), PARAMETER :: SPAN_MIN_FRAC = 0.1_wp - REAL(wp), PARAMETER :: DEG2RAD = 3.14159265358979323846264338327950288_wp/180.0_wp LOGICAL, ALLOCATABLE :: grounded(:) - REAL(wp), ALLOCATABLE :: slope(:), zfl(:), lay_az - REAL(wp) :: total, span, e_h(2), past, past_e, d, u1(3), u2(3), l1, l2, turn, turn_max, zf, dfdx, dfdy, u(3) - REAL(wp) :: laid_t - INTEGER :: n, k, ie, k_end, k_oth, k_past, k_turn, k_at, end_id, jp, es, support + REAL(wp), ALLOCATABLE :: slope(:), zfl(:), znode(:) + REAL(wp) :: total, span, e_h(2), past, past_e, d, u1(3), u2(3), l1, l2, turn, turn_max, zf, dfdx, dfdy + INTEGER :: n, k, ie, k_end, k_oth, k_past, k_turn, k_at, k_lay, end_id, jp, support LOGICAL :: has_floor, by_current, by_slope, as_laid - CHARACTER(512) :: em CHARACTER(200) :: what, cause CHARACTER(320) :: remedy note = '' - support = 2 + support = FOLD_FRICTION_FULL IF (PRESENT(friction_support)) support = friction_support - as_laid = opts%has_friction .AND. opts%static_friction == CD_STATIC_FRICTION_AS_LAID .AND. support >= 2 + as_laid = opts%has_friction .AND. opts%static_friction == CD_STATIC_FRICTION_AS_LAID .AND. & + support == FOLD_FRICTION_FULL n = SIZE(q)/3 IF (n < 3) RETURN - ALLOCATE (grounded(n), slope(n), zfl(n)) + ALLOCATE (grounded(n), slope(n), zfl(n), znode(n)) DO k = 1, n CALL floor_at(q(3*k - 2), q(3*k - 1), has_floor, zf, dfdx, dfdy) IF (.NOT. has_floor) RETURN grounded(k) = q(3*k) <= zf + GROUNDED_TOL slope(k) = SQRT(dfdx*dfdx + dfdy*dfdy) zfl(k) = zf + znode(k) = q(3*k) END DO IF (COUNT(grounded) < 2) RETURN total = CD_ZERO @@ -9927,14 +9964,13 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry, friction_ IF (span < SPAN_MIN_FRAC*MAX(-zfl(k_end), q(3*k_oth) - q(3*k_end)) .OR. & span <= 1.0e-6_wp*MAX(CD_ONE, total)) CYCLE e_h = (q(3*k_oth - 2:3*k_oth - 1) - q(3*k_end - 2:3*k_end - 1))/span - ! staticsFriction asLaid lays the line from its lower end (node 1, or node n when that is - ! lower) along layAzimuth: laid away from the other end, the run lies past this end by - ! the deck's own lay, and friction holds it there - IF (as_laid .AND. k_end == MERGE(n, 1, q(3*n) < q(3))) THEN - CALL line_static_friction(opts, ln%id, lay_az, laid_t) - IF (ALLOCATED(lay_az)) THEN - IF (DOT_PRODUCT([COS(lay_az), SIN(lay_az)], e_h) < -1.0e-3_wp) RETURN - END IF + ! staticsFriction asLaid holds the run toward its as-laid position: where that reference + ! itself reaches past this end, the deck lays the run there (as_laid_reference_past) + IF (as_laid) THEN + k_lay = MERGE(n, 1, q(3*n) < q(3)) + IF (as_laid_reference_past(opts, ln%id, q(3*k_lay - 2:3*k_lay - 1), & + q(3*(n + 1 - k_lay) - 2:3*(n + 1 - k_lay) - 1), & + q(3*k_end - 2:3*k_end - 1), e_h, total) > 0.01_wp*span + 0.5_wp) RETURN END IF past_e = CD_ZERO DO k = 1, n @@ -9991,49 +10027,9 @@ SUBROUTINE ei0_fold_note(ln, points, opts, q, note, model, bathymetry, friction_ ! the cause: a deck current on the line (its drag on the suspended span pulls the run as ! well as the drag on the run itself, so a profile still at the seabed counts), a seabed ! sloping at the fold, or neither (a slack run) - by_current = .FALSE. - IF (opts%has_current) THEN - DO k = 1, n - u = deck_current_velocity(opts, q(3*k), es, em) - IF (es /= CD_HYDRO_OK) CYCLE - IF (NORM2(u) > CD_ZERO) THEN - by_current = .TRUE. - EXIT - END IF - END DO - END IF - by_slope = slope(k_at) > TAN(SLOPE_MIN_DEG*DEG2RAD) - IF (by_current .AND. by_slope) THEN - cause = 'the current and the seabed slope drive the run along the seabed, which holds it only by friction' - ELSE IF (by_current) THEN - cause = 'the current drives the run along the seabed, which holds it only by friction' - ELSE IF (by_slope) THEN - cause = 'the seabed slope drives the run downhill, which the seabed holds only by friction' - ELSE - cause = 'the run carries no tension, so nothing sets its layout on the seabed' - END IF - ! the remedy, from the static seabed friction the deck has and the route accepts - IF (.NOT. (by_current .OR. by_slope)) THEN - remedy = 'a shorter line prevents it' - ELSE IF (support <= 0) THEN - remedy = 'a shorter line prevents it; seabed friction (frictionMu) is not supported on this deck' - ELSE IF (as_laid) THEN - remedy = 'a shorter line prevents it; the as-laid seabed friction (staticsFriction asLaid) does not hold '// & - 'the run there' - ELSE IF (by_slope .AND. support >= 2 .AND. opts%has_friction) THEN - remedy = 'staticsFriction asLaid or a shorter line prevents it; with staticsFriction none the static solve '// & - 'applies frictionMu against a deck current only' - ELSE IF (by_slope .AND. support >= 2) THEN - remedy = 'seabed friction toward the as-laid position (frictionMu with staticsFriction asLaid) or a shorter '// & - 'line prevents it' - ELSE IF (by_slope) THEN - remedy = 'a shorter line prevents it; the static solve of this deck applies seabed friction against a deck '// & - 'current only' - ELSE IF (opts%has_friction) THEN - remedy = 'a shorter line prevents it; frictionMu does not hold the run against this current' - ELSE - remedy = 'seabed friction (frictionMu) or a shorter line prevents it' - END IF + by_current = deck_current_on_line(opts, znode) + by_slope = slope(k_at) > FOLD_SLOPE_MIN + CALL fold_cause_remedy(opts, by_current, by_slope, support, cause, remedy) note = 'line '//TRIM(int_to_str(ln%id))//': '//TRIM(what)//'; '//TRIM(cause)//'. Check that it is the '// & 'intended layout ('//TRIM(remedy)//')' @@ -10094,6 +10090,105 @@ SUBROUTINE add_model_fold_notes(lines, points, opts, models, summaries, friction END DO END SUBROUTINE add_model_fold_notes + LOGICAL FUNCTION deck_current_on_line(opts, z) RESULT(on) + !! Whether the deck current is non-zero at any of the node elevations z: its drag on the + !! suspended span pulls a grounded run as well as its drag on the run itself, so a current + !! profile that vanishes at the seabed still counts. + TYPE(DeckOptions), INTENT(IN) :: opts + REAL(wp), INTENT(IN) :: z(:) + REAL(wp) :: u(3) + INTEGER :: k, es + CHARACTER(512) :: em + on = .FALSE. + IF (.NOT. opts%has_current) RETURN + DO k = 1, SIZE(z) + u = deck_current_velocity(opts, z(k), es, em) + IF (es /= CD_HYDRO_OK) CYCLE + IF (NORM2(u) > CD_ZERO) THEN + on = .TRUE. + RETURN + END IF + END DO + END FUNCTION deck_current_on_line + + SUBROUTINE fold_cause_remedy(opts, by_current, by_slope, support, cause, remedy) + !! The cause and the remedy named by a note on a grounded run folded past its end (the + !! EI = 0 ei0_fold_note and the finite-EI anchor_overshoot_note). The cause is the deck + !! current, the seabed slope at the fold, both, or neither (a slack run). The remedy + !! follows the deck's static seabed friction and support, the friction the route accepts + !! (FOLD_FRICTION_*): with staticsFriction none the static solve applies frictionMu against + !! a deck current only, so frictionMu answers a current and staticsFriction asLaid a slope; + !! where that friction already acts, or the route rejects it, a shorter line remains; the + !! static-only line solve carries no friction at all, so there friction needs dtM and TMax. + TYPE(DeckOptions), INTENT(IN) :: opts + LOGICAL, INTENT(IN) :: by_current, by_slope + INTEGER, INTENT(IN) :: support + CHARACTER(*), INTENT(OUT) :: cause, remedy + LOGICAL :: as_laid + as_laid = opts%has_friction .AND. opts%static_friction == CD_STATIC_FRICTION_AS_LAID + IF (by_current .AND. by_slope) THEN + cause = 'the current and the seabed slope drive the run along the seabed, which holds it only by friction' + ELSE IF (by_current) THEN + cause = 'the current drives the run along the seabed, which holds it only by friction' + ELSE IF (by_slope) THEN + cause = 'the seabed slope drives the run downhill, which the seabed holds only by friction' + ELSE + cause = 'the run carries no tension, so nothing sets its layout on the seabed' + END IF + IF (.NOT. (by_current .OR. by_slope)) THEN + remedy = 'a shorter line prevents it' + ELSE IF (support == FOLD_FRICTION_NEEDS_MARCH .AND. by_slope) THEN + remedy = 'seabed friction toward the as-laid position (frictionMu with staticsFriction asLaid, which need '// & + 'dtM and TMax: the static-only solve carries no seabed friction) or a shorter line prevents it' + ELSE IF (support == FOLD_FRICTION_NEEDS_MARCH) THEN + remedy = 'seabed friction (frictionMu, which needs dtM and TMax: the static-only solve carries no seabed '// & + 'friction) or a shorter line prevents it' + ELSE IF (support == FOLD_FRICTION_NONE) THEN + remedy = 'a shorter line prevents it; seabed friction (frictionMu) is not supported on this deck' + ELSE IF (as_laid .AND. support == FOLD_FRICTION_FULL) THEN + remedy = 'a shorter line prevents it; the as-laid seabed friction (staticsFriction asLaid) does not hold '// & + 'the run there' + ELSE IF (by_slope .AND. support == FOLD_FRICTION_FULL .AND. opts%has_friction) THEN + remedy = 'staticsFriction asLaid or a shorter line prevents it; with staticsFriction none the static solve '// & + 'applies frictionMu against a deck current only' + ELSE IF (by_slope .AND. support == FOLD_FRICTION_FULL) THEN + remedy = 'seabed friction toward the as-laid position (frictionMu with staticsFriction asLaid) or a shorter '// & + 'line prevents it' + ELSE IF (by_slope) THEN + remedy = 'a shorter line prevents it; the static solve of this deck applies seabed friction against a deck '// & + 'current only' + ELSE IF (opts%has_friction) THEN + remedy = 'a shorter line prevents it; frictionMu does not hold the run against this current' + ELSE + remedy = 'seabed friction (frictionMu) or a shorter line prevents it' + END IF + END SUBROUTINE fold_cause_remedy + + REAL(wp) FUNCTION as_laid_reference_past(opts, line_id, lay_xy, other_xy, end_xy, e_h, laid_len) RESULT(past) + !! How far [m] the staticsFriction asLaid reference of a line reaches past one of its ends, + !! on the side away from the other end: the line laid on the seabed from its lower end + !! lay_xy (the anchor, or the fairlead when that is lower; other_xy is the other end) along + !! layAzimuth, by default toward the other end, over its length laid_len. end_xy is the + !! end tested and e_h the unit horizontal direction from it toward the line's other end; + !! global coordinates. The laid run is straight in plan, so its farthest point past the end + !! is one of its two ends; on a sloped seabed its plan length is shorter than laid_len, so + !! the distance is an upper bound. Zero for a reference that stays on the near side. + TYPE(DeckOptions), INTENT(IN) :: opts + INTEGER, INTENT(IN) :: line_id + REAL(wp), INTENT(IN) :: lay_xy(2), other_xy(2), end_xy(2), e_h(2), laid_len + REAL(wp), ALLOCATABLE :: lay_az + REAL(wp) :: laid_t, dir(2), h + CALL line_static_friction(opts, line_id, lay_az, laid_t) + IF (ALLOCATED(lay_az)) THEN + dir = [COS(lay_az), SIN(lay_az)] + ELSE + h = NORM2(other_xy - lay_xy) + dir = [CD_ONE, CD_ZERO] + IF (h > 1.0e-9_wp*MAX(CD_ONE, laid_len)) dir = (other_xy - lay_xy)/h + END IF + past = MAX(CD_ZERO, -DOT_PRODUCT(lay_xy - end_xy, e_h), -DOT_PRODUCT(lay_xy + laid_len*dir - end_xy, e_h)) + END FUNCTION as_laid_reference_past + SUBROUTINE solve_one_line(ln, sections, types, points, opts, q, tension, converged, ErrStat, ErrMsg, bathymetry, & end_ten, end_force) !! Solve one EI=0 line (Fixed anchor -> Coupled/held fairlead) built from its ordered @@ -18603,7 +18698,8 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod ! frictionMu is rejected beside Connect/Free points and Point3 buoys, and staticsFriction asLaid ! on every multibody deck CALL collect_system_init_summaries(sys_lines, points, mb%system, sum_sys, ErrStat, ErrMsg, opts=opts, & - friction_support=MERGE(0, 1, deck_has_dynamic_points(pc))) + friction_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_NO_AS_LAID, & + deck_has_non_rigid6_dynamic_points(points, bodies))) IF (ErrStat /= CD_DECKDRV_OK) GOTO 900 ELSE ALLOCATE (sum_sys(0)) @@ -18664,14 +18760,18 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod lnc%endconn_ez_ref(:, 1) = dclamp CALL build_one_hermite_cable(lnc, sections, types, pc, opts, opts%dtM, mb%cables(c), node, & ErrStat, ErrMsg, standalone_controls=.TRUE., bathymetry=bathymetry, & - fairlead_orientation=TRANSPOSE(rclamp)) + fairlead_orientation=TRANSPOSE(rclamp), & + fold_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_NO_AS_LAID, & + deck_has_non_rigid6_dynamic_points(points, bodies))) END BLOCK ! re-stepped inside the outer Newton of the monolithic step: its end loads must be ! converged well inside the junction tolerance mb%cables(c)%tol = MIN(mb%cables(c)%tol, CLAMPED_CABLE_TOL) ELSE CALL build_one_hermite_cable(cab_lines(c), sections, types, pc, opts, opts%dtM, mb%cables(c), node, & - ErrStat, ErrMsg, standalone_controls=.TRUE., bathymetry=bathymetry) + ErrStat, ErrMsg, standalone_controls=.TRUE., bathymetry=bathymetry, & + fold_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_NO_AS_LAID, & + deck_has_non_rigid6_dynamic_points(points, bodies))) END IF IF (ErrStat /= CD_DECKDRV_OK) GOTO 900 END DO @@ -24390,7 +24490,9 @@ SUBROUTINE hermite_end_loads(jl, fm, km, rot) IF (opts%dtM > CD_ZERO) dtb = opts%dtM CALL build_one_hermite_cable(lnc, sections, types, pc, opts, dtb, cab, node, ErrStat, ErrMsg, & standalone_controls=.TRUE., bathymetry=bathymetry, & - fairlead_orientation=TRANSPOSE(rclamp), init_note=note) + fairlead_orientation=TRANSPOSE(rclamp), init_note=note, & + fold_support=MERGE(FOLD_FRICTION_NONE, FOLD_FRICTION_NO_AS_LAID, & + deck_has_non_rigid6_dynamic_points(points, bodies))) IF (ErrStat == CD_DECKDRV_OK) THEN CALL CD_HFMF_CalcOutput(cab, fm(1:3), es, em, y_moment=fm(4:6)) IF (es /= CD_HFMF_OK) CALL fail_solve(ErrStat, ErrMsg, 'finite-EI LINE '//TRIM(int_to_str(lnc%id))// & @@ -32088,7 +32190,7 @@ SUBROUTINE collect_model_init_summaries(lines, points, models, summaries, ErrSta END IF CALL set_init_summary(lines(i)%id, tension, declination, azimuth, summaries(i), fair_force=fair_force) END DO - IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, models, summaries, 2) + IF (PRESENT(opts)) CALL add_model_fold_notes(lines, points, opts, models, summaries, FOLD_FRICTION_FULL) END SUBROUTINE collect_model_init_summaries SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrStat, ErrMsg, opts, friction_support) @@ -32099,8 +32201,8 @@ SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrSt INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg !! opts (optional): add each line's static fold note (ei0_fold_note), with the route's - !! friction_support (default 0: a system of Connect/Free, Point3, body or rod points, whose - !! deck rejects frictionMu) + !! friction_support (default FOLD_FRICTION_NONE: a system of Connect/Free, Point3, body or + !! rod points, whose deck rejects frictionMu) TYPE(DeckOptions), INTENT(IN), OPTIONAL :: opts INTEGER, INTENT(IN), OPTIONAL :: friction_support TYPE(ModelOutputWorkspace) :: work @@ -32132,7 +32234,7 @@ SUBROUTINE collect_system_init_summaries(lines, points, system, summaries, ErrSt IF (PRESENT(friction_support)) THEN CALL add_model_fold_notes(lines, points, opts, system%lines, summaries, friction_support) ELSE - CALL add_model_fold_notes(lines, points, opts, system%lines, summaries, 0) + CALL add_model_fold_notes(lines, points, opts, system%lines, summaries, FOLD_FRICTION_NONE) END IF END IF END SUBROUTINE collect_system_init_summaries diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index 710bf0c5..e60e5abf 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -96,6 +96,7 @@ MODULE CableDyn_OpenFAST_Aggregate PUBLIC :: CD_AGG_NDynamicPoints PUBLIC :: CD_AGG_HasRigid6 PUBLIC :: CD_AGG_HasRod + PUBLIC :: CD_AGG_HasPoint3 PUBLIC :: CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, CD_AGG_Set_Rigid6_States PUBLIC :: CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States, CD_AGG_Set_Rod_States PUBLIC :: CD_AGG_Refresh_PointMesh @@ -215,6 +216,8 @@ MODULE CableDyn_OpenFAST_Aggregate ! Coupled Rigid6 bodies (pure EI=0 deck): the opaque runtime the facade marches over the ! EI=0 system each mooring step, in place of the plain moving step. has_rigid6 selects the ! body-march branch; the runtime's own snapshot buffer joins the aggregate snapshot/restore. + ! Point3 buoys among the Free points of the EI=0 system (CD_AGG_HasPoint3). + LOGICAL :: has_point3 = .FALSE. LOGICAL :: has_rigid6 = .FALSE. TYPE(CD_Rigid6RuntimeType) :: rigid6 ! Coupled rigid RODS: the rod twin of the Rigid6 runtime above. has_rod selects the rod-march @@ -374,6 +377,7 @@ SUBROUTINE CD_AGG_Init_From_Deck(self, deck_path, dt, ErrStat, ErrMsg, env_gravi candidate%has_rigid6 = parts%has_rigid6 IF (parts%has_rigid6) candidate%rigid6 = parts%rigid6 candidate%has_rod = parts%has_rod + candidate%has_point3 = parts%has_point3 IF (parts%has_rod) candidate%rod = parts%rod candidate%nhost_rod = 0 IF (parts%has_rod) candidate%nhost_rod = CD_Rod_NHost(candidate%rod) @@ -1981,6 +1985,7 @@ SUBROUTINE CD_AGG_End(self, ErrStat, ErrMsg) self%has_rigid6 = .FALSE. CALL CD_Rod_End(self%rod) self%has_rod = .FALSE. + self%has_point3 = .FALSE. CALL CD_Range_End(self%ranges) self%nhost_rod = 0 self%nhost_body = 0 @@ -2588,6 +2593,14 @@ LOGICAL FUNCTION CD_AGG_HasRod(self) RESULT(has) has = self%has_rod .AND. CD_Rod_NRods(self%rod) > 0 END FUNCTION CD_AGG_HasRod + LOGICAL FUNCTION CD_AGG_HasPoint3(self) RESULT(has) + !! True iff the deck has a Point3 buoy, which the EI=0 system steps as a Free point but + !! the static solve does not place: it starts, and a static re-solve holds it, at its deck + !! position. + TYPE(CD_AGG_ModuleType), INTENT(IN) :: self + has = self%has_point3 + END FUNCTION CD_AGG_HasPoint3 + INTEGER FUNCTION CD_AGG_Rigid6_MirrorSize(self) RESULT(n) !! Reals the checkpoint mirror must reserve for the aggregate's Rigid6 bodies (0 if none). TYPE(CD_AGG_ModuleType), INTENT(IN) :: self diff --git a/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90 index 00f1adaa..8cab4b7d 100644 --- a/src/openfast/CableDyn_OF.f90 +++ b/src/openfast/CableDyn_OF.f90 @@ -77,7 +77,7 @@ MODULE CableDyn CD_AGG_Snapshot, CD_AGG_Restore, & CD_AGG_NMovingPoints, CD_AGG_NDynamicPoints, CD_AGG_Refresh_PointMesh, & CD_AGG_NFailures, CD_AGG_Get_Substep_Counts, & - CD_AGG_HasRigid6, CD_AGG_HasRod, & + CD_AGG_HasRigid6, CD_AGG_HasRod, CD_AGG_HasPoint3, & CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, & CD_AGG_Set_Rigid6_States, & CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States, CD_AGG_Set_Rod_States, & @@ -741,6 +741,15 @@ SUBROUTINE CD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er '(linearize a deck without BODIES/RODS).', ErrStat, ErrMsg, RoutineName ) RETURN END IF + ! A Point3 buoy steps as a Free point, but the static solve holds it at its deck position: + ! each perturbed re-solve would leave it there and omit its compliance as well. + IF (InitInp%Linearize .AND. CD_AGG_HasPoint3( Inst(id)%agg )) THEN + CALL SetErrStat( ErrID_Fatal, 'CableDyn mooring module: formal OpenFAST linearization '// & + 'with Point3 buoys is not supported; the quasi-static reduction holds a '// & + 'Point3 buoy at its deck position instead of re-solving its equilibrium '// & + '(model the buoy as a Free point to linearize).', ErrStat, ErrMsg, RoutineName ) + RETURN + END IF IF (InitInp%Linearize .AND. Inst(id)%agg%ncable > 0) THEN DO ic = 1, Inst(id)%agg%ncable ! a line restrained in torsion returns a torque moment that turns with the platform diff --git a/tests/check_fold_layout.py b/tests/check_fold_layout.py new file mode 100644 index 00000000..0edbde8b --- /dev/null +++ b/tests/check_fold_layout.py @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: Apache-2.0 +"""The layouts behind the EI = 0 fold-note tests (driver_ei0_fold_note_* in CMakeLists.txt). + +Those tests check that a note is printed or not; this one checks that the static layouts are +the ones the notes are about, so that a silent no-note test cannot pass on a layout that never +reached past its anchor. The anchor of each chain is at x = 450 m, its fairlead at x = 0, and +the note threshold is 1 % of the 450 m span plus 0.5 m, so a grounded node past the anchor by +more than 5 m (x > 455 m) is a run carried past it: + +* ei0_hairpin_current.dat (a 2 m/s current, frictionless seabed): the run reaches past the + anchor, and the driver notes it; +* ei0_hairpin_current_friction.dat (the same with frictionMu 0.5): friction holds the run + short of the threshold, so there is nothing to note; +* ei0_aslaid_behind_anchor.dat (staticsFriction asLaid, layAzimuth 0, away from the + fairlead): the run does lie past the anchor, laid there by the deck, which the note skips. + +Usage: check_fold_layout.py +""" + +import pathlib +import subprocess +import sys +import tempfile + +ANCHOR_X = 450.0 +THRESHOLD = 0.01 * 450.0 + 0.5 +FLOOR_Z = -100.0 +GROUNDED_TOL = 0.05 +NODES = 53 + + +def node_positions(exe, deck): + """The static x and z of every node of line 1 (deck node 1 = End A ... 53 = End B).""" + text = deck.read_text(encoding="utf-8") + head = text.split("--------------------- OUTPUTS")[0] + channels = [f"L1N{k}px" for k in range(1, NODES + 1)] + [f"L1N{k}pz" for k in range(1, NODES + 1)] + body = head + "--------------------- OUTPUTS ---\n" + "\n".join(channels) + "\n--------------------- END ---\n" + with tempfile.TemporaryDirectory() as tmp: + path = pathlib.Path(tmp) / deck.name + path.write_text(body, encoding="utf-8", newline="\n") + run = subprocess.run([exe, str(path), "layout"], cwd=tmp, capture_output=True, text=True) + if run.returncode != 0: + raise SystemExit(f"{deck.name}: driver failed ({run.returncode}):\n{run.stdout}\n{run.stderr}") + rows = (pathlib.Path(tmp) / "layout.out").read_text(encoding="utf-8").splitlines() + values = [float(v) for v in rows[2].split()[1:]] + return values[:NODES], values[NODES:] + + +def farthest_grounded_x(exe, deck): + xs, zs = node_positions(exe, deck) + grounded = [x for x, z in zip(xs, zs) if z <= FLOOR_Z + GROUNDED_TOL] + if not grounded: + raise SystemExit(f"{deck.name}: no grounded node") + return max(grounded) + + +def main(): + exe, data = str(pathlib.Path(sys.argv[1]).resolve()), pathlib.Path(sys.argv[2]).resolve() + failures = [] + x = farthest_grounded_x(exe, data / "ei0_hairpin_current.dat") + print(f"frictionless current: grounded run reaches x = {x:.3f} m") + if not x > ANCHOR_X + THRESHOLD: + failures.append("the frictionless current deck does not carry the run past its anchor") + x = farthest_grounded_x(exe, data / "ei0_hairpin_current_friction.dat") + print(f"current with frictionMu: grounded run reaches x = {x:.3f} m") + if not x <= ANCHOR_X + THRESHOLD: + failures.append("frictionMu does not hold the run short of its anchor") + x = farthest_grounded_x(exe, data / "ei0_aslaid_behind_anchor.dat") + print(f"as laid behind the anchor: grounded run reaches x = {x:.3f} m") + if not x > ANCHOR_X + THRESHOLD: + failures.append("the as-laid run does not lie past its anchor, so the skipped note is not exercised") + for f in failures: + print("FAIL: " + f) + return 1 if failures else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/data/fei_hairpin_current.dat b/tests/data/fei_hairpin_current.dat new file mode 100644 index 00000000..88e6e97c --- /dev/null +++ b/tests/data/fei_hairpin_current.dat @@ -0,0 +1,37 @@ +--------------------- CableDyn Input File --------------------------- +Finite-EI lazy wave carried 2 m past its anchor by a 1.9 m/s current on a frictionless seabed (the cable statics matrix case CUR_1013; noted) +--------------------- LINE TYPES ------------------------------------ +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (N-m2) (-) (-) (-) (-) +bare 0.1784650716 82.63060908 255233842 0 25945.91551 1.2 0.1 1 0 +buoy 0.4710966462 88.94142595 255233842 0 40205.41756 1.2 0.1 1 0 +--------------------- POINTS ---------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0 0 -13.08348484 +2 Fixed 41.77649681 0 -42.543 +--------------------- LINES ----------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS -------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 bare 20.5504 2 +1 buoy 7.3589 1 +1 bare 35.1167 4 +--------------------- OPTIONS --------------------------------------- +9.80665 g +1025.0 rhoW +42.543 WtrDpth +3e+06 kBot +1.0e4 cBot +0.05 dtM +0.0 TMax +False adaptive_mesh +True tensile_safety +uniform 1.906 0.0 0.0 current +--------------------- OUTPUTS --------------------------------------- +"FairTen1" +"AnchTen1" +--------------------- need this line -------------------------------- diff --git a/tests/test_point_seabed_contact.f90 b/tests/test_point_seabed_contact.f90 index 682c5ad6..bcd7c056 100644 --- a/tests/test_point_seabed_contact.f90 +++ b/tests/test_point_seabed_contact.f90 @@ -107,8 +107,9 @@ END SUBROUTINE case_flat_static SUBROUTINE case_point3_march(scheme) !! A Point3 buoy of the clump's mass (BODY Mass 50000, Vol 0) set at the clump's static !! position: no static solve places a Point3, so it starts there, and it stays at rest only - !! if its own footprint carries the share of its weight that the clump's did (about 1 m of - !! penetration's worth, 1.3e5 N: without it the buoy sinks centimetres in the first steps). + !! if its own footprint carries the share of its weight that the clump's did, kBot*A*pen = + !! 3.44e5 N/m * 0.95 m = 3.3e5 N (without it the buoy sinks about 2.8 m into the seabed + !! over the 2 s march, against the 1e-3 m bound here). CHARACTER(*), INTENT(IN) :: scheme REAL(wp), ALLOCATABLE :: rows(:, :) INTEGER :: es From d8bfeb524eee316074c9bc03ac17ceee14ca4dbf Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sat, 17 Oct 2026 21:41:38 +0900 Subject: [PATCH 5/5] fix: deck numbering in the fold and spike notes; point contact and the sub-step estimate On top of dev's run audit, deck-node channels and explicit object sub-step estimate: - The fold note of an EI = 0 line names the node of a turn by its deck number (1 = End A, the of the node channels; EI = 0 lines are never refined), and the manual says so. A new deck folds a slack chain between two grounded ends in a current (180 deg at node 49): driver_ei0_fold_note_turn checks the note, and driver_ei0_fold_layouts checks that node 49 is the deck node of the fold in the static layout. - The run audit's spike warning numbered its segment in internal order (End B first); it now counts from End A, as .Line.t.out and the fold note do. No result changes. - The manual states that the seabed contact of Free/Connect points and Point3 buoys is linearly implicit in the point step (stiffness and damping in the effective mass, like the end blocks of the lines), so it sets no step limit and the explicit object sub-step estimate leaves it out, as it leaves out the implicit seabed damping and friction. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 16 ++++---------- CMakeLists.txt | 11 ++++++++++ doc/theory.rst | 17 ++++++++++----- doc/troubleshooting.rst | 5 +++-- src/CableDyn_DeckDriver.f90 | 9 ++++---- tests/check_fold_layout.py | 20 ++++++++++++++--- tests/data/ei0_fold_turn_current.dat | 32 ++++++++++++++++++++++++++++ 7 files changed, 84 insertions(+), 26 deletions(-) create mode 100644 tests/data/ei0_fold_turn_current.dat diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b20adfc..0d3639aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,7 +99,8 @@ All notable changes to CableDyn are recorded in this file. The format follows tension, or that of its viscoelastic or Syrope law) at one step exceeds four times its own one step before and after, ten times the largest tension anywhere on the line one step before and after, and the largest tension of the initial state. The first spike of a line is reported as - a warning, once per line, and the run summary counts them. The run ends with a note when a + a warning, once per line, naming its segment from End A as `.Line.t.out` numbers it, and + the run summary counts them. The run ends with a note when a taut segment turned by more than 1° in one solver step (with `ei0_substeps auto`, see Changed, 1.1 times the larger of 1° and `ei0_substep_angle`; the sub-steps of a sub-stepped or recovered step count as steps; the mean and standard deviation of the tension err by about @@ -188,7 +189,8 @@ All notable changes to CableDyn are recorded in this file. The format follows the grounded run of a tension-only line past its anchor where no seabed friction holds it, and it folds back with zero tension at the fold: a 2 m/s current carried a chain 20 m past its anchor, a 5° slope 24 m, without a word. The equilibrium is kept, and one note per line names - the fold (the distance past the anchor, or a turn above 150° of the grounded run), its cause + the fold (the distance past the anchor, or a turn above 150° of the grounded run at a deck + node, numbered from End A as the node channels), its cause (a deck current on the line, a seabed steeper than 0.5° at the fold, or a slack run) and the remedy that fits the deck's static friction: `frictionMu` against a current, `staticsFriction asLaid` on a slope (with the default `staticsFriction none` the static solve @@ -656,16 +658,6 @@ All notable changes to CableDyn are recorded in this file. The format follows OPTION); an anchor below the seabed by more than the tolerance gives the depth, the tolerance rule, and the Z to use. These messages change no acceptance rule. -- `Free` and `Connect` points (clump weights, buoys) now have their own seabed contact. Until - now only the end nodes of the attached lines held a point on the seabed, over their - tributary length, so a heavy clump sank silently into it: a 50 t clump between two polyester - lines ended 2.8 m below the seabed, a 20 t clump on chain 1.0 m. A point with `Mass` or `Vol` - now rests on a footprint `A = V^(2/3)` (`V` = `Vol`, or `Mass`/7850 kg/m³ for a clump declared - by its mass alone) with the line contact law, stiffness `kBot·A` and damping `cBot·A`, along - the surface normal on a bathymetry, in the point static equilibrium and in the monolithic, - staggered and OpenFAST point steps; MoorDyn points have no seabed contact. The 50 t clump now - rests 0.95 m deep (its weight alone presses its 3.44 m² footprint in by 1.43 m) and the 20 t - clump 0.67 m. The point routes still reject `frictionMu`, so the contact is frictionless. - `Free` and `Connect` points (clump weights, buoys) and `Point3` buoys now have their own seabed contact. Until now only the end nodes of the attached lines held a point on the seabed, over their tributary length, so a heavy clump sank silently into it: a 50 t clump diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b58ec74..e86a8a0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2129,6 +2129,17 @@ add_test(NAME driver_ei0_fold_note_slope -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_slope -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) set_tests_properties(driver_ei0_fold_note_slope PROPERTIES LABELS "fortran;driver;integration;static") +# ... and a fold of the grounded run onto itself between two grounded ends, named at its deck +# node (driver_ei0_fold_layouts checks that it is the node of the fold). +add_test(NAME driver_ei0_fold_note_turn + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/ei0_fold_turn_current.dat|turn" + "-DONCE=Note: line 1: the static layout folds the grounded run back on itself \\(a 180 deg turn at node 49, a hairpin\\);the current drives the run along the seabed, which holds it only by friction" + "-DMUST_MATCH=seabed friction \\(frictionMu\\) or a shorter line prevents it" + "-DMUST_NOT=past its anchor" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_ei0_fold_note_turn + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_ei0_fold_note_turn PROPERTIES LABELS "fortran;driver;integration;static") foreach(_deck IN ITEMS examples/chain_catenary_shallow_30m tests/data/ei0_hairpin_current_friction tests/data/ei0_fold_slope_aslaid tests/data/ei0_aslaid_behind_anchor tests/data/ei0_clump_no_fold) diff --git a/doc/theory.rst b/doc/theory.rst index f41d3357..a75319ba 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1180,7 +1180,9 @@ at least a tenth of the water depth at that end, or of the height of the other e that is larger, so that a near-vertical line, whose side away from its other end is not defined, is left to the next test), or ``the static layout folds the grounded run back on itself (a ... deg turn at node ...)`` when the run turns by more than 150° -at a node whose two neighbours are also grounded (within 5 cm of the floor). The note names the +at a node whose two neighbours are also grounded (within 5 cm of the floor); the node is the +deck node, numbered as the ```` of the node channels (1 = End A; an ``EI = 0`` line is never +refined, so its deck nodes are its mesh nodes). The note names the cause: a deck current acting on the line (a current profile that vanishes at the seabed still pulls the run through the suspended span), a seabed steeper than 0.5° at the fold, or neither (a slack run). Its remedy follows the deck's static friction. Without ``frictionMu``: friction @@ -1865,9 +1867,12 @@ Deck ``POINTS``, ``BODIES``, and ``RODS`` records follow the MoorDyn object mode with added mass :math:`\rho V C_a`. Points are advanced around the implicit line step with implicit-Euler kinematics, and the attached line ends' own blocks are linearly implicit: the structural mass diagonal, the Morison added-mass block, and the end-segment elastic tangent - and axial damping. A light or massless connector is therefore stable at any - :math:`\Delta t`, including under added mass that exceeds the structural mass, and the end - segments impose no :math:`\sqrt{k_\text{line}/m_\text{point}}` limit. The coupling to the + and axial damping, and so is the point's own seabed contact (its stiffness + :math:`k_\text{Bot} A` and damping :math:`c_\text{Bot} A`). A light or massless connector is + therefore stable at any :math:`\Delta t`, including under added mass that exceeds the + structural mass, and neither the end segments nor the footprint impose a + :math:`\sqrt{k/m_\text{point}}` limit, so the sub-step estimate of the explicit object march + (below) leaves the points out. The coupling to the first interior node, drag, and seabed contact at the end node stay at the step-start state; the step fails with a named error if a point's motion becomes non-finite. - **Rigid6 bodies** have six DOFs, a diagonal inertia about the centre of gravity, and the @@ -2111,7 +2116,9 @@ the added mass changes as it crosses. A finite-EI cable on a body or rod of the whose end force the march returns explicitly, adds the directional spring above with :math:`k_a = 1/\sum l_0/EA` and its current end tension. The normal seabed damping and the regularised friction (a damper :math:`\mu N/\sqrt{v^2 + v_\text{reg}^2}`, :math:`\mu N/v_\text{reg}` -at rest) are applied implicitly, the friction as that secant coefficient, so they set no limit; +at rest) are applied implicitly, the friction as that secant coefficient, so they set no limit, +nor does the seabed contact of a ``Free``/``Connect`` point or a Point3 buoy, which its point +step treats as linearly implicit (see Free points above), so the estimate leaves it out; the monolithic scheme carries the contact and the hydrostatics in its Jacobian, and its accuracy sub-steps (above) leave them out. A step that would need more than 256 sub-steps is warned about once per run. The estimate omits the line-end inertia and the coupling between diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index 37b95b20..587f693f 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -667,7 +667,8 @@ Warnings and notes that do not stop a run at node ..., a hairpin) ...`` - an ``EI = 0`` line whose grounded run turns back by more than 150° at a node, away from its ends (for example a slack line whose excess length the static solve lays out and back - on the seabed). As above, the layout is an equilibrium of the deck as written; check the + on the seabed). The node is a deck node, numbered as the ```` of the node channels + (1 = End A). As above, the layout is an equilibrium of the deck as written; check the line length before using it. * - ``Note: line ...: the equilibrium in the current is held in the vertical plane of the line; it is unstable out of that plane ...`` @@ -725,7 +726,7 @@ Warnings and notes that do not stop a run * - ``Warning: line ...: segment ... carried ... N at t = ... s for a single step, ... times the largest tension on the line one step before and after`` - a non-physical tension spike: the tension of one segment (elastic, viscoelastic or - Syrope) rose and fell within one step to ten times anything the line carried one step + Syrope; numbered from End A, as in ``.Line.t.out``) rose and fell within one step to ten times anything the line carried one step before and after, which no physical snap or tension wave does. It is the signature of an under-resolved slack–taut transition integrated without energy control, for example with diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 4f68bdea..9a71baeb 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -4223,9 +4223,8 @@ SUBROUTINE anchor_overshoot_note() !! staticsFriction asLaid no note is made when the as-laid reference itself reaches past !! the anchor (as_laid_reference_past): the deck lays the run there. REAL(wp), PARAMETER :: GROUNDED_TOL = 0.05_wp - REAL(wp) :: e_h(2), e_g(2), span, past, d, floor_z, xg, yg, pos(3), gx, gy, slope_at, laid_t_n + REAL(wp) :: e_h(2), span, past, d, floor_z, xg, yg, pos(3), gx, gy, slope_at REAL(wp) :: z_nodes(SIZE(q_static)/6) - REAL(wp), ALLOCATABLE :: lay_az_n INTEGER :: k, esb, support CHARACTER(1024) :: emb CHARACTER(200) :: cause @@ -28472,12 +28471,14 @@ INTEGER FUNCTION audited_line_id(lines, i) RESULT(id) END FUNCTION audited_line_id SUBROUTINE warn_line_spike(model, line_id) - !! The once-per-line warning of the run audit's first implausible tension spike. + !! The once-per-line warning of the run audit's first implausible tension spike. The + !! segment is numbered in deck order, from End A, as the segment tension outputs and the + !! fold note's nodes are (audit_spike_elem is in internal order, End B first). TYPE(CD_ModelType), INTENT(IN) :: model INTEGER, INTENT(IN) :: line_id INTEGER :: ios WRITE (output_unit, '(A,I0,A,I0,A,ES10.3,A,F10.3,A,F0.1,A)', IOSTAT=ios) ' Warning: line ', line_id, & - ': segment ', model%audit_spike_elem, ' carried ', model%audit_spike_tension, ' N at t =', & + ': segment ', model%n_elem + 1 - model%audit_spike_elem, ' carried ', model%audit_spike_tension, ' N at t =', & model%audit_spike_time, ' s for a single step, ', model%audit_spike_ratio, & ' times the largest tension on the line one step before and after: a non-physical tension spike '// & '(an under-resolved slack-taut transition). Check the result with a smaller dtM (doc: troubleshooting).' diff --git a/tests/check_fold_layout.py b/tests/check_fold_layout.py index 0edbde8b..24ddf626 100644 --- a/tests/check_fold_layout.py +++ b/tests/check_fold_layout.py @@ -12,12 +12,16 @@ * ei0_hairpin_current_friction.dat (the same with frictionMu 0.5): friction holds the run short of the threshold, so there is nothing to note; * ei0_aslaid_behind_anchor.dat (staticsFriction asLaid, layAzimuth 0, away from the - fairlead): the run does lie past the anchor, laid there by the deck, which the note skips. + fairlead): the run does lie past the anchor, laid there by the deck, which the note skips; +* ei0_fold_turn_current.dat (both ends grounded, the current along the line): the run folds + back on itself, and the node the note names is the deck node of the fold (the farthest + node downstream, numbered from End A as the node channels). Usage: check_fold_layout.py """ import pathlib +import re import subprocess import sys import tempfile @@ -29,8 +33,9 @@ NODES = 53 -def node_positions(exe, deck): - """The static x and z of every node of line 1 (deck node 1 = End A ... 53 = End B).""" +def node_positions(exe, deck, stderr=None): + """The static x and z of every node of line 1 (deck node 1 = End A ... 53 = End B); the + driver's stderr is appended to the list stderr when one is given.""" text = deck.read_text(encoding="utf-8") head = text.split("--------------------- OUTPUTS")[0] channels = [f"L1N{k}px" for k in range(1, NODES + 1)] + [f"L1N{k}pz" for k in range(1, NODES + 1)] @@ -41,6 +46,8 @@ def node_positions(exe, deck): run = subprocess.run([exe, str(path), "layout"], cwd=tmp, capture_output=True, text=True) if run.returncode != 0: raise SystemExit(f"{deck.name}: driver failed ({run.returncode}):\n{run.stdout}\n{run.stderr}") + if stderr is not None: + stderr.append(run.stderr) rows = (pathlib.Path(tmp) / "layout.out").read_text(encoding="utf-8").splitlines() values = [float(v) for v in rows[2].split()[1:]] return values[:NODES], values[NODES:] @@ -69,6 +76,13 @@ def main(): print(f"as laid behind the anchor: grounded run reaches x = {x:.3f} m") if not x > ANCHOR_X + THRESHOLD: failures.append("the as-laid run does not lie past its anchor, so the skipped note is not exercised") + err = [] + xs, _ = node_positions(exe, data / "ei0_fold_turn_current.dat", err) + fold = max(range(NODES), key=lambda k: xs[k]) + 1 + named = re.search(r"deg turn at node (\d+), a hairpin", err[0]) + print(f"fold on itself: the run turns at deck node {fold}, the note names node {named.group(1) if named else None}") + if named is None or int(named.group(1)) != fold: + failures.append("the turn note does not name the deck node of the fold") for f in failures: print("FAIL: " + f) return 1 if failures else 0 diff --git a/tests/data/ei0_fold_turn_current.dat b/tests/data/ei0_fold_turn_current.dat new file mode 100644 index 00000000..5a38544e --- /dev/null +++ b/tests/data/ei0_fold_turn_current.dat @@ -0,0 +1,32 @@ +--------------------- CableDyn Input File ------------------------------------ +Slack chain between two grounded ends, a 2 m/s current along it on a frictionless seabed: the run folds back on itself at a deck node (noted) +--------------------- LINE TYPES --------------------------------------------- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +chain 0.216 286.56 1.22976e9 -1 0 1.37 0.64 1 0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +1 Coupled 0.0 0.0 -100.0 +2 Fixed 450.0 0.0 -100.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 chain 520.0 52 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +100.0 WtrDpth +1.0e5 kBot +1.0e4 cBot +0.05 dtM +0.0 TMax +uniform 2.0 0 0 current +--------------------- OUTPUTS ------------------------------------------------ +FairTen1 +AnchTen1 +--------------------- END ----------------------------------------------------