From ce56b5c6e7f7ebf53112112f5e091ee9bbb543bd Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 20 Nov 2026 15:21:21 +0900 Subject: [PATCH 1/4] feat: VIV FRAME method cycle, a lag-free frame velocity The VIV FRAME section takes an optional third column, rows TypeName Tf [Method]: filter (the default, the first-order filter as before) or cycle. With cycle the frame velocity of a synchronisation type is the mean of the node velocity over the window Tf plus half its change over it, vbar(t) = (1/Tf) int_{t-Tf}^{t} v dt' + (v(t) - v(t-Tf))/2, which drops a component of period Tf and its harmonics (the cross-flow VIV and the in-line VIV at twice its frequency) and passes the slow motion of a towed or floater-driven cable without the filter's lag; Tf is then one period of the response. The filter's lag leaves the frame faster than the cable on a decelerating motion and slower on an accelerating one. The kernel (CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, CD_VIV_Cycle_Valid) samples the velocity's integral every Tf/64, exactly for the velocity linear over a step, in a ring of 66 samples held relative to the integral at the committed time; I(t - Tf) and v(t - Tf) come from the quadratic through the three samples around t - Tf. Its state, 2 + 3 x 66 rows per node, sits in the motion statistics after the frame rows on EI = 0 lines and finite-EI cables, so step recovery, snapshots and checkpoints carry it, and a restored state with a sample time off [0, 1] or a slot off the ring fails closed. A line takes one method; rows without the column are unchanged to the bit. Tests: viv_cycle_frame (a period-Tf component and its second harmonic drop out within 0.25 %, a ramp passes to round-off, a quadratic gives the T^2/12 error, long steps); hermite_viv_frame F5 (moving and fixed pipe agree, the frame follows the imposed velocity within 0.17 % against 1.7 % for the filter, snapshot replay bit for bit); hfmf_mirror (6) checkpoint round-trip and an invalid slot failing closed; viv_coupled (checkpoint restart and rewind with the ring on both line kinds); viv_frame_deck G5-G7 (Method filter is the row without it to the bit, Method cycle towed and held, refusals); viv_wake_deck W7 (the four-column row, an unknown Method and Method cycle on a wake-oscillator type refused by name). The Python deck checker and builder follow (viv_frame_method). Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 12 ++ CMakeLists.txt | 7 ++ doc/capabilities.rst | 3 +- doc/driver_format.md | 26 +++-- doc/theory.rst | 37 ++++++ python/cabledyn/builder.py | 28 ++++- python/cabledyn/deck_file.py | 55 +++++++-- python/tests/test_deck_file.py | 25 ++++- src/CableDyn_DeckDriver.f90 | 85 +++++++++++--- src/CableDyn_HermiteCableDynamic.f90 | 52 ++++++++- src/CableDyn_Model.f90 | 58 +++++++++- src/CableDyn_OpenFAST_HermiteFMF.f90 | 5 + src/CableDyn_VIV.f90 | 101 +++++++++++++++++ tests/test_hermite_viv_frame.f90 | 74 +++++++++++- tests/test_hfmf_mirror.f90 | 45 +++++++- tests/test_viv_coupled.f90 | 28 ++++- tests/test_viv_cycle_frame.f90 | 161 +++++++++++++++++++++++++++ tests/test_viv_frame_deck.f90 | 99 +++++++++++++++- tests/test_viv_wake_deck.f90 | 11 +- 19 files changed, 852 insertions(+), 60 deletions(-) create mode 100644 tests/test_viv_cycle_frame.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index c78ca02..b46907a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,18 @@ All notable changes to CableDyn are recorded in this file. The format follows ### Added +- `VIV FRAME` method `cycle`: an optional third column, rows `TypeName Tf [Method]`, `filter` (the + default) or `cycle`. With `cycle` the frame velocity of a synchronisation type is the mean of the + node velocity over the window `Tf` plus half its change over it, which drops a component of + period `Tf` and its harmonics (the cross-flow VIV and the in-line VIV at twice its frequency) and + passes the slow motion of a towed or floater-driven cable without the first-order filter's lag; + `Tf` is then one period of the response. The filter's lag leaves the frame faster than the cable + on a decelerating motion and slower on an accelerating one; on the moving pipe of the frame gate + the cycle mean follows the imposed velocity within 0.17 % of its amplitude, the filter within + 1.7 %. A ring of 66 samples per node is the new state (step recovery, snapshots, checkpoints; an + invalid restored state fails closed). `EI = 0` lines and finite-EI cables, standalone and + coupled; one method per line; rows without the column are unchanged to the bit. + - `OPTIONS CDOutDt` (alias `cd_out_dt`): the interval of the coupled `.CD.out` rows (OpenFAST and FAST.Farm), a whole multiple of the CableDyn step; `0`, the default, keeps a row after every committed step. A row re-evaluates and writes every deck channel, so on a cable with many diff --git a/CMakeLists.txt b/CMakeLists.txt index 9865b3f..cf31a56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1324,6 +1324,13 @@ target_link_libraries(test_viv_kernels PRIVATE cabledyn_core) add_test(NAME viv_kernels COMMAND test_viv_kernels) set_tests_properties(viv_kernels PROPERTIES LABELS "fortran;unit;dynamic;viv") +# The cycle-mean flow frame kernel (VIV FRAME method cycle): a component of period T and its second +# harmonic drop out, a ramp passes without lag, a quadratic gives the second-order error. +add_executable(test_viv_cycle_frame tests/test_viv_cycle_frame.f90) +target_link_libraries(test_viv_cycle_frame PRIVATE cabledyn_core) +add_test(NAME viv_cycle_frame COMMAND test_viv_cycle_frame) +set_tests_properties(viv_cycle_frame PROPERTIES LABELS "fortran;unit;dynamic;viv") + # Time-step convergence of a locked-in VIV response (the line and the synchronisation model or the # wake oscillator coupled): second order in the step at rho_inf 1 and 0.4 on an EI = 0 line, and # on a finite-EI cable; the lock-in does not move with the numerical damping. diff --git a/doc/capabilities.rst b/doc/capabilities.rst index e5b7458..69277c2 100644 --- a/doc/capabilities.rst +++ b/doc/capabilities.rst @@ -157,7 +157,8 @@ Line and constitutive capability host's fluid field on the coupled routes and its state in the checkpoint; a ``VIV FRAME`` row (``Tf``) takes the cable's filtered motion as the frame of its phases, amplitude estimate and cross-flow damping (a towed or floater-driven cable, - :ref:`theory-viv-frame`) + :ref:`theory-viv-frame`), by a first-order filter or (method ``cycle``) the lag-free mean + over one response period * - Stochastic VIV band centre (``VIV STOCHASTIC`` section ``sigma``, ``c``, ``Nf``, ``seed``) - Standalone and coupled - the slowly varying random synchronisation centre of Ulveseter et al. (2017) on ``EI = 0`` diff --git a/doc/driver_format.md b/doc/driver_format.md index 9dec5de..c7131b8 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1382,15 +1382,16 @@ filter time `Tf` the frame moves with the cable's own slow motion (see ```text --------------------- VIV FRAME ---------------------------------------- -TypeName Tf -(-) (s) -cable 10 +TypeName Tf Method +(-) (s) (-) +cable 10 filter ``` | Column | Meaning | |--------|---------| | `TypeName` | an existing LINE TYPES name (case-insensitive) with LINE TYPES `Cl > 0` or a WAKE OSCILLATOR row, at most one row each | -| `Tf` | filter time >= 0 [s], at most 1e15; `0` is the ambient flow | +| `Tf` | filter time >= 0 [s], at most 1e15; `0` is the ambient flow; with `Method cycle` the window, one period of the VIV response | +| `Method` | optional: `filter` (the default) or `cycle` (synchronisation model only, `Tf > 0`) | Behaviour: @@ -1420,11 +1421,22 @@ Behaviour: in the relative velocity (`omega_m Tf <= 0.1`) needs a motion period at least 30 VIV periods long. For a motion only a few VIV periods long (a floater heave close to the VIV frequency) no `Tf` separates the two, and the response depends on `Tf`: report its sensitivity to `Tf`. +- `Method cycle` takes the frame velocity as the mean over the window `Tf` plus half its change + over it, `(1/Tf) int_{t-Tf}^{t} v dt' + (v(t) - v(t-Tf))/2`: a component of period `Tf` and its + harmonics (the cross-flow VIV and the in-line VIV at twice its frequency) drop out, and the + slow motion passes without the filter's lag, so a decelerating motion does not leave the frame + faster than the cable. Give `Tf` as one period of the response (`1/f`): off the period the VIV + velocity passes into the frame by about `|sin(pi delta)|` for `f Tf = 1 + delta` (a taut cable + responding at 0.29 Hz locks in at A/D 0.79 with `Tf` 3.5 s and at 0.55 with `Tf` 1 s), so it + suits a response at one known frequency. A line takes one method; its ring of 66 samples per node + is part of the step-recovery, snapshot and checkpoint state (see + [Flow frame of the synchronisation model](theory.rst)). - The filtered velocity is part of the step-recovery, snapshot and checkpoint state. A row with `Tf = 0` leaves the run exactly as without it. It acts on `EI = 0` lines and finite-EI cables, - standalone and coupled. A row fails if it is not `TypeName Tf`, names an undefined or already - named type or one without VIV (neither LINE TYPES `Cl > 0` nor a WAKE OSCILLATOR row), or holds - a value out of range. + standalone and coupled. A row fails if it is not `TypeName Tf [Method]`, names an undefined or + already named type or one without VIV (neither LINE TYPES `Cl > 0` nor a WAKE OSCILLATOR row), + holds a value out of range or a `Method` other than `filter` and `cycle`, or takes `cycle` on a + type without `Cl > 0` or with `Tf = 0`; a line whose types mix the two methods fails. ### VIV STOCHASTIC (optional) diff --git a/doc/theory.rst b/doc/theory.rst index 9d74a3a..8cb0dda 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1682,6 +1682,43 @@ estimate, stay 0 without a table), so it is part of the step-recovery, snapshot state; an ``EI = 0`` line filters its smoothed node velocity. :math:`T_f` 0 or no row leaves the run unchanged to the bit. +**Cycle mean** (``VIV FRAME`` method ``cycle``). The first-order filter lags a motion at +:math:`\omega_m` by :math:`\arctan\omega_m T_f`, so on a decelerating motion the frame keeps more +of the earlier, faster velocity than the cable has, and on an accelerating one less, so the frame +speed differs between the two half-cycles at the same flow speed. With the method ``cycle`` the frame velocity is instead the mean over the +window :math:`T = T_f` plus half the change over it, + +.. math:: + + \bar{\mathbf v}(t) = \frac{1}{T}\int_{t-T}^{t}\mathbf v\,dt' + + \tfrac12\left[\mathbf v(t) - \mathbf v(t - T)\right]. + +A component of period :math:`T` and its harmonics drop out of both terms (the cross-flow VIV at +:math:`f = 1/T` and the in-line one at :math:`2f`), and a velocity linear in time passes unchanged, +without lag; a velocity quadratic in time is off by :math:`T^2/12` times its second derivative. +The integral :math:`I = \int\mathbf v\,dt` is sampled every :math:`h = T/64`, exactly for the +velocity linear over a step, in a ring of 66 samples per node held relative to :math:`I` at the +committed time, and :math:`I(t - T)` and :math:`\mathbf v(t - T) = I'(t - T)` come from the +quadratic through the three samples around :math:`t - T`; the sampled harmonics at :math:`f` and +:math:`2f` leave 0.25 % of their amplitude (``viv_cycle_frame``). On the pipe moved through still +water above (``Tf`` 0.6 s against the window 1 s) the frame velocity is off the imposed velocity +by 0.17 % of its amplitude over 5-15 s, against 1.7 % for the filter (``hermite_viv_frame``). The +window must be one period of the response, :math:`T = 1/f`: off the period the VIV velocity +passes into :math:`\bar{\mathbf v}` by about :math:`|\sin(\pi\,\delta)|` for a mismatch +:math:`fT = 1 + \delta`, and the phases and the amplitude estimate lose it (the taut cable of the +deck gate, its response at 0.29 Hz, locks in at A/D 0.79 with :math:`T` 3.5 s and at 0.55 with +:math:`T` 1 s). It therefore suits a response at one known frequency; a response that moves +between modes needs the filter. The method acts on the synchronisation model (not the wake +oscillator), one method per line. The sample time, the ring slot and the ring are +:math:`2 + 3 \times 66` rows of the node's motion statistics after rows 7-9, so they are part of +the step-recovery, snapshot and checkpoint state, and a restart that installs a sample time off +:math:`[0, 1]` or a slot off the ring fails closed. On the L3-O cylinder with the published sets, +the window :math:`T = 1/f_1` = 0.373 s against the filter of the record (:math:`T_f` 0.2 s), the +mean gap between the decelerating and accelerating paths becomes 0.413 / 0.599 for uls19 at +:math:`U_{R,max}` 6.5 / 7.9 (0.426 / 0.498 with the filter; measured 0.089 / 0.123) and +0.320 / 0.267 for b1 (0.364 / 0.380): the method removes the filter's lag from the frame, not the +deceleration hold of these sets. + .. _theory-viv-stochastic: Stochastic band centre diff --git a/python/cabledyn/builder.py b/python/cabledyn/builder.py index 1996130..5b80ab2 100644 --- a/python/cabledyn/builder.py +++ b/python/cabledyn/builder.py @@ -240,6 +240,11 @@ class LineType: the phases, the amplitude estimate (and so the ``viv_amplitude`` coefficients) and the ``viv_damping`` split, so it needs ``cl > 0`` or ``wake_cl0``. ``None`` writes no row. + viv_frame_method : str | None + Optional method of the ``VIV FRAME`` row, its third column: ``"filter"`` (the + first-order filter, as without the column) or ``"cycle"`` (the lag-free mean over the + window ``viv_frame_tf``, one period of the response; synchronisation model only, + ``viv_frame_tf > 0``). ``None`` writes the two-column row. viv_stochastic : tuple[float, ...] | None Optional stochastic band centre of a type's synchronisation model, a ``VIV STOCHASTIC`` section row ``Name sigma c [Nf [seed]]`` as @@ -297,6 +302,7 @@ class LineType: viv_frame_tf: float | None = None viv_damping: tuple[float, ...] | None = None viv_stochastic: tuple[float, ...] | None = None + viv_frame_method: str | None = None @dataclass(eq=False) @@ -1725,6 +1731,7 @@ def add_line_type( viv_frame_tf: float | None = None, viv_damping: tuple[float, ...] | None = None, viv_stochastic: tuple[float, ...] | None = None, + viv_frame_method: str | None = None, ) -> LineType: """Add a ``LINE TYPES`` row; see :class:`LineType` for the fields. @@ -1770,6 +1777,7 @@ def add_line_type( viv_frame_tf, None if viv_damping is None else tuple(viv_damping), None if viv_stochastic is None else tuple(viv_stochastic), + viv_frame_method, ) self._line_types.append(item) return item @@ -3117,15 +3125,31 @@ def _viv_diam_table(self) -> tuple[str, str, list[list[str]]]: def _viv_frame_table(self) -> tuple[str, str, list[list[str]]]: rows: list[list[str]] = [] + with_method = any( + item.viv_frame_tf is not None and item.viv_frame_method is not None + for item in self._line_types + ) for item in self._line_types: if item.viv_frame_tf is None: + if item.viv_frame_method is not None: + raise ValueError( + f"line type {item.name!r}: viv_frame_method needs viv_frame_tf" + ) continue what = f"line type {item.name!r}" if item.wake_cl0 is None and not (item.cl is not None and item.cl > 0.0): raise ValueError( f"{what}: viv_frame_tf sets the frame of its VIV model, set cl > 0 or wake_cl0" ) - rows.append([_text(item.name, what), _num(item.viv_frame_tf, what)]) + row = [_text(item.name, what), _num(item.viv_frame_tf, what)] + if with_method: + method = (item.viv_frame_method or "filter").lower() + if method not in ("filter", "cycle"): + raise ValueError(f"{what}: viv_frame_method must be 'filter' or 'cycle'") + row.append(method) + rows.append(row) + if with_method: + return "Name Tf Method", "(-) (s) (-)", rows return "Name Tf", "(-) (s)", rows def _viv_sto_table(self) -> tuple[str, str, list[list[str]]]: @@ -3373,6 +3397,8 @@ def load(self) -> None: for row in self.rows("VIV FRAME"): t = row.tokens model.line_types[t[0]].viv_frame_tf = _f(t[1]) + if len(t) > 2: + model.line_types[t[0]].viv_frame_method = t[2].lower() for row in self.rows("VIV STOCHASTIC"): t = row.tokens model.line_types[t[0]].viv_stochastic = tuple(_f(v) for v in t[1:]) diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 3496702..33b6d9c 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -3393,22 +3393,40 @@ def _check_viv_diam_section(self, viv_type_names: set[str]) -> None: "VIV: give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row" ) - def _check_viv_frame_section(self, frame_type_names: set[str]) -> None: - """Native ``apply_type_viv_frame`` for the VIV FRAME section. + def _check_viv_frame_section( + self, + frame_type_names: set[str], + lift_type_names: set[str] | None = None, + section_types_by_line: dict | None = None, + ) -> None: + """Native ``apply_type_viv_frame`` and ``deck_line_frame_cycle`` for the VIV FRAME section. - A row ``TypeName Tf`` sets the flow frame of a line type's VIV model: with the filter + A row ``TypeName Tf [Method]`` sets the flow frame of a line type's VIV model: with the time ``Tf > 0`` [s] the free stream is the ambient flow relative to the cable's velocity - low-pass filtered over ``Tf`` (0: the ambient flow), at most 1e15. It sets the wake - oscillator's frequency, or on the synchronisation model the motion of the phases, the - amplitude estimate and the VIV DAMPING split, so the type needs LINE TYPES ``Cl > 0`` or - a WAKE OSCILLATOR row with ``CL0 > 0`` (``frame_type_names``); a type takes one row. + low-pass filtered over ``Tf`` (``Method filter``, the default) or its lag-free mean over + the window ``Tf`` (``Method cycle``, synchronisation types only, ``Tf > 0``); 0 is the + ambient flow, at most 1e15. It sets the wake oscillator's frequency, or on the + synchronisation model the motion of the phases, the amplitude estimate and the VIV + DAMPING split, so the type needs LINE TYPES ``Cl > 0`` (``lift_type_names``) or a WAKE + OSCILLATOR row with ``CL0 > 0`` (``frame_type_names``); a type takes one row, and a line + whose framed lift types mix the two methods fails. """ types = {row.tokens[0].lower(): row.tokens[0] for row in self.line_types} named: set[str] = set() + cycle_types: set[str] = set() + filter_types: set[str] = set() for row in self._rows("VIV FRAME"): where = self._at(row) - if len(row.tokens) != 2: - raise DeckFormatError(f"{where}: VIV FRAME rows must be: TypeName Tf") + if len(row.tokens) not in (2, 3): + raise DeckFormatError(f"{where}: VIV FRAME rows must be: TypeName Tf [Method]") + cyc = False + if len(row.tokens) == 3: + method = row.tokens[2].lower() + if method not in ("filter", "cycle"): + raise DeckFormatError( + f'{where}: VIV FRAME Method must be filter or cycle, got "{row.tokens[2]}"' + ) + cyc = method == "cycle" name = row.tokens[0].lower() if name not in types: raise DeckFormatError( @@ -3431,6 +3449,21 @@ def _check_viv_frame_section(self, frame_type_names: set[str]) -> None: f'{where}: VIV FRAME of LINE TYPE "{types[name]}" sets the flow frame of its ' "VIV model: give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row" ) + lifting = lift_type_names is None or name in lift_type_names + if cyc and not (lifting and value > 0.0): + raise DeckFormatError( + f'{where}: VIV FRAME Method cycle of LINE TYPE "{types[name]}" acts on the ' + "synchronisation model (LINE TYPES Cl > 0) with a window Tf > 0" + ) + if lifting and value > 0.0: + (cycle_types if cyc else filter_types).add(name) + for line_id, section_types in (section_types_by_line or {}).items(): + used = {t.lower() for t in section_types} + if used & cycle_types and used & filter_types: + raise DeckFormatError( + f"{self._label}: line {line_id}: its VIV FRAME rows mix the methods filter and " + "cycle; a line takes one method" + ) def _check_viv_sto_section(self, viv_type_names: set[str], wake_type_names: set[str]) -> None: """Native ``apply_type_viv_sto`` for the VIV STOCHASTIC section. @@ -4905,7 +4938,9 @@ def end_key(token: str) -> str: wake_type_names = self._check_wake_section(viv_type_names) amp_type_names = self._check_viv_amp_section(viv_type_names) self._check_viv_diam_section(viv_type_names | wake_type_names) - self._check_viv_frame_section(viv_type_names | wake_type_names) + self._check_viv_frame_section( + viv_type_names | wake_type_names, viv_type_names, section_types_by_line + ) self._check_viv_sto_section(viv_type_names, wake_type_names) damp_type_names = self._check_viv_damp_section(amp_type_names) amp_lines = { diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 47d6ba2..1049367 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -5012,7 +5012,9 @@ def test_viv_frame_rows_are_read_and_kept(tmp_path): @pytest.mark.parametrize( "wake, rows, message", [ - (True, ("chain 8 1",), "rows must be: TypeName Tf"), + (True, ("chain 8 cycle 1",), "rows must be: TypeName Tf [Method]"), + (True, ("chain 8 1",), 'Method must be filter or cycle, got "1"'), + (True, ("chain 8 cycle",), "acts on the synchronisation model"), (True, ("cable 8",), 'undefined LINE TYPE "cable"'), (True, ("chain 8", "chain 4"), 'names LINE TYPE "chain" twice'), (True, ("chain -1",), "filter time Tf must be >= 0"), @@ -5033,6 +5035,27 @@ def test_viv_frame_rows_follow_the_native_checks(wake, rows, message): ) +def test_viv_frame_method_cycle_is_read_kept_and_checked(tmp_path): + from cabledyn import DeckModel + + lift_only = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")) + text = _with_section(lift_only, "VIV FRAME", "TypeName Tf Method", "chain 0.4 cycle") + DeckFile.from_text(text) + path = tmp_path / "cycle.dat" + path.write_text(text, encoding="utf-8") + model = DeckModel.load(path) + assert model.line_types["chain"].viv_frame_tf == 0.4 + assert model.line_types["chain"].viv_frame_method == "cycle" + saved = tmp_path / "saved.dat" + model.save(saved) + again = DeckModel.load(saved) + assert again.line_types["chain"].viv_frame_method == "cycle" + assert again.line_types["chain"].viv_frame_tf == 0.4 + DeckFile.from_text(_with_section(lift_only, "VIV FRAME", "chain 8 filter")) + with pytest.raises(DeckFormatError, match=re.escape("with a window Tf > 0")): + DeckFile.from_text(_with_section(lift_only, "VIV FRAME", "chain 0 cycle")) + + def test_viv_frame_takes_a_synchronisation_type(): # the phases of the lift alone, and with a table its estimate and damping split, take it lift_only = _edit(_DYNAMIC, (_LIFT_ROW, _LIFT_ROW + " 0.8")) diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 15ab521..7e54eab 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -471,10 +471,12 @@ MODULE CableDyn_DeckDriver ! has_wake_row marks a type the section names. REAL(wp) :: wo_cl0 = CD_ZERO, wo_st = CD_VIV_WAKE_DEFAULT_ST, wo_eps = CD_VIV_WAKE_DEFAULT_EPS REAL(wp) :: wo_a = CD_VIV_WAKE_DEFAULT_A - ! The VIV frame of a line type (the optional VIV FRAME section, a row per type: TypeName Tf): - ! the filter time Tf [s] of the cable velocity that the VIV model's flow frame moves with - ! (0: the ambient flow); has_vivf_row marks a type the section names. + ! The VIV frame of a line type (the optional VIV FRAME section, a row per type: TypeName Tf + ! [Method]): the time Tf [s] of the cable velocity that the VIV model's flow frame moves with + ! (0: the ambient flow), the first-order filter time or with Method cycle (viv_tfcyc) the + ! window of the cycle mean; has_vivf_row marks a type the section names. REAL(wp) :: viv_tf = CD_ZERO + LOGICAL :: viv_tfcyc = .FALSE. LOGICAL :: has_vivf_row = .FALSE. ! The stochastic band centre of a line type (the optional VIV STOCHASTIC section, a row per type: ! TypeName sigma c [Nf [seed]]; Ulveseter et al. 2017): the standard deviation sigma of the @@ -3774,6 +3776,9 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, ! nodes and tangent (a line the reader turned around, a mesh the static solve refined) BLOCK REAL(wp) :: seed(cable%line%nn) + LOGICAL :: frame_cyc + frame_cyc = deck_line_frame_cycle(ln, sections, types, ErrStat, ErrMsg) + IF (ErrStat /= 0) RETURN IF (ALLOCATED(cable%deck_node)) THEN CALL CD_Deck_VIV_Phase_Seed(cable%line%l0, ln%ends_swapped, seed, deck_map=cable%deck_node, & zero=opts%viv_phase_zero) @@ -3801,7 +3806,7 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, tangent_reversed=.NOT. ln%ends_swapped, clx=viv_clx, il_alpha=viv_al, & chh=viv_hh, amp=viv_amp3, amp_n=viv_ampn, dviv=viv_dva, & cdy=RESHAPE([cdy_a, cdy_b, cdy_c], [3, SIZE(cdy_a)], ORDER=[2, 1]), & - tf=wo_tf, sto=viv_sto) + tf=wo_tf, sto=viv_sto, tf_cycle=frame_cyc) ELSE CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, viv_cl, viv_cf, viv_df, & MERGE(opts%viv_rms_window, & @@ -3810,7 +3815,7 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, tangent_reversed=.NOT. ln%ends_swapped, amp=viv_amp3, amp_n=viv_ampn, & dviv=viv_dva, & cdy=RESHAPE([cdy_a, cdy_b, cdy_c], [3, SIZE(cdy_a)], ORDER=[2, 1]), & - tf=wo_tf, sto=viv_sto) + tf=wo_tf, sto=viv_sto, tf_cycle=frame_cyc) END IF END BLOCK IF (es /= CD_HCDYN_OK) THEN @@ -10988,6 +10993,9 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er ! deck's End B: CD_Deck_VIV_Phase_Seed takes it to the model's nodes and tangent BLOCK REAL(wp) :: seed(model%n_dof/3) + LOGICAL :: frame_cyc + frame_cyc = deck_line_frame_cycle(ln, sections, types, ErrStat, ErrMsg) + IF (ErrStat /= 0) RETURN CALL CD_Deck_VIV_Phase_Seed(model%l0, ln%ends_swapped, seed, zero=opts%viv_phase_zero) ! the VIV AMPLITUDE tables, left unallocated (absent below) on a line without one CALL viv_amp_tables(types, viv_tix, viv_amp3, viv_ampn) @@ -11000,11 +11008,11 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, viv_dia, viv_cf, viv_df, tw, es, em, & phase_seed=seed, tangent_reversed=.NOT. ln%ends_swapped, clx=viv_clx, & il_alpha=viv_al, chh=viv_hh, amp=viv_amp3, amp_n=viv_ampn, tf=viv_ftf, & - sto=viv_sto) + sto=viv_sto, tf_cycle=frame_cyc) ELSE CALL CD_Set_Model_VIV(model, opts%rhoW, viv_cl, viv_dia, viv_cf, viv_df, tw, es, em, & phase_seed=seed, tangent_reversed=.NOT. ln%ends_swapped, amp=viv_amp3, & - amp_n=viv_ampn, tf=viv_ftf, sto=viv_sto) + amp_n=viv_ampn, tf=viv_ftf, sto=viv_sto, tf_cycle=frame_cyc) END IF END BLOCK IF (es == CD_MODEL_OK) CALL CD_Recompute_Model_Acceleration(model, es, em) @@ -18028,9 +18036,12 @@ SUBROUTINE apply_type_viv_diam(row, types, ErrStat, ErrMsg) END SUBROUTINE apply_type_viv_diam SUBROUTINE apply_type_viv_frame(row, types, ErrStat, ErrMsg) - !! One VIV FRAME row: TypeName Tf -- the flow frame of a line type's VIV model: with the filter - !! time Tf > 0 [s] (at most 1e15) the flow the model takes as the free stream is the ambient - !! flow relative to the cable's velocity low-pass filtered over Tf (first order), so that a + !! One VIV FRAME row: TypeName Tf [Method] -- the flow frame of a line type's VIV model: with + !! the time Tf > 0 [s] (at most 1e15) the flow the model takes as the free stream is the ambient + !! flow relative to the cable's velocity low-pass filtered over Tf (Method filter, the default: + !! first order; Method cycle, synchronisation model only: the cycle mean over the window Tf plus + !! half the velocity's change over it, which drops a component of period Tf and its harmonics + !! and passes the slow motion without lag; Tf then about one VIV period), so that a !! cable moved through the water by a tow or its floater sees that motion as flow, and its own !! VIV velocity, much faster than Tf, does not count; Tf 0 is the ambient flow. It sets the !! wake oscillator's frequency, or on the synchronisation model (LINE TYPES Cl > 0) the motion @@ -18045,11 +18056,23 @@ SUBROUTINE apply_type_viv_frame(row, types, ErrStat, ErrMsg) CHARACTER(DECK_RECLEN) :: tok INTEGER :: it REAL(wp) :: v - LOGICAL :: found, ok + LOGICAL :: found, ok, cyc ErrStat = 0; ErrMsg = '' - IF (count_tokens(row) /= 2) THEN - CALL fail(ErrStat, ErrMsg, 'VIV FRAME rows must be: TypeName Tf'); RETURN + IF (count_tokens(row) /= 2 .AND. count_tokens(row) /= 3) THEN + CALL fail(ErrStat, ErrMsg, 'VIV FRAME rows must be: TypeName Tf [Method]'); RETURN + END IF + cyc = .FALSE. + IF (count_tokens(row) == 3) THEN + CALL get_token(row, 3, tok, found) + SELECT CASE (to_lower(TRIM(tok))) + CASE ('filter') + cyc = .FALSE. + CASE ('cycle') + cyc = .TRUE. + CASE DEFAULT + CALL fail(ErrStat, ErrMsg, 'VIV FRAME Method must be filter or cycle, got "'//TRIM(tok)//'"'); RETURN + END SELECT END IF CALL get_token(row, 1, tok, found) it = find_type(types, TRIM(tok)) @@ -18072,10 +18095,46 @@ SUBROUTINE apply_type_viv_frame(row, types, ErrStat, ErrMsg) CALL fail(ErrStat, ErrMsg, 'VIV FRAME of LINE TYPE "'//TRIM(types(it)%name)//'" sets the flow frame of '// & 'its VIV model: give the type LINE TYPES Cl > 0 or a WAKE OSCILLATOR row'); RETURN END IF + IF (cyc .AND. .NOT. (types(it)%cl > CD_ZERO .AND. v > CD_ZERO)) THEN + CALL fail(ErrStat, ErrMsg, 'VIV FRAME Method cycle of LINE TYPE "'//TRIM(types(it)%name)//'" acts on the '// & + 'synchronisation model (LINE TYPES Cl > 0) with a window Tf > 0'); RETURN + END IF types(it)%viv_tf = v + types(it)%viv_tfcyc = cyc types(it)%has_vivf_row = .TRUE. END SUBROUTINE apply_type_viv_frame + LOGICAL FUNCTION deck_line_frame_cycle(ln, sections, types, ErrStat, ErrMsg) RESULT(cyc) + !! The VIV FRAME method of a line: .TRUE. where its lifting types with a frame (Cl > 0, Tf > 0) + !! take Method cycle. A line takes one method; types that mix the two are refused. + TYPE(DeckLine), INTENT(IN) :: ln + TYPE(DeckSection), INTENT(IN) :: sections(:) + TYPE(DeckLineType), INTENT(IN) :: types(:) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER :: i, tidx + LOGICAL :: any_cyc, any_filter + ErrStat = 0; ErrMsg = '' + any_cyc = .FALSE. + any_filter = .FALSE. + DO i = 1, SIZE(sections) + IF (sections(i)%line_id /= ln%id) CYCLE + tidx = sections(i)%ltype + IF (.NOT. (types(tidx)%cl > CD_ZERO .AND. types(tidx)%viv_tf > CD_ZERO)) CYCLE + IF (types(tidx)%viv_tfcyc) THEN + any_cyc = .TRUE. + ELSE + any_filter = .TRUE. + END IF + END DO + cyc = any_cyc + IF (any_cyc .AND. any_filter) THEN + CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': its VIV FRAME rows mix the methods filter '// & + 'and cycle; a line takes one method') + cyc = .FALSE. + END IF + END FUNCTION deck_line_frame_cycle + SUBROUTINE apply_type_viv_sto(row, types, ErrStat, ErrMsg) !! One VIV STOCHASTIC row: TypeName sigma c [Nf [seed]] -- the stochastic band centre of a line !! type's synchronisation model (Ulveseter et al. 2017): the centre cF becomes a slowly varying diff --git a/src/CableDyn_HermiteCableDynamic.f90 b/src/CableDyn_HermiteCableDynamic.f90 index ed77b53..fb286b7 100644 --- a/src/CableDyn_HermiteCableDynamic.f90 +++ b/src/CableDyn_HermiteCableDynamic.f90 @@ -70,6 +70,7 @@ MODULE CableDyn_HermiteCableDynamic CD_VIV_Inline_Phase_Rate, CD_VIV_Wake_Advance, CD_VIV_NMS, CD_VIV_NMS_AMP, & CD_VIV_AMP_MAXP, CD_VIV_Amplitude_Update, CD_VIV_Table, CD_VIV_Check_Amp_Table, & CD_VIV_Ambient_Crossflow_Rate, CD_VIV_NMS_FRAME, CD_VIV_Mean_Square_Weight, & + CD_VIV_NMS_CYC, CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, & CD_VIV_Filter_Linear, CD_VIV_Sto_Node, CD_VIV_Sto_Centre, CD_VIV_STO_MAXF USE CableDyn_Hydro, ONLY: CD_Morison_Drag_Per_Length_Jac, CD_Airy_Wave_Kinematics_Precomputed, & CD_Morison_Drag_Split_Per_Length_Jac, & @@ -406,6 +407,10 @@ MODULE CableDyn_HermiteCableDynamic ! amplitude-table coefficients, and on an element with viv_ftfe(e) > 0 the axes and blend of ! the cross-flow damping (elem_frame_v, the mean over its end nodes). LOGICAL :: viv_frame = .FALSE. + ! the cycle-mean frame (Set_VIV tf_cycle; VIV FRAME method cycle): rows 7:9 hold instead the + ! cycle mean over Tf of the node velocity (CD_VIV_Cycle_Update), its state in the + ! CD_VIV_NMS_CYC rows after them, so the snapshot, the step recovery and the checkpoint carry it + LOGICAL :: viv_cyc = .FALSE. REAL(wp), ALLOCATABLE :: viv_ftf(:), viv_ftfe(:) ! The stochastic band centre (Set_VIV sto; VIV STOCHASTIC section; CableDyn_VIV): with sigma > 0 ! on some element (viv_sto) viv_ms has one more row, its last, the node's travelled @@ -1183,7 +1188,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Axial(model, mu_axial, ErrStat, ErrM END SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Axial SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, ErrMsg, phase_seed, tangent_reversed, & - clx, il_alpha, chh, wake, amp, amp_n, dviv, cdy, tf, sto) + clx, il_alpha, chh, wake, amp, amp_n, dviv, cdy, tf, sto, tf_cycle) !! Install the cross-flow VIV synchronisation model (CableDyn_VIV) on a cable with drag: !! per element the lift coefficient cl (0: no lift) and the band df/cf, and the running-RMS !! averaging time t_window (s; 0 takes 500 steps of the first step). The lift acts on the @@ -1252,6 +1257,12 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err !! length-weighted c over those with sigma > 0, the most components and the seed of the first; !! its centre advances with the node's travelled distance theta = integral U/D dt, U the !! shedding speed of the phase rate, at the step's mid-point as the phase. + !! + !! tf_cycle (optional, with tf; default .FALSE.): the frame velocity is the cycle mean over the + !! window Tf instead of the first-order filter, vbar = (1/Tf) int_{t-Tf}^{t} v dt' + + !! (v(t) - v(t-Tf))/2 (CD_VIV_Cycle_Update): a component of period Tf and its harmonics drop + !! out and the slow motion passes without the filter's lag. Tf is then about one period of the + !! cable's VIV response. TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model REAL(wp), INTENT(IN) :: cl(:), cf(:), df(:), t_window INTEGER, INTENT(OUT) :: ErrStat @@ -1268,9 +1279,10 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err REAL(wp), INTENT(IN), OPTIONAL :: dviv(:) REAL(wp), INTENT(IN), OPTIONAL :: cdy(:, :) REAL(wp), INTENT(IN), OPTIONAL :: tf(:) + LOGICAL, INTENT(IN), OPTIONAL :: tf_cycle REAL(wp), INTENT(IN), OPTIONAL :: sto(:, :) INTEGER :: e, k, ne, nn, es, nms, nw, nfm, nfk, seedk - LOGICAL :: had_filter, had_frame, want_frame, had_sto, want_sto + LOGICAL :: had_filter, had_frame, want_frame, had_sto, want_sto, had_cyc, want_cyc REAL(wp) :: wsum, tw_old, rest_old, ssum, csum, cw REAL(wp), ALLOCATABLE :: s_a(:), s_f(:, :), s_p(:, :) INTEGER, ALLOCATABLE :: s_n(:) @@ -1523,6 +1535,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err had_wake = model%viv_wake had_filter = model%wo_filter had_frame = model%viv_frame + had_cyc = model%viv_cyc had_sto = model%viv_sto had_amp = model%has_viv_amp tw_old = model%viv_tw @@ -1540,6 +1553,10 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err END IF nms = MERGE(CD_VIV_NMS_AMP, CD_VIV_NMS, want_amp) IF (want_frame) nms = CD_VIV_NMS_FRAME + want_cyc = .FALSE. + IF (want_frame .AND. PRESENT(tf_cycle)) want_cyc = tf_cycle + ! the cycle-mean frame's state after the frame rows + IF (want_cyc) nms = nms + CD_VIV_NMS_CYC ! the step predictor after the motion statistics (viv_pred_row; row 2 on a wake cable) IF (.NOT. want_wake) nms = nms + MERGE(2, 1, want_il) ! the travelled distance of the stochastic band centre last (viv_theta) @@ -1596,6 +1613,14 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err ALLOCATE (model%viv_ftfe(ne), model%viv_ftf(nn)) model%viv_ftfe = tf model%viv_ftf = CD_ZERO + ! every node holds a valid cycle-mean state (nodes without lift included), so a checkpoint of + ! the whole block reloads + IF (want_cyc) THEN + DO k = 1, nn + CALL CD_VIV_Cycle_Init(model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, k), & + model%v(6*(k - 1) + 1:6*(k - 1) + 3)) + END DO + END IF DO k = 1, nn IF (.NOT. model%viv_node(k)) CYCLE wsum = CD_ZERO @@ -1606,8 +1631,11 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, t_window, ErrStat, Err END DO model%viv_ftf(k) = model%viv_ftf(k)/wsum model%viv_ms(7:9, k) = model%v(6*(k - 1) + 1:6*(k - 1) + 3) + IF (want_cyc) CALL CD_VIV_Cycle_Init(model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, k), & + model%v(6*(k - 1) + 1:6*(k - 1) + 3)) END DO model%viv_frame = .TRUE. + model%viv_cyc = want_cyc END IF IF (want_sto) THEN ! per node the length-weighted sigma over its lifting elements, the length-weighted c over @@ -1750,6 +1778,7 @@ SUBROUTINE refresh_acceleration() model%viv_wake = had_wake model%wo_filter = had_filter model%viv_frame = had_frame + model%viv_cyc = had_cyc model%viv_sto = had_sto model%has_viv_amp = had_amp model%viv_tw = tw_old @@ -1848,6 +1877,7 @@ SUBROUTINE clear_viv(model) IF (ALLOCATED(model%viv_ftfe)) DEALLOCATE (model%viv_ftfe) IF (ALLOCATED(model%viv_sto_a)) DEALLOCATE (model%viv_sto_a, model%viv_sto_f, model%viv_sto_p, model%viv_sto_n) model%viv_frame = .FALSE. + model%viv_cyc = .FALSE. model%viv_sto = .FALSE. model%has_viv_amp = .FALSE. model%has_viv = .FALSE. @@ -2082,6 +2112,7 @@ PURE INTEGER FUNCTION viv_pred_row(model) RESULT(r) IF (model%viv_wake) RETURN r = MERGE(CD_VIV_NMS_AMP, CD_VIV_NMS, model%has_viv_amp) IF (model%viv_frame) r = CD_VIV_NMS_FRAME + IF (model%viv_cyc) r = r + CD_VIV_NMS_CYC r = r + 1 END FUNCTION viv_pred_row @@ -2304,9 +2335,20 @@ SUBROUTINE viv_step_end(model, dt) vf = CD_ZERO IF (model%viv_frame) THEN IF (model%viv_ftf(k) > CD_ZERO) THEN - IF (CD_All_Finite(model%v(i0 + 1:i0 + 3))) & - model%viv_ms_next(7:9, k) = CD_VIV_Filter_Linear(model%viv_ms(7:9, k), model%ws_vn(i0 + 1:i0 + 3), & - model%v(i0 + 1:i0 + 3), dt/model%viv_ftf(k)) + IF (CD_All_Finite(model%v(i0 + 1:i0 + 3))) THEN + IF (model%viv_cyc) THEN + ! the cycle mean over Tf (CD_VIV_Cycle_Update), the velocity linear over the step, + ! from the committed state (so a repeated end-of-step pass gives the same result) + model%viv_ms_next(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, k) = & + model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, k) + CALL CD_VIV_Cycle_Update(model%viv_ms_next(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, k), & + model%ws_vn(i0 + 1:i0 + 3), model%v(i0 + 1:i0 + 3), dt, model%viv_ftf(k), & + model%viv_ms_next(7:9, k)) + ELSE + model%viv_ms_next(7:9, k) = CD_VIV_Filter_Linear(model%viv_ms(7:9, k), model%ws_vn(i0 + 1:i0 + 3), & + model%v(i0 + 1:i0 + 3), dt/model%viv_ftf(k)) + END IF + END IF vf = 0.5_wp*(model%viv_ms(7:9, k) + model%viv_ms_next(7:9, k)) END IF END IF diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index f593c0f..6eea0f3 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -61,6 +61,7 @@ MODULE CableDyn_Model CD_VIV_NMS, CD_VIV_NMS_AMP, CD_VIV_AMP_MAXP, CD_VIV_Amplitude_Update, CD_VIV_Table, & CD_VIV_Check_Amp_Table, CD_VIV_Ambient_Crossflow_Rate, CD_VIV_Wake_Advance, & CD_VIV_NMS_FRAME, CD_VIV_Mean_Square_Weight, CD_VIV_Filter_Linear, & + CD_VIV_NMS_CYC, CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, CD_VIV_Cycle_Valid, & CD_VIV_Sto_Node, CD_VIV_Sto_Centre, CD_VIV_STO_MAXF USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_CableGenAlphaWorkspace, CD_Clear_GenAlpha_Workspace, & CD_Cable_Initial_Acceleration, CD_Cable_Gen_Alpha_Step, CD_Cable_Step_Loads, & @@ -451,6 +452,10 @@ MODULE CableDyn_Model ! flow, and so the shedding speed, unchanged), and the amplitude estimate takes the node's ! velocity across the ambient flow both relative to it (frame_node). LOGICAL :: viv_frame = .FALSE. + ! the cycle-mean frame (CD_Set_Model_VIV tf_cycle; VIV FRAME method cycle): rows 7:9 hold the + ! cycle mean over Tf of the node's smoothed velocity (CD_VIV_Cycle_Update), its state in the + ! CD_VIV_NMS_CYC rows after them + LOGICAL :: viv_cyc = .FALSE. REAL(wp), ALLOCATABLE :: viv_ftf(:) ! The stochastic band centre (CD_Set_Model_VIV sto; VIV STOCHASTIC section; CableDyn_VIV): with ! sigma > 0 on some element (viv_sto) viv_ms has one more row, its last, the node's travelled @@ -3981,7 +3986,7 @@ SUBROUTINE CD_Set_Model_Syrope_State(model, slow, tmax, ErrStat, ErrMsg) END SUBROUTINE CD_Set_Model_Syrope_State SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, ErrMsg, phase_seed, & - tangent_reversed, clx, il_alpha, chh, amp, amp_n, wake, tf, sto) + tangent_reversed, clx, il_alpha, chh, amp, amp_n, wake, tf, sto, tf_cycle) !! Install the cross-flow VIV model (CableDyn_VIV) on an initialised line. Per element: !! the lift coefficient cl (0 = no lift on that element), hydrodynamic diameter, and the !! synchronisation centre cf and half-range df of the non-dimensional shedding frequency; @@ -4021,6 +4026,10 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, !! in-line motion of the phases takes the node's velocity relative to vbar, and the amplitude !! estimate takes it across the ambient flow relative to vbar, so a line moved through the !! water sees that motion as flow. The shedding speed stays the relative normal speed. + !! tf_cycle (optional, with tf; default .FALSE.): vbar is the cycle mean over the window Tf, + !! (1/Tf) int_{t-Tf}^{t} v dt' + (v(t) - v(t-Tf))/2 (CD_VIV_Cycle_Update), in place of the + !! first-order filter: a component of period Tf and its harmonics drop out and the slow motion + !! passes without lag. TYPE(CD_ModelType), INTENT(INOUT) :: model REAL(wp), INTENT(IN) :: rho, cl(:), diameter(:), cf(:), df(:), t_window INTEGER, INTENT(OUT) :: ErrStat @@ -4035,6 +4044,7 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, INTEGER, INTENT(IN), OPTIONAL :: amp_n(:) REAL(wp), INTENT(IN), OPTIONAL :: wake(:, :) REAL(wp), INTENT(IN), OPTIONAL :: tf(:) + LOGICAL, INTENT(IN), OPTIONAL :: tf_cycle !! sto (optional, (4, n_elem); not with the wake oscillator), per element (sigma, c, N_f, seed) of !! the stochastic band centre of Ulveseter et al. (2017; CD_VIV_Sto_Node), as the finite-EI model !! takes it (CD_HermiteCable_Dyn_Set_VIV): sigma >= 0 (0: the constant cf), and where sigma > 0 @@ -4044,7 +4054,7 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, REAL(wp), INTENT(IN), OPTIONAL :: sto(:, :) INTEGER :: n_nodes, n_elem, e, nd, istat, k, nms, nfm, nfk, seedk REAL(wp) :: wsum, ssum, csum, cw - LOGICAL :: want_il, want_amp, want_wake, want_filter, want_frame, want_sto + LOGICAL :: want_il, want_amp, want_wake, want_filter, want_frame, want_sto, want_cyc CHARACTER(160) :: amsg ErrStat = CD_MODEL_OK @@ -4247,6 +4257,10 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, END DO nms = MERGE(CD_VIV_NMS_AMP, CD_VIV_NMS, want_amp .OR. (want_wake .AND. want_filter)) IF (want_frame) nms = CD_VIV_NMS_FRAME + want_cyc = .FALSE. + IF (want_frame .AND. PRESENT(tf_cycle)) want_cyc = tf_cycle + ! the cycle-mean frame's state after the frame rows + IF (want_cyc) nms = nms + CD_VIV_NMS_CYC ! the step predictor after the motion statistics (viv_pred_row; row 2 on a wake line) IF (.NOT. want_wake) nms = nms + MERGE(2, 1, want_il) ! the travelled distance of the stochastic band centre last (viv_theta) @@ -4349,6 +4363,14 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, ! the filter time per node, length-weighted over its lifting elements as the band; the ! filtered velocity starts at the node's (smoothed) velocity model%viv_ftf = CD_ZERO + ! every node holds a valid cycle-mean state (the ends and nodes without lift included), so a + ! checkpoint of the whole block reloads + IF (want_cyc) THEN + DO nd = 1, n_nodes + CALL CD_VIV_Cycle_Init(model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, nd), & + model%v(3*nd - 2:3*nd)) + END DO + END IF DO nd = 2, n_nodes - 1 IF (.NOT. model%viv_node(nd)) CYCLE wsum = CD_ZERO @@ -4359,8 +4381,11 @@ SUBROUTINE CD_Set_Model_VIV(model, rho, cl, diameter, cf, df, t_window, ErrStat, END DO model%viv_ftf(nd) = model%viv_ftf(nd)/wsum model%viv_ms(7:9, nd) = smoothed(model%v, 3*nd - 2) + IF (want_cyc) CALL CD_VIV_Cycle_Init(model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, nd), & + smoothed(model%v, 3*nd - 2)) END DO model%viv_frame = .TRUE. + model%viv_cyc = want_cyc END IF model%viv_phi_rollback = model%viv_phi model%viv_ms_rollback = model%viv_ms @@ -4538,6 +4563,7 @@ SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg, phi CHARACTER(*), INTENT(OUT) :: ErrMsg REAL(wp), INTENT(IN), OPTIONAL :: phi_x(:), ms_x(:, :) LOGICAL :: neg + INTEGER :: i ErrStat = CD_MODEL_OK ErrMsg = '' IF (.NOT. model%initialized) THEN @@ -4564,6 +4590,15 @@ SUBROUTINE CD_Set_Model_VIV_State(model, phi, ms, t_window, ErrStat, ErrMsg, phi neg = .FALSE. IF (.NOT. model%viv_wake) neg = ANY(ms(1:2, :) < CD_ZERO) IF (model%has_viv_amp .OR. model%viv_frame) neg = neg .OR. ANY(ms(4:5, :) < CD_ZERO) + IF (model%viv_cyc) THEN + DO i = 1, SIZE(ms, 2) + IF (.NOT. CD_VIV_Cycle_Valid(ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, i))) THEN + CALL fail(ErrStat, ErrMsg, 'VIV cycle-mean frame state: the sample time must be in [0, 1] and the '// & + 'ring slot an integer of the ring') + RETURN + END IF + END DO + END IF IF (neg .OR. t_window < CD_ZERO) THEN CALL fail(ErrStat, ErrMsg, 'VIV mean squares, amplitudes and averaging time must be non-negative') RETURN @@ -4799,6 +4834,7 @@ PURE INTEGER FUNCTION CD_Model_VIV_NMS(model) RESULT(n) TYPE(CD_ModelType), INTENT(IN) :: model n = MERGE(CD_VIV_NMS_AMP, CD_VIV_NMS, model%has_viv_amp .OR. model%wo_filter) IF (model%viv_frame) n = CD_VIV_NMS_FRAME + IF (model%viv_cyc) n = n + CD_VIV_NMS_CYC IF (model%has_viv .AND. .NOT. model%viv_wake) n = n + MERGE(2, 1, model%has_viv_il) ! the travelled distance of a stochastic band centre last IF (model%viv_sto) n = n + 1 @@ -4937,6 +4973,7 @@ PURE INTEGER FUNCTION viv_pred_row(model) RESULT(r) IF (model%viv_wake) RETURN r = MERGE(CD_VIV_NMS_AMP, CD_VIV_NMS, model%has_viv_amp) IF (model%viv_frame) r = CD_VIV_NMS_FRAME + IF (model%viv_cyc) r = r + CD_VIV_NMS_CYC r = r + 1 END FUNCTION viv_pred_row @@ -5097,8 +5134,18 @@ SUBROUTINE viv_step_end(model, dt, ErrStat, ErrMsg) ! keeps it) averaged with the step-start one vf = CD_ZERO IF (frame_node(model, nd)) THEN - IF (CD_All_Finite(vs1)) & - model%viv_ms_next(7:9, nd) = CD_VIV_Filter_Linear(model%viv_ms(7:9, nd), vs0, vs1, dt/model%viv_ftf(nd)) + IF (CD_All_Finite(vs1)) THEN + IF (model%viv_cyc) THEN + ! the cycle mean over Tf (CD_VIV_Cycle_Update), the smoothed velocity linear over the + ! step, from the committed state (so a repeated end-of-step pass gives the same result) + model%viv_ms_next(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, nd) = & + model%viv_ms(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, nd) + CALL CD_VIV_Cycle_Update(model%viv_ms_next(CD_VIV_NMS_FRAME + 1:CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC, nd), & + vs0, vs1, dt, model%viv_ftf(nd), model%viv_ms_next(7:9, nd)) + ELSE + model%viv_ms_next(7:9, nd) = CD_VIV_Filter_Linear(model%viv_ms(7:9, nd), vs0, vs1, dt/model%viv_ftf(nd)) + END IF + END IF vf = 0.5_wp*(model%viv_ms(7:9, nd) + model%viv_ms_next(7:9, nd)) END IF ! the mid-point motion: the mean position, and the velocity and acceleration over the step, @@ -5290,6 +5337,7 @@ SUBROUTINE clear_viv(model) IF (ALLOCATED(model%viv_sto_a)) DEALLOCATE (model%viv_sto_a, model%viv_sto_f, model%viv_sto_p, model%viv_sto_n) model%viv_sto = .FALSE. model%viv_frame = .FALSE. + model%viv_cyc = .FALSE. model%viv_wake = .FALSE. model%wo_filter = .FALSE. model%has_viv_amp = .FALSE. @@ -8074,6 +8122,7 @@ SUBROUTINE CD_Copy_Model(src, dst, ErrStat, ErrMsg) work%viv_sto = src%viv_sto work%wo_filter = src%wo_filter work%viv_frame = src%viv_frame + work%viv_cyc = src%viv_cyc work%has_viv_amp = src%has_viv_amp CALL copy_real3(src%viv_amp, work%viv_amp, 'viv_amp', ErrStat, ErrMsg) IF (ErrStat /= CD_MODEL_OK) RETURN @@ -8271,6 +8320,7 @@ SUBROUTINE commit_model_copy(from, to) CALL MOVE_ALLOC(from%wo_tf, to%wo_tf) CALL MOVE_ALLOC(from%viv_ftf, to%viv_ftf) to%viv_frame = from%viv_frame + to%viv_cyc = from%viv_cyc CALL MOVE_ALLOC(from%viv_sto_a, to%viv_sto_a) CALL MOVE_ALLOC(from%viv_sto_f, to%viv_sto_f) CALL MOVE_ALLOC(from%viv_sto_p, to%viv_sto_p) diff --git a/src/CableDyn_OpenFAST_HermiteFMF.f90 b/src/CableDyn_OpenFAST_HermiteFMF.f90 index 843e770..ab8a3f6 100644 --- a/src/CableDyn_OpenFAST_HermiteFMF.f90 +++ b/src/CableDyn_OpenFAST_HermiteFMF.f90 @@ -51,6 +51,7 @@ MODULE CableDyn_OpenFAST_HermiteFMF USE CableDyn_HermiteTorsion, ONLY: CD_HermiteTorsionType, CD_HermiteTorsion_Compliance, CD_HermiteTorsion_Line, & CD_HermiteTorsion_Unwrap, CD_HTORS_OK, CD_HTORS_MAX_STEP USE CableDyn_HermiteCable, ONLY: CD_HermiteCable_Shapes + USE CableDyn_VIV, ONLY: CD_VIV_Cycle_Valid, CD_VIV_NMS_FRAME, CD_VIV_NMS_CYC USE CableDyn_EndConnection, ONLY: CD_EndConn_Project, CD_ENDCONN_OK, CD_ENDCONN_BADINPUT, & CD_ENDCONN_PINNED, CD_ENDCONN_FINITE, CD_ENDCONN_RIGID USE CableDyn_Bathymetry, ONLY: CD_BathymetryType @@ -2493,6 +2494,10 @@ SUBROUTINE CD_HFMF_UnpackMirror(self, buf, t, ErrStat, ErrMsg) IF (self%line%has_viv_amp .OR. self%line%viv_frame) THEN IF (ANY(buf(kb + (i - 1)*nv + 4:kb + (i - 1)*nv + 5) < CD_ZERO)) bad_viv = .TRUE. END IF + IF (self%line%viv_cyc) THEN + IF (.NOT. CD_VIV_Cycle_Valid(buf(kb + (i - 1)*nv + CD_VIV_NMS_FRAME + 1: & + kb + (i - 1)*nv + CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC))) bad_viv = .TRUE. + END IF END DO IF (bad_viv) THEN ErrStat = CD_HFMF_BADINPUT diff --git a/src/CableDyn_VIV.f90 b/src/CableDyn_VIV.f90 index 8183c3a..d9be6a2 100644 --- a/src/CableDyn_VIV.f90 +++ b/src/CableDyn_VIV.f90 @@ -81,6 +81,9 @@ MODULE CableDyn_VIV PUBLIC :: CD_VIV_Ambient_Crossflow_Rate PUBLIC :: CD_VIV_Sto_Node PUBLIC :: CD_VIV_Sto_Centre + PUBLIC :: CD_VIV_Cycle_Init + PUBLIC :: CD_VIV_Cycle_Update + PUBLIC :: CD_VIV_Cycle_Valid !> MoorDyn's running-RMS window in time steps (Line%n_m): each step updates the stored !> mean square as ((n_m - 1) old + new) / n_m. @@ -119,6 +122,12 @@ MODULE CableDyn_VIV !> the number Ulveseter et al. (2017, Sec. 3) take. INTEGER, PARAMETER, PUBLIC :: CD_VIV_STO_MAXF = 1000 INTEGER, PARAMETER, PUBLIC :: CD_VIV_STO_DEFAULT_NF = 100 + !> The cycle-mean flow frame (VIV FRAME method `cycle`; CD_VIV_Cycle_Update): samples per window + !> T, and the rows of its state per node, the time since the last sample, the ring position of + !> that sample and the ring of CD_VIV_CYC_NB + 2 samples of the integral of the velocity (three + !> components each), held relative to the integral at the committed time. + INTEGER, PARAMETER, PUBLIC :: CD_VIV_CYC_NB = 64 + INTEGER, PARAMETER, PUBLIC :: CD_VIV_NMS_CYC = 2 + 3*(CD_VIV_CYC_NB + 2) !> Chord below which a node tangent is undefined (a collapsed pair of neighbours). REAL(wp), PARAMETER :: TINY_CHORD = 1.0e-12_wp @@ -730,6 +739,98 @@ PURE REAL(wp) FUNCTION CD_VIV_Sto_Centre(cf, a, fhat, p0, theta) RESULT(centre) centre = cf + a*SUM(SIN(p0 + CD_VIV_TWO_PI*theta*fhat)) END FUNCTION CD_VIV_Sto_Centre + PURE SUBROUTINE CD_VIV_Cycle_Init(st, v) + !! The cycle-mean frame state (CD_VIV_Cycle_Update) of a node that has moved at the constant + !! velocity v for all past time: its frame velocity is then v. + REAL(wp), INTENT(OUT) :: st(CD_VIV_NMS_CYC) + REAL(wp), INTENT(IN) :: v(3) + INTEGER :: j + st(1) = CD_ZERO + st(2) = CD_ONE + ! slot j holds the sample j - 1 intervals h before the latest, (I - I(t))/h = -(j - 1) v + DO j = 1, CD_VIV_CYC_NB + 2 + st(3 + 3*(j - 1):5 + 3*(j - 1)) = -REAL(j - 1, wp)*v + END DO + END SUBROUTINE CD_VIV_Cycle_Init + + PURE SUBROUTINE CD_VIV_Cycle_Update(st, v0, v1, dt, tw, vs) + !! One step dt of the cycle-mean flow frame of a node: with the node velocity linear from v0 + !! to v1 over the step, the frame velocity at the step end is + !! + !! v_s(t) = (I(t) - I(t - T))/T + (v(t) - v(t - T))/2, I(t) = int^t v dt' + !! + !! over the window T = tw: the mean velocity over the last window plus half its change over it. + !! A component of period T and its harmonics drop out of both terms exactly (to the sampling + !! below), and a velocity linear in time passes unchanged, with no lag; a quadratic one with + !! the error T^2/6 of its second derivative. I is sampled every h = T/NB (NB = CD_VIV_CYC_NB) in + !! a ring of NB + 2 samples, exactly for the velocity linear over the step, and I(t - T) and + !! v(t - T) = I'(t - T) come from the quadratic through the three samples around t - T. The ring + !! holds I relative to its value at the step end, (I - I(t))/h, so it stays of the order of the + !! velocity however long the run. st: (1) the time since the latest sample over h, (2) the + !! ring slot of the latest sample, (3:) the ring (CD_VIV_Cycle_Init). + REAL(wp), INTENT(INOUT) :: st(CD_VIV_NMS_CYC) + REAL(wp), INTENT(IN) :: v0(3), v1(3), dt, tw + REAL(wp), INTENT(OUT) :: vs(3) + INTEGER, PARAMETER :: nr = CD_VIV_CYC_NB + 2 + REAL(wp) :: h, tau, di(3), s, is(3), x, c0, c1, c2, d0, d1, d2, ia(3), ib(3), ic(3) + INTEGER :: latest, j, ja, jb, jc + h = tw/REAL(CD_VIV_CYC_NB, wp) + tau = st(1)*h + latest = NINT(st(2)) + ! the integral over the step, per h: the ring shifts so that it stays relative to I(t_end) + di = 0.5_wp*dt*(v0 + v1)/h + DO j = 1, nr + st(3 + 3*(j - 1):5 + 3*(j - 1)) = st(3 + 3*(j - 1):5 + 3*(j - 1)) - di + END DO + ! the samples inside the step, at s = h - tau, 2h - tau, ... from its start + s = h - tau + DO WHILE (s <= dt) + ! I(t0 + s) - I(t_end) = -int_s^dt v, v linear: per h + is = -((dt - s)*v0 + 0.5_wp*(dt*dt - s*s)*(v1 - v0)/dt)/h + latest = MODULO(latest - 2, nr) + 1 + st(3 + 3*(latest - 1):5 + 3*(latest - 1)) = is + s = s + h + END DO + tau = dt - (s - h) + st(1) = tau/h + st(2) = REAL(latest, wp) + ! t - T lies x = NB - tau/h sample intervals before the latest sample, x in (NB - 1, NB]: the + ! quadratic through the samples NB - 1, NB and NB + 1 intervals back (age a, increasing back in + ! time), Lagrange weights at x and of the derivative in x + x = REAL(CD_VIV_CYC_NB, wp) - st(1) + ja = slot(CD_VIV_CYC_NB - 1) + jb = slot(CD_VIV_CYC_NB) + jc = slot(CD_VIV_CYC_NB + 1) + x = x - REAL(CD_VIV_CYC_NB, wp) ! in [-1, 0): the ages NB - 1, NB, NB + 1 sit at -1, 0, 1 + c0 = 0.5_wp*x*(x - CD_ONE) + c1 = (CD_ONE - x)*(CD_ONE + x) + c2 = 0.5_wp*x*(x + CD_ONE) + d0 = x - 0.5_wp + d1 = -2.0_wp*x + d2 = x + 0.5_wp + ia = st(3 + 3*(ja - 1):5 + 3*(ja - 1)) + ib = st(3 + 3*(jb - 1):5 + 3*(jb - 1)) + ic = st(3 + 3*(jc - 1):5 + 3*(jc - 1)) + ! (I(t) - I(t - T))/T with I(t) = 0 in the ring's units (per h, T = NB h); age grows back in + ! time, so dI/dt = -(1/h) dI/dage + vs = -(c0*ia + c1*ib + c2*ic)/REAL(CD_VIV_CYC_NB, wp) + 0.5_wp*(v1 + (d0*ia + d1*ib + d2*ic)) + CONTAINS + PURE INTEGER FUNCTION slot(age) RESULT(j) + INTEGER, INTENT(IN) :: age + j = MODULO(latest - 1 + age, nr) + 1 + END FUNCTION slot + END SUBROUTINE CD_VIV_Cycle_Update + + PURE LOGICAL FUNCTION CD_VIV_Cycle_Valid(st) RESULT(ok) + !! A cycle-mean frame state (CD_VIV_Cycle_Update) that a restart may install: finite, the time + !! since the latest sample in [0, 1] sample intervals and the ring slot an integer of the ring. + REAL(wp), INTENT(IN) :: st(:) + ok = SIZE(st) == CD_VIV_NMS_CYC + IF (.NOT. ok) RETURN + ok = ALL(ABS(st) <= HUGE(CD_ONE)) .AND. st(1) >= CD_ZERO .AND. st(1) <= CD_ONE .AND. & + st(2) >= CD_ONE .AND. st(2) <= REAL(CD_VIV_CYC_NB + 2, wp) .AND. .NOT. (ABS(st(2) - ANINT(st(2))) > CD_ZERO) + END FUNCTION CD_VIV_Cycle_Valid + ELEMENTAL REAL(wp) FUNCTION CD_VIV_Wrap_Phase(phi) RESULT(wrapped) !! The phase mapped to [0, 2 pi); the model only uses cos(phi) and sin(. - phi). REAL(wp), INTENT(IN) :: phi diff --git a/tests/test_hermite_viv_frame.f90 b/tests/test_hermite_viv_frame.f90 index 59b291a..4d83128 100644 --- a/tests/test_hermite_viv_frame.f90 +++ b/tests/test_hermite_viv_frame.f90 @@ -40,10 +40,16 @@ PROGRAM test_hermite_viv_frame !! 18 %) and the RMS more than 15 % (measured 23 %) from the fixed pipe's, with the lift alone !! the RMS more than 4 % (measured 8 %); !! * F4 a snapshot taken mid-run and restored replays the following steps bit for bit, the - !! filtered velocity included. + !! filtered velocity included; + !! * F5 the cycle-mean frame (tf_cycle, window Tf 1 s, about one period of the response): it + !! installs its state after the frame rows (CD_VIV_NMS_CYC more), the moving and the fixed pipe + !! agree as in F2, its frame velocity follows the imposed one without the filter's lag (at the + !! mid node over 5-15 s, the ramp: within 0.5 % of U0, measured 0.17 %, and at most a fifth of the + !! first-order filter's lag error with Tf 0.6 s, measured 1.7 %), and a snapshot taken mid-run + !! and restored replays the following steps bit for bit, the ring of the cycle mean included. USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_VALUE, IEEE_QUIET_NAN USE CableDyn_Precision, ONLY: wp - USE CableDyn_VIV, ONLY: CD_VIV_AMP_MAXP, CD_VIV_NMS_FRAME + USE CableDyn_VIV, ONLY: CD_VIV_AMP_MAXP, CD_VIV_NMS_FRAME, CD_VIV_NMS_CYC USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCableDynType, CD_HermiteCable_Dyn_Init, & CD_HermiteCable_Dyn_Set_Drag, CD_HermiteCable_Dyn_Set_AddedMass, & CD_HermiteCable_Dyn_Set_VIV, CD_HermiteCable_Dyn_Set_Held_Fluid, & @@ -172,6 +178,61 @@ PROGRAM test_hermite_viv_frame CALL CD_HermiteCable_Dyn_End(model) END BLOCK + ! ---- F5 the cycle-mean frame ---- + BLOCK + REAL(wp), ALLOCATABLE :: q_ref(:, :), ms_ref(:, :, :) + REAL(wp) :: tfc(NE), y, vi, ai, dev, devf + INTEGER :: s, nr + tfc = 1.0_wp + CALL run_case(.TRUE., tfc, .TRUE., pk_mf, rms_mf, cycle=.TRUE.) + CALL run_case(.FALSE., tfc, .TRUE., pk_ff, rms_ff, cycle=.TRUE.) + WRITE (*, '(A,2F9.4,A,2F9.4)') ' F5 (tables) cycle mean: moving peak, RMS A/D ', pk_mf/D, rms_mf/D, '; fixed ', & + pk_ff/D, rms_ff/D + CALL require(pk_ff > 0.2_wp*D, 'F5: the fixed pipe locks in with the cycle-mean frame') + CALL require(ABS(pk_mf/pk_ff - 1.0_wp) <= TOL_F2_PEAK .AND. ABS(rms_mf/rms_ff - 1.0_wp) <= TOL_F2, & + 'F5: with the cycle-mean frame the moving and the fixed pipe agree') + nr = CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC + 1 + CALL build(model) + CALL CD_HermiteCable_Dyn_Set_VIV(model, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, cdy=cdy, tf=tfc, & + tf_cycle=.TRUE.) + CALL require(es == CD_HCDYN_OK .AND. model%viv_frame .AND. model%viv_cyc .AND. SIZE(model%viv_ms, 1) == nr, & + 'F5: the cycle-mean frame installs its state after the frame rows: '//TRIM(em)) + CALL build(twin) + CALL CD_HermiteCable_Dyn_Set_VIV(twin, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, cdy=cdy, tf=tfv) + CALL require(es == CD_HCDYN_OK .AND. .NOT. twin%viv_cyc, 'F5: the filter twin installs: '//TRIM(em)) + dev = 0.0_wp + devf = 0.0_wp + DO s = 1, 1500 + CALL advance(model, s, .TRUE.) + CALL advance(twin, s, .TRUE.) + IF (s > 500) THEN + CALL imposed(REAL(s, wp)*DT, y, vi, ai) + dev = MAX(dev, ABS(model%viv_ms(8, NE/2 + 1) - vi)) + devf = MAX(devf, ABS(twin%viv_ms(8, NE/2 + 1) - vi)) + END IF + END DO + WRITE (*, '(A,F8.4,A,F8.4)') ' F5 frame velocity off the imposed one, cycle mean ', dev/U0, '; filter ', devf/U0 + CALL require(dev <= 0.005_wp*U0 .AND. devf > 5.0_wp*dev, & + 'F5: the cycle mean follows the imposed velocity without the filter''s lag') + CALL CD_HermiteCable_Dyn_Snapshot(model, es, em) + CALL require(es == CD_HCDYN_OK, 'F5: snapshot: '//TRIM(em)) + ALLOCATE (q_ref(SIZE(model%q), 200), ms_ref(nr, NN, 200)) + DO s = 1, 200 + CALL advance(model, 1500 + s, .TRUE.) + q_ref(:, s) = model%q + ms_ref(:, :, s) = model%viv_ms + END DO + CALL CD_HermiteCable_Dyn_Restore(model, es, em) + CALL require(es == CD_HCDYN_OK, 'F5: restore: '//TRIM(em)) + DO s = 1, 200 + CALL advance(model, 1500 + s, .TRUE.) + IF (ANY(model%q /= q_ref(:, s)) .OR. ANY(model%viv_ms /= ms_ref(:, :, s))) EXIT + END DO + CALL require(s > 200, 'F5: the restored snapshot replays the state and the cycle-mean ring bit for bit') + CALL CD_HermiteCable_Dyn_End(model) + CALL CD_HermiteCable_Dyn_End(twin) + END BLOCK + IF (nfail > 0) THEN WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' ERROR STOP 1 @@ -272,20 +333,25 @@ SUBROUTINE advance(m, s, moving) IF (es /= CD_HCDYN_OK) CALL require(.FALSE., 'step: '//TRIM(em)) END SUBROUTINE advance - SUBROUTINE run_case(moving, tfe, tables, pk, rms) + SUBROUTINE run_case(moving, tfe, tables, pk, rms, cycle) !! Two periods of the moving or the fixed pipe with the filter times tfe, with the amplitude !! tables and the cross-flow damping (tables) or the lift Cl alone; over the second period !! the peak and RMS cross-flow (z) displacement of the mid node from its rest depth. LOGICAL, INTENT(IN) :: moving, tables REAL(wp), INTENT(IN) :: tfe(NE) REAL(wp), INTENT(OUT) :: pk, rms + LOGICAL, INTENT(IN), OPTIONAL :: cycle TYPE(CD_HermiteCableDynType), ALLOCATABLE :: m + LOGICAL :: cyc REAL(wp) :: z, s2 INTEGER :: s, n ALLOCATE (m) CALL build(m) + cyc = .FALSE. + IF (PRESENT(cycle)) cyc = cycle IF (tables) THEN - CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, cdy=cdy, tf=tfe) + CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cf, df, 2.0_wp, es, em, amp=amp, amp_n=ampn, cdy=cdy, tf=tfe, & + tf_cycle=cyc) ELSE CALL CD_HermiteCable_Dyn_Set_VIV(m, cl, cf, df, 2.0_wp, es, em, tf=tfe) END IF diff --git a/tests/test_hfmf_mirror.f90 b/tests/test_hfmf_mirror.f90 index 97a102e..472b8d5 100644 --- a/tests/test_hfmf_mirror.f90 +++ b/tests/test_hfmf_mirror.f90 @@ -21,7 +21,10 @@ PROGRAM test_hfmf_mirror !! non-finite time fail closed; !! 5) with cross-flow and in-line VIV the VIV block is 6 nn + 1 values (the in-line phase and !! mean squares after the cross-flow block), it round-trips bit-identically into the twin's - !! in-line state, and a negative in-line mean square fails closed. + !! in-line state, and a negative in-line mean square fails closed; + !! 6) with the cycle-mean VIV frame (VIV FRAME method cycle) the VIV block carries its ring + !! (CD_VIV_NMS_CYC rows per node after the frame rows), round-trips bit-identically after a + !! few steps have filled it, and a ring slot off the ring fails closed. USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Init_Deck_HermiteCable, CD_DECKDRV_OK USE CableDyn_OpenFAST_HermiteFMF, ONLY: CD_HFMF_ModuleType, CD_HFMF_MirrorSize, CD_HFMF_PackMirror, & @@ -29,6 +32,7 @@ PROGRAM test_hfmf_mirror CD_HFMF_BoundaryMirrorSize, CD_HFMF_VIVMirrorSize, CD_HFMF_TorsionMirrorSize, & CD_HFMF_End, CD_HFMF_OK, CD_HFMF_BADINPUT USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Dyn_Set_VIV, CD_HCDYN_OK + USE CableDyn_VIV, ONLY: CD_VIV_NMS_FRAME, CD_VIV_NMS_CYC USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE, IEEE_VALUE, IEEE_QUIET_NAN IMPLICIT NONE INTEGER :: nfail @@ -150,6 +154,45 @@ PROGRAM test_hfmf_mirror 'a negative in-line mean square fails closed') END BLOCK + ! (6) the cycle-mean frame's ring in the VIV block + BLOCK + REAL(wp), ALLOCATABLE :: cl(:), cf(:), df(:), tf(:), vb(:), vb2(:) + INTEGER :: ne, nn, kv, nv, j + ne = cable%line%ne + nn = cable%line%nn + ALLOCATE (cl(ne), cf(ne), df(ne), tf(ne)) + cl = 0.8_wp; cf = 0.18_wp; df = 0.08_wp; tf = 1.0_wp + CALL CD_HermiteCable_Dyn_Set_VIV(cable%line, cl, cf, df, 0.25_wp, es, em, tf=tf, tf_cycle=.TRUE.) + CALL require(es == CD_HCDYN_OK .AND. cable%line%viv_cyc, 'cycle-mean frame on the cable: '//TRIM(em)) + CALL CD_HermiteCable_Dyn_Set_VIV(twin%line, cl, cf, df, 0.25_wp, es, em, tf=tf, tf_cycle=.TRUE.) + CALL require(es == CD_HCDYN_OK, 'cycle-mean frame on the twin: '//TRIM(em)) + nv = SIZE(cable%line%viv_ms, 1) + CALL require(nv == CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC + 1, 'the ring sits after the frame rows') + CALL require(CD_HFMF_VIVMirrorSize(cable) == (1 + nv)*nn + 1, 'VIV block with the ring: (1 + nms) nn + 1 values') + ! a filled ring: distinct values in every row, a valid sample time and slot + DO j = 1, nn + DO i = CD_VIV_NMS_FRAME + 3, CD_VIV_NMS_FRAME + CD_VIV_NMS_CYC + cable%line%viv_ms(i, j) = 1.0e-3_wp*REAL(i + 7*j, wp) + END DO + cable%line%viv_ms(CD_VIV_NMS_FRAME + 1, j) = 0.375_wp + cable%line%viv_ms(CD_VIV_NMS_FRAME + 2, j) = REAL(MOD(j, 60) + 1, wp) + END DO + ALLOCATE (vb(CD_HFMF_MirrorSize(cable)), vb2(CD_HFMF_MirrorSize(cable))) + CALL CD_HFMF_PackMirror(cable, vb, es, em) + CALL require(es == CD_HFMF_OK, 'pack with the ring: '//TRIM(em)) + kb = 3*nf + CD_HFMF_FrictionMirrorSize(cable) + 3*(cable%line%ndof - nf) + vb(kb + 7:kb + 15) = [1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp] + CALL CD_HFMF_UnpackMirror(twin, vb, 3.0_wp, es, em) + CALL require(es == CD_HFMF_OK, 'unpack with the ring: '//TRIM(em)) + CALL require(nan_max_abs(twin%line%viv_ms - cable%line%viv_ms) <= 0.0_wp, 'the ring reloads') + CALL CD_HFMF_PackMirror(twin, vb2, es, em) + CALL require(nan_max_abs(vb2 - vb) <= 0.0_wp, 'the VIV block with the ring round-trips bit-identically') + kv = SIZE(vb) - CD_HFMF_TorsionMirrorSize(cable) - CD_HFMF_VIVMirrorSize(cable) + nn + vb(kv + CD_VIV_NMS_FRAME + 2) = 0.5_wp + CALL CD_HFMF_UnpackMirror(twin, vb, 3.0_wp, es, em) + CALL require(es == CD_HFMF_BADINPUT, 'a fractional ring slot fails closed') + END BLOCK + CALL CD_HFMF_End(cable) CALL CD_HFMF_End(twin) CALL finish() diff --git a/tests/test_viv_coupled.f90 b/tests/test_viv_coupled.f90 index 84db44d..cd15f60 100644 --- a/tests/test_viv_coupled.f90 +++ b/tests/test_viv_coupled.f90 @@ -45,11 +45,14 @@ PROGRAM test_viv_coupled !! statistics), with the same restart and rewind checks; !! * the flow frame on the lift alone (VIV FRAME Tf 5 s, no tables): both blocks carry the !! filtered velocity in rows 7-9 of 9 motion statistics (rows 3-6 unused), with the same restart - !! and rewind checks; + !! and rewind checks; with the cycle-mean frame (VIV FRAME Tf 3.4 s Method cycle) both blocks + !! carry its ring after them too (CD_VIV_NMS_CYC more rows per node), with the same restart and + !! rewind checks; !! * a stochastic band centre (VIV STOCHASTIC sigma 0.02, c 0.07, 100 components on both types): !! both blocks grow by the travelled distance of the centre (1 per node), with the same restart !! and rewind checks. USE CableDyn_Precision, ONLY: wp + USE CableDyn_VIV, ONLY: CD_VIV_NMS_CYC USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_End, CD_AGG_OK, & CD_AGG_NMovingPoints, CD_AGG_GetMovingPointMesh, CD_AGG_Step_Moving, & CD_AGG_UpdateStates_Moving, CD_AGG_CalcOutput, CD_AGG_NFluidNodes, & @@ -69,7 +72,7 @@ PROGRAM test_viv_coupled ! the deck of the restart and rewind cases, and whether its lines carry in-line VIV CHARACTER(32) :: deck_name = 'viv_coupled.dat' LOGICAL :: il_case = .FALSE., wake_case = .FALSE., amp_case = .FALSE., wakef_case = .FALSE., ampf_case = .FALSE. - LOGICAL :: frame_case = .FALSE., sto_case = .FALSE. + LOGICAL :: frame_case = .FALSE., sto_case = .FALSE., cyc_case = .FALSE. nfail = 0 CALL write_deck('viv_coupled.dat', 0.8_wp) @@ -80,6 +83,7 @@ PROGRAM test_viv_coupled CALL write_deck('viv_coupled_amp.dat', 0.8_wp, amp=.TRUE.) CALL write_deck('viv_coupled_ampf.dat', 0.8_wp, amp=.TRUE., wake_tf='5.0', damp=.TRUE.) CALL write_deck('viv_coupled_frame.dat', 0.8_wp, wake_tf='5.0') + CALL write_deck('viv_coupled_cyc.dat', 0.8_wp, wake_tf='3.4 cycle') CALL write_deck('viv_coupled_sto.dat', 0.8_wp, sto='0.02 0.07 100 3') CALL case_lockin() CALL case_restart() @@ -105,6 +109,11 @@ PROGRAM test_viv_coupled frame_case = .TRUE. CALL case_restart() CALL case_rewind() + deck_name = 'viv_coupled_cyc.dat' + cyc_case = .TRUE. + CALL case_restart() + CALL case_rewind() + cyc_case = .FALSE. frame_case = .FALSE. deck_name = 'viv_coupled_amp.dat' wake_case = .FALSE. @@ -413,7 +422,7 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok) ! synchronisation line, the step predictor (two rows with in-line VIV) ok = ok .AND. nv == (MERGE(6, 3, il_case) + MERGE(4, 0, amp_case .OR. wakef_case) + & MERGE(3, 0, ampf_case) + MERGE(7, 0, frame_case) + MERGE(1, 0, sto_case) + & - MERGE(0, MERGE(2, 1, il_case), wake_case))*(ndof/3) + 1 + MERGE(CD_VIV_NMS_CYC, 0, cyc_case) + MERGE(0, MERGE(2, 1, il_case), wake_case))*(ndof/3) + 1 IF (with_viv .AND. nv > 0) THEN ALLOCATE (buf(nv)) CALL CD_Get_System_Line_VIV_State(a%sys%fast%system, il, buf, es, em) @@ -428,7 +437,8 @@ LOGICAL FUNCTION rebuild(a, b, with_viv) RESULT(ok) nvc = CD_HFMF_VIVMirrorSize(a%cables(1)) ok = ok .AND. nvc == (MERGE(6, 3, il_case) + MERGE(MERGE(5, 2, wakef_case), 0, wake_case) + & MERGE(4, 0, amp_case) + MERGE(3, 0, ampf_case) + MERGE(7, 0, frame_case) + & - MERGE(1, 0, sto_case) + MERGE(0, MERGE(2, 1, il_case), wake_case))*a%cables(1)%line%nn + 1 + MERGE(1, 0, sto_case) + MERGE(CD_VIV_NMS_CYC, 0, cyc_case) + & + MERGE(0, MERGE(2, 1, il_case), wake_case))*a%cables(1)%line%nn + 1 IF (.NOT. with_viv) THEN ! the cable's VIV block as the fresh build has it (the torsion-free cable ends with it) CALL CD_HFMF_PackMirror(b%cables(1), fresh, es, em) @@ -458,7 +468,9 @@ LOGICAL FUNCTION identical(a, b) RESULT(same) ! the filtered velocity in rows 7-9 of the motion statistics on both lines, no tables same = a%cables(1)%line%viv_frame .AND. .NOT. a%cables(1)%line%has_viv_amp .AND. & a%sys%fast%system%lines(1)%viv_frame .AND. .NOT. a%sys%fast%system%lines(1)%has_viv_amp .AND. & - SIZE(a%cables(1)%line%viv_ms, 1) == 10 .AND. SIZE(a%sys%fast%system%lines(1)%viv_ms, 1) == 10 .AND. & + SIZE(a%cables(1)%line%viv_ms, 1) == 10 + MERGE(CD_VIV_NMS_CYC, 0, cyc_case) .AND. & + SIZE(a%sys%fast%system%lines(1)%viv_ms, 1) == 10 + MERGE(CD_VIV_NMS_CYC, 0, cyc_case) .AND. & + (a%cables(1)%line%viv_cyc .EQV. cyc_case) .AND. (a%sys%fast%system%lines(1)%viv_cyc .EQV. cyc_case) .AND. & MAXVAL(ABS(a%sys%fast%system%lines(1)%viv_ms - b%sys%fast%system%lines(1)%viv_ms)) <= 0.0_wp .AND. & MAXVAL(ABS(a%cables(1)%line%viv_ms - b%cables(1)%line%viv_ms)) <= 0.0_wp END IF @@ -587,7 +599,11 @@ SUBROUTINE write_deck(path, cl, window, dtm, anchor_first, inline, wake, amp, wa END IF IF (PRESENT(wake_tf)) THEN WRITE (u, '(A)') '--------------------- VIV FRAME ---' - WRITE (u, '(A)') 'TypeName Tf' + IF (INDEX(wake_tf, 'cycle') > 0) THEN + WRITE (u, '(A)') 'TypeName Tf Method' + ELSE + WRITE (u, '(A)') 'TypeName Tf' + END IF WRITE (u, '(A)') 'riser '//wake_tf WRITE (u, '(A)') 'cable '//wake_tf END IF diff --git a/tests/test_viv_cycle_frame.f90 b/tests/test_viv_cycle_frame.f90 new file mode 100644 index 0000000..eb917d8 --- /dev/null +++ b/tests/test_viv_cycle_frame.f90 @@ -0,0 +1,161 @@ +! File: tests/test_viv_cycle_frame.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_viv_cycle_frame + !! The cycle-mean flow frame kernel (CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, CD_VIV_Cycle_Valid): + !! vbar(t) = (1/T) int_{t-T}^{t} v dt' + (v(t) - v(t-T))/2 over the window T, from a ring of + !! CD_VIV_CYC_NB samples per window of the velocity's integral. + !! * C1 a component of period T and its second harmonic (a cross-flow VIV at f = 1/T and an + !! in-line one at 2f) on a constant drop out: vbar is the constant within 1 % of the harmonics' + !! amplitude after the first window (measured 0.25 %; what is left is the sampled derivative of + !! v(t - T), the quadratic through three samples, of order (omega h)^2/6 with h = T/NB); + !! * C2 a ramp v = a + b t passes without lag: vbar = v(t) to round-off (1e-12; the first-order + !! filter of time T lags it by b T); with the harmonics of C1 on it within 1 %; + !! * C3 a quadratic v = c t^2 gives c (t^2 - T^2/6), the kernel's second-order error, within + !! c h^2 (the sampled integral of a cubic); + !! * C4 C2 and C3 hold for steps longer than a sample interval (dt = 1.7 T/NB) and for a step that + !! does not divide T; + !! * C5 a node at rest at v0 (Init) gives vbar = v0 at once; the state stays valid + !! (CD_VIV_Cycle_Valid) over a long run, and a state with a sample time outside [0, 1] or a + !! slot off the ring is invalid. + USE CableDyn_Precision, ONLY: wp + USE CableDyn_VIV, ONLY: CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, CD_VIV_Cycle_Valid, CD_VIV_NMS_CYC, CD_VIV_CYC_NB + IMPLICIT NONE + REAL(wp), PARAMETER :: PI = 3.141592653589793238_wp, TW = 0.4_wp + INTEGER :: nfail + REAL(wp) :: st(CD_VIV_NMS_CYC), vs(3), err + nfail = 0 + + ! C5 at rest + CALL CD_VIV_Cycle_Init(st, [0.3_wp, -0.2_wp, 0.1_wp]) + CALL CD_VIV_Cycle_Update(st, [0.3_wp, -0.2_wp, 0.1_wp], [0.3_wp, -0.2_wp, 0.1_wp], 1.0e-3_wp, TW, vs) + CALL require(MAXVAL(ABS(vs - [0.3_wp, -0.2_wp, 0.1_wp])) <= 1.0e-14_wp, 'C5: a node at rest keeps its velocity') + + ! C1 harmonics on a constant + err = run_case(1, 1.0e-3_wp) + WRITE (*, '(A,ES10.3)') ' C1 harmonics on a constant, max |vbar - v_slow|/amp: ', err + CALL require(err <= 1.0e-2_wp, 'C1: a component of period T and its second harmonic drop out') + ! C2 ramp + err = run_case(2, 1.0e-3_wp) + WRITE (*, '(A,ES10.3)') ' C2 ramp, max |vbar - v|: ', err + CALL require(err <= 1.0e-12_wp, 'C2: a ramp passes without lag') + err = run_case(4, 1.0e-3_wp) + WRITE (*, '(A,ES10.3)') ' C2 ramp with harmonics, max |vbar - v_slow|/amp: ', err + CALL require(err <= 1.0e-2_wp, 'C2: a ramp with harmonics on it passes without lag') + ! C3 quadratic + err = run_case(3, 1.0e-3_wp) + WRITE (*, '(A,ES10.3)') ' C3 quadratic, max |vbar - c (t^2 - T^2/6)| / (c h^2): ', err + CALL require(err <= 1.0_wp, 'C3: a quadratic gives the second-order error c T^2/6') + ! C4 long steps that do not divide T + err = run_case(2, 1.7_wp*TW/REAL(CD_VIV_CYC_NB, wp)) + CALL require(err <= 1.0e-12_wp, 'C4: a ramp passes without lag with steps longer than a sample interval') + err = run_case(3, 1.7_wp*TW/REAL(CD_VIV_CYC_NB, wp)) + CALL require(err <= 1.0_wp, 'C4: the quadratic error holds with steps longer than a sample interval') + + ! C5 validity + CALL CD_VIV_Cycle_Init(st, [0.0_wp, 0.0_wp, 0.0_wp]) + CALL require(CD_VIV_Cycle_Valid(st), 'C5: the initial state is valid') + st(1) = 1.5_wp + CALL require(.NOT. CD_VIV_Cycle_Valid(st), 'C5: a sample time beyond one interval is invalid') + st(1) = 0.5_wp + st(2) = REAL(CD_VIV_CYC_NB + 3, wp) + CALL require(.NOT. CD_VIV_Cycle_Valid(st), 'C5: a slot off the ring is invalid') + st(2) = 2.5_wp + CALL require(.NOT. CD_VIV_Cycle_Valid(st), 'C5: a fractional slot is invalid') + + IF (nfail > 0) THEN + WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' + ERROR STOP 1 + END IF + WRITE (*, '(A)') 'PASS: the cycle-mean flow frame kernel' + +CONTAINS + + SUBROUTINE require(cond, label) + LOGICAL, INTENT(IN) :: cond + CHARACTER(*), INTENT(IN) :: label + IF (.NOT. cond) THEN + WRITE (*, '(A)') 'MISMATCH: '//label + nfail = nfail + 1 + END IF + END SUBROUTINE require + + PURE FUNCTION signal(kind, t) RESULT(v) + !! The test velocity (three components) and, in v(4:6), its slow part (the expected vbar). + INTEGER, INTENT(IN) :: kind + REAL(wp), INTENT(IN) :: t + REAL(wp) :: v(6), w, h(3) + w = 2.0_wp*PI/TW + h = [0.0_wp, 0.5_wp*SIN(w*t + 0.3_wp), 0.2_wp*COS(2.0_wp*w*t)] + SELECT CASE (kind) + CASE (1) + v(4:6) = [0.25_wp, -0.1_wp, 0.05_wp] + v(1:3) = v(4:6) + h + CASE (2) + v(4:6) = [0.25_wp + 0.03_wp*t, -0.1_wp - 0.02_wp*t, 0.05_wp] + v(1:3) = v(4:6) + CASE (3) + v(1:3) = [0.02_wp*t*t, -0.01_wp*t*t, 0.0_wp] + v(4:6) = v(1:3) - [0.02_wp, -0.01_wp, 0.0_wp]*TW*TW/6.0_wp + CASE DEFAULT + v(4:6) = [0.25_wp + 0.03_wp*t, -0.1_wp - 0.02_wp*t, 0.05_wp] + v(1:3) = v(4:6) + h + END SELECT + END FUNCTION signal + + REAL(wp) FUNCTION run_case(kind, dt) RESULT(err) + !! The largest error of vbar against the slow part over 20 windows, after the first two + !! (a ramp or quadratic case starts from its value continued backwards in time exactly: the + !! ring is primed with the integral of the signal over the window before t = 0). + INTEGER, INTENT(IN) :: kind + REAL(wp), INTENT(IN) :: dt + REAL(wp) :: s(CD_VIV_NMS_CYC), t, v0(6), v1(6), out(3), scale, h + INTEGER :: n, k + CALL prime(kind, s) + h = TW/REAL(CD_VIV_CYC_NB, wp) + ! the harmonics' amplitude; the ramp absolute (round-off); the quadratic's c h^2 + SELECT CASE (kind) + CASE (1, 4) + scale = 0.5_wp + CASE (3) + scale = 0.02_wp*h*h + CASE DEFAULT + scale = 1.0_wp + END SELECT + err = 0.0_wp + n = CEILING(20.0_wp*TW/dt) + t = 0.0_wp + DO k = 1, n + v0 = signal(kind, t) + v1 = signal(kind, t + dt) + CALL CD_VIV_Cycle_Update(s, v0(1:3), v1(1:3), dt, TW, out) + t = t + dt + IF (t > 2.0_wp*TW) err = MAX(err, MAXVAL(ABS(out - v1(4:6)))/scale) + CALL require(CD_VIV_Cycle_Valid(s), 'C5: the state stays valid') + END DO + END FUNCTION run_case + + SUBROUTINE prime(kind, s) + !! The ring at t = 0 for the signal continued backwards: sample j (j - 1 intervals h back) holds + !! (I(-(j - 1) h) - I(0))/h, the integral by Simpson's rule (exact for these polynomials and + !! close for the harmonics, which the first windows flush anyway). + INTEGER, INTENT(IN) :: kind + REAL(wp), INTENT(OUT) :: s(CD_VIV_NMS_CYC) + REAL(wp) :: h, a, b, va(6), vm(6), vb(6), acc(3) + INTEGER :: j + CALL CD_VIV_Cycle_Init(s, [0.0_wp, 0.0_wp, 0.0_wp]) + h = TW/REAL(CD_VIV_CYC_NB, wp) + acc = 0.0_wp + s(3:5) = 0.0_wp + DO j = 2, CD_VIV_CYC_NB + 2 + b = -REAL(j - 2, wp)*h + a = b - h + va = signal(kind, a) + vm = signal(kind, 0.5_wp*(a + b)) + vb = signal(kind, b) + acc = acc - h*(va(1:3) + 4.0_wp*vm(1:3) + vb(1:3))/6.0_wp + s(3 + 3*(j - 1):5 + 3*(j - 1)) = acc/h + END DO + END SUBROUTINE prime + +END PROGRAM test_viv_cycle_frame diff --git a/tests/test_viv_frame_deck.f90 b/tests/test_viv_frame_deck.f90 index 98cd168..9e48d88 100644 --- a/tests/test_viv_frame_deck.f90 +++ b/tests/test_viv_frame_deck.f90 @@ -25,7 +25,15 @@ PROGRAM test_viv_frame_deck !! 0.5 %, measured at most 0.24 %, frequency within 0.005 Hz), on both cores, with and without !! the tables (an EI = 0 line cannot run between two moving points, so the towed case is !! finite-EI only); - !! G4 refusals by name: a VIV FRAME row on a type without VIV (no Cl, no WAKE OSCILLATOR row). + !! G4 refusals by name: a VIV FRAME row on a type without VIV (no Cl, no WAKE OSCILLATOR row); + !! G5 Method filter (the third column) is the row without it, bit for bit, on both cores; + !! G6 Method cycle (the cycle mean over the window Tf 3.5 s, one period of the 0.29 Hz response): + !! towed, the finite-EI cable responds as + !! the cable held in the current (A/D within 1 %, frequency within 0.005 Hz), and held in the + !! current it leaves the response as the ambient flow gives it (A/D within 0.5 %, frequency + !! within 0.005 Hz), on both cores, with the tables; + !! G7 refusals by name: an unknown Method, Method cycle with Tf 0 and a line whose types mix the + !! two methods. USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK IMPLICIT NONE @@ -46,6 +54,10 @@ PROGRAM test_viv_frame_deck CALL check_tow('vfd_tow', AMP, 'riser 0.31 0.89', fe_cur, fe_cur_tf, ' (tables)') CALL check_tow('vfd_tows', '', '', fs_cur, fs_cur_tf, ' (lift only)') CALL check_refusals() + CALL check_methods('1.0', AMP, 'riser 0.31 0.89', 'vfm_fe', fe_cur) + CALL check_methods('0.0', AMP, '', 'vfm_l', l_cur) + CALL check_cycle_tow(fe_cur) + CALL check_method_refusals() IF (nfail > 0) THEN WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' ERROR STOP 1 @@ -133,7 +145,7 @@ SUBROUTINE write_rows(u, title, header, rows) END DO END SUBROUTINE write_rows - SUBROUTINE write_deck(path, ei, amp_rows, damp_rows, tmax_, tow, frame_rows, cl) + SUBROUTINE write_deck(path, ei, amp_rows, damp_rows, tmax_, tow, frame_rows, cl, mix) !! ei the type's EI; amp_rows/damp_rows: the VIV AMPLITUDE and VIV DAMPING data rows, !! ';'-separated ('' for no section); tow: no current, both ends Coupled and moved by the motion !! file vfd_tow.txt; frame_rows: the VIV FRAME data rows (no section without it). @@ -141,10 +153,14 @@ SUBROUTINE write_deck(path, ei, amp_rows, damp_rows, tmax_, tow, frame_rows, cl) REAL(wp), INTENT(IN) :: tmax_ LOGICAL, INTENT(IN) :: tow CHARACTER(*), INTENT(IN), OPTIONAL :: frame_rows, cl + LOGICAL, INTENT(IN), OPTIONAL :: mix CHARACTER(8) :: cl_col INTEGER :: u + LOGICAL :: two cl_col = '0.8' IF (PRESENT(cl)) cl_col = cl + two = .FALSE. + IF (PRESENT(mix)) two = mix OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------' WRITE (u, '(A)') 'VIV FRAME deck gate: taut cable in a uniform current or towed through still water' @@ -152,6 +168,8 @@ SUBROUTINE write_deck(path, ei, amp_rows, damp_rows, tmax_, tow, frame_rows, cl) WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx Cl dF cF' WRITE (u, '(A)') 'riser 0.10 10.0 5.0e7 -0.8 '//ei//' 1.2 1.0 0.0 0.0 '//TRIM(cl_col)// & ' 0.08 0.18' + IF (two) WRITE (u, '(A)') 'riser2 0.10 10.0 5.0e7 -0.8 '//ei//' 1.2 1.0 0.0 0.0 '// & + TRIM(cl_col)//' 0.08 0.18' WRITE (u, '(A)') '----------------------- POINTS ----------------------------------------------' WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA' WRITE (u, '(A)') '1 Coupled 0.0 0.0 -50.0 0 0 0 0' @@ -165,10 +183,21 @@ SUBROUTINE write_deck(path, ei, amp_rows, damp_rows, tmax_, tow, frame_rows, cl) WRITE (u, '(A)') '1 1 2 -' WRITE (u, '(A)') '----------------------- SECTIONS --------------------------------------------' WRITE (u, '(A)') 'LineID LineType Length NumSegs' - WRITE (u, '(A)') '1 riser 99.900100 50' + IF (two) THEN + WRITE (u, '(A)') '1 riser 49.950050 25' + WRITE (u, '(A)') '1 riser2 49.950050 25' + ELSE + WRITE (u, '(A)') '1 riser 99.900100 50' + END IF IF (LEN_TRIM(amp_rows) > 0) CALL write_rows(u, 'VIV AMPLITUDE', 'TypeName AD Cv CdAmp', amp_rows) IF (LEN_TRIM(damp_rows) > 0) CALL write_rows(u, 'VIV DAMPING', 'TypeName a b', damp_rows) - IF (PRESENT(frame_rows)) CALL write_rows(u, 'VIV FRAME', 'TypeName Tf', frame_rows) + IF (PRESENT(frame_rows)) THEN + IF (INDEX(frame_rows, 'cycle') > 0 .OR. INDEX(frame_rows, 'filter') > 0 .OR. INDEX(frame_rows, 'bogus') > 0) THEN + CALL write_rows(u, 'VIV FRAME', 'TypeName Tf Method', frame_rows) + ELSE + CALL write_rows(u, 'VIV FRAME', 'TypeName Tf', frame_rows) + END IF + END IF WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------' WRITE (u, '(A)') '0.01 dtM' WRITE (u, '(A)') '100.0 WtrDpth' @@ -350,4 +379,66 @@ SUBROUTINE check_refusals() 'G4: a VIV FRAME row on a type without VIV is refused') END SUBROUTINE check_refusals + SUBROUTINE check_methods(ei, amp_rows, damp_rows, tag, ref) + !! G5 and G6 (held) on the cable of EI ei in the current: Method filter against the row without + !! it, and Method cycle against the ambient flow (ref: A/D, f without the section). + CHARACTER(*), INTENT(IN) :: ei, amp_rows, damp_rows, tag + REAL(wp), INTENT(IN) :: ref(2) + REAL(wp) :: r(2) + LOGICAL :: ok + CHARACTER(1024) :: msg + CHARACTER(:), ALLOCATABLE :: lab + lab = ' (EI '//ei//')' + CALL write_deck(tag//'_tf.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 10') + CALL run(tag//'_tf.dat', tag//'_tf', ok, msg) + CALL require(ok, 'G5: the deck with Tf 10 s runs'//lab//': '//TRIM(msg)) + CALL write_deck(tag//'_flt.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 10 filter') + CALL run(tag//'_flt.dat', tag//'_flt', ok, msg) + CALL require(ok, 'G5: the deck with Method filter runs'//lab//': '//TRIM(msg)) + CALL require(same_file(tag//'_tf.out', tag//'_flt.out'), 'G5: Method filter is the row without it, bit for bit'//lab) + CALL write_deck(tag//'_cyc.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 3.5 cycle') + CALL run(tag//'_cyc.dat', tag//'_cyc', ok, msg) + CALL require(ok, 'G6: the deck with Method cycle runs'//lab//': '//TRIM(msg)) + CALL stats(tag//'_cyc', r, ok) + CALL require(ok, 'G6: the cycle run wrote its rows'//lab) + WRITE (*, '(A,2F8.4,A,2F8.4)') 'G6'//lab//': in the current A/D, f [Hz] with Method cycle ', r, '; ambient ', ref + CALL require(ABS(r(1)/ref(1) - 1.0_wp) <= 0.005_wp .AND. ABS(r(2) - ref(2)) <= 0.005_wp, & + 'G6: held in the current, Method cycle leaves the response as the ambient flow gives it'//lab) + END SUBROUTINE check_methods + + SUBROUTINE check_cycle_tow(ref) + !! G6 (towed) on the finite-EI cable with the tables, Method cycle, against the cable held in the + !! current (ref). + REAL(wp), INTENT(IN) :: ref(2) + REAL(wp) :: r(2) + LOGICAL :: ok + CHARACTER(1024) :: msg + CALL write_deck('vfm_tow_cyc.dat', '1.0', AMP, 'riser 0.31 0.89', TMAX, .TRUE., frame_rows='riser 3.5 cycle') + CALL run('vfm_tow_cyc.dat', 'vfm_tow_cyc', ok, msg) + CALL require(ok, 'G6: the towed deck with Method cycle runs: '//TRIM(msg)) + CALL stats('vfm_tow_cyc', r, ok) + CALL require(ok, 'G6: the towed cycle run wrote its rows') + WRITE (*, '(A,2F8.4,A,2F8.4)') 'G6: towed A/D, f [Hz] with Method cycle ', r, '; held in the current ', ref + CALL require(ABS(r(1)/ref(1) - 1.0_wp) <= TOL_TOW .AND. ABS(r(2) - ref(2)) <= 0.005_wp, & + 'G6: towed with Method cycle, the cable responds as the cable held in the current') + END SUBROUTINE check_cycle_tow + + SUBROUTINE check_method_refusals() + LOGICAL :: ok + CHARACTER(1024) :: msg + CALL write_deck('vfm_bad1.dat', '1.0', '', '', 1.0_wp, .FALSE., frame_rows='riser 10 bogus') + CALL run('vfm_bad1.dat', 'vfm_bad1', ok, msg) + WRITE (*, '(A)') 'G7 an unknown Method: '//TRIM(msg) + CALL require(.NOT. ok .AND. INDEX(msg, 'Method must be filter or cycle') > 0, 'G7: an unknown Method is refused') + CALL write_deck('vfm_bad2.dat', '1.0', '', '', 1.0_wp, .FALSE., frame_rows='riser 0 cycle') + CALL run('vfm_bad2.dat', 'vfm_bad2', ok, msg) + WRITE (*, '(A)') 'G7 Method cycle with Tf 0: '//TRIM(msg) + CALL require(.NOT. ok .AND. INDEX(msg, 'with a window Tf > 0') > 0, 'G7: Method cycle with Tf 0 is refused') + CALL write_deck('vfm_bad3.dat', '1.0', '', '', 1.0_wp, .FALSE., frame_rows='riser 1 cycle;riser2 1 filter', & + mix=.TRUE.) + CALL run('vfm_bad3.dat', 'vfm_bad3', ok, msg) + WRITE (*, '(A)') 'G7 mixed methods: '//TRIM(msg) + CALL require(.NOT. ok .AND. INDEX(msg, 'mix the methods') > 0, 'G7: a line whose types mix the methods is refused') + END SUBROUTINE check_method_refusals + END PROGRAM test_viv_frame_deck diff --git a/tests/test_viv_wake_deck.f90 b/tests/test_viv_wake_deck.f90 index dece596..21211b7 100644 --- a/tests/test_viv_wake_deck.f90 +++ b/tests/test_viv_wake_deck.f90 @@ -28,8 +28,9 @@ PROGRAM test_viv_wake_deck !! fixed cable in the current with Tf 10 s locks in as without it (the filter removes the !! VIV velocity: A/D within 2 %, frequency within 0.002 Hz), on both cores, and the two !! cores agree there as in W5 (an EI = 0 line cannot run between two moving points); - !! W7 VIV FRAME refusals by name: a malformed row, an unknown or repeated type, - !! a negative Tf, and a type without VIV (no Cl, no WAKE OSCILLATOR row). + !! W7 VIV FRAME refusals by name: a malformed row, an unknown Method, Method cycle on a + !! wake-oscillator type, an unknown or repeated type, a negative Tf, and a type without VIV + !! (no Cl, no WAKE OSCILLATOR row). USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK IMPLICIT NONE @@ -411,8 +412,12 @@ END SUBROUTINE check_filter_fixed SUBROUTINE check_refusals() CALL refused('riser 0.3 0.2 0.3 12 1', 'TypeName CL0 [St [eps [A]]]', 'a row of six columns') - CALL refused('riser 0.3', 'VIV FRAME rows must be: TypeName Tf', 'W7: a VIV FRAME row of three columns', & + CALL refused('riser 0.3', 'VIV FRAME rows must be: TypeName Tf [Method]', 'W7: a VIV FRAME row of four columns', & + frame_rows='riser 10 cycle 1') + CALL refused('riser 0.3', 'VIV FRAME Method must be filter or cycle', 'W7: a VIV FRAME row with an unknown Method', & frame_rows='riser 10 1') + CALL refused('riser 0.3', 'acts on the synchronisation model', 'W7: Method cycle on a wake-oscillator type', & + frame_rows='riser 10 cycle') CALL refused('riser 0.3', 'VIV FRAME row names undefined LINE TYPE', 'W7: an unknown type', & frame_rows='cable 10') CALL refused('riser 0.3', 'VIV FRAME names LINE TYPE', 'W7: a repeated type', frame_rows='riser 10;riser 5') From cafdc22b5c56723bef2baec6dcb568a551e02d68 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 20 Nov 2026 15:28:06 +0900 Subject: [PATCH 2/4] fix: keep the cycle-mean sample time in [0, h] at round-off A sample landing on the step end (window 1 s, steps of 0.01 s) could round the time since the latest sample a few ulps below 0, a valid simulation state that CD_VIV_Cycle_Valid then refused on a checkpoint restore. The update now clamps it to [0, h]; viv_cycle_frame C5 runs 10000 such steps and checks the state stays valid. Signed-off-by: Jae Hoon Seo --- src/CableDyn_VIV.f90 | 4 +++- tests/test_viv_cycle_frame.f90 | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/CableDyn_VIV.f90 b/src/CableDyn_VIV.f90 index d9be6a2..b69b857 100644 --- a/src/CableDyn_VIV.f90 +++ b/src/CableDyn_VIV.f90 @@ -791,7 +791,9 @@ PURE SUBROUTINE CD_VIV_Cycle_Update(st, v0, v1, dt, tw, vs) st(3 + 3*(latest - 1):5 + 3*(latest - 1)) = is s = s + h END DO - tau = dt - (s - h) + ! the time since the latest sample, in [0, h]: at a sample landing on the step end the + ! difference can round to a few ulps below 0 (Tf 1 s, dt 0.01 s), which must stay a valid state + tau = MIN(MAX(dt - (s - h), CD_ZERO), h) st(1) = tau/h st(2) = REAL(latest, wp) ! t - T lies x = NB - tau/h sample intervals before the latest sample, x in (NB - 1, NB]: the diff --git a/tests/test_viv_cycle_frame.f90 b/tests/test_viv_cycle_frame.f90 index eb917d8..403ba8c 100644 --- a/tests/test_viv_cycle_frame.f90 +++ b/tests/test_viv_cycle_frame.f90 @@ -16,8 +16,9 @@ PROGRAM test_viv_cycle_frame !! * C4 C2 and C3 hold for steps longer than a sample interval (dt = 1.7 T/NB) and for a step that !! does not divide T; !! * C5 a node at rest at v0 (Init) gives vbar = v0 at once; the state stays valid - !! (CD_VIV_Cycle_Valid) over a long run, and a state with a sample time outside [0, 1] or a - !! slot off the ring is invalid. + !! (CD_VIV_Cycle_Valid) over a long run, also where samples land on step ends (window 1 s, + !! steps of 0.01 s), and a state with a sample time outside [0, 1] or a slot off the ring is + !! invalid. USE CableDyn_Precision, ONLY: wp USE CableDyn_VIV, ONLY: CD_VIV_Cycle_Init, CD_VIV_Cycle_Update, CD_VIV_Cycle_Valid, CD_VIV_NMS_CYC, CD_VIV_CYC_NB IMPLICIT NONE @@ -52,6 +53,21 @@ PROGRAM test_viv_cycle_frame err = run_case(3, 1.7_wp*TW/REAL(CD_VIV_CYC_NB, wp)) CALL require(err <= 1.0_wp, 'C4: the quadratic error holds with steps longer than a sample interval') + ! C5 a sample landing on a step end (window 1 s, steps of 0.01 s, the 25th step rounded the + ! sample time a few ulps below 0) keeps the state valid over many windows + BLOCK + INTEGER :: k + LOGICAL :: all_ok + CALL CD_VIV_Cycle_Init(st, [0.1_wp, 0.0_wp, 0.0_wp]) + all_ok = .TRUE. + DO k = 1, 10000 + CALL CD_VIV_Cycle_Update(st, [0.1_wp, 0.0_wp, 0.0_wp], [0.1_wp, 0.0_wp, 0.0_wp], 0.01_wp, 1.0_wp, vs) + all_ok = all_ok .AND. CD_VIV_Cycle_Valid(st) .AND. st(1) >= 0.0_wp + END DO + CALL require(all_ok, 'C5: samples on step ends keep a valid state (window 1 s, dt 0.01 s)') + CALL require(MAXVAL(ABS(vs - [0.1_wp, 0.0_wp, 0.0_wp])) <= 1.0e-12_wp, 'C5: and the constant velocity') + END BLOCK + ! C5 validity CALL CD_VIV_Cycle_Init(st, [0.0_wp, 0.0_wp, 0.0_wp]) CALL require(CD_VIV_Cycle_Valid(st), 'C5: the initial state is valid') From 67b03cbca5abd2f3b76a3bfc9d4a7ff7bd0b814e Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 20 Nov 2026 15:53:17 +0900 Subject: [PATCH 3/4] fix: type arguments of the VIV FRAME check's section map mypy (Python 3.10 target) wants dict[str, list[str]] for the map of a line's section types that the line-wide method check takes. Signed-off-by: Jae Hoon Seo --- python/cabledyn/deck_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 33b6d9c..14be159 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -3397,7 +3397,7 @@ def _check_viv_frame_section( self, frame_type_names: set[str], lift_type_names: set[str] | None = None, - section_types_by_line: dict | None = None, + section_types_by_line: dict[str, list[str]] | None = None, ) -> None: """Native ``apply_type_viv_frame`` and ``deck_line_frame_cycle`` for the VIV FRAME section. From 683694e0c974e0fc660c62e979863bbc32a47935 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 20 Nov 2026 16:06:48 +0900 Subject: [PATCH 4/4] style: split two test lines over the 120-character format limit fprettify (the CI format gate, line length 120) re-indented them; the calls are split instead. Signed-off-by: Jae Hoon Seo --- tests/test_viv_frame_deck.f90 | 3 ++- tests/test_viv_wake_deck.f90 | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_viv_frame_deck.f90 b/tests/test_viv_frame_deck.f90 index 9e48d88..a510dc1 100644 --- a/tests/test_viv_frame_deck.f90 +++ b/tests/test_viv_frame_deck.f90 @@ -395,7 +395,8 @@ SUBROUTINE check_methods(ei, amp_rows, damp_rows, tag, ref) CALL write_deck(tag//'_flt.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 10 filter') CALL run(tag//'_flt.dat', tag//'_flt', ok, msg) CALL require(ok, 'G5: the deck with Method filter runs'//lab//': '//TRIM(msg)) - CALL require(same_file(tag//'_tf.out', tag//'_flt.out'), 'G5: Method filter is the row without it, bit for bit'//lab) + CALL require(same_file(tag//'_tf.out', tag//'_flt.out'), & + 'G5: Method filter is the row without it, bit for bit'//lab) CALL write_deck(tag//'_cyc.dat', ei, amp_rows, damp_rows, TMAX, .FALSE., frame_rows='riser 3.5 cycle') CALL run(tag//'_cyc.dat', tag//'_cyc', ok, msg) CALL require(ok, 'G6: the deck with Method cycle runs'//lab//': '//TRIM(msg)) diff --git a/tests/test_viv_wake_deck.f90 b/tests/test_viv_wake_deck.f90 index 21211b7..5bccad0 100644 --- a/tests/test_viv_wake_deck.f90 +++ b/tests/test_viv_wake_deck.f90 @@ -414,8 +414,8 @@ SUBROUTINE check_refusals() CALL refused('riser 0.3 0.2 0.3 12 1', 'TypeName CL0 [St [eps [A]]]', 'a row of six columns') CALL refused('riser 0.3', 'VIV FRAME rows must be: TypeName Tf [Method]', 'W7: a VIV FRAME row of four columns', & frame_rows='riser 10 cycle 1') - CALL refused('riser 0.3', 'VIV FRAME Method must be filter or cycle', 'W7: a VIV FRAME row with an unknown Method', & - frame_rows='riser 10 1') + CALL refused('riser 0.3', 'VIV FRAME Method must be filter or cycle', & + 'W7: a VIV FRAME row with an unknown Method', frame_rows='riser 10 1') CALL refused('riser 0.3', 'acts on the synchronisation model', 'W7: Method cycle on a wake-oscillator type', & frame_rows='riser 10 cycle') CALL refused('riser 0.3', 'VIV FRAME row names undefined LINE TYPE', 'W7: an unknown type', &