From 7f94a15fbe98d6493655b4036d519b78920b893a Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sun, 8 Nov 2026 23:08:52 +0900 Subject: [PATCH] fix(statics): a compression on unresolved elements names the mesh, not the current The diagnosis of a finite-EI line that stops in a current read the element-mean axial force of the last state and named a compression there as a limit of the current: the friction holding the grounded run, or the run pushed along the seabed. On an element longer than half its bending length (EI/|w|)^(1/3) the element-mean axial force of a stiff line oscillates and can read a compression the line does not carry. The deck driver then skipped the mesh-sequenced route on that diagnosis, and the solver could stop its continuation at a grounded-run limit the mesh made up. A compression on such an element (or its neighbours) now names the mesh and how to refine it, and sets no grounded-run limit, so the other routes run. driver_graded_cross_current: a lazy wave on a graded mesh (0.9 m elements beside 4 m and 10 m ones) in a 0.2 m/s cross current exits 2 before and now solves with no fallback. Signed-off-by: Jae Hoon Seo --- CMakeLists.txt | 10 ++++ src/CableDyn_HermiteCableStatic.f90 | 33 +++++++++-- tests/data/lazy_wave_graded_cross_current.dat | 57 +++++++++++++++++++ 3 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 tests/data/lazy_wave_graded_cross_current.dat diff --git a/CMakeLists.txt b/CMakeLists.txt index 96dcf84c..dfe7c3f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2845,6 +2845,16 @@ if(Python3_Interpreter_FOUND) 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. +# A lazy wave on a graded mesh in a cross current: the continuation route stops on a compression +# read on elements longer than half the bending length, which is no grounded-run limit, so the +# mesh-sequenced route still runs and solves the deck, with no fallback. +add_test(NAME driver_graded_cross_current + COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 + "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/lazy_wave_graded_cross_current.dat|graded" + "-DMUST_NOT=failed Newton;stalled;looser tolerance" + -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/driver_graded_cross_current + -P ${CMAKE_CURRENT_SOURCE_DIR}/tests/check_driver_output.cmake) +set_tests_properties(driver_graded_cross_current PROPERTIES LABELS "fortran;driver;integration;static" TIMEOUT 600) add_test(NAME driver_clamped_buoyant_held COMMAND ${CMAKE_COMMAND} -DDRIVER=$ -DEXPECT_RC=0 "-DARGS=${CMAKE_CURRENT_SOURCE_DIR}/tests/data/clamped_buoyant_cable_held.dat|held" diff --git a/src/CableDyn_HermiteCableStatic.f90 b/src/CableDyn_HermiteCableStatic.f90 index 4aa6374b..1ab2f5e2 100644 --- a/src/CableDyn_HermiteCableStatic.f90 +++ b/src/CableDyn_HermiteCableStatic.f90 @@ -3248,7 +3248,7 @@ PURE LOGICAL FUNCTION current_has_drag(cur) RESULT(has) has = cur%drag END FUNCTION current_has_drag - FUNCTION current_compression_note(l0, EA, qx, seabed_z, flat, frictional, frictionless_run) RESULT(note) + FUNCTION current_compression_note(l0, EA, qx, seabed_z, flat, frictional, frictionless_run, EI, w) RESULT(note) !! Diagnosis of a current that has no tension-only equilibrium on the traced branch: !! empty unless the state qx (the last one reached) carries an element-mean axial force !! (three-point Gauss mean of EA (|r'| - 1), free of the end-node boundary layer) below @@ -3263,8 +3263,13 @@ FUNCTION current_compression_note(l0, EA, qx, seabed_z, flat, frictional, fricti ! TRUE for the two frictionless grounded-run diagnoses (the run folds against its end or ! is pushed along the seabed in compression). LOGICAL, INTENT(OUT), OPTIONAL :: frictionless_run + ! The bending stiffness and weight per length of the elements (both or neither): on an + ! element longer than half its bending length (EI/|w|)^(1/3) the element-mean axial force of + ! a stiff line oscillates and can read a compression the line does not carry, so a + ! compression there names the mesh, not a limit of the current. + REAL(wp), INTENT(IN), OPTIONAL :: EI(:), w(:) CHARACTER(1024) :: note - REAL(wp) :: t_min, t_max, s_min, z_min, z_top + REAL(wp) :: t_min, t_max, s_min, z_min, z_top, need INTEGER :: k, k_min, wios, ne, es CHARACTER(1024) :: em note = '' @@ -3279,6 +3284,22 @@ FUNCTION current_compression_note(l0, EA, qx, seabed_z, flat, frictional, fricti IF (.NOT. (t_min < -1.0e-3_wp*t_max)) RETURN ! Height of the compressed element: the lower of its two nodes. z_min = MIN(qx(6*(k_min - 1) + 3), qx(6*k_min + 3)) + IF (PRESENT(EI) .AND. PRESENT(w)) THEN + ! the compressed element and its neighbours against half their bending length + need = CD_ZERO + DO k = MAX(1, k_min - 1), MIN(ne, k_min + 1) + IF (EI(k) > CD_ZERO .AND. ABS(w(k)) > CD_ZERO) & + need = MAX(need, l0(k)/(0.5_wp*(EI(k)/ABS(w(k)))**(1.0_wp/3.0_wp))) + END DO + IF (need > 1.0_wp) THEN + WRITE (note, '(A,ES10.3,A,F10.2,A,F6.2,A)', IOSTAT=wios) 'the line reads an element-mean axial '// & + 'compression (', t_min, ' N at unstretched arc length ', s_min, ' m) on elements ', need, & + ' times half the bending length (EI/|w|)^(1/3), where the element-mean axial force of a stiff '// & + 'line oscillates and can read a compression the line does not carry; refine those elements '// & + '(NumSegs) to half the bending length or less; ' + RETURN + END IF + END IF IF (flat .AND. z_min <= seabed_z + 0.01_wp*(z_top - seabed_z) .AND. frictional) THEN WRITE (note, '(A,ES10.3,A,F10.2,A,ES10.3,A)', IOSTAT=wios) 'the line is in axial compression at '// & 'the seabed (', t_min, ' N at unstretched arc length ', s_min, ' m, ', z_min - seabed_z, & @@ -3695,7 +3716,7 @@ LOGICAL FUNCTION frictionless_run_limit(qx) RESULT(run_limit) run_limit = .FALSE. IF (.NOT. PRESENT(current)) RETURN IF (.NOT. current_has_drag(current)) RETURN - note = current_compression_note(l0, EA, qx, seabed_z, flat, use_fric, run_limit) + note = current_compression_note(l0, EA, qx, seabed_z, flat, use_fric, run_limit, EI=EI, w=w) END FUNCTION frictionless_run_limit FUNCTION compression_note(qx) RESULT(note) @@ -3707,7 +3728,7 @@ FUNCTION compression_note(qx) RESULT(note) note = '' IF (.NOT. PRESENT(current)) RETURN IF (.NOT. current_has_drag(current)) RETURN - note = current_compression_note(l0, EA, qx, seabed_z, flat, use_fric) + note = current_compression_note(l0, EA, qx, seabed_z, flat, use_fric, EI=EI, w=w) END FUNCTION compression_note FUNCTION fixed_point_name() RESULT(name) @@ -6798,7 +6819,7 @@ SUBROUTINE CD_HermiteCable_Static_Solve_AutoMesh(l0, EA, EI, w, seed, fixed_dofs IF (PRESENT(current)) THEN IF (current_has_drag(current)) & emloc = TRIM(current_compression_note(l0_out, EA_out, q_out, seabed_z,.NOT. PRESENT(bathymetry), & - ALLOCATED(current%friction)))//TRIM(emloc) + ALLOCATED(current%friction), EI=EI_out, w=w_out))//TRIM(emloc) END IF ErrStat = es; ErrMsg = 'CD_HermiteCable_Static_Solve_AutoMesh: refined-mesh polish failed: '//TRIM(emloc) RETURN @@ -6930,7 +6951,7 @@ SUBROUTINE CD_HermiteCable_Static_Solve_AutoMesh(l0, EA, EI, w, seed, fixed_dofs IF (PRESENT(current)) THEN IF (current_has_drag(current)) & wbuf = TRIM(current_compression_note(l0_out, EA_out, q_out, seabed_z,.NOT. PRESENT(bathymetry), & - ALLOCATED(current%friction)))//TRIM(wbuf) + ALLOCATED(current%friction), EI=EI_out, w=w_out))//TRIM(wbuf) END IF ErrMsg = wbuf RETURN diff --git a/tests/data/lazy_wave_graded_cross_current.dat b/tests/data/lazy_wave_graded_cross_current.dat new file mode 100644 index 00000000..a871e623 --- /dev/null +++ b/tests/data/lazy_wave_graded_cross_current.dat @@ -0,0 +1,57 @@ +--------------------- CableDyn Input File ------------------------------------ +Lazy-wave cable on a graded mesh in a cross current: a mesh-scale compression is no grounded-run limit +-- The lazy wave of lazy_wave_touchdown_planar_coarse_att.dat (25 discrete buoyancy modules on a +-- frictional seabed) with its buoyant stretch refined fourfold, so 0.9 m elements meet 4 m ones at +-- the sag bend and 10 m ones along the grounded run, in a 0.2 m/s current across the line's plane. +-- The catenary-continuation route stops on an element-mean axial compression read on those long +-- elements, where the axial force of a stiff line oscillates: a mesh artefact, not the friction +-- holding the grounded run. The static solve names it as such and goes on to the mesh-sequenced +-- route, which solves the deck. +--------------------- LINE TYPES --------------------------------------------- +Name Diam Mass EA BA EI GAs GJ Irt Irn Cdn Cdt Can Cat +(-) (m) (kg/m) (N) (-) (Nm2) (N) (Nm2) (kgm) (kgm) (-) (-) (-) (-) +bare 0.16 36.70 4.69e8 0.0 1.99e4 1.0e8 1.5e4 1.0 1.0 1.2 0.1 1.0 0.0 +--------------------- POINTS ------------------------------------------------- +ID Type X Y Z +(-) (-) (m) (m) (m) +7 Coupled 30.0 0.0 -20.0 +8 Fixed 500.0 0.0 -200.0 +--------------------- LINES -------------------------------------------------- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +4 7 8 - +--------------------- SECTIONS ----------------------------------------------- +LineID LineType Length NumSegs +(-) (-) (m) (-) +4 bare 80.0 20 +4 bare 96.0 108 +4 bare 424.0 42 +--------------------- ATTACHMENTS ------------------------------------------- +LineID ArcLength Mass Volume CdA Ca CdAx +(-) (m) (kg) (m^3) (m^2) (-) (m^2) +4 80.0:10.66666667:176.0 228.3 0.45945 3.48 1.0 0.0 +--------------------- END CONNECTIONS ---------------------------------------- +LineID End Stiffness EzX EzY EzZ TorsStiffness NxX NxY NxZ Pretwist +(-) (-) (N-m/rad) (-) (-) (-) (N-m/rad) (-) (-) (-) (deg) +4 A Rigid 0.1058 0 -0.9944 Free 0 1 0 0 +4 B Rigid 1 0 0 Free 0 1 0 0 +--------------------- OPTIONS ------------------------------------------------ +9.80665 g +1025.0 rhoW +3.0e6 kBot +3.0e5 cBot +0.35 frictionMu +200.0 WtrDpth +0.025 dtM +0.0 TMax +uniform 0 0.2 0.0 current +--------------------- OUTPUTS ------------------------------------------------ +FairTen4 +AnchTen4 +Point7Fx +Point7Fy +Point7Fz +Point8Fx +Point8Fy +Point8Fz +--------------------- END ----------------------------------------------------