diff --git a/CHANGELOG.md b/CHANGELOG.md index 204025d1..ca12e8f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,11 @@ All notable changes to CableDyn are recorded in this file. The format follows frequency in mode-1 lock-in and stays in mode 1 where that string jumps to mode 2. The multibody march carries it too (a cable on a Rigid6 body or rod, or beside free points), with the same lock-in. A finite-EI line with two moving ends refuses `Cl > 0`. +- LINES Outputs flag `V` (MoorDyn's): the cross-flow VIV lift force at the nodes of a line, + written to `.Line.V.out` on dynamic runs of the standalone routes that carry VIV. On + a finite-EI line each element's lift is lumped to its nodes; at the interior nodes of a taut + line in lock-in it matches the `EI = 0` line's within 0.1 %. Upper case only, as in MoorDyn, + whose `v` (node velocities) CableDyn does not write. - Cross-flow VIV on the coupled routes: OpenFAST (`CompMooring = 5`), FAST.Farm and the standalone runner of a mixed `EI = 0` / finite-EI deck carry the lift on both line kinds, with the host's fluid field. The phases, running mean squares and averaging time are part of the diff --git a/CMakeLists.txt b/CMakeLists.txt index 58831b66..9c3b79d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2472,6 +2472,10 @@ cabledyn_msg_test(weightless_finite_ei msg_weightless_finite_ei.dat 0 cabledyn_msg_test(weightless_finite_ei_vertical msg_weightless_finite_ei_vertical.dat 2 "weightless .neutrally buoyant. line is longer than its vertical span;nothing chooses the side of the bow;offset its ends horizontally" "net-heavy") +# MoorDyn's line flag v (node velocities) is not written; V (the VIV lift) is upper case. +cabledyn_msg_test(line_flag_velocity msg_line_flag_velocity.dat 1 + "supported line-output flags are p, t, r and V .the VIV lift, upper case as MoorDyn's." + "net-heavy") # An EI=0 line type rejected as net-buoyant whose mass is a relative 4e-9 below the displaced water # mass is named weightless and slack; one a relative 2e-6 below it keeps the plain message. cabledyn_msg_test(weightless_ei0 msg_weightless_ei0.dat 1 diff --git a/app/cabledyn.f90 b/app/cabledyn.f90 index bac2d593..abb2ad00 100644 --- a/app/cabledyn.f90 +++ b/app/cabledyn.f90 @@ -483,7 +483,7 @@ SUBROUTINE run_mixed_held_deck(deck, root, dt, has_dt, run_time, has_run_time, h RETURN END IF IF (line_outputs) THEN - run_msg = 'CableDyn_driver: mixed-deck LINE Outputs p/t are not supported; '// & + run_msg = 'CableDyn_driver: mixed-deck LINE Outputs p/t/V are not supported; '// & 'use main OUTPUTS channels or remove the per-line flags' RETURN END IF diff --git a/doc/migrating.rst b/doc/migrating.rst index b14d72fb..53a743d1 100644 --- a/doc/migrating.rst +++ b/doc/migrating.rst @@ -97,6 +97,11 @@ Keyword map types and as a distributed lift on finite-EI types (:ref:`theory-viv`); the running-RMS window is ``VIVrmsWindow`` seconds, by default 500 steps of ``dtM`` as MoorDyn's + * - ``LINES`` ``Outputs`` flags ``p``, ``t``, ``V`` + - the same quantities, one file per flag where MoorDyn writes one file per line: + ``.Line.p.out``, ``.t.out`` and ``.V.out`` (the VIV lift at the nodes), on the + standalone routes (:doc:`outputs`); MoorDyn's other line flags (``v``, ``U``, ``D``, + ``c``, ``s``, ``d``, ...) are not written and are a parse error * - ``ElasticMod 2/3`` viscoelastic ``EA``/``BA`` - ``Es|Ed`` / ``Es|alphaMBL|vbeta`` in ``EA`` and ``BA_s|BA_d`` in ``BA`` * - Syrope line type and ``SYROPE IC`` diff --git a/doc/outputs.rst b/doc/outputs.rst index 87d8c0e8..7da7d638 100644 --- a/doc/outputs.rst +++ b/doc/outputs.rst @@ -318,10 +318,11 @@ B)``, header row, units row, data (12 columns): Per-line files (``LINES`` ``Outputs`` flag) ------------------------------------------- -Set the ``Outputs`` column of a ``LINES`` row to any combination of the letters below -(case-insensitive, e.g. ``ptr``); ``-`` or an empty field requests nothing. Any other letter is a -parse error. Mixed ``EI = 0`` + finite-EI decks reject the ``p`` and ``t`` flags (use main-file -channels instead) and accept ``r``. +Set the ``Outputs`` column of a ``LINES`` row to any combination of the letters below (e.g. +``ptr``); ``-`` or an empty field requests nothing. ``p``, ``t`` and ``r`` are case-insensitive; +``V`` is upper case, as in MoorDyn, whose lower-case ``v`` (node velocities) CableDyn does not +write. Any other letter is a parse error. Mixed ``EI = 0`` + finite-EI decks reject the ``p``, +``t`` and ``V`` flags (use main-file channels instead) and accept ``r``. .. list-table:: :header-rows: 1 @@ -338,6 +339,14 @@ channels instead) and accept ``r``. - segment (element) tensions, End A → End B; on a finite-EI line the mean of the axial components of the element's own two equilibrium end forces (``OutputRecovery element``: the axial resultant at the element midpoint) + * - ``V`` + - ``.Line.V.out`` + - cross-flow VIV lift force at the nodes, End A → End B, on dynamic runs (MoorDyn's line + flag ``V``; a static run carries no lift and writes no file). On an ``EI = 0`` line the + end nodes carry none, as in MoorDyn; on a finite-EI line each element's lift is lumped to + its two nodes (the translational part of its consistent load), so the end nodes carry + the lift of their half-elements. Zero on a line without VIV (``Cl = 0``); a finite-EI + line with two moving ends carries no VIV and refuses the flag * - ``r`` - ``.Line.range.out`` - range graph: minimum, maximum and mean over the run of the node tension, curvature, bend @@ -365,6 +374,9 @@ deck node of that node, 0 for a node the refinement added. * - ``.t.out`` - ``Segment Tension(N)`` - ``Time(s) Segment1Tension(N) Segment2Tension(N) … SegmentTension(N)`` + * - ``.V.out`` + - (none) + - ``Time(s) Node1LiftX(N) Node1LiftY(N) Node1LiftZ(N) Node2LiftX(N) … NodeLiftZ(N)`` Dynamic per-line rows are written at the same times as ``.out``. diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index f4849988..24fb33c1 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -2614,6 +2614,7 @@ def numeric(token: str, row: DeckRecord, field: str) -> float: # Cl > 0 on an EI = 0 row (native init_one_model, which needs the line's Morison drag in # water) has_viv_ei0 = False + viv_type_names: set[str] = set() for row in self.line_types: for index in (1, 2, *range(5, len(row.tokens))): numeric(row.tokens[index], row, f"LINE TYPES column {index + 1}") @@ -2702,6 +2703,8 @@ def numeric(token: str, row: DeckRecord, field: str) -> float: "working-curve model" ) has_viv_ei0 = has_viv_ei0 or (cl > 0.0 and not ei > 0.0) + if cl > 0.0: + viv_type_names.add(row.tokens[0].lower()) if ei > 0.0 and (is_syrope or len(ea_parts) > 1): model = "Syrope" if is_syrope else "viscoelastic stiffness" raise DeckFormatError(f"{self._at(row)}: {model} is not supported with EI > 0") @@ -2891,7 +2894,8 @@ def end_key(token: str) -> str: # lines whose stock anchor-first row the native reader turns around (its ends swap) swapped_lines: set[str] = set() range_lines = 0 - series_lines = 0 # lines with per-line time-series files (flags p, t) + lift_lines = 0 # lines with the VIV lift file (flag V) + series_lines = 0 # lines with per-line time-series files (flags p, t, V) for row in self.lines: if len(row.tokens) not in {3, 4, 7}: raise DeckFormatError(f"{self._at(row)}: LINES row needs 3, 4, or 7 fields") @@ -2900,14 +2904,17 @@ def end_key(token: str) -> str: if len(row.tokens) == 7 else (row.tokens[3] if len(row.tokens) == 4 else "-") ) - if output_flags != "-" and not re.fullmatch(r"[pPtTrR]+", output_flags): + # V (the VIV lift) is case-sensitive, as MoorDyn's v (node velocities) is not written + if output_flags != "-" and not re.fullmatch(r"[pPtTrRV]+", output_flags): raise DeckFormatError( - f"{self._at(row)}: LINE Outputs accepts only '-', 'p', 't', and 'r'" + f"{self._at(row)}: LINE Outputs accepts only '-', 'p', 't', 'r', and 'V'" ) if "r" in output_flags.lower(): range_lines += 1 - if "p" in output_flags.lower() or "t" in output_flags.lower(): + if "p" in output_flags.lower() or "t" in output_flags.lower() or "V" in output_flags: series_lines += 1 + if "V" in output_flags: + lift_lines += 1 if len(row.tokens) == 7: line_type = row.tokens[1] endpoints: tuple[str, ...] = row.tokens[2:4] @@ -3546,7 +3553,7 @@ def end_key(token: str) -> str: if series_lines: raise DeckFormatError( f"{self._label}: a mixed EI=0/finite-EI deck writes no per-line files; " - "use OUTPUTS channels instead of the LINES Outputs flags p and t" + "use OUTPUTS channels instead of the LINES Outputs flags p, t and V" ) # Native deck_needs_multibody: a dynamic deck that no single-family march covers @@ -3589,6 +3596,24 @@ def is_body_kind(kind: str, pinned: bool) -> bool: ) elif has_rigid6: needs_multibody = non_rigid6_points + if deck_driver_route and has_dtm and has_tmax and line_ids and all(finite_lines): + # native run_deck_driver: a finite-EI deck the multibody march does not take, with a + # line whose End B moves, runs on the compatibility route, which carries no VIV + moving_end_b = not needs_multibody and any( + point_types[node_b] != "fixed" for _, node_b in normalized_line_endpoints.values() + ) + if moving_end_b and any( + viv_type_names.intersection(types) for types in section_types_by_line.values() + ): + raise DeckFormatError( + f"{self._label}: VIV (LINE TYPES Cl > 0) of a finite-EI line needs its End B " + "fixed (the cubic-Hermite march); set Cl = 0 for a line with two moving ends" + ) + if moving_end_b and lift_lines: + raise DeckFormatError( + f"{self._label}: the LINES Outputs flag V (VIV lift) needs a line that carries " + "VIV, which a finite-EI line with two moving ends does not" + ) if failures and deck_driver_route: # native CD_Run_Deck_Driver: FAILURE runs on the point-system object graph only if not has_dtm: diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 6bec1952..d1452838 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -938,6 +938,19 @@ def test_attachments_accept_an_axial_drag_area_and_a_deck_current(tmp_path): DeckFile.from_text(text) +def test_viv_lift_flag_is_upper_case_and_standalone(): + # V writes the VIV lift file; as MoorDyn's line flags it is case-sensitive (v, MoorDyn's + # node velocities, is not written) + deck = DeckFile.from_text(_edit(_DYNAMIC, ("1 2 1 -\n", "1 2 1 pV\n"))) + assert deck.lines[0].tokens[3] == "pV" + with pytest.raises(DeckFormatError, match="accepts only '-', 'p', 't', 'r', and 'V'"): + DeckFile.from_text(_edit(_DYNAMIC, ("1 2 1 -\n", "1 2 1 pv\n"))) + # a mixed EI=0/finite-EI deck writes no per-line files + mixed = _ATTACHMENT_DECK.format(rows="1 60.0 100 0.1 0.1 1.0", options="") + with pytest.raises(DeckFormatError, match="flags p, t and V"): + DeckFile.from_text(mixed.replace("1 2 1 -\n", "1 2 1 V\n")) + + def test_attachments_are_accepted_on_the_coupled_route(tmp_path): path = tmp_path / "attachments-coupled.dat" path.write_text( @@ -2467,7 +2480,7 @@ def test_range_flag_and_range_start_follow_native_rules(): ("50.0 WtrDpth\n", "50.0 WtrDpth\n0 RangeStart\n"), ) ) - with pytest.raises(DeckFormatError, match="accepts only '-', 'p', 't', and 'r'"): + with pytest.raises(DeckFormatError, match="accepts only '-', 'p', 't', 'r', and 'V'"): DeckFile.from_text(_edit(_STATIC, ("1 2 1 -\n", "1 2 1 rx\n"))) assert DeckFile.from_text(_edit(_STATIC, ("1 2 1 -\n", "1 2 1 r\n"))).lines[0].tokens[3] == "r" @@ -4076,6 +4089,25 @@ def test_reserved_windows_device_names_are_refused(monkeypatch, tmp_path): ) +def test_viv_and_lift_flag_refused_on_a_finite_ei_line_with_two_moving_ends(): + # native run_deck_driver: a farm-shared finite-EI line (Turbine1 to Turbine2) runs on the + # compatibility route, which carries no VIV: Cl > 0 and the lift file V are refused + shared = _edit( + _TURBINE_DECK, + ("chain 0.1 20.0 1.0e9 -1.0 0.0 1.2", "chain 0.1 20.0 1.0e9 -1.0 1.0e4 1.2"), + ("1 1 3 -\n2 2 3 -\n", "1 1 2 -\n"), + ("1 chain 380 20\n2 chain 380 20\n", "1 chain 620 30\n"), + ("100 WtrDpth\n", "100 WtrDpth\n0.1 dtM\n10.0 TMax\n"), + ) + DeckFile.from_text(shared) + with pytest.raises(DeckFormatError, match="needs its End B fixed"): + DeckFile.from_text(_edit(shared, ("1.2 0.2 1.0 0.0\n", "1.2 0.2 1.0 0.0 0.8\n"))) + with pytest.raises(DeckFormatError, match=r"flag V \(VIV lift\) needs a line that carries VIV"): + DeckFile.from_text(_edit(shared, ("1 1 2 -\n", "1 1 2 V\n"))) + # the same flag on a line with a Fixed End B is accepted + DeckFile.from_text(_edit(_DYNAMIC, ("1 2 1 -\n", "1 2 1 V\n"))) + + @pytest.mark.parametrize( ("edit", "message"), [ diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 93251c5a..e07937c8 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -57,11 +57,12 @@ MODULE CableDyn_DeckDriver CD_Get_Model_EndForces, & CD_Update_Model_CoupledMotion, CD_Update_Model_Hydro_Fields, & CD_Recompute_Model_Acceleration, CD_Step_Model, CD_Step_Model_Recovering, CD_MODEL_OK, & - CD_Audit_Model_Step, CD_Set_Model_VIV + CD_Audit_Model_Step, CD_Set_Model_VIV, CD_Get_Model_VIV_Lift USE CableDyn_System, ONLY: CD_SystemType, CD_SystemPointType, CD_LineEndpointBinding, & CD_Init_System_From_Points, CD_End_System, CD_System_Line_NDOF, & CD_System_Line_NElem, CD_Get_System_Point_State, CD_Get_System_Line_State, & - CD_Get_System_Line_Tension, CD_Update_System_Point_Fluid_Fields, & + CD_Get_System_Line_Tension, CD_Get_System_Line_VIV_Lift, & + CD_Update_System_Point_Fluid_Fields, & 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, & @@ -104,6 +105,7 @@ MODULE CableDyn_DeckDriver CD_HermiteCable_Dyn_Set_ForceBlend, CD_HC_FORCE_BLEND_DEFAULT, & CD_HermiteCable_Dyn_Set_Friction_Anchors, & CD_HermiteCable_Dyn_Set_Friction_Axial, CD_HermiteCable_Dyn_Set_VIV, & + CD_HermiteCable_Dyn_VIV_Node_Lift, & CD_HermiteCable_Dyn_Set_Control_Seabed, & CD_HermiteCable_Dyn_Max_Step_Rotation, CD_HermiteCable_Dyn_Energy, & CD_HermiteCable_Attachment_Drag, CD_HermiteCable_Dyn_Torsion_State @@ -16460,7 +16462,8 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio END DO IF (.NOT. valid_line_output_flags(lines(i)%outputs)) THEN CALL fail(ErrStat, ErrMsg, 'LINE Outputs "'//TRIM(lines(i)%outputs)// & - '": supported line-output flags are p, t and r'); RETURN + '": supported line-output flags are p, t, r and V (the VIV lift, upper case as MoorDyn''s)') + RETURN END IF IF (find_point(points, lines(i)%nodeA) == 0) THEN CALL fail(ErrStat, ErrMsg, 'LINE '//TRIM(int_to_str(lines(i)%id))//' references undefined POINT id '// & @@ -17033,12 +17036,14 @@ SUBROUTINE write_static_line_tension_file(out_root, line_id, nelem, tension_line CLOSE (unit) END SUBROUTINE write_static_line_tension_file - SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_units, ErrStat, ErrMsg) + SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_units, ErrStat, ErrMsg, lift_units) !! Open optional per-line dynamic time-series files requested by LINE Outputs flags. CHARACTER(*), INTENT(IN) :: out_root TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(CD_ModelType), INTENT(IN) :: models(:) INTEGER, ALLOCATABLE, INTENT(OUT) :: pos_units(:), ten_units(:) + ! the VIV lift files (flag V) of the lines, when the caller takes them + INTEGER, ALLOCATABLE, INTENT(OUT), OPTIONAL :: lift_units(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg @@ -17051,11 +17056,15 @@ SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_uni ALLOCATE (pos_units(SIZE(lines)), ten_units(SIZE(lines))) pos_units = 0 ten_units = 0 + IF (PRESENT(lift_units)) THEN + ALLOCATE (lift_units(SIZE(lines))) + lift_units = 0 + END IF DO i = 1, SIZE(lines) IF (.NOT. line_outputs_requested(lines(i)%outputs)) CYCLE ndof = CD_Model_NDOF(models(i), es, em) IF (es /= CD_MODEL_OK) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = CD_DECKDRV_SOLVEFAIL ErrMsg = 'CableDyn_DeckDriver: dynamic line-output DOF query failed: '//TRIM(em) RETURN @@ -17066,7 +17075,7 @@ SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_uni path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.p.out' OPEN (NEWUNIT=pos_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open dynamic line position output file: '//TRIM(path)); RETURN END IF WRITE (pos_units(i), '(A)') '# CableDyn dynamic line node positions; public node order EndA -> EndB' @@ -17082,7 +17091,7 @@ SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_uni path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.t.out' OPEN (NEWUNIT=ten_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open dynamic line tension output file: '//TRIM(path)); RETURN END IF WRITE (ten_units(i), '(A)') '# CableDyn dynamic line segment tensions; public segment order EndA -> EndB' @@ -17092,15 +17101,26 @@ SUBROUTINE open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_uni END DO WRITE (ten_units(i), '(A)') '' END IF + IF (PRESENT(lift_units)) THEN + IF (line_output_has_lift(lines(i)%outputs)) THEN + CALL open_line_lift_file(out_root, lines(i)%id, nnode, lift_units(i), ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) THEN + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units); RETURN + END IF + END IF + END IF END DO END SUBROUTINE open_dynamic_line_outputs - SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg) + SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units) !! Open optional per-line dynamic time-series files for a point-system deck. CHARACTER(*), INTENT(IN) :: out_root TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(CD_SystemType), INTENT(IN) :: system INTEGER, ALLOCATABLE, INTENT(OUT) :: pos_units(:), ten_units(:) + ! the VIV lift files (flag V) of the lines, when the caller takes them + INTEGER, ALLOCATABLE, INTENT(OUT), OPTIONAL :: lift_units(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg @@ -17113,11 +17133,15 @@ SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ALLOCATE (pos_units(SIZE(lines)), ten_units(SIZE(lines))) pos_units = 0 ten_units = 0 + IF (PRESENT(lift_units)) THEN + ALLOCATE (lift_units(SIZE(lines))) + lift_units = 0 + END IF DO i = 1, SIZE(lines) IF (.NOT. line_outputs_requested(lines(i)%outputs)) CYCLE ndof = CD_System_Line_NDOF(system, i, es, em) IF (es /= CD_SYSTEM_OK) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = CD_DECKDRV_SOLVEFAIL ErrMsg = 'CableDyn_DeckDriver: system dynamic line-output DOF query failed: '//TRIM(em) RETURN @@ -17128,7 +17152,7 @@ SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.p.out' OPEN (NEWUNIT=pos_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open system dynamic line position output file: '//TRIM(path)); RETURN END IF WRITE (pos_units(i), '(A)') '# CableDyn dynamic line node positions; public node order EndA -> EndB' @@ -17144,7 +17168,7 @@ SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.t.out' OPEN (NEWUNIT=ten_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open system dynamic line tension output file: '//TRIM(path)); RETURN END IF WRITE (ten_units(i), '(A)') '# CableDyn dynamic line segment tensions; public segment order EndA -> EndB' @@ -17154,26 +17178,37 @@ SUBROUTINE open_dynamic_system_line_outputs(out_root, lines, system, pos_units, END DO WRITE (ten_units(i), '(A)') '' END IF + IF (PRESENT(lift_units)) THEN + IF (line_output_has_lift(lines(i)%outputs)) THEN + CALL open_line_lift_file(out_root, lines(i)%id, nnode, lift_units(i), ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) THEN + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units); RETURN + END IF + END IF + END IF END DO END SUBROUTINE open_dynamic_system_line_outputs - SUBROUTINE write_dynamic_line_outputs(time, lines, models, pos_units, ten_units, work, ErrStat, ErrMsg) + SUBROUTINE write_dynamic_line_outputs(time, lines, models, pos_units, ten_units, work, ErrStat, ErrMsg, lift_units) !! Append one time row to every requested dynamic per-line output file. REAL(wp), INTENT(IN) :: time TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(CD_ModelType), INTENT(IN) :: models(:) INTEGER, INTENT(IN) :: pos_units(:), ten_units(:) + INTEGER, INTENT(IN), OPTIONAL :: lift_units(:) TYPE(ModelOutputWorkspace), INTENT(INOUT) :: work INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - INTEGER :: i, ndof, nnode, ne, es + INTEGER :: i, ndof, nnode, ne, es, lift_unit CHARACTER(1024) :: em ErrStat = CD_DECKDRV_OK ErrMsg = '' DO i = 1, SIZE(lines) - IF (pos_units(i) == 0 .AND. ten_units(i) == 0) CYCLE + lift_unit = 0 + IF (PRESENT(lift_units)) lift_unit = lift_units(i) + IF (pos_units(i) == 0 .AND. ten_units(i) == 0 .AND. lift_unit == 0) CYCLE ndof = CD_Model_NDOF(models(i), es, em) IF (es /= CD_MODEL_OK) THEN ErrStat = CD_DECKDRV_SOLVEFAIL @@ -17210,6 +17245,22 @@ SUBROUTINE write_dynamic_line_outputs(time, lines, models, pos_units, ten_units, RETURN END IF END IF + IF (lift_unit /= 0) THEN + BLOCK + REAL(wp) :: lift(3, nnode) + CALL CD_Get_Model_VIV_Lift(models(i), lift, es, em) + IF (es /= CD_MODEL_OK) THEN + ErrStat = CD_DECKDRV_SOLVEFAIL + ErrMsg = 'CableDyn_DeckDriver: dynamic line VIV lift recovery failed: '//TRIM(em) + RETURN + END IF + CALL write_line_position_row(lift_unit, time, RESHAPE(lift, [3*nnode]), 3, ne, ErrStat) + IF (ErrStat /= CD_DECKDRV_OK) THEN + ErrMsg = 'CableDyn_DeckDriver: non-finite dynamic line VIV lift output' + RETURN + END IF + END BLOCK + END IF END DO END SUBROUTINE write_dynamic_line_outputs @@ -17267,23 +17318,27 @@ SUBROUTINE write_line_tension_row(unit, time, tension, ErrStat) END IF END SUBROUTINE write_line_tension_row - SUBROUTINE write_dynamic_system_line_outputs(time, lines, system, pos_units, ten_units, work, ErrStat, ErrMsg) + SUBROUTINE write_dynamic_system_line_outputs(time, lines, system, pos_units, ten_units, work, ErrStat, ErrMsg, & + lift_units) !! Append one time row to requested dynamic per-line output files for a point-system deck. REAL(wp), INTENT(IN) :: time TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(CD_SystemType), INTENT(IN) :: system INTEGER, INTENT(IN) :: pos_units(:), ten_units(:) + INTEGER, INTENT(IN), OPTIONAL :: lift_units(:) TYPE(ModelOutputWorkspace), INTENT(INOUT) :: work INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - INTEGER :: i, ndof, nnode, ne, es + INTEGER :: i, ndof, nnode, ne, es, lift_unit CHARACTER(1024) :: em ErrStat = CD_DECKDRV_OK ErrMsg = '' DO i = 1, SIZE(lines) - IF (pos_units(i) == 0 .AND. ten_units(i) == 0) CYCLE + lift_unit = 0 + IF (PRESENT(lift_units)) lift_unit = lift_units(i) + IF (pos_units(i) == 0 .AND. ten_units(i) == 0 .AND. lift_unit == 0) CYCLE ndof = CD_System_Line_NDOF(system, i, es, em) IF (es /= CD_SYSTEM_OK) THEN ErrStat = CD_DECKDRV_SOLVEFAIL @@ -17320,6 +17375,22 @@ SUBROUTINE write_dynamic_system_line_outputs(time, lines, system, pos_units, ten RETURN END IF END IF + IF (lift_unit /= 0) THEN + BLOCK + REAL(wp) :: lift(3, nnode) + CALL CD_Get_System_Line_VIV_Lift(system, i, lift, es, em) + IF (es /= CD_SYSTEM_OK) THEN + ErrStat = CD_DECKDRV_SOLVEFAIL + ErrMsg = 'CableDyn_DeckDriver: dynamic line VIV lift recovery failed: '//TRIM(em) + RETURN + END IF + CALL write_line_position_row(lift_unit, time, RESHAPE(lift, [3*nnode]), 3, ne, ErrStat) + IF (ErrStat /= CD_DECKDRV_OK) THEN + ErrMsg = 'CableDyn_DeckDriver: non-finite dynamic line VIV lift output' + RETURN + END IF + END BLOCK + END IF END DO END SUBROUTINE write_dynamic_system_line_outputs @@ -17434,8 +17505,9 @@ SUBROUTINE write_dynamic_finite_line_outputs(time, lines, models, pos_units, ten END DO END SUBROUTINE write_dynamic_finite_line_outputs - SUBROUTINE close_dynamic_line_outputs(pos_units, ten_units) + SUBROUTINE close_dynamic_line_outputs(pos_units, ten_units, lift_units) INTEGER, ALLOCATABLE, INTENT(INOUT) :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE, INTENT(INOUT), OPTIONAL :: lift_units(:) INTEGER :: i IF (ALLOCATED(pos_units)) THEN @@ -17450,8 +17522,53 @@ SUBROUTINE close_dynamic_line_outputs(pos_units, ten_units) END DO DEALLOCATE (ten_units) END IF + IF (PRESENT(lift_units)) THEN + IF (ALLOCATED(lift_units)) THEN + DO i = 1, SIZE(lift_units) + IF (lift_units(i) /= 0) CLOSE (lift_units(i)) + END DO + DEALLOCATE (lift_units) + END IF + END IF END SUBROUTINE close_dynamic_line_outputs + SUBROUTINE open_line_lift_file(out_root, line_id, nnode, unit, ErrStat, ErrMsg, deck_nodes) + !! Open .Line.V.out (LINES Outputs flag V) and write its header: the VIV + !! lift force at each node, End A -> End B. deck_nodes, on a line whose mesh the static solve + !! refined, names the deck node of each node (0: added), as the .p.out file does. + CHARACTER(*), INTENT(IN) :: out_root + INTEGER, INTENT(IN) :: line_id, nnode + INTEGER, INTENT(OUT) :: unit + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER, INTENT(IN), OPTIONAL :: deck_nodes(:) + CHARACTER(LEN(out_root) + 32) :: path + INTEGER :: ios, node + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + path = TRIM(out_root)//'.Line'//TRIM(int_to_str(line_id))//'.V.out' + OPEN (NEWUNIT=unit, FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) + IF (ios /= 0) THEN + unit = 0 + CALL fail(ErrStat, ErrMsg, 'cannot open dynamic line VIV lift output file: '//TRIM(path)); RETURN + END IF + WRITE (unit, '(A)') '# CableDyn dynamic line VIV lift force at the nodes; public node order EndA -> EndB' + IF (PRESENT(deck_nodes)) THEN + WRITE (unit, '(A)', ADVANCE='NO') '# DeckNode' + DO node = 1, nnode + WRITE (unit, '(A,I0)', ADVANCE='NO') char_tab(), deck_nodes(node) + END DO + WRITE (unit, '(A)') '' + END IF + WRITE (unit, '(A)', ADVANCE='NO') 'Time(s)' + DO node = 1, nnode + WRITE (unit, '(A,A,I0,A)', ADVANCE='NO') char_tab(), 'Node', node, 'LiftX(N)' + WRITE (unit, '(A,A,I0,A)', ADVANCE='NO') char_tab(), 'Node', node, 'LiftY(N)' + WRITE (unit, '(A,A,I0,A)', ADVANCE='NO') char_tab(), 'Node', node, 'LiftZ(N)' + END DO + WRITE (unit, '(A)') '' + END SUBROUTINE open_line_lift_file + SUBROUTINE open_dynamic_rod_outputs(out_root, rods, pos_units, ErrStat, ErrMsg) !! Open optional per-rod dynamic endpoint-position time-series files. CHARACTER(*), INTENT(IN) :: out_root @@ -17551,7 +17668,7 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry INTEGER :: unit, ios, step, nstep, es, n_iter, step_substeps - INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), lift_units(:) INTEGER :: miss_count, consecutive_miss, max_consecutive_miss INTEGER :: recovery_event_count, recovery_max_substeps_used CHARACTER(LEN(out_root) + 8) :: path @@ -17596,12 +17713,13 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co RETURN END IF END IF - CALL open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_line_outputs(out_root, lines, models, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) RETURN path = TRIM(out_root)//'.out' OPEN (NEWUNIT=unit, FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open output file: '//TRIM(path)); RETURN END IF WRITE (unit, '(A)') '# CableDyn driver output (dynamic; convergence quality is reported by status message)' @@ -17613,13 +17731,14 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co END IF IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_line_outputs(CD_ZERO, lines, models, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_line_outputs(CD_ZERO, lines, models, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF ! the run audit starts from the initial state (its tension scale is that of t = 0) @@ -17631,7 +17750,7 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co CALL update_wave_models(models, opts, t, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17653,7 +17772,7 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co END IF IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) converged = .FALSE. ErrStat = es ErrMsg = TRIM(em)//INSPECTION_NOTE @@ -17663,7 +17782,7 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co max_consecutive_miss, first_miss_time, last_miss_time) IF (.NOT. step_converged .OR. stalled) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) RETURN @@ -17671,7 +17790,7 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co CALL check_models_plausibility(models, lines, opts%max_strain, t, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) converged = .FALSE. ErrMsg = TRIM(ErrMsg)//INSPECTION_NOTE RETURN @@ -17686,20 +17805,21 @@ SUBROUTINE write_dynamic_out(out_root, channels, lines, points, opts, models, co END IF IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_line_outputs(t, lines, models, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_line_outputs(t, lines, models, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF CALL CD_Profile_Enter(CD_PROF_PROGRESS) CALL update_driver_progress(progress, step, t) END DO CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) IF (ErrStat == CD_DECKDRV_OK .AND. recovery_event_count > 0) THEN @@ -17727,7 +17847,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry INTEGER :: unit, ios, step, nstep, es, n_iter - INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), lift_units(:) INTEGER :: miss_count, consecutive_miss, max_consecutive_miss CHARACTER(LEN(out_root) + 8) :: path CHARACTER(1024) :: em @@ -17749,12 +17869,13 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys max_consecutive_miss = 0 first_miss_time = CD_ZERO last_miss_time = CD_ZERO - CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) RETURN path = TRIM(out_root)//'.out' OPEN (NEWUNIT=unit, FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open output file: '//TRIM(path)); RETURN END IF WRITE (unit, '(A)') '# CableDyn driver output (dynamic points; convergence quality is reported by status message)' @@ -17762,7 +17883,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL update_system_point_hydro(system, points, opts, CD_ZERO, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17770,7 +17891,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL update_system_line_hydro(system, opts, CD_ZERO, hydro_work, es, em, initial_condition=.TRUE.) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17778,13 +17899,14 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL write_system_model_row(unit, CD_ZERO, channels, lines, points, system, output_work, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF ! the run audit starts from the initial state (its tension scale is that of t = 0) @@ -17795,7 +17917,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL update_system_point_hydro(system, points, opts, t, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17803,7 +17925,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL update_system_line_hydro(system, opts, t, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17813,7 +17935,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL CD_Profile_Enter(CD_PROF_CHECK) IF (es /= CD_SYSTEM_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = CD_DECKDRV_SOLVEFAIL ErrMsg = 'CableDyn_DeckDriver: dynamic point-system step failed: '//TRIM(em) RETURN @@ -17822,7 +17944,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys max_consecutive_miss, first_miss_time, last_miss_time) IF (.NOT. step_converged .OR. stalled) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('dynamic point-system run', nstep, miss_count, & max_consecutive_miss, first_miss_time, last_miss_time, & converged, ErrStat, ErrMsg) @@ -17832,7 +17954,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys IF (ErrStat /= CD_DECKDRV_OK) THEN ErrMsg = TRIM(ErrMsg)//INSPECTION_NOTE CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) converged = .FALSE. RETURN END IF @@ -17841,7 +17963,7 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL check_and_fire_failures(system, lines, points, failures, t, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -17852,20 +17974,21 @@ SUBROUTINE write_system_dynamic_out(out_root, channels, lines, points, opts, sys CALL write_system_model_row(unit, t, channels, lines, points, system, output_work, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF CALL CD_Profile_Enter(CD_PROF_PROGRESS) CALL update_driver_progress(progress, step, t) END DO CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('dynamic point-system run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) IF (ErrStat == CD_DECKDRV_OK) CALL report_system_line_audits(system, lines, opts%dtM) @@ -18101,7 +18224,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o TYPE(RigidBodyState), ALLOCATABLE :: rigid(:) INTEGER :: unit, ios, step, nstep, es, n_iter - INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), lift_units(:) INTEGER :: miss_count, consecutive_miss, max_consecutive_miss CHARACTER(LEN(out_root) + 8) :: path CHARACTER(1024) :: em @@ -18145,7 +18268,8 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o END IF WRITE (unit, '(A)') '# CableDyn driver output (Rigid6 dynamic; convergence quality is reported by status message)' CALL write_header(unit, channels) - CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) RETURN @@ -18153,7 +18277,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o CALL update_system_line_hydro(system, opts, CD_ZERO, hydro_work, es, em, initial_condition=.TRUE.) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -18162,13 +18286,14 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o rigid=rigid, opts=opts, bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF ! the run audit starts from the initial state (its tension scale is that of t = 0) @@ -18184,7 +18309,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o CALL update_system_line_hydro(system, opts, t, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -18196,7 +18321,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o CALL CD_Profile_Enter(CD_PROF_CHECK) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -18205,7 +18330,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o max_consecutive_miss, first_miss_time, last_miss_time) IF (.NOT. step_converged .OR. stalled) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('Rigid6 dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) RETURN @@ -18214,7 +18339,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o IF (ErrStat /= CD_DECKDRV_OK) THEN ErrMsg = TRIM(ErrMsg)//INSPECTION_NOTE CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) converged = .FALSE. RETURN END IF @@ -18223,7 +18348,7 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o CALL check_and_fire_failures(system, lines, points, failures, t, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) ErrStat = es ErrMsg = em RETURN @@ -18235,20 +18360,21 @@ SUBROUTINE write_rigid6_dynamic_out(out_root, channels, bodies, lines, points, o rigid=rigid, opts=opts, bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF - CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF CALL CD_Profile_Enter(CD_PROF_PROGRESS) CALL update_driver_progress(progress, step, t) END DO CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL CD_Classify_Dynamic_Completion('Rigid6 dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) IF (ErrStat == CD_DECKDRV_OK) CALL report_system_line_audits(system, lines, opts%dtM) @@ -18273,7 +18399,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi TYPE(RodState), ALLOCATABLE :: rod_state(:) INTEGER :: unit, ios, step, nstep, es, n_iter - INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), lift_units(:) INTEGER, ALLOCATABLE :: rod_pos_units(:) INTEGER :: miss_count, consecutive_miss, max_consecutive_miss CHARACTER(LEN(out_root) + 8) :: path @@ -18319,7 +18445,8 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi END IF WRITE (unit, '(A)') '# CableDyn driver output (rod dynamic; convergence quality is reported by status message)' CALL write_header(unit, channels) - CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_system_line_outputs(out_root, lines, system, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) RETURN @@ -18327,13 +18454,13 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi CALL open_dynamic_rod_outputs(out_root, rods, rod_pos_units, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) RETURN END IF CALL update_system_line_hydro(system, opts, CD_ZERO, hydro_work, es, em, initial_condition=.TRUE.) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) ErrStat = es ErrMsg = em @@ -18343,21 +18470,22 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi rods=rod_state, opts=opts, bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF - CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(CD_ZERO, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF CALL write_dynamic_rod_outputs(CD_ZERO, rods, rod_state, rod_pos_units, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF @@ -18374,7 +18502,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi CALL update_system_line_hydro(system, opts, t, hydro_work, es, em) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) ErrStat = es ErrMsg = em @@ -18387,7 +18515,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi CALL CD_Profile_Enter(CD_PROF_CHECK) IF (es /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) ErrStat = es ErrMsg = em @@ -18397,7 +18525,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi max_consecutive_miss, first_miss_time, last_miss_time) IF (.NOT. step_converged .OR. stalled) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) CALL CD_Classify_Dynamic_Completion('rod dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) @@ -18407,7 +18535,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi IF (ErrStat /= CD_DECKDRV_OK) THEN ErrMsg = TRIM(ErrMsg)//INSPECTION_NOTE CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) converged = .FALSE. RETURN @@ -18419,21 +18547,22 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi rods=rod_state, opts=opts, bathymetry=bathymetry) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF - CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg) + CALL write_dynamic_system_line_outputs(t, lines, system, pos_units, ten_units, output_work, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF CALL write_dynamic_rod_outputs(t, rods, rod_state, rod_pos_units, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) RETURN END IF @@ -18441,7 +18570,7 @@ SUBROUTINE write_rod_dynamic_out(out_root, channels, rod_types, rods, lines, poi CALL update_driver_progress(progress, step, t) END DO CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL close_dynamic_rod_outputs(rod_pos_units) CALL CD_Classify_Dynamic_Completion('rod dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) @@ -19703,6 +19832,7 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod TYPE(CD_LineInitSummary), ALLOCATABLE :: sum_sys(:), sum_cab(:), summaries(:) LOGICAL, ALLOCATABLE :: is_fin(:), is_ei0(:) INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), cpos_units(:), cten_units(:), rod_units(:) + INTEGER, ALLOCATABLE :: lift_units(:), clift_units(:) INTEGER :: i, k, c, ir, ib, pa, pb, node, unit, ios, step, nstep, es, n_iter, bid INTEGER :: miss_count, consecutive_miss, max_consecutive_miss LOGICAL :: step_converged, stalled @@ -20004,12 +20134,14 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod 'status message)' CALL write_header(unit, channels) IF (mb%has_sys) THEN - CALL open_dynamic_system_line_outputs(out_root, sys_lines, mb%system, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_system_line_outputs(out_root, sys_lines, mb%system, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) ELSE ALLOCATE (pos_units(0), ten_units(0)) END IF IF (ErrStat == CD_DECKDRV_OK) & - CALL open_dynamic_hermite_line_outputs(out_root, cab_lines, mb%cables, cpos_units, cten_units, ErrStat, ErrMsg) + CALL open_dynamic_hermite_line_outputs(out_root, cab_lines, mb%cables, cpos_units, cten_units, ErrStat, ErrMsg, & + lift_units=clift_units) IF (ErrStat == CD_DECKDRV_OK) CALL open_dynamic_rod_outputs(out_root, own, rod_units, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) GOTO 800 IF (probe_armed .AND. SIZE(mb%rigid) > 0) THEN @@ -20081,8 +20213,8 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod IF (ErrStat == CD_DECKDRV_OK .AND. converged) CALL range_write(mb_ranges, out_root, ErrStat, ErrMsg) 800 CONTINUE CLOSE (unit) - IF (ALLOCATED(pos_units)) CALL close_dynamic_line_outputs(pos_units, ten_units) - IF (ALLOCATED(cpos_units)) CALL close_dynamic_line_outputs(cpos_units, cten_units) + IF (ALLOCATED(pos_units)) CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) + IF (ALLOCATED(cpos_units)) CALL close_dynamic_line_outputs(cpos_units, cten_units, clift_units) IF (ALLOCATED(rod_units)) CALL close_dynamic_rod_outputs(rod_units) 900 CONTINUE IF (ErrStat /= CD_DECKDRV_OK) converged = .FALSE. @@ -20165,11 +20297,12 @@ SUBROUTINE mb_outputs(time) WRITE (unit, ROW_VALUES_FMT) time, (char_tab(), vals(j), j=1, SIZE(channels)) IF (mb%has_sys) THEN CALL write_dynamic_system_line_outputs(time, sys_lines, mb%system, pos_units, ten_units, output_work, & - ErrStat, ErrMsg) + ErrStat, ErrMsg, lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) RETURN END IF IF (SIZE(mb%cables) > 0) THEN - CALL write_dynamic_hermite_line_outputs(time, cab_lines, mb%cables, cpos_units, cten_units, ErrStat, ErrMsg) + CALL write_dynamic_hermite_line_outputs(time, cab_lines, mb%cables, cpos_units, cten_units, ErrStat, ErrMsg, & + lift_units=clift_units) IF (ErrStat /= CD_DECKDRV_OK) RETURN END IF CALL write_dynamic_rod_outputs(time, own, mb%rods, rod_units, ErrStat, ErrMsg) @@ -27975,7 +28108,7 @@ SUBROUTINE write_hermite_dynamic_out(out_root, channels, lines, points, opts, ca INTEGER :: unit, ios, step, nstep, i, es, pidx, tensile_events, tensile_element INTEGER :: recovery_events, recovery_max_used - INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:) + INTEGER, ALLOCATABLE :: pos_units(:), ten_units(:), lift_units(:) CHARACTER(LEN(out_root) + 8) :: path CHARACTER(1024) :: em REAL(wp) :: t, up(3), uv(3), ua(3), tensile_force, tensile_threshold, tensile_xi, tensile_time, turn @@ -28031,7 +28164,8 @@ SUBROUTINE write_hermite_dynamic_out(out_root, channels, lines, points, opts, ca END IF WRITE (unit, '(A)') '# CableDyn driver output (finite-EI dynamic; production cubic-Hermite route)' CALL write_header(unit, channels) - CALL open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, ten_units, ErrStat, ErrMsg) + CALL open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN CLOSE (unit); RETURN END IF @@ -28042,9 +28176,9 @@ SUBROUTINE write_hermite_dynamic_out(out_root, channels, lines, points, opts, ca CALL write_hermite_static_profile(out_root, lines, cables, ErrStat, ErrMsg) IF (ErrStat == CD_DECKDRV_OK) & CALL write_dynamic_hermite_line_outputs(CD_ZERO, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, & - ranges=ranges) + ranges=ranges, lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) THEN - CLOSE (unit); CALL close_dynamic_line_outputs(pos_units, ten_units); RETURN + CLOSE (unit); CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units); RETURN END IF CALL start_driver_progress(progress, nstep, opts%dtM) @@ -28095,13 +28229,13 @@ SUBROUTINE write_hermite_dynamic_out(out_root, channels, lines, points, opts, ca has_motion=opts%has_motion_file, ranges=ranges) IF (ErrStat == CD_DECKDRV_OK) & CALL write_dynamic_hermite_line_outputs(t, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, & - ranges=ranges) + ranges=ranges, lift_units=lift_units) IF (ErrStat /= CD_DECKDRV_OK) EXIT CALL CD_Profile_Enter(CD_PROF_PROGRESS) CALL update_driver_progress(progress, step, t) END DO CLOSE (unit) - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) IF (opts%tensile_mode == CD_HCDYN_TENSILE_WARN) THEN DO i = 1, SIZE(cables) CALL CD_HFMF_Get_Tensile_Diagnostics(cables(i), tensile_events, tensile_force, & @@ -28540,11 +28674,14 @@ SUBROUTINE write_hermite_model_row(unit, time, channels, lines, points, cables, WRITE (unit, '(A)') '' END SUBROUTINE write_hermite_model_row - SUBROUTINE open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, ten_units, ErrStat, ErrMsg) + SUBROUTINE open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, & + lift_units) CHARACTER(*), INTENT(IN) :: out_root TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(CD_HFMF_ModuleType), INTENT(IN) :: cables(:) INTEGER, ALLOCATABLE, INTENT(OUT) :: pos_units(:), ten_units(:) + ! the VIV lift files (flag V) of the lines, when the caller takes them + INTEGER, ALLOCATABLE, INTENT(OUT), OPTIONAL :: lift_units(:) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg INTEGER :: i, ios, node, seg @@ -28552,13 +28689,17 @@ SUBROUTINE open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, ErrStat = CD_DECKDRV_OK; ErrMsg = '' ALLOCATE (pos_units(SIZE(lines)), ten_units(SIZE(lines))) pos_units = 0; ten_units = 0 + IF (PRESENT(lift_units)) THEN + ALLOCATE (lift_units(SIZE(lines))) + lift_units = 0 + END IF DO i = 1, SIZE(lines) IF (.NOT. line_outputs_requested(lines(i)%outputs)) CYCLE IF (line_output_has_flag(lines(i)%outputs, 'p')) THEN path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.p.out' OPEN (NEWUNIT=pos_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open Hermite line position output: '//TRIM(path)); RETURN END IF WRITE (pos_units(i), '(A)') '# CableDyn finite-EI Hermite line node positions; public node order EndA -> EndB' @@ -28583,7 +28724,7 @@ SUBROUTINE open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, path = TRIM(out_root)//'.Line'//TRIM(int_to_str(lines(i)%id))//'.t.out' OPEN (NEWUNIT=ten_units(i), FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) IF (ios /= 0) THEN - CALL close_dynamic_line_outputs(pos_units, ten_units) + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units) CALL fail(ErrStat, ErrMsg, 'cannot open Hermite line tension output: '//TRIM(path)); RETURN END IF WRITE (ten_units(i), '(A)') '# CableDyn finite-EI Hermite segment tensions; public order EndA -> EndB' @@ -28593,10 +28734,24 @@ SUBROUTINE open_dynamic_hermite_line_outputs(out_root, lines, cables, pos_units, END DO WRITE (ten_units(i), '(A)') '' END IF + IF (PRESENT(lift_units)) THEN + IF (line_output_has_lift(lines(i)%outputs)) THEN + IF (ALLOCATED(cables(i)%deck_node)) THEN + CALL open_line_lift_file(out_root, lines(i)%id, cables(i)%line%nn, lift_units(i), ErrStat, ErrMsg, & + deck_nodes=[(CD_Cable_Deck_Node(cables(i), node), node=1, cables(i)%line%nn)]) + ELSE + CALL open_line_lift_file(out_root, lines(i)%id, cables(i)%line%nn, lift_units(i), ErrStat, ErrMsg) + END IF + IF (ErrStat /= CD_DECKDRV_OK) THEN + CALL close_dynamic_line_outputs(pos_units, ten_units, lift_units); RETURN + END IF + END IF + END IF END DO END SUBROUTINE open_dynamic_hermite_line_outputs - SUBROUTINE write_dynamic_hermite_line_outputs(time, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, ranges) + SUBROUTINE write_dynamic_hermite_line_outputs(time, lines, cables, pos_units, ten_units, ErrStat, ErrMsg, ranges, & + lift_units) !! One row of the per-line position and segment-tension files. ranges, when given, is the !! range set sampled for this row by write_hermite_model_row: a line with a range graph !! then reuses the segment tensions of that sample's recovery pass (range_sample_cable). @@ -28607,7 +28762,9 @@ SUBROUTINE write_dynamic_hermite_line_outputs(time, lines, cables, pos_units, te INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg TYPE(CD_RangeSet), INTENT(IN), OPTIONAL :: ranges - INTEGER :: i, node, inode, seg, k + INTEGER, INTENT(IN), OPTIONAL :: lift_units(:) + INTEGER :: i, node, inode, seg, k, es + CHARACTER(1024) :: em ErrStat = CD_DECKDRV_OK; ErrMsg = '' DO i = 1, SIZE(lines) ! Each row is assembled in deck order and written in one WRITE; a non-finite entry @@ -28652,6 +28809,27 @@ SUBROUTINE write_dynamic_hermite_line_outputs(time, lines, cables, pos_units, te WRITE (ten_units(i), ROW_VALUES_FMT) time, (char_tab(), tension(k), k=1, SIZE(tension)) END BLOCK END IF + IF (PRESENT(lift_units)) THEN + IF (lift_units(i) /= 0) THEN + BLOCK + REAL(wp) :: lift(3, cables(i)%line%nn), row(3*cables(i)%line%nn) + CALL CD_HermiteCable_Dyn_VIV_Node_Lift(cables(i)%line, lift, es, em) + IF (es /= CD_HCDYN_OK) THEN + CALL fail_solve(ErrStat, ErrMsg, 'Hermite line VIV lift recovery failed: '//TRIM(em)); RETURN + END IF + DO node = 1, cables(i)%line%nn + inode = deck_to_internal_node(node, cables(i)%line%ne) + DO k = 1, 3 + row(3*node - 3 + k) = cable_global_component(cables(i), lift(:, inode), k) + END DO + END DO + IF (.NOT. ALL(IEEE_IS_FINITE(row))) THEN + CALL fail_solve(ErrStat, ErrMsg, 'non-finite Hermite line VIV lift output'); RETURN + END IF + WRITE (lift_units(i), ROW_VALUES_FMT) time, (char_tab(), row(k), k=1, SIZE(row)) + END BLOCK + END IF + END IF END DO END SUBROUTINE write_dynamic_hermite_line_outputs @@ -28682,6 +28860,11 @@ SUBROUTINE write_finite_dynamic_out(out_root, channels, lines, points, opts, mod converged = .TRUE. ErrStat = CD_DECKDRV_OK ErrMsg = '' + ! the two-moving-end finite-EI line carries no VIV (Cl > 0 is refused on it), so no lift + IF (ANY([(line_output_has_lift(lines(step)%outputs), step=1, SIZE(lines))])) THEN + CALL fail(ErrStat, ErrMsg, 'the LINES Outputs flag V (VIV lift) needs a line that carries VIV, which a '// & + 'finite-EI line with two moving ends does not'); RETURN + END IF nstep = NINT(opts%tmax/opts%dtM) CALL range_setup_planned(output_work%rset, lines, channels, opts, ErrStat, ErrMsg, fmodels=models, & bathymetry=bathymetry) @@ -35741,10 +35924,11 @@ LOGICAL FUNCTION any_line_outputs_requested(lines) RESULT(requested) TYPE(DeckLine), INTENT(IN) :: lines(:) INTEGER :: i - ! the per-line time-series files (p, t); the range graph (r) is not one of them + ! the per-line time-series files (p, t, V); the range graph (r) is not one of them requested = .FALSE. DO i = 1, SIZE(lines) - IF (line_output_has_flag(lines(i)%outputs, 'p') .OR. line_output_has_flag(lines(i)%outputs, 't')) THEN + IF (line_output_has_flag(lines(i)%outputs, 'p') .OR. line_output_has_flag(lines(i)%outputs, 't') .OR. & + line_output_has_lift(lines(i)%outputs)) THEN requested = .TRUE. RETURN END IF @@ -35760,17 +35944,24 @@ LOGICAL FUNCTION line_output_has_flag(flags, flag) RESULT(has_flag) has_flag = INDEX(lo, flag(1:1)) > 0 END FUNCTION line_output_has_flag + LOGICAL FUNCTION line_output_has_lift(flags) RESULT(has_flag) + !! The VIV lift file flag V. Case-sensitive, as MoorDyn's line flags are: there v is the node + !! velocities, which CableDyn does not write. + CHARACTER(*), INTENT(IN) :: flags + has_flag = INDEX(flags, 'V') > 0 + END FUNCTION line_output_has_lift + LOGICAL FUNCTION valid_line_output_flags(flags) RESULT(ok) CHARACTER(*), INTENT(IN) :: flags CHARACTER(NAMELEN) :: lo INTEGER :: i - lo = to_lower(TRIM(flags)) + lo = TRIM(flags) ok = .TRUE. IF (LEN_TRIM(lo) == 0 .OR. TRIM(lo) == '-') RETURN DO i = 1, LEN_TRIM(lo) SELECT CASE (lo(i:i)) - CASE ('p', 't', 'r') + CASE ('p', 'P', 't', 'T', 'r', 'R', 'V') CASE DEFAULT ok = .FALSE. RETURN diff --git a/src/CableDyn_HermiteCableDynamic.f90 b/src/CableDyn_HermiteCableDynamic.f90 index 1d6682df..89d7fb44 100644 --- a/src/CableDyn_HermiteCableDynamic.f90 +++ b/src/CableDyn_HermiteCableDynamic.f90 @@ -124,6 +124,7 @@ MODULE CableDyn_HermiteCableDynamic PUBLIC :: CD_HermiteCable_Dyn_Set_Friction_Anchors PUBLIC :: CD_HermiteCable_Dyn_Set_Friction_Axial PUBLIC :: CD_HermiteCable_Dyn_Set_VIV + PUBLIC :: CD_HermiteCable_Dyn_VIV_Node_Lift PUBLIC :: CD_HermiteCable_Dyn_Restore PUBLIC :: CD_HermiteCable_Dyn_Energy PUBLIC :: CD_HermiteCable_Dyn_Curvature @@ -1258,6 +1259,33 @@ SUBROUTINE viv_element_lift(model, q_cfg, v_cfg, e, flift, ErrStat, ErrMsg, djq, END IF END SUBROUTINE viv_element_lift + SUBROUTINE CD_HermiteCable_Dyn_VIV_Node_Lift(model, lift, ErrStat, ErrMsg) + !! The VIV lift on every node at the committed state [N] (3, nn), in the model frame: the + !! translational components of the elements' consistent lift loads, summed at the nodes + !! (MoorDyn's nodal lift on a lumped line). Zero on a cable without VIV. + TYPE(CD_HermiteCableDynType), INTENT(IN) :: model + REAL(wp), INTENT(OUT) :: lift(:, :) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: flift(12) + INTEGER :: e + lift = CD_ZERO + ErrStat = CD_HCDYN_OK; ErrMsg = '' + IF (.NOT. model%initialized) THEN + ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_VIV_Node_Lift: model not initialised'; RETURN + END IF + IF (SIZE(lift, 1) /= 3 .OR. SIZE(lift, 2) /= model%nn) THEN + ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_VIV_Node_Lift: lift must be shaped (3, nn)'; RETURN + END IF + IF (.NOT. model%has_viv) RETURN + DO e = 1, model%ne + CALL viv_element_lift(model, model%q, model%v, e, flift, ErrStat, ErrMsg) + IF (ErrStat /= CD_HCDYN_OK) RETURN + lift(:, e) = lift(:, e) + flift(1:3) + lift(:, e + 1) = lift(:, e + 1) + flift(7:9) + END DO + END SUBROUTINE CD_HermiteCable_Dyn_VIV_Node_Lift + SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Anchors(model, anchors, ErrStat, ErrMsg) !! Switch the seabed friction of a contact model with mu > 0 to elastic-plastic friction !! springs anchored at anchors(1:2, node) (x, y in the solve frame). The spring stiffness diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index adf6de6f..b7f1d3ae 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -96,7 +96,7 @@ MODULE CableDyn_Model PUBLIC :: CD_Set_Model_Syrope_State PUBLIC :: CD_Set_Model_VIV PUBLIC :: CD_Latch_Model_VIV_Window - PUBLIC :: CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Model_Has_VIV + PUBLIC :: CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Model_Has_VIV, CD_Get_Model_VIV_Lift PUBLIC :: CD_Get_Model_Tension PUBLIC :: CD_Get_Model_EndForces PUBLIC :: CD_Get_Model_EndNodeMassDiag @@ -4062,6 +4062,38 @@ SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg) model%viv_phi_eval = phi END SUBROUTINE CD_Set_Model_VIV_State + SUBROUTINE CD_Get_Model_VIV_Lift(model, lift, ErrStat, ErrMsg) + !! The VIV lift force on every node at the committed state [N] (3, n_nodes); zero on the + !! end nodes, on nodes without VIV, and on a model without VIV. + TYPE(CD_ModelType), INTENT(IN) :: model + REAL(wp), INTENT(OUT) :: lift(:, :) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER :: nd, ia + REAL(wp) :: coef, uu(3) + LOGICAL :: ok + lift = CD_ZERO + ErrStat = CD_MODEL_OK + ErrMsg = '' + IF (.NOT. model%initialized) THEN + ErrStat = CD_MODEL_NOT_INITIALIZED + ErrMsg = 'CableDyn_Model: model is not initialized' + RETURN + END IF + IF (SIZE(lift, 1) /= 3 .OR. SIZE(lift, 2) /= model%n_dof/3) THEN + CALL fail(ErrStat, ErrMsg, 'VIV lift output must have shape (3, n_nodes)') + RETURN + END IF + IF (.NOT. model%has_viv) RETURN + DO nd = 2, model%n_dof/3 - 1 + IF (.NOT. model%viv_node(nd)) CYCLE + CALL viv_node_coef(model, model%q, nd, coef, uu) + ia = 3*nd - 2 + CALL CD_VIV_Node_Lift(model%q(ia - 3:ia - 1), model%q(ia + 3:ia + 5), smoothed(model%v, ia), uu, coef, & + model%viv_phi(nd), lift(:, nd), ok) + END DO + END SUBROUTINE CD_Get_Model_VIV_Lift + PURE LOGICAL FUNCTION CD_Model_Has_VIV(model) RESULT(has) !! True if the model carries the cross-flow VIV phase state. TYPE(CD_ModelType), INTENT(IN) :: model diff --git a/src/CableDyn_System.f90 b/src/CableDyn_System.f90 index e46ab3c6..cb3b130a 100644 --- a/src/CableDyn_System.f90 +++ b/src/CableDyn_System.f90 @@ -17,7 +17,7 @@ MODULE CableDyn_System CD_Get_Model_State, CD_Get_Model_Tension, & CD_Model_Has_Viscoelastic, CD_Get_Model_VE_Dl1, CD_Set_Model_VE_Dl1, & CD_Model_Has_Syrope, CD_Get_Model_Syrope_State, CD_Set_Model_Syrope_State, & - CD_Model_Has_VIV, CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, & + CD_Model_Has_VIV, CD_Get_Model_VIV_State, CD_Set_Model_VIV_State, CD_Get_Model_VIV_Lift, & CD_Model_Has_Friction, CD_Get_Model_Friction_Anchors, CD_Set_Model_Friction_Anchors, & CD_Latch_Model_VIV_Window, & CD_Get_Model_EndNodeMassDiag, CD_Get_Model_EndNodeAddedMass, & @@ -78,7 +78,8 @@ MODULE CableDyn_System PUBLIC :: CD_Get_System_Line_Friction_Anchors PUBLIC :: CD_Set_System_Line_Friction_Anchors PUBLIC :: CD_Get_System_Line_Syrope_State - PUBLIC :: CD_System_Line_VIV_MirrorSize, CD_Get_System_Line_VIV_State, CD_Set_System_Line_VIV_State + PUBLIC :: CD_System_Line_VIV_MirrorSize, CD_Get_System_Line_VIV_State, CD_Set_System_Line_VIV_State, & + CD_Get_System_Line_VIV_Lift PUBLIC :: CD_Set_System_Line_Syrope_State PUBLIC :: CD_Get_System_PointBlocks PUBLIC :: CD_Get_System_Point_State @@ -1024,6 +1025,29 @@ SUBROUTINE CD_Set_System_Line_VIV_State(system, line_index, buf, ErrStat, ErrMsg ErrMsg = '' END SUBROUTINE CD_Set_System_Line_VIV_State + SUBROUTINE CD_Get_System_Line_VIV_Lift(system, line_index, lift, ErrStat, ErrMsg) + !! VIV lift force on every node of one contained line at the committed state (3, n_nodes). + TYPE(CD_SystemType), INTENT(IN) :: system + INTEGER, INTENT(IN) :: line_index + REAL(wp), INTENT(OUT) :: lift(:, :) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER :: es + CHARACTER(160) :: em + + lift = CD_ZERO + CALL validate_line_index(system, line_index, ErrStat, ErrMsg) + IF (ErrStat /= CD_SYSTEM_OK) RETURN + CALL CD_Get_Model_VIV_Lift(system%lines(line_index), lift, es, em) + IF (es /= CD_MODEL_OK) THEN + ErrStat = CD_SYSTEM_SOLVEFAIL + ErrMsg = 'CableDyn_System: line VIV lift query failed: '//TRIM(em) + RETURN + END IF + ErrStat = CD_SYSTEM_OK + ErrMsg = '' + END SUBROUTINE CD_Get_System_Line_VIV_Lift + SUBROUTINE CD_Set_System_Line_Syrope_State(system, line_index, slow, tmax, ErrStat, ErrMsg) !! Overwrite one contained line's per-element Syrope states from a checkpoint mirror !! (the cross-process restart reload). diff --git a/tests/data/msg_line_flag_velocity.dat b/tests/data/msg_line_flag_velocity.dat new file mode 100644 index 00000000..1d73e241 --- /dev/null +++ b/tests/data/msg_line_flag_velocity.dat @@ -0,0 +1,37 @@ +--------------------- CableDyn Input File --- +msg_line_flag_velocity +--------------------- LINE TYPES --- +TypeName Diam MassDenInAir EA BA EI Cd_n Cd_t Ca_n Ca_t +(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-) +neut 0.2 80.0 100000000 -1 0.0 1.2 0.1 1 0 +--------------------- POINTS --- +ID Type X Y Z Mass Vol CdA Ca +(-) (-) (m) (m) (m) (kg) (m3) (m2) (-) +1 Coupled 0 0 -20 0 0 0 0 +2 Fixed 80 0 -100 0 0 0 0 +--------------------- LINES --- +ID NodeA NodeB Outputs +(-) (-) (-) (-) +1 1 2 pv +--------------------- SECTIONS --- +LineID LineType Length NumSegs +(-) (-) (m) (-) +1 neut 120 120 +--------------------- OPTIONS --- +9.80665 g +1025.0 rhoW +200.0 WtrDpth +100000.0 kBot +1.0e4 cBot +0.05 dtM +0.0 TMax +--------------------- OUTPUTS --- +"FairTen1" +"AnchTen1" +"Point1Fx" +"Point1Fy" +"Point1Fz" +"Point2Fx" +"Point2Fy" +"Point2Fz" +--------------------- need this line --- diff --git a/tests/test_viv_lockin.py b/tests/test_viv_lockin.py index 0102c6c3..7c9fa788 100644 --- a/tests/test_viv_lockin.py +++ b/tests/test_viv_lockin.py @@ -21,6 +21,11 @@ * the same finite-EI cable on the multibody march (End A Fixed, and a weighted Connect point on two chains 300 m away, which puts the deck on that march) locks in as on the Hermite route (within 1 % and one bin); +* the VIV lift files (LINES Outputs flag V) of the EI = 0 line, the cable and the cable on the + multibody march: no lift on the EI = 0 line's end nodes (MoorDyn's), and the same cross-flow + lift at the interior nodes on all three (standard deviation over 60-120 s within 1 %) but the + end nodes' neighbours: the EI = 0 line's end half-segments carry no lift, as MoorDyn's, while + a cable element shares its lift between its two nodes; * a bending-stiff, neutrally buoyant cable (8.1 kg/m, EA 5e9 N, EI 5e7 N m^2, about 51 kN: beta = pi^2 EI/(T L^2) ~ 1) against the EI = 0 string tensioned to T (1 + beta), which has the same first-mode frequency and shape: at U 0.21 m/s both lock into mode 1 with the same @@ -82,7 +87,7 @@ def check(ok: bool, message: str) -> None: def deck(dtm: float, ei: float = 0.0, ea: float = 5.0e7, mass: float = 10.0, tension: float = 5.0e4, - waterkin: str = "current.dat") -> str: + waterkin: str = "current.dat", outputs: str = "-") -> str: length = 100.0 / (1.0 + tension / ea) return f"""--------------------- CableDyn Input File --------------------------------- VIV lock-in gate: taut line in a uniform cross current @@ -98,7 +103,7 @@ def deck(dtm: float, ei: float = 0.0, ea: float = 5.0e7, mass: float = 10.0, ten ----------------------- LINES ----------------------------------------------- ID LineType AttachA AttachB UnstrLen NumSegs Outputs (#) (name) (#) (#) (m) (-) (-) -1 riser 1 2 {length:.6f} 50 - +1 riser 1 2 {length:.6f} 50 {outputs} ---------------------- OPTIONS ---------------------------------------------- {dtm} dtM 100.0 WtrDpth @@ -127,12 +132,23 @@ def multibody(text: str) -> str: "3 Fixed 0.0 300.0 -20.0 0 0 0 0\n" "4 Connect 50.0 300.0 -60.0 5000 0 0 0\n" "5 Fixed 100.0 300.0 -20.0 0 0 0 0"), - (" 50 -\n", " 50 -\n2 chain 3 4 70.0 20 -\n" - "3 chain 5 4 70.0 20 -\n"), ): assert text.count(old) == 1, old text = text.replace(old, new) - return text + riser = next(line for line in text.splitlines() if line.startswith("1 riser")) + return text.replace(riser + "\n", riser + "\n2 chain 3 4 70.0 20 -\n" + "3 chain 5 4 70.0 20 -\n") + + +def lift_std(path: Path) -> np.ndarray: + """Standard deviation over 60-120 s of the cross-flow (z) lift at each node of a V file.""" + lines = path.read_text().splitlines() + head = next(i for i, line in enumerate(lines) if line.startswith("Time")) + names = lines[head].split("\t") + data = np.loadtxt(lines[head + 1:]) + data = data[data[:, 0] >= 60.0] + cols = [j for j, name in enumerate(names) if name.endswith("LiftZ(N)")] + return data[:, cols].std(axis=0) def response(path: Path) -> tuple[float, float, float]: @@ -169,11 +185,12 @@ def main() -> int: stiff = {"ei": 5.0e7, "ea": 5.0e9, "mass": 8.1} string = {"ea": 5.0e7, "mass": 8.1, "tension": 5.0e4 * (1.0 + beta)} runs = [ - (0.01, "viv_dt0.01", deck(0.01, waterkin="current_0.15.dat")), + (0.01, "viv_dt0.01", deck(0.01, waterkin="current_0.15.dat", outputs="V")), (0.002, "viv_dt0.002", deck(0.002, waterkin="current_0.15.dat")), - ("fei", "viv_fei", deck(0.01, ei=1.0, waterkin="current_0.15.dat")), + ("fei", "viv_fei", deck(0.01, ei=1.0, waterkin="current_0.15.dat", outputs="V")), ("fei_fine", "viv_fei_dt0.002", deck(0.002, ei=1.0, waterkin="current_0.15.dat")), - ("fei_mb", "viv_fei_multibody", multibody(deck(0.01, ei=1.0, waterkin="current_0.15.dat"))), + ("fei_mb", "viv_fei_multibody", + multibody(deck(0.01, ei=1.0, waterkin="current_0.15.dat", outputs="V"))), ] for u in (0.21, 0.30): runs.append((("stiff", u), f"viv_stiff_u{u}", deck(0.01, waterkin=f"current_{u}.dat", **stiff))) @@ -225,6 +242,21 @@ def run(name: str) -> subprocess.CompletedProcess[str]: check(abs(a1 - a0) <= 0.01 * a0 and abs(q1 - q0) <= 0.01 * q0 and abs(f1 - f0) <= 1.0 / 60.0, f"finite-EI cable on the multibody march: mid/quarter A/D {a1:.3f}/{q1:.3f} at {f1:.3f} Hz, " f"Hermite route {a0:.3f}/{q0:.3f} at {f0:.3f} Hz (within 1 % and one bin)") + lifts = {} + for key, name in ((0.01, "viv_dt0.01"), ("fei", "viv_fei"), ("fei_mb", "viv_fei_multibody")): + if key in results: + lifts[key] = lift_std(out / f"{name}.Line1.V.out") + if 0.01 in lifts: + ends = lifts[0.01][[0, -1]] + check(bool(np.all(ends == 0.0)) and lifts[0.01][25] > 0.5, + f"EI = 0 line lift file: no lift on the end nodes, mid-span cross-flow lift std " + f"{lifts[0.01][25]:.3f} N") + for key, what in (("fei", "cable"), ("fei_mb", "cable on the multibody march")): + if 0.01 in lifts and key in lifts: + inner0, inner1 = lifts[0.01][2:-2], lifts[key][2:-2] + worst = float(np.max(np.abs(inner1 - inner0) / np.maximum(inner0, 1.0e-3))) + check(worst <= 0.01, f"{what} lift file: interior cross-flow lift std within {worst:.2%} of the " + "EI = 0 line's (within 1 %)") if ("stiff", 0.21) in results and ("string", 0.21) in results: (a1, f1, _), (a0, f0, _) = results[("stiff", 0.21)], results[("string", 0.21)] check(abs(a1 - a0) <= 0.03 * a0 and abs(f1 - f0) <= 1.0 / 60.0,